Skip to content

Commit 2f6b129

Browse files
authored
Merge pull request #2084 from olyson/zerothtstep
ctsm5.3.019: Stop running 0th time step
2 parents fb89f33 + 71e56b9 commit 2f6b129

15 files changed

Lines changed: 354 additions & 288 deletions

File tree

doc/ChangeLog

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,106 @@
11
===============================================================
2+
Tag name: ctsm5.3.019
3+
Originator(s): olyson (Keith Oleson, UCAR/TSS)
4+
Date: Tue 14 Jan 2025 02:46:11 PM MST
5+
One-line Summary: Stop running 0th time step
6+
7+
Purpose and description of changes
8+
----------------------------------
9+
As with the last tag, this is also for consistency with CAM.
10+
11+
Contributors
12+
------------
13+
Bill Sacks. In the final steps, also slevis.
14+
15+
Significant changes to scientifically-supported configurations
16+
--------------------------------------------------------------
17+
18+
Does this tag change answers significantly for any of the following physics configurations?
19+
(Details of any changes will be given in the "Answer changes" section below.)
20+
21+
[Put an [X] in the box for any configuration with significant answer changes.]
22+
23+
[ ] clm6_0
24+
25+
[ ] clm5_0
26+
27+
[ ] ctsm5_0-nwp
28+
29+
[ ] clm4_5
30+
31+
32+
Bugs fixed
33+
----------
34+
List of CTSM issues fixed (include CTSM Issue # and description) [one per line]:
35+
Fixes #925
36+
37+
Notes of particular relevance for developers:
38+
---------------------------------------------
39+
Caveats for developers (e.g., code that is duplicated that requires double maintenance):
40+
Same or similar changes needed separately in clm, in mosart, and in rtm.
41+
42+
Changes to tests or testing:
43+
FAIL RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput RUN
44+
I did not label this failure EXPECTED because the fix is planned for the next tag, ctsm5.3.020.
45+
46+
I resolved the izumi nag tests that failed to build (due to a bug in rtm and mosart) by introducing the bug-fix manually, as explained here:
47+
https://github.com/ESCOMP/CTSM/pull/2084#issuecomment-2584164690
48+
In ctsm5.3.020 we plan to update to the rtm/mosart tags that include the fix.
49+
50+
Testing summary:
51+
----------------
52+
53+
[PASS means all tests PASS; OK means tests PASS other than expected fails.]
54+
55+
build-namelist tests (if CLMBuildNamelist.pm has changed):
56+
57+
derecho - PASS
58+
59+
python testing (if python code has changed; see instructions in python/README.md; document testing done):
60+
61+
derecho - PASS
62+
63+
regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
64+
65+
derecho ----- OK
66+
izumi ------- OK
67+
68+
mosart
69+
derecho ----- OK
70+
izumi ------- OK
71+
72+
rtm
73+
derecho ----- OK
74+
75+
If the tag used for baseline comparisons was NOT the previous tag, note that here:
76+
I repeated the rtm & mosart test-suites with mosart1.1.04 instead of 06 and rtm1_0_82 instead of 84 (all else the same) and compared against the new baselines mosart1.1.06-ctsm5.3.019 and rtm1_0_84-ctsm5.3.019. These gave b4b identical answers.
77+
78+
Answer changes
79+
--------------
80+
81+
Changes answers relative to baseline: Yes
82+
83+
Summarize any changes to answers, i.e.,
84+
- what code configurations: All
85+
- what platforms/compilers: All
86+
- nature of change: larger than roundoff/same climate
87+
88+
Caveat: We see diffs in mosart and cpl output that will be eliminated in ctsm5.3.020. They are discussed here:
89+
https://github.com/ESCOMP/CTSM/pull/2838#issuecomment-2477608383
90+
https://github.com/ESCOMP/MOSART/issues/103#issuecomment-2479679014
91+
92+
Other details
93+
-------------
94+
List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
95+
rtm and mosart were already updated in the previous tag (ctsm5.3.018) to include the corresponding rtm and mosart tags
96+
97+
Pull Requests that document the changes (include PR ids):
98+
https://github.com/ESCOMP/ctsm/pull/2084
99+
https://github.com/ESCOMP/MOSART/pull/67
100+
https://github.com/ESCOMP/RTM/pull/37
101+
102+
===============================================================
103+
===============================================================
2104
Tag name: ctsm5.3.018
3105
Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310)
4106
Date: Fri 10 Jan 2025 05:37:08 PM MST
@@ -96,7 +198,7 @@ https://github.com/ESCOMP/MOSART/issues/103#issuecomment-2479679014
96198
Other details
97199
-------------
98200
List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
99-
rtm, mosart
201+
rtm, mosart (see related note in ctsm5.3.019)
100202

101203
Pull Requests that document the changes (include PR ids):
102204
https://github.com/ESCOMP/ctsm/pull/2838

doc/ChangeSum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Tag Who Date Summary
22
============================================================================================================================
3+
ctsm5.3.019 olyson 01/14/2025 Stop running 0th time step
34
ctsm5.3.018 slevis 01/10/2025 Change history time to be the middle of the time bounds
45
ctsm5.3.017 slevis 01/09/2025 Merge tmp-241219 branch to master
56
tmp-241219.n03.ctsm5.3.016 01/09/2025 Bug fix for izumi nag tests to pass (slevis)

