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

Get FATES and carbon_only test-suite tests to pass with MIMICS active #1643

Merged
merged 30 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d5c1ed5
Changes to get FATES and carbon_only tests pass with MIMICS active
slevis-lmwg Feb 9, 2022
28a0406
Access the FATES copy of annsum_npp in FATES-MIMICS simulations
slevis-lmwg Feb 14, 2022
a16cc85
Calc. ligninNratioAvg(c) from values by pft when use_fates = .true.
slevis-lmwg Feb 14, 2022
41802c2
Check that FATES-MIMICS cases set use_lch4 = .true., else fail
slevis-lmwg Feb 15, 2022
bea8e4a
Replaced if-statement with select case statement as per EK's review
slevis-lmwg Feb 25, 2022
88308bd
Merge remote-tracking branch 'escomp/master' into ligninNratio_forfates
slevis-lmwg Feb 25, 2022
c0747af
Get select case statmt to compile by changing case options to constants
slevis-lmwg Feb 25, 2022
098e86f
Update Fates testmod to run w MIMICS. First draft of ChangeLog updates.
slevis-lmwg Feb 26, 2022
86d18b2
Update ChangeLog with test-suite results
slevis-lmwg Feb 26, 2022
e52992c
Error check in the fortran to ensure MIMICS-FATES sets use_lch4 = .true.
slevis-lmwg Mar 13, 2022
d95a716
Reverted my mods to FATES test and added new FATES test
slevis-lmwg Mar 13, 2022
a8057f9
Update ChangeLog about my mods to the tests (see previous commit)
slevis-lmwg Mar 13, 2022
0438304
Added fates_and_lch4_if: construct around if statement for clarity
slevis-lmwg Mar 18, 2022
ffa084a
Made the fates_and_lch4_if into nested if statements for clearer code
slevis-lmwg Apr 4, 2022
8bf3153
Merge remote-tracking branch 'escomp/master' into ligninNratio_forfates
slevis-lmwg Apr 25, 2022
50f4af3
Update FATES-MIMICS to use FATES copy of ligninNratio
slevis-lmwg Apr 25, 2022
922aaf2
Revert a testmod change I had made for testing FATES-MIMICS
slevis-lmwg Apr 25, 2022
dd24018
Corrected to receive FATES variable litt_flux_ligc_per_n as site level
slevis-lmwg Apr 26, 2022
cd42ddf
Consolidating ligninNratioAvg var from cnveg_carbonflux to ...
slevis-lmwg Apr 27, 2022
eadb090
Update ChangeLog
slevis-lmwg Apr 27, 2022
f704b40
Update ChangeSum
slevis-lmwg Apr 27, 2022
c4708e9
Update comments about microbial C heterotrophic resp. per @wwieder
slevis-lmwg Apr 27, 2022
79a4ec3
Corrections needed for failing tests to pass
slevis-lmwg Apr 27, 2022
1a4bb3f
Fix for restart test that wasn't passing
slevis-lmwg Apr 28, 2022
e5c0d80
Make my restart-fix workaround thread-safe
slevis-lmwg Apr 29, 2022
6794fa3
Updates to get threaded test to PASS
slevis-lmwg Apr 30, 2022
392d047
Merge tag 'ctsm5.1.dev092' into ligninNratio_forfates
slevis-lmwg Apr 30, 2022
611fb16
Make copy_fates_var local to clmfates_interface module
slevis-lmwg May 3, 2022
08f3a3c
The new test added with this PR now also tests threading
slevis-lmwg May 3, 2022
28acc2f
Update date on changelog add description of issue
ekluzek May 4, 2022
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
6 changes: 6 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,12 @@ sub setup_cmdl_bgc {
$log->warning("$var normally use_nitrif_denitrif should only be FALSE if FATES is on, it has NOT been validated for being off for BGC mode" );
}
}
# if MIMICS is on and use_fates = .true. then use_lch4 must = .true.
if ( (! &value_is_true($nl_flags->{'use_lch4'})) && &value_is_true($nl_flags->{'use_fates'}) ) {
if ( $soil_decomp_method eq "MIMICSWieder2015" ) {
$log->warning("If MIMICS is on and use_fates = .true. then use_lch4 must be .true. and currently it's not" );
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
#
# Set FUN for BGC
Expand Down
10 changes: 10 additions & 0 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,16 @@
<option name="comment">30 day exact restart test activating FATES size and age mortality mode on an f45 grid.</option>
</options>
</test>
<test name="ERP_P144x2_Ld30" grid="f45_f45_mg37" compset="I2000Clm50FatesRs" testmods="clm/mimicsFatesColdDef">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="fates"/>
</machines>
<options>
<option name="wallclock">00:40:00</option>
<option name="comment">30 day exact restart test with threading, running FATES-MIMICS on an f45 grid.</option>
</options>
</test>
<test name="SMS_D_Ld5" grid="f10_f10_mg37" compset="I2000Clm50BgcCrop" testmods="clm/irrig_alternate">
<machines>
<machine name="izumi" compiler="nag" category="aux_clm">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
../Fates
../mimics
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange CLM_FORCE_COLDSTART="on"
68 changes: 68 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,72 @@
===============================================================
Tag name: ctsm5.1.dev093
Originator(s): slevis (Samuel Levis)
Date: Tue May 3 21:50:20 MDT 2022
One-line Summary: Modifications for FATES-MIMICS to work

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

1) For FATES-MIMICS cases, use ligninNratioAvg calculated by FATES.
2) For FATES-MIMICS cases, use annsum_npp_col calculated by FATES.
3) Small modification to allow carbon-only to work with MIMICS.

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.]

[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed or introduced
------------------------
Issues fixed (include CTSM Issue #):
Fixes #1636 -- FATES tests fail with MIMICS active

Notes of particular relevance for users
---------------------------------------
Caveats for users (e.g., need to interpolate initial conditions):
MIMICS-FATES now do work together, but only as long as use_lch4 = .true.

Notes of particular relevance for developers:
---------------------------------------------
Changes to tests or testing:
To confirm that MIMICS-FATES works, I added the testmod mimicsFatesColdDef.

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

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

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

cheyenne ---- PASS
izumi ------- OK


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

Changes answers relative to baseline: NO
...but made history variable CWDC_HR active.

Other details
-------------
Pull Requests that document the changes (include PR ids):
https://github.com/ESCOMP/ctsm/pull/1643

===============================================================
===============================================================
Tag name: ctsm5.1.dev092
Originator(s): sacks (Bill Sacks)
Date: Fri Apr 29 18:31:48 MDT 2022
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.1.dev093 slevis 05/03/2022 Modifications for FATES-MIMICS to work
ctsm5.1.dev092 sacks 04/29/2022 Refactor NutrientCompetition / CNAllocation to provide hooks for AgSys
ctsm5.1.dev091 rgknox 04/22/2022 clm decomp method is now passed to fates to enabled mimics coupling
ctsm5.1.dev090 samrabin 03/31/2022 Fix misleading name of "gddplant"
Expand Down
38 changes: 28 additions & 10 deletions src/biogeochem/CNDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module CNDriverMod
use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type
use ActiveLayerMod , only : active_layer_type
use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type
use CLMFatesInterfaceMod , only : hlm_fates_interface_type
use CropReprPoolsMod , only : nrepr
!
! !PUBLIC TYPES:
implicit none
Expand Down Expand Up @@ -96,7 +98,7 @@ subroutine CNDriverNoLeaching(bounds,
c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, &
soilbiogeochem_state_inst, &
soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, &
active_layer_inst, &
active_layer_inst, clm_fates, &
atm2lnd_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, &
wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, &
soil_water_retention_curve, crop_inst, ch4_inst, &
Expand Down Expand Up @@ -200,6 +202,7 @@ subroutine CNDriverNoLeaching(bounds,
class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method
class(fire_method_type) , intent(inout) :: cnfire_method
logical , intent(in) :: dribble_crophrv_xsmrpool_2atm
type(hlm_fates_interface_type) , intent(inout) :: clm_fates
!
! !LOCAL VARIABLES:
real(r8):: cn_decomp_pools(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_pools)
Expand Down Expand Up @@ -322,6 +325,7 @@ subroutine CNDriverNoLeaching(bounds,
soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst)
else if (decomp_method == mimics_decomp) then
call decomp_rates_mimics(bounds, num_soilc, filter_soilc, &
num_soilp, filter_soilp, clm_fates, &
soilstate_inst, temperature_inst, cnveg_carbonflux_inst, ch4_inst, &
soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst)
end if
Expand Down Expand Up @@ -1056,12 +1060,14 @@ subroutine CNDriverSummarizeFluxes(bounds, &
type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst
!
! !LOCAL VARIABLES:
integer :: begp,endp
integer :: begc,endc
integer :: begg,endg

character(len=*), parameter :: subname = 'CNDriverSummarizeFluxes'
!-----------------------------------------------------------------------

begp = bounds%begp; endp= bounds%endp
begc = bounds%begc; endc= bounds%endc
begg = bounds%begg; endg = bounds%endg

Expand All @@ -1071,12 +1077,30 @@ subroutine CNDriverSummarizeFluxes(bounds, &
! soilbiogeochem carbon/nitrogen flux summary
! ----------------------------------------------

call soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc)
call soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, &
num_soilp, filter_soilp, &
soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
leafc_to_litter_patch=cnveg_carbonflux_inst%leafc_to_litter_patch(begp:endp), &
frootc_to_litter_patch=cnveg_carbonflux_inst%frootc_to_litter_patch(begp:endp))
if ( use_c13 ) then
call c13_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc)
call c13_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, &
num_soilp, filter_soilp, &
c13_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
c13_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
leafc_to_litter_patch=c13_cnveg_carbonflux_inst%leafc_to_litter_patch(begp:endp), &
frootc_to_litter_patch=c13_cnveg_carbonflux_inst%frootc_to_litter_patch(begp:endp))
end if
if ( use_c14 ) then
call c14_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc)
call c14_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, &
num_soilp, filter_soilp, &
c14_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
c14_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
leafc_to_litter_patch=c14_cnveg_carbonflux_inst%leafc_to_litter_patch(begp:endp), &
frootc_to_litter_patch=c14_cnveg_carbonflux_inst%frootc_to_litter_patch(begp:endp))
end if
call soilbiogeochem_nitrogenflux_inst%Summary(bounds, num_soilc, filter_soilc)

