Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added clm5_params.c171117__FruitTree.nc
Binary file not shown.
6 changes: 3 additions & 3 deletions src/clm5/biogeochem/CNBalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ subroutine BeginCNBalance(this, bounds, num_soilc, filter_soilc, &
c = filter_soilc(fc)
col_begcb(c) = totcolc(c)
col_begnb(c) = totcoln(c)

end do

end associate
Expand Down Expand Up @@ -161,10 +162,9 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, &

! calculate the total column-level carbon storage, for mass conservation check
col_endcb(c) = totcolc(c)

! calculate total column-level inputs
col_cinputs = gpp(c)

! calculate total column-level outputs
! er = ar + hr, col_fire_closs includes patch-level fire losses
col_coutputs = er(c) + col_fire_closs(c) + col_hrv_xsmrpool_to_atm(c) + &
Expand All @@ -181,7 +181,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, &

! subtract leaching flux
col_coutputs = col_coutputs - som_c_leached(c)

! calculate the total column-level carbon balance error for this time step
col_errcb(c) = (col_cinputs - col_coutputs)*dt - &
(col_endcb(c) - col_begcb(c))
Expand Down
16 changes: 13 additions & 3 deletions src/clm5/biogeochem/CNCIsoFluxMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ subroutine CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
iso_cnveg_cf%frootc_to_litter_patch , cnveg_cf%frootc_to_litter_patch, &
iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, &
num_soilp , filter_soilp, 1._r8, 0, isotope)

call CIsoFluxCalc(&
iso_cnveg_cf%livestemc_to_deadstemc_patch , cnveg_cf%livestemc_to_deadstemc_patch, &
iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, &
Expand Down Expand Up @@ -414,6 +414,17 @@ subroutine CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, &
num_soilp , filter_soilp, 1._r8, 0, isotope)

call CIsoFluxCalc(&
iso_cnveg_cf%crop_seedc_to_froot_patch , cnveg_cf%crop_seedc_to_froot_patch, &
iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, &
num_soilp , filter_soilp, 1._r8, 0, isotope)

call CIsoFluxCalc(&
iso_cnveg_cf%crop_seedc_to_deadstem_patch , cnveg_cf%crop_seedc_to_deadstem_patch, &
iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, &
num_soilp , filter_soilp, 1._r8, 0, isotope)


call CIsoFluxCalc(&
iso_cnveg_cf%grain_curmr_patch , cnveg_cf%grain_curmr_patch, &
iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, &
Expand Down Expand Up @@ -1222,7 +1233,7 @@ subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, &
+ frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
+ frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)

!DML
if (ivt(p) >= npcropmin) then ! add livestemc to litter
! stem litter carbon fluxes
Expand Down Expand Up @@ -1492,7 +1503,6 @@ subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, &
hrv_livecrootc_to_litter(p) * wtcol(p) * croot_prof(p,j)
harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + &
hrv_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j)

! storage harvest mortality carbon fluxes
harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
Expand Down
135 changes: 97 additions & 38 deletions src/clm5/biogeochem/CNCStateUpdate1Mod.F90

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/clm5/biogeochem/CNCStateUpdate2Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%harvest_c_to_litr_lig_c_col(c,j) * dt
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = &
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%harvest_c_to_cwdc_col(c,j) * dt

! wood to product pools - states updated in CNProducts
end do
end do
Expand All @@ -201,7 +200,6 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
- cf_veg%hrv_livecrootc_to_litter_patch(p) * dt
cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) &
- cf_veg%hrv_deadcrootc_to_litter_patch(p) * dt

! xsmrpool
cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) &
- cf_veg%hrv_xsmrpool_to_atm_patch(p) * dt
Expand Down
9 changes: 6 additions & 3 deletions src/clm5/biogeochem/CNDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,12 @@ subroutine CNDriverNoLeaching(bounds,
filter_soilp, num_pcropp, filter_pcropp, &
doalb, waterstate_inst, temperature_inst, atm2lnd_inst, &
crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, &
cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_state_inst, soilbiogeochem_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, &
c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, &
leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), &
froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), &
stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp,1:nlevdecomp_full), &
phase=1)
call t_stopf('CNPhenology_phase1')

