In tl_npzd_iron.h, this is affecting line 1680 and following:
Code: Select all
!> Bio(i,k,iPhyt)=Bio(i,k,iPhyt)/(1.0_r8+cff)
!>
tl_Bio(i,k,iPhyt)=(tl_Bio(i,k,iPhyt)- &
& tl_cff*Bio(i,k,iPhyt))/ &
& (1.0_r8+cff)
!> Bio(i,k,iZoop)=Bio(i,k,iZoop)+ &
!> & Bio(i,k,iPhyt)*cff2*cff
!>
tl_Bio(i,k,iZoop)=tl_Bio(i,k,iZoop)+ &
& cff2*(tl_Bio(i,k,iPhyt)*cff+ &
& Bio(i,k,iPhyt)*tl_cff)
!> Bio(i,k,iNO3_)=Bio(i,k,iNO3_)+ &
!> & Bio(i,k,iPhyt)*ZooEEN(ng)*cff
!>
tl_Bio(i,k,iNO3_)=tl_Bio(i,k,iNO3_)+ &
& ZooEEN(ng)*(tl_Bio(i,k,iPhyt)*cff+ &
& Bio(i,k,iPhyt)*tl_cff)
!> Bio(i,k,iSDet)=Bio(i,k,iSDet)+ &
!> & Bio(i,k,iPhyt)*ZooEED(ng)*cff
!>
tl_Bio(i,k,iSDet)=tl_Bio(i,k,iSDet)+ &
& ZooEED(ng)*(tl_Bio(i,k,iPhyt)*cff+ &
& Bio(i,k,iPhyt)*tl_cff)
FIX:
The fix is straightforward:
(1) save the nonlinear state at the correct instance by inserting a Bio2(i,k,iPhyt)=Bio(i,k,iPhyt) statement just below line 1405:
Code: Select all
Bio(i,k,iPhyt)=Bio(i,k,iPhyt)/(1.0_r8+cff)
Bio2(i,k,iPhyt)=Bio(i,k,iPhyt)
Code: Select all
!> Bio(i,k,iPhyt)=Bio(i,k,iPhyt)/(1.0_r8+cff)
!>
tl_Bio(i,k,iPhyt)=(tl_Bio(i,k,iPhyt)- &
& tl_cff*Bio2(i,k,iPhyt))/ &
& (1.0_r8+cff)
!> Bio(i,k,iZoop)=Bio(i,k,iZoop)+ &
!> & Bio(i,k,iPhyt)*cff2*cff
!>
tl_Bio(i,k,iZoop)=tl_Bio(i,k,iZoop)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