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

Diff of /MITgcm/pkg/mdsio/mdsio_read_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 56  C Global variables / common blocks Line 56  C Global variables / common blocks
56  #include "SIZE.h"  #include "SIZE.h"
57  #include "EEPARAMS.h"  #include "EEPARAMS.h"
58  #include "PARAMS.h"  #include "PARAMS.h"
59    #ifdef ALLOW_EXCH2
60    #include "W2_EXCH2_SIZE.h"
61    #include "W2_EXCH2_TOPOLOGY.h"
62    #include "W2_EXCH2_PARAMS.h"
63    #endif /* ALLOW_EXCH2 */
64    
65  C !INPUT PARAMETERS:  C !INPUT PARAMETERS:
66        CHARACTER*(*) fName        CHARACTER*(*) fName
# Line 83  C !LOCAL VARIABLES: Line 88  C !LOCAL VARIABLES:
88        LOGICAL globalFile,fileIsOpen        LOGICAL globalFile,fileIsOpen
89        INTEGER length_of_rec        INTEGER length_of_rec
90        CHARACTER*(max_len_mbuf) msgBuf        CHARACTER*(max_len_mbuf) msgBuf
91    #ifdef ALLOW_EXCH2
92          INTEGER tGx,tNx,tN
93    #endif /* ALLOW_EXCH2 */
94  C     ------------------------------------------------------------------  C     ------------------------------------------------------------------
95    
96  C Only do I/O if I am the master thread  C Only do I/O if I am the master thread
# Line 190  C (This is a place-holder for the active Line 198  C (This is a place-holder for the active
198          ENDIF          ENDIF
199    
200          IF (fileIsOpen) THEN          IF (fileIsOpen) THEN
201    #ifdef ALLOW_EXCH2
202    C layout of global x-z section files is "xStack"
203             tN = W2_myTileList(bi,bj)
204             tGx = exch2_txXStackLo(tN)
205             tNx = exch2_tNx(tN)
206    #endif /* ALLOW_EXCH2 */
207           DO k=1,kSize           DO k=1,kSize
208             IF (globalFile) THEN             IF (globalFile) THEN
209    #ifdef ALLOW_EXCH2
210    C record length is sNx==tNx
211                irec = 1 + ( tGx-1
212         &                   + ( k-1 + (irecord-1)*kSize )*exch2_xStack_Nx
213         &                 )/tNx
214    #else /* ALLOW_EXCH2 */
215              iG = myXGlobalLo-1 + (bi-1)*sNx              iG = myXGlobalLo-1 + (bi-1)*sNx
216              jG = (myYGlobalLo-1)/sNy + (bj-1)              jG = (myYGlobalLo-1)/sNy + (bj-1)
217              irec=1 + INT(iG/sNx) + nSx*nPx*(k-1)              irec=1 + INT(iG/sNx) + nSx*nPx*(k-1)
218       &           + nSx*nPx*kSize*(irecord-1)       &           + nSx*nPx*kSize*(irecord-1)
219    #endif /* ALLOW_EXCH2 */
220             ELSE             ELSE
221              iG = 0              iG = 0
222              jG = 0              jG = 0
# Line 312  C Global variables / common blocks Line 333  C Global variables / common blocks
333  #include "SIZE.h"  #include "SIZE.h"
334  #include "EEPARAMS.h"  #include "EEPARAMS.h"
335  #include "PARAMS.h"  #include "PARAMS.h"
336    #ifdef ALLOW_EXCH2
337    #include "W2_EXCH2_SIZE.h"
338    #include "W2_EXCH2_TOPOLOGY.h"
339    #include "W2_EXCH2_PARAMS.h"
340    #endif /* ALLOW_EXCH2 */
341    
342  C !INPUT PARAMETERS:  C !INPUT PARAMETERS:
343        CHARACTER*(*) fName        CHARACTER*(*) fName
# Line 339  C !LOCAL VARIABLES: Line 365  C !LOCAL VARIABLES:
365        LOGICAL globalFile,fileIsOpen        LOGICAL globalFile,fileIsOpen
366        INTEGER length_of_rec        INTEGER length_of_rec
367        CHARACTER*(max_len_mbuf) msgBuf        CHARACTER*(max_len_mbuf) msgBuf
368    #ifdef ALLOW_EXCH2
369          INTEGER tGy,tNy,tN
370    #endif /* ALLOW_EXCH2 */
371    
372  C     ------------------------------------------------------------------  C     ------------------------------------------------------------------
373    
374  C Only do I/O if I am the master thread  C Only do I/O if I am the master thread
# Line 446  C (This is a place-holder for the active Line 476  C (This is a place-holder for the active
476          ENDIF          ENDIF
477    
478          IF (fileIsOpen) THEN          IF (fileIsOpen) THEN
479    #ifdef ALLOW_EXCH2
480    C layout of global y-z section files is "yStack"
481             tN = W2_myTileList(bi,bj)
482             tGy = exch2_tyYStackLo(tN)
483             tNy = exch2_tNy(tN)
484    #endif /* ALLOW_EXCH2 */
485           DO k=1,kSize           DO k=1,kSize
486             IF (globalFile) THEN             IF (globalFile) THEN
487    #ifdef ALLOW_EXCH2
488    C record length is sNy==tNy
489                irec = 1 + ( tGy-1
490         &                   + ( k-1 + (irecord-1)*kSize )*exch2_yStack_Ny
491         &                 )/tNy
492    #else /* ALLOW_EXCH2 */
493              iG = (myXGlobalLo-1)/sNx + (bi-1)              iG = (myXGlobalLo-1)/sNx + (bi-1)
494              jG = myYGlobalLo-1 + (bj-1)*sNy              jG = myYGlobalLo-1 + (bj-1)*sNy
495              irec=1 + INT(jG/sNy) + nSy*nPy*(k-1)              irec=1 + INT(jG/sNy) + nSy*nPy*(k-1)
496       &           + nSy*nPy*kSize*(irecord-1)       &           + nSy*nPy*kSize*(irecord-1)
497    #endif /* ALLOW_EXCH2 */
498             ELSE             ELSE
499              iG = 0              iG = 0
500              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