1 |
C $Header$ |
C $Header$ |
2 |
|
|
3 |
#include "CPP_OPTIONS.h" |
#include "MDSIO_OPTIONS.h" |
4 |
|
|
5 |
C The five "public" routines supplied here are: |
C The five "public" routines supplied here are: |
6 |
C |
C |
26 |
C |
C |
27 |
C To be modified to work with MITgcmuv message routines. |
C To be modified to work with MITgcmuv message routines. |
28 |
|
|
|
#undef SAFE_IO |
|
|
|
|
|
#ifdef SAFE_IO |
|
|
#define _NEW_STATUS 'new' |
|
|
#else |
|
|
#define _NEW_STATUS 'unknown' |
|
|
#endif |
|
|
|
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
|
|
#define _OLD_STATUS 'unknown' |
|
|
#else |
|
|
#define _OLD_STATUS 'old' |
|
|
#endif |
|
|
|
|
29 |
C======================================================================= |
C======================================================================= |
30 |
SUBROUTINE MDSREADFIELD_3D_GL( |
SUBROUTINE MDSREADFIELD_3D_GL( |
31 |
I fName, |
I fName, |
123 |
& ' MDSREADFIELD: opening global file: ',dataFName |
& ' MDSREADFIELD: opening global file: ',dataFName |
124 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
125 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
|
stop " xx, adxx, weights and masks are not supposed to be global" |
|
126 |
endif |
endif |
127 |
|
|
128 |
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) |
135 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
136 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
137 |
globalFile = .TRUE. |
globalFile = .TRUE. |
|
stop " xx, adxx, weights and masks are not supposed to be global" |
|
138 |
endif |
endif |
139 |
endif |
endif |
140 |
C Loop over all processors |
C Loop over all processors |
153 |
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" |
154 |
C (This is a place-holder for the active/passive mechanism |
C (This is a place-holder for the active/passive mechanism |
155 |
if (exst) then |
if (exst) then |
156 |
write(msgbuf,'(a,a)') |
if ( debugLevel .GE. debLevA ) then |
157 |
|
write(msgbuf,'(a,a)') |
158 |
& ' MDSREADFIELD_GL: opening file: ',dataFName |
& ' MDSREADFIELD_GL: opening file: ',dataFName |
159 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
160 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
161 |
|
endif |
162 |
length_of_rec=MDS_RECLEN( filePrec, sNx, mythid ) |
length_of_rec=MDS_RECLEN( filePrec, sNx, mythid ) |
163 |
open( dUnit, file=dataFName, status='old', |
open( dUnit, file=dataFName, status='old', |
164 |
& access='direct', recl=length_of_rec ) |
& access='direct', recl=length_of_rec ) |
169 |
& ' MDSREADFIELD_GL: filename: ',dataFName |
& ' MDSREADFIELD_GL: filename: ',dataFName |
170 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
171 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
172 |
|
call print_error( msgbuf, mythid ) |
173 |
write(msgbuf,'(a)') |
write(msgbuf,'(a)') |
174 |
& ' MDSREADFIELD_GL: File does not exist' |
& ' MDSREADFIELD_GL: File does not exist' |
175 |
|
call print_message( msgbuf, standardmessageunit, |
176 |
|
& SQUEEZE_RIGHT , mythid) |
177 |
call print_error( msgbuf, mythid ) |
call print_error( msgbuf, mythid ) |
178 |
stop 'ABNORMAL END: S/R MDSREADFIELD_GL' |
stop 'ABNORMAL END: S/R MDSREADFIELD_GL' |
179 |
endif |
endif |
570 |
& ' MDSREADFIELD: opening global file: ',dataFName |
& ' MDSREADFIELD: opening global file: ',dataFName |
571 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
572 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
|
stop " xx, adxx, weights and masks are not supposed to be global" |
|
573 |
endif |
endif |
574 |
|
|
575 |
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) |
582 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
583 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
584 |
globalFile = .TRUE. |
globalFile = .TRUE. |
|
stop " xx, adxx, weights and masks are not supposed to be global" |
|
585 |
endif |
endif |
586 |
endif |
endif |
587 |
C Loop over all processors |
C Loop over all processors |
600 |
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" |
601 |
C (This is a place-holder for the active/passive mechanism |
C (This is a place-holder for the active/passive mechanism |
602 |
if (exst) then |
if (exst) then |
603 |
write(msgbuf,'(a,a)') |
if ( debugLevel .GE. debLevA ) then |
604 |
|
write(msgbuf,'(a,a)') |
605 |
& ' MDSREADFIELD_GL: opening file: ',dataFName |
& ' MDSREADFIELD_GL: opening file: ',dataFName |
606 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
607 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
608 |
|
endif |
609 |
length_of_rec=MDS_RECLEN( filePrec, sNx, mythid ) |
length_of_rec=MDS_RECLEN( filePrec, sNx, mythid ) |
610 |
open( dUnit, file=dataFName, status='old', |
open( dUnit, file=dataFName, status='old', |
611 |
& access='direct', recl=length_of_rec ) |
& access='direct', recl=length_of_rec ) |
616 |
& ' MDSREADFIELD_GL: filename: ',dataFName |
& ' MDSREADFIELD_GL: filename: ',dataFName |
617 |
call print_message( msgbuf, standardmessageunit, |
call print_message( msgbuf, standardmessageunit, |
618 |
& SQUEEZE_RIGHT , mythid) |
& SQUEEZE_RIGHT , mythid) |
619 |
|
call print_error( msgbuf, mythid ) |
620 |
write(msgbuf,'(a)') |
write(msgbuf,'(a)') |
621 |
& ' MDSREADFIELD_GL: File does not exist' |
& ' MDSREADFIELD_GL: File does not exist' |
622 |
|
call print_message( msgbuf, standardmessageunit, |
623 |
|
& SQUEEZE_RIGHT , mythid) |
624 |
call print_error( msgbuf, mythid ) |
call print_error( msgbuf, mythid ) |
625 |
stop 'ABNORMAL END: S/R MDSREADFIELD_GL' |
stop 'ABNORMAL END: S/R MDSREADFIELD_GL' |
626 |
endif |
endif |