Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow run_set creation with non-standard forcing file names #487

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

awlostowski-noaa
Copy link
Contributor

@awlostowski-noaa awlostowski-noaa commented Oct 27, 2021

The implicit run_set creation capability is currently customized to work with forcing files (channel route out files) of a standard naming convention: YYYYMMDDHHMM.CHRTOUT_DOMAIN1. This pull request modifies nnu.build_forcing_sets such that the set creation processes works with other filenames that may not contain 12-digit date codes, or when globbed and sorted, may not necessarily be in chronological simulation order.

At the root of this change is a new (optional) user input parameter named is_date_in_forcing_filename (logical). This parameter is only required if implicit run set creation is requested (along the V3 execution pathway).

  • If is_date_in_forcing_filename == True, then the forcing filenames with a 12-digit datetime code are expected to appear somewhere in forcing filenames (specifically, YYYYMMDDHHMM).
  • If is_date_in_forcing_filename == False, then no assumptions are made about filenames and we do not expect a globbed and sorted forcing file list to necessarily be in chronological simulation order. The simulation datetimes of each forcing file in the forcing directory are directly observed by evaluating the NetCDF file attribute, model_output_valid_time
  • If not specified, then is_date_in_forcing_filename defaults to True

@awlostowski-noaa
Copy link
Contributor Author

awlostowski-noaa commented Oct 27, 2021

Testing

conventional forcing filenames, is_date_in_forcing_filename == True:

[{'qlat_files': [
'201809080100.CHRTOUT_DOMAIN1', '201809080200.CHRTOUT_DOMAIN1', '201809080300.CHRTOUT_DOMAIN1', 
'201809080400.CHRTOUT_DOMAIN1', '201809080500.CHRTOUT_DOMAIN1', '201809080600.CHRTOUT_DOMAIN1', 
'201809080700.CHRTOUT_DOMAIN1', '201809080800.CHRTOUT_DOMAIN1', '201809080900.CHRTOUT_DOMAIN1',
'201809081000.CHRTOUT_DOMAIN1', '201809081100.CHRTOUT_DOMAIN1', '201809081200.CHRTOUT_DOMAIN1'
], 
'nts': 144, 'final_timestamp': datetime.datetime(2018, 9, 8, 12, 0)}]
  • The same results is obtained if is_date_in_forcing_filename == False, thought it takes longer.

(UN)conventional forcing filenames, is_date_in_forcing_filename == False:

[{'qlat_files': [
'nwm.t16z.analysis_assim_extend.channel_rt.tm27.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm26.conus.nc',
'nwm.t16z.analysis_assim_extend.channel_rt.tm25.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm24.conus.nc',
'nwm.t16z.analysis_assim_extend.channel_rt.tm23.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm22.conus.nc',
'nwm.t16z.analysis_assim_extend.channel_rt.tm21.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm20.conus.nc',
'nwm.t16z.analysis_assim_extend.channel_rt.tm19.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm18.conus.nc',
'nwm.t16z.analysis_assim_extend.channel_rt.tm17.conus.nc', 'nwm.t16z.analysis_assim_extend.channel_rt.tm16.conus.nc'
],
'nts': 144, 'final_timestamp': datetime.datetime(2021, 10, 21, 0, 0)}]

@awlostowski-noaa awlostowski-noaa marked this pull request as draft October 28, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant