Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e505dc8
Add two 1x1 FatesColdPRT2 tests, one with, one without MIMICS
slevis-lmwg Jul 30, 2025
01671b9
Uncomment if ( .not. use_fates_sp ) section of clmfates_interfaceMod
slevis-lmwg Aug 11, 2025
59f9d09
Replace plant_ndemand(c) * nuptake_prof(c,j) with plant_ndemand_vr(c,j)
slevis-lmwg Aug 12, 2025
b155e58
New use_fates section for plant_ndemand_vr and plant_ndemand from fates
slevis-lmwg Aug 13, 2025
c79230c
New use_fates section to set the FATES N uptake fluxes
slevis-lmwg Aug 13, 2025
98b4b7d
Change clm_fate from "in" to "inout" argument
slevis-lmwg Aug 13, 2025
a46a76c
Replace if (use_fates) with (is_fates(c)) to add flexibility
slevis-lmwg Aug 14, 2025
f2202fb
Remove two unhelpful 1x1 FatesColdPRT2 tests that I added earlier
slevis-lmwg Aug 15, 2025
e96b87e
New is_fates section for plant_ndemand, now when use_nitrif_denitrif
slevis-lmwg Aug 26, 2025
b24738b
Add (really, uncomment) FATES npp to enable fixation
slevis-lmwg Aug 26, 2025
00a332e
Uncomment hrv_deadstem_to_prod* lines in clmfates_interfaceMod
slevis-lmwg Sep 19, 2025
2bbdd64
Add error check about fates_parteh_mode = 2 and suplnitro = suplnAll
slevis-lmwg Sep 20, 2025
d8bc6ce
Upd. namelist_defaults for suplnitro when parteh_mode == 1 or /= 1
slevis-lmwg Sep 22, 2025
116b310
prt_carbon_allom_hyp -> fates_c_only & prt_cnp_flex_allom_hyp ->fates_cn
slevis-lmwg Sep 22, 2025
ba955b6
Correction to syntax error caught by gnu and nvhpc, not intel
slevis-lmwg Sep 23, 2025
391a023
Update fates paramfile var prescribed_puptake to 1 for PRT2 test
slevis-lmwg Sep 23, 2025
e881a89
Adjust unit conversions to agree with FATES commit b2a1da6
slevis-lmwg Dec 8, 2025
8135820
Change fates paramfile var prescribed_puptake to 10 for PRT2 test
slevis-lmwg Dec 10, 2025
e73b42d
Replace fates_cn with fates_cnp throughout
slevis-lmwg Dec 16, 2025
25ea275
Remove FATES_ERROR_EL from user_nl_clm (out-of-scope fix)
slevis-lmwg Dec 17, 2025
71ed0fe
Merge tag 'ctsm5.4.004' into fates-cn
slevis-lmwg Dec 17, 2025
3b7e863
Merge tag 'ctsm5.4.005' into fates-cn
slevis-lmwg Dec 20, 2025
b146c70
Add PRT2 test with synthetic N to replicate the pre-CN-coupling setup
slevis-lmwg Dec 20, 2025
fab4aa0
Update two namelist error-checks
slevis-lmwg Dec 30, 2025
e5403d2
Update equivalent to last error-checks, this time in controlMod.F90
slevis-lmwg Dec 31, 2025
cfa42fa
Add FatesColdPRT2_suplnAll test and corresponding testmod
slevis-lmwg Dec 31, 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
24 changes: 14 additions & 10 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1706,10 +1706,10 @@ sub process_namelist_inline_logic {
}
setup_logic_cnmatrix($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_z0param($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl);

Expand Down Expand Up @@ -3330,7 +3330,7 @@ sub setup_logic_supplemental_nitrogen {
} elsif ( $nl_flags->{'bgc_mode'} eq "fates" && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) {
# Or... if its fates but not fates-sp
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
'suplnitro', 'use_fates'=>$nl_flags->{'use_fates'});
'suplnitro', 'fates_parteh_mode'=>$nl->get_value('fates_parteh_mode'));
}
#
# Error checking for suplnitro
Expand All @@ -3349,6 +3349,18 @@ sub setup_logic_supplemental_nitrogen {
$log->warning("There is no need to use a bgc_spinup mode when supplemental Nitrogen is on for all PFT's, as these modes spinup Nitrogen" );
}
}

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

