Allow run_set creation with non-standard forcing file names #487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 modifiesnnu.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).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).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
is_date_in_forcing_filename
defaults toTrue