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

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

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

revision 1.14 by jmc, Wed Aug 5 23:17:54 2009 UTC revision 1.15 by jmc, Tue Sep 1 19:08:27 2009 UTC
# Line 12  C !INTERFACE: Line 12  C !INTERFACE:
12       I   useCurrentDir,       I   useCurrentDir,
13       I   arrType,       I   arrType,
14       I   kSize,kLo,kHi,       I   kSize,kLo,kHi,
15       O   arr,       O   fldRL, fldRS,
16       I   irecord,       I   irecord,
17       I   myThid )       I   myThid )
18    
# Line 23  C fName     (string)  :: base name for f Line 23  C fName     (string)  :: base name for f
23  C filePrec  (integer) :: number of bits per word in file (32 or 64)  C filePrec  (integer) :: number of bits per word in file (32 or 64)
24  C useCurrentDir(logic):: always read from the current directory (even if  C useCurrentDir(logic):: always read from the current directory (even if
25  C                        "mdsioLocalDir" is set)  C                        "mdsioLocalDir" is set)
26  C arrType   (char(2)) :: declaration of "arr": either "RS" or "RL"  C arrType   (char(2)) :: which array (fldRL/RS) to read into, either "RL" or "RS"
27  C kSize     (integer) :: size of third dimension: normally either 1 or Nr  C kSize     (integer) :: size of third dimension: normally either 1 or Nr
28  C kLo       (integer) :: 1rst vertical level (of array "arr") to read-in  C kLo       (integer) :: 1rst vertical level (of array fldRL/RS) to read-in
29  C kHi       (integer) :: last vertical level (of array "arr") to read-in  C kHi       (integer) :: last vertical level (of array fldRL/RS) to read-in
30  C arr       ( RS/RL ) :: array to read into, arr(:,:,kSize,:,:)  C fldRL       ( RL )  :: array to read into if arrType="RL", fldRL(:,:,kSize,:,:)
31    C fldRS       ( RS )  :: array to read into if arrType="RS", fldRS(:,:,kSize,:,:)
32  C irecord   (integer) :: record number to read  C irecord   (integer) :: record number to read
33  C myIter    (integer) :: time step number  C myIter    (integer) :: time step number
34  C myThid    (integer) :: thread identifier  C myThid    (integer) :: thread identifier
# Line 37  C  IF the file "fName.data" exists and f Line 38  C  IF the file "fName.data" exists and f
38  C  form "fName.xxx.yyy.data" exist. Currently, the meta-files are not  C  form "fName.xxx.yyy.data" exist. Currently, the meta-files are not
39  C  read because it is difficult to parse files in fortran.  C  read because it is difficult to parse files in fortran.
40  C The precision of the file is decsribed by filePrec, set either  C The precision of the file is decsribed by filePrec, set either
41  C  to floatPrec32 or floatPrec64. The precision or declaration of  C  to floatPrec32 or floatPrec64. The char*(2) string arrType, either "RL"
42  C  the array argument must be consistently described by the char*(2)  C  or "RS", selects which array is filled in, either fldRL or fldRS.
 C  string arrType, either "RS" or "RL".  
