Skip to content

Commit aceafc9

Browse files
authored
Merge pull request #2992 from jinmuluo/n-vertical-movement
ctsm5.3.072: Incorporating a new vertical movement scheme for soil nitrate
2 parents 72e8451 + f9195c5 commit aceafc9

File tree

18 files changed

+438
-31
lines changed

18 files changed

+438
-31
lines changed

bld/CLMBuildNamelist.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,13 @@ sub setup_cmdl_bgc {
10061006
if ( &value_is_true($nl->get_value($var)) && $nl_flags->{'soil_decomp_method'} ne "CENTURYKoven2013" ) {
10071007
$log->fatal_error("$var can only be on with CENTURYKoven2013 soil decomposition");
10081008
}
1009+
1010+
# Set use_nvmovement
1011+
$var = "use_nvmovement";
1012+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var);
1013+
if ( &value_is_true($nl->get_value($var)) && !&value_is_true($nl_flags->{'use_nitrif_denitrif'}) ) {
1014+
$log->fatal_error("$var cannot be on with use_nitrif_denitrif = .false.");
1015+
}
10091016
} # end bgc
10101017

10111018

bld/namelist_files/namelist_defaults_ctsm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
24312431
<use_lch4 >.true.</use_lch4>
24322432
<use_nitrif_denitrif soil_decomp_method="None" >.false.</use_nitrif_denitrif>
24332433
<use_nitrif_denitrif >.true.</use_nitrif_denitrif>
2434+
<use_nvmovement >.false.</use_nvmovement>
24342435

24352436
<!-- ===== FATES DEFAULTS =========== -->
24362437
<fates_electron_transport_model use_fates=".true.">FvCB1980</fates_electron_transport_model>

bld/namelist_files/namelist_definition_ctsm.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,12 @@ How LUNA and Photosynthesis (if needed) will get Leaf nitrogen content
10021002
lnc_opt = true get from leaf N from CN model
10031003
lnc_opt = false get based on LAI and fixed CN ratio from parameter file
10041004
</entry>
1005+
<entry id="use_nvmovement" type="logical" category="bgc"
1006+
group="clm_inparm" value=".false.">
1007+
use_nvmovement = true use soil nitrogen vertical movement
1008+
use_nvmovement = false do not use soil nitrogen vertical movement
1009+
use_nvmovement cannot be true while use_nitrif_denitrif is false
1010+
</entry>
10051011

10061012
<entry id="paramfile" type="char*512" category="datasets"
10071013
input_pathname="abs" group="clm_inparm" valid_values="" >

cime_config/testdefs/testlist_clm.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,24 @@
595595
<option name="wallclock">00:50:00</option>
596596
</options>
597597
</test>
598+
<test name="ERP_D_Ld5" grid="f10_f10_mg37" compset="IHistClm60Bgc" testmods="clm/decStart--clm/nvmovement">
599+
<machines>
600+
<machine name="izumi" compiler="nag" category="aux_clm"/>
601+
</machines>
602+
<options>
603+
<option name="wallclock">01:00:00</option>
604+
<option name="comment">Confirms that use_nvmovement = .true. works with bit-for-bit restarts in IHist</option>
605+
</options>
606+
</test>
607+
<test name="ERP_D_Ld5" grid="f10_f10_mg37" compset="I1850Clm60BgcCrop" testmods="clm/nvmovement--clm/matrixcnOn">
608+
<machines>
609+
<machine name="derecho" compiler="intel" category="aux_clm"/>
610+
</machines>
611+
<options>
612+
<option name="wallclock">00:40:00</option>
613+
<option name="comment">Confirms that use_nvmovement = .true. works with bit-for-bit restarts when matrixcnOn</option>
614+
</options>
615+
</test>
598616
<test name="ERS_D" grid="f10_f10_mg37" compset="I1850Clm60Sp" testmods="clm/ExcessIceStreams">
599617
<machines>
600618
<machine name="izumi" compiler="nag" category="aux_clm"/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use_nvmovement = .true.

