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

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

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

revision 1.18 by jmc, Wed Jan 7 21:35:00 2004 UTC revision 1.21 by edhill, Mon Mar 29 03:33:51 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
 CBOI  
 C !TITLE: pkg/generic\_advdiff  
 C !AUTHORS: adcroft@mit.edu  
 C !INTRODUCTION: Generic Advection Diffusion Package  
 C  
 C Package "generic\_advdiff" provides a common set of routines for calculating  
 C advective/diffusive fluxes for tracers (cell centered quantities on a C-grid).  
 C  
 C Many different advection schemes are available: the standard centered  
 C second order, centered fourth order and upwind biased third order schemes  
 C are known as linear methods and require some stable time-stepping method  
 C such as Adams-Bashforth. Alternatives such as flux-limited schemes are  
 C stable in the forward sense and are best combined with the multi-dimensional  
 C method provided in gad\_advection.  
 C  
 C There are two high-level routines:  
 C  \begin{itemize}  
 C  \item{GAD\_CALC\_RHS} calculates all fluxes at time level "n" and is used  
 C  for the standard linear schemes. This must be used in conjuction with  
 C  Adams-Bashforth time-stepping. Diffusive and parameterized fluxes are  
 C  always calculated here.  
 C  \item{GAD\_ADVECTION} calculates just the advective fluxes using the  
 C  non-linear schemes and can not be used in conjuction with Adams-Bashforth  
 C  time-stepping.  
 C  \end{itemize}  
 CEOI  
   
4  #include "GAD_OPTIONS.h"  #include "GAD_OPTIONS.h"
5    
6    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7  CBOP  CBOP
8  C !ROUTINE: GAD_ADVECTION  C !ROUTINE: GAD_ADVECTION
9    
10  C !INTERFACE: ==========================================================  C !INTERFACE: ==========================================================
11        SUBROUTINE GAD_ADVECTION(        SUBROUTINE GAD_ADVECTION(
12       I           implicitAdvection, advectionScheme, tracerIdentity,       I     implicitAdvection, advectionScheme, tracerIdentity,
13       I           uVel, vVel, wVel, tracer,       I     uVel, vVel, wVel, tracer,
14       O           gTracer,       O     gTracer,
15       I           bi,bj, myTime,myIter,myThid)       I     bi,bj, myTime,myIter,myThid)
 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  
16    
17  C !DESCRIPTION:  C !DESCRIPTION:
18  C Calculates the tendancy of a tracer due to advection.  C Calculates the tendancy of a tracer due to advection.
# Line 73  C !USES: =============================== Line 46  C !USES: ===============================
46  #endif  #endif
47    
48  C !INPUT PARAMETERS: ===================================================  C !INPUT PARAMETERS: ===================================================
49  C  implicitAdvection    :: vertical advection treated implicitly (later on)  C  implicitAdvection :: implicit vertical advection (later on)
50  C  advectionScheme      :: advection scheme to use  C  advectionScheme   :: advection scheme to use
51  C  tracerIdentity       :: identifier for the tracer (required only for OBCS)  C  tracerIdentity    :: tracer identifier (required only for OBCS)
52  C  uVel                 :: velocity, zonal component  C  uVel              :: velocity, zonal component
53  C  vVel                 :: velocity, meridional component  C  vVel              :: velocity, meridional component
54  C  wVel                 :: velocity, vertical component  C  wVel              :: velocity, vertical component
55  C  tracer               :: tracer field  C  tracer            :: tracer field
56  C  bi,bj                :: tile indices  C  bi,bj             :: tile indices
57  C  myTime               :: current time  C  myTime            :: current time
58  C  myIter               :: iteration number  C  myIter            :: iteration number
59  C  myThid               :: thread number  C  myThid            :: thread number
60        LOGICAL implicitAdvection        LOGICAL implicitAdvection
61        INTEGER advectionScheme        INTEGER advectionScheme
62        INTEGER tracerIdentity        INTEGER tracerIdentity
# Line 97  C  myThid               :: thread number Line 70  C  myThid               :: thread number
70        INTEGER myThid        INTEGER myThid
71    
72  C !OUTPUT PARAMETERS: ==================================================  C !OUTPUT PARAMETERS: ==================================================
73  C  gTracer              :: tendancy array  C  gTracer           :: tendancy array
74        _RL gTracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)        _RL gTracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
75    
76  C !LOCAL VARIABLES: ====================================================  C !LOCAL VARIABLES: ====================================================
77  C  maskUp               :: 2-D array for mask at W points  C  maskUp        :: 2-D array for mask at W points
78  C  iMin,iMax,jMin,jMax  :: loop range for called routines  C  iMin,iMax,    :: loop range for called routines
79  C  i,j,k                :: loop indices  C  jMin,jMax     :: loop range for called routines
80  C  kup                  :: index into 2 1/2D array, toggles between 1 and 2  C  i,j,k         :: loop indices
81  C  kdown                :: index into 2 1/2D array, toggles between 2 and 1  C  kup           :: index into 2 1/2D array, toggles between 1 and 2
82  C  kp1                  :: =k+1 for k<Nr, =Nr for k=Nr  C  kdown         :: index into 2 1/2D array, toggles between 2 and 1
83  C  xA,yA                :: areas of X and Y face of tracer cells  C  kp1           :: =k+1 for k<Nr, =Nr for k=Nr
84  C  uTrans,vTrans,rTrans :: 2-D arrays of volume transports at U,V and W points  C  xA,yA         :: areas of X and Y face of tracer cells
85  C  rTransKp1            :: vertical volume transport at interface k+1  C  uTrans,vTrans :: 2-D arrays of volume transports at U,V points
86  C  af                   :: 2-D array for horizontal advective flux  C  rTrans        :: 2-D arrays of volume transports at W points
87  C  fVerT                :: 2 1/2D arrays for vertical advective flux  C  rTransKp1     :: vertical volume transport at interface k+1
88  C  localTij             :: 2-D array used as temporary local copy of tracer fld  C  af            :: 2-D array for horizontal advective flux
89  C  localTijk            :: 3-D array used as temporary local copy of tracer fld  C  fVerT         :: 2 1/2D arrays for vertical advective flux
90  C  kp1Msk               :: flag (0,1) to act as over-riding mask for W levels  C  localTij      :: 2-D array, temporary local copy of tracer fld
91  C  calc_fluxes_X        :: logical to indicate to calculate fluxes in X dir  C  localTijk     :: 3-D array, temporary local copy of tracer fld
92  C  calc_fluxes_Y        :: logical to indicate to calculate fluxes in Y dir  C  kp1Msk        :: flag (0,1) for over-riding mask for W levels
93  C  nipass               :: number of passes to make in multi-dimensional method  C  calc_fluxes_X :: logical to indicate to calculate fluxes in X dir
94  C  ipass                :: number of the current pass being made  C  calc_fluxes_Y :: logical to indicate to calculate fluxes in Y dir
95    C  nipass        :: number of passes in multi-dimensional method
96    C  ipass         :: number of the current pass being made
97        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
98        INTEGER iMin,iMax,jMin,jMax        INTEGER iMin,iMax,jMin,jMax
99        INTEGER i,j,k,kup,kDown        INTEGER i,j,k,kup,kDown

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.22