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

Optionally base GDD20 on per-gridcell windows, not per-hemisphere #2593

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
75d7df6
Functionize UpdateAccVars_CropGDDs().
samsrabin May 31, 2024
45aff29
Optionally read/use gdd20 accum seasons from stream files.
samsrabin May 31, 2024
0feff1f
Fix check of invalid swindow inputs.
samsrabin Jun 1, 2024
3729b6d
Add RxCropCalsAdaptGGCMI testmod and test.
samsrabin Jun 1, 2024
d020ead
Fix check that gdd20 season files are provided.
samsrabin Jun 1, 2024
42b0dbb
Minor rearrangement in cropcal namelist definition.
samsrabin Jun 1, 2024
92555b9
generate_gdd20_baseline.py now saves NETCDF3_CLASSIC.
samsrabin Jun 1, 2024
30eb31c
Update default to point to classic version.
samsrabin Jun 1, 2024
a6e2c1e
Add allow_invalid_gdd20_season_inputs to namelist XML.
samsrabin Jun 1, 2024
9f04d71
Update missing values from generate_gdd20_baseline.py.
samsrabin Jun 1, 2024
625fd5e
RxCropCalsAdaptGGCMI now uses allow_invalid_gdd20_season_inputs.
samsrabin Jun 1, 2024
0156d1a
Move hist_addfld1d() for GDD0 to be with its siblings.
samsrabin Jun 1, 2024
b7c34ff
Add max versions of GDD season accum outputs.
samsrabin Jun 1, 2024
535e2c5
Even gdd20 files need to be advance()d.
samsrabin Jun 1, 2024
3e524db
generate_gdd20_baseline.py now saves to double instead of float.
samsrabin Jun 1, 2024
18df6b4
stream_fldFileName_gdd20_baseline now defaults to half-deg fake file.
samsrabin Jun 1, 2024
a3feed9
Use fixed gdd20 baseline file.
samsrabin Jun 2, 2024
5144b36
gdd20 baseline now interpolated w/ nearest-neighbor. Revert this!
samsrabin Jun 3, 2024
90b938b
generate_gdd20_nbaseline: Use GDDNX.
samsrabin Jun 3, 2024
e82679d
generate_gdd20_baseline: Grid, if needed.
samsrabin Jun 3, 2024
8b43fec
generate_gdd20_baseline: Improve long names.
samsrabin Jun 3, 2024
dcacbd4
Minor cleanup in UpdateAccVars_CropGDDs.
samsrabin Jun 3, 2024
2cf491d
Add outputs: GDD20_BASELINE, GDD20_SEASON_START/END.
samsrabin Jun 3, 2024
0083a08
rxcropmaturity.py is now parent rxcropmaturityshared.py.
samsrabin Jun 3, 2024
f728f96
Added back RXCROPMATURITY.
samsrabin Jun 3, 2024
e4b97a2
Add RXCROPMATURITYSKIPRUN.
samsrabin Jun 3, 2024
3a28c67
UpdateAccVars_CropGDDs: Only check gdd20 seasons if no NaNs/Infs.
samsrabin Jun 3, 2024
dcbc90e
Add TemperatureType restart var to flush GDD20s.
samsrabin Jun 4, 2024
982ef9a
Fixes to imports in RXCROPMATURITY(SKIPRUN).
samsrabin Jun 4, 2024
e1db253
Add reset option to update_accum_field_runmean().
samsrabin Jun 4, 2024
af0e12d
Actually flush GDD20 variables.
samsrabin Jun 4, 2024
a30a975
Update RXCROPMATURITY* namelists.
samsrabin Jun 4, 2024
0bdd55a
RXCROPMATURITYSKIPRUN now sets BUILD_COMPLETE=TRUE. Works!
samsrabin Jun 4, 2024
e890670
Revert "Actually flush GDD20 variables."
samsrabin Jun 6, 2024
4fb19c8
Revert "Add reset option to update_accum_field_runmean()."
samsrabin Jun 6, 2024
f9687b3
Merge remote-tracking branch 'origin/accum-reset-logical-ctsm5.2.005'…
samsrabin Jun 6, 2024
f830270
Update GDD20 flushing to use markreset_accum_field().
samsrabin Jun 6, 2024
7b92c53
Merge branch 'accum-reset-logical-ctsm5.2.005' into scale-mat-reqs-pr…
samsrabin Jun 7, 2024
3041578
Move stream_gdd20_seasons stuff to controlMod.
samsrabin Jun 10, 2024
801fa01
CLMBuildNamelist: Always set stream_meshfile_cropcal.
samsrabin Jun 10, 2024
dcff4f8
Set gdd20 season start/end NaNs to -1.
samsrabin Jun 10, 2024
c4ef0e7
UpdateAccVars_CropGDDs: Skip non-crops.
samsrabin Jun 10, 2024
b90789b
use_cropcal_streams now includes gdd20 dates.
samsrabin Jun 10, 2024
0ffbd07
Handle invalid gdd20_season_start and _end separately.
samsrabin Jun 10, 2024
2ebe85d
Fix restartvar() for flush_gdd20.
samsrabin Jun 11, 2024
e9531de
Add RXCROPMATURITYSKIPBUILD test.
samsrabin Jun 12, 2024
4144ac9
RXCROPMATURITY: copy .env_mach_specific.sh to gddgen dir.
samsrabin Jun 12, 2024
9f0b7ba
Add missing commas to RXCROPMATURITYSHARED.
samsrabin Jun 12, 2024
3733d8c
Merge branch 'scale-maturity-reqs-upstream' into scale-mat-reqs-pr2-g…
samsrabin Jun 12, 2024
8745206
PlantCrop: Error if gddmaturity(p) < min_gddmaturity but use_cropcal_…
samsrabin Jun 12, 2024
62bcd0b
Add some printout in PlantCrop().
samsrabin Jun 12, 2024
9cd2b22
Add printout of cropcal_stream DERIVED settings.
samsrabin Jun 12, 2024
a8923bf
Add printout when flushing GDD20s.
samsrabin Jun 12, 2024
f2518b6
PlantCrop: GDD-gen runs get gddmaturity 1e36.
samsrabin Jun 12, 2024
c4aa93b
PlantCrop: Remove troubleshooting printout.
samsrabin Jun 12, 2024
fb478a1
rxcropmaturityshared: Restore 'modify user_nl files: new fsurdat.'
samsrabin Jun 12, 2024
57daeec
Add manual flush_gdd20 option.
samsrabin Jun 12, 2024
9010346
Error if gdd20_season_start or _end > 366.
samsrabin Jun 12, 2024
3b6a8ce
UpdateAccVars_CropGDDs bugfix: Use day of year, not day of month.
samsrabin Jun 13, 2024
97b95e9
Add Cidadinho test site.
samsrabin Jun 13, 2024
d33ef3e
Add partial versions of RXCROPMATURITY test.
samsrabin Jun 3, 2024
5b3b8af
RXCROPMATURITY: copy .env_mach_specific.sh to gddgen dir.
samsrabin Jun 12, 2024
a2c792f
Add interpolate_gdds.py.
samsrabin Jun 14, 2024
46307bc
generate_gdds: Don't fail if making figures but GDDHARV alll NaN.
samsrabin Jun 14, 2024
faa536e
Revert "PlantCrop: GDD-gen runs get gddmaturity 1e36."
samsrabin Jun 14, 2024
bbd6327
Add RXCROPMATURITYSKIPGEN test.
samsrabin Jun 14, 2024
6bf9976
interpolate_gdds: nearest-neighbor for safety.
samsrabin Jun 14, 2024
81177dd
Revert all RXCROPMATURITY changes.
samsrabin Jun 14, 2024
17761a9
Leave gdd20_season_(start,end)_patch as real.
samsrabin Jun 14, 2024
e286f37
Add RXCROPMATURITYSKIPGEN test to aux_clm.
samsrabin Jun 14, 2024
6f59eab
Remove RXCROPMATURITY SKIPRUN and SKIPBUILD tests.
samsrabin Jun 14, 2024
104a2be
Remove RXCROPMATURITY test from expected failure list.
samsrabin Jun 14, 2024
dd6e0cb
Move RXCROPMATURITYSHARED into rxcropmaturity.py.
samsrabin Jun 14, 2024
6c5fdb1
Remove refs to skip_run.
samsrabin Jun 14, 2024
3efa49a
Unexpected behavior in rxboth run now errors check_rxboth_run.py.
samsrabin Jun 14, 2024
045d90f
Reformat with black.
samsrabin Jun 14, 2024
6af704f
Add previous commit to .git-blame-ignore-revs.
samsrabin Jun 14, 2024
76b7df7
check_rx_obeyed.py: Satisfy pylint.
samsrabin Jun 14, 2024
0a76437
Merge remote-tracking branch 'origin/fix-rxcropmaturity' into scale-m…
samsrabin Jun 14, 2024
fda1ae2
check_rxboth_run: Handle diffs_eg_txt never assigned.
samsrabin Jun 16, 2024
bacf5e9
Merge remote-tracking branch 'origin/fix-rxcropmaturity' into scale-m…
samsrabin Jun 16, 2024
ca15115
RXCROPMATURITY: Fix gdd-gen namelist.
samsrabin Jun 16, 2024
23f6fa2
PlantCrop: Error if gdd20 <= 0.
samsrabin Jun 16, 2024
78c5d98
Handle gdd20 < minimum if generate_crop_gdds.
samsrabin Jun 17, 2024
f618893
Set cropcal_rx true for both parts of RXCROPMATURITY*.
samsrabin Jun 18, 2024
7578787
Add GddGen(OnlyOutputs(Surf)) testmods.
samsrabin Jun 18, 2024
6fdcf4c
UpdateAccVars_CropGDDs: Remove check that patch is a crop.
samsrabin Jun 18, 2024
c6ae96b
Add StreamGdd20Seasons testmod.
samsrabin Jun 18, 2024
9c5b279
StreamGdd20Seasons: Set allow_invalid_gdd20_season_inputs .true.
samsrabin Jun 18, 2024
70b8fe3
Don't check gdd20_season_starts/ends if not crop.
samsrabin Jun 18, 2024
41e30bd
Correct comment in crop testmod user_nl_clm.
samsrabin Jun 18, 2024
30597ce
Add four tests to crop_calendars suite:
samsrabin Jun 18, 2024
2573c34
Fix walltime for GddGen tests.
samsrabin Jun 19, 2024
418f6be
GDD20_BASELINE and GDD20_SEASON_START/END now instantaneous.
samsrabin Jun 19, 2024
e3a00f8
Save GDD20_BASELINE and GDD20_SEASON_START/END in crop testmod.
samsrabin Jun 19, 2024
3b915fd
Simplify crop calendar tests.
samsrabin Jun 19, 2024
501ba25
Add tricky ERP test of RxCropCalsAdaptGGCMI.
samsrabin Jun 19, 2024
8d75453
TemperatureType: Save flush_gdd20 regardless of stream_gdd20_seasons.
samsrabin Jun 20, 2024
6810090
cropcal_interp: Ignore init when considering stream_gdd20_seasons.
samsrabin Jun 20, 2024
24845d2
cropcal_interp: Ignore init when considering adapt_cropcal_rx_cultiva…
samsrabin Jun 21, 2024
5b49d91
Forgot to commit RxCropCalsAdaptFlush testmod.
samsrabin Jun 21, 2024
4f702c3
Add ERP test of RxCropCalsAdaptGGCMI to expected failure list.
samsrabin Jun 25, 2024
d13508b
run_sys_tests: Check Python env for RXCROPMATURITY.
samsrabin Jun 25, 2024
a5da93e
generate_gdd20_baseline: Add optional -y1 and -yN args.
samsrabin Jun 26, 2024
23c8743
generate_gdds: Map sdate in/out diffs.
samsrabin Jun 26, 2024
7994c82
Save crop date variables in testmods more frequently.
samsrabin Jul 11, 2024
014800d
Add tweak_latlons.py.
samsrabin Jul 11, 2024
4c1d66f
mesh_type.py: Handle a broadcast error.
samsrabin Jul 11, 2024
f11003b
mesh_type.py: Improve error for lon > 360.
samsrabin Jul 11, 2024
231b4ac
tweak_latlons.py: Add more files.
samsrabin Jul 11, 2024
9f186d4
Use tweaked_latlon cropcal inputs.
samsrabin Jul 11, 2024
1377d48
Fix default stream_meshfile_cropcal.
samsrabin Jul 12, 2024
d60dc80
Fix reset of sowing_reason_perharv_patch.
samsrabin Jul 12, 2024
5c3e71f
Remove midDecStart-RxCropCalsAdaptGGCMI test from expected fails.
samsrabin Jul 12, 2024
dc488c7
Improve interpolate_gdds.py.
samsrabin Jul 12, 2024
3db9bf2
tweak_latlons: Include gdd20 files.
samsrabin Jul 12, 2024
64302ad
Additions/tweaks to CLM testlist.
samsrabin Jul 12, 2024
0da6eb5
Remove Clm50 RXCROPMATURITY tests.
samsrabin Jul 14, 2024
87d1fa1
Move tweak_latlons.py to tools/contrib/.
samsrabin Jul 14, 2024
f6ff134
Rework tweak_latlons.py to run from command line.
samsrabin Jul 14, 2024
2274263
Refine RxCropCals* testlist.
samsrabin Jul 14, 2024
e143138
generate_gdd20_baseline: Clarity rearrangement.
samsrabin Jul 18, 2024
647fc52
import_ds: Workaround to import multiple files without dask.
samsrabin Jul 18, 2024
96015da
generate_gdd20_baseline: Can now specify -v/--variable GDDBX or GDDB20.
samsrabin Jul 18, 2024
3cc1d0f
generate_gdd20_baseline: Satisfy pylint.
samsrabin Jul 18, 2024
b1bbe15
generate_gdd20_baseline: Save input file list as attribute(s).
samsrabin Jul 18, 2024
a703cb6
generate_gdd20_baseline: Save input year range as attribute.
samsrabin Jul 18, 2024
7a5e067
generate_gdd20_baseline: Save input variable type as attribute.
samsrabin Jul 18, 2024
25896e4
generate_gdd20_baseline: Functionize setup_output_dataset().
samsrabin Jul 18, 2024
f909d2d
Fill all land cells with MISSING_RX_GDD_VAL.
samsrabin Jul 18, 2024
8fa8506
Set different gdd20 baseline file if using default gdd20 baseline sea…
samsrabin Jul 18, 2024
945c8bb
Add utility function to get list of managed crops WITH grasses.
samsrabin Jul 18, 2024
ec9f07f
generate_gdd20_baseline: Use MGDCROP_LIST constant.
samsrabin Jul 18, 2024
669f227
generate_gdd20_baseline: Include mgd grasses.
samsrabin Jul 18, 2024
a624606
generate_gdd20_baseline: Include unmanaged crops.
samsrabin Jul 18, 2024
753fda3
Format with black.
samsrabin Jul 23, 2024
c0a3556
Add previous commit to .git-blame-ignore-revs.
samsrabin Jul 23, 2024
71ca96d
Delete an unused ncd_log.
samsrabin Jul 24, 2024
ad2c7f3
Delete a troubleshooting log message.
samsrabin Jul 24, 2024
592476f
Improve comments/error at "Handle invalid gdd20 season values."
samsrabin Jul 24, 2024
013028c
Replace SSR with Sam Rabin.
samsrabin Jul 24, 2024
96c7c2d
import_ds.py: Delete a commented-out line.
samsrabin Jul 24, 2024
1d9e939
Improve a comment in run_sys_tests.py.
samsrabin Jul 24, 2024
78d9f98
Improve error messages in PlantCrop().
samsrabin Jul 24, 2024
d3e6cbf
CropType: Fix a comment.
samsrabin Jul 24, 2024
6546a68
TemperatureType Restart(): Delete unused p.
samsrabin Jul 24, 2024
c96ce35
Delete unused sowingWindows testmod.
samsrabin Jul 24, 2024
b96ec91
check_rxboth_run.py: Improve error message.
samsrabin Jul 24, 2024
876e23b
interpolate_gdds.py: Strict check for prefix match.
samsrabin Jul 24, 2024
fecad29
Delete unneeded cropAnnOutputMonthly testmod.
samsrabin Jul 24, 2024
c94aeea
Add READMEs to testmods decStart and midDecStart.
samsrabin Jul 24, 2024
833d4f6
import_output(): Bugfix in call of check_v0_le_v1().
samsrabin Jul 24, 2024
56523e4
Remove 1-degree RXCROPMATURITY test from rxcropmaturity, crop_calenda…
samsrabin Jul 24, 2024
d06e864
Remove unneeded RxCropCalsAdaptFlush testmod.
samsrabin Jul 24, 2024
a2bf124
generate_gdd20_baseline.py: Add a clarifying comment.
samsrabin Jul 24, 2024
c9ff0ee
PlantCrop(): Resolve (dismiss) a TODO.
samsrabin Jul 24, 2024
bc05591
Improve flush_gdd20 restart logic.
samsrabin Jul 24, 2024
d298aef
Do not use flush_gdd20 from clm_varctl in flush decision.
samsrabin Jul 24, 2024
827632e
Actually don't use TemperatureType%flush_gdd20 at all.
samsrabin Jul 25, 2024
4ab30a5
crop_calendars Python stuff now includes crop grasses.
samsrabin Jul 25, 2024
aeb4182
interpolate_gdds.py: Syntax fix.
samsrabin Jul 25, 2024
929ec5d
Skip switchgrass in RXCROPMATURITY.
samsrabin Jul 25, 2024
b70c156
Manually specify sowing date file for GddGen testmod.
samsrabin Jul 25, 2024
7400d5b
Add izumi_nag.clm-RxCropCalsAdaptGGCMI test to expected fails.
samsrabin Jul 25, 2024
388c7ed
Move stream_gdd20_seasons to cropCalStreamMod.
samsrabin Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b
6c6f57e948bfa31e60b383536cc21663fedb8b70
9660667b1267dcd4150889f5f39db540158be74a
665cf86102e09b4c4c5a140700676dca23bc55a9
045d90f1d80f713eb3ae0ac58f6c2352937f1eb0
753fda3ff0147837231a73c9c728dd9ce47b5997
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ hash = 34723c2
required = True

