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

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

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

revision 1.2 by heimbach, Fri Mar 7 04:30:08 2003 UTC revision 1.3 by heimbach, Tue Jul 8 15:00:27 2003 UTC
# Line 54  C Functions Line 54  C Functions
54        integer ILNBLNK        integer ILNBLNK
55        integer MDS_RECLEN        integer MDS_RECLEN
56  C Local variables  C Local variables
57        character*(80) dataFName        character*(80) dataFName,pfName
58        integer iG,jG,irec,dUnit,IL        integer iG,jG,irec,dUnit,IL,pIL
59        logical exst        logical exst
60        logical globalFile,fileIsOpen        logical globalFile,fileIsOpen
61        integer length_of_rec        integer length_of_rec
# Line 80  C Record number must be >= 1 Line 80  C Record number must be >= 1
80  C Assume nothing  C Assume nothing
81        globalFile = .FALSE.        globalFile = .FALSE.
82        fileIsOpen = .FALSE.        fileIsOpen = .FALSE.
83        IL=ILNBLNK( fName )        IL  = ILNBLNK( fName )
84          pIL = ILNBLNK( mdsioLocalDir )
85    
86    C Assign special directory
87          if ( mdsioLocalDir .NE. ' ' ) then
88           write(pFname(1:80),'(2a)') mdsioLocalDir(1:pIL), fName(1:IL)
89          else
90           pFname= fName
91          endif
92          pIL=ILNBLNK( pfName )
93    
94  C Assign a free unit number as the I/O channel for this routine  C Assign a free unit number as the I/O channel for this routine
95        call MDSFINDUNIT( dUnit, mythid )        call MDSFINDUNIT( dUnit, mythid )
# Line 89  C Check first for global file with simpl Line 98  C Check first for global file with simpl
98        dataFName = fName        dataFName = fName
99        inquire( file=dataFname, exist=exst )        inquire( file=dataFname, exist=exst )
100        if (exst) then        if (exst) then
101         write(msgbuf,'(a,a)')         if ( debugLevel .GE. debLevA ) then
102            write(msgbuf,'(a,a)')
103       &   ' MDSREADVECTOR: opening global file: ',dataFName       &   ' MDSREADVECTOR: opening global file: ',dataFName
104         call print_message( msgbuf, standardmessageunit,          call print_message( msgbuf, standardmessageunit,
105       &                     SQUEEZE_RIGHT , mythid)       &                     SQUEEZE_RIGHT , mythid)
106           endif
107         globalFile = .TRUE.         globalFile = .TRUE.
108        endif        endif
109    
# Line 101  C If negative check for global file with Line 112  C If negative check for global file with
112         write(dataFname(1:80),'(2a)') fName(1:IL),'.data'         write(dataFname(1:80),'(2a)') fName(1:IL),'.data'
113         inquire( file=dataFname, exist=exst )         inquire( file=dataFname, exist=exst )
114         if (exst) then         if (exst) then
115            if ( debugLevel .GE. debLevA ) then
116           write(msgbuf,'(a,a)')           write(msgbuf,'(a,a)')
117       &     ' MDSREADVECTOR: opening global file: ',dataFName       &     ' MDSREADVECTOR: opening global file: ',dataFName
118           call print_message( msgbuf, standardmessageunit,           call print_message( msgbuf, standardmessageunit,
119       &                       SQUEEZE_RIGHT , mythid)       &                       SQUEEZE_RIGHT , mythid)
120            endif
121          globalFile = .TRUE.          globalFile = .TRUE.
122         endif         endif
123        endif        endif
# Line 125  C If we are reading from a tiled MDS fil Line 138  C If we are reading from a tiled MDS fil
138           iG=bi+(myXGlobalLo-1)/sNx ! Kludge until unstructered tiles           iG=bi+(myXGlobalLo-1)/sNx ! Kludge until unstructered tiles
139           jG=bj+(myYGlobalLo-1)/sNy ! Kludge until unstructered tiles           jG=bj+(myYGlobalLo-1)/sNy ! Kludge until unstructered tiles
140           write(dataFname(1:80),'(2a,i3.3,a,i3.3,a)')           write(dataFname(1:80),'(2a,i3.3,a,i3.3,a)')
141       &              fName(1:IL),'.',iG,'.',jG,'.data'       &              pfName(1:pIL),'.',iG,'.',jG,'.data'
142           inquire( file=dataFname, exist=exst )           inquire( file=dataFname, exist=exst )
143  C Of course, we only open the file if the tile is "active"  C Of course, we only open the file if the tile is "active"
144  C (This is a place-holder for the active/passive mechanism)  C (This is a place-holder for the active/passive mechanism)
145           if (exst) then           if (exst) then
146            write(msgbuf,'(a,a)')            if ( debugLevel .GE. debLevA ) then
147               write(msgbuf,'(a,a)')
148       &      ' MDSREADVECTOR: opening file: ',dataFName       &      ' MDSREADVECTOR: opening file: ',dataFName
149            call print_message( msgbuf, standardmessageunit,             call print_message( msgbuf, standardmessageunit,
150       &                        SQUEEZE_RIGHT , mythid)       &                        SQUEEZE_RIGHT , mythid)
151              endif
152            length_of_rec=MDS_RECLEN( filePrec, narr, mythid )            length_of_rec=MDS_RECLEN( filePrec, narr, mythid )
153            open( dUnit, file=dataFName, status='old',            open( dUnit, file=dataFName, status='old',
154       &        access='direct', recl=length_of_rec )       &        access='direct', recl=length_of_rec )
155            fileIsOpen=.TRUE.            fileIsOpen=.TRUE.
156           else           else
157            fileIsOpen=.FALSE.            fileIsOpen=.FALSE.
158            write(msgbuf,'(a,a)')            write(msgbuf,'(3a)')
159       &      ' MDSREADVECTOR: opening file: ',dataFName       &      ' MDSREADVECTOR: opening file: ',dataFName,pfName
160            call print_message( msgbuf, standardmessageunit,            call print_message( msgbuf, standardmessageunit,
161       &                        SQUEEZE_RIGHT , mythid)       &                        SQUEEZE_RIGHT , mythid)
162            write(msgbuf,'(a)')            write(msgbuf,'(a)')

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

  ViewVC Help
Powered by ViewVC 1.1.22