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

Prescribed sowing date and maturity requirements #1863

Merged
merged 435 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
435 commits
Select commit Hold shift + click to select a range
5d432a3
Delete commented-out declarations in cropcalStreamMod.
samsrabin Oct 10, 2022
37f914b
Now must specify if you want to ignore mxmat, with use_mxmat = .false.
samsrabin Oct 10, 2022
f7dea1b
Merge branch 'rx_crop_calendars3' into rx_crop_calendars2
samsrabin Oct 17, 2022
e79d7d3
Removed commented-out lines of code.
samsrabin Oct 27, 2022
ee53b4e
Removed unused variable ivt from a loop in cropcal_interp().
samsrabin Oct 27, 2022
98c7a1d
Breaking up some long lines.
samsrabin Oct 27, 2022
fe257d4
Comment to clarify choice of not per-second units for repr_grainc_to_…
samsrabin Oct 27, 2022
2b18452
Comments for new 2d variables now include units and dimensions.
samsrabin Oct 27, 2022
4973cc2
Added comment in CropPhenology() explaining logic of setting do_plant…
samsrabin Oct 27, 2022
8f6ca20
Edited a comment to clarify why do_plant_{normal,lastchance} are calc…
samsrabin Oct 27, 2022
2f4fd16
Improved comment explaining harvest of "crops incorrectly planted in …
samsrabin Oct 27, 2022
6bf99fa
Added _patch suffix to variables introduced in this branch.
samsrabin Oct 27, 2022
6ee4b5f
Removing ignore_rx_crop_gdds option.
samsrabin Oct 27, 2022
dfaa91b
Renamed sown_today to did_plant_prescribed_today.
samsrabin Oct 27, 2022
27b827f
Renamed is_day_before_next_sowing to will_plant_prescribed_tomorrow.
samsrabin Oct 28, 2022
a463b72
Minor de-duplication in 2 spots.
samsrabin Oct 28, 2022
4b3aea5
Replaced a use of use_cropcal_streams with use_cropcal_rx_sdates. (Sh…
samsrabin Nov 8, 2022
c2e4c67
Removed default cropcal files.
samsrabin Nov 8, 2022
1b14d9c
Removed vestigial use_cropcal_streams from controlMod.
samsrabin Nov 8, 2022
d5bda14
Don't use gddmin as minimum GDD requirement when not using prescribed…
samsrabin Nov 9, 2022
93b69e0
Only error if zero harvests will actually be an issue.
samsrabin Nov 11, 2022
8a18ea8
hrv_xsmrpool_to_atm_dribbler now considers allows_non_annual_delta.
samsrabin Jan 2, 2023
f78a19c
use gddmin as minimum GDD requirement if generate_crop_gdds true.
samsrabin Jan 3, 2023
309e0ed
Merge branch 'ts_zero_harvests' into rx_crop_calendars2
samsrabin Jan 3, 2023
5952083
Removed unnecessary error check from cropcal_interp().
samsrabin Jan 6, 2023
a18ceaf
No longer using s for sowing_count(p) except as loop index.
samsrabin Jan 6, 2023
0c168ac
Removed unnecessary assignment of -5 in cropcal_interp().
samsrabin Jan 6, 2023
b016f9d
Moved two error checks from CropPhenology() to init functions.
samsrabin Jan 6, 2023
cd904fc
PlantCrop() now only tries to set next_rx_sdate if use_cropcal_rx_sda…
samsrabin Jan 6, 2023
5ff3203
Added crop calendar tests.
samsrabin Jan 7, 2023
225ffdf
Replaced harvest reason hard-codes with parameters.
samsrabin Jan 7, 2023
bb86039
Moved backwards-compatibility checks for iyop and sowing_reason from …
samsrabin Jan 9, 2023
b833b8b
Now using current day/date instead of prev.
samsrabin Jan 9, 2023
3e86141
Reworked harvest reasons.
samsrabin Jan 10, 2023
f5153c2
HARVEST_REASON_PERHARV 'units' is now a key to reason numbers.
samsrabin Jan 10, 2023
6036d8b
De-duplication in sowing requirement checks.
samsrabin Jan 11, 2023
3d952bb
iyop now calculated upon restart instead of being read-in.
samsrabin Jan 11, 2023
5ecbae7
Bugfix to previous.
samsrabin Jan 11, 2023
1d1a3eb
CropType restart now only checks whether hdates_thisyr_patch was read.
samsrabin Jan 13, 2023
eb82a54
Removed unused min_crop_gdd_target.
samsrabin Jan 13, 2023
672140b
Use taxmode extend instead of cycle in cropcalStreamMod.
samsrabin Jan 23, 2023
4a781a3
PlantCrop(): min gddmaturity 1.0 for all crops when prescribing eithe…
samsrabin Jan 26, 2023
08e2fe6
Safer method to freeze-kill winter cereals.
samsrabin Jan 28, 2023
5bd0506
Set stream_dtlimit to 10^30 for crop calendar streams.
samsrabin Jan 29, 2023
bc770f0
Moved 'vernalization forces harvest' else-if in harvest logic.
samsrabin Mar 23, 2023
1fdde35
Revert "Moved 'vernalization forces harvest' else-if in harvest logic."
samsrabin Mar 24, 2023
c3d3860
Safer method of 'Safer method to freeze-kill winter cereals.'
samsrabin Mar 24, 2023
ad86a9c
Merge branch 'ts-bad-hdates-in-gddgen' into rx_crop_calendars2
samsrabin Mar 24, 2023
87fc26f
CLMBuildNamelist.pm now requires use_mxmat false when generate_crop_g…
samsrabin Mar 31, 2023
cadc9cd
Bugfixes to previous.
samsrabin Mar 31, 2023
086ba44
Merge tag ctsm5.1.dev120 into rx_crop_calendars2
samsrabin Apr 3, 2023
de052fc
Added setup_for_gddgen.sh.
samsrabin Apr 3, 2023
8875e08
Improved portability of setup_for_gddgen.sh.
samsrabin Apr 4, 2023
ce6be4c
setup_for_gddgen.sh now sets use_init_interp if needed.
samsrabin Apr 4, 2023
f39e7ea
Added generate_gdds_testing.sh.
samsrabin Apr 4, 2023
7a4616e
Replaced old cropcal tests with cropcals_generate_gdds.
samsrabin Apr 4, 2023
ae16a3e
cropcals_generate_gdds shell_commands now looks for generate_gdds.sh …
samsrabin Apr 4, 2023
527e0ae
cropcals_generate_gdds test shell_commands now respects test specific…
samsrabin Apr 4, 2023
526c204
Renamed generate_gdds_testing.sh to generate_gdds.sh.
samsrabin Apr 4, 2023
1f36f78
Removed an outdated development line from setup_for_gddgen.sh.
samsrabin Apr 4, 2023
8bc8532
setup_for_gddgen.sh: Do not fail if sim length seems too short.
samsrabin Apr 4, 2023
e0f50bb
cropcals_generate_gdds test: Call case.setup at beginning of shell_co…
samsrabin Apr 4, 2023
f7deb0d
Brought in Python for generating GDDs into python/ctsm/crop_calendars.
samsrabin Apr 7, 2023
b1c2c57
Added ctsm_py_gallery as an external at python/ctsm_py_gallery.
samsrabin Apr 7, 2023
a98bd88
make_surface_for_gddgen: paramfile now only needed if using get_new_f…
samsrabin Apr 10, 2023
324e95d
Added RXCROPMATURITY SystemTest.
samsrabin Apr 10, 2023
35979b6
Added RXCROPMATURITY to config_tests.xml.
samsrabin Apr 10, 2023
41d44aa
Bugfixes to RXCROPMATURITY test.
samsrabin Apr 10, 2023
149bbd4
Another bugfix to RXCROPMATURITY.
samsrabin Apr 10, 2023
5c641ae
Fixes to messaging in RXCROPMATURITY test.
samsrabin Apr 10, 2023
ca7b1fb
Reverting a change to RXCROPMATURITY test re: conda.
samsrabin Apr 10, 2023
27422e9
RXCROPMATURITY test: Use `conda run -n` instead of 'conda activate'.
samsrabin Apr 10, 2023
1d63445
Bugfix in make_surface_for_gddgen.py: Correct references to outfile.
samsrabin Apr 10, 2023
ad17a33
RXCROPMATURITY test: Don't change run start date.
samsrabin Apr 11, 2023
ec685e9
Fixes to make_surface_for_gddgen.py.
samsrabin Apr 11, 2023
acce5d6
Change RXCROPMATURITY run length to 4 years (temporarily).
samsrabin Apr 11, 2023
128ff8d
Move initialization of crop allocation coefficients to PlantCrop().
samsrabin Apr 18, 2023
2646ead
Revert "Do not allow jumping to cphase_grainfill without having enter…
samsrabin Apr 18, 2023
12a1a12
Bugfix to rework of crop allocation variable init.
samsrabin Apr 19, 2023
387190a
Put crop allocation variable initialization, plus aleafi/astemi, back…
samsrabin Apr 19, 2023
c98f2c0
Revert "Revert "Do not allow jumping to cphase_grainfill without havi…
samsrabin Apr 19, 2023
aab6793
Revert rework of crop allocation variable init and reversion of CropP…
samsrabin Apr 21, 2023
5c80d6b
Revert "Do not allow jumping to cphase_grainfill without having enter…
samsrabin Apr 19, 2023
3c97196
Add crop allocation coefficient init to PlantCrop, n/i a(stem,leaf)i.
samsrabin Apr 19, 2023
6380bb1
Add a(stem,leaf)i.
samsrabin Apr 19, 2023
7b3ef09
Add a(stem,leaf)i init to calc_crop_allocation_fractions() "not cropl…
samsrabin Apr 19, 2023
69f4c22
Add a(stem,leaf)i init to calc_crop_allocation_fractions() "planted b…
samsrabin Apr 20, 2023
b8aaf82
Replace various tests with RXCROPMATURITY SystemTest.
samsrabin Apr 3, 2023
15eee7e
RXCROPMATURITY now accepts arbitrary run lengths ≥5 years.
samsrabin May 5, 2023
08c58c3
Removed force_harvest.
samsrabin May 8, 2023
7a74dc4
RXCROPMATURITY: Add daily per-PFT CPHASE output to Prescribed Calenda…
samsrabin May 9, 2023
c3555a8
Put do_harvest back where force_harvest was removed from cphase_leafe…
samsrabin May 9, 2023
0ab3900
Complete rework of workaround for NaN astemi/aleafi.
samsrabin May 10, 2023
3fba589
Merge branch 'remove-force-harvest' into rx_crop_calendars4
samsrabin May 10, 2023
5f5e37b
Complete RXCROPMATURITY SystemTest work.
samsrabin May 10, 2023
d484c5f
Merge tag 'ctsm5.1.dev124' into rx_crop_calendars4
samsrabin May 10, 2023
7798b9a
Add annual SDATES and HDATES outputs to clm-crop test.
samsrabin May 10, 2023
dc3158d
Removed duplicate RXCROPMATURITY from cime_config/config_tests.xml.
samsrabin May 11, 2023
229c9b7
Only allow RXCROPMATURITY to be called with test cropMonthOutput.
samsrabin May 11, 2023
49f2883
Removed an outdated comment from cime_config/config_tests.xml.
samsrabin May 11, 2023
5bc4a22
Update CIME and use new list-capable append_to_user_nl_files().
samsrabin May 11, 2023
ecd83f5
Improved error handling in RXCROPMATURITY.
samsrabin May 11, 2023
ff05829
RXCROPMATURITY: Move getting of rx crop files to its own function, ca…
samsrabin May 11, 2023
c9cc838
Deleted unused crop calendar shell scripts.
samsrabin May 12, 2023
4962a54
Remove unused variable from GDD generation import_and_process_1yr().
samsrabin May 12, 2023
946527b
generate_gdds.py: Minor rearrangement.
samsrabin May 12, 2023
f698a06
RXCROPMATURITY: Added support for 0.9 x 1.25 resolution.
samsrabin May 12, 2023
76e5c84
Variable name bugfix in RXCROPMATURITY.
samsrabin May 12, 2023
c2dddbf
RXCROPMATURITY: Hard-coded option to use fsurdat method instead of fl…
samsrabin May 12, 2023
3a91016
cropcal_module check_v0_le_v1(): Removed backward compatibility for f…
samsrabin May 15, 2023
7efbd52
cropcal_module now includes open_lu_ds().
samsrabin May 15, 2023
04ab76a
cropcal_module: Removed incl_irrig option from import_output().
samsrabin May 15, 2023
d065c4a
cropcal_module: Added missing diagnostic functions.
samsrabin May 15, 2023
ea14e55
fsurdat method works! Removed flanduse_timeseries option.
samsrabin May 15, 2023
f512081
Reworked RXCROPMATURITY log message prefix.
samsrabin May 15, 2023
8a81343
RXCROPMATURITY gddgen now uses simplified method to get fsurdat. BROK…
samsrabin May 15, 2023
8f5b1bd
RXCROPMATURITY: Fix to call of make_fsurdat_all_crops_everywhere.py.
samsrabin May 15, 2023
22d4f6a
make_fsurdat_all_crops_everywhere.py now respects -i/--input-file.
samsrabin May 16, 2023
e91139b
RXCROPMATURITY: Updated s/hdates for f09_g17.
samsrabin May 20, 2023
84c3def
Merge branch 'rxcropmaturity-fsurdat' into rxcropmaturity-test-dev
samsrabin May 21, 2023
91af08d
Merge branch 'rxcropmaturity-cleanup' into rxcropmaturity-test-dev
samsrabin May 21, 2023
e8835e5
RXCROPMATURITY: Update description of _run_make_surface_for_gddgen().
samsrabin May 21, 2023
337f20d
vernalization() kill no longer changes huigrain or gddmaturity.
samsrabin May 19, 2023
03ac2b3
Merge branch 'rx_crop_calendars2' into rxcropmaturity-test-dev
samsrabin May 22, 2023
3d2e765
In generate_gdds, chunk on import if possible (dask present).
samsrabin May 22, 2023
445fbd0
RXCROPMATURITY now uses npl conda env instead of ctsm_pylib, if avail…
samsrabin May 22, 2023
86a3b5e
Added RXCROPMATURITY to the ctsm_sci category in testlist_clm.xml.
samsrabin May 22, 2023
fe42f38
vernalization() kill no longer changes huigrain or gddmaturity.
samsrabin May 19, 2023
d23e47b
In generate_gdds, chunk on import if possible (dask present).
samsrabin May 22, 2023
fcb4771
RXCROPMATURITY now uses npl conda env instead of ctsm_pylib, if avail…
samsrabin May 22, 2023
b24c127
Added RXCROPMATURITY to the ctsm_sci category in testlist_clm.xml.
samsrabin May 22, 2023
6106c00
cropcal_figs_module no longer ignores import errors.
samsrabin May 22, 2023
42aa9c1
Merge branch 'gddgen-plots' into rxcropmaturity-test-dev
samsrabin May 22, 2023
d9e3c10
Removed ability of generate_gdds.py to handle GDDHARV in h3 instead o…
samsrabin May 22, 2023
84d161a
RXCROPMATURITY: Do not save daily HUI in GDD generation.
samsrabin May 22, 2023
7b59966
RDXCROPMATURITY: swapped h1 and h2 of daily gdd-gen outputs.
samsrabin May 22, 2023
7a5c38c
RXCROPMATURITY: Do not save any daily outputs for Prescribed Calendar…
samsrabin May 22, 2023
b519997
Added missing return statement from cropcal_module import_output().
samsrabin May 25, 2023
527d4fa
Finished switching h1 and h2.
samsrabin May 25, 2023
cb9c8ff
Merge branch 'rxcropmaturity-reduce-outdata' into rxcropmaturity-test…
samsrabin May 26, 2023
d2bcaf1
Bugfix in utils import_ds().
samsrabin May 26, 2023
2026dda
Removed unneeded imports from cropcal Python modules.
samsrabin May 26, 2023
e86eacc
Renamed .../crop_calendars/utils.py to .../cropcal_utils.py to disamb…
samsrabin May 26, 2023
753b7c3
RXCROPMATURITY: Syntax fix.
samsrabin May 26, 2023
d2c536e
RXCROPMATURITY: Use non-fill1 sdates.
samsrabin May 26, 2023
c71acfc
Merge branch 'rxcropmaturity-test-nofill1' into rxcropmaturity-test-dev
samsrabin May 30, 2023
30a758b
Updated check_rxboth_run.py to use h1 files.
samsrabin May 30, 2023
4290860
Merge branch 'rxcropmaturity-test-dev' into rx_crop_calendars4
samsrabin Jun 15, 2023
d0442ef
Update cime tag to cime6.0.129 to include append_to_user_nl_files() u…
samsrabin Jun 20, 2023
790d36c
Merge tag 'ctsm5.1.dev128' into rx_crop_calendars4
samsrabin Jun 21, 2023
c1ce8b8
Bugfix in nhtfrq of annual outputs in cropMonthOutput test.
samsrabin Jun 21, 2023
e98b248
Added per-harvest output variables to crop and cropMonthOutput tests.
samsrabin Jun 21, 2023
2500c41
Removed MCT version of cropcalStreamMod.
samsrabin Jun 21, 2023
0af2990
RXCROPMATURITY: Replaced path for sowing/harvest dates with path in s…
samsrabin Jun 21, 2023
ba27972
RXCROPMATURITY now uses DIN_LOC_ROOT instead of standard Cheyenne inp…
samsrabin Jun 21, 2023
aa3af72
Roll back cime to tag cime6.0.118.
samsrabin Jun 21, 2023
381c553
Merge branch 'rx_crop_calendars4-finishup' into rx_crop_calendars4
samsrabin Jun 23, 2023
86b4c65
Don't save *TO_FOOD_PERHARV and *TO_FOOD_ANN to primary tape.
samsrabin Jun 23, 2023
358802e
Removed MCT tests from testlist_clm.xml.
samsrabin Jun 26, 2023
81efbe0
Added CallRestartvarDimOK() stub to unit_test_stubs/utils/restUtilMod…
samsrabin Jun 26, 2023
64cb848
FSURDATMODIFYCTSM test now uses `conda run -n` instead of `conda acti…
samsrabin Jun 26, 2023
c97c142
Declared CallRestartvarDimOK a public member of restUtilMod_stub.F90.
samsrabin Jun 27, 2023
77c6fc9
Merge branch 'rx_crop_calendars4-ts' into rx_crop_calendars4
samsrabin Jun 27, 2023
72c7891
Merge tag 'ctsm5.1.dev129' into rx_crop_calendars4
samsrabin Jun 27, 2023
cc2ffe2
Do not checkout ctsm_py_gallery (unused).
samsrabin Jun 28, 2023
50e37c7
Revert a leftover troubleshooting change.
samsrabin Jun 28, 2023
8007919
Remove hard-coded verbose option from cropcalStreamMod.
samsrabin Jun 29, 2023
1980159
Replace \ line continuations with &.
samsrabin Jul 7, 2023
072cc48
Protect harvest "if do_plant and not did_plant" with use_cropcal_stre…
samsrabin Jul 7, 2023
99ec14a
Handle new GRAIN outputs in LREPRSTRUCT test.
samsrabin Jul 7, 2023
1a020a5
Merge branch 'rx_crop_calendars4-ans-chgs-03' into rx_crop_calendars4
samsrabin Jul 11, 2023
7daf217
Merge tag 'ctsm5.1.dev130' into rx_crop_calendars4
samsrabin Jul 11, 2023
bf1f25c
Renamed crop namelist to crop_inparm.
samsrabin Jul 11, 2023
c2002a9
Merge branch 'rx_crop_calendars4-ts-izumi-failreadcropnml' into rx_cr…
samsrabin Jul 11, 2023
45dce8e
Roll back cime: cime6.0.118 → 108.
samsrabin Jul 12, 2023
ca2d5e3
Revert "Roll back cime: cime6.0.118 → 108."
samsrabin Jul 12, 2023
5364ad6
Reformatting with black.
samsrabin Jul 12, 2023
2700356
Delete unused cropcals_generate_gdds test.
samsrabin Jul 12, 2023
8220435
Remove variable numbers from master_list_nofates.rst.
samsrabin Jul 12, 2023
b4b8ff3
Added new variables to master_list_nofates.rst
samsrabin Jul 12, 2023
18496f1
Added line numbers back to master_list_nofates.rst.
samsrabin Jul 12, 2023
8aaf644
Added temporary ChangeLog file.
samsrabin Jul 14, 2023
052397f
ChangeLog.tmp: build-namelist tests pass.
samsrabin Jul 14, 2023
26d2c7c
Updated ChangeLog.tmp.
samsrabin Jul 17, 2023
5d2a7f5
Description fix in namelist_definition_ctsm.xml.
samsrabin Jul 17, 2023
cac3986
Merge branch 'rx_crop_calendars4' into rx_crop_calendars2
samsrabin Jul 17, 2023
786c610
Updated .git-blame-ignore-revs.
samsrabin Jul 17, 2023
fb7e266
Removed a now-unneeded error check.
samsrabin Jul 19, 2023
fd896fe
Replaced .gt. 0 with > 0._r8.
samsrabin Jul 19, 2023
4e22d04
Improved a bit of ChangeLog.tmp.
samsrabin Jul 19, 2023
876d34f
ChangeLog.tmp: Replace code diffs with patch URLs.
samsrabin Jul 19, 2023
b5915c0
ChangeLog.tmp: Correct new CIME version.
samsrabin Jul 19, 2023
be0c9fb
ChangeLog.tmp: Marked answer changes as "larger than roundoff."
samsrabin Jul 19, 2023
7a494e0
Update cime from cime6.0.118 to 125.
samsrabin Jul 20, 2023
418d600
ChangeLog.tmp: Changes now classified as roundoff-level.
samsrabin Jul 20, 2023
17b4e49
ChangeLog.tmp: Removed "known bugs found since the previous tag" sect…
samsrabin Jul 20, 2023
233c2da
Removed unused make_surface_for_gddgen.py.
samsrabin Jul 20, 2023
7dadfed
Replace names/comments referencing make_surface_for_gddgen with make_…
samsrabin Jul 20, 2023
c1046b5
Remove unused argument of _run_make_fsurdat_all_crops_everywhere().
samsrabin Jul 20, 2023
d9445a7
Copy ggcmi_cropcals2.py into this repo as process_ggcmi_shdates.py.
samsrabin Jul 20, 2023
cdefb03
process shdates: Script is now called from the command line.
samsrabin Jul 20, 2023
6c7c54d
process shdates: Remove unused imports.
samsrabin Jul 20, 2023
ebc71b5
process shdates: Import cropcal_utils instead of CTSM Python gallery.
samsrabin Jul 20, 2023
2f42dde
process shdates: Move imports to top of script.
samsrabin Jul 20, 2023
1087fe4
process shdates: Read options from command-line.
samsrabin Jul 20, 2023
2d912a0
process shdates: Move "created" to be added to out_attrs with others.
samsrabin Jul 20, 2023
f363edc
process shdates: Add verbose to command-line options.
samsrabin Jul 20, 2023
3b4a81d
process shdates: Improve section headers.
samsrabin Jul 20, 2023
eac179c
Added -a/--author required argument.
samsrabin Jul 20, 2023
58281ae
process shdates: Added optional --ggcmi-author argument.
samsrabin Jul 20, 2023
6e669b2
process shdates: Rearranging.
samsrabin Jul 20, 2023
d792e71
Added regrid_ggcmi_shdates.py.
samsrabin Jul 20, 2023
13dcdf2
regrid_ggcmi_shdates: Added command-line arguments.
samsrabin Jul 20, 2023
d4b6087
process shdates: Improved parser descriptions.
samsrabin Jul 20, 2023
8358ba3
regrid_ggcmi_shdates: Fixes to handling of output directory.
samsrabin Jul 20, 2023
b19eca0
regrid_ggcmi_shdates: Minor rearranging.
samsrabin Jul 20, 2023
76f0d49
process shdates: Verbose now default true.
samsrabin Jul 21, 2023
dcfcf4b
regrid_ggcmi_shdates: Shell run stdout now included in error message.
samsrabin Jul 21, 2023
e89eb5d
regrid_ggcmi_shdates: Retry cdo command twice if needed.
samsrabin Jul 21, 2023
669020e
process shdates: Fix to argument order.
samsrabin Jul 21, 2023
7f240ed
process shdates: Implement os.path.join() in one place.
samsrabin Jul 21, 2023
ecc82ee
regrid and process shdates: Improve handling of relative command-line…
samsrabin Jul 21, 2023
5d0b103
process shdates: Improved -y1/-yN descriptions.
samsrabin Jul 21, 2023
ccc8303
process shdates: Don't generate "fill1" files.
samsrabin Jul 21, 2023
907f046
process shdates: Removed troubleshooting stop.
samsrabin Jul 21, 2023
18963f3
process shdates: Output file path generation cleaner and more robust.
samsrabin Jul 21, 2023
e71f959
generate_gdds.py no longer makes fill0 files.
samsrabin Jul 21, 2023
b4eb133
process shdates: Ensure output files have the same datetime string.
samsrabin Jul 21, 2023
3e55d86
process shdates: Leading underscore now assumed for file specifier.
samsrabin Jul 21, 2023
dc503e4
regrid shdates: Retry cdo again if needed.
samsrabin Jul 21, 2023
0f3d59f
process shdates: Improved a comment.
samsrabin Jul 21, 2023
aeda686
process shdates: Removed a bad error.
samsrabin Jul 21, 2023
85833b9
process shdates: -t/--template-file no longer used.
samsrabin Jul 21, 2023
ae643a0
regrid shdates: Corrected an argument description.
samsrabin Jul 21, 2023
a9bdfda
process shdates: Append resolution to dir w/ regridded files.
samsrabin Jul 21, 2023
5e4ffaf
process shdates: Remove unused code/comment.
samsrabin Jul 21, 2023
f8ab311
process shdates: Simplified I/O.
samsrabin Jul 21, 2023
952ec6a
process shdates: File format NETCDF3_CLASSIC.
samsrabin Jul 24, 2023
9987b41
process shdates: Don't save missing_value.
samsrabin Jul 24, 2023
fc37d6f
Move two error checks to CLMBuildNamelist.pm, and add one.
samsrabin Jul 25, 2023
d0d4015
Added --skip-crops argument for generate_gdds.
samsrabin Jul 25, 2023
d0b4409
generate_gdds: Don't try to save time_bounds if not present in rx sda…
samsrabin Jul 25, 2023
fd477aa
Merge branch 'rx_crop_calendars4' into process-ggcmi-shdates
samsrabin Jul 25, 2023
3b2a37a
Added --skip-crops arg to call of generate_gdds.py.
samsrabin Jul 25, 2023
8bc4688
Black reformatting.
samsrabin Jul 26, 2023
de7eed0
Added previous commit to .git-blame-ignore-revs.
samsrabin Jul 26, 2023
d64baba
Merge branch 'process-ggcmi-shdates' into rx_crop_calendars4
samsrabin Jul 26, 2023
16cc470
Merge branch 'rx_crop_calendars4' into rx_crop_calendars2
samsrabin Jul 26, 2023
ae5da4a
Updated ChangeLog.
samsrabin Jul 27, 2023
30e9189
Reverted outdated change to .gitignore.
samsrabin Jul 27, 2023
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
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ e44dc469439e02e9ee582dab274d890ebdfab104
b88e1cd1b28e3609684c79a2ec0e88f26cfc362b
51c102c5df2e0ef971b5f8eeeb477567899af63a
7dacad70e74e2ec97f6492d4e7a3cb5dd498bcd7
b771971e3299c4fa56534b93421f7a2b9c7282fd
9de88bb57ea9855da408cbec1dc8acb9079eda47
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ core.*
*.log !run.log
*.pyc
Depends
ts_generate_gdds.py
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.108
tag = cime6.0.118
required = True

[cmeps]
Expand Down
47 changes: 43 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1625,9 +1625,9 @@ sub process_namelist_inline_logic {
setup_logic_urban($opts, $nl_flags, $definition, $defaults, $nl);

###############################
# namelist group: crop #
# namelist group: crop_inparm #
###############################
setup_logic_crop($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_crop_inparm($opts, $nl_flags, $definition, $defaults, $nl);

###############################
# namelist group: ch4par_in #
Expand Down Expand Up @@ -1695,6 +1695,11 @@ sub process_namelist_inline_logic {
##################################
setup_logic_lai_streams($opts, $nl_flags, $definition, $defaults, $nl);

##################################
# namelist group: cropcal_streams #
##################################
setup_logic_cropcal_streams($opts, $nl_flags, $definition, $defaults, $nl);

##########################################
# namelist group: soil_moisture_streams #
##########################################
Expand Down Expand Up @@ -2149,7 +2154,7 @@ sub setup_logic_urban {

#-------------------------------------------------------------------------------

sub setup_logic_crop {
sub setup_logic_crop_inparm {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

if ( &value_is_true($nl->get_value('use_crop')) ) {
Expand Down Expand Up @@ -3920,6 +3925,39 @@ 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, 'generate_crop_gdds');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat');

# Consistency checking: Do not generate_crop_gdds without use_mxmat false
my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ;
my $use_mxmat = $nl->get_value('use_mxmat') ;
if ( $generate_crop_gdds eq '.true.' and $use_mxmat eq '.true.' ) {
$log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" );
}
}

#-------------------------------------------------------------------------------

sub setup_logic_soilwater_movement {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

Expand Down Expand Up @@ -4297,14 +4335,15 @@ sub write_output_files {
my @groups;
@groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams
soil_moisture_streams lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology
cropcal_streams
clm_soilhydrology_inparm dynamic_subgrid cnvegcarbonstate
finidat_consistency_checks dynpft_consistency_checks
clm_initinterp_inparm century_soilbgcdecompcascade
soilhydrology_inparm luna friction_velocity mineral_nitrogen_dynamics
soilwater_movement_inparm rooting_profile_inparm
soil_resis_inparm bgc_shared canopyfluxes_inparm aerosol
clmu_inparm clm_soilstate_inparm clm_nitrogen clm_snowhydrology_inparm
cnprecision_inparm clm_glacier_behavior crop irrigation_inparm
cnprecision_inparm clm_glacier_behavior crop_inparm irrigation_inparm
surfacealbedo_inparm water_tracers_inparm);

#@groups = qw(clm_inparm clm_canopyhydrology_inparm clm_soilhydrology_inparm
Expand Down
7 changes: 7 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<min_critical_dayl_method use_cn=".true." phys="clm5_1" >DependsOnLat</min_critical_dayl_method>
<onset_thresh_depends_on_veg >.false.</onset_thresh_depends_on_veg>
<min_critical_dayl_method >Constant</min_critical_dayl_method>
<generate_crop_gdds >.false.</generate_crop_gdds>
<use_mxmat >.true.</use_mxmat>

<!-- use additional stress deciduous onset trigger -->
<constrain_stress_deciduous_onset phys="clm4_5" >.false.</constrain_stress_deciduous_onset>
Expand Down Expand Up @@ -1665,6 +1667,11 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<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>

<!-- lightning streams namelist defaults -->

<light_res use_cn=".false." >none</light_res>
Expand Down
51 changes: 48 additions & 3 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1090,20 +1090,20 @@ Toggle to turn on the 1-year grain product pool in the crop model
</entry>

<entry id="baset_mapping" type="char*20" category="physics"
group="crop" valid_values="constant,varytropicsbylat" value="constant">
group="crop_inparm" valid_values="constant,varytropicsbylat" value="constant">
Type of mapping to use for base temperature for prognostic crop model
constant = Just use baset from the PFT parameter file
varytropicsbylat = Vary the tropics by latitude
</entry>

<entry id="baset_latvary_slope" type="real" category="physics"
group="crop" valid_values="" value="0.4d00">
group="crop_inparm" valid_values="" value="0.4d00">
Only used when baset_mapping == varytropicsbylat
Slope with latitude in degrees to vary tropical baset by
</entry>

<entry id="baset_latvary_intercept" type="real" category="physics"
group="crop" valid_values="" value="12.0d00">
group="crop_inparm" valid_values="" value="12.0d00">
Only used when baset_mapping == varytropicsbylat
Intercept at zero latitude to add to baset from the PFT parameter file
</entry>
Expand All @@ -1129,6 +1129,16 @@ Phenology onset depends on the vegetation type
(only used when CN is on)
</entry>

<entry id="generate_crop_gdds" type="logical" category="physics"
group="cnphenology" valid_values="" value=".false.">
Set to .true. in order to override crop harvesting logic and to instead harvest the day before the next sowing date. Used to generate growing-degree day outputs that can be used with an external script to generate new GDD requirement ("cultivar") files.
</entry>

<entry id="use_mxmat" type="logical" category="physics"
group="cnphenology" valid_values="" value=".true.">
Set to .false. in order to ignore crop PFT parameter for maximum growing season length (mxmat). Must be set to .false. when generate_crop_gdds is .true.
</entry>

<entry id="min_critical_dayl_method" type="char*25" category="physics"
group="cnphenology" valid_values="Constant,DependsOnLat,DependsOnVeg,DependsOnLatAndVeg">
Method for determining what the minimum critical day length for seasonal decidious leaf offset depends on
Expand Down Expand Up @@ -1805,6 +1815,41 @@ Mapping method from LAI input file to the model resolution
copy = copy using the same indices
</entry>

<!-- ======================================================================================== -->
<!-- cropcal_streams streams Namelist -->
<!-- ======================================================================================== -->

<!-- Crop calendars -->
<entry id="stream_year_first_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
First year to loop over for crop calendar data
</entry>

<entry id="stream_year_last_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
Last year to loop over for crop calendar data
</entry>

<entry id="model_year_align_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
Simulation year that aligns with stream_year_first_cropcal value
</entry>

<entry id="stream_fldfilename_sdate" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for sowing dates
</entry>

<entry id="stream_fldfilename_cultivar_gdds" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for cultivar growing degree-day targets
</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
</entry>

<!-- ======================================================================================== -->
<!-- light_streams streams Namelist (when CN an CLM4_5 is active) -->
<!-- ======================================================================================== -->
Expand Down
57 changes: 8 additions & 49 deletions cime_config/SystemTests/fsurdatmodifyctsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import os
import re
import subprocess
import systemtest_utils as stu
from CIME.SystemTests.system_tests_common import SystemTestsCommon
from CIME.XML.standard_module_setup import *
from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files
Expand Down Expand Up @@ -69,58 +69,17 @@ def _run_modify_fsurdat(self):
tool_path = os.path.join(self._ctsm_root, "tools/modify_input_files/fsurdat_modifier")

self._case.load_env(reset=True)
conda_env = ". " + self._get_caseroot() + "/.env_mach_specific.sh; "
# Preprend the commands to get the conda environment for python first
conda_env += self._get_conda_env()
# Source the env
try:
subprocess.run(
conda_env + "python3 " + tool_path + " " + self._cfg_file_path,
shell=True,
check=True,
)
except subprocess.CalledProcessError as error:
print("ERROR while getting the conda environment and/or ")
print("running the fsurdat_modifier tool: ")
print("(1) If your ctsm_pylib environment is out of date or you ")
print("have not created the ctsm_pylib environment, yet, you may ")
print("get past this error by running ./py_env_create ")
print("in your ctsm directory and trying this test again. ")
print("(2) If conda is not available, install and load conda, ")
print("run ./py_env_create, and then try this test again. ")
print("(3) If (1) and (2) are not the issue, then you may be ")
print("getting an error within the fsurdat_modifier tool itself. ")
print("Default error message: ")
print(error.output)
raise
except:
print("ERROR trying to run fsurdat_modifier tool.")
raise
command = f"python3 {tool_path} {self._cfg_file_path}"
stu.run_python_script(
self._get_caseroot(),
"ctsm_pylib",
command,
tool_path,
)

def _modify_user_nl(self):
append_to_user_nl_files(
caseroot=self._get_caseroot(),
component="clm",
contents="fsurdat = '{}'".format(self._fsurdat_out),
)

def _get_conda_env(self):
#
# Add specific commands needed on different machines to get conda available
# Use semicolon here since it's OK to fail
#
# Execute the module unload/load when "which conda" fails
# eg on cheyenne
try:
subprocess.run("which conda", shell=True, check=True)
conda_env = " "
except subprocess.CalledProcessError:
# Remove python and add conda to environment for cheyennne
conda_env = "module unload python; module load conda;"

# Activate the python environment
conda_env += " conda activate ctsm_pylib"
# End above to get to actual command
conda_env += " && "

return conda_env
14 changes: 14 additions & 0 deletions cime_config/SystemTests/lreprstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ def _case_one_setup(self):
contents="for_testing_use_repr_structure_pool=.true.",
)

# Replace any GRAIN outputs with the same outputs for REPRODUCTIVE1 and REPRODUCTIVE2
user_nl_clm_path = os.path.join(self._get_caseroot(), "user_nl_clm")
with open(user_nl_clm_path) as f:
user_nl_clm_text = f.read()
for grain_output in re.findall("GRAIN\w*", user_nl_clm_text):
user_nl_clm_text = user_nl_clm_text.replace(
grain_output,
grain_output.replace("GRAIN", "REPRODUCTIVE1")
+ "', '"
+ grain_output.replace("GRAIN", "REPRODUCTIVE2"),
)
with open(user_nl_clm_path, "w") as f:
f.write(user_nl_clm_text)

def _case_two_setup(self):
# This is needed in the nearly-standard case to prevent grain from being used to
# replenish crop seed deficits, thus making grain act like the reproductive
Expand Down
Loading