Expand Down Expand Up @@ -4926,14 +4938,6 @@ sub setup_logic_fates {
'use_fates_managed_fire'=>$nl->get_value('use_fates_managed_fire'),
'use_fates_sp'=>$nl_flags->{'use_fates_sp'} );

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
7 changes: 3 additions & 4 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<megan_use_gamma_sm>.false.</megan_use_gamma_sm>
<megan_min_gamma_sm>0.0d00</megan_min_gamma_sm>

<!-- Supplmental Nitrogen mode -->
<suplnitro use_cn=".true." >NONE</suplnitro>
<suplnitro use_fates=".true." >ALL</suplnitro>

<!-- Albedo for glaciers -->
<albice >0.50,0.30</albice>
<albice phys="clm4_5" >0.60,0.40</albice>
Expand Down Expand Up @@ -2689,6 +2685,9 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
<use_fates_fixed_biogeog use_fates=".true." >.false.</use_fates_fixed_biogeog>
<fates_history_dimlevel use_fates=".true.">2,2</fates_history_dimlevel>

<!-- Supplmental Nitrogen mode -->
<suplnitro >NONE</suplnitro>
<suplnitro fates_parteh_mode="1" >ALL</suplnitro>

<!-- ========================================= -->
<!-- Defaults for dynamic subgrid -->
Expand Down
22 changes: 21 additions & 1 deletion cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3849,7 +3849,27 @@
</machines>
<options>
<option name="wallclock">00:40:00</option>
<option name="comment">Exact restart debug test covering Fates CNP nutrients mode.</option>
<option name="comment">Exact restart debug test covering Fates CNP nutrients mode (P still prescribed in clm).</option>
</options>
</test>
<test name="ERS_D_Ld30" grid="f45_f45_mg37" compset="I2000Clm60FatesCruRsGs" testmods="clm/FatesColdPRT2_suplnAll">
<machines>
<machine name="derecho" compiler="intel" category="fates"/>
<machine name="lawrencium-lr3" compiler="intel" category="fates"/>
</machines>
<options>
<option name="wallclock">00:40:00</option>
<option name="comment">Exact restart debug test covering Fates CNP nutrients mode with suplnitro set to ALL.</option>
</options>
</test>
<test name="ERS_D_Ld30" grid="f45_f45_mg37" compset="I2000Clm60FatesCruRsGs" testmods="clm/FatesColdPRT2_synthN">
<machines>
<machine name="derecho" compiler="intel" category="fates"/>
<machine name="lawrencium-lr3" compiler="intel" category="fates"/>
</machines>
<options>
<option name="wallclock">00:40:00</option>
<option name="comment">Exact restart debug test covering Fates CNP nutrients mode with both P and N prescribed to replicate what happened before the CLM-FATES-CN coupling.</option>
</options>
</test>
<test name="ERS_D_Ld30" grid="f45_f45_mg37" compset="HIST_DATM%CRUv7_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV_SESP" testmods="clm/FatesColdLandUse">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_DEMOTION_CARBONFLUX', 'FATES_PROMOTION_CARBONFLUX',
'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_USTORY',
'FATES_NEP', 'FATES_HET_RESP', 'FATES_FIRE_CLOSS', 'FATES_FIRE_FLUX_EL',
'FATES_CBALANCE_ERROR', 'FATES_ERROR_EL', 'FATES_LEAF_ALLOC',
'FATES_CBALANCE_ERROR', 'FATES_LEAF_ALLOC',
'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC',
'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC',
'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
SRCDIR=`./xmlquery SRCROOT --value`
CASEDIR=`./xmlquery CASEROOT --value`
FATESDIR=$SRCDIR/src/fates/

FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_np.json
FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_p.json

cp $FATESDIR/parameter_files/fates_params_default.json $FATESPARAMFILE

$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_nuptake --values 1.0 --indices all

$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_puptake --values 1.0 --indices all
$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_puptake --values 10.0 --indices all

echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm
echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
../nofireemis
../cn_conly
../FatesColdPRT2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
../Fates
../FatesCold
../FatesSetupParamBuild/
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SRCDIR=`./xmlquery SRCROOT --value`
CASEDIR=`./xmlquery CASEROOT --value`
FATESDIR=$SRCDIR/src/fates/
FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_np.json