[ccs_config]
tag = ccs_config_cesm0.0.92
hash = 75847d58bac1149adcb8d9b40181df631c273e19
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm.git
repo_url = https://github.com/samsrabin/ccs_config_cesm.git
local_path = ccs_config
required = True

Expand Down
27 changes: 23 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1842,9 +1842,10 @@ sub setup_logic_site_specific {
$nl->set_variable_value($group, $var, $val);
}

if ($nl_flags->{'res'} eq "1x1_smallvilleIA") {
my $res = $nl_flags->{'res'};
if ($res eq "1x1_smallvilleIA" or $res eq "1x1_cidadinhoBR") {
if (! &value_is_true($nl_flags->{'use_cn'}) || ! &value_is_true($nl_flags->{'use_crop'})) {
$log->fatal_error("1x1_smallvilleIA grids must use a compset with CN and CROP turned on.");
$log->fatal_error("${res} grids must use a compset with CN and CROP turned on.");
}
}

Expand Down Expand Up @@ -4175,8 +4176,11 @@ sub setup_logic_cropcal_streams {
# Set up other crop calendar parameters
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx_adapt');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_gdd20_seasons');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'flush_gdd20');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_cropcal');

# These can't both be true
my $cropcals_rx = $nl->get_value('cropcals_rx') ;
Expand All @@ -4185,12 +4189,27 @@ sub setup_logic_cropcal_streams {
$log->fatal_error("cropcals_rx and cropcals_rx_adapt may not both be true" );
}

