/[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.11 by jmc, Wed Mar 6 02:01:54 2002 UTC revision 1.15 by heimbach, Fri Jun 27 01:57:28 2003 UTC
# Line 128  C  ipass                :: number of the Line 128  C  ipass                :: number of the
128  CEOP  CEOP
129    
130  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
131              act0 = tracerIdentity - 1
132              max0 = maxpass
133            act1 = bi - myBxLo(myThid)            act1 = bi - myBxLo(myThid)
134            max1 = myBxHi(myThid) - myBxLo(myThid) + 1            max1 = myBxHi(myThid) - myBxLo(myThid) + 1
135            act2 = bj - myByLo(myThid)            act2 = bj - myByLo(myThid)
# Line 135  CEOP Line 137  CEOP
137            act3 = myThid - 1            act3 = myThid - 1
138            max3 = nTx*nTy            max3 = nTx*nTy
139            act4 = ikey_dynamics - 1            act4 = ikey_dynamics - 1
140            ikey = (act1 + 1) + act2*max1            igadkey = (act0 + 1)
141       &                      + act3*max1*max2       &                      + act1*max0
142       &                      + act4*max1*max2*max3       &                      + act2*max0*max1
143         &                      + act3*max0*max1*max2
144         &                      + act4*max0*max1*max2*max3
145              if (tracerIdentity.GT.maxpass) then
146                 print *, 'ph-pass gad_advection ', maxpass, tracerIdentity
147                 STOP 'maxpass seems smaller than tracerIdentity'
148              endif
149  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
150    
151  C--   Set up work arrays with valid (i.e. not NaN) values  C--   Set up work arrays with valid (i.e. not NaN) values
# Line 166  C     uninitialised but inert locations. Line 174  C     uninitialised but inert locations.
174  C--   Start of k loop for horizontal fluxes  C--   Start of k loop for horizontal fluxes
175        DO k=1,Nr        DO k=1,Nr
176  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
177           kkey = (ikey-1)*Nr + k           kkey = (igadkey-1)*Nr + k
178  CADJ STORE tracer(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte  CADJ STORE tracer(:,:,k,bi,bj) =
179    CADJ &     comlev1_bibj_k_gad, key=kkey, byte=isbyte
180  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
181    
182  C--   Get temporary terms used by tendency routines  C--   Get temporary terms used by tendency routines
# Line 192  C--   Make local copy of tracer array Line 201  C--   Make local copy of tracer array
201    
202        IF (useCubedSphereExchange) THEN        IF (useCubedSphereExchange) THEN
203         nipass=3         nipass=3
204    #ifdef ALLOW_AUTODIFF_TAMC
205           if ( nipass.GT.maxcube )
206         &      STOP 'maxcube needs to be = 3'
207    #endif
208        ELSE        ELSE
209         nipass=1         nipass=1
210        ENDIF        ENDIF
# Line 200  cph       nipass=1 Line 213  cph       nipass=1
213  C--   Multiple passes for different directions on different tiles  C--   Multiple passes for different directions on different tiles
214        DO ipass=1,nipass        DO ipass=1,nipass
215  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
216           passkey = ipass + (k-1)   *maxpass           passkey = ipass + (k-1)      *maxcube
217       &                   + (ikey-1)*maxpass*Nr       &                   + (igadkey-1)*maxcube*Nr
218           IF (nipass .GT. maxpass) THEN           IF (nipass .GT. maxpass) THEN
219            STOP 'GAD_ADVECTION: nipass > maxpass. check tamc.h'            STOP 'GAD_ADVECTION: nipass > maxcube. check tamc.h'
220           ENDIF           ENDIF
221  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
222    
# Line 252  C-    Advective flux in X Line 265  C-    Advective flux in X
265    
266  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
267  #ifndef DISABLE_MULTIDIM_ADVECTION  #ifndef DISABLE_MULTIDIM_ADVECTION
268  CADJ STORE localTij(:,:)  = comlev1_bibj_pass, key=passkey, byte=isbyte  CADJ STORE localTij(:,:)  =
269    CADJ &     comlev1_bibj_k_gad_pass, key=passkey, byte=isbyte
270  #endif  #endif
271  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
272    
# Line 266  CADJ STORE localTij(:,:)  = comlev1_bibj Line 280  CADJ STORE localTij(:,:)  = comlev1_bibj
280         CALL GAD_DST3FL_ADV_X(         CALL GAD_DST3FL_ADV_X(
281       &       bi,bj,k,deltaTtracer,uTrans,uVel,localTij,af,myThid)       &       bi,bj,k,deltaTtracer,uTrans,uVel,localTij,af,myThid)
282        ELSE        ELSE
        write(0,*) advectionScheme  
283         STOP 'GAD_ADVECTION: adv. scheme incompatibale with multi-dim'         STOP 'GAD_ADVECTION: adv. scheme incompatibale with multi-dim'
284        ENDIF        ENDIF
285    
# Line 319  C-    Advective flux in Y Line 332  C-    Advective flux in Y
332    
333  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
334  #ifndef DISABLE_MULTIDIM_ADVECTION  #ifndef DISABLE_MULTIDIM_ADVECTION
335  CADJ STORE localTij(:,:)  = comlev1_bibj_pass, key=passkey, byte=isbyte  CADJ STORE localTij(:,:)  =
336    CADJ &     comlev1_bibj_k_gad_pass, key=passkey, byte=isbyte
337  #endif  #endif
338  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
339    
# Line 389  c     kp1=min(Nr,k+1) Line 403  c     kp1=min(Nr,k+1)
403    
404  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
405  CADJ STORE localTijk(:,:,k)    CADJ STORE localTijk(:,:,k)  
406  CADJ &     = comlev1_bibj_k, key=kkey, byte=isbyte  CADJ &     = comlev1_bibj_k_gad, key=kkey, byte=isbyte
407    CADJ STORE rTrans(:,:)  
408    CADJ &     = comlev1_bibj_k_gad, key=kkey, byte=isbyte
409  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
410    
411  C-- Compute Vertical transport  C-- Compute Vertical transport

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

  ViewVC Help
Powered by ViewVC 1.1.22