Expand All @@ -1092,8 +1116,6 @@ subroutine CNDriverSummarizeFluxes(bounds, &
soilbiogeochem_lithr_col=soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
soilbiogeochem_cwdc_col=soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_cwdn_col=soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
product_closs_grc=c_products_inst%product_loss_grc(begg:endg))

if ( use_c13 ) then
Expand All @@ -1104,8 +1126,6 @@ subroutine CNDriverSummarizeFluxes(bounds, &
soilbiogeochem_lithr_col=c13_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
c13_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
soilbiogeochem_cwdc_col=c13_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_cwdn_col=soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
product_closs_grc=c13_products_inst%product_loss_grc(begg:endg))
end if

Expand All @@ -1117,8 +1137,6 @@ subroutine CNDriverSummarizeFluxes(bounds, &
soilbiogeochem_lithr_col=c14_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
c14_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
soilbiogeochem_cwdc_col=c14_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), &
soilbiogeochem_cwdn_col=soilbiogeochem_nitrogenstate_inst%cwdn_col(begc:endc), &
product_closs_grc=c14_products_inst%product_loss_grc(begg:endg))
end if
call t_stopf('CNvegCflux_summary')
Expand Down
72 changes: 3 additions & 69 deletions src/biogeochem/CNVegCarbonFluxType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module CNVegCarbonFluxType
use decompMod , only : bounds_type
use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con
use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools
use clm_varpar , only : nlevdecomp_full, nlevdecomp, i_litr_min, i_litr_max, i_cwdl2
use clm_varpar , only : nlevdecomp_full, nlevdecomp, i_litr_min, i_litr_max
use clm_varcon , only : spval, dzsoi_decomp
use clm_varctl , only : use_cndv, use_c13, use_nitrif_denitrif, use_crop
use clm_varctl , only : use_grainproduct
Expand Down Expand Up @@ -338,9 +338,6 @@ module CNVegCarbonFluxType
real(r8), pointer :: nbp_grc (:) ! (gC/m2/s) net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux, positive for sink (same as net carbon exchange between land and atmosphere)
real(r8), pointer :: nee_grc (:) ! (gC/m2/s) net ecosystem exchange of carbon, includes fire and hrv_xsmrpool, excludes landuse and harvest flux, positive for source