# Add defaults if reading gdd20 seasons from stream files
my $stream_gdd20_seasons = $nl->get_value('stream_gdd20_seasons') ;
if ( &value_is_true($stream_gdd20_seasons)) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_start');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_end');

# Check
my $gdd20_season_start_file = $nl->get_value('stream_fldFileName_gdd20_season_start') ;
my $gdd20_season_end_file = $nl->get_value('stream_fldFileName_gdd20_season_end') ;
if ( &string_is_undef_or_empty($gdd20_season_start_file) or &string_is_undef_or_empty($gdd20_season_end_file) ) {
$log->message($gdd20_season_start_file);
$log->message($gdd20_season_end_file);
$log->fatal_error("If stream_gdd20_seasons is true, gdd20 season start and end files must be provided." );
}
}

# Add defaults if using prescribed crop calendars
if ( &value_is_true($cropcals_rx) or &value_is_true($cropcals_rx_adapt) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_swindow_start');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_swindow_end');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_cultivar_gdds');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_cropcal');
if ( &value_is_true($cropcals_rx_adapt) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline');
}
Expand All @@ -4202,7 +4221,7 @@ sub setup_logic_cropcal_streams {
my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ;
my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ;
my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ;
if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file) or !&string_is_undef_or_empty($mesh_file)) {
if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file)) {

# User gave an input file without specifying cropcals_rx or cropcals_rx_adapt = .true.
# Requiring this means nothing to the code, but helps namelist make more sense
Expand Down
30 changes: 20 additions & 10 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,8 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_C96_hist_1850_78pfts_c240216.nc</fsurdat>
<fsurdat hgrid="1x1_smallvilleIA" sim_year="1850" >
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240221.nc</fsurdat>
<fsurdat hgrid="1x1_cidadinhoBR" sim_year="2000" >
lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240613.nc</fsurdat>
<fsurdat hgrid="1x1_brazil" sim_year="1850">
lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_brazil_hist_1850_78pfts_c240221.nc</fsurdat>

Expand Down Expand Up @@ -1477,11 +1479,14 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
>lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc</flanduse_timeseries>


<!-- Note that this transient file only goes up to year 1855.
<!-- Note that these transient files only go up to year 1855.
This is sufficient for testing purposes, but could cause problems if you try to run beyond 1855. -->
<flanduse_timeseries hgrid="1x1_smallvilleIA" sim_year_range="1850-2000"
>lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240221.nc</flanduse_timeseries>

<!-- Cidadinho test site has no transient data. -->
<flanduse_timeseries hgrid="1x1_cidadinhoBR" sim_year_range="1850-2000"></flanduse_timeseries>

<!-- Future scenarios - landuse time series files with crop on -->

<!-- SSP1-RCP2.6 - relative to {csmdata}) -->
Expand Down Expand Up @@ -1689,6 +1694,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
<!-- crop calendars: default settings -->
<cropcals_rx>.false.</cropcals_rx>
<cropcals_rx_adapt>.false.</cropcals_rx_adapt>
<stream_gdd20_seasons>.false.</stream_gdd20_seasons>
<flush_gdd20>.false.</flush_gdd20>
<stream_year_first_cropcal_swindows >2000</stream_year_first_cropcal_swindows>
<stream_year_last_cropcal_swindows >2000</stream_year_last_cropcal_swindows>
<model_year_align_cropcal_swindows >2000</model_year_align_cropcal_swindows>
Expand All @@ -1697,15 +1704,18 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
<model_year_align_cropcal_cultivar_gdds >2000</model_year_align_cropcal_cultivar_gdds>

