106 |
C Fe_recycle :: recycling of newly-produced organic iron |
C Fe_recycle :: recycling of newly-produced organic iron |
107 |
c xxx to be completed |
c xxx to be completed |
108 |
INTEGER i,j,k |
INTEGER i,j,k |
109 |
|
INTEGER bttmlyr |
110 |
_RL PONflux_u |
_RL PONflux_u |
111 |
_RL POPflux_u |
_RL POPflux_u |
112 |
_RL PFEflux_u |
_RL PFEflux_u |
127 |
_RL lig_stability |
_RL lig_stability |
128 |
_RL FreeFe |
_RL FreeFe |
129 |
_RL Fe_ads_inorg(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL Fe_ads_inorg(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
130 |
_RL Fe_ads_org(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL Fe_ads_org |
131 |
_RL log_btm_flx |
_RL log_btm_flx |
132 |
_RL Fe_reminp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL Fe_reminp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
133 |
_RL o2_upper |
_RL o2_upper |
156 |
|
|
157 |
c --------------------------------------------------------------------- |
c --------------------------------------------------------------------- |
158 |
c Initialize output and diagnostics |
c Initialize output and diagnostics |
159 |
|
|
160 |
DO k=1,Nr |
DO k=1,Nr |
161 |
DO j=jmin,jmax |
DO j=jmin,jmax |
162 |
DO i=imin,imax |
DO i=imin,imax |
|
Fe_ads_org(i,j,k) = 0. _d 0 |
|
163 |
Fe_ads_inorg(i,j,k) = 0. _d 0 |
Fe_ads_inorg(i,j,k) = 0. _d 0 |
164 |
N_reminp(i,j,k) = 0. _d 0 |
N_reminp(i,j,k) = 0. _d 0 |
165 |
P_reminp(i,j,k) = 0. _d 0 |
P_reminp(i,j,k) = 0. _d 0 |
185 |
c --------------------------------------------------------------------- |
c --------------------------------------------------------------------- |
186 |
c Remineralization |
c Remineralization |
187 |
|
|
|
CADJ STORE Fe_ads_org = comlev1, key = ikey_dynamics |
|
|
cxx needed? |
|
|
|
|
188 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
189 |
DO j=jmin,jmax |
DO j=jmin,jmax |
190 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
191 |
DO i=imin,imax |
DO i=imin,imax |
|
cmm C$TAF init upper_flux = static, Nr |
|
192 |
|
|
193 |
C Initialize upper flux |
C Initialize upper flux |
194 |
PONflux_u = 0. _d 0 |
PONflux_u = 0. _d 0 |
197 |
CaCO3flux_u = 0. _d 0 |
CaCO3flux_u = 0. _d 0 |
198 |
|
|
199 |
DO k=1,Nr |
DO k=1,Nr |
200 |
c C$TAF STORE PONflux_u = upper_flux |
|
201 |
c C$TAF STORE POPflux_u = upper_flux |
Fe_ads_org = 0. _d 0 |
202 |
c C$TAF STORE PFEflux_u = upper_flux |
|
203 |
c C$TAF STORE CaCO3flux_u = upper_flux |
C ARE WE ON THE BOTTOM |
204 |
CADJ STORE PONflux_u, POPflux_u, PFEflux_u, CaCO3flux_u = |
bttmlyr = 1 |
205 |
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
IF (k.LT.Nr) THEN |
206 |
CADJ STORE Fe_ads_org = |
IF (hFacC(i,j,k+1,bi,bj).GT.0) bttmlyr = 0 |
207 |
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
C we are not yet at the bottom |
208 |
CMM) |
ENDIF |
209 |
|
|
210 |
IF ( hFacC(i,j,k,bi,bj).gt.0. _d 0 ) THEN |
IF ( hFacC(i,j,k,bi,bj).gt.0. _d 0 ) THEN |
211 |
|
|
246 |
& *hFacC(i,j,k,bi,bj)) |
& *hFacC(i,j,k,bi,bj)) |
247 |
C!! multiply by intercept_frac ??? |
C!! multiply by intercept_frac ??? |
248 |
|
|
|
|
|
249 |
C Start with cells that are not the deepest cells |
C Start with cells that are not the deepest cells |
250 |
IF ((k.LT.Nr) .AND. (hFacC(i,j,k+1,bi,bj).GT.0)) THEN |
IF (bttmlyr.EQ.0) THEN |
|
|
|
251 |
C Nutrient accumulation in a cell is given by the biological production |
C Nutrient accumulation in a cell is given by the biological production |
252 |
C (and instant remineralization) of particulate organic matter |
C (and instant remineralization) of particulate organic matter |
253 |
C plus flux thought upper interface minus flux through lower interface. |
C plus flux thought upper interface minus flux through lower interface. |
262 |
& *drF(k) - CaCO3flux_l)*recip_drF(k) |
& *drF(k) - CaCO3flux_l)*recip_drF(k) |
263 |
|
|
264 |
Fe_sed(i,j,k) = 0. _d 0 |
Fe_sed(i,j,k) = 0. _d 0 |
265 |
|
C NOW DO BOTTOM LAYER |
|
|
|
266 |
ELSE |
ELSE |
267 |
C If this layer is adjacent to bottom topography or it is the deepest |
C If this layer is adjacent to bottom topography or it is the deepest |
268 |
C cell of the domain, then remineralize/dissolve in this grid cell |
C cell of the domain, then remineralize/dissolve in this grid cell |
288 |
Fe_sed(i,j,k) = min(1. _d -11, |
Fe_sed(i,j,k) = min(1. _d -11, |
289 |
& max(epsln, FetoC_sed * POC_sed * recip_drF(k) |
& max(epsln, FetoC_sed * POC_sed * recip_drF(k) |
290 |
& *recip_hFacC(i,j,k,bi,bj))) |
& *recip_hFacC(i,j,k,bi,bj))) |
291 |
|
|
292 |
#ifdef BLING_ADJOINT_SAFE |
#ifdef BLING_ADJOINT_SAFE |
293 |
Fe_sed(i,j,k) = 0. _d 0 |
Fe_sed(i,j,k) = 0. _d 0 |
294 |
#endif |
#endif |
406 |
c & *CtoP/NUTfac*12.01/wsink)**(0.58)*FreeFe |
c & *CtoP/NUTfac*12.01/wsink)**(0.58)*FreeFe |
407 |
|
|
408 |
#ifndef BLING_ADJOINT_SAFE |
#ifndef BLING_ADJOINT_SAFE |
409 |
Fe_ads_org(i,j,k) = |
Fe_ads_org = |
410 |
& kFE_org*(PONflux_l/(epsln + wsink) |
& kFE_org*(PONflux_l/(epsln + wsink) |
411 |
& * MasstoN)**(0.58)*FreeFe |
& * MasstoN)**(0.58)*FreeFe |
412 |
#else |
#else |
413 |
Fe_ads_org(i,j,k) = |
Fe_ads_org = |
414 |
& kFE_org*(PONflux_l/(epsln + wsink0) |
& kFE_org*(PONflux_l/(epsln + wsink0) |
415 |
& * MasstoN)**(0.58)*FreeFe |
& * MasstoN)**(0.58)*FreeFe |
416 |
#endif |
#endif |
423 |
C in oxidizing environments). |
C in oxidizing environments). |
424 |
|
|
425 |
PFEflux_l = (PFEflux_u+(Fe_spm(i,j,k)+Fe_ads_inorg(i,j,k) |
PFEflux_l = (PFEflux_u+(Fe_spm(i,j,k)+Fe_ads_inorg(i,j,k) |
426 |
& +Fe_ads_org(i,j,k))*drF(k) |
& +Fe_ads_org)*drF(k) |
427 |
& *hFacC(i,j,k,bi,bj))/(1+zremin*drF(k) |
& *hFacC(i,j,k,bi,bj))/(1+zremin*drF(k) |
428 |
& *hFacC(i,j,k,bi,bj)) |
& *hFacC(i,j,k,bi,bj)) |
429 |
|
|
443 |
|
|
444 |
Fe_reminp(i,j,k) = (pfeflux_u+(Fe_spm(i,j,k) |
Fe_reminp(i,j,k) = (pfeflux_u+(Fe_spm(i,j,k) |
445 |
& +Fe_ads_inorg(i,j,k) |
& +Fe_ads_inorg(i,j,k) |
446 |
& +Fe_ads_org(i,j,k))*drF(k) |
& +Fe_ads_org)*drF(k) |
447 |
& *hFacC(i,j,k,bi,bj)-pfeflux_l)*recip_drF(k) |
& *hFacC(i,j,k,bi,bj)-pfeflux_l)*recip_drF(k) |
448 |
& *recip_hFacC(i,j,k,bi,bj) |
& *recip_hFacC(i,j,k,bi,bj) |
449 |
C!! there's an intercept_frac here... need to add |
C!! there's an intercept_frac here... need to add |
457 |
|
|
458 |
c |
c |
459 |
Fe_reminsum(i,j,k) = Fe_reminp(i,j,k) + Fe_sed(i,j,k) |
Fe_reminsum(i,j,k) = Fe_reminp(i,j,k) + Fe_sed(i,j,k) |
460 |
& - Fe_ads_org(i,j,k) - Fe_ads_inorg(i,j,k) |
& - Fe_ads_org - Fe_ads_inorg(i,j,k) |
461 |
cc Fe_reminsum(i,j,k) = 0. _d 0 |
cc Fe_reminsum(i,j,k) = 0. _d 0 |
462 |
|
|
463 |
ENDIF |
ENDIF |
464 |
|
|
465 |
|
Fe_ads_org = 0. _d 0 |
466 |
|
|
467 |
ENDDO |
ENDDO |
468 |
ENDDO |
ENDDO |
469 |
ENDDO |
ENDDO |
470 |
|
|
|
CADJ STORE Fe_ads_org = comlev1, key = ikey_dynamics |
|
|
cxx needed? |
|
|
|
|
|
|
|
471 |
c --------------------------------------------------------------------- |
c --------------------------------------------------------------------- |
472 |
|
|
473 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |