/[MITgcm]/MITgcm/pkg/exch2/w2_set_map_tiles.F
ViewVC logotype

Diff of /MITgcm/pkg/exch2/w2_set_map_tiles.F

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

revision 1.3 by jmc, Fri Apr 23 20:21:06 2010 UTC revision 1.4 by jahn, Wed Oct 13 20:56:01 2010 UTC
# Line 42  C     !LOCAL VARIABLES: Line 42  C     !LOCAL VARIABLES:
42  C     === Local variables ===  C     === Local variables ===
43  C     msgBuf     :: Informational/error message buffer  C     msgBuf     :: Informational/error message buffer
44        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
45        INTEGER tNx, tNy, fNx, fNy, nbPts, fBaseX        INTEGER tNx, tNy, fNx, fNy, nbPts, fBaseX, fBaseY
46        INTEGER nbTx, nbTy        INTEGER nbTx, nbTy
47        INTEGER j, ii, k, tId, tx, ty        INTEGER j, ii, k, tId, tx, ty
48        INTEGER divide, nnx(W2_maxNbFacets)        INTEGER divide, nnx(W2_maxNbFacets)
# Line 116  C     of all x-size (faster to apply GCD Line 116  C     of all x-size (faster to apply GCD
116        ENDIF        ENDIF
117    
118  C--   Global Map size:  C--   Global Map size:
119    C     facets stacked in x direction
120          exch2_xStack_Nx = 0
121          exch2_xStack_Ny = 0
122          DO j=1,nFacets
123            exch2_xStack_Nx =   exch2_xStack_Nx + facet_dims(2*j-1)
124            exch2_xStack_Ny = MAX( exch2_xStack_Ny, facet_dims(2*j) )
125          ENDDO
126    C     facets stacked in y direction
127          exch2_yStack_Nx = 0
128          exch2_yStack_Ny = 0
129          DO j=1,nFacets
130            exch2_yStack_Nx = MAX( exch2_yStack_Nx, facet_dims(2*j-1) )
131            exch2_yStack_Ny =   exch2_yStack_Ny + facet_dims(2*j)
132          ENDDO
133        IF ( W2_mapIO.EQ.-1 ) THEN        IF ( W2_mapIO.EQ.-1 ) THEN
134          exch2_global_Nx = 0          exch2_global_Nx = exch2_xStack_Nx
135          exch2_global_Ny = 0          exch2_global_Ny = exch2_xStack_Ny
         DO j=1,nFacets  
           exch2_global_Nx =   exch2_global_Nx + facet_dims(2*j-1)  
           exch2_global_Ny = MAX( exch2_global_Ny, facet_dims(2*j) )  
         ENDDO  
136        ELSEIF ( W2_mapIO.EQ.0 ) THEN        ELSEIF ( W2_mapIO.EQ.0 ) THEN
137          exch2_global_Nx = nbPts          exch2_global_Nx = nbPts
138          exch2_global_Ny = 1          exch2_global_Ny = 1
# Line 141  C--   Set tiles mapping within facet (su Line 151  C--   Set tiles mapping within facet (su
151        tId = 0        tId = 0
152        nbPts = 0        nbPts = 0
153        fBaseX = 0        fBaseX = 0
154          fBaseY = 0
155        DO j=1,nFacets        DO j=1,nFacets
156          fNx = facet_dims(2*j-1)          fNx = facet_dims(2*j-1)
157          fNy = facet_dims( 2*j )          fNy = facet_dims( 2*j )
# Line 165  C--   Tags blank tile by removing facet Line 176  C--   Tags blank tile by removing facet
176            exch2_tNy   ( tId ) = tNy            exch2_tNy   ( tId ) = tNy
177            exch2_tBasex( tId ) = (tx-1)*tNx            exch2_tBasex( tId ) = (tx-1)*tNx
178            exch2_tBasey( tId ) = (ty-1)*tNy            exch2_tBasey( tId ) = (ty-1)*tNy
179  C--   Global IO Mapping  C--   Global IO Mappings
180    C       these are for OBCS (vertical slices)
181              exch2_txXStackLo( tId ) = 1 + exch2_tBasex(tId) + fBaseX
182              exch2_tyXStackLo( tId ) = 1 + exch2_tBasey(tId)
183              exch2_txYStackLo( tId ) = 1 + exch2_tBasex(tId)
184              exch2_tyYStackLo( tId ) = 1 + exch2_tBasey(tId) + fBaseY
185    C       and these for global files (3d files/horizontal 2d files)
186            IF ( W2_mapIO.EQ.-1 ) THEN            IF ( W2_mapIO.EQ.-1 ) THEN
187  C-        Old format  C-        Old format
188              exch2_txGlobalo( tId ) = 1 + exch2_tBasex(tId) + fBaseX              exch2_txGlobalo( tId ) = 1 + exch2_tBasex(tId) + fBaseX
# Line 189  C         Compact format: piled in the Y Line 206  C         Compact format: piled in the Y
206           ENDDO           ENDDO
207          ENDDO          ENDDO
208          fBaseX = fBaseX + fNx          fBaseX = fBaseX + fNx
209            fBaseY = fBaseY + fNy
210          nbPts = nbPts + fNx*fNy          nbPts = nbPts + fNx*fNy
211        ENDDO        ENDDO
212    

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

  ViewVC Help
Powered by ViewVC 1.1.22