<!-- crop calendars: default input files -->
<stream_fldFileName_swindow_start cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc</stream_fldFileName_swindow_start>
<stream_fldFileName_swindow_end cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc</stream_fldFileName_swindow_end>
<stream_fldfilename_cultivar_gdds cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc</stream_fldfilename_cultivar_gdds>
<stream_meshfile_cropcal cropcals_rx=".true.">share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc</stream_meshfile_cropcal>
<stream_fldFileName_swindow_start cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc</stream_fldFileName_swindow_start>
<stream_fldFileName_swindow_end cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc</stream_fldFileName_swindow_end>
<stream_fldfilename_cultivar_gdds cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc</stream_fldfilename_cultivar_gdds>
<stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true.">lnd/clm2/testdata/gdd20baseline.tmp_dontupload.nc</stream_fldFileName_gdd20_baseline>
<stream_meshfile_cropcal cropcals_rx_adapt=".true.">share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc</stream_meshfile_cropcal>
<stream_fldFileName_swindow_start cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc</stream_fldFileName_swindow_start>
<stream_fldFileName_swindow_end cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc</stream_fldFileName_swindow_end>
<stream_fldfilename_cultivar_gdds cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc</stream_fldfilename_cultivar_gdds>
<stream_meshfile_cropcal cropcals_rx=".true.">lnd/clm2/cropdata/calendars/processed/360x720_120830_ESMFmesh_c20210507_cdf5.tweaked_latlons.nc</stream_meshfile_cropcal>
<stream_fldFileName_swindow_start cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc</stream_fldFileName_swindow_start>
<stream_fldFileName_swindow_end cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc</stream_fldFileName_swindow_end>
<stream_fldfilename_cultivar_gdds cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc</stream_fldfilename_cultivar_gdds>
<stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true." stream_gdd20_seasons=".false.">lnd/clm2/cropdata/calendars/processed/20230714_cropcals_pr2_1deg.actually2deg.1980-2009.from_GDDB20.interpd_halfdeg.tweaked_latlons.nc</stream_fldFileName_gdd20_baseline>
<stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true." stream_gdd20_seasons=".true.">lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.tweaked_latlons.nc</stream_fldFileName_gdd20_baseline>
samsrabin marked this conversation as resolved.
Show resolved Hide resolved
<stream_fldFileName_gdd20_season_start stream_gdd20_seasons=".true.">lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc</stream_fldFileName_gdd20_season_start>
<stream_fldFileName_gdd20_season_end stream_gdd20_seasons=".true.">lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc</stream_fldFileName_gdd20_season_end>
<stream_meshfile_cropcal cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/360x720_120830_ESMFmesh_c20210507_cdf5.tweaked_latlons.nc</stream_meshfile_cropcal>