cp $FATESDIR/parameter_files/fates_params_default.json $FATESPARAMFILE

$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_puptake --values 10.0 --indices all
$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_nuptake --values 10.0 --indices all

echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fates_parteh_mode = 2
hist_fincl1 = 'FATES_L2FR','FATES_L2FR_CANOPY_REC_PF','FATES_L2FR_USTORY_REC_PF',
'FATES_NH4UPTAKE_SZPF','FATES_NO3UPTAKE_SZPF','FATES_NEFFLUX_SZPF',
'FATES_NDEMAND_SZPF','FATES_NFIX_SYM_SZPF','FATES_NH4UPTAKE','FATES_NO3UPTAKE',
'FATES_NEFFLUX','FATES_NDEMAND','FATES_NFIX_SYM','FATES_STOREN','FATES_STOREN_TF',
'FATES_VEGN','FATES_SAPWOODN','FATES_LEAFN','FATES_FROOTN','FATES_REPRON','FATES_VEGN_SZPF',
'FATES_LEAFN_SZPF','FATES_FROOTN_SZPF','FATES_SAPWOODN_SZPF','FATES_STOREN_SZPF','FATES_STOREN_TF_CANOPY_SZPF',
'FATES_STOREN_TF_USTORY_SZPF','FATES_REPRON_SZPF','FATES_STOREP','FATES_STOREP_TF','FATES_VEGP','FATES_SAPWOODP',
'FATES_LEAFP','FATES_FROOTP','FATES_REPROP','FATES_PUPTAKE','FATES_PEFFLUX','FATES_PDEMAND',
'FATES_VEGP_SZPF','FATES_LEAFP_SZPF','FATES_FROOTP_SZPF','FATES_SAPWOODP_SZPF','FATES_STOREP_SZPF',
'FATES_STOREP_TF_CANOPY_SZPF','FATES_STOREP_TF_USTORY_SZPF','FATES_REPROP_SZPF','FATES_PUPTAKE_SZPF',
'FATES_PEFFLUX_SZPF','FATES_PDEMAND_SZPF'
2 changes: 1 addition & 1 deletion src/biogeochem/CNDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ subroutine CNDriverNoLeaching(bounds,
cnveg_carbonflux_inst,cnveg_nitrogenstate_inst,cnveg_nitrogenflux_inst, &
soilbiogeochem_carbonflux_inst,&
soilbiogeochem_state_inst,soilbiogeochem_nitrogenstate_inst, &
soilbiogeochem_nitrogenflux_inst,canopystate_inst)
soilbiogeochem_nitrogenflux_inst,canopystate_inst, clm_fates)
call t_stopf('soilbiogeochemcompetition')

