/[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.2 by adcroft, Mon Sep 10 13:09:04 2001 UTC revision 1.3 by adcroft, Mon Sep 17 19:48:04 2001 UTC
# Line 45  C     == Local variables Line 45  C     == Local variables
45        _RL localTij(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL localTij(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46        _RL localTijk(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL localTijk(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
47        _RL kp1Msk        _RL kp1Msk
48          LOGICAL calc_fluxes_X,calc_fluxes_Y
49          INTEGER nipass,ipass
50    
51  C--   Set up work arrays with valid (i.e. not NaN) values  C--   Set up work arrays with valid (i.e. not NaN) values
52  C     These inital values do not alter the numerical results. They  C     These inital values do not alter the numerical results. They
# Line 84  C--   Make local copy of tracer array Line 86  C--   Make local copy of tracer array
86         ENDDO         ENDDO
87        ENDDO        ENDDO
88    
89          IF (useCubedSphereExchange) THEN
90           nipass=3
91          ELSE
92           nipass=1
93          ENDIF
94           nipass=1
95    
96    C--   Multiple passes for different directions on different tiles
97          DO ipass=1,nipass
98    
99          IF (nipass.EQ.3) THEN
100           calc_fluxes_X=.FALSE.
101           calc_fluxes_Y=.FALSE.
102           IF (ipass.EQ.1 .AND. (bi.EQ.1 .OR. bi.EQ.2) ) THEN
103            calc_fluxes_X=.TRUE.
104           ELSEIF (ipass.EQ.1 .AND. (bi.EQ.4 .OR. bi.EQ.5) ) THEN
105            calc_fluxes_Y=.TRUE.
106           ELSEIF (ipass.EQ.2 .AND. (bi.EQ.1 .OR. bi.EQ.6) ) THEN
107            calc_fluxes_Y=.TRUE.
108           ELSEIF (ipass.EQ.2 .AND. (bi.EQ.3 .OR. bi.EQ.4) ) THEN
109            calc_fluxes_X=.TRUE.
110           ELSEIF (ipass.EQ.3 .AND. (bi.EQ.2 .OR. bi.EQ.3) ) THEN
111            calc_fluxes_Y=.TRUE.
112           ELSEIF (ipass.EQ.3 .AND. (bi.EQ.5 .OR. bi.EQ.6) ) THEN
113            calc_fluxes_X=.TRUE.
114           ENDIF
115          ELSE
116           calc_fluxes_X=.TRUE.
117           calc_fluxes_Y=.TRUE.
118          ENDIF
119    
120    C--   X direction
121          IF (calc_fluxes_X) THEN
122    
123    C--   Internal exchange for calculations in X
124          IF (useCubedSphereExchange) THEN
125           DO j=1,Oly
126            DO i=1,Olx
127             localTij( 1-i , 1-j )=localTij( 1-j ,    i    )
128             localTij( 1-i ,sNy+j)=localTij( 1-j , sNy+1-i )
129             localTij(sNx+i, 1-j )=localTij(sNx+j,    i    )
130             localTij(sNx+i,sNy+j)=localTij(sNx+j, sNy+1-i )
131            ENDDO
132           ENDDO
133          ENDIF
134    
135  C-    Advective flux in X  C-    Advective flux in X
136        DO j=1-Oly,sNy+Oly        DO j=1-Oly,sNy+Oly
137         DO i=1-Olx,sNx+Olx         DO i=1-Olx,sNx+Olx
# Line 124  C--   Apply open boundary conditions Line 172  C--   Apply open boundary conditions
172        END IF        END IF
173  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
174    
175    C--   End of X direction
176          ENDIF
177    
178    C--   Y direction
179          IF (calc_fluxes_Y) THEN
180    
181    C--   Internal exchange for calculations in Y
182          IF (useCubedSphereExchange) THEN
183           DO j=1,Oly
184            DO i=1,Olx
185             localTij( 1-i , 1-j )=localTij(   j   , 1-i )
186             localTij( 1-i ,sNy+j)=localTij(   j   ,sNy+i)
187             localTij(sNx+i, 1-j )=localTij(sNx+1-j, 1-i )
188             localTij(sNx+i,sNy+j)=localTij(sNx+1-j,sNy+i)
189            ENDDO
190           ENDDO
191          ENDIF
192    
193  C-    Advective flux in Y  C-    Advective flux in Y
194        DO j=1-Oly,sNy+Oly        DO j=1-Oly,sNy+Oly
195         DO i=1-Olx,sNx+Olx         DO i=1-Olx,sNx+Olx
# Line 152  C-    Advective flux in Y Line 218  C-    Advective flux in Y
218       &     )       &     )
219         ENDDO         ENDDO
220        ENDDO        ENDDO
221    
222  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
223  C--   Apply open boundary conditions  C--   Apply open boundary conditions
224        IF (useOBCS) THEN        IF (useOBCS) THEN
# Line 162  C--   Apply open boundary conditions Line 229  C--   Apply open boundary conditions
229         END IF         END IF
230        END IF        END IF
231  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
232        DO j=1-Oly,sNy+Oly-1  
233    C--   End of Y direction
234          ENDIF
235    
236          DO j=1-Oly,sNy+Oly
237         DO i=1-Olx,sNx+Olx         DO i=1-Olx,sNx+Olx
238          localTijk(i,j,k)=localTij(i,j)          localTijk(i,j,k)=localTij(i,j)
239         ENDDO         ENDDO
240        ENDDO        ENDDO
241    
242    C--   End of ipass loop
243          ENDDO
244    
245  C--   End of K loop for horizontal fluxes  C--   End of K loop for horizontal fluxes
246        ENDDO        ENDDO

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

  ViewVC Help
Powered by ViewVC 1.1.22