Skip to content

Commit 32ad119

Browse files
authored
Merge pull request #3328 from slevis-lmwg/upd_pfts1d_wt_with_time
ctsm5.3.064: Add time dimension to *1d_wt* fields that change in transient simulations
2 parents d43d777 + 1143538 commit 32ad119

File tree

7 files changed

+199
-30
lines changed

7 files changed

+199
-30
lines changed

bld/CLMBuildNamelist.pm

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,14 +2867,20 @@ sub setup_logic_do_transient_pfts {
28672867
}
28682868

28692869
# if do_transient_pfts is .true. and any of these (n_dom_* or toosmall_*)
2870-
# are > 0 or collapse_urban = .true., then give fatal error
2870+
# are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error
28712871
if (&value_is_true($nl->get_value($var))) {
28722872
if (&value_is_true($nl->get_value('collapse_urban'))) {
28732873
$log->fatal_error("$var cannot be combined with collapse_urban");
28742874
}
28752875
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
28762876
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soi > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
28772877
}
2878+
2879+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time',
2880+
'do_transient_pfts'=>$nl_flags->{'do_transient_pfts'});
2881+
if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) {
2882+
$log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_pfts is .true.");
2883+
}
28782884
}
28792885
}
28802886

@@ -2944,14 +2950,20 @@ sub setup_logic_do_transient_crops {
29442950
}
29452951

29462952
# if do_transient_crops is .true. and any of these (n_dom_* or toosmall_*)
2947-
# are > 0 or collapse_urban = .true., then give fatal error
2953+
# are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error
29482954
if (&value_is_true($nl->get_value($var))) {
29492955
if (&value_is_true($nl->get_value('collapse_urban'))) {
29502956
$log->fatal_error("$var cannot be combined with collapse_urban");
29512957
}
29522958
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
29532959
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
29542960
}
2961+
2962+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time',
2963+
'do_transient_crops'=>$nl_flags->{'do_transient_crops'});
2964+
if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) {
2965+
$log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_crops is .true.");
2966+
}
29552967
}
29562968

29572969
my $dopft = "do_transient_pfts";
@@ -3021,7 +3033,7 @@ sub setup_logic_do_transient_lakes {
30213033
}
30223034

30233035
# if do_transient_lakes is .true. and any of these (n_dom_* or toosmall_*)
3024-
# are > 0 or collapse_urban = .true., then give fatal error
3036+
# are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error
30253037
if (&value_is_true($nl->get_value($var))) {
30263038
if (&value_is_true($nl->get_value('collapse_urban'))) {
30273039
$log->fatal_error("$var cannot be combined with collapse_urban");
@@ -3031,6 +3043,12 @@ sub setup_logic_do_transient_lakes {
30313043
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
30323044
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
30333045
}
3046+
3047+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time',
3048+
'do_transient_lakes'=>$nl_flags->{'do_transient_lakes'});
3049+
if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) {
3050+
$log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_lakes is .true.");
3051+
}
30343052
}
30353053
}
30363054

@@ -3093,7 +3111,7 @@ sub setup_logic_do_transient_urban {
30933111
}
30943112

30953113
# if do_transient_urban is .true. and any of these (n_dom_* or toosmall_*)
3096-
# are > 0 or collapse_urban = .true., then give fatal error
3114+
# are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error
30973115
if (&value_is_true($nl->get_value($var))) {
30983116
if (&value_is_true($nl->get_value('collapse_urban'))) {
30993117
$log->fatal_error("$var cannot be combined with collapse_urban");
@@ -3103,6 +3121,12 @@ sub setup_logic_do_transient_urban {
31033121
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
31043122
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
31053123
}
3124+
3125+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time',
3126+
'do_transient_urban'=>$nl_flags->{'do_transient_urban'});
3127+
if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) {
3128+
$log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_urban is .true.");
3129+
}
31063130
}
31073131
}
31083132

bld/namelist_files/namelist_defaults_ctsm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,11 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
24722472
<do_transient_lakes>.false.</do_transient_lakes>
24732473
<do_transient_urban>.false.</do_transient_urban>
24742474
<reset_dynbal_baselines>.false.</reset_dynbal_baselines>
2475+
<vars_1dwt_w_time do_transient_pfts=".true.">.true.</vars_1dwt_w_time>
2476+
<vars_1dwt_w_time do_transient_crops=".true.">.true.</vars_1dwt_w_time>
2477+
<vars_1dwt_w_time do_transient_lakes=".true.">.true.</vars_1dwt_w_time>
2478+
<vars_1dwt_w_time do_transient_urban=".true.">.true.</vars_1dwt_w_time>
2479+
<vars_1dwt_w_time>.false.</vars_1dwt_w_time>
24752480

24762481
<!-- ========================================= -->
24772482
<!-- Defaults for water tracers -->

bld/namelist_files/namelist_definition_ctsm.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,15 @@ or more, which causes CAM to blow up. However, note that setting it to true will
27792779
break water and energy conservation!
27802780
</entry>
27812781

2782+
<entry id="vars_1dwt_w_time" type="logical" category="physics"
2783+
group="dynamic_subgrid" valid_values="" >
2784+
A TRUE setting adds the time dimension to all 1dwt variables that appear in
2785+
files generated as a result of hist_dov2xy = .false. (e.g. pfts1d_wtcol).
2786+
Transient simulations (run_has_transient_landcover = .true.) have the same
2787+
outcome as vars_1dwt_w_time = .true..
2788+
Use this flag if you wish to change FALSE to TRUE when run_has_transient_landcover = .false..
2789+
</entry>
2790+
27822791
<!-- ======================================================================================== -->
27832792
<!-- Namelist options related to finidat consistency checks -->
27842793
<!-- ======================================================================================== -->

doc/ChangeLog

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,81 @@
11
===============================================================
2+
Tag name: ctsm5.3.064
3+
Originator(s): slevis (Samuel Levis)
4+
Date: Thu 24 Jul 2025 01:13:00 PM MDT
5+
One-line Summary: Add time dimension to 1d_wt fields in transient runs
6+
7+
Purpose and description of changes
8+
----------------------------------
9+
10+
1d_wt fields (e.g. pfts1d_wtgcell) appear in history when hist_dov2xy = .false.
11+
This PR:
12+
- adds the time dimension to these variables in Hist runs because these variables change with time
13+
- adds new namelist variable vars_1dwt_w_time to let users add the time dimension when it is not added by default, i.e. in non-transient runs
14+
- throws a build namelist error when the new namelist variable is .false. in a transient simulation
15+
16+
Significant changes to scientifically-supported configurations
17+
--------------------------------------------------------------
18+
19+
Does this tag change answers significantly for any of the following physics configurations?
20+
(Details of any changes will be given in the "Answer changes" section below.)
21+
22+
[Put an [X] in the box for any configuration with significant answer changes.]
23+
24+
[ ] clm6_0
25+
26+
[ ] clm5_0
27+
28+
[ ] ctsm5_0-nwp
29+
30+
[ ] clm4_5
31+
32+
33+
Bugs fixed
34+
----------
35+
List of CTSM issues fixed (include CTSM Issue # and description) [one per line]:
36+
Resolves #3307 Updating vector history file output...
37+
38+
Notes of particular relevance for users
39+
---------------------------------------
40+
Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
41+
New namelist variable vars_1dwt_w_time; user will get an error if they set it to .false. when any of the following is .true.:
42+
do_transient_pfts, do_transient_crops, do_transient_lakes, do_transient_urban
43+
44+
Changes made to namelist defaults (e.g., changed parameter values):
45+
vars_1dwt_w_time defaults to true when any of the following is .true.:
46+
do_transient_pfts, do_transient_crops, do_transient_lakes, do_transient_urban
47+
else vars_1dwt_w_time defaults to .false.
48+
49+
Changes to documentation:
50+
Added vars_1dwt_w_time to namelist_definition_ctsm.xml with an explanation of its use
51+
52+
Testing summary:
53+
----------------
54+
[PASS means all tests PASS; OK means tests PASS other than expected fails.]
55+
56+
build-namelist tests (if CLMBuildNamelist.pm has changed):
57+
58+
derecho - PASS
59+
60+
regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
61+
62+
derecho ----- OK
63+
izumi ------- OK
64+
65+
Answer changes
66+
--------------
67+
68+
Changes answers relative to baseline: Yes
69+
- 1d_wt fields with the time dimension will display different answers in transient simulations, though this is diagnostic in nature.
70+
- Only one test is affected in aux_clm: RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput
71+
72+
Other details
73+
-------------
74+
Pull Requests that document the changes (include PR ids):
75+
https://github.com/ESCOMP/ctsm/pull/3328
76+
77+
===============================================================
78+
===============================================================
279
Tag name: ctsm5.3.063
380
Originator(s): samrabin (Sam Rabin, UCAR/TSS)
481
Date: Thu Jul 10 12:28:36 MDT 2025

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.064 slevis 07/24/2025 Add time dimension to 1d_wt fields in transient runs
34
ctsm5.3.063 samrabin 07/10/2025 Merge b4b-dev to master
45
ctsm5.3.062 slevis 07/09/2025 Put inst. and non-inst. fields on separate hist files
56
ctsm5.3.061 slevis 06/26/2025 Merge b4b-dev to master

src/dyn_subgrid/dynSubgridControlMod.F90

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module dynSubgridControlMod
2626
public :: get_do_transient_crops ! return the value of the do_transient_crops control flag
2727
public :: get_do_transient_lakes ! return the value of the do_transient_lakes control flag
2828
public :: get_do_transient_urban ! return the value of the do_transient_urban control flag
29+
public :: get_vars_1dwt_w_time ! return the value of the vars_1dwt_w_time control flag
2930
public :: run_has_transient_landcover ! returns true if any aspects of prescribed transient landcover are enabled
3031
public :: get_do_harvest ! return the value of the do_harvest control flag
3132
public :: get_do_grossunrep ! return the value of the do_grossunrep control flag
@@ -47,6 +48,7 @@ module dynSubgridControlMod
4748
logical :: do_transient_urban = .false. ! whether to apply transient urban from dataset
4849
logical :: do_harvest = .false. ! whether to apply harvest from dataset
4950
logical :: do_grossunrep = .false. ! whether to apply gross unrepresented landcover change from dataset
51+
logical :: vars_1dwt_w_time = .false. ! whether to add the time dimension to 1dwt variables, e.g. pfts1d_wtcol
5052

5153
logical :: reset_dynbal_baselines = .false. ! whether to reset baseline values of total column water and energy in the first step of the run
5254

@@ -126,6 +128,7 @@ subroutine read_namelist( NLFilename )
126128
logical :: do_transient_urban
127129
logical :: do_harvest
128130
logical :: do_grossunrep
131+
logical :: vars_1dwt_w_time
129132
logical :: reset_dynbal_baselines
130133
logical :: for_testing_allow_non_annual_changes
131134
logical :: for_testing_zero_dynbal_fluxes
@@ -144,6 +147,7 @@ subroutine read_namelist( NLFilename )
144147
do_transient_urban, &
145148
do_harvest, &
146149
do_grossunrep, &
150+
vars_1dwt_w_time, &
147151
reset_dynbal_baselines, &
148152
for_testing_allow_non_annual_changes, &
149153
for_testing_zero_dynbal_fluxes
@@ -156,6 +160,7 @@ subroutine read_namelist( NLFilename )
156160
do_transient_urban = .false.
157161
do_harvest = .false.
158162
do_grossunrep = .false.
163+
vars_1dwt_w_time = .false.
159164
reset_dynbal_baselines = .false.
160165
for_testing_allow_non_annual_changes = .false.
161166
for_testing_zero_dynbal_fluxes = .false.
@@ -183,6 +188,7 @@ subroutine read_namelist( NLFilename )
183188
call shr_mpi_bcast (do_transient_urban, mpicom)
184189
call shr_mpi_bcast (do_harvest, mpicom)
185190
call shr_mpi_bcast (do_grossunrep, mpicom)
191+
call shr_mpi_bcast (vars_1dwt_w_time, mpicom)
186192
call shr_mpi_bcast (reset_dynbal_baselines, mpicom)
187193
call shr_mpi_bcast (for_testing_allow_non_annual_changes, mpicom)
188194
call shr_mpi_bcast (for_testing_zero_dynbal_fluxes, mpicom)
@@ -195,6 +201,7 @@ subroutine read_namelist( NLFilename )
195201
do_transient_urban = do_transient_urban, &
196202
do_harvest = do_harvest, &
197203
do_grossunrep = do_grossunrep, &
204+
vars_1dwt_w_time = vars_1dwt_w_time, &
198205
reset_dynbal_baselines = reset_dynbal_baselines, &
199206
for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, &
200207
for_testing_zero_dynbal_fluxes = for_testing_zero_dynbal_fluxes)
@@ -397,6 +404,18 @@ logical function get_do_transient_urban()
397404

398405
end function get_do_transient_urban
399406

407+
!-----------------------------------------------------------------------
408+
logical function get_vars_1dwt_w_time()
409+
! !DESCRIPTION:
410+
! Return the value of the vars_1dwt_w_time control flag
411+
!-----------------------------------------------------------------------
412+
413+
SHR_ASSERT_FL(dyn_subgrid_control_inst%initialized, sourcefile, __LINE__)
414+
415+
get_vars_1dwt_w_time = dyn_subgrid_control_inst%vars_1dwt_w_time
416+
417+
end function get_vars_1dwt_w_time
418+
400419
!-----------------------------------------------------------------------
401420
logical function run_has_transient_landcover()
402421
! !DESCRIPTION:
@@ -406,6 +425,7 @@ logical function run_has_transient_landcover()
406425
run_has_transient_landcover = &
407426
(get_do_transient_pfts() .or. &
408427
get_do_transient_crops() .or. &
428+
get_do_transient_lakes() .or. &
409429
get_do_transient_urban())
410430
end function run_has_transient_landcover
411431

0 commit comments

Comments
 (0)