43  C (kSize,kLo,kHi) allows for both 2-D and 3-D arrays to be handled, with  C (kSize,kLo,kHi) allows for both 2-D and 3-D arrays to be handled, with
44  C  the option to only read and fill-in a sub-set of consecutive vertical  C  the option to only read and fill-in a sub-set of consecutive vertical
45  C  levels (from kLo to kHi) ; (kSize,kLo,kHi)=(1,1,1) implies a 2-D model  C  levels (from kLo to kHi) ; (kSize,kLo,kHi)=(1,1,1) implies a 2-D model
46  C  field and (kSize,kLo,kHi)=(Nr,1,Nr) implies a 3-D model field.  C  field and (kSize,kLo,kHi)=(Nr,1,Nr) implies a 3-D model field.
47  C irecord is the record number to be read and must be >= 1.  C irecord is the record number to be read and must be >= 1.
48  C The file data is stored in arr *but* the overlaps are *not* updated,  C The file data is stored in fldRL/RS *but* the overlaps are *not* updated,
49  C  i.e., an exchange must be called. This is because the routine is  C  i.e., an exchange must be called. This is because the routine is
50  C  sometimes called from within a MASTER_THID region.  C  sometimes called from within a MASTER_THID region.
51  C  C
# Line 78  C !INPUT PARAMETERS: Line 78  C !INPUT PARAMETERS:
78        INTEGER irecord        INTEGER irecord
79        INTEGER myThid        INTEGER myThid
80  C !OUTPUT PARAMETERS:  C !OUTPUT PARAMETERS:
81        _RL  arr(*)        _RL  fldRL(*)
82          _RS  fldRS(*)
83    
84  C !FUNCTIONS  C !FUNCTIONS
85        INTEGER  ILNBLNK        INTEGER  ILNBLNK
# Line 295  C  to acces shared buffer while master t Line 296  C  to acces shared buffer while master t
296  C All threads wait for Master to finish loading into shared buffer  C All threads wait for Master to finish loading into shared buffer
297            CALL BAR2( myThid )            CALL BAR2( myThid )
298            IF ( arrType.EQ.'RS' ) THEN            IF ( arrType.EQ.'RS' ) THEN
299              CALL MDS_PASS_R4toRS( sharedLocBuf_r4, arr,              CALL MDS_PASS_R4toRS( sharedLocBuf_r4, fldRS,
300       I                        1, k, kSize, 0, 0, .TRUE., myThid )       I                        1, k, kSize, 0, 0, .TRUE., myThid )
301            ELSEIF ( arrType.EQ.'RL' ) THEN            ELSEIF ( arrType.EQ.'RL' ) THEN
302              CALL MDS_PASS_R4toRL( sharedLocBuf_r4, arr,              CALL MDS_PASS_R4toRL( sharedLocBuf_r4, fldRL,
303       I                        1, k, kSize, 0, 0, .TRUE., myThid )       I                        1, k, kSize, 0, 0, .TRUE., myThid )
304            ELSE            ELSE
305              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 316  C All threads wait for Master to finish Line 317  C All threads wait for Master to finish
317  C All threads wait for Master to finish loading into shared buffer  C All threads wait for Master to finish loading into shared buffer
318            CALL BAR2( myThid )            CALL BAR2( myThid )
319            IF ( arrType.EQ.'RS' ) THEN            IF ( arrType.EQ.'RS' ) THEN
320              CALL MDS_PASS_R8toRS( sharedLocBuf_r8, arr,              CALL MDS_PASS_R8toRS( sharedLocBuf_r8, fldRS,
321       I                        1, k, kSize, 0, 0, .TRUE., myThid )       I                        1, k, kSize, 0, 0, .TRUE., myThid )
322            ELSEIF ( arrType.EQ.'RL' ) THEN            ELSEIF ( arrType.EQ.'RL' ) THEN
323              CALL MDS_PASS_R8toRL( sharedLocBuf_r8, arr,              CALL MDS_PASS_R8toRL( sharedLocBuf_r8, fldRL,
324       I                        1, k, kSize, 0, 0, .TRUE., myThid )       I                        1, k, kSize, 0, 0, .TRUE., myThid )
325            ELSE            ELSE
326              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 500  C- endif iAmDoingIO Line 501  C- endif iAmDoingIO
501  C All threads wait for Master to finish reading into shared buffer  C All threads wait for Master to finish reading into shared buffer
502         CALL BAR2( myThid )         CALL BAR2( myThid )
503    
504  C---    Copy from 3-D buffer to arr (multi-threads):  C---    Copy from 3-D buffer to fldRL/RS (multi-threads):
505          IF ( filePrec.EQ.precFloat32 ) THEN          IF ( filePrec.EQ.precFloat32 ) THEN
506            IF ( arrType.EQ.'RS' ) THEN            IF ( arrType.EQ.'RS' ) THEN
507              CALL MDS_PASS_R4toRS( shared3dBuf_r4, arr,              CALL MDS_PASS_R4toRS( shared3dBuf_r4, fldRS,
508       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )
509            ELSEIF ( arrType.EQ.'RL' ) THEN            ELSEIF ( arrType.EQ.'RL' ) THEN
510              CALL MDS_PASS_R4toRL( shared3dBuf_r4, arr,              CALL MDS_PASS_R4toRL( shared3dBuf_r4, fldRL,
511       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )
512            ELSE            ELSE
513              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 517  C---    Copy from 3-D buffer to arr (mul Line 518  C---    Copy from 3-D buffer to arr (mul
518            ENDIF            ENDIF
519          ELSEIF ( filePrec.EQ.precFloat64 ) THEN          ELSEIF ( filePrec.EQ.precFloat64 ) THEN
520            IF ( arrType.EQ.'RS' ) THEN            IF ( arrType.EQ.'RS' ) THEN
521              CALL MDS_PASS_R8toRS( shared3dBuf_r8, arr,              CALL MDS_PASS_R8toRS( shared3dBuf_r8, fldRS,
522       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )
523            ELSEIF ( arrType.EQ.'RL' ) THEN            ELSEIF ( arrType.EQ.'RL' ) THEN
524              CALL MDS_PASS_R8toRL( shared3dBuf_r8, arr,              CALL MDS_PASS_R8toRL( shared3dBuf_r8, fldRL,
525       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )       I                    nNz, kLo, kSize, 0, 0, .TRUE., myThid )
526            ELSE            ELSE
527              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22