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

FATES land use v2 API update (CTSM-side) #2507

Merged
merged 131 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
48b52dc
Point FATES external at Charlie's LUH2 branch.
samsrabin Apr 17, 2024
526bc19
Update CTSM to work with FATES LUH2. Some issues remain.
samsrabin Apr 17, 2024
46420cf
Add fates_landuse_v2 test suite.
samsrabin Apr 18, 2024
e4c8b6a
Point FATES external to my repo: Nag array index fix.
samsrabin Apr 18, 2024
7216006
Apply relevant changes from rgknox/fates-auto-params.
samsrabin Apr 18, 2024
a7c21a7
Don't allow flandusepftdat to be set in non-FATES runs.
samsrabin Apr 23, 2024
90a4028
Actually set flandusepftdat in CLMBuildNamelist.pm.
samsrabin Apr 23, 2024
d88fda0
Update path for default flandusepftdat.
samsrabin Apr 23, 2024
a731954
Point FATES external back at Charlie's branch.
samsrabin Apr 28, 2024
0191278
Add missing potential veg to build list.
samsrabin Apr 28, 2024
fffb794
add use_fates_lupft switch
glemieux May 1, 2024
5d11bcf
add fates use_potentialveg namelist defaults settings and checks
glemieux May 1, 2024
6bd7d37
add use_fates_lupft to default namelist
glemieux May 2, 2024
edae95a
manually revert defaults for use_fates_lupft and fix calls to fatal_e…
glemieux May 4, 2024
af6a1c0
remove old flandusepftdat add_default and fix use_fates_lupft check
glemieux May 4, 2024
d5575d5
correct call to add_default for use_fates_lupft dependency with use_f…
glemieux May 4, 2024
ea773e4
add use_fates_lupft dependencies for nocomp and fbg
glemieux May 4, 2024
a21181f
add fates_harvest_mode to use_fates_luh check
glemieux May 5, 2024
d8178e4
add use_fates_potentialveg to use_fates_luh check
glemieux May 5, 2024
9751fb6
add check to fates sp mode to make sure landuse isn't enabled
glemieux May 5, 2024
75f9cc5
rename luh unit test that matched old test
glemieux May 6, 2024
ff3af55
add build namelist unit tests for fates landuse v2
glemieux May 6, 2024
69154da
update fates logging unit test to use new fates harvest mode
glemieux May 6, 2024
5c5ca6f
minor update
glemieux May 6, 2024
2a88002
change lupft check to fbg + luh check to mirror fates-side logic
glemieux May 7, 2024
1ffa406
Merge pull request #1 from glemieux/fates-landuse-v2-modechecks
samsrabin May 7, 2024
0bcf80a
FatesColdLUH2 tests now use use_fates_nocomp false.
samsrabin May 1, 2024
0edcb1b
Update FATES external to latest ckoven/luh2_nocomp_merge.
samsrabin May 8, 2024
92fb806
Update FatesColdLUH2 testdef.
samsrabin May 8, 2024
f672801
Add FatesColdLUH2Mode0 testdef.
samsrabin May 8, 2024
05332fb
Remove get_do_harvest dependency for fates harvest modes
glemieux May 9, 2024
a35f91d
fix check to be only during use of clm landuse timeseries for fates
glemieux May 9, 2024
74e8666
fix passing num landuse harvest vars to the fates landuse harvest cat…
glemieux May 9, 2024
fd07890
fix missing end if
glemieux May 9, 2024
72ed623
update do_harvest to not be compatible with fates
May 9, 2024
f00ba49
remove fates from the do_harvest section altogether
glemieux May 9, 2024
278a901
fix if statements
glemieux May 10, 2024
d66ddff
update fates_harvest_mode to use chars to set namelist options
glemieux May 13, 2024
c5b92ec
Merge remote-tracking branch 'glemieux/fates-landuse-v2-harvestmodese…
glemieux May 13, 2024
458c788
add default pass values for logging and harvest
glemieux May 13, 2024
28f5bc3
update fates_harvest_mode to accept strings
glemieux May 13, 2024
f19a080
add more landuse graceful failures
glemieux May 15, 2024
02fc1ef
Merge remote-tracking branch 'glemieux/fates-landuse-v2-harvestmodese…
glemieux May 16, 2024
7c5c632
fix namelist definition
glemieux May 16, 2024
0266a70
update landuse parameters from ints to chars
glemieux May 16, 2024
a73705e
merge resolution between fates luh2 and 5.2.005
rgknox May 17, 2024
438d85a
Added a missing bracket
rgknox May 17, 2024
e6f62c4
fix reading of fates_harvest_modes during namelist build checks
glemieux May 17, 2024
093f066
minor comment update
glemieux May 17, 2024
3967d77
new fates api 36 paramfile default
rgknox May 22, 2024
423f5bb
Merge pull request #4 from rgknox/fates-landuse-v2-api35
samsrabin May 22, 2024
07e811e
Merge pull request #2 from glemieux/fates-landuse-v2-harvestmodesepar…
samsrabin May 22, 2024
0676cf3
Merge pull request #3 from glemieux/fates-landuse-v2-fhm-chars
samsrabin May 22, 2024
5b30740
Pin FATES external to commit a997af5.
samsrabin May 22, 2024
2a7ca01
add systemtest for potential vegetation spin up
May 23, 2024
b7cf13f
add PVT system test to the config_test xml file
glemieux May 23, 2024
8e35d80
add test mode for use_fates_lupft
glemieux May 23, 2024
af5451b
remove tabs and correct whitespace
glemieux May 23, 2024
00d23e9
correct add default for fluh and flandusepftdat
glemieux May 23, 2024
2ac13bc
correct typos causing RunTimeError to be missed
glemieux May 23, 2024
f4ff559
remove tabs again
glemieux May 23, 2024
de8c0a3
update what new utility function returns as output
glemieux May 24, 2024
cd04c06
change dictionary to ordered dict
glemieux May 24, 2024
dab6361
pvt system init step update
glemieux May 24, 2024
175a3d0
pvt system test setup looks correct
glemieux May 25, 2024
10728d9
add non-Cold based testmod for spinup + transient
glemieux May 25, 2024
0537a6a
add potential veg check to avoid accessing timeseries file
glemieux May 29, 2024
dbbd795
change fluh_timeseries to use an file with wider time range
glemieux May 29, 2024
2848873
fix pvt system test
glemieux May 29, 2024
709c3da
remove unnecessary import call
glemieux May 29, 2024
1dc3d3c
Merge tag 'ctsm5.2.006' into fates-landuse-v2-deconflict_006
glemieux May 30, 2024
071d076
Merge pull request #5 from glemieux/fates-landuse-v2-deconflict_006
samsrabin May 31, 2024
eb9f1f3
Merge pull request #7 from glemieux/fates-landuse-v2-systest
samsrabin May 31, 2024
aed9d31
remove hydro tests that are now passing per NGEET/FATES#1164
glemieux Jun 4, 2024
be4f999
Merge tag 'ctsm5.2.007' into fates-landuse-v2
glemieux Jun 11, 2024
628be7b
temporarily update fates to point to latest pull request commit hash
glemieux Jun 11, 2024
422f06f
add fates potential vegetation spin up to transient test mod
glemieux Jun 25, 2024
f9d8349
rename fates luh2 harvest modes
glemieux Jun 25, 2024
5a46b93
remove fates land use no harvest due to overlap
glemieux Jun 26, 2024
3318d3b
update fates landuse harvest test mod names
glemieux Jun 26, 2024
5571017
Merge tag 'branch_tags/tmp-240620.n02.ctsm5.2.007' into fates-landuse…
glemieux Jun 27, 2024
34c4db0
Revert "Apply relevant changes from rgknox/fates-auto-params."
glemieux Jun 27, 2024
6a27513
Merge pull request #8 from glemieux/fates-landuse-v2-merge
samsrabin Jun 27, 2024
99d0f2b
move fates landuse test mods to fates suite
glemieux Jun 27, 2024
535033b
remove flandusepft and fluh_times pointers for testmod
glemieux Jun 28, 2024
8793f47
add readme noting grid resolution limitation
glemieux Jun 28, 2024
95bf3f8
add fates harvest event expected failure
glemieux Jun 28, 2024
889cc97
update seed dispersal test mod to put on-the-fly generated paramfile …
glemieux Jun 27, 2024
f58cd7e
reinstate fates-landuse as a second, shorter test list
glemieux Jun 28, 2024
9465da6
fix luh2 harvest testmod
glemieux Jun 28, 2024
c2deb25
rename fates landuse to luh2harvestevent
glemieux Jun 28, 2024
4d0b49a
fix fates harvest event code testmod
glemieux Jun 28, 2024
387ac5e
add description to flandusepftdat definition
glemieux Jun 28, 2024
16a9223
update flandusepftdat description with note about use_fates_lupft
glemieux Jun 28, 2024
f985fba
rename misleading surfdata_file option name to the landuse_timeseries
glemieux Jun 28, 2024
31803d9
add language about age and possible future deprication of
glemieux Jun 28, 2024
3ff5f4a
fix copy/paste typo
glemieux Jun 28, 2024
32b2554
add clarifying language for use_fates_potentialveg
glemieux Jun 28, 2024
aaaff22
add clearer instructions about when to use_fates_potentialveg
glemieux Jun 28, 2024
f6f7b2d
add language explaining what use_fates_lupft does
glemieux Jun 28, 2024
df42d8e
Merge remote-tracking branch 'escomp/master' into fates-landuse-v2
glemieux Jun 28, 2024
2539cea
add readme to FatesLUPFT test mod
glemieux Jun 28, 2024
bf46d33
update fates logging test with new harvest event code
glemieux Jul 1, 2024
96d1a78
reinstate FatesColdLandUse
glemieux Jul 1, 2024
f47e2bf
remove duplicate tests
glemieux Jul 1, 2024
0e6eed5
Revert "update seed dispersal test mod to put on-the-fly generated pa…
glemieux Jul 5, 2024
a486e86
update harvest parameter variables lengths
glemieux Jul 6, 2024
fafc813
update fates submodule to api 36
glemieux Jul 8, 2024
e49c11d
update ChangeLog and ChangeSum
glemieux Jul 9, 2024
da50efd
add clarifying language for user about FATES and do_harvest
glemieux Jul 9, 2024
2b50ebb
correct fluh_timeseries file name
glemieux Jul 9, 2024
03ab3bd
remove out-dated-comment
glemieux Jul 9, 2024
272f99f
remove unused land use mod subroutine
glemieux Jul 9, 2024
093f5fb
Update bld/namelist_files/namelist_definition_ctsm.xml with note aste…
glemieux Jul 12, 2024
63c4582
Update bld/namelist_files/namelist_definition_ctsm.xml with astericks
glemieux Jul 12, 2024
1e9df49
update comment regarding landuse x pft data set
glemieux Jul 12, 2024
48aeb43
Update README with suggested clarification
glemieux Jul 12, 2024
9ee7561
fix how harvest mode is passed to add_default for use_fates_luh
glemieux Jul 12, 2024
48368ac
add comment pointing to luh2 data set readme
glemieux Jul 12, 2024
b0e6565
add single quotes around fates_harvest_mode in unit tests
glemieux Jul 12, 2024
664eb44
Merge remote-tracking branch 'escomp/master' into fates-landuse-v2
glemieux Jul 12, 2024
12c60f3
correct POTVEG fail unit test
glemieux Jul 12, 2024
322097f
change folder name for fates land use x pft files
glemieux Jul 15, 2024
9db4d48
add izumi luh2 failure to expected list
glemieux Jul 16, 2024
1de58fb
update fates to sci.1.77.1_api.36.0.0
glemieux Jul 17, 2024
1a7fe40
Merge tag 'ctsm5.2.012' into fates-landuse-v2
glemieux Jul 17, 2024
47571d8
formatting fixed for changelog
glemieux Jul 17, 2024
e4142b9
fixing bad merge with changelog
glemieux Jul 17, 2024
75cd2f4
reformat new and updated systests with black
glemieux Jul 17, 2024
3416574
update date
Jul 18, 2024
f36659e
Merge pull request #9 from adrifoster/fates-landuse-v2-datechange
samsrabin Jul 18, 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
Prev Previous commit
Next Next commit
manually revert defaults for use_fates_lupft and fix calls to fatal_e…
…rror
  • Loading branch information