python/ctsm/crop_calendars/generate_gdds_functions.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def error(logger, string):
6060
"""
6161
Simultaneously print ERROR messages to console and to log file
6262
"""
63+
print(string)
6364
logger.error(string)
6465
raise RuntimeError(string)
6566

@@ -271,7 +272,7 @@ def import_and_process_1yr(
271272
else:
272273
chunks = None
273274

274-
# Get h2 file (list)
275+
# Get h1 file (list)
275276
h1_pattern = os.path.join(indir, "*h1.*.nc")
276277
h1_filelist = glob.glob(h1_pattern)
277278
if not h1_filelist:
@@ -551,13 +552,14 @@ def import_and_process_1yr(
551552
log(logger, " Importing accumulated GDDs...")
552553
clm_gdd_var = "GDDACCUM"
553554
my_vars = [clm_gdd_var, "GDDHARV"]
554-
pattern = os.path.join(indir, f"*h2.{this_year-1}-01-01*.nc")
555-
h2_files = glob.glob(pattern)
556-
if not h2_files:
557-
pattern = os.path.join(indir, f"*h2.{this_year-1}-01-01*.nc.base")
555+
patterns = [f"*h2.{this_year-1}-01*.nc", f"*h2.{this_year-1}-01*.nc.base"]
556+
for p in patterns:
557+
pattern = os.path.join(indir, p)
558558
h2_files = glob.glob(pattern)
559-
if not h2_files:
560-
error(logger, f"No files found matching pattern '*h2.{this_year-1}-01-01*.nc(.base)'")
559+
if h2_files:
560+
break
561+
if not h2_files:
562+
error(logger, f"No files found matching patterns: {patterns}")
561563
h2_ds = import_ds(
562564
h2_files,
563565
my_vars=my_vars,

src/biogeochem/CNPhenologyMod.F90

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -392,19 +392,7 @@ subroutine CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, &
392392
soilstate_inst, temperature_inst, atm2lnd_inst, wateratm2lndbulk_inst, cnveg_state_inst, &
393393
cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst)
394394

395-
! BACKWARDS_COMPATIBILITY(wjs, 2022-02-03) Old restart files generated at the end
396-
! of the year can indicate that a crop was panted on Jan 1, because that used to be
397-
! the time given to the last time step of the year. This would cause problems if we
398-
! ran CropPhenology in time step 0, because now time step 0 is labeled as Dec 31,
399-
! so CropPhenology would see the crop as having been planted 364 days ago, and so
400-
! would want to harvest this newly-planted crop. To avoid this situation, we avoid
401-
! calling CropPhenology on time step 0.
402-
!
403-
! This .not. is_first_step() condition can be removed either when we can rely on
404-
! all restart files having been generated with
405-
! https://github.com/ESCOMP/CTSM/issues/1623 resolved, or we stop having a time
406-
! step 0 (https://github.com/ESCOMP/CTSM/issues/925).
407-
if (num_pcropp > 0 .and. .not. is_first_step()) then
395+
if (num_pcropp > 0) then
408396
call CropPhenology(num_pcropp, filter_pcropp, &
409397
waterdiagnosticbulk_inst, temperature_inst, crop_inst, canopystate_inst, cnveg_state_inst, &
410398
cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, &

src/biogeochem/CNVegetationFacade.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ subroutine EndOfTimeStepVegDynamics(this, bounds, num_natvegp, filter_natvegp, &
12851285
! Call dv (dynamic vegetation) at last time step of year
12861286

12871287
call t_startf('d2dgvm')
1288-
if (is_end_curr_year() .and. .not. is_first_step()) then
1288+
if (is_end_curr_year()) then
12891289

12901290
! Get date info. kyr is used in lpj(). At end of first year, kyr = 2.
12911291
call get_curr_date(yr, mon, day, sec)
@@ -1337,7 +1337,7 @@ subroutine WriteHistory(this, bounds)
13371337

13381338
! Write to CNDV history buffer if appropriate
13391339
if (use_cndv) then
1340-
if (is_end_curr_year() .and. .not. is_first_step()) then
1340+
if (is_end_curr_year()) then
13411341
call t_startf('clm_drv_io_hdgvm')
13421342
call CNDVHist( bounds, this%dgvs_inst )
13431343
if (masterproc) write(iulog,*) 'Annual CNDV calculations are complete'

src/biogeochem/CropType.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ subroutine CropIncrementYear (this, num_pcropp, filter_pcropp)
930930
! Update nyrs when it's the end of the year (unless it's the very start of the
931931
! run). This assumes that, if this patch is active at the end of the year, then it was
932932
! active for the whole year.
933-
if ((kmo == 1 .and. kda == 1 .and. mcsec == 0) .and. .not. is_first_step()) then
933+
if ((kmo == 1 .and. kda == 1 .and. mcsec == 0)) then
934934
do fp = 1, num_pcropp
935935
p = filter_pcropp(fp)
936936

src/biogeochem/dynCNDVMod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ subroutine dynCNDV_interp( bounds, dgvs_inst)
9999
patch%wtcol(p) = dgvs_inst%fpcgrid_patch(p) + &
100100
wt1 * (dgvs_inst%fpcgridold_patch(p) - dgvs_inst%fpcgrid_patch(p))
101101

102-
if (mon==1 .and. day==1 .and. sec==dtime .and. nstep>0) then
102+
if (mon==1 .and. day==1 .and. sec==dtime) then
103103
dgvs_inst%fpcgridold_patch(p) = dgvs_inst%fpcgrid_patch(p)
104104
end if
105105
end if

0 commit comments

Comments
 (0)