@@ -316,9 +316,13 @@ subroutine initialize(self,configunit)
316316 if (self% use_cyanos) then
317317 call self% register_state_variable( self% id_bg, ' bg' , ' mgC/m3' , ' cyanobacteria' , minimum= 1.0e-14_rk , vertical_movement=- self% BioC(44 ) , &
318318 initial_value= 1e-4_rk * redf(1 )* redf(6 ) )
319- if (self% use_chl) &
319+ if (self% use_chl) then
320320 call self% register_state_variable( self% id_bgchl, ' bgchl' , ' mgChl/m3' , ' cyanobacteria chl-a' , minimum= 1.0e-14_rk / 20 ., vertical_movement=- self% BioC(44 ) , &
321321 initial_value= 1e-4_rk * redf(1 )* redf(6 )/ 27 .)
322+ call self% add_to_aggregate_variable(total_chlorophyll, self% id_bgchl)
323+ else
324+ call self% add_to_aggregate_variable(total_chlorophyll, self% id_bg, scale_factor= 1.0_rk / 60.0_rk )
325+ end if
322326 end if
323327 if (self% use_coccolithophores) then
324328 call self% register_state_variable( self% id_cocco, ' ccl' , ' mgC/m3' , ' coccolithophores' , minimum= 1.0e-14_rk , vertical_movement=- self% sinkCocco , &
@@ -572,8 +576,10 @@ subroutine do(self,_ARGUMENTS_DO_)
572576 bg_loss = max (sign (- 1.0_rk ,bg-0.5_rk ),0.0_rk ) ! cyanobacteria
573577 mic_loss = max (sign (- 1.0_rk ,microzoo-0.05_rk ),0.0_rk ) ! microzooplankton
574578 mes_loss = max (sign (- 1.0_rk ,mesozoo-0.05_rk ),0.0_rk ) ! mesozooplankton
575- cocco_loss = max (sign (- 1.0_rk ,cocco-0.5_rk ),0.0_rk ) ! coccolithophores
576- caco3_loss = max (sign (- 1.0_rk ,caco3-0.1_rk ),0.0_rk ) ! caco3 - temporary for now
579+ if (self% use_coccolithophores) then
580+ cocco_loss = max (sign (- 1.0_rk ,cocco-0.5_rk ),0.0_rk ) ! coccolithophores
581+ caco3_loss = max (sign (- 1.0_rk ,caco3-0.1_rk ),0.0_rk ) ! caco3 - temporary for now
582+ end if
577583
578584 ! remineralisation rate
579585 frem = self% BioC(22 ) * (1._rk+20._rk * (temp** 2 / (13._rk ** 2 + temp** 2 )))
@@ -599,7 +605,12 @@ subroutine do(self,_ARGUMENTS_DO_)
599605 up_nh4_cocco = nh4/ (self% rNH4cocco+ nh4)
600606 up_no3_cocco = no3/ (self% rNO3cocco+ no3)* exp (- self% BioC(8 )* nh4)
601607 up_pho_cocco = pho/ (self% rPO4cocco+ pho)
602- up_n_cocco = up_nh4_cocco+ up_no3_cocco
608+ up_n_cocco = up_nh4_cocco+ up_no3_cocco
609+ else
610+ up_nh4_cocco = 0.0_rk
611+ up_no3_cocco = 0.0_rk
612+ up_pho_cocco = 0.0_rk
613+ up_n_cocco = 0.0_rk
603614 end if
604615
605616 ! production and nutrient uptake
@@ -780,9 +791,10 @@ subroutine do(self,_ARGUMENTS_DO_)
780791 highMortPs = self% m2Ps * ( fla/ (fla + self% Km2Ps) )
781792 highMortPl = self% m2Pl * ( dia/ (dia + self% Km2Pl) )
782793 highMortZs = self% m2Zs * ( microzoo/ (microzoo + self% Km2Zs) )
783- highMortZl = self% m2Zl * ( mesozoo/ (mesozoo + self% Km2Zl) )
784- highMortCocco = self% mort2Cocco * ( cocco/ (cocco + self% Km2Cocco) )
785-
794+ highMortZl = self% m2Zl * ( mesozoo/ (mesozoo + self% Km2Zl) )
795+ if (self% use_coccolithophores) then
796+ highMortCocco = self% mort2Cocco * ( cocco/ (cocco + self% Km2Cocco) )
797+ end if
786798 _SET_ODE_(self% id_fla, (self% BioC(2 )* Ps_prod - self% BioC(10 )* fla_loss - highMortPs* fla_loss )* fla - ZsonPs* microzoo - ZlonPs* mesozoo)
787799 _SET_ODE_(self% id_dia, (self% BioC(1 )* Pl_prod - self% BioC(9 )* dia_loss - highMortPl* dia_loss )* dia - ZsonPl* microzoo - ZlonPl* mesozoo)
788800 if (self% use_cyanos) then
@@ -899,10 +911,13 @@ subroutine do(self,_ARGUMENTS_DO_)
899911
900912 ! phosphate
901913
902- rhs = - Prod_Dia_Fla - Prod_Cocco - Prod_BG - self % BioC( 28 ) * bg * Bg_fix &
914+ rhs = - Prod_Dia_Fla - Prod_Cocco - Prod_BG &
903915 + self% BioC(18 ) * microzoo * mic_loss &
904916 + self% BioC(17 ) * mesozoo * mes_loss &
905917 + frem* det + fremDOM* dom
918+ if (self% use_cyanos) then
919+ rhs = rhs - self% BioC(28 )* bg* Bg_fix
920+ end if
906921 _SET_ODE_(self% id_pho, rhs)
907922
908923
0 commit comments