! distribute the available N between the competing patches on the basis of
Expand Down
18 changes: 7 additions & 11 deletions src/biogeochem/CNNDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,14 @@ subroutine CNNFixation(num_soilc, filter_soilc, &
if(col%is_fates(c))then
s = clm_fates%f2hmap(clump_index)%hsites(c)
! %ema_npp is Smoothed [gc/m2/yr]
!npp = clm_fates%fates(clump_index)%bc_out(s)%ema_npp/(dayspyr*secspday)
! FATES N cycling is not yet active, so runs are supplemented anyway
! this will be added when FATES N cycling is completed.
npp = 0._r8
npp = clm_fates%fates(clump_index)%bc_out(s)%ema_npp
else
npp = col_lag_npp(c)
! need to put npp in units of gC/m^2/year here first
npp = col_lag_npp(c) * secspday * dayspyr
end if

if (npp /= spval) then
! need to put npp in units of gC/m^2/year here first
t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * npp *(secspday * dayspyr))))/(secspday * dayspyr)
t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * npp))) / (secspday * dayspyr)
nfix_to_sminn(c) = max(0._r8,t)
else
nfix_to_sminn(c) = 0._r8
Expand All @@ -262,14 +259,13 @@ subroutine CNNFixation(num_soilc, filter_soilc, &

if(col%is_fates(c))then
s = clm_fates%f2hmap(clump_index)%hsites(c)
!npp = clm_fates%fates(clump_index)%bc_out(s)%ema_npp
! See above regarding FATES and N fixation
npp = 0._r8
! %ema_npp is Smoothed [gc/m2/yr]
npp = clm_fates%fates(clump_index)%bc_out(s)%ema_npp
else
npp = cannsum_npp(c)
end if

t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * npp)))/(secspday * dayspyr)
t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * npp))) / (secspday * dayspyr)
nfix_to_sminn(c) = max(0._r8,t)
end do
endif
Expand Down
2 changes: 1 addition & 1 deletion src/fates
Submodule fates updated 80 files
+2 −2 CMakeLists.txt
+60 −58 biogeochem/EDCanopyStructureMod.F90
+5 −5 biogeochem/EDCohortDynamicsMod.F90
+2 −2 biogeochem/EDMortalityFunctionsMod.F90
+7 −14 biogeochem/EDPatchDynamicsMod.F90
+7 −6 biogeochem/EDPhysiologyMod.F90
+2 −4 biogeochem/FatesAllometryMod.F90
+10 −6 biogeochem/FatesCohortMod.F90
+5 −5 biogeochem/FatesSoilBGCFluxMod.F90
+1 −2 biogeophys/CMakeLists.txt
+186 −77 biogeophys/FatesLeafBiophysParamsMod.F90
+7 −7 biogeophys/FatesPlantRespPhotosynthMod.F90
+1 −1 fire/SFFireWeatherMod.F90
+1 −1 fire/SFNesterovMod.F90
+325 −100 fire/SFParamsMod.F90
+12 −12 functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90
+1 −2 main/CMakeLists.txt
+1 −1 main/ChecksBalancesMod.F90
+3 −3 main/EDInitMod.F90
+44 −51 main/EDMainMod.F90
+546 −230 main/EDParamsMod.F90
+1,245 −485 main/EDPftvarcon.F90
+16 −9 main/EDTypesMod.F90
+1 −1 main/FatesGlobals.F90
+2 −3 main/FatesHistoryInterfaceMod.F90
+104 −127 main/FatesInterfaceMod.F90
+11 −22 main/FatesInventoryInitMod.F90
+487 −48 main/FatesParametersInterface.F90
+11 −39 main/FatesRestartInterfaceMod.F90
+138 −0 main/FatesSynchronizedParamsMod.F90
+12 −9 main/FatesUtilsMod.F90
+0 −1,272 main/JSONParameterUtilsMod.F90
+0 −54 parameter_files/TestParsing/TestJSON.F90
+0 −8 parameter_files/TestParsing/WrapJSonTestMod.F90
+0 −1 parameter_files/TestParsing/bld/README
+0 −26 parameter_files/TestParsing/build_testjson.sh
+2 −2 parameter_files/fates_params_default.cdl
+0 −2,190 parameter_files/fates_params_default.json
+0 −61 parameter_files/patch_default_bciopt224.json
+62 −0 parameter_files/patch_default_bciopt224.xml
+2 −2 parteh/PRTAllometricCNPMod.F90
+2 −2 parteh/PRTAllometricCarbonMod.F90
+2 −2 parteh/PRTGenericMod.F90
+1 −1 parteh/PRTParametersMod.F90
+817 −263 parteh/PRTParamsFATESMod.F90
+4 −5 testing/build_fortran_tests.py
+1 −1 testing/cime_setup.md
+6 −4 testing/functional_testing/allometry/FatesTestAllometry.F90
+6 −4 testing/functional_testing/fire/fuel/FatesTestFuel.F90
+6 −5 testing/functional_testing/fire/mortality/FatesTestFireMortality.F90
+1 −1 testing/functional_testing/fire/mortality/fire_mortality_test.py
+16 −105 testing/functional_testing/fire/ros/FatesTestROS.F90
+0 −39 testing/functional_testing/fire/ros/ros_test.py
+5 −3 testing/functional_testing/patch/FatesTestPatch.F90
+7 −7 testing/functional_tests.cfg
+0 −75 testing/generate_empty_test.py
+0 −34 testing/great_circle/TestGreatCircle.F90
+0 −45 testing/great_circle/WrapGreatCircleMod.F90
+0 −1 testing/great_circle/bld/README
+0 −27 testing/great_circle/build_gc.sh
+17 −14 testing/run_functional_tests.py
+0 −24 testing/templates/cmake_ftest_template.txt
+0 −6 testing/templates/cmake_utest_template.txt
+0 −33 testing/templates/fortran_test_template.txt
+0 −38 testing/templates/pfunit_template.txt
+0 −39 testing/templates/test_class_template.txt
+0 −434 testing/test_generator_class.py
+7 −7 testing/testing_shr/FatesFactoryMod.F90
+178 −35 testing/testing_shr/FatesUnitTestParamReaderMod.F90
+1 −1 testing/unit_tests.cfg
+0 −22 testing/utils.py
+297 −0 tools/FatesPFTIndexSwapper.py
+515 −0 tools/UpdateParamAPI.py
+0 −77 tools/batch_patch_params.py
+0 −483 tools/cdl_to_xml.py
+318 −329 tools/modify_fates_paramfile.py
+162 −0 tools/ncvarsort.py
+0 −102 tools/pft_index_swapper.py
+0 −157 tools/sort_parameters.py
+0 −71 tools/write_json.py
4 changes: 2 additions & 2 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ module clm_varctl