glemieux committed May 4, 2024
commit edae95a1013439e234e7d56d57c01efc74ce063f
25 changes: 15 additions & 10 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4371,19 +4371,24 @@ sub setup_logic_fates {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence",
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage",
"use_fates_luh","use_fates_lupft" );
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage");
foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'},
'use_fates_sp'=>$nl_flags->{'use_fates_sp'} );
}

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'},
'use_fates_lupft'=>$nl_flags->{'use_fates_lupft'} );

my $suplnitro = $nl->get_value('suplnitro');
my $parteh_mode = $nl->get_value('fates_parteh_mode');
if ( ($parteh_mode == 1) && ($suplnitro !~ /ALL/) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) {
$log->fatal_error("supplemental Nitrogen (suplnitro) is NOT set to ALL, FATES is on, " .
"but and FATES-SP is not active, but fates_parteh_mode is 1, so Nitrogen is not active" .
"Change suplnitro back to ALL");
}

#
# For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set
# And also check for other settings that can't be trigged on as well
Expand Down Expand Up @@ -4425,16 +4430,16 @@ sub setup_logic_fates {
'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 );
my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) );
if ( ! defined($nl->get_value($var)) ) {
fatal_error("$var is required when use_fates_lupft is set" );
$log->fatal_error("$var is required when use_fates_lupft is set" );
} elsif ( ! -f "$fname" ) {
fatal_error("$fname does NOT point to a valid filename" );
$log->fatal_error("$fname does NOT point to a valid filename" );
}
}
# make sure that nocomp and fbg mode are enabled as well as use_fates_luh
my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" );
foreach my $var ( @list ) {
if ( ! &value_is_true($nl->get_value($var)) ) {
fatal_error("$var is required when use_fates_lupft is true" );
$log->fatal_error("$var is required when use_fates_lupft is true" );
}
}
}
Expand All @@ -4461,10 +4466,10 @@ sub setup_logic_fates {
if ( defined($nl->get_value($var)) ) {
if ( &value_is_true($nl->get_value($var)) ) {
if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) {
fatal_error("use_fates_luh must be true when $var is true" );
$log->fatal_error("use_fates_luh must be true when $var is true" );
}
if ( $nl->get_value('fates_harvest_mode') > 0) {
fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" );
$log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" );
}
}
}
Expand All @@ -4475,17 +4480,17 @@ sub setup_logic_fates {
# if ( $nl->get_value($var) == 2) {
# # Make sure that do_harvest is set to true
# if ( ! &value_is_true($nl->get_value('do_harvest')) ) {
# fatal_error("do_harvest must be true when $var is equal to 2" );
# $log->fatal_error("do_harvest must be true when $var is equal to 2" );
# }
# using fates_harvest mode with raw luh2 harvest data
if ( $nl->get_value($var) > 2) {
# Make sure that use_fates_luh is true when using raw fates luh2 harvest data
if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) {
fatal_error("use_fates_luh is required to be true when $var is greater than 2" );
$log->fatal_error("use_fates_luh is required to be true when $var is greater than 2" );
}
# do_harvest can not be on if we are using the raw fates luh2 harvest data
if ( &value_is_true($nl->get_value('do_harvest')) ) {
fatal_error("do_harvest can not be true when $var is greater than 2" );
$log->fatal_error("do_harvest can not be true when $var is greater than 2" );
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2769,19 +2769,16 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<use_fates_sp use_fates=".true.">.false.</use_fates_sp>
<use_fates_lupft use_fates=".true.">.false.</use_fates_lupft>
<use_fates_potentialveg use_fates=".true.">.false.</use_fates_potentialveg>
<use_fates_luh use_fates=".true." fates_harvest_mode="3" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." fates_harvest_mode="4" >.true.</use_fates_luh>

<use_fates_luh use_fates=".true." use_fates_lupft=".true." >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_potentialveg=".true.">.true.</use_fates_luh>
<use_fates_luh use_fates=".true." >.false.</use_fates_luh>

<fates_parteh_mode use_fates=".true.">1</fates_parteh_mode>
<fates_seeddisp_cadence use_fates=".true.">0</fates_seeddisp_cadence>

<use_fates_nocomp use_fates=".true." use_fates_sp=".true." >.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." >.false.</use_fates_nocomp>
<use_fates_fixed_biogeog use_fates=".true." use_fates_sp=".true." >.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." >.false.</use_fates_fixed_biogeog>

<!-- ========================================= -->
Expand Down