! Plant C to N ratios
real(r8), pointer :: ligninNratioAvg_col(:) ! Average of leaf, fine root, and CWD lignin to N ratio

! Dynamic landcover fluxnes
real(r8), pointer :: landuseflux_grc(:) ! (gC/m2/s) dwt_conv_cflux+product_closs
real(r8), pointer :: npp_Nactive_patch (:) ! C used by mycorrhizal uptake (gC/m2/s)
Expand Down Expand Up @@ -709,8 +706,6 @@ subroutine InitAllocate(this, bounds, carbon_type)
allocate(this%annsum_npp_col (begc:endc)) ; this%annsum_npp_col (:) = nan
allocate(this%lag_npp_col (begc:endc)) ; this%lag_npp_col (:) = spval

allocate(this%ligninNratioAvg_col (begc:endc)) ; this%ligninNratioAvg_col (:) = nan

allocate(this%nep_col (begc:endc)) ; this%nep_col (:) = nan
allocate(this%nbp_grc (begg:endg)) ; this%nbp_grc (:) = nan
allocate(this%nee_grc (begg:endg)) ; this%nee_grc (:) = nan
Expand Down Expand Up @@ -3439,12 +3434,10 @@ subroutine InitCold(this, bounds)

if (lun%ifspecial(l)) then
this%annsum_npp_col(c) = spval
this%ligninNratioAvg_col(c) = spval
end if

if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
this%annsum_npp_col(c) = 0._r8
this%ligninNratioAvg_col(c) = 0._r8
end if
end do

Expand Down Expand Up @@ -3670,11 +3663,6 @@ subroutine RestartBulkOnly ( this, bounds, ncid, flag )
long_name='', units='', &
interpinic_flag='interp', readvar=readvar, data=this%annsum_npp_col)

call restartvar(ncid=ncid, flag=flag, varname='ligninNratioAvg', xtype=ncd_double, &
dim1name='column', &
long_name='', units='', &
interpinic_flag='interp', readvar=readvar, data=this%ligninNratioAvg_col)