Expand Down Expand Up @@ -447,22 +448,24 @@ subroutine CNDriverNoLeaching(bounds,
filter_soilp, num_pcropp, filter_pcropp, &
doalb, waterstate_inst, temperature_inst, atm2lnd_inst, &
crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, &
cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_state_inst,soilbiogeochem_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, &
c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, &
leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), &
froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), &
stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp,1:nlevdecomp_full), &
phase=1)
end if
call CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, &
filter_soilp, num_pcropp, filter_pcropp, &
doalb, waterstate_inst, temperature_inst, atm2lnd_inst, &
crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, &
cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_state_inst, soilbiogeochem_state_inst,cnveg_carbonstate_inst, cnveg_carbonflux_inst, &
cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, &
c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, &
leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), &
froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), &
stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp,1:nlevdecomp_full), &
phase=2)

call t_stopf('CNPhenology')
Expand Down
8 changes: 5 additions & 3 deletions src/clm5/biogeochem/CNFUNMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
! -deciduous leaf habit (0 or 1)
stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress
! -deciduous leaf habit (0 or 1)
perennial => pftcon%perennial , & ! Input: binary flag for perennial crop types (0 or 1)
a_fix => pftcon%a_fix , & ! Input: A BNF parameter
b_fix => pftcon%b_fix , & ! Input: A BNF parameter
c_fix => pftcon%c_fix , & ! Input: A BNF parameter
Expand Down Expand Up @@ -1194,7 +1195,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
! Calculate appropriate degree of retranslocation
!-------------------------------------------------------------------------------

if(leafc(p).gt.0.0_r8.and.litterfall_n_step(p,istp)* fixerfrac>0.0_r8.and.ivt(p) <npcropmin)then
if(leafc(p).gt.0.0_r8.and.litterfall_n_step(p,istp)* fixerfrac>0.0_r8.and. (ivt(p) <npcropmin .or. perennial(ivt(p)) == 1.0_r8)) then ! include perennial woody crops (added by O.Dombrowski)
call fun_retranslocation(p,dt,npp_to_spend,&
litterfall_c_step(p,istp)* fixerfrac,&
litterfall_n_step(p,istp)* fixerfrac,&
Expand Down Expand Up @@ -1229,6 +1230,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
if(local_use_flexiblecn)then
if (leafn(p) == 0.0_r8) then ! to avoid division by zero
delta_CN = fun_cn_flex_c(ivt(p)) ! Max CN ratio over standard
write(iulog,*) 'fun_cn_flex_c is used no1'
else
delta_CN = (leafc(p)+leafc_storage(p))/(leafn(p)+leafn_storage(p)) - leafcn(ivt(p)) ! leaf CN ratio
end if
Expand All @@ -1237,12 +1239,14 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
! then, if the plant is very much in need of N, the C used for uptake is increased accordingly.
if(delta_CN .gt.0.and. frac_ideal_C_use.lt.1.0)then
frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p)))
write(iulog,*) 'fun_cn_flex_c is used no2',fun_cn_flex_c(ivt(p))
end if
! If we have too much N (e.g. from free N retranslocation) then make frac_ideal_c_use even lower.
! For a CN delta of fun_cn_flex_c, then we reduce C expendiure to the minimum of 0.5.
! This seems a little intense?
if(delta_CN.lt.0.0)then
frac_ideal_C_use = frac_ideal_C_use + 0.5_r8*(1.0_r8*delta_CN/fun_cn_flex_c(ivt(p)))
write(iulog,*) 'fun_cn_flex_c is used no3'
endif
frac_ideal_C_use = max(min(1.0_r8,frac_ideal_C_use),0.5_r8)
! don't let this go above 1 or below an arbirtray minimum (to prevent zero N uptake).
Expand Down Expand Up @@ -1519,8 +1523,6 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
npp_Nuptake(p) = soilc_change(p)
! how much carbon goes to growth of tissues?
npp_growth(p) = (Nuptake(p)- free_retransn_to_npool(p))*plantCN(p)+(excess_carbon_acc/dt) !does not include gresp, since this is calculated from growth



