Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
51d9f09
Break up a long line.
samsrabin Jan 18, 2024
c763d66
use_cropcal_rx_cultivar_gdds not needed in CropPhenology().
samsrabin Jan 18, 2024
846f1cc
PlantCrop(): Be strict about PFT identification.
samsrabin Jan 18, 2024
5b056b7
PlantCrop: Get gdd20 before setting gddmaturity.
samsrabin Jan 18, 2024
08906bb
Correct a comment.
samsrabin Jan 18, 2024
6ef52cd
Remove a troubleshooting write to iulog.
samsrabin Jan 18, 2024
98f68e7
Optionally adjust rx maturity reqt based on recent climate.
samsrabin Jan 18, 2024
b73bcfd
Don't adapt rx cultivar gdd reqts if baseline gdd20 is ≤0.
samsrabin May 23, 2024
20f32c1
Ignore 'invalid' values in stream_fldFileName_gdd20_baseline on read.
samsrabin May 24, 2024
a7cd057
Add generate_gdd20_baseline tool.
samsrabin May 24, 2024
fd5f177
Format generate_gdd20_baseline.py with black.
samsrabin May 28, 2024
5eafae7
Add previous commit to .git-blame-ignore-revs.
samsrabin May 28, 2024
38d6888
Add testmods RxCropCals, RxCropCalsAdapt.
samsrabin May 29, 2024
317f77d
Add cropcals_rx namelist boolean.
samsrabin May 29, 2024
81380ef
CLMBuildNamelist: Fix logic and message for check of sowing window st…
samsrabin May 29, 2024
b195734
CLMBuildNamelist: Use &string_is_undef_or_empty() instead of comparin…
samsrabin May 29, 2024
4b18a5b
CLMBuildNamelist: Use &value_is_true() instead of comparing to '.true.'
samsrabin May 29, 2024
e76fbbc
CLMBuildNamelist: Update setup_logic_cropcal_streams() with cropcals_rx.
samsrabin May 29, 2024
0f729d8
Bugfix: cropcalStreamMod now handles cropcals_rx.
samsrabin May 29, 2024
74411ea
Update RxCropCals testmod to use cropcals_rx true.
samsrabin May 29, 2024
9d1f88d
Add RxCropCals and RxCropCalsAdapt tests to new suite crop_calendars.
samsrabin May 29, 2024
7e5257a
Add cropcals_rx_adapt option.
samsrabin May 29, 2024
5911cea
Move add_default() of model_year_align_cropcal to be with other year …
samsrabin May 31, 2024
ccc228c
Merge pull request #6 from samsrabin/scale-mat-reqs-pr1.1-nml
samsrabin May 31, 2024
d89cb9d
Split streams year params for swindows vs maturity reqts.
samsrabin May 31, 2024
eb27a2d
Explain hard-coding of 2000 when reading GDD20 baseline file.
samsrabin May 31, 2024
a09d72c
Merge pull request #2560 from samsrabin/scale-mat-reqs-5.2.005
samsrabin May 31, 2024
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
1351313
Remove unused 'use' of accumResetVal from EnergyFluxType UpdateAccVar…
samsrabin Jun 5, 2024
7364ad6
All accumulator types can now be manually reset.
samsrabin Jun 5, 2024
9e39acc
Added reset tests for timeavg and runmean. Former not working.
samsrabin Jun 5, 2024
1ef5a74
Fix reset behavior for timeavg. Tests now working.
samsrabin Jun 5, 2024
2123b15
Added unit tests for markreset_accum_field().
samsrabin Jun 6, 2024
94cbf03
Reset timeavg and runaccum accumulators to initval, not 0.
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
906a39e
Whitespace fix.
samsrabin Jun 7, 2024
4a4e5ef
Replace init_ml_mpatch_field with a change in init_ml_patch_field.
samsrabin Jun 7, 2024
8035a77
test_accumul: Replace logical->int loops with one-line merge().
samsrabin Jun 7, 2024
669fe21
test_accumul: Add test of timeavg reset 2 days after period start. Fa…
samsrabin Jun 7, 2024
d82be2c
accumulMod bugfix: Use ndays_reset_shifted instead of nresets. Tests …
samsrabin Jun 7, 2024
7024437
Bugfix: Was resetting AGDD instead of AGDDTW.
samsrabin Jun 7, 2024
f558526
Add comments warning against wrapping runaccum do-loops in checks for…
samsrabin Jun 7, 2024
7b92c53
Merge branch 'accum-reset-logical-ctsm5.2.005' into scale-mat-reqs-pr…
samsrabin Jun 7, 2024
31b62a3
Merge pull request #2585 from samsrabin/accum-reset-logical-ctsm5.2.005
samsrabin Jun 9, 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
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
81177dd
Revert all RXCROPMATURITY changes.
samsrabin Jun 14, 2024
17761a9
Leave gdd20_season_(start,end)_patch as real.
samsrabin Jun 14, 2024
0a76437
Merge remote-tracking branch 'origin/fix-rxcropmaturity' into scale-m…
samsrabin Jun 14, 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
c5cc03c
Merge tag 'ctsm5.2.015' into scale-mat-reqs-pr3-mergemaster
samsrabin Jul 25, 2024
0d4a300
Fix setting of stream_fldFileName_gdd20_baseline.
samsrabin Jul 25, 2024
4b18928
Merge pull request #2593 from samsrabin/scale-mat-reqs-pr2-ggcmiseas
samsrabin Jul 25, 2024
649547c
Don't specify PE layout for SMS crop_calendars tests.
samsrabin Jul 25, 2024
26ce0bb
Add izumi versions of most derecho crop_calendars tests.
samsrabin Jul 25, 2024
ae4af6b
Fix PE layouts of izumi crop_calendars tests.
samsrabin Jul 25, 2024
e757d3d
Add oldCropCals testmod and two aux_clm tests that use it.
samsrabin Jul 25, 2024
7070abc
Add cropcals_rx(_adapt) in some testmods; rename RxCropCals to RxCrop…
samsrabin Jul 25, 2024
f0a221f
Rework RxCropCalsAdaptGGCMI to not require RxCropCalsAdapt.
samsrabin Jul 25, 2024
5dabe62
Delete RxCropCalsAdapt test.
samsrabin Jul 25, 2024
ca6b608
Add 'cropcals_rx_adapt = .false.' to RXCROPMATURITYSHARED.
samsrabin Jul 25, 2024
904e6b2
Change a test name in ExpectedTestFails.xml.
samsrabin Jul 26, 2024
a3d8158
Turn on cropcals_rx_adapt by default for physics other than clm4_5, c…
samsrabin Jul 26, 2024
dcdd587
Remove most Izumi crop_calendars tests.
samsrabin Jul 26, 2024
af02bca
Update ChangeLog and ChangeSum.
samsrabin Jul 26, 2024
542f708
Wrap cropcal subroutine calls in use_crop.
samsrabin Jul 26, 2024
126ce29
Allocate first dim on dataptr2d_*_start/end arrays with begp:endp.
samsrabin Jul 26, 2024
b7a8fb5
Allocate 2d arrays with begp:endp, not lsize.
samsrabin Jul 26, 2024
63b66b6
Add ERP_D_Ld10_P64x2.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm…
samsrabin Jul 26, 2024
7e04126
dataptr2d arrays' first dim is gridcell, not patch.
samsrabin Jul 26, 2024
d47b28a
Use begg and endg instead of lsize.
samsrabin Jul 26, 2024
2156c72
Use begg/endg instead of referring to bounds%.
samsrabin Jul 26, 2024
3631dc9
Merge pull request #2661 from samsrabin/scale-mat-reqs-pr3-mergemaster
samsrabin Jul 26, 2024
b1aed3f
Update ChangeLog and ChangeSum.
samsrabin Jul 26, 2024
66e28d1
Changes one Izumi test from f19 to 10x15 resolution.
samsrabin Jul 26, 2024
2713766
Merge pull request #2664 from samsrabin/scale-mat-reqs-pr4-makedefault
ekluzek Jul 26, 2024
2422cef
Update date on Change files
ekluzek Jul 27, 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 @@ -26,6 +26,7 @@ d866510188d26d51bcd6d37239283db690af7e82
0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7
e096358c832ab292ddfd22dd5878826c7c788968
475831f0fb0e31e97f630eac4e078c886558b61c
fd5f177131d63d39e79a13918390bdfb642d781e
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
Expand All @@ -49,3 +50,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b
665cf86102e09b4c4c5a140700676dca23bc55a9
1a49e547ba3c48fa483f9ae81a8f05adcd6b888c
045d90f1d80f713eb3ae0ac58f6c2352937f1eb0
753fda3ff0147837231a73c9c728dd9ce47b5997
146 changes: 116 additions & 30 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1903,9 +1903,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 @@ -4208,52 +4209,137 @@ sub setup_logic_lai_streams {
sub setup_logic_cropcal_streams {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

# Set first and last stream years
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});

