Skip to content

Commit

Permalink
fix hist error
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Oct 30, 2024
1 parent 108f171 commit b982c0c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/biogeochem/CNFUNMIMICSplusMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ subroutine CNFUNMIMICSplus (bounds, num_soilc, filter_soilc, num_soilp ,filter_s
retransn_to_npool(p)+free_retransn_to_npool(p)

! Nactive(p) = Nactive_no3(p) + Nactive_nh4(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p)
!Nactive(p) = Necm(p) + Nam(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p)
Nactive(p) = Necm(p) + Nam(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p)
if (Nuptake(p) > 10000._r8) then
write(iulog,*) 'ERROR: Nuptake: ', Nuptake(p)
write(iulog,*) 'ERROR: Nnonmyc_no3: ', Nnonmyc_no3(p)
Expand Down Expand Up @@ -1097,6 +1097,7 @@ subroutine CNFUNMIMICSplus (bounds, num_soilc, filter_soilc, num_soilp ,filter_s
npp_Nfix(p) = (npp_paths_acc(p,ipfix)) /dt
npp_Nretrans(p) = (npp_retrans_acc(p))/dt
npp_Nactive(p) = npp_Necm(p) + npp_Nam(p) + npp_Nnonmyc_no3(p) + npp_Nnonmyc_nh4(p)
Nuptake(p) = Necm(p) + Nam(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p) + Nfix(p) + Nretrans(p)

!---------------------------Extra Respiration Fluxes--------------------!
soilc_change(p) = npp_Necm(p) + npp_Nam(p) + npp_Nnonmyc_no3(p) + npp_Nnonmyc_nh4(p) + npp_Nfix(p) + npp_Nretrans(p)
Expand Down Expand Up @@ -1150,6 +1151,13 @@ subroutine CNFUNMIMICSplus (bounds, num_soilc, filter_soilc, num_soilp ,filter_s
endif
if(npp_Nactive(p).gt.0.0_r8)then
cost_nactive(p) = (Nactive(p)+Nnonmyc(p))/(npp_Nactive(p)+npp_Nnonmyc(p))
if (cost_nactive(p) >= spval) then
write(iulog,*) 'cost_nactive: ', cost_nactive(p), Nactive(p), npp_Nactive(p)
write(iulog,*) 'myc n npp: ', Necm(p),npp_Necm(p),Nam(p),npp_Nam(p)
write(iulog,*) 'nonmyc n npp: ',Nnonmyc_no3(p),npp_Nnonmyc_no3(p),Nnonmyc_nh4(p),npp_Nnonmyc_nh4(p)
write(iulog,*) 'fix n npp: ',Nfix(p),npp_Nfix(p)
write(iulog,*) 'uptake n npp',Nuptake(p),npp_Nuptake
endif
else
cost_nactive(p) = spval
endif
Expand Down

0 comments on commit b982c0c

Please sign in to comment.