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

ctsm5.3.022: Update FATES namelist and build options to avoid Meier2022 #2934

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b441507
moved the passing of the use_luh2 flag to fates earlier in the sequen…
rgknox Dec 4, 2024
4bff2f2
updated naming convention of local variables
rgknox Dec 4, 2024
cf5d00d
add graceful failure if for Meier2022 and use_fates combo
glemieux Jan 14, 2025
dbb6192
add default option to z0param_method
glemieux Jan 14, 2025
43407e1
add endrun call during initialization if Meier2022 is run with fates
glemieux Jan 14, 2025
cb361eb
update comment and error message with issue number
glemieux Jan 15, 2025
57f3d21
add failure unit test for Meier2022 and fates
glemieux Jan 15, 2025
97ac823
add use_fates to add_default call in roughness bld logic
glemieux Jan 15, 2025
17ca334
change secondary forest history names per ngeet/fates#1273
glemieux Jan 15, 2025
23b30ae
Revert "add endrun call during initialization if Meier2022 is run wit…
glemieux Jan 15, 2025
ccb55da
add Meier2022 check in control_init fates section
glemieux Jan 15, 2025
51d5bf5
fix fates secondary history output name in allvars
glemieux Jan 31, 2025
1137ffa
add missing variables that should be in allvars
glemieux Jan 31, 2025
cdaa96b
Merge remote-tracking branch 'rgknox/fates-luh2flag-order' into fates…
glemieux Jan 31, 2025
00026b0
Merge remote-tracking branch 'glemieux/fates-allvar-testupdate' into …
glemieux Jan 31, 2025
dec3271
Merge tag 'ctsm5.3.021' into fates-meier-bldcheck
glemieux Jan 31, 2025
b1668f4
remove fates_l2fr_clszpf for fatescoldallvars
glemieux Jan 31, 2025
9d987f3
Merge remote-tracking branch 'glemieux/fates-allvar-testupdate' into …
glemieux Jan 31, 2025
a346a18
update fates tag to sci.1.80.11_api.37.0.0
glemieux Jan 31, 2025
0ac98fb
add fates issue 1324 to the expected failure list
glemieux Feb 3, 2025
f31299b
Revert "add fates issue 1324 to the expected failure list"
glemieux Feb 3, 2025
2322c7b
remove FATES_C13_DISC_SZPF
glemieux Feb 3, 2025
85fbb83
update Changelog and Changesum
glemieux Feb 4, 2025
57f5518
update fates izumi results for ctsm5.3.022
glemieux Feb 4, 2025
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: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[submodule "fates"]
path = src/fates
url = https://github.com/NGEET/fates
fxtag = sci.1.80.4_api.37.0.0
fxtag = sci.1.80.11_api.37.0.0
fxrequired = AlwaysRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/NCAR/fates-release
Expand Down
10 changes: 7 additions & 3 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2118,17 +2118,21 @@ sub setup_logic_roughness_methods {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

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

my $var = remove_leading_and_trailing_quotes( $nl->get_value("z0param_method") );
if ( $var ne "Meier2022" && $var ne "ZengWang2007" ) {
$log->fatal_error("$var is incorrect entry for the namelist variable z0param_method; expected Meier2022 or ZengWang2007");
}
my $phys = $physv->as_string();
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
if ( $phys eq "clm4_5" || $phys eq "clm5_0" ) {
if ( $var eq "Meier2022" ) {
if ( $var eq "Meier2022" ) {
if ( $phys eq "clm4_5" || $phys eq "clm5_0" ) {
$log->fatal_error("z0param_method = $var and phys = $phys, but this method has been tested only with clm6_0 and later versions; to use with earlier versions, disable this error, and add Meier2022 parameters to the corresponding params file");
}
# Make sure that fates and meier2022 are not both active due to issue #2932
if ( &value_is_true($nl_flags->{'use_fates'}) ) {
$log->fatal_error("z0param_method = $var and use_fates currently are not compatible. Please update the z0param_method to ZengWang2007. See issue #2932 for more information.")
}
}
}
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- ================================================================== -->

<z0param_method>ZengWang2007</z0param_method>
<z0param_method phys="clm6_0">Meier2022</z0param_method>
<z0param_method use_fates=".false." phys="clm6_0" >Meier2022</z0param_method>

<use_z0m_snowmelt z0param_method="Meier2022" >.true.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>
Expand Down
8 changes: 6 additions & 2 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile {
#
# Figure out number of tests that will run
#
my $ntests = 3263;
my $ntests = 3264;

if ( defined($opts{'compare'}) ) {
$ntests += 1979;
$ntests += 1980;
}
plan( tests=>$ntests );

Expand Down Expand Up @@ -1185,6 +1185,10 @@ sub cat_and_create_namelistinfile {
namelst=>"use_hydrstress=.true.",
phys=>"clm5_0",
},
"useMeierwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
namelst=>"z0param_method=Meier2022",
phys=>"clm5_0",
},
"noanthro_w_crop" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -crop -use_case 1850_noanthro_control",
namelst=>"",
phys=>"clm5_0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use_fates_tree_damage = .true.
hist_ndens = 1
hist_fincl1 = 'FATES_TLONGTERM',
'FATES_TGROWTH','FATES_SEEDS_IN_GRIDCELL_PF','FATES_SEEDS_OUT_GRIDCELL_PF','FATES_NCL_AP',
'FATES_NPATCH_AP','FATES_VEGC_AP','FATES_SECONDAREA_ANTHRODIST_AP','FATES_SECONDAREA_DIST_AP',
'FATES_NPATCH_AP','FATES_VEGC_AP','FATES_SECONDARY_ANTHRODISTAGE_AP','FATES_SECONDARY_AREA_AP',
'FATES_FUEL_AMOUNT_APFC','FATES_STOREC_TF_USTORY_SZPF','FATES_STOREC_TF_CANOPY_SZPF',
'FATES_CROWNAREA_CLLL','FATES_ABOVEGROUND_MORT_SZPF',
'FATES_ABOVEGROUND_PROD_SZPF','FATES_NPLANT_SZAP','FATES_NPLANT_CANOPY_SZAP',
Expand Down Expand Up @@ -56,4 +56,5 @@ hist_fincl1 = 'FATES_TLONGTERM',
'FATES_PARSUN_CL','FATES_PARSHA_CL','FATES_LAISUN_CLLL','FATES_LAISHA_CLLL','FATES_LAISUN_CLLLPF',
'FATES_LAISHA_CLLLPF','FATES_PARPROF_DIR_CLLLPF','FATES_PARPROF_DIF_CLLLPF','FATES_LAISUN_CL','FATES_LAISHA_CL',
'FATES_PARPROF_DIR_CLLL','FATES_PARPROF_DIF_CLLL','FATES_NET_C_UPTAKE_CLLL','FATES_CROWNFRAC_CLLLPF',
'FATES_LBLAYER_COND_AP','FATES_STOMATAL_COND_AP'
'FATES_LBLAYER_COND_AP','FATES_STOMATAL_COND_AP','FATES_TLONGTERM','FATES_PRIMARY_AREA_AP','FATES_NPP_LU',
'FATES_GPP_LU'
86 changes: 86 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
===============================================================
Tag name: ctsm5.3.022
Originator(s): glemieux (Gregory Lemieux, LBNL, [email protected])
Date: Tue Feb 4 09:41:49 AM PST 2025
One-line Summary: Update FATES namelist build to avoid Meier2022

Purpose and description of changes
----------------------------------

This tag brings in three updates, the primary of which is an update to the namelist
build to avoid running FATES with roughness method Meier2022 in light of recently
discovered incompatibility between FATES and this method. FATES will now used
ZengWang2007 for all run mode.

The other two updates are fairly minor changes. One is a B4B change to the order in
which the use_fates_luh flag is passed to FATES. The other is an update to history
outputs for the FatesColdAllVars testmod per a recent FATES-side update.


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm6_0

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed
----------

#2932 - 'Meier 2022' z0 parameterization causes errors with FATES

Testing summary:
----------------

[PASS means all tests PASS; OK means tests PASS other than expected fails.]

build-namelist tests (if CLMBuildNamelist.pm has changed):

derecho - PASS

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho ----- OK
izumi -------

fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates-<FATES TAG>-<CTSM TAG>)
derecho ----- OK
izumi ------- OK

If the tag used for baseline comparisons was NOT the previous tag, note that here:

fates suite tested against fates-sci.1.80.10_api.37.0.0-ctsm5.3.021

Answer changes
--------------

Changes answers relative to baseline: Yes, only some FATES tests

The FATES tag has been updated from sci.1.80.4_api.37.0.0 to sci.1.80.11_api.37.0.0,
which includes a number of bug fixes some of which result in changes to some baselines.
Additional, all tests using Clm60Fates based compsets have DIFFs due to the roughness
method update.

Other details
-------------
List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
fates: sci.1.80.4_api.37.0.0 -> sci.1.80.11_api.37.0.0

Pull Requests that document the changes (include PR ids):
(https://github.com/ESCOMP/ctsm/pull)
https://github.com/ESCOMP/CTSM/pull/2934
https://github.com/ESCOMP/CTSM/pull/2936
https://github.com/ESCOMP/CTSM/pull/2898
https://github.com/NGEET/FATES/pull/1273

===============================================================
===============================================================
Tag name: ctsm5.3.021
Originator(s): samrabin (Sam Rabin, UCAR/TSS)
Date: Wed 29 Jan 2025 04:21:40 PM MST
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.3.022 glemieux 02/04/2025 Update FATES namelist build to avoid Meier2022
ctsm5.3.021 samrabin 01/29/2025 Standardize time metadata (release tag for ctsm5.3)
ctsm5.3.020 samrabin 01/17/2025 Merge b4b-dev
ctsm5.3.019 olyson 01/14/2025 Stop running 0th time step
Expand Down
2 changes: 1 addition & 1 deletion src/fates
Submodule fates updated 36 files
+16 −11 CMakeLists.txt
+12 −16 biogeochem/EDCanopyStructureMod.F90
+0 −1 biogeochem/EDCohortDynamicsMod.F90
+45 −23 biogeochem/EDLoggingMortalityMod.F90
+5 −6 biogeochem/EDMortalityFunctionsMod.F90
+23 −26 biogeochem/EDPatchDynamicsMod.F90
+27 −23 biogeochem/EDPhysiologyMod.F90
+56 −30 biogeochem/FatesAllometryMod.F90
+8 −8 biogeochem/FatesCohortMod.F90
+2 −0 biogeochem/FatesLandUseChangeMod.F90
+1 −0 fire/CMakeLists.txt
+1 −1 fire/FatesFuelMod.F90
+318 −0 fire/SFEquationsMod.F90
+80 −146 fire/SFMainMod.F90
+5 −5 main/EDMainMod.F90
+3 −1 main/FatesConstantsMod.F90
+109 −244 main/FatesHistoryInterfaceMod.F90
+15 −1 main/FatesInterfaceMod.F90
+0 −1 main/FatesParameterDerivedMod.F90
+155 −0 parteh/PRTParamsFATESMod.F90
+2 −1 testing/CMakeLists.txt
+3 −5 testing/functional_testing/fire/fuel/CMakeLists.txt
+5 −2 testing/functional_testing/fire/fuel/FatesTestFuel.F90
+0 −0 testing/functional_testing/fire/fuel/fuel_test.py
+24 −0 testing/functional_testing/fire/ros/CMakeLists.txt
+414 −0 testing/functional_testing/fire/ros/FatesTestROS.F90
+233 −0 testing/functional_testing/fire/ros/ros_test.py
+6 −0 testing/functional_testing/fire/shr/CMakeLists.txt
+17 −8 testing/functional_testing/fire/shr/FatesTestFireMod.F90
+0 −0 testing/functional_testing/fire/shr/SyntheticFuelModels.F90
+7 −0 testing/functional_tests.cfg
+2 −1 testing/run_functional_tests.py
+7 −3 tools/BatchPatchParams.py
+4 −3 tools/FatesPFTIndexSwapper.py
+2 −2 tools/modify_fates_paramfile.py
+33 −11 tools/ncvarsort.py
5 changes: 5 additions & 0 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ subroutine control_init(dtime)
errMsg(sourcefile, __LINE__))
end if

if (z0param_method == 'Meier2022') then
call endrun(msg=' ERROR: Surface roughness parameterization Meier2022 is not compatible with FATES.'//&
errMsg(sourcefile, __LINE__))
end if

else

! These do default to false anyway, but this emphasizes they
Expand Down
38 changes: 21 additions & 17 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,11 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)
integer,intent(in) :: surf_numpft
integer,intent(in) :: surf_numcft
integer,intent(out) :: maxsoil_patches
integer :: pass_biogeog
integer :: pass_nocomp
integer :: pass_sp
integer :: pass_use_fixed_biogeog
integer :: pass_use_nocomp
integer :: pass_use_sp
integer :: pass_masterproc
integer :: pass_use_luh2
logical :: verbose_output
type(fates_param_reader_ctsm_impl) :: var_reader

Expand All @@ -321,25 +322,25 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)
! Send parameters individually

if(use_fates_fixed_biogeog)then
pass_biogeog = 1
pass_use_fixed_biogeog = 1
else
pass_biogeog = 0
pass_use_fixed_biogeog = 0
end if
call set_fates_ctrlparms('use_fixed_biogeog',ival=pass_biogeog)
call set_fates_ctrlparms('use_fixed_biogeog',ival=pass_use_fixed_biogeog)

if(use_fates_nocomp)then
pass_nocomp = 1
pass_use_nocomp = 1
else
pass_nocomp = 0
pass_use_nocomp = 0
end if
call set_fates_ctrlparms('use_nocomp',ival=pass_nocomp)
call set_fates_ctrlparms('use_nocomp',ival=pass_use_nocomp)

if(use_fates_sp)then
pass_sp = 1
pass_use_sp = 1
else
pass_sp = 0
pass_use_sp = 0
end if
call set_fates_ctrlparms('use_sp',ival=pass_sp)
call set_fates_ctrlparms('use_sp',ival=pass_use_sp)

if(masterproc)then
pass_masterproc = 1
Expand All @@ -348,6 +349,14 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)
end if
call set_fates_ctrlparms('masterproc',ival=pass_masterproc)

! FATES landuse modes
if(use_fates_luh) then
pass_use_luh2 = 1
else
pass_use_luh2 = 0
end if
call set_fates_ctrlparms('use_luh2',ival=pass_use_luh2)

end if


Expand Down Expand Up @@ -395,7 +404,6 @@ subroutine CLMFatesGlobals2()
integer :: pass_is_restart
integer :: pass_cohort_age_tracking
integer :: pass_tree_damage
integer :: pass_use_luh
integer :: pass_use_potentialveg
integer :: pass_num_luh_states
integer :: pass_num_luh_transitions
Expand Down Expand Up @@ -540,16 +548,12 @@ subroutine CLMFatesGlobals2()

! FATES landuse modes
if(use_fates_luh) then
pass_use_luh = 1
pass_num_luh_states = num_landuse_state_vars
pass_num_luh_transitions = num_landuse_transition_vars
else
pass_use_luh = 0
pass_num_luh_states = 0
pass_num_luh_transitions = 0
end if

call set_fates_ctrlparms('use_luh2',ival=pass_use_luh)
call set_fates_ctrlparms('num_luh2_states',ival=pass_num_luh_states)
call set_fates_ctrlparms('num_luh2_transitions',ival=pass_num_luh_transitions)

Expand Down