!-----------------------Diagnostic Fluxes------------------------------!
if(availc(p).gt.0.0_r8)then !what happens in the night?
Expand Down
30 changes: 21 additions & 9 deletions src/clm5/biogeochem/CNGRespMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst, canopystate_i
leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN)
frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN)
livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN)

perennial => pftcon%perennial , & ! Input: binary flag for perennial crop types (1=perennial, 0=not perennial)

laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:)] sunlit projected leaf area index
laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:)] shaded projected leaf area index

Expand Down Expand Up @@ -147,19 +148,29 @@ subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst, canopystate_i
respfact_livestem_storage = 1.0_r8

if (ivt(p) >= npcropmin) then ! skip 2 generic crops
cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) * respfact_livestem
if (perennial(ivt(p)) == 1._r8 .and. woody(ivt(p)) == 1.0_r8) then ! (added by O.Dombrowski)
cpool_grain_gr(p) = cpool_to_grainc(p) * grperc(ivt(p))

cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * &
respfact_livestem_storage
cpool_grain_storage_gr(p) = cpool_to_grainc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p))

transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * &
respfact_livestem_storage
transfer_grain_gr(p) = grainc_xfer_to_grainc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p)))

else
cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) * respfact_livestem

cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * &
respfact_livestem_storage

transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * &
respfact_livestem_storage

cpool_grain_gr(p) = cpool_to_grainc(p) * grperc(ivt(p))
cpool_grain_gr(p) = cpool_to_grainc(p) * grperc(ivt(p))

cpool_grain_storage_gr(p) = cpool_to_grainc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p))
cpool_grain_storage_gr(p) = cpool_to_grainc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p))

transfer_grain_gr(p) = grainc_xfer_to_grainc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p)))
transfer_grain_gr(p) = grainc_xfer_to_grainc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p)))

end if
end if

! leaf and fine root growth respiration
Expand Down Expand Up @@ -203,6 +214,7 @@ subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst, canopystate_i
cpool_deadcroot_storage_gr(p) = cpool_to_deadcrootc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p))

transfer_deadcroot_gr(p) = deadcrootc_xfer_to_deadcrootc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p)))

end if

end do
Expand Down
5 changes: 3 additions & 2 deletions src/clm5/biogeochem/CNGapMortalityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ subroutine CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_so
associate( &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type

woody => pftcon%woody , & ! Input: binary flag for woody lifeform
woody => pftcon%woody , & ! Input: binary flag for woody lifeform
perennial => pftcon%perennial , & ! Input: binary flag for perennial crop types

greffic => dgvs_inst%greffic_patch , & ! Input: [real(r8) (:) ]
heatstress => dgvs_inst%heatstress_patch , & ! Input: [real(r8) (:) ]
Expand Down Expand Up @@ -235,7 +236,7 @@ subroutine CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_so
cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadcrootn_patch(p) * m
end if

if (ivt(p) < npcropmin) then
if (ivt(p) < npcropmin .or. perennial(ivt(p)) == 1._r8) then ! perennial flag added by O.Dombrowski
cnveg_nitrogenflux_inst%m_retransn_to_litter_patch(p) = cnveg_nitrogenstate_inst%retransn_patch(p) * m
end if

Expand Down
5 changes: 4 additions & 1 deletion src/clm5/biogeochem/CNMRespMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ subroutine CNMResp(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type

woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody)

perennial => pftcon%perennial , & ! Input: binary flag for perennial crop types (1=perennial, 0= not perennial)
frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-]
laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index
laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index
Expand Down Expand Up @@ -264,6 +264,9 @@ subroutine CNMResp(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
if (woody(ivt(p)) == 1) then
livestem_mr(p) = livestemn(p)*br*tc
livecroot_mr(p) = livecrootn(p)*br_root*tc
if (perennial(ivt(p)) == 1._r8) then ! (added by O.Dombrowski)
grain_mr(p) = grainn(p)*br*tc
end if
else if (ivt(p) >= npcropmin) then
livestem_mr(p) = livestemn(p)*br*tc
grain_mr(p) = grainn(p)*br*tc
Expand Down
Loading
Loading