Skip to content

Commit

Permalink
AM fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elisacw committed Oct 17, 2024
1 parent ea82a98 commit b02fa11
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSplusMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,7 @@ subroutine myc_cn_fluxes(dz, fc_to_myc, fn_to_myc, fn_to_veg, fn_myc_growth, fc_

if (present(fc_myc_enz)) then ! ECM
N_demand_myc = c_use_eff * (1.0_r8 - f_enz) * fc_to_myc / params_inst%mimicsplus_cn_myc
if (N_uptake_myc > N_demand_myc) then
if (N_uptake_myc >= N_demand_myc) then
fn_to_veg = N_uptake_myc - N_demand_myc ! N flux myc -> veg
fn_myc_growth = N_demand_myc ! How much N the need to grow
fc_myc_enz = fc_to_myc * f_enz * c_use_eff
Expand All @@ -2486,10 +2486,23 @@ subroutine myc_cn_fluxes(dz, fc_to_myc, fn_to_myc, fn_to_veg, fn_myc_growth, fc_
fc_myc_resp = fc_to_myc - (fc_myc_growth + fc_myc_enz) ! C that they don't need to grow
end if
else
N_demand_myc = c_use_eff * (fc_to_myc) / params_inst%mimicsplus_cn_myc
N_demand_myc = c_use_eff * (fc_to_myc) / params_inst%mimicsplus_cn_myc !AM
if (N_uptake_myc >= N_demand_myc) then
fn_to_veg = N_uptake_myc - N_demand_myc ! N flux myc -> veg
fn_myc_growth = N_demand_myc ! How much N the need to grow
fc_myc_growth = fn_myc_growth * params_inst%mimicsplus_cn_myc
! enzyme flux will go to soma pool in the next update
fc_myc_resp = fc_to_myc - fc_myc_growth ! C that they don't need to grow
else ! less N in soil, so we limit N flux to vegetaion and mycorrhiza N demand so their sum is equal to N uptake
fn_to_veg = (1-f_growth) * N_uptake_myc
c_use_eff = f_growth * N_uptake_myc
fn_myc_growth = f_growth * N_uptake_myc
!fc_myc_growth = c_use_eff * fc_to_myc !ECW double check this or nex line
fc_myc_growth = fn_myc_growth * params_inst%mimicsplus_cn_myc / fc_to_myc
fc_myc_resp = fc_to_myc - fc_myc_growth ! C that they don't need to grow
end if
end if


end subroutine myc_cn_fluxes

!Moisture function, based on testbed code: https://github.com/wwieder/biogeochem_testbed/blob/957a5c634b9f2d0b4cdba0faa06b5a91216ace33/SOURCE_CODE/mimics_cycle.f90#L401-L419
Expand Down

0 comments on commit b02fa11

Please sign in to comment.