/[MITgcm]/MITgcm/pkg/mdsio/mdsio_write_section.F
ViewVC logotype

Diff of /MITgcm/pkg/mdsio/mdsio_write_section.F

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

revision 1.2 by jmc, Tue Mar 16 00:16:50 2010 UTC revision 1.3 by jahn, Wed Oct 13 20:56:40 2010 UTC
# Line 61  C Global variables / common blocks Line 61  C Global variables / common blocks
61  #include "SIZE.h"  #include "SIZE.h"
62  #include "EEPARAMS.h"  #include "EEPARAMS.h"
63  #include "PARAMS.h"  #include "PARAMS.h"
64    #ifdef ALLOW_EXCH2
65    #include "W2_EXCH2_SIZE.h"
66    #include "W2_EXCH2_TOPOLOGY.h"
67    #include "W2_EXCH2_PARAMS.h"
68    #endif /* ALLOW_EXCH2 */
69    
70  C !INPUT PARAMETERS:  C !INPUT PARAMETERS:
71        CHARACTER*(*) fName        CHARACTER*(*) fName
# Line 89  C !LOCAL VARIABLES: Line 94  C !LOCAL VARIABLES:
94        INTEGER length_of_rec        INTEGER length_of_rec
95        LOGICAL fileIsOpen        LOGICAL fileIsOpen
96        CHARACTER*(max_len_mbuf) msgBuf        CHARACTER*(max_len_mbuf) msgBuf
97    #ifdef ALLOW_EXCH2
98          INTEGER tGx,tNx,tN
99    #endif /* ALLOW_EXCH2 */
100    
101  C     ------------------------------------------------------------------  C     ------------------------------------------------------------------
102    
103  C Only do I/O if I am the master thread  C Only do I/O if I am the master thread
# Line 160  C If we are writing to a tiled MDS file Line 169  C If we are writing to a tiled MDS file
169           ENDIF           ENDIF
170          ENDIF          ENDIF
171          IF (fileIsOpen) THEN          IF (fileIsOpen) THEN
172    #ifdef ALLOW_EXCH2
173    C layout of global x-z section files is "xStack"
174             tN = W2_myTileList(bi,bj)
175             tGx = exch2_txXStackLo(tN)
176             tNx = exch2_tNx(tN)
177    #endif /* ALLOW_EXCH2 */
178           DO k=1,kSize           DO k=1,kSize
179             IF (globalFile) THEN             IF (globalFile) THEN
180    #ifdef ALLOW_EXCH2
181    C record length is sNx==tNx
182                irec = 1 + ( tGx-1
183         &                   + ( k-1 + (irecord-1)*kSize )*exch2_xStack_Nx
184         &                 )/tNx
185    #else /* ALLOW_EXCH2 */
186              iG = myXGlobalLo-1 + (bi-1)*sNx              iG = myXGlobalLo-1 + (bi-1)*sNx
187              jG = (myYGlobalLo-1)/sNy + (bj-1)              jG = (myYGlobalLo-1)/sNy + (bj-1)
188              irec=1 + INT(iG/sNx) + nSx*nPx*(k-1)              irec=1 + INT(iG/sNx) + nSx*nPx*(k-1)
189       &           + nSx*nPx*kSize*(irecord-1)       &           + nSx*nPx*kSize*(irecord-1)
190    #endif /* ALLOW_EXCH2 */
191             ELSE             ELSE
192              iG = 0              iG = 0
193              jG = 0              jG = 0
# Line 293  C Global variables / common blocks Line 315  C Global variables / common blocks
315  #include "SIZE.h"  #include "SIZE.h"
316  #include "EEPARAMS.h"  #include "EEPARAMS.h"
317  #include "PARAMS.h"  #include "PARAMS.h"
318    #ifdef ALLOW_EXCH2
319    #include "W2_EXCH2_SIZE.h"
320    #include "W2_EXCH2_TOPOLOGY.h"
321    #include "W2_EXCH2_PARAMS.h"
322    #endif /* ALLOW_EXCH2 */
323    
324  C !INPUT PARAMETERS:  C !INPUT PARAMETERS:
325        CHARACTER*(*) fName        CHARACTER*(*) fName
# Line 321  C !LOCAL VARIABLES: Line 348  C !LOCAL VARIABLES:
348        INTEGER length_of_rec        INTEGER length_of_rec
349        LOGICAL fileIsOpen        LOGICAL fileIsOpen
350        CHARACTER*(max_len_mbuf) msgBuf        CHARACTER*(max_len_mbuf) msgBuf
351    #ifdef ALLOW_EXCH2
352          INTEGER tGy,tNy,tN
353    #endif /* ALLOW_EXCH2 */
354  C     ------------------------------------------------------------------  C     ------------------------------------------------------------------
355    
356  C Only do I/O if I am the master thread  C Only do I/O if I am the master thread
# Line 392  C If we are writing to a tiled MDS file Line 422  C If we are writing to a tiled MDS file
422           ENDIF           ENDIF
423          ENDIF          ENDIF
424          IF (fileIsOpen) THEN          IF (fileIsOpen) THEN
425    #ifdef ALLOW_EXCH2
426    C layout of global y-z section files is "yStack"
427             tN = W2_myTileList(bi,bj)
428             tGy = exch2_tyYStackLo(tN)
429             tNy = exch2_tNy(tN)
430    #endif /* ALLOW_EXCH2 */
431           DO k=1,kSize           DO k=1,kSize
432             IF (globalFile) THEN             IF (globalFile) THEN
433    #ifdef ALLOW_EXCH2
434    C record length is sNy==tNy
435                irec = 1 + ( tGy-1
436         &                   + ( k-1 + (irecord-1)*kSize )*exch2_yStack_Ny
437         &                 )/tNy
438    #else /* ALLOW_EXCH2 */
439              iG = (myXGlobalLo-1)/sNx + (bi-1)              iG = (myXGlobalLo-1)/sNx + (bi-1)
440              jG = myYGlobalLo-1 + (bj-1)*sNy              jG = myYGlobalLo-1 + (bj-1)*sNy
441              irec=1 + INT(jG/sNy) + nSy*nPy*(k-1)              irec=1 + INT(jG/sNy) + nSy*nPy*(k-1)
442       &           + nSy*nPy*kSize*(irecord-1)       &           + nSy*nPy*kSize*(irecord-1)
443    #endif /* ALLOW_EXCH2 */
444             ELSE             ELSE
445              iG = 0              iG = 0
446              jG = 0              jG = 0

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

  ViewVC Help
Powered by ViewVC 1.1.22