Skip to content

Commit

Permalink
addresses #41, allowing micCN to change with litter quality.
Browse files Browse the repository at this point in the history
  • Loading branch information
wwieder committed Nov 19, 2020
1 parent 3bd07c3 commit e4ea7f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
10 changes: 6 additions & 4 deletions SOURCE_CODE/mimics_cycle_CN.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,8 @@ SUBROUTINE mimics_soil_reverseMM_CN(mp,iYrCnt,idoy,mdaily,cleaf2met,cleaf2str,cr
! 0.3 tau_r(2)
! 0.00024 tau_k(1)
! 0.1 tau_k(2)
mimicsbiome%CN_r(npt) = mimicsbiome%CNr * SQRT(mimicsbiome%fmet(npt)/mimicsbiome%cnModDenom)
mimicsbiome%CN_k(npt) = mimicsbiome%CNk * SQRT(mimicsbiome%fmet(npt)/mimicsbiome%cnModDenom)

mimicsbiome%tauR(npt) = mimicsbiome%tau_r(1) * &
exp(mimicsbiome%tau_r(2) * mimicsbiome%fmet(npt)) * mimicsbiome%tauMod(npt)
Expand Down Expand Up @@ -1771,16 +1773,16 @@ SUBROUTINE mimics_soil_reverseMM_CN(mp,iYrCnt,idoy,mdaily,cleaf2met,cleaf2str,cr
upMICrC = mimicsbiome%MGE(1)*(LITmin(1)+SOMmin(1)) + mimicsbiome%MGE(2)*(LITmin(2))
upMICrN = mimicsbiome%NUE(1)*(LITminN(1)+SOMminN(1)) + mimicsbiome%NUE(2)*(LITminN(2)) + DINup_r
CNup_r = upMICrC/(upMICrN + 1e-10) !avoiding /0
Overflow_r = upMICrC - upMICrN*min(mimicsbiome%CN_r, CNup_r)
Nspill_r = upMICrN - upMICrC/max(mimicsbiome%CN_r, CNup_r)
Overflow_r = upMICrC - upMICrN*min(mimicsbiome%CN_r(npt), CNup_r)
Nspill_r = upMICrN - upMICrC/max(mimicsbiome%CN_r(npt), CNup_r)
! Add Overflow_r and Overflow_k to output netCDF file. Units conversion occurs in subroutine mimics_caccum. -mdh 10/12/2020
mimicsflux%Overflow_r(npt) = mimicsflux%Overflow_r(npt) + Overflow_r

upMICkC = mimicsbiome%MGE(3)*(LITmin(3)+ SOMmin(2)) + mimicsbiome%MGE(4)*(LITmin(4))
upMICkN = mimicsbiome%NUE(3)*(LITminN(3) + SOMminN(2)) + mimicsbiome%NUE(4)*LITminN(4) + DINup_k
CNup_k = upMICkC/(upMICkN + 1e-10)
Overflow_k = upMICkC - upMICkN*min(mimicsbiome%CN_k, CNup_k)
Nspill_k = upMICkN - upMICkC/max(mimicsbiome%CN_k, CNup_k)
Overflow_k = upMICkC - upMICkN*min(mimicsbiome%CN_k(npt), CNup_k)
Nspill_k = upMICkN - upMICkC/max(mimicsbiome%CN_k(npt), CNup_k)
! Add Overflow_r and Overflow_k to output netCDF file. Units conversion occurs in subroutine mimics_caccum. -mdh 10/12/2020
mimicsflux%Overflow_k(npt) = mimicsflux%Overflow_k(npt) + Overflow_k

Expand Down
15 changes: 8 additions & 7 deletions SOURCE_CODE/mimics_inout_CN.f90
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ SUBROUTINE mimics_readbiome(fname_mimicsbiome, mp, mvtype)
write(*,'(2x,a13,2x,f10.6)') 'tau_k(1)=', mimicsbiome%tau_k(1)
write(*,'(2x,a13,2x,f10.6)') 'tau_k(2)=', mimicsbiome%tau_k(2)


read(101,*) mimicsbiome%tauModDenom
read(101,*) mimicsbiome%tauMod_MIN
read(101,*) mimicsbiome%tauMod_MAX
Expand Down Expand Up @@ -304,13 +303,15 @@ SUBROUTINE mimics_readbiome(fname_mimicsbiome, mp, mvtype)
write(*,'(2x,a7,2x,f10.6)') 'NUE(3)=', mimicsbiome%NUE(3)
write(*,'(2x,a7,2x,f10.6)') 'NUE(4)=', mimicsbiome%NUE(4)

read(101,*) mimicsbiome%CN_r
read(101,*) mimicsbiome%CN_k
read(101,*) mimicsbiome%CNr
read(101,*) mimicsbiome%CNk
read(101,*) mimicsbiome%fracDINavailMIC
read(101,*) mimicsbiome%cnModDenom

write(*,'(2x,a5,2x,f10.6)') 'CN_r=', mimicsbiome%CN_r
write(*,'(2x,a5,2x,f10.6)') 'CN_k=', mimicsbiome%CN_k
write(*,'(2x,a5,2x,f10.6)') 'CNr=', mimicsbiome%CNr
write(*,'(2x,a5,2x,f10.6)') 'CNk=', mimicsbiome%CNk
write(*,'(2x,a16,2x,f10.6)') 'fracDINavailMIC=', mimicsbiome%fracDINavailMIC
write(*,'(2x,a13,2x,f10.6)') 'cnModDenom=', mimicsbiome%cnModDenom
!! ----------------------------------------------------------------------


Expand Down Expand Up @@ -448,8 +449,8 @@ SUBROUTINE mimics_init(filename_mimicsipool,mp,ms,mst)

mimicspool%LITmN(:) = mimicspool%LITm(:)/10.0
mimicspool%LITsN(:) = mimicspool%LITs(:)/10.0
mimicspool%MICrN(:) = mimicspool%MICr(:)/mimicsbiome%CN_r
mimicspool%MICkN(:) = mimicspool%MICk(:)/mimicsbiome%CN_k
mimicspool%MICrN(:) = mimicspool%MICr(:)/mimicsbiome%CNr
mimicspool%MICkN(:) = mimicspool%MICk(:)/mimicsbiome%CNk
mimicspool%SOMaN(:) = mimicspool%SOMa(:)/10.0
mimicspool%SOMcN(:) = mimicspool%SOMc(:)/10.0
mimicspool%SOMpN(:) = mimicspool%SOMp(:)/10.0
Expand Down
14 changes: 9 additions & 5 deletions SOURCE_CODE/mimics_variable_CN.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ MODULE mimicsvariable
REAL(r_2), POINTER :: tauModDenom, tauMod_MIN, tauMod_MAX

REAL(r_2), POINTER :: densDep, &
CN_r, &
CN_k, &
fracDINavailMIC
fracDINavailMIC, &
cnModDenom, CNr, CNk

REAL(r_2), DIMENSION(:), POINTER :: fmet, &
ligninNratioAvg, &
CN_r, &
CN_k, &
Vslope, &
Kslope, &
Vmod, &
Expand Down Expand Up @@ -203,8 +204,9 @@ SUBROUTINE alloc_mimicsvariable(mp,mvtype,mplant)
mimicsbiome%tauMod_MIN, &
mimicsbiome%tauMod_MAX, &
mimicsbiome%densDep, &
mimicsbiome%CN_r, &
mimicsbiome%CN_k, &
mimicsbiome%CNr, &
mimicsbiome%CNk, &
mimicsbiome%cnModDenom, &
mimicsbiome%fracDINavailMIC)

ALLOCATE(mimicsbiome%Vint(nRK), &
Expand All @@ -226,6 +228,8 @@ SUBROUTINE alloc_mimicsvariable(mp,mvtype,mplant)
mimicsbiome%desorb(arraysize), &
mimicsbiome%fmet(arraysize), &
mimicsbiome%ligninNratioAvg(arraysize), &
mimicsbiome%CN_r(arraysize), &
mimicsbiome%CN_k(arraysize), &
mimicsbiome%tauR(arraysize), &
mimicsbiome%tauK(arraysize), &
mimicsbiome%tauMod(arraysize), &
Expand Down

0 comments on commit e4ea7f3

Please sign in to comment.