Repository navigation
new end-to-end workflow and better handling of input arguments to gen_timeseries and cmor_driver - #126
Conversation
…ocabulary) validation
…y the help messages for gen_timeseries and cmor_driver to make the required arguments explicit
maritsandstad
left a comment
There was a problem hiding this comment.
All good just have a couple of questions, probably this can just go in.
| logger = logging.getLogger("run_reference_case") | ||
|
|
||
|
|
||
| def parse_arguments(): |
There was a problem hiding this comment.
Eventually, I think we would want to send the
case.add_argument(
"--realization-initialization-physics-forcing",
type=str,
default="r1i1p1f1",
help="Variant indices in the format rXiYpZfW (default: r1i1p1f1)",
)
which cmor driver adds here, so you could also use this harness to run the full cmorisation (not just for testing). There might be other options like that which we want to include for that, but that is at least one.
There was a problem hiding this comment.
I have added this to the workflow - and modified the cmor_driver argument:
--variant-label rXiYpZfW, --realization-initialization-physics-forcing rXiYpZfW
Ensemble member this output belongs to: realization, initialization, physics and forcing indices, e.g. r1i1p1f1. This is the CMIP variant_label, and appears in the output paths and file names. The longer spelling is accepted as an alias. (default: r1i1p1f1)
I think we want this capability to not only do testing by also the full cmorisation workflow - which should be in place with this PR.
There was a problem hiding this comment.
This is very good, but I wonder how much it will conflict with my current PR for the grids, might need to rehash that for this...
There was a problem hiding this comment.
Maybe it actually matches up quite well...don't know yet...
|
@maritsandstad - I am trying to test this on the current run n1850GaxgGHG.LM.nor30b25.528.20260928 - using 2 years of data from it. I want to make sure everything works before I modify the draft status. |
new end-to-end workflow
scripts/run_reference_case.pyWith this new script a output from a coupled run can be processed and checked end-to-end. The script runs gen_timeseries, cmor_driver and validate_cmor_output for every realm of a target archived case. A table is then printed with a summary of what worked.
This script does the following:
--dry-runprints the commands without running them)restartability
One requirement of an end-to-end workflow is that if you interrupt it or there is an error - you can resume without starting back from the beginning. Repeating the same command now continues where it stopped via the following:
<outdir>/completed_steps.json, and a repeated run skips those. So if a run dies partway through, rerunning it picks up at the next unfinished step.gen_timeseries.pynow keeps existing output and produces only the timesteps that are missing, rather than rewriting everything. So even a step that was interrupted midway resumes rather thanrepeating its work.
--forceruns everything again and rewrites existing time series.updated arguments to gen_timeseries.py and cmor_driver.py
Both of these scripts had long flat option lists with defaults on most options. Options are now grouped in
--helpunder "required arguments" and a few plainer headings, and the ones describing the case must be given.gen_timeseries.py--modelcesm--realmcmor_driver.py--model,--realm,--frequency,--experiment--tsdir--resolution--atmos-res, and only where it applies--caseroot,--cimeroot--versionThe input grid is now worked out from the model and the realm, so sea-ice data
can no longer be put through atmosphere weight files by mistake.
--atmos-resis only needed for the atmospheric and land realms; the others derive their own.
other additions
--ocn-static-filenow applies only where it is used, and says when it is being ignoredWhat you will need to change
Existing commands that relied on the defaults need the values spelled out:
Anyone who used
--caseroot/--cimerootto locate time series now passes--tsdirdirectly. That path was<DOUT_S_ROOT>/<component>/proc/tseries/<frequency>.Drafted with Claude Code.