Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize time metadata (we will mark this as the release tag for ctsm5.3) #2052

Open
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

samsrabin
Copy link
Collaborator

@samsrabin samsrabin commented Jul 11, 2023

Description of changes

Standardizes a dimension name of output variable time_bounds (from hist_interval to nbnd), as well as attributes for that plus mcdate, mcsec, mdcur, and mscur.

Specific notes

Contributors other than yourself: @billsacks, @ekluzek

CTSM Issues Fixed: Resolves #1693.

Are answers expected to change (and if so in what way)? No.

Any User Interface Changes (namelist or namelist defaults changes)? No.

Testing performed

New metadata in a history file from a short test:

netcdf standardize-time-metadata_rtm.clm2.h0.1850-01-01-00000 {
dimensions:
...
    nbnd = 2 ;
...
variables:
...
    int mcdate(time) ;
        ...
        mcdate:calendar = "noleap" ;
    int mcsec(time) ;
        ...
        mcsec:calendar = "noleap" ;
    int mdcur(time) ;
        ...
        mdcur:calendar = "noleap" ;
    int mscur(time) ;
        ...
        mscur:calendar = "noleap" ;
...
    double time_bounds(time, nbnd) ;
        time_bounds:long_name = "time interval endpoints" ;
        time_bounds:units = "days since 1850-01-01 00:00:00" ;
        time_bounds:calendar = "noleap" ;

All aux_clm tests pass bit-for-bit against ctsm5.1.dev131, except for expected failures.

@samsrabin samsrabin added blocked: dependency Wait to work on this until dependency is resolved next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Jul 11, 2023
@samsrabin samsrabin self-assigned this Jul 11, 2023
@samsrabin
Copy link
Collaborator Author

samsrabin commented Jul 11, 2023

Marked as blocked:dependency because, at the moment, Externals.cfg points to branches of my personal MOSART (issue ESCOMP/MOSART#53) and RTM (issue ESCOMP/RTM#31) forks that contain the same changes. I haven't yet submitted those as pull requests, because I first wanted to see if any more testing is requested.

UPDATE
PRs ESCOMP/MOSART#66 and ESCOMP/RTM#35

@samsrabin samsrabin added tag: simple bfb and removed next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Jul 13, 2023
Enable prescribed crop calendars

This branch enables CLM to read in externally-prescribed crop sowing dates and "cultivar" maturity requirements (growing degree-days, GDDs). This has so far only been tested with static values, and the results indicate that yield performance is worsened. However, this capability is required by the GGCMI phase 3 / ISIMIP3 Agriculture protocol.

Briefly, the way this works is that an offline run is first performed with prescribed sowing dates and 364-day seasons. Instantaneous GDD accumulation is saved daily. A Python script then cross-references those daily outputs with a map of mean sowing dates to determine the mean accumulated GDDs in the growing season, saving the result as a file for use as prescribed maturity requirements.
@samsrabin
Copy link
Collaborator Author

From CTSM software engineering meeting today: This doesn't need to wait on other time-related PRs. It can come in as soon as the relevant externals are updated (and Externals.cfg here is changed to point to them).

olyson and others added 3 commits November 1, 2023 15:39
Add sowing window input files

Previously, one could run crops with either (a) sowing windows defined by the hemisphere-specific start and end dates on the paramfile or (b) prescribed sowing dates specified by input file stream_fldFileName_sdate. This PR replaces the latter with two new input files, stream_fldFileName_swindow_start and stream_fldFileName_swindow_end.
@slevis-lmwg slevis-lmwg changed the base branch from b4b-dev to master November 19, 2024 23:13
slevis resolved conflicts:
Externals.cfg
src/main/histFileMod.F90
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Nov 20, 2024

Testing includes all three "history" PRs (this one, #2084, #2838) and their mosart/rtm counterparts:

derecho
PASS build-namelist_test.pl
PASS python testing

PASS ./run_sys_tests -s rtm -c rtm1_0_83-ctsm5.3.012_zerothtstep -g rtm1_0_83-ctsm5.3.012_zeroth+stdize_tmeta
OK ./run_sys_tests -s mosart -c mosart1.1.05-ctsm5.3.012_zerothtstep -g mosart1.1.05-ctsm5.3.012_zeroth+stdize_tmeta
OK ./run_sys_tests -s aux_clm -c ctsm5.3.012_zerothtstep -g ctsm5.3.012_zeroth+stdize_tmeta

DIFF ERI_D.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningModeLDust variable DPFCT_ROCK
...same diff in cprnc.out as in base.cprnc.out from this PR.
Explanation:

  1. This diff from the baseline comes from comparing the .rest files, and the restart comparison failed in the baseline. The test does not differ from the baseline when comparing the .base files. So the issue to resolve is not this failure but the restart comparison in the baseline.
  2. Also the restart comparison passed here, so the restart comparison failure in the baseline may not be critical to solve, as there is no sign of anything else being affected.

izumi

PASS ./run_sys_tests -s mosart -c mosart1.1.05_ctsm5.3.012_zerothtstep -g mosart1.1.05_ctsm5.3.012_zeroth+stdize_tmeta
OK ./run_sys_tests -s aux_clm -c ctsm5.3.012_zerothtstep -g ctsm5.3.012_zeroth+stdize_tmeta

@ekluzek ekluzek changed the title Standardize time metadata Standardize time metadata (we will mark this as the release tag for ctsm5.3) Nov 21, 2024
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Nov 22, 2024

I updated my copy of this branch and its rtm/mosart counterparts with the changes from this commit
eeedbc6
and submitted
./create_test RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput
to see if we need to worry about the failure that I got in this test today in #2838. See follow-up below.

Also
./create_test ERI_D.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningModeLDust -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.012
to see if we need to worry about the restart diffs that I got in the zerothtstep branch. Other diffs are expected in this comparison, same as in the zerothtstep comparison I think. CONFIRMED: Yes, diffs from baseline; no diffs in restart.

@slevis-lmwg
Copy link
Contributor

@samsrabin I confirmed that RXCROPMATURITYSKIPGEN_Ld1097 fails with a legit error, due to the updated if-statement that we discussed yesterday from what I can tell. The error I see says:
RuntimeError: Expected 2 timesteps in output but got 1
See here:
/glade/derecho/scratch/slevis/RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput.20241121_195614_ddlohd

@samsrabin
Copy link
Collaborator Author

Okay, I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfb bit-for-bit blocked: dependency Wait to work on this until dependency is resolved external issue needs to be addressed elsewhere (submodule); issue here for the sake of project tracking good first issue simple; good for first-time contributors PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete
Projects
Status: In progress - master/b4b-dev
Development

Successfully merging this pull request may close these issues.

Modify naming and attributes of time variables on history files to be consistent with other CESM components
5 participants