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

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

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

revision 1.2 by gforget, Fri Sep 24 23:21:03 2010 UTC revision 1.3 by jmc, Thu Sep 30 01:02:22 2010 UTC
# Line 21  C     !DESCRIPTION: \bv Line 21  C     !DESCRIPTION: \bv
21  c     ==================================================================  c     ==================================================================
22  c     SUBROUTINE mds_read_whalos  c     SUBROUTINE mds_read_whalos
23  c     ==================================================================  c     ==================================================================
24  c     o Read file that includes halos. The main purpose is for  c     o Read file that includes halos. The main purpose is for
25  c       adjoint related "tape I/O". The secondary purpose is debugging.  c       adjoint related "tape I/O". The secondary purpose is debugging.
26  c     ==================================================================  c     ==================================================================
27  c     SUBROUTINE mds_read_whalos  c     SUBROUTINE mds_read_whalos
# Line 56  c     mythid    -  number of the thread Line 56  c     mythid    -  number of the thread
56        integer fid        integer fid
57        integer filePrec        integer filePrec
58        integer n2d        integer n2d
       integer length  
59        integer irec        integer irec
60        _RL     fldRL(1-Olx:sNx+Olx,1-Oly:sNy+Oly,n2d,nSx,nSy)        _RL     fldRL(1-Olx:sNx+Olx,1-Oly:sNy+Oly,n2d,nSx,nSy)
61  CEOP  CEOP
# Line 77  C     gloNyWh :: global sum of sNyWh Line 76  C     gloNyWh :: global sum of sNyWh
76        PARAMETER ( sNyWh = sNy+2*Oly )        PARAMETER ( sNyWh = sNy+2*Oly )
77        PARAMETER ( procNyWh = sNyWh*nSy*nSx )        PARAMETER ( procNyWh = sNyWh*nSy*nSx )
78        PARAMETER ( gloNyWh = procNyWh*nPy*nPx )        PARAMETER ( gloNyWh = procNyWh*nPy*nPx )
79          
80        character*(MAX_LEN_FNAM) pfName        character*(MAX_LEN_FNAM) pfName
81        character*(MAX_LEN_MBUF) msgBuf        character*(MAX_LEN_MBUF) msgBuf
82        integer IL,pIL        integer IL,pIL
83        integer bx,by        integer bx,by
84          
85        integer length2d, length3d, length_of_rec        integer length2d, length3d, length_of_rec
86        integer i2d, i3d        integer i2d, i3d
87        integer i,j,k,bi,bj,ii        integer i,j,k,bi,bj,ii
# Line 101  c     == functions == Line 100  c     == functions ==
100    
101  c     == end of interface ==  c     == end of interface ==
102    
103        length2d=sNxWh*procNyWh        length2d=sNxWh*procNyWh
104        length3d=length2d*nr        length3d=length2d*nr
105    
106  C Only do I/O if I am the master thread (and mpi process 0 IF useSingleCpuIO):  C Only do I/O if I am the master thread (and mpi process 0 IF useSingleCpuIO):
# Line 140  c get the unit and open file Line 139  c get the unit and open file
139              ELSE              ELSE
140                READ(dUnit,rec=irec2d) fld2d_procbuff_r8                READ(dUnit,rec=irec2d) fld2d_procbuff_r8
141              ENDIF              ENDIF
142            ELSE                      ELSE
143              IF (filePrec .EQ. precFloat32) THEN              IF (filePrec .EQ. precFloat32) THEN
144                READ(dUnit,rec=irec2d) fld2d_globuff_r4                READ(dUnit,rec=irec2d) fld2d_globuff_r4
145              ELSE              ELSE
146                READ(dUnit,rec=irec2d) fld2d_globuff_r8                READ(dUnit,rec=irec2d) fld2d_globuff_r8
147              ENDIF                        ENDIF
148            ENDIF                      ENDIF
149          ENDIF          ENDIF
150          _BARRIER          _BARRIER
151    
152          IF (filePrec .EQ. precFloat32) THEN          IF (filePrec .EQ. precFloat32) THEN
153            IF ( useSingleCpuIO ) then            IF ( useSingleCpuIO ) then
154              CALL SCATTER_2D_WH_R4 ( fld2d_globuff_r4,              CALL SCATTER_2D_WH_R4 ( fld2d_globuff_r4,
155       &                              fld2d_procbuff_r4,myThid)       &                              fld2d_procbuff_r4,myThid)
156              CALL BAR2( myThid )              CALL BAR2( myThid )
157            ENDIF            ENDIF
# Line 160  c get the unit and open file Line 159  c get the unit and open file
159       &                    1, i2d, n2d, 0, 0, .TRUE., myThid )       &                    1, i2d, n2d, 0, 0, .TRUE., myThid )
160          ELSE          ELSE
161            IF ( useSingleCpuIO ) then            IF ( useSingleCpuIO ) then
162              CALL SCATTER_2D_WH_R8 ( fld2d_globuff_r8,              CALL SCATTER_2D_WH_R8 ( fld2d_globuff_r8,
163       &                              fld2d_procbuff_r8,myThid)       &                              fld2d_procbuff_r8,myThid)
164              CALL BAR2( myThid )              CALL BAR2( myThid )
165            ENDIF            ENDIF
# Line 169  c get the unit and open file Line 168  c get the unit and open file
168          ENDIF          ENDIF
169    
170        enddo        enddo
171          
172         IF ( iAmDoingIO ) THEN         IF ( iAmDoingIO ) THEN
173           CLOSE( dUnit )           CLOSE( dUnit )
174         ENDIF         ENDIF

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

  ViewVC Help
Powered by ViewVC 1.1.22