integer, public :: fates_seeddisp_cadence = iundef ! 0 => no seed dispersal
! 1, 2, 3 => daily, monthly, or yearly dispersal
integer, public :: fates_parteh_mode = -9 ! 1 => carbon only
! 2 => C+N+P (not enabled yet)
integer, public :: fates_parteh_mode = -9 ! = 1 indicated by fates_c_only is carbon only
! = 2 indicated by fates_cnp is C+N+P, though clm cannot enable phosphorus yet, so clm needs fates_cnp_prescribed_puptake > 1 (recommended value 10) in the fates paramfile
! no others enabled
integer, public :: fates_spitfire_mode = 0
! 0 for no fire; 1 for constant ignitions;
Expand Down
16 changes: 12 additions & 4 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module controlMod
use CNSharedParamsMod , only: use_fun, use_matrixcn
use CIsoAtmTimeseriesMod , only: use_c14_bombspike, atm_c14_filename, use_c13_timeseries, atm_c13_filename
use SoilBiogeochemDecompCascadeConType, only : use_soil_matrixcn
use SoilBiogeochemCompetitionMod , only: suplnitro, suplnNon
use SoilBiogeochemCompetitionMod , only: suplnitro, suplnNon, suplnAll
use SoilBiogeochemLittVertTranspMod , only: som_adv_flux, max_depth_cryoturb
use SoilBiogeochemVerticalProfileMod , only: surfprof_exp
use SoilBiogeochemNitrifDenitrifMod , only: no_frozen_nitrif_denitrif
Expand All @@ -51,6 +51,7 @@ module controlMod
use CanopyFluxesMod , only: CanopyFluxesReadNML
use shr_drydep_mod , only: n_drydep
use clm_varctl
use PRTGenericMod, only : fates_cnp, fates_c_only
!
! !PUBLIC TYPES:
implicit none
Expand Down Expand Up @@ -491,12 +492,19 @@ subroutine control_init(dtime)
use_fates_bgc = .true.
end if

if (fates_parteh_mode == 1 .and. suplnitro == suplnNon .and. use_fates_bgc )then
write(iulog,*) ' When FATES with fates_parteh_mode == 1 (ie carbon only mode),'
if (fates_parteh_mode == fates_c_only .and. suplnitro == suplnNon)then
write(iulog,*) ' When fates_parteh_mode == fates_c_only,'
write(iulog,*) ' you must have supplemental nitrogen turned on, there will be'
write(iulog,*) ' no nitrogen dynamics with the plants, and therefore no'
write(iulog,*) ' meaningful limitations to nitrogen.'
call endrun(msg=' ERROR: fates_parteh_mode=1 must have suplnitro set to suplnAll.'//&
call endrun(msg=' ERROR: fates_parteh_mode=fates_c_only must have suplnitro set to suplnAll.'//&
errMsg(sourcefile, __LINE__))
end if
if (fates_parteh_mode == fates_cnp .and. use_fates_sp )then
write(iulog,*) ' When fates_parteh_mode == fates_cnp,'
write(iulog,*) ' you must have use_fates_bgc and not use_fates_sp.'
write(iulog,*) ' When you have use_fates_sp, then fates_parteh_mode should equal fates_c_only.'
call endrun(msg=' ERROR: fates_parteh_mode=fates_cnp and use_fates_sp are inconsistent.'//&
errMsg(sourcefile, __LINE__))
end if

Expand Down
Loading
Loading