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

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

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

revision 1.2 by jmc, Wed Jan 7 21:35:00 2004 UTC revision 1.5 by jmc, Fri Nov 12 17:31:16 2004 UTC
# Line 11  C     !INTERFACE: Line 11  C     !INTERFACE:
11       I      kappaRX, wVel, tracer,       I      kappaRX, wVel, tracer,
12       U      gTracer,       U      gTracer,
13       I      bi, bj, myTime, myIter, myThid )       I      bi, bj, myTime, myIter, myThid )
14  C     !DESCRIPTION: \bv  C     !DESCRIPTION:
15  C     *==========================================================*  C     Solve implicitly vertical advection and diffusion for one tracer.
 C     | S/R GAD_IMPLICIT_R  
 C     | o Solve implicitly vertical advection & diffusion  
 C     |   for one tracer  
 C     *==========================================================*  
 C     *==========================================================*  
 C     \ev  
16    
17  C     !USES:  C     !USES:
18        IMPLICIT NONE        IMPLICIT NONE
# Line 29  C     == Global data == Line 23  C     == Global data ==
23  #include "GRID.h"  #include "GRID.h"
24  #include "GAD.h"  #include "GAD.h"
25    
26  C     !INPUT/OUTPUT PARAMETERS:  C !INPUT/OUTPUT PARAMETERS:
27  C     == Routine Arguments ==  C == Routine Arguments ==
28    C implicitAdvection :: if True, treat vertical advection implicitly
29    C advectionScheme   :: advection scheme to use
30    C tracerIdentity    :: Identifier for the tracer
31    C kappaRX           :: 3-D array for vertical diffusion coefficient
32    C wVel              :: vertical component of the velcity field
33    C tracer            :: tracer field at current time step
34    C gTracer           :: future tracer field
35    C bi,bj             :: tile indices
36    C myTime            :: current time
37    C myIter            :: current iteration number
38    C myThid            :: thread number
39        LOGICAL implicitAdvection        LOGICAL implicitAdvection
40        INTEGER advectionScheme        INTEGER advectionScheme
41        INTEGER tracerIdentity        INTEGER tracerIdentity
# Line 42  C     == Routine Arguments == Line 47  C     == Routine Arguments ==
47        _RL myTime        _RL myTime
48        INTEGER myIter, myThid        INTEGER myIter, myThid
49    
50  C     !LOCAL VARIABLES:  C !LOCAL VARIABLES:
51  C     == Local variables ==  C == Local variables ==
52    C iMin,iMax,jMin,jMax  :: computational domain
53    C i,j,k  :: loop indices
54    C a5d    :: 2nd  lower diagonal of the pentadiagonal matrix
55    C b5d    :: 1rst lower diagonal of the pentadiagonal matrix
56    C c5d    :: main diagonal       of the pentadiagonal matrix
57    C d5d    :: 1rst upper diagonal of the pentadiagonal matrix
58    C e5d    :: 2nd  upper diagonal of the pentadiagonal matrix
59    C rTrans    :: vertical volume transport at inteface k
60    C rTransKp1 :: vertical volume transport at inteface k+1
61    C localTijk :: local copy of tracer (for Non-Lin Adv.Scheme)
62    C diagonalNumber :: number of non-zero diagonals in the matrix
63    C errCode   :: > 0 if singular matrix
64        INTEGER iMin,iMax,jMin,jMax        INTEGER iMin,iMax,jMin,jMax
65        INTEGER i,j,k        INTEGER i,j,k
66        INTEGER diagonalNumber, errCode        INTEGER diagonalNumber, errCode
# Line 55  C     == Local variables == Line 72  C     == Local variables ==
72        _RL rTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL rTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
73        _RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
74        _RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
       _RL limitDf  (1-Olx:sNx+Olx,1-Oly:sNy+Oly)  
       _RL rFlx  
75  CEOP  CEOP
76    
77        IF (Nr.LE.1) RETURN        IF (Nr.LE.1) RETURN
# Line 187  c          localTijk(i,j,k)     = gTrace Line 202  c          localTijk(i,j,k)     = gTrace
202            ENDDO            ENDDO
203          ENDDO          ENDDO
204    
205          IF (K.GE.2) THEN  #ifdef ALLOW_AIM
206    C- a hack to prevent Water-Vapor vert.transport into the stratospheric level Nr
207            IF ( K.GE.2 .AND.
208         &     (.NOT.useAIM .OR.tracerIdentity.NE.GAD_SALINITY .OR.K.LT.Nr)
209         &              ) THEN
210    #else
211            IF ( K.GE.2 ) THEN
212    #endif
213    
214           IF ( advectionScheme.EQ.ENUM_CENTERED_2ND ) THEN           IF ( advectionScheme.EQ.ENUM_CENTERED_2ND ) THEN
215            diagonalNumber = 3            diagonalNumber = 3

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

  ViewVC Help
Powered by ViewVC 1.1.22