/[MITgcm]/MITgcm/model/src/timestep_tracer.F
ViewVC logotype

Diff of /MITgcm/model/src/timestep_tracer.F

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

revision 1.6 by adcroft, Tue Sep 4 14:53:10 2001 UTC revision 1.17 by mlosch, Tue Dec 13 15:12:53 2011 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7    CBOP
8    C     !ROUTINE: TIMESTEP_TRACER
9    C     !INTERFACE:
10        SUBROUTINE TIMESTEP_TRACER(        SUBROUTINE TIMESTEP_TRACER(
11       I                     bi, bj, iMin, iMax, jMin, jMax, K,       I                     bi, bj, k, deltaTloc,
12       I                     advection_scheme,       I                     tracer,
13       I                     tracer, gTracer,       U                     gTracer,
      O                     gTrNm1,  
14       I                     myIter, myThid )       I                     myIter, myThid )
15  C     /==========================================================\  C     !DESCRIPTION: \bv
16  C     | S/R TIMESTEP_TRACER                                      |  C     *==========================================================*
17  C     | o Step model tracer field forward in time                |  C     | S/R TIMESTEP_TRACER
18  C     \==========================================================/  C     | o Step model tracer field forward in time
19        IMPLICIT NONE  C     *==========================================================*
20    C     \ev
21    
22    C     !USES:
23          IMPLICIT NONE
24  C     == Global variables ===  C     == Global variables ===
25  #include "SIZE.h"  #include "SIZE.h"
26  #include "EEPARAMS.h"  #include "EEPARAMS.h"
27  #include "PARAMS.h"  #include "PARAMS.h"
 #include "GAD.h"  
28  #include "GRID.h"  #include "GRID.h"
 #include "SURFACE.h"  
29    
30    C     !INPUT/OUTPUT PARAMETERS:
31  C     == Routine Arguments ==  C     == Routine Arguments ==
32        INTEGER bi,bj,iMin,iMax,jMin,jMax,K        INTEGER bi, bj, k
33        INTEGER advection_scheme        _RL     deltaTloc
34        _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)
35        _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)
       _RL  gTrNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)  
36        INTEGER myIter, myThid        INTEGER myIter, myThid
37    
38    C     !LOCAL VARIABLES:
39  C     == Local variables ==  C     == Local variables ==
40        INTEGER i,j        INTEGER i,j
41        _RL ab15,ab05  CEOP
       _RL gTrtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
   
 C     Adams-Bashforth timestepping weights  
       IF (myIter .EQ. 0) THEN  
        ab15=1.0  
        ab05=0.0  
       ELSE  
        ab15=1.5+abEps  
        ab05=-(0.5+abEps)  
       ENDIF  
42    
43  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
 C     Compute effective G-term:  
       IF ( advection_scheme.EQ.ENUM_CENTERED_2ND  
      & .OR.advection_scheme.EQ.ENUM_UPWIND_3RD  
      & .OR.advection_scheme.EQ.ENUM_CENTERED_4TH ) THEN  
   
 C-    with Adams-Bashforth weights:  
        DO j=jMin,jMax  
         DO i=iMin,iMax  
          gTrtmp(i,j) = ab15*gTracer(i,j,k,bi,bj)  
      &               + ab05*gTrNm1(i,j,k,bi,bj)  
         ENDDO  
        ENDDO  
   
       ELSEIF (advection_scheme.EQ.ENUM_FLUX_LIMIT  
      &    .OR.advection_scheme.EQ.ENUM_DST3  
      &    .OR.advection_scheme.EQ.ENUM_DST3_FLUX_LIMIT ) THEN  
   
 C-    with no Adams-Bashforth weights:  
        DO j=jMin,jMax  
         DO i=iMin,iMax  
          gTrtmp(i,j) = gTracer(i,j,k,bi,bj)  
         ENDDO  
        ENDDO  
   
       ELSE  
        STOP 'TIMESTEP_TRACER: Bad advection_scheme'  
       ENDIF  
   
 #ifdef NONLIN_FRSURF  
       IF (nonlinFreeSurf.GT.0) THEN  
        DO j=jMin,jMax  
         DO i=iMin,iMax  
          IF (k.EQ.ksurfC(i,j,bi,bj)) THEN  
           gTrtmp(i,j) = gTrtmp(i,j)  
      &          *hFacC(i,j,k,bi,bj)/hFac_surfC(i,j,bi,bj)  
          ENDIF  
         ENDDO  
        ENDDO  
       ENDIF  
 #endif /* NONLIN_FRSURF */  
44    
45  C-    Step forward tracer  C-    Step tracer forward in time and store provisional value in gTracer array
46        DO j=jMin,jMax        DO j=1-Oly,sNy+Oly
47         DO i=iMin,iMax         DO i=1-Olx,sNx+Olx
48           gTrNm1(i,j,k,bi,bj)=tracer(i,j,k,bi,bj)           gTracer(i,j,k,bi,bj)=tracer(i,j,k,bi,bj)
49       &            +deltaTtracer*gTrtmp(i,j)       &            +deltaTloc*gTracer(i,j,k,bi,bj)
50    #ifdef ALLOW_OBCS
51    CML   For the Stevens open boundary conditions, we need to step forward
52    CML   the tracer even on the boundary in order to include surface
53    CML   forcing and (vertical) diffusion contributions. For other cases
54    CML   this mask was meant to avoid unrealistic values on the open boundaries.
55    CML   Lets hope that we can live without this safety net.
56    C    &                      *maskInC(i,j,bi,bj)
57    #endif
58         ENDDO         ENDDO
59        ENDDO        ENDDO
60    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22