/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_som_advect.F
ViewVC logotype

Diff of /MITgcm/pkg/generic_advdiff/gad_som_advect.F

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

revision 1.11 by jmc, Sat Mar 2 00:32:30 2013 UTC revision 1.12 by jmc, Tue Nov 19 16:59:33 2013 UTC
# Line 11  C !INTERFACE: ========================== Line 11  C !INTERFACE: ==========================
11        SUBROUTINE GAD_SOM_ADVECT(        SUBROUTINE GAD_SOM_ADVECT(
12       I     implicitAdvection, advectionScheme, vertAdvecScheme,       I     implicitAdvection, advectionScheme, vertAdvecScheme,
13       I     tracerIdentity, deltaTLev,       I     tracerIdentity, deltaTLev,
14       I     uVel, vVel, wVel, tracer,       I     uFld, vFld, wFld, tracer,
15       U     smTr,       U     smTr,
16       O     gTracer,       O     gTracer,
17       I     bi,bj, myTime,myIter,myThid)       I     bi,bj, myTime,myIter,myThid)
# Line 40  C  implicitAdvection :: implicit vertica Line 40  C  implicitAdvection :: implicit vertica
40  C  advectionScheme   :: advection scheme to use (Horizontal plane)  C  advectionScheme   :: advection scheme to use (Horizontal plane)
41  C  vertAdvecScheme   :: advection scheme to use (vertical direction)  C  vertAdvecScheme   :: advection scheme to use (vertical direction)
42  C  tracerIdentity    :: tracer identifier (required only for OBCS)  C  tracerIdentity    :: tracer identifier (required only for OBCS)
43  C  uVel              :: velocity, zonal component  C  uFld              :: Advection velocity field, zonal component
44  C  vVel              :: velocity, meridional component  C  vFld              :: Advection velocity field, meridional component
45  C  wVel              :: velocity, vertical component  C  wFld              :: Advection velocity field, vertical component
46  C  tracer            :: tracer field  C  tracer            :: tracer field
47  C  bi,bj             :: tile indices  C  bi,bj             :: tile indices
48  C  myTime            :: current time  C  myTime            :: current time
# Line 52  C  myThid            :: thread number Line 52  C  myThid            :: thread number
52        INTEGER advectionScheme, vertAdvecScheme        INTEGER advectionScheme, vertAdvecScheme
53        INTEGER tracerIdentity        INTEGER tracerIdentity
54        _RL deltaTLev(Nr)        _RL deltaTLev(Nr)
55        _RL uVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL uFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
56        _RL vVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL vFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
57        _RL wVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL wFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
58        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
59        INTEGER bi,bj        INTEGER bi,bj
60        _RL myTime        _RL myTime
# Line 73  C  i,j,k         :: loop indices Line 73  C  i,j,k         :: loop indices
73  C  kUp           :: index into 2 1/2D array, toggles between 1 and 2  C  kUp           :: index into 2 1/2D array, toggles between 1 and 2
74  C  kDown         :: index into 2 1/2D array, toggles between 2 and 1  C  kDown         :: index into 2 1/2D array, toggles between 2 and 1
75  C  xA,yA         :: areas of X and Y face of tracer cells  C  xA,yA         :: areas of X and Y face of tracer cells
 C  uFld,vFld     :: 2-D local copy of horizontal velocity, U,V components  
 C  wFld          :: 2-D local copy of vertical velocity  
76  C  uTrans,vTrans :: 2-D arrays of volume transports at U,V points  C  uTrans,vTrans :: 2-D arrays of volume transports at U,V points
77  C  rTrans        :: 2-D arrays of volume transports at W points  C  rTrans        :: 2-D arrays of volume transports at W points
78  C  afx           :: 2-D array for horizontal advective flux, x direction  C  afx           :: 2-D array for horizontal advective flux, x direction
# Line 96  C  msgBuf        :: Informational/error Line 94  C  msgBuf        :: Informational/error
94        INTEGER i,j,k,km1,kUp,kDown        INTEGER i,j,k,km1,kUp,kDown
95        _RS xA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS xA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
96        _RS yA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS yA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL uFld    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL vFld    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL wFld    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
97        _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
98        _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
99        _RL rTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
# Line 181  C     uninitialised but inert locations. Line 176  C     uninitialised but inert locations.
176         DO i=1-OLx,sNx+OLx         DO i=1-OLx,sNx+OLx
177           afx(i,j) = 0.           afx(i,j) = 0.
178           afy(i,j) = 0.           afy(i,j) = 0.
179  C-    xA,yA,uFld,vFld,uTrans,vTrans are set over the full domain  C-    xA,yA,uTrans,vTrans are set over the full domain
180  C     in CALC_COMMON_FACTORS: no need for extra initialisation  C      => no need for extra initialisation
181  c       xA(i,j)      = 0. _d 0  c       xA(i,j)      = 0. _d 0
182  c       yA(i,j)      = 0. _d 0  c       yA(i,j)      = 0. _d 0
183  c       uTrans(i,j)  = 0. _d 0  c       uTrans(i,j)  = 0. _d 0
# Line 246  C--   Start of k loop for horizontal flu Line 241  C--   Start of k loop for horizontal flu
241        DO k=1,Nr        DO k=1,Nr
242    
243  C--   Get temporary terms used by tendency routines  C--   Get temporary terms used by tendency routines
244         CALL CALC_COMMON_FACTORS (         DO j=1-OLy,sNy+OLy
245       I         uVel, vVel,          DO i=1-OLx,sNx+OLx
246       O         uFld, vFld, uTrans, vTrans, xA, yA,            xA(i,j) = _dyG(i,j,bi,bj)*deepFacC(k)
247       I         k,bi,bj, myThid )       &            *drF(k)*_hFacW(i,j,k,bi,bj)
248              yA(i,j) = _dxG(i,j,bi,bj)*deepFacC(k)
249  #ifdef ALLOW_GMREDI       &            *drF(k)*_hFacS(i,j,k,bi,bj)
250  C--   Residual transp = Bolus transp + Eulerian transp          ENDDO
251         IF (useGMRedi)         ENDDO
252       &   CALL GMREDI_CALC_UVFLOW(  C--   Calculate "volume transports" through tracer cell faces.
253       U                  uFld, vFld, uTrans, vTrans,  C     anelastic: scaled by rhoFacC (~ mass transport)
254       I                  k, bi, bj, myThid )         DO j=1-OLy,sNy+OLy
255  #endif /* ALLOW_GMREDI */          DO i=1-OLx,sNx+OLx
256              uTrans(i,j) = uFld(i,j,k)*xA(i,j)*rhoFacC(k)
257              vTrans(i,j) = vFld(i,j,k)*yA(i,j)*rhoFacC(k)
258            ENDDO
259           ENDDO
260    
261  C--   grid-box volume and tracer content (zero order moment)  C--   grid-box volume and tracer content (zero order moment)
262         DO j=1-OLy,sNy+OLy         DO j=1-OLy,sNy+OLy
# Line 514  c       IF ( k.EQ.1 ) THEN Line 513  c       IF ( k.EQ.1 ) THEN
513  C- Surface interface :  C- Surface interface :
514           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
515            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
            wFld(i,j)   = 0.  
516             rTrans(i,j) = 0.             rTrans(i,j) = 0.
517             maskUp(i,j) = 0.             maskUp(i,j) = 0.
518            ENDDO            ENDDO
# Line 524  C- Surface interface : Line 522  C- Surface interface :
522  C- Interior interface :  C- Interior interface :
523           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
524            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
525             wFld(i,j)   = wVel(i,j,k,bi,bj)             rTrans(i,j) = wFld(i,j,k)*rA(i,j,bi,bj)
            rTrans(i,j) = wVel(i,j,k,bi,bj)*rA(i,j,bi,bj)  
526       &                 *deepFac2F(k)*rhoFacF(k)       &                 *deepFac2F(k)*rhoFacF(k)
527       &                 *maskC(i,j,k-1,bi,bj)       &                 *maskC(i,j,k-1,bi,bj)
528             maskUp(i,j) = 1.             maskUp(i,j) = 1.
# Line 537  C- Linear Free-Surface: do not mask rTra Line 534  C- Linear Free-Surface: do not mask rTra
534           km1= MAX(k-1,1)           km1= MAX(k-1,1)
535           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
536            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
537             wFld(i,j)   = wVel(i,j,k,bi,bj)             rTrans(i,j) = wFld(i,j,k)*rA(i,j,bi,bj)
            rTrans(i,j) = wVel(i,j,k,bi,bj)*rA(i,j,bi,bj)  
538       &                 *deepFac2F(k)*rhoFacF(k)       &                 *deepFac2F(k)*rhoFacF(k)
539             maskUp(i,j) = maskC(i,j,km1,bi,bj)*maskC(i,j,k,bi,bj)             maskUp(i,j) = maskC(i,j,km1,bi,bj)*maskC(i,j,k,bi,bj)
540            ENDDO            ENDDO
# Line 547  C- Linear Free-Surface: do not mask rTra Line 543  C- Linear Free-Surface: do not mask rTra
543  C- end Surface/Interior if bloc  C- end Surface/Interior if bloc
544          ENDIF          ENDIF
545    
 #ifdef ALLOW_GMREDI  
 C--   Residual transp = Bolus transp + Eulerian transp  
         IF (useGMRedi .AND. k.GT.1 )  
      &     CALL GMREDI_CALC_WFLOW(  
      U                 wFld, rTrans,  
      I                 k, bi, bj, myThid )  
 #endif /* ALLOW_GMREDI */  
   
546  C-    Compute vertical advective flux in the interior:  C-    Compute vertical advective flux in the interior:
547          IF ( vertAdvecScheme.EQ.ENUM_SOM_PRATHER          IF ( vertAdvecScheme.EQ.ENUM_SOM_PRATHER
548       &     .OR. vertAdvecScheme.EQ.ENUM_SOM_LIMITER ) THEN       &     .OR. vertAdvecScheme.EQ.ENUM_SOM_LIMITER ) THEN

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22