<!-- lightning streams namelist defaults -->

Expand Down
2 changes: 2 additions & 0 deletions bld/namelist_files/namelist_defaults_overall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ determine default values for namelists.
<res sitespf_pt="1x1_urbanc_alpha" >1x1_urbanc_alpha</res>
<res sitespf_pt="1x1_numaIA" >1x1_numaIA</res>
<res sitespf_pt="1x1_smallvilleIA" >1x1_smallvilleIA</res>
<res sitespf_pt="1x1_cidadinhoBR" >1x1_cidadinhoBR</res>

<!-- Default simulation year -->
<sim_year>2000</sim_year>
Expand Down Expand Up @@ -110,6 +111,7 @@ determine default values for namelists.
<mask hgrid="1x1_urbanc_alpha" >test</mask>
<mask hgrid="1x1_numaIA" >navy</mask>
<mask hgrid="1x1_smallvilleIA" >test</mask>
<mask hgrid="1x1_cidadinhoBR" >test</mask>
<mask >gx1v7</mask>

<!-- Default glacier model options -->
Expand Down
25 changes: 25 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,31 @@ Filename of input stream data for cultivar growing degree-day targets
Filename of input stream data for baseline GDD20 values
</entry>

<entry id="stream_gdd20_seasons" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons."
</entry>

