/[MITgcm]/MITgcm/eesupp/src/open_copy_data_file.F
ViewVC logotype

Diff of /MITgcm/eesupp/src/open_copy_data_file.F

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

revision 1.3 by jmc, Mon Dec 13 04:24:25 2010 UTC revision 1.4 by dimitri, Sat Sep 28 19:09:38 2013 UTC
# Line 44  C     === Local variables === Line 44  C     === Local variables ===
44  C     msgBuf    :: Informational/error message buffer  C     msgBuf    :: Informational/error message buffer
45        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
46        CHARACTER*(MAX_LEN_PREC) record        CHARACTER*(MAX_LEN_PREC) record
 #if defined (TARGET_BGL) || defined (TARGET_CRAYXT)  
47        CHARACTER*(MAX_LEN_FNAM) scratchFile1        CHARACTER*(MAX_LEN_FNAM) scratchFile1
48        CHARACTER*(MAX_LEN_FNAM) scratchFile2        CHARACTER*(MAX_LEN_FNAM) scratchFile2
 #endif  
49        INTEGER  errIO,IL        INTEGER  errIO,IL
50        LOGICAL  exst        LOGICAL  exst
51  CEOP  CEOP
# Line 70  C--   Open the parameter file Line 68  C--   Open the parameter file
68         STOP 'ABNORMAL END: S/R OPEN_COPY_DATA_FILE'         STOP 'ABNORMAL END: S/R OPEN_COPY_DATA_FILE'
69        ENDIF        ENDIF
70    
 #if defined (TARGET_BGL) || defined (TARGET_CRAYXT)  
71        WRITE(scratchFile1,'(A,I4.4)') 'scratch1.', myProcId        WRITE(scratchFile1,'(A,I4.4)') 'scratch1.', myProcId
72        WRITE(scratchFile2,'(A,I4.4)') 'scratch2.', myProcId        WRITE(scratchFile2,'(A,I4.4)') 'scratch2.', myProcId
73    #ifdef SINGLE_DISK_IO
74          IF( myProcId .EQ. 0 ) THEN
75             OPEN(UNIT=scrUnit1, FILE=scratchFile1, STATUS='UNKNOWN')
76             OPEN(UNIT=scrUnit2, FILE=scratchFile2, STATUS='UNKNOWN')
77          ENDIF
78    #else /* ifndef SINGLE_DISK_IO */
79    # if defined (TARGET_BGL) || defined (TARGET_CRAYXT)
80        OPEN(UNIT=scrUnit1, FILE=scratchFile1, STATUS='UNKNOWN')        OPEN(UNIT=scrUnit1, FILE=scratchFile1, STATUS='UNKNOWN')
81        OPEN(UNIT=scrUnit2, FILE=scratchFile2, STATUS='UNKNOWN')        OPEN(UNIT=scrUnit2, FILE=scratchFile2, STATUS='UNKNOWN')
82  #else  # else
83        OPEN(UNIT=scrUnit1,STATUS='SCRATCH')        OPEN(UNIT=scrUnit1,STATUS='SCRATCH')
84        OPEN(UNIT=scrUnit2,STATUS='SCRATCH')        OPEN(UNIT=scrUnit2,STATUS='SCRATCH')
85    # endif
86    #endif /* SINGLE_DISK_IO */
87    
88    #ifdef SINGLE_DISK_IO
89          IF( myProcId .EQ. 0 ) THEN
90  #endif  #endif
91    
92        OPEN(UNIT=modelDataUnit,FILE=data_file,STATUS='OLD',        OPEN(UNIT=modelDataUnit,FILE=data_file,STATUS='OLD',
93       &     IOSTAT=errIO)       &     IOSTAT=errIO)
94        IF ( errIO .LT. 0 ) THEN        IF ( errIO .LT. 0 ) THEN
# Line 134  C--   Return open unit to caller Line 144  C--   Return open unit to caller
144        iUnit = scrUnit1        iUnit = scrUnit1
145        REWIND(iUnit)        REWIND(iUnit)
146    
147    #ifdef SINGLE_DISK_IO
148          CLOSE(iUnit)
149          ENDIF
150          OPEN(UNIT=iUnit, FILE=scratchFile1, STATUS='OLD')
151    #endif
152    
153        _END_MASTER(myThid)        _END_MASTER(myThid)
154    
155    #ifdef SINGLE_DISK_IO
156    C-- all processes must wait for process 0 to complete writing scratchFile1
157          _BARRIER
158    #endif
159    
160        RETURN        RETURN
161        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22