Skip to content

Commit

Permalink
limit mining
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Oct 25, 2024
1 parent 85b1b93 commit 670da83
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSplusMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ subroutine calc_myc_mining_rates(dz, cpool_som,cpool_myc, npool_som, fc_som2soma
! During this process carbon is release from the chemmically and physically protected SOM pools which enters the avaliable SOM pool.

! USES:

use clm_time_manager, only: get_step_size_real
! ARGUMENTS:
real(r8), intent(in) :: cpool_som ! SOM pool [gC/m3]
real(r8), intent(in) :: cpool_myc ! Carbon pool of mycorrhiza [gC/m3]
Expand All @@ -1957,9 +1957,12 @@ subroutine calc_myc_mining_rates(dz, cpool_som,cpool_myc, npool_som, fc_som2soma
real(r8), intent(inout) :: fn_mining_som ! nitrogen mining flux [gN/m3/s]

! LOCAL VARIABLES:
real(r8) :: secphr = 60.0_r8 * 60.0_r8
real(r8) :: secphr = 60.0_r8 * 60.0_r8
real(r8), parameter :: small_value = 1.e-10_r8
real(r8) :: dt

dt = get_step_size_real()

! SOM carbon flux
fc_som2soma = (params_inst%mimicsplus_k_mo / secphr) * dz * cpool_myc * cpool_som
! Nitrogen mining flux
Expand All @@ -1974,6 +1977,16 @@ subroutine calc_myc_mining_rates(dz, cpool_som,cpool_myc, npool_som, fc_som2soma
fn_mining_som = 0.0_r8
fc_som2soma = 0.0_r8
endif
! we need to check that we do not take too much.
if (cpool_som < fc_som2soma * dt) then
fn_mining_som = 0.0_r8
fc_som2soma = 0.0_r8
endif
! same for nitrogen
if (npool_som < fn_mining_som * dt) then
fn_mining_som = 0.0_r8
fc_som2soma = 0.0_r8
endif

end subroutine calc_myc_mining_rates

Expand Down

0 comments on commit 670da83

Please sign in to comment.