Enable EAMxx CMORization, E3SM Diags and add ts-level vertical regrid#827
Enable EAMxx CMORization, E3SM Diags and add ts-level vertical regrid#827chengzhuzhang wants to merge 11 commits into
Conversation
Closes #820: replace fragile input_files.split(".") gate in e3sm_to_cmip.bash with a prc_typ-based check that honors input_component override (e.g. EAMxx runs with input_files="AVERAGE.nmonths_x1"). Addresses #817: add EAMxx-specific ncremap flags (--ps_nm=${file}/ps, --vrt_in=vert_L128.nc) when prc_typ == 'eamxx', auto-defaulted from diagnostics_base_path. New additive [ts] vert_remap_vars path produces a sibling ts_vert_remap/ directory alongside ts/, so users can use native-level and pressure-level data simultaneously. e3sm_to_cmip.bash auto-detects ts_vert_remap/ files (via readlink) and skips redundant inline regrid. Files changed: - zppy/defaults/default.ini: new [ts] vert_remap_vars, vrt_remap_file, vrt_in_file; new [e3sm_to_cmip] vrt_in_file - zppy/templates/ts.bash: post-ncclimo vert remap block - zppy/ts.py: path defaults for vrt_remap_file / vrt_in_file - zppy/templates/e3sm_to_cmip.bash: prc_typ gate, EAMxx flags, ts_vert_remap consumption - zppy/e3sm_to_cmip.py: EAMxx vrt_in_file default - examples/post.v3.eamxx.e3sm_to_cmip.cfg: example based on issue #820 Legacy [e3sm_to_cmip] interp_vars path is preserved unchanged for backward compatibility. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Renames examples/post.v3.eamxx.e3sm_to_cmip.cfg to post.v3.eamxx.cfg and merges in climo, additional ts subsections, e3sm_to_cmip land_monthly, and e3sm_diags tasks. Contributed by Shixuan Zhang. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A prior run replaces the symlink in place via mv ${file}.plev ${file},
so on re-run the file is a real plev file with no lev/ilev dim and
ncremap fails. Bail out early when the file is no longer a symlink.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The web publish path used the subsection-resolved ${case}, which for
EAMxx cfgs that override case in [climo]/[[atm_monthly_180x360_aave]]
(to match the ncclimo input filename prefix, e.g. "1ma_ne30pg2") would
land under that short prefix instead of the canonical [default] case
name. Snapshot config["default"]["case"] into c["default_case"] and use
it for web_dir so file-prefix overrides no longer reroute publishing.
Climo file-prefix lookups and param.test_name still use the subsection
case, so file discovery is unchanged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Enables EAMxx CMORization and e3sm_diags pipelines end-to-end, replaces the fragile input_files-prefix gate before vertical interpolation with a prc_typ-based gate, and adds an opt-in [ts] vertical-regrid path that writes pressure-level files to a sibling ts_vert_remap/ directory which e3sm_to_cmip then auto-detects to avoid redundant regridding.
Changes:
- Replace fragile
input_files.split(".")[0]gate withprc_typ in ('cam','eam','eamxx'); emit EAMxx-specificncremapflags (--ps_nm,--vrt_in) whenprc_typ=='eamxx'; auto-skip vars already vert-remapped by[ts]. - Add
[ts]parametersvert_remap_vars/vrt_remap_file/vrt_in_filewith EAMxx defaults underdiagnostics_base_path, and[ts]template logic to produce a parallelts_vert_remap/output tree. - Switch
e3sm_diagsweb publish path to${www}/{{ default_case }}/...(decoupled from subsectioncaseoverrides) and addexamples/post.v3.eamxx.cfg.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| zppy/templates/e3sm_to_cmip.bash | New prc_typ gate, ts_vert_remap symlink overlay, readlink-based skip, and EAMxx ncremap flags. |
| zppy/templates/ts.bash | New optional vertical regrid loop producing output_plev/ and ts_vert_remap/ sibling destination. |
| zppy/templates/e3sm_diags.bash | web_dir now uses {{ default_case }} instead of subsection ${case}. |
| zppy/ts.py | Defaults for new vrt_remap_file/vrt_in_file when vert_remap_vars is set. |
| zppy/e3sm_to_cmip.py | EAMxx-only default for vrt_in_file. |
| zppy/e3sm_diags.py | Propagates config['default']['case'] as default_case for the bash template. |
| zppy/defaults/default.ini | Declares new [ts] and [e3sm_to_cmip] parameters (and __many__ overrides). |
| tests/test_sections.py | Adds new params to expected section/subsection dicts. |
| examples/post.v3.eamxx.cfg | New end-to-end EAMxx example (climo, ts, e3sm_to_cmip, e3sm_diags). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@zhangshixuan1987 this PR should enable cmorization and e3sm Diags (except dirunal cycle and TC sets) for eamxx. I needed to make changes to both zppy and your example cfg file to make things work. Could you review: https://github.com/E3SM-Project/zppy/blob/f61b71a1980b8800daa095d0f7764b563083da55/examples/post.v3.eamxx.cfg. and let me know if it looks okay? e3sm_digas results can be find here. There was an issue for start and end year for Wheeler Kiladis, I will have a rerun to create it. |
|
@zhangshixuan1987 #830 should already be taken care of by this PR, without needing to add additional parameters. |
@chengzhuzhang Then we can forget about the #830 |
|
I realized that more work needed for eamxx daily output |
Hi @chengzhuzhang, I think the cfg file looks consistent with what I have on my local use. Below are some of my comments for your reference:
All other parts look reasonable to me. Thank you @chengzhuzhang for merging this cfg example. |
Summary
Objectives:
input_files.split(".")[0]gate ine3sm_to_cmip.bashthatexcluded EAMxx runs whose
input_filesdoesn't start withcam/eam/eamxx(e.g.
input_files = "AVERAGE.nmonths_x1"withinput_component = "eamxx").Replaced with a
prc_typ-based gate that honorsinput_component. Fix [Bug]: fragile component detection before vertical interpolation #820--ps_nm=${file}/ps,--vrt_in=<L128>)inside the e3sm_to_cmip vertical interpolation block, auto-emitted when
prc_typ == 'eamxx'.vrt_in_filedefaults under{diagnostics_base_path}/e3sm_to_cmip_data/grids/vert_L128.nc.[ts]parametersvert_remap_vars,vrt_remap_file,vrt_in_file: when set, thetstaskalso writes vertically remapped files to a sibling directory
post/{component}/{grid}/ts_vert_remap/{frequency}/{ypf}yr/alongsidets/,so users can use native-level and pressure-level data simultaneously.
e3sm_to_cmip.bashto auto-detectts_vert_remap/files (viareadlinkon the input symlinks) and skip its inline regrid for those vars,avoiding redundant work.
examples/post.v3.eamxx.cfgdemonstrating the EAMxx pipeline end-to-end(climo, ts, e3sm_to_cmip, e3sm_diags). Contributed by @zhangshixuan1987
Issue resolution:
Select one: This pull request is...
Please fill out either the "Small Change" or "Big Change" section (the latter includes the numbered subsections), and delete the other.
Small Change
Big Change
1. Does this do what we want it to do?
Required:
If applicable:
2. Are the implementation details accurate & efficient?
Required:
If applicable:
zppy/conda, not just animportstatement.3. Is this well documented?
Required:
4. Is this code clean?
Required:
If applicable: