diff --git a/cime_config/tests.py b/cime_config/tests.py index 6ea66987ecba..c4d2f0a15c08 100644 --- a/cime_config/tests.py +++ b/cime_config/tests.py @@ -432,6 +432,7 @@ "ERS_Ld60.f45_g37.IELMFATES.elm-fates_cold_nofire", "ERS_Ld60.f45_g37.IELMFATES.elm-fates_cold_st3", "ERS_Ld60.f45_g37.IELMFATES.elm-fates_cold_pphys", + "SMS_D_Ld15.f45_g37.IELMFATES.elm-fates_cold_twostream", ) }, diff --git a/components/elm/bld/configure b/components/elm/bld/configure index 01cc15f9d204..e0a13f30be7d 100755 --- a/components/elm/bld/configure +++ b/components/elm/bld/configure @@ -477,6 +477,7 @@ sub write_filepath_cesmbld "external_models/fates/biogeochem", "external_models/fates/fire", "external_models/fates/parteh", + "external_models/fates/radiation", "external_models/mpp/src/mpp/dtypes", "external_models/mpp/src/mpp/thermal", "external_models/mpp/src/mpp/util", diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold/shell_commands b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold/shell_commands index 5c5dc3a9118a..c2771ff61c4a 100644 --- a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold/shell_commands +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold/shell_commands @@ -1,2 +1,8 @@ ./xmlchange TEST_MEMLEAK_TOLERANCE=0.75 ./xmlchange NTHRDS=1 + +# Change PIO settings as temporary fix for #6316 +if [ `./xmlquery --value LND_GRID` == 1.9x2.5 ]; then + ./xmlchange PIO_NUMTASKS=4 + ./xmlchange PIO_STRIDE=-999 +fi diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_allvars/user_nl_elm b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_allvars/user_nl_elm index 67f363bb0a3e..2aff9c0b3c23 100644 --- a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_allvars/user_nl_elm +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_allvars/user_nl_elm @@ -14,8 +14,7 @@ hist_fincl1 = 'FATES_CROWNAREA_PF', 'FATES_CANOPYCROWNAREA_PF', 'FATES_LAISHA_TOP_CL', 'FATES_FABD_SUN_CLLLPF', 'FATES_FABD_SHA_CLLLPF', 'FATES_FABI_SUN_CLLLPF', 'FATES_FABI_SHA_CLLLPF', 'FATES_FABD_SUN_CLLL', 'FATES_FABD_SHA_CLLL', 'FATES_FABI_SUN_CLLL', 'FATES_FABI_SHA_CLLL', -'FATES_PARPROF_DIR_CLLLPF', 'FATES_PARPROF_DIF_CLLLPF', -'FATES_PARPROF_DIR_CLLL', 'FATES_PARPROF_DIF_CLLL', 'FATES_FABD_SUN_TOPLF_CL', +'FATES_PARPROF_DIR_CLLLPF', 'FATES_PARPROF_DIF_CLLLPF','FATES_FABD_SUN_TOPLF_CL', 'FATES_FABD_SHA_TOPLF_CL', 'FATES_FABI_SUN_TOPLF_CL', 'FATES_FABI_SHA_TOPLF_CL', 'FATES_NET_C_UPTAKE_CLLL', 'FATES_CROWNAREA_CLLL', 'FATES_NPLANT_CANOPY_SZAP', 'FATES_NPLANT_USTORY_SZAP', 'FATES_DDBH_CANOPY_SZAP', 'FATES_DDBH_USTORY_SZAP', diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/README b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/README new file mode 100644 index 000000000000..8211a863c35c --- /dev/null +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/README @@ -0,0 +1,19 @@ +Testing FATES two-stream radiation scheme is activated by switching the fates_rad_model +parameter from 1 to 2. This is all that is needed, both radiation schemes +1) Norman and 2) two-stream use the same optical parameters. + +fates_rad_model + +Note that to avoid exceeding the filename string length maximum, the parameter +file generated on the fly is placed in the $SRCROOT/src/fates/parameter_files +directory. This may still run into problems is the $SRCROOT string is too long. + +Like the test with seed dispersal activation, the main downside of this method is +that this file will require a custom update for every fates parameter file API update. +Allowing the HLM to generate the file at runtime via buildnamelist step +will provide the capability to build the fates parameter file on +the fly which with the appropriate values for this test. + +Note that the test as currently designed is not machine agnostic as it requires +specific shell commands for enabling the workflow to have access to ncgen. Currently +this test is only usable on perlmutter. diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/include_user_mods b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/include_user_mods new file mode 100644 index 000000000000..45e8af32d22a --- /dev/null +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/include_user_mods @@ -0,0 +1 @@ +../fates_cold diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/shell_commands b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/shell_commands new file mode 100644 index 000000000000..e3f2fa482d66 --- /dev/null +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/shell_commands @@ -0,0 +1,15 @@ +module load e4s +spack env activate gcc +spack load nco + +SRCDIR=`./xmlquery SRCROOT --value` +CASEDIR=`./xmlquery CASEROOT --value` +FATESDIR=$SRCDIR/components/elm/src/external_models/fates +FATESPARAMFILE=$CASEDIR/fates_params_twostream.nc + +ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl + +$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_rad_model --val 2 --allpfts + +spack unload nco +module unload e4s diff --git a/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/user_nl_elm b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/user_nl_elm new file mode 100644 index 000000000000..cae5fc2112da --- /dev/null +++ b/components/elm/cime_config/testdefs/testmods_dirs/elm/fates_cold_twostream/user_nl_elm @@ -0,0 +1 @@ +fates_paramfile = '$CASEROOT/fates_params_twostream.nc' diff --git a/components/elm/src/external_models/fates b/components/elm/src/external_models/fates index 698a8df848ec..42d804ba54d0 160000 --- a/components/elm/src/external_models/fates +++ b/components/elm/src/external_models/fates @@ -1 +1 @@ -Subproject commit 698a8df848ecdb81aa72fee6c86be2c41b2545e9 +Subproject commit 42d804ba54d0cf013a9737018ff9920e0c9808ea diff --git a/components/elm/src/main/elmfates_interfaceMod.F90 b/components/elm/src/main/elmfates_interfaceMod.F90 index edcdd01f1ede..9b9fbc6e3903 100644 --- a/components/elm/src/main/elmfates_interfaceMod.F90 +++ b/components/elm/src/main/elmfates_interfaceMod.F90 @@ -149,7 +149,8 @@ module ELMFatesInterfaceMod use EDInitMod , only : init_patches use EDInitMod , only : set_site_properties use EDPftVarcon , only : EDpftvarcon_inst - use EDSurfaceRadiationMod , only : ED_SunShadeFracs, ED_Norman_Radiation + use FatesRadiationDriveMod, only : FatesSunShadeFracs + use FatesRadiationDriveMod, only : FatesNormalizedCanopyRadiation use EDBtranMod , only : btran_ed, & get_active_suction_layers use EDCanopyStructureMod , only : canopy_summarization, update_hlm_dynamics @@ -519,7 +520,7 @@ subroutine ELMFatesGlobals2() call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_types) call set_fates_ctrlparms('use_logging',ival=pass_logging) - if(use_fates_luh) then + 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 @@ -2055,7 +2056,7 @@ subroutine wrap_sunfrac(this,bounds_clump,top_af_inst,canopystate_inst) ! as well as total patch sun/shade fraction output boundary condition ! ------------------------------------------------------------------------------- - call ED_SunShadeFracs(this%fates(nc)%nsites, & + call FatesSunShadeFracs(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out) @@ -2563,7 +2564,7 @@ subroutine wrap_canopy_radiation(this, bounds_clump, & end do end do - call ED_Norman_Radiation(this%fates(nc)%nsites, & + call FatesNormalizedCanopyRadiation(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out)