--- MITgcm_contrib/bling/pkg/bling_remineralization.F 2016/05/15 00:30:35 1.3 +++ MITgcm_contrib/bling/pkg/bling_remineralization.F 2016/05/19 16:30:00 1.4 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_remineralization.F,v 1.3 2016/05/15 00:30:35 mmazloff Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_remineralization.F,v 1.4 2016/05/19 16:30:00 mmazloff Exp $ C $Name: $ #include "BLING_OPTIONS.h" @@ -106,6 +106,7 @@ C Fe_recycle :: recycling of newly-produced organic iron c xxx to be completed INTEGER i,j,k + INTEGER bttmlyr _RL PONflux_u _RL POPflux_u _RL PFEflux_u @@ -195,11 +196,17 @@ PFEflux_u = 0. _d 0 CaCO3flux_u = 0. _d 0 -c C$TAF init remin_stuff = static, Nr - DO k=1,Nr Fe_ads_org = 0. _d 0 + +C ARE WE ON THE BOTTOM + bttmlyr = 1 + IF (k.LT.Nr) THEN + IF (hFacC(i,j,k+1,bi,bj).GT.0) bttmlyr = 0 +C we are not yet at the bottom + ENDIF + IF ( hFacC(i,j,k,bi,bj).gt.0. _d 0 ) THEN C Sinking speed is evaluated at the bottom of the cell @@ -239,10 +246,8 @@ & *hFacC(i,j,k,bi,bj)) C!! multiply by intercept_frac ??? - C Start with cells that are not the deepest cells - IF ((k.LT.Nr) .AND. (hFacC(i,j,k+1,bi,bj).GT.0)) THEN - + IF (bttmlyr.EQ.0) THEN C Nutrient accumulation in a cell is given by the biological production C (and instant remineralization) of particulate organic matter C plus flux thought upper interface minus flux through lower interface. @@ -257,8 +262,7 @@ & *drF(k) - CaCO3flux_l)*recip_drF(k) Fe_sed(i,j,k) = 0. _d 0 - - +C NOW DO BOTTOM LAYER ELSE C If this layer is adjacent to bottom topography or it is the deepest C cell of the domain, then remineralize/dissolve in this grid cell @@ -284,7 +288,7 @@ Fe_sed(i,j,k) = min(1. _d -11, & max(epsln, FetoC_sed * POC_sed * recip_drF(k) & *recip_hFacC(i,j,k,bi,bj))) - + #ifdef BLING_ADJOINT_SAFE Fe_sed(i,j,k) = 0. _d 0 #endif