<entry id="flush_gdd20" type="logical" category="datasets"
group="clm_inparm" valid_values="" >
Set this to true to flush the accumulated GDD20 variables as soon as possible.
</entry>

<entry id="allow_invalid_gdd20_season_inputs" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
By default, a value in stream_fldFileName_gdd20_season_start or _end outside the range [1, 365] (or 366 in leap years) will cause the run to fail. Set this to .true. to instead have such cells fall back to the hard-coded hemisphere-specific "warm seasons."
</entry>

<entry id="stream_fldFileName_gdd20_season_start" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for date (day of year) of start of gdd20 accumulation season.
</entry>

<entry id="stream_fldFileName_gdd20_season_end" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for date (day of year) of end of gdd20 accumulation season.
</entry>

<entry id="stream_meshfile_cropcal" type="char*256" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for crop calendar inputs
Expand Down
30 changes: 16 additions & 14 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1590,21 +1590,23 @@ sub cat_and_create_namelistinfile {
print "==================================================\n";

# Check for crop resolutions
my $crop1850_res = "1x1_smallvilleIA";
$options = "-bgc bgc -crop -res $crop1850_res -use_case 1850_control -envxml_dir .";
&make_env_run();
eval{ system( "$bldnml $options > $tempfile 2>&1 " ); };
is( $@, '', "$options" );
$cfiles->checkfilesexist( "$options", $mode );
$cfiles->shownmldiff( "default", "standard" );
if ( defined($opts{'compare'}) ) {
$cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode );
$cfiles->comparefiles( "$options", $mode, $opts{'compare'} );
}
if ( defined($opts{'generate'}) ) {
$cfiles->copyfiles( "$options", $mode );
my @crop1850_res = ( "1x1_smallvilleIA", "1x1_cidadinhoBR" );
foreach my $res ( @crop1850_res ) {
$options = "-bgc bgc -crop -res $res -use_case 1850_control -envxml_dir .";
&make_env_run();
eval{ system( "$bldnml $options > $tempfile 2>&1 " ); };
is( $@, '', "$options" );
$cfiles->checkfilesexist( "$options", $mode );
$cfiles->shownmldiff( "default", "standard" );
if ( defined($opts{'compare'}) ) {
$cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode );
$cfiles->comparefiles( "$options", $mode, $opts{'compare'} );
}
if ( defined($opts{'generate'}) ) {
$cfiles->copyfiles( "$options", $mode );
}
&cleanup();
}
&cleanup();

my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" );
foreach my $res ( @crop_res ) {
Expand Down
Loading
Loading