# Set align year, if first and last years are different
if ( $nl->get_value('stream_year_first_cropcal') !=
$nl->get_value('stream_year_last_cropcal') ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
'model_year_align_cropcal', 'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
}

# 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') ;
my $cropcals_rx_adapt = $nl->get_value('cropcals_rx_adapt') ;
if (&value_is_true($cropcals_rx) and &value_is_true($cropcals_rx_adapt)) {
$log->fatal_error("cropcals_rx and cropcals_rx_adapt may not both be true" );
Comment thread
ekluzek marked this conversation as resolved.
Resolved
}

# 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." );
}
}

# Option checks
my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ;
my $use_mxmat = $nl->get_value('use_mxmat') ;
# 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');
if ( &value_is_true($cropcals_rx_adapt) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline', 'stream_gdd20_seasons'=>$stream_gdd20_seasons);
}
}

# Add defaults if using any crop calendar input files
my $swindow_start_file = $nl->get_value('stream_fldFileName_swindow_start') ;
my $swindow_end_file = $nl->get_value('stream_fldFileName_swindow_end') ;
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 ( ($swindow_start_file eq '' and $swindow_start_file ne '') or ($swindow_start_file ne '' and $swindow_start_file eq '') ) {
$log->fatal_error("When specifying sowing window dates, you must provide both swindow_start_file and swindow_end_file. To specify exact sowing dates, use the same 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
if ( !&value_is_true($cropcals_rx) and !&value_is_true($cropcals_rx_adapt) ){
$log->fatal_error("If providing any crop calendar input file(s), cropcals_rx or cropcals_rx_adapt must be true" );
}

# User set cropcals_rx_adapt to true but set stream_fldFileName_gdd20_baseline to empty
if ( &value_is_true($cropcals_rx_adapt) and &string_is_undef_or_empty($gdd20_baseline_file) ) {
$log->fatal_error("If cropcals_rx_adapt is true, stream_fldFileName_gdd20_baseline must be provided" );
}

# cropcals_rx_adapt is false but user provided stream_fldFileName_gdd20_baseline
if ( !&value_is_true($cropcals_rx_adapt) and !&string_is_undef_or_empty($gdd20_baseline_file) ) {
$log->fatal_error("If stream_fldFileName_gdd20_baseline provided, cropcals_rx_adapt must be true" );
}

# User provided an input file but set mesh file to empty
if ( &string_is_undef_or_empty($mesh_file) ) {
$log->fatal_error("If providing any crop calendar input file(s), you must provide stream_meshfile_cropcal" );
}

# Set stream years
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal_swindows',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal_swindows',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal_swindows',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal_cultivar_gdds',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal_cultivar_gdds',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal_cultivar_gdds',
'sim_year'=>$nl_flags->{'sim_year'},
'sim_year_range'=>$nl_flags->{'sim_year_range'});

# Do not allow maturity requirements to change over time if stream_fldFileName_gdd20_baseline is provided. That would be nonsensical.
if ( $nl->get_value('stream_year_first_cropcal_cultivar_gdds') !=
$nl->get_value('stream_year_last_cropcal_cultivar_gdds')
and !&string_is_undef_or_empty($gdd20_baseline_file) ) {
$log->fatal_error("If cropcals_rx_adapt is true (i.e., stream_fldFileName_gdd20_baseline is provided), baseline maturity requirements are allowed to vary over time (i.e., stream_year_first_cropcal_cultivar_gdds and stream_year_last_cropcal_cultivar_gdds must be the same)." );
}
}
if ( $generate_crop_gdds eq '.true.' ) {
if ( $use_mxmat eq '.true.' ) {

# If running with prescribed crop calendars, certain files must be provided
my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ;
if ( &value_is_true($cropcals_rx) or &value_is_true($cropcals_rx_adapt) ) {
if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) {
$log->fatal_error("If cropcals_rx or cropcals_rx_adapt is true, sowing window start and end files must be provided. To specify exact sowing dates, use the same file." );
}
if ( &string_is_undef_or_empty($gdd_file) and (! &value_is_true($generate_crop_gdds)) ){
$log->fatal_error("If cropcals_rx or cropcals_rx_adapt is true and generate_crop_gdds is false, maturity requirement file stream_fldFileName_cultivar_gdds must be provided" );
}
}

# Option checks
if ( &string_is_undef_or_empty($gdd_file) and ! &string_is_undef_or_empty($gdd20_baseline_file) ) {
$log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline");
}
if ( &value_is_true($generate_crop_gdds) ) {
my $use_mxmat = $nl->get_value('use_mxmat') ;
if ( &value_is_true($use_mxmat) ) {
$log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" );
}
if ( $swindow_start_file eq '' or $swindow_end_file eq '' ) {
if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) {
Comment thread
ekluzek marked this conversation as resolved.
Resolved
$log->fatal_error("If generate_crop_gdds is true, you must specify stream_fldFileName_swindow_start and stream_fldFileName_swindow_end")
}
if ( $swindow_start_file ne $swindow_end_file ) {
$log->fatal_error("If generate_crop_gdds is true, you must specify exact sowing dates by setting stream_fldFileName_swindow_start and stream_fldFileName_swindow_end to the same file")
}
if ( $gdd_file ne '' ) {
if ( ! &string_is_undef_or_empty($gdd_file) ) {
$log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_cultivar_gdds")
}
}
if ( $mesh_file eq '' and ( $swindow_start_file ne '' or $gdd_file ne '' ) ) {
$log->fatal_error("If prescribing crop sowing dates and/or maturity requirements, you must specify stream_meshfile_cropcal")
if ( ! &string_is_undef_or_empty($gdd20_baseline_file) ) {
$log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_gdd20_baseline")
}
}
}

Expand Down
39 changes: 34 additions & 5 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,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>
Comment thread
ekluzek marked this conversation as resolved.
Resolved
<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 @@ -1980,11 +1982,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>
Comment thread
ekluzek marked this conversation as resolved.
Resolved

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

<!-- SSP1-RCP2.6 - relative to {csmdata}) -->
Expand Down Expand Up @@ -2192,10 +2197,34 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
<lai_mapalgo hgrid="1x1_asphaltjungleNJ" >nn</lai_mapalgo>
<lai_mapalgo hgrid="5x5_amazon" >nn</lai_mapalgo>

<!-- crop calendar streams namelist defaults -->
<stream_year_first_cropcal >1850</stream_year_first_cropcal>
<stream_year_last_cropcal >2100</stream_year_last_cropcal>
<model_year_align_cropcal >1850</model_year_align_cropcal>
<!-- crop calendars: default settings -->
<cropcals_rx>.false.</cropcals_rx>
<cropcals_rx_adapt>.true.</cropcals_rx_adapt>
<cropcals_rx_adapt phys="clm4_5">.false.</cropcals_rx_adapt>
<cropcals_rx_adapt phys="clm5_0">.false.</cropcals_rx_adapt>
<cropcals_rx_adapt phys="clm5_1">.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>
<stream_year_first_cropcal_cultivar_gdds >2000</stream_year_first_cropcal_cultivar_gdds>
<stream_year_last_cropcal_cultivar_gdds >2000</stream_year_last_cropcal_cultivar_gdds>
<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.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>
<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
Loading