/[MITgcm]/MITgcm/pkg/ptracers/ptracers_integrate.F
ViewVC logotype

Diff of /MITgcm/pkg/ptracers/ptracers_integrate.F

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

revision 1.20 by mlosch, Fri Nov 19 01:34:27 2004 UTC revision 1.25 by mlosch, Mon Oct 10 05:53:48 2005 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "PTRACERS_OPTIONS.h"  #include "PTRACERS_OPTIONS.h"
 cswdptr -- add ---  
 #ifdef ALLOW_GCHEM  
 # include "GCHEM_OPTIONS.h"  
 #endif  
 cswdptr -- end add ---  
5    
6  CBOP  CBOP
7  C !ROUTINE: PTRACERS_INTEGRATE  C !ROUTINE: PTRACERS_INTEGRATE
# Line 78  C  GAD_TR               :: passive trace Line 73  C  GAD_TR               :: passive trace
73        INTEGER kUp,kDown,km1        INTEGER kUp,kDown,km1
74        INTEGER GAD_TR        INTEGER GAD_TR
75        LOGICAL calcAdvection        LOGICAL calcAdvection
76          INTEGER iterNb
77  CEOP  CEOP
78    
79  C Loop over tracers  C Loop over tracers
# Line 111  C (advection, [explicit] diffusion, para Line 107  C (advection, [explicit] diffusion, para
107       I                   GAD_TR,       I                   GAD_TR,
108       I                   PTRACERS_advScheme(iTracer),       I                   PTRACERS_advScheme(iTracer),
109       I                   PTRACERS_advScheme(iTracer),       I                   PTRACERS_advScheme(iTracer),
110       I                   calcAdvection, .FALSE.,       I                   calcAdvection, PTRACERS_ImplVertAdv(iTracer),
111       U                   rFlx(1-Olx,1-Oly,1,iTracer),       U                   rFlx(1-Olx,1-Oly,1,iTracer),
112       U                   gPtr(1-Olx,1-Oly,1,1,1,iTracer),       U                   gPtr(1-Olx,1-Oly,1,1,1,iTracer),
113       I                   myTime, myIter, myThid )       I                   myTime, myIter, myThid )
114    
115  C External forcing term(s)  C External forcing term(s)
 cswdptr --add --  
 #ifdef ALLOW_GCHEM  
 #ifndef PTRACERS_SEPARATE_FORCING  
        IF ( forcing_In_AB .AND. useGCHEM )  
      &    CALL GCHEM_FORCING_INT(  
      I                        bi,bj,iMin,iMax,jMin,jMax,k,  
      I                        iTracer,  
      I                        myTime,myIter, myThid)  
 #endif  
 #else  
 cswdptr - end add ---  
116         IF ( forcing_In_AB )         IF ( forcing_In_AB )
117       &   CALL PTRACERS_FORCING(       &   CALL PTRACERS_FORCING(
118       I                      bi,bj,iMin,iMax,jMin,jMax,k,       I                      bi,bj,iMin,iMax,jMin,jMax,k,iTracer,
119       U                      gPtr(1-Olx,1-Oly,1,1,1,iTracer),       U                      gPtr(1-Olx,1-Oly,1,1,1,iTracer),
120       I                      surfaceForcingPtr(1-Olx,1-Oly,1,1,iTracer),       I                      surfaceForcingPtr(1-Olx,1-Oly,1,1,iTracer),
121       I                      myIter,myTime,myThid)       I                      myIter,myTime,myThid)
 cswdptr --add---  
 #endif  
 cswdptr -- end add ---  
