55 |
integer ILNBLNK |
integer ILNBLNK |
56 |
integer MDS_RECLEN |
integer MDS_RECLEN |
57 |
C Local variables |
C Local variables |
58 |
character*(128) dataFName,pfName |
character*(MAX_LEN_FNAM) dataFName,pfName |
59 |
integer iG,jG,irec,dUnit,IL,pIL |
integer iG,jG,irec,dUnit,IL,pIL |
60 |
logical exst |
logical exst |
61 |
logical globalFile,fileIsOpen |
logical globalFile,fileIsOpen |
101 |
|
|
102 |
C Assign special directory |
C Assign special directory |
103 |
if ( mdsioLocalDir .NE. ' ' ) then |
if ( mdsioLocalDir .NE. ' ' ) then |
104 |
write(pFname(1:128),'(2a)') |
write(pFname,'(2a)') |
105 |
& mdsioLocalDir(1:pIL), fName(1:IL) |
& mdsioLocalDir(1:pIL), fName(1:IL) |
106 |
else |
else |
107 |
pFname= fName |
pFname= fName |
119 |
if (exst) then |
if (exst) then |
120 |
if ( debugLevel .GE. debLevB ) then |
if ( debugLevel .GE. debLevB ) then |
121 |
write(msgbuf,'(a,a)') |
write(msgbuf,'(a,a)') |
122 |
& ' MDSREADVECTOR: opening global file: ',dataFName |
& ' MDSREADVECTOR: opening global file: ',dataFName(1:IL) |
123 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
124 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
125 |
endif |
endif |
128 |
|
|
129 |
C If negative check for global file with MDS name (ie. fName.data) |
C If negative check for global file with MDS name (ie. fName.data) |
130 |
if (.NOT. globalFile) then |
if (.NOT. globalFile) then |
131 |
write(dataFname(1:128),'(2a)') fName(1:IL),'.data' |
write(dataFname,'(2a)') fName(1:IL),'.data' |
132 |
inquire( file=dataFname, exist=exst ) |
inquire( file=dataFname, exist=exst ) |
133 |
if (exst) then |
if (exst) then |
134 |
if ( debugLevel .GE. debLevB ) then |
if ( debugLevel .GE. debLevB ) then |
135 |
write(msgbuf,'(a,a)') |
write(msgbuf,'(a,a)') |
136 |
& ' MDSREADVECTOR: opening global file: ',dataFName |
& ' MDSREADVECTOR: opening global file: ',dataFName(1:IL+5) |
137 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
138 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
139 |
endif |
endif |
156 |
if (.NOT. globalFile) then |
if (.NOT. globalFile) then |
157 |
iG=bi+(myXGlobalLo-1)/sNx ! Kludge until unstructered tiles |
iG=bi+(myXGlobalLo-1)/sNx ! Kludge until unstructered tiles |
158 |
jG=bj+(myYGlobalLo-1)/sNy ! Kludge until unstructered tiles |
jG=bj+(myYGlobalLo-1)/sNy ! Kludge until unstructered tiles |
159 |
write(dataFname(1:128),'(2a,i3.3,a,i3.3,a)') |
write(dataFname,'(2a,i3.3,a,i3.3,a)') |
160 |
& pfName(1:pIL),'.',iG,'.',jG,'.data' |
& pfName(1:pIL),'.',iG,'.',jG,'.data' |
161 |
inquire( file=dataFname, exist=exst ) |
inquire( file=dataFname, exist=exst ) |
162 |
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" |
164 |
if (exst) then |
if (exst) then |
165 |
if ( debugLevel .GE. debLevB ) then |
if ( debugLevel .GE. debLevB ) then |
166 |
write(msgbuf,'(a,a)') |
write(msgbuf,'(a,a)') |
167 |
& ' MDSREADVECTOR: opening file: ',dataFName |
& ' MDSREADVECTOR: opening file: ',dataFName(1:pIL+13) |
168 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
169 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
170 |
endif |
endif |
174 |
fileIsOpen=.TRUE. |
fileIsOpen=.TRUE. |
175 |
else |
else |
176 |
fileIsOpen=.FALSE. |
fileIsOpen=.FALSE. |
177 |
write(msgbuf,'(3a)') |
write(msgbuf,'(4a)') |
178 |
& ' MDSREADVECTOR: opening file: ',dataFName,pfName |
& ' MDSREADVECTOR: opening file: ',fName(1:IL), |
179 |
|
& ' , ',dataFName(1:pIL+13) |
180 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
181 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
182 |
write(msgbuf,'(a)') |
write(msgbuf,'(a)') |
247 |
|
|
248 |
C If negative check for global file with MDS name (ie. fName.data) |
C If negative check for global file with MDS name (ie. fName.data) |
249 |
if (.NOT. globalFile) then |
if (.NOT. globalFile) then |
250 |
write(dataFname(1:128),'(2a)') fName(1:IL),'.data' |
write(dataFname,'(2a)') fName(1:IL),'.data' |
251 |
inquire( file=dataFname, exist=exst ) |
inquire( file=dataFname, exist=exst ) |
252 |
if (exst) globalFile = .TRUE. |
if (exst) globalFile = .TRUE. |
253 |
endif |
endif |
259 |
open( dUnit, file=dataFName, status='old', |
open( dUnit, file=dataFName, status='old', |
260 |
& access='direct', recl=length_of_rec ) |
& access='direct', recl=length_of_rec ) |
261 |
else |
else |
262 |
write(msgbuf,'(2a)') ' MDSREADFIELD: filename: ',dataFName |
write(msgbuf,'(2a)') |
263 |
|
& ' MDSREADFIELD: filename: ',dataFName(1:IL) |
264 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
265 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
266 |
call print_error( msgbuf, mythid ) |
call print_error( msgbuf, mythid ) |
351 |
|
|
352 |
integer narr |
integer narr |
353 |
_RL local(narr) |
_RL local(narr) |
354 |
integer i,j,k,l,bi,bj,nNz |
_RS arr(narr) |
355 |
_RS arr(narr) |
integer k,nNz |
356 |
integer mythid |
integer mythid |
357 |
|
|
358 |
|
integer L |
359 |
|
|
360 |
DO L=1,narr |
DO L=1,narr |
361 |
arr(L) = local(L) |
arr(L) = local(L) |
362 |
ENDDO |
ENDDO |
371 |
|
|
372 |
integer narr |
integer narr |
373 |
_RL local(narr) |
_RL local(narr) |
374 |
integer i,j,k,l,bi,bj,nNz |
_RS arr(narr) |
375 |
_RL arr(narr) |
integer k,nNz |
376 |
integer mythid |
integer mythid |
377 |
|
|
378 |
|
integer L |
379 |
|
|
380 |
DO L=1,narr |
DO L=1,narr |
381 |
arr(L) = local(L) |
arr(L) = local(L) |
382 |
ENDDO |
ENDDO |