call restartvar(ncid=ncid, flag=flag, varname='tempsum_litfall', xtype=ncd_double, &
dim1name='pft', &
long_name='', units='', &
Expand Down Expand Up @@ -4108,7 +4096,6 @@ subroutine Summary_carbonflux(this, &
bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, isotope, &
soilbiogeochem_hr_col, soilbiogeochem_cwdhr_col, soilbiogeochem_lithr_col, &
soilbiogeochem_decomp_cascade_ctransfer_col, &
soilbiogeochem_cwdc_col, soilbiogeochem_cwdn_col, &
product_closs_grc)
!
! !DESCRIPTION:
Expand All @@ -4119,8 +4106,8 @@ subroutine Summary_carbonflux(this, &
use clm_varcon , only: secspday
use clm_varctl , only: nfix_timeconst, carbon_resp_opt
use subgridAveMod , only: p2c, c2g
use SoilBiogeochemDecompCascadeConType , only: decomp_cascade_con, mimics_decomp, decomp_method
use CNSharedParamsMod , only: use_fun, CNParamsShareInst
use SoilBiogeochemDecompCascadeConType , only: decomp_cascade_con
use CNSharedParamsMod , only: use_fun
!
! !ARGUMENTS:
class(cnveg_carbonflux_type) :: this
Expand All @@ -4134,22 +4121,13 @@ subroutine Summary_carbonflux(this, &
real(r8) , intent(in) :: soilbiogeochem_cwdhr_col(bounds%begc:)
real(r8) , intent(in) :: soilbiogeochem_lithr_col(bounds%begc:)
real(r8) , intent(in) :: soilbiogeochem_decomp_cascade_ctransfer_col(bounds%begc:,1:)
real(r8) , intent(in) :: soilbiogeochem_cwdc_col(bounds%begc:)
real(r8) , intent(in) :: soilbiogeochem_cwdn_col(bounds%begc:)
real(r8) , intent(in) :: product_closs_grc(bounds%begg:)
!
! !LOCAL VARIABLES:
integer :: c,p,j,k,l,g ! indices
integer :: fp,fc ! lake filter indices
real(r8) :: nfixlags, dtime ! temp variables for making lagged npp
real(r8) :: maxdepth ! depth to integrate soil variables
real(r8) :: ligninNratio_cwd ! lignin to N ratio of CWD
real(r8) :: ligninNratio_leaf_patch(bounds%begp:bounds%endp) ! lignin to N ratio of leaves, patch level
real(r8) :: ligninNratio_froot_patch(bounds%begp:bounds%endp) ! lignin to N ratio of fine roots, patch level
real(r8) :: ligninNratio_leaf_col(bounds%begc:bounds%endc) ! lignin to N ratio of leaves, column level
real(r8) :: ligninNratio_froot_col(bounds%begc:bounds%endc) ! lignin to N ratio of fine roots, column level
real(r8) :: leafc_to_litter_col(bounds%begc:bounds%endc) ! leaf C to litter C, column level
real(r8) :: frootc_to_litter_col(bounds%begc:bounds%endc) ! fine root C to litter C, column level
real(r8) :: nep_grc(bounds%begg:bounds%endg) ! nep_col averaged to gridcell
real(r8) :: fire_closs_grc(bounds%begg:bounds%endg) ! fire_closs_col averaged to gridcell
real(r8) :: hrv_xsmrpool_to_atm_grc(bounds%begg:bounds%endg) ! hrv_xsmrpool_to_atm_col averaged to gridcell (gC/m2/s)
Expand Down Expand Up @@ -4539,17 +4517,6 @@ subroutine Summary_carbonflux(this, &
this%hrv_gresp_storage_to_litter_patch(p) + &
this%hrv_gresp_xfer_to_litter_patch(p)

if (decomp_method == mimics_decomp) then
! Calculate ligninNratio for leaves and fine roots
associate(ivt => patch%itype) ! Input: [integer (:)] patch plant type
ligninNratio_leaf_patch(p) = pftcon%lf_flig(ivt(p)) * &
pftcon%lflitcn(ivt(p)) * &
this%leafc_to_litter_patch(p)
ligninNratio_froot_patch(p) = pftcon%fr_flig(ivt(p)) * &
pftcon%frootcn(ivt(p)) * &
this%frootc_to_litter_patch(p)
end associate
end if
end do ! end of patches loop

!------------------------------------------------
Expand Down Expand Up @@ -4594,39 +4561,6 @@ subroutine Summary_carbonflux(this, &
this%gpp_patch(bounds%begp:bounds%endp), &
this%gpp_col(bounds%begc:bounds%endc))

if (decomp_method == mimics_decomp) then
call p2c(bounds, num_soilc, filter_soilc, &
ligninNratio_leaf_patch(bounds%begp:bounds%endp), &
ligninNratio_leaf_col(bounds%begc:bounds%endc))
call p2c(bounds, num_soilc, filter_soilc, &
ligninNratio_froot_patch(bounds%begp:bounds%endp), &
ligninNratio_froot_col(bounds%begc:bounds%endc))
call p2c(bounds, num_soilc, filter_soilc, &
this%leafc_to_litter_patch(bounds%begp:bounds%endp), &
leafc_to_litter_col(bounds%begc:bounds%endc))
call p2c(bounds, num_soilc, filter_soilc, &
this%frootc_to_litter_patch(bounds%begp:bounds%endp), &
frootc_to_litter_col(bounds%begc:bounds%endc))

! Calculate ligninNratioAve
do fc = 1,num_soilc
c = filter_soilc(fc)
if (soilbiogeochem_cwdn_col(c) > 0._r8) then
ligninNratio_cwd = CNParamsShareInst%cwd_flig * &
(soilbiogeochem_cwdc_col(c) / soilbiogeochem_cwdn_col(c)) * &
soilbiogeochem_decomp_cascade_ctransfer_col(c,i_cwdl2)
else
ligninNratio_cwd = 0._r8
end if
this%ligninNratioAvg_col(c) = &
(ligninNratio_leaf_col(c) + ligninNratio_froot_col(c) + &
ligninNratio_cwd) / &
max(1.0e-3_r8, leafc_to_litter_col(c) + &
frootc_to_litter_col(c) + &
soilbiogeochem_decomp_cascade_ctransfer_col(c,i_cwdl2))
end do
end if

! this code is to calculate an exponentially-relaxed npp value for use in NDynamics code

if ( trim(isotope) == 'bulk') then
Expand Down
Loading