122    
123  C If using Adams-Bashforth II, then extrapolate tendancies  C If using Adams-Bashforth II, then extrapolate tendancies
124    C gPtr is now the tracer tendency for explicit advection/diffusion
125        IF ( PTRACERS_advScheme(iTracer).EQ.ENUM_CENTERED_2ND        IF ( PTRACERS_advScheme(iTracer).EQ.ENUM_CENTERED_2ND
126       & .OR.PTRACERS_advScheme(iTracer).EQ.ENUM_UPWIND_3RD       & .OR.PTRACERS_advScheme(iTracer).EQ.ENUM_UPWIND_3RD
127       & .OR.PTRACERS_advScheme(iTracer).EQ.ENUM_CENTERED_4TH ) THEN       & .OR.PTRACERS_advScheme(iTracer).EQ.ENUM_CENTERED_4TH ) THEN
128    #ifdef ALLOW_MATRIX
129    C  If matrix is being computed, block call to S/R ADAMS_BASHFORTH2 to
130    C  prevent gPtr from being replaced by the average of gPtr and gPtrNm1.    
131            IF (.NOT.useMATRIX) THEN
132    #endif          
133            iterNb = myIter
134            IF (staggerTimeStep) iterNb = myIter - 1
135          CALL ADAMS_BASHFORTH2(          CALL ADAMS_BASHFORTH2(
136       I                        bi,bj,K,       I                        bi,bj,K,
137       U                        gPtr(1-Olx,1-Oly,1,1,1,iTracer),       U                        gPtr(1-Olx,1-Oly,1,1,1,iTracer),
138       U                        gPtrNm1(1-Olx,1-Oly,1,1,1,iTracer),       U                        gPtrNm1(1-Olx,1-Oly,1,1,1,iTracer),
139       I                        myIter,myThid )       I                        iterNb, myThid )
140    #ifdef ALLOW_MATRIX
141            ENDIF
142    #endif    
143        ENDIF        ENDIF
144    
145  C External forcing term(s)  C External forcing term(s)
 cswdptr - add--  
 #ifdef ALLOW_GCHEM  
 #ifndef PTRACERS_SEPARATE_FORCING  
        IF ( .NOT.forcing_In_AB .AND. useGCHEM )  
      &    CALL GCHEM_FORCING_INT(  
      I                        bi,bj,iMin,iMax,jMin,jMax,k,  
      I                        iTracer,  
      I                        myTime,myIter, myThid)  
 #endif  
 #else  
 cswdptr - end add ---  
146         IF ( .NOT.forcing_In_AB )         IF ( .NOT.forcing_In_AB )
147       &   CALL PTRACERS_FORCING(       &   CALL PTRACERS_FORCING(
148       I                      bi,bj,iMin,iMax,jMin,jMax,k,       I                      bi,bj,iMin,iMax,jMin,jMax,k,iTracer,
149       U                      gPtr(1-Olx,1-Oly,1,1,1,iTracer),       U                      gPtr(1-Olx,1-Oly,1,1,1,iTracer),
150       I                      surfaceForcingPtr(1-Olx,1-Oly,1,1,iTracer),       I                      surfaceForcingPtr(1-Olx,1-Oly,1,1,iTracer),
151       I                      myIter,myTime,myThid)       I                      myIter,myTime,myThid)
 cswdptr - add--  
 #endif  
 cswdptr -- end add ---  
152    
153  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
154  C Account for change in level thickness  C Account for change in level thickness
# Line 196  C Integrate forward in time, storing in Line 175  C Integrate forward in time, storing in
175       I                        gPtr(1-Olx,1-Oly,1,1,1,iTracer),       I                        gPtr(1-Olx,1-Oly,1,1,1,iTracer),
176       I                        myIter,myThid )       I                        myIter,myThid )
177    
178    #ifdef   ALLOW_OBCS
179    C Apply open boundary conditions
180             IF (useOBCS) THEN
181              CALL OBCS_APPLY_PTRACER(
182         I         bi, bj, k, iTracer,
183         U         gPtr(1-Olx,1-Oly,k,bi,bj,iTracer),
184         I         myThid )
185             END IF
186    #endif   /* ALLOW_OBCS */
187  C end of tracer loop  C end of tracer loop
188        ENDDO        ENDDO
189    

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.22