/[MITgcm]/MITgcm_contrib/bling/pkg/bling_remineralization.F
ViewVC logotype

Diff of /MITgcm_contrib/bling/pkg/bling_remineralization.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by mmazloff, Sun Feb 28 21:49:24 2016 UTC revision 1.3 by mmazloff, Sun May 15 00:30:35 2016 UTC
# Line 126  c xxx to be completed Line 126  c xxx to be completed
126        _RL lig_stability        _RL lig_stability
127        _RL FreeFe        _RL FreeFe
128        _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)
129        _RL Fe_ads_org(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL Fe_ads_org
130        _RL log_btm_flx        _RL log_btm_flx
131        _RL Fe_reminp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL Fe_reminp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
132        _RL o2_upper        _RL o2_upper
# Line 155  CEOP Line 155  CEOP
155        
156  c ---------------------------------------------------------------------  c ---------------------------------------------------------------------
157  c  Initialize output and diagnostics  c  Initialize output and diagnostics
158    
159         DO k=1,Nr         DO k=1,Nr
160          DO j=jmin,jmax          DO j=jmin,jmax
161            DO i=imin,imax            DO i=imin,imax
               Fe_ads_org(i,j,k)   = 0. _d 0  
162                Fe_ads_inorg(i,j,k) = 0. _d 0                Fe_ads_inorg(i,j,k) = 0. _d 0
163                N_reminp(i,j,k)     = 0. _d 0                N_reminp(i,j,k)     = 0. _d 0
164                P_reminp(i,j,k)     = 0. _d 0                P_reminp(i,j,k)     = 0. _d 0
# Line 184  c  Initialize output and diagnostics Line 184  c  Initialize output and diagnostics
184  c ---------------------------------------------------------------------  c ---------------------------------------------------------------------
185  c  Remineralization  c  Remineralization
186                    
 CADJ STORE Fe_ads_org = comlev1, key = ikey_dynamics  
 cxx needed?  
   
187  C$TAF LOOP = parallel  C$TAF LOOP = parallel
188        DO j=jmin,jmax         DO j=jmin,jmax
189  C$TAF LOOP = parallel  C$TAF LOOP = parallel
190         DO i=imin,imax          DO i=imin,imax
 cmm C$TAF init upper_flux = static, Nr  
191    
192  C  Initialize upper flux  C  Initialize upper flux
193          PONflux_u            = 0. _d 0          PONflux_u            = 0. _d 0
# Line 199  C  Initialize upper flux Line 195  C  Initialize upper flux
195          PFEflux_u            = 0. _d 0          PFEflux_u            = 0. _d 0
196          CaCO3flux_u          = 0. _d 0          CaCO3flux_u          = 0. _d 0
197    
198    c C$TAF init remin_stuff = static, Nr
199    
200          DO k=1,Nr          DO k=1,Nr
 c C$TAF STORE PONflux_u = upper_flux  
 c C$TAF STORE POPflux_u = upper_flux  
 c C$TAF STORE PFEflux_u = upper_flux  
 c C$TAF STORE CaCO3flux_u = upper_flux  
 CADJ STORE PONflux_u, POPflux_u, PFEflux_u, CaCO3flux_u =  
 CADJ &     comlev1, key = ikey_dynamics, kind = isbyte  
 CADJ STORE Fe_ads_org =  
 CADJ &     comlev1, key = ikey_dynamics, kind = isbyte  
 CMM)  
201    
202             Fe_ads_org   = 0. _d 0
203           IF ( hFacC(i,j,k,bi,bj).gt.0. _d 0 ) THEN           IF ( hFacC(i,j,k,bi,bj).gt.0. _d 0 ) THEN
204    
205  C  Sinking speed is evaluated at the bottom of the cell  C  Sinking speed is evaluated at the bottom of the cell
# Line 412  c     &           min(0.5/PTRACERS_dTLev Line 402  c     &           min(0.5/PTRACERS_dTLev
402  c     &           *CtoP/NUTfac*12.01/wsink)**(0.58)*FreeFe  c     &           *CtoP/NUTfac*12.01/wsink)**(0.58)*FreeFe
403    
404  #ifndef BLING_ADJOINT_SAFE  #ifndef BLING_ADJOINT_SAFE
405              Fe_ads_org(i,j,k) =              Fe_ads_org =
406       &           kFE_org*(PONflux_l/(epsln + wsink)       &           kFE_org*(PONflux_l/(epsln + wsink)
407       &             * MasstoN)**(0.58)*FreeFe       &             * MasstoN)**(0.58)*FreeFe
408  #else  #else
409              Fe_ads_org(i,j,k) =              Fe_ads_org =
410       &           kFE_org*(PONflux_l/(epsln + wsink0)       &           kFE_org*(PONflux_l/(epsln + wsink0)
411       &             * MasstoN)**(0.58)*FreeFe       &             * MasstoN)**(0.58)*FreeFe
412  #endif  #endif
# Line 429  C  it is completely remineralized (fe 2+ Line 419  C  it is completely remineralized (fe 2+
419  C  in oxidizing environments).  C  in oxidizing environments).
420    
421             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)
422       &            +Fe_ads_org(i,j,k))*drF(k)       &            +Fe_ads_org)*drF(k)
423       &            *hFacC(i,j,k,bi,bj))/(1+zremin*drF(k)       &            *hFacC(i,j,k,bi,bj))/(1+zremin*drF(k)
424       &            *hFacC(i,j,k,bi,bj))       &            *hFacC(i,j,k,bi,bj))
425    
# Line 449  c this is calculated last for the deepes Line 439  c this is calculated last for the deepes
439    
440             Fe_reminp(i,j,k) = (pfeflux_u+(Fe_spm(i,j,k)             Fe_reminp(i,j,k) = (pfeflux_u+(Fe_spm(i,j,k)
441       &            +Fe_ads_inorg(i,j,k)       &            +Fe_ads_inorg(i,j,k)
442       &            +Fe_ads_org(i,j,k))*drF(k)       &            +Fe_ads_org)*drF(k)
443       &            *hFacC(i,j,k,bi,bj)-pfeflux_l)*recip_drF(k)       &            *hFacC(i,j,k,bi,bj)-pfeflux_l)*recip_drF(k)
444       &            *recip_hFacC(i,j,k,bi,bj)       &            *recip_hFacC(i,j,k,bi,bj)
445  C!! there's an intercept_frac here... need to add  C!! there's an intercept_frac here... need to add
# Line 463  C  Prepare the tracers for the next laye Line 453  C  Prepare the tracers for the next laye
453    
454  c  c
455            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)
456       &                       - Fe_ads_org(i,j,k) - Fe_ads_inorg(i,j,k)       &                       - Fe_ads_org - Fe_ads_inorg(i,j,k)
457  cc             Fe_reminsum(i,j,k) = 0. _d 0  cc             Fe_reminsum(i,j,k) = 0. _d 0
458    
459           ENDIF           ENDIF
460    
461             Fe_ads_org   = 0. _d 0
462    
463          ENDDO          ENDDO
464         ENDDO         ENDDO
465        ENDDO        ENDDO
466    
 CADJ STORE Fe_ads_org = comlev1, key = ikey_dynamics  
 cxx needed?  
   
   
467  c ---------------------------------------------------------------------  c ---------------------------------------------------------------------
468    
469  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22