Use yearly ERA5 DATM files - #147
Open
ezhilsabareesh8 wants to merge 3 commits into
Open
Conversation
anton-seaice
left a comment
Contributor
There was a problem hiding this comment.
is it intentional to remove support for RYF ?
| # Use the first source variable for RYF file naming. | ||
| driver_src_var = datavar_pairs[0][0] | ||
|
|
||
| for year in range(year_first, year_last + 1): |
Contributor
There was a problem hiding this comment.
Probably more robust to get the file names from the actual files,
e.g. something like:
from glob import glob
from pathlib import Path
root_dir = Path(f'/g/data/rt52/era5/single-levels/reanalysis/{era5_prefix}')
files = glob(f"**/{era5_prefix}_era5_oper_sfc_{year}*.nc", root_dir=dir, recursive=True)
files.sort()
for f in files:
file_element = SubElement(datafiles, "file")
file_element.text = f
(untested)
root_dir needs to be set to whereever the source data is
Contributor
There was a problem hiding this comment.
This means the code should needn't changing when the dataset is extended
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Update
generate_xml_datm_era5.pyto generate yearly ERA5 DATM file paths instead of monthly paths.The XML now expects payu-staged files like:
./INPUT/{stream}/{stream}_era5_oper_sfc_YYYY0101-YYYY1231.ncand handles partial 2026 as:
./INPUT/{stream}/{stream}_era5_oper_sfc_20260101-20260331.nc