doc/ChangeLog

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,80 @@
11
===============================================================
2+
Tag name: ctsm5.3.072
3+
Originator(s): jinmuluo (Jinmu Luo, Cornell University)
4+
Date: Tue 26 Aug 2025 02:53:26 PM MDT
5+
One-line Summary: New vertical movement scheme for soil nitrate
6+
7+
Purpose and description of changes
8+
----------------------------------
9+
10+
Introducing a vertical movement scheme for soil nitrate but setting its use to .false. by default.
11+
Details about the new scheme in the PR #2992.
12+
13+
Significant changes to scientifically-supported configurations
14+
--------------------------------------------------------------
15+
16+
Does this tag change answers significantly for any of the following physics configurations?
17+
(Details of any changes will be given in the "Answer changes" section below.)
18+
19+
[Put an [X] in the box for any configuration with significant answer changes.]
20+
21+
[ ] clm6_0
22+
23+
[ ] clm5_0
24+
25+
[ ] ctsm5_0-nwp
26+
27+
[ ] clm4_5
28+
29+
30+
Bugs fixed
31+
----------
32+
List of CTSM issues fixed (include CTSM Issue # and description) [one per line]:
33+
No corresponding github issue
34+
35+
Notes of particular relevance for users
36+
---------------------------------------
37+
Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
38+
use_nvmovement can be set by user
39+
40+
Changes made to namelist defaults (e.g., changed parameter values):
41+
use_nvmovement defaults to .false.
42+
43+
Changes to documentation:
44+
Planned for Jinmu's NSF-NCAR visit this Fall
45+
46+
Notes of particular relevance for developers:
47+
---------------------------------------------
48+
Changes to tests or testing:
49+
New tests with nvmovement testmods, one with matrixcnOn and one with it off
50+
ERP_D_Ld5.f10_f10_mg37.I1850Clm60BgcCrop.derecho_intel.clm-nvmovement--clm-matrixcnOn
51+
ERP_D.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-decStart--clm-nvmovement
52+
53+
Testing summary:
54+
----------------
55+
56+
[PASS means all tests PASS; OK means tests PASS other than expected fails.]
57+
58+
build-namelist tests (if CLMBuildNamelist.pm has changed):
59+
60+
derecho - PASS with all commits up to and including 1cf9859
61+
62+
regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
63+
64+
derecho ----- OK
65+
izumi ------- OK
66+
67+
Answer changes
68+
--------------
69+
Changes answers relative to baseline: No
70+
71+
Other details
72+
-------------
73+
Pull Requests that document the changes (include PR ids):
74+
https://github.com/ESCOMP/ctsm/pull/2992
75+
76+
===============================================================
77+
===============================================================
278
Tag name: ctsm5.3.071
379
Originator(s): samrabin (Sam Rabin, UCAR/TSS)
480
Date: Fri Aug 22 13:49:25 MDT 2025

doc/ChangeSum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Tag Who Date Summary
22
============================================================================================================================
3+
ctsm5.3.072 jinmuluo 08/26/2025 New vertical movement scheme for soil nitrate
34
ctsm5.3.071 samrabin 08/22/2025 Merge b4b-dev to master
45
ctsm5.3.070 glemieux 08/22/2025 Update default FATES parameter file and add FATES managed fire namelist option
56
ctsm5.3.069 samrabin 08/12/2025 Add SystemTests to run subset_data and then CTSM

src/biogeochem/CNDriverMod.F90

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module CNDriverMod
4444
use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type
4545
use CLMFatesInterfaceMod , only : hlm_fates_interface_type
4646
use CropReprPoolsMod , only : nrepr
47+
use SoilHydrologyType , only: soilhydrology_type
4748
!
4849
! !PUBLIC TYPES:
4950
implicit none
@@ -1013,7 +1014,7 @@ subroutine CNDriverLeaching(bounds, &
10131014
c13_cnveg_carbonstate_inst,c14_cnveg_carbonstate_inst, &
10141015
c13_cnveg_carbonflux_inst,c14_cnveg_carbonflux_inst, &
10151016
c13_soilbiogeochem_carbonstate_inst,c14_soilbiogeochem_carbonstate_inst,&
1016-
c13_soilbiogeochem_carbonflux_inst,c14_soilbiogeochem_carbonflux_inst)
1017+
c13_soilbiogeochem_carbonflux_inst,c14_soilbiogeochem_carbonflux_inst, soilhydrology_inst)
10171018
!
10181019
! !DESCRIPTION:
10191020
! Update the nitrogen leaching rate as a function of soluble mineral N and total soil water outflow.
@@ -1028,6 +1029,8 @@ subroutine CNDriverLeaching(bounds, &
10281029
use clm_time_manager , only: is_first_step_of_this_run_segment,is_beg_curr_year,is_end_curr_year,get_curr_date
10291030
use CNSharedParamsMod , only: use_matrixcn
10301031
use SoilBiogeochemDecompCascadeConType, only: use_soil_matrixcn
1032+
use SoilNitrogenMovementMod , only: SoilNitrogenMovement
1033+
use clm_varctl, only : use_nvmovement
10311034
!
10321035
! !ARGUMENTS:
10331036
type(bounds_type) , intent(in) :: bounds
@@ -1045,6 +1048,7 @@ subroutine CNDriverLeaching(bounds, &
10451048
type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst
10461049
type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst
10471050
type(soilstate_type) , intent(inout) :: soilstate_inst
1051+
type(soilhydrology_type) , intent(in) :: soilhydrology_inst
10481052
type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst
10491053
type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst
10501054
type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst
@@ -1062,8 +1066,16 @@ subroutine CNDriverLeaching(bounds, &
10621066
type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst
10631067
integer p,fp,yr,mon,day,sec
10641068
!-----------------------------------------------------------------------
1065-
1066-
! Mineral nitrogen dynamics (deposition, fixation, leaching)
1069+
1070+
! soil nitrate fast aqueous movement, leaching will be evaluted here
1071+
if (use_nitrif_denitrif .and. use_nvmovement) then
1072+
call t_startf('SoilNitrogenMovementMod')
1073+
call SoilNitrogenMovement(bounds, num_bgc_soilc, filter_bgc_soilc, waterstatebulk_inst, &
1074+
soilstate_inst, soilhydrology_inst, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst)
1075+
call t_stopf('SoilNitrogenMovementMod')
1076+
end if
1077+
1078+
! Mineral nitrogen dynamics: deposition, fixation. If use_nvmoment false, also leaching.
10671079

10681080
call t_startf('SoilBiogeochemNLeaching')
10691081
call SoilBiogeochemNLeaching(bounds, num_bgc_soilc, filter_bgc_soilc, &

src/biogeochem/CNVegetationFacade.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ module CNVegetationFacade
9696
use SoilBiogeochemPrecisionControlMod , only: SoilBiogeochemPrecisionControl
9797
use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type
9898
use CLMFatesInterfaceMod , only : hlm_fates_interface_type
99+
use SoilHydrologyType , only : soilhydrology_type
99100
!
100101
implicit none
101102
private
@@ -1074,7 +1075,7 @@ subroutine EcosystemDynamicsPostDrainage(this, bounds, num_allc, filter_allc, &
10741075
soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, &
10751076
c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, &
10761077
c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, &
1077-
soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst)
1078+
soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, soilhydrology_inst)
10781079
!
10791080
! !DESCRIPTION:
10801081
! Do the main science for CN vegetation that needs to be done after hydrology-drainage
@@ -1113,6 +1114,7 @@ subroutine EcosystemDynamicsPostDrainage(this, bounds, num_allc, filter_allc, &
11131114
type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst
11141115
type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst
11151116
type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst
1117+
type(soilhydrology_type) , intent(in) :: soilhydrology_inst
11161118
!
11171119
! !LOCAL VARIABLES:
11181120

@@ -1135,7 +1137,7 @@ subroutine EcosystemDynamicsPostDrainage(this, bounds, num_allc, filter_allc, &
11351137
this%c13_cnveg_carbonstate_inst,this%c14_cnveg_carbonstate_inst, &
11361138
this%c13_cnveg_carbonflux_inst,this%c14_cnveg_carbonflux_inst, &
11371139
c13_soilbiogeochem_carbonstate_inst,c14_soilbiogeochem_carbonstate_inst,&
1138-
c13_soilbiogeochem_carbonflux_inst,c14_soilbiogeochem_carbonflux_inst)
1140+
c13_soilbiogeochem_carbonflux_inst,c14_soilbiogeochem_carbonflux_inst, soilhydrology_inst)
11391141

11401142
! Set controls on very low values in critical state variables
11411143

0 commit comments

Comments
 (0)