Update archive script to handle new ocean output#69
Update archive script to handle new ocean output#69kieranricardo wants to merge 2 commits intomainfrom
Conversation
blimlim
left a comment
There was a problem hiding this comment.
Thanks @kieranricardo! Really glad that this makes the ocean file processing a lot simpler. I've just added a few comments around unneeded functions that can also be removed
| return f"{len(non_time_dims)}d" | ||
|
|
||
|
|
||
| def get_frequency(times): |
There was a problem hiding this comment.
Should be safe to delete this function as it's not used anymore
| return frequency | ||
|
|
||
|
|
||
| def check_year(year, da_years): |
There was a problem hiding this comment.
Should be safe to delete this one too
| return ("scalar_axis" in dims) | ||
|
|
||
|
|
||
| def get_ndims(dims): |
There was a problem hiding this comment.
Should be safe to delete the get_ndims function
| ) | ||
|
|
||
|
|
||
| def set_scalar_name(ds, scalar_vars, frequency, year): |
There was a problem hiding this comment.
Should be safe to delete this one
| ) | ||
|
|
||
|
|
||
| def parse_cell_methods(methods_string): |
There was a problem hiding this comment.
Should be safe to delete this one too
| dataset.load().to_netcdf(out_filepath) | ||
|
|
||
|
|
||
| def is_scalar_var(dims): |
There was a problem hiding this comment.
I think this one can go too
| return name | ||
|
|
||
|
|
||
| def set_ocn_file_name(ndims, |
There was a problem hiding this comment.
This one can be deleted too
This updates the archiving script to handle the new ocean output (single variable files).
Note that a typo in the suite cause the ocean files to be saved as
om3_...in stead ofcm3_..., to handle thisom3andcm3are searched for in the file regex, andom3is replaced withcm3in the output filenames.Example output here:
/g/data/zv30/non-cmip/ACCESS-CM3/cm3-run-20-01-2026-om3-update