/[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.62 by jmc, Sun Jun 28 01:05:41 2009 UTC revision 1.63 by jmc, Sun Oct 31 15:20:48 2010 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "GAD_OPTIONS.h"  #include "GAD_OPTIONS.h"
5  #undef MULTIDIM_OLD_VERSION  #undef OBCS_MULTIDIM_OLD_VERSION
6    
7  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
8  CBOP  CBOP
# Line 300  C--   For cube need one pass for each of Line 300  C--   For cube need one pass for each of
300        interiorOnly = .FALSE.        interiorOnly = .FALSE.
301        overlapOnly  = .FALSE.        overlapOnly  = .FALSE.
302        IF (useCubedSphereExchange) THEN        IF (useCubedSphereExchange) THEN
 #ifdef MULTIDIM_OLD_VERSION  
 C-    CubedSphere : pass 3 times, with full update of local tracer field  
        IF (ipass.EQ.1) THEN  
         calc_fluxes_X = nCFace.EQ.1 .OR. nCFace.EQ.2  
         calc_fluxes_Y = nCFace.EQ.4 .OR. nCFace.EQ.5  
        ELSEIF (ipass.EQ.2) THEN  
         calc_fluxes_X = nCFace.EQ.3 .OR. nCFace.EQ.4  
         calc_fluxes_Y = nCFace.EQ.6 .OR. nCFace.EQ.1  
 #else /* MULTIDIM_OLD_VERSION */  
303  C-    CubedSphere : pass 3 times, with partial update of local tracer field  C-    CubedSphere : pass 3 times, with partial update of local tracer field
304         IF (ipass.EQ.1) THEN         IF (ipass.EQ.1) THEN
305          overlapOnly  = MOD(nCFace,3).EQ.0          overlapOnly  = MOD(nCFace,3).EQ.0
# Line 320  C-    CubedSphere : pass 3 times, with p Line 311  C-    CubedSphere : pass 3 times, with p
311          interiorOnly = MOD(nCFace,3).EQ.1          interiorOnly = MOD(nCFace,3).EQ.1
312          calc_fluxes_X = nCFace.EQ.2 .OR. nCFace.EQ.3 .OR. nCFace.EQ.4          calc_fluxes_X = nCFace.EQ.2 .OR. nCFace.EQ.3 .OR. nCFace.EQ.4
313          calc_fluxes_Y = nCFace.EQ.5 .OR. nCFace.EQ.6 .OR. nCFace.EQ.1          calc_fluxes_Y = nCFace.EQ.5 .OR. nCFace.EQ.6 .OR. nCFace.EQ.1
 #endif /* MULTIDIM_OLD_VERSION */  
314         ELSE         ELSE
315          interiorOnly = .TRUE.          interiorOnly = .TRUE.
316          calc_fluxes_X = nCFace.EQ.5 .OR. nCFace.EQ.6          calc_fluxes_X = nCFace.EQ.5 .OR. nCFace.EQ.6
# Line 358  C   and b) the overlap of myTile are not Line 348  C   and b) the overlap of myTile are not
348         IF ( .NOT.overlapOnly .OR. N_edge .OR. S_edge ) THEN         IF ( .NOT.overlapOnly .OR. N_edge .OR. S_edge ) THEN
349    
350  C-     Internal exchange for calculations in X  C-     Internal exchange for calculations in X
 #ifdef MULTIDIM_OLD_VERSION  
         IF ( useCubedSphereExchange ) THEN  
 #else  
351          IF ( overlapOnly ) THEN          IF ( overlapOnly ) THEN
 #endif  
352           CALL FILL_CS_CORNER_TR_RL( 1, .FALSE.,           CALL FILL_CS_CORNER_TR_RL( 1, .FALSE.,
353       &                              localTij, bi,bj, myThid )       &                              localTij, bi,bj, myThid )
354          ENDIF          ENDIF
# Line 411  C-     Advective flux in X : done Line 397  C-     Advective flux in X : done
397         ENDIF         ENDIF
398    
399  C-     Update the local tracer field where needed:  C-     Update the local tracer field where needed:
400    C      use "maksInC" to prevent updating tracer field in OB regions
401    
402  C      update in overlap-Only  C      update in overlap-Only
403         IF ( overlapOnly ) THEN         IF ( overlapOnly ) THEN
# Line 430  C         in corner region) but safer to Line 417  C         in corner region) but safer to
417       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
418       &       *( af(i+1,j)-af(i,j)       &       *( af(i+1,j)-af(i,j)
419       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))
420       &        )       &        )*maskInC(i,j,bi,bj)
421            ENDDO            ENDDO
422           ENDDO           ENDDO
423          ENDIF          ENDIF
# Line 443  C         in corner region) but safer to Line 430  C         in corner region) but safer to
430       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
431       &       *( af(i+1,j)-af(i,j)       &       *( af(i+1,j)-af(i,j)
432       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))
433       &        )       &        )*maskInC(i,j,bi,bj)
434            ENDDO            ENDDO
435           ENDDO           ENDDO
436          ENDIF          ENDIF
# Line 462  C      do not only update the overlap Line 449  C      do not only update the overlap
449       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
450       &       *( af(i+1,j)-af(i,j)       &       *( af(i+1,j)-af(i,j)
451       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(uTrans(i+1,j)-uTrans(i,j))
452       &        )       &        )*maskInC(i,j,bi,bj)
453           ENDDO           ENDDO
454          ENDDO          ENDDO
455  C-      keep advective flux (for diagnostics)  C-      keep advective flux (for diagnostics)
# Line 473  C-      keep advective flux (for diagnos Line 460  C-      keep advective flux (for diagnos
460          ENDDO          ENDDO
461    
462  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
463    #ifdef OBCS_MULTIDIM_OLD_VERSION
464  C-     Apply open boundary conditions  C-     Apply open boundary conditions
465          IF ( useOBCS ) THEN          IF ( useOBCS ) THEN
466           IF (tracerIdentity.EQ.GAD_TEMPERATURE) THEN           IF (tracerIdentity.EQ.GAD_TEMPERATURE) THEN
# Line 486  C-     Apply open boundary conditions Line 474  C-     Apply open boundary conditions
474  #endif /* ALLOW_PTRACERS */  #endif /* ALLOW_PTRACERS */
475           ENDIF           ENDIF
476          ENDIF          ENDIF
477    #endif /* OBCS_MULTIDIM_OLD_VERSION */
478  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
479    
480  C-     end if/else update overlap-Only  C-     end if/else update overlap-Only
# Line 521  C   and b) the overlap of myTile are not Line 510  C   and b) the overlap of myTile are not
510         IF ( .NOT.overlapOnly .OR. E_edge .OR. W_edge ) THEN         IF ( .NOT.overlapOnly .OR. E_edge .OR. W_edge ) THEN
511    
512  C-     Internal exchange for calculations in Y  C-     Internal exchange for calculations in Y
 #ifdef MULTIDIM_OLD_VERSION  
         IF ( useCubedSphereExchange ) THEN  
 #else  
513          IF ( overlapOnly ) THEN          IF ( overlapOnly ) THEN
 #endif  
514           CALL FILL_CS_CORNER_TR_RL( 2, .FALSE.,           CALL FILL_CS_CORNER_TR_RL( 2, .FALSE.,
515       &                              localTij, bi,bj, myThid )       &                              localTij, bi,bj, myThid )
516          ENDIF          ENDIF
# Line 581  C-     Advective flux in Y : done Line 566  C-     Advective flux in Y : done
566         ENDIF         ENDIF
567    
568  C-     Update the local tracer field where needed:  C-     Update the local tracer field where needed:
569    C      use "maksInC" to prevent updating tracer field in OB regions
570    
571  C      update in overlap-Only  C      update in overlap-Only
572         IF ( overlapOnly ) THEN         IF ( overlapOnly ) THEN
# Line 600  C         in corner region) but safer to Line 586  C         in corner region) but safer to
586       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
587       &       *( af(i,j+1)-af(i,j)       &       *( af(i,j+1)-af(i,j)
588       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))
589       &        )       &        )*maskInC(i,j,bi,bj)
590            ENDDO            ENDDO
591           ENDDO           ENDDO
592          ENDIF          ENDIF
# Line 613  C         in corner region) but safer to Line 599  C         in corner region) but safer to
599       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
600       &       *( af(i,j+1)-af(i,j)       &       *( af(i,j+1)-af(i,j)
601       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))
602       &        )       &        )*maskInC(i,j,bi,bj)
603            ENDDO            ENDDO
604           ENDDO           ENDDO
605          ENDIF          ENDIF
# Line 632  C      do not only update the overlap Line 618  C      do not only update the overlap
618       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)       &       *recip_rA(i,j,bi,bj)*recip_deepFac2C(k)
619       &       *( af(i,j+1)-af(i,j)       &       *( af(i,j+1)-af(i,j)
620       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))       &         -tracer(i,j,k,bi,bj)*(vTrans(i,j+1)-vTrans(i,j))
621       &        )       &        )*maskInC(i,j,bi,bj)
622           ENDDO           ENDDO
623          ENDDO          ENDDO
624  C-      keep advective flux (for diagnostics)  C-      keep advective flux (for diagnostics)
# Line 643  C-      keep advective flux (for diagnos Line 629  C-      keep advective flux (for diagnos
629          ENDDO          ENDDO
630    
631  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
632    #ifdef OBCS_MULTIDIM_OLD_VERSION
633  C-     Apply open boundary conditions  C-     Apply open boundary conditions
634          IF (useOBCS) THEN          IF (useOBCS) THEN
635           IF (tracerIdentity.EQ.GAD_TEMPERATURE) THEN           IF (tracerIdentity.EQ.GAD_TEMPERATURE) THEN
# Line 656  C-     Apply open boundary conditions Line 643  C-     Apply open boundary conditions
643  #endif /* ALLOW_PTRACERS */  #endif /* ALLOW_PTRACERS */
644           ENDIF           ENDIF
645          ENDIF          ENDIF
646    #endif /* OBCS_MULTIDIM_OLD_VERSION */
647  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
648    
649  C      end if/else update overlap-Only  C      end if/else update overlap-Only

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.22