/[MITgcm]/MITgcm/model/src/packages_write_pickup.F
ViewVC logotype

Diff of /MITgcm/model/src/packages_write_pickup.F

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

revision 1.11 by edhill, Sun Feb 20 04:31:54 2005 UTC revision 1.20 by cnh, Tue Nov 8 23:01:10 2005 UTC
# Line 54  C     oldPrc :: Temp. for holding I/O pr Line 54  C     oldPrc :: Temp. for holding I/O pr
54  C     fn     :: Temp. for building file name string.  C     fn     :: Temp. for building file name string.
55  C     lgf    :: Flag to indicate whether to use global file mode.  C     lgf    :: Flag to indicate whether to use global file mode.
56        LOGICAL permCheckPoint, tempCheckPoint          LOGICAL permCheckPoint, tempCheckPoint  
57    #ifdef ALLOW_CAL
58          INTEGER thisdate(4), prevdate(4)
59    #endif
60  CEOP  CEOP
61    
62        permCheckPoint = .FALSE.        permCheckPoint = .FALSE.
63        tempCheckPoint = .FALSE.        tempCheckPoint = .FALSE.
64        permCheckPoint=        permCheckPoint=
65       &     DIFFERENT_MULTIPLE(pChkptFreq,myTime,myTime-deltaTClock)       &     DIFFERENT_MULTIPLE(pChkptFreq,myTime,deltaTClock)
66        tempCheckPoint=        tempCheckPoint=
67       &     DIFFERENT_MULTIPLE( ChkptFreq,myTime,myTime-deltaTClock)       &     DIFFERENT_MULTIPLE( ChkptFreq,myTime,deltaTClock)
68          
69    #ifdef ALLOW_CAL
70          IF ( calendarDumps ) THEN
71    C--   Convert approximate months (30-31 days) and years (360-372 days)
72    C     to exact calendar months and years.
73    C-    First determine calendar dates for this and previous time step.
74             call cal_GetDate( myiter  ,mytime            ,thisdate,mythid )
75             call cal_GetDate( myiter-1,mytime-deltaTClock,prevdate,mythid )
76    C-    Monthly pChkptFreq:
77             IF( pChkptFreq.GE. 2592000 .AND. pChkptFreq.LE. 2678400 ) THEN
78                permCheckPoint = .FALSE.
79                IF((thisdate(1)-prevdate(1)) .GT. 50  )permCheckPoint=.TRUE.
80             ENDIF
81    C-    Yearly  pChkptFreq:
82             IF( pChkptFreq.GE.31104000 .AND. pChkptFreq.LE.31968000 ) THEN
83                permCheckPoint = .FALSE.
84                IF((thisdate(1)-prevdate(1)) .GT. 5000)permCheckPoint=.TRUE.
85             ENDIF
86    C-    Monthly  ChkptFreq:
87             IF(  ChkptFreq.GE. 2592000 .AND.  ChkptFreq.LE. 2678400 ) THEN
88                tempCheckPoint = .FALSE.
89                IF((thisdate(1)-prevdate(1)) .GT. 50  )tempCheckPoint=.TRUE.
90             ENDIF
91    C-    Yearly   ChkptFreq:
92             IF(  ChkptFreq.GE.31104000 .AND.  ChkptFreq.LE.31968000 ) THEN
93                tempCheckPoint = .FALSE.
94                IF((thisdate(1)-prevdate(1)) .GT. 5000)tempCheckPoint=.TRUE.
95             ENDIF
96          ENDIF
97    #endif
98    
99        IF (        IF (
100       &     ( .NOT.modelEnd .AND. (permCheckPoint.OR.tempCheckPoint) )       &     ( .NOT.modelEnd .AND. (permCheckPoint.OR.tempCheckPoint) )
101       &     .OR.       &     .OR.
# Line 126  CEOP Line 159  CEOP
159    
160  C     Going to really do some IO. Make everyone except master thread wait.  C     Going to really do some IO. Make everyone except master thread wait.
161        _BARRIER        _BARRIER
162        _BEGIN_MASTER( myThid )  C     _BEGIN_MASTER( myThid )
163    
164        prec = precFloat64        prec = precFloat64
165        lgf = globalFile        lgf = globalFile
# Line 182  C     Write restart file for floats Line 215  C     Write restart file for floats
215  #endif  #endif
216    
217  #ifdef ALLOW_LAND  #ifdef ALLOW_LAND
218  C     Write pickup file for Lnad package:  C     Write pickup file for Land package:
219        IF (useLand) THEN        IF (useLand) THEN
220          CALL LAND_WRITE_PICKUP(fn,myTime,myIter,myThid)          CALL LAND_WRITE_PICKUP(permCheckPoint,fn,
221         &       myTime,myIter,myThid)
222        ENDIF        ENDIF
223  #endif  #endif
224    
# Line 200  C     Write pickup file for fizhi packag Line 234  C     Write pickup file for fizhi packag
234  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
235  C     Write pickup file for diagnostics package  C     Write pickup file for diagnostics package
236        IF (useDiagnostics) THEN        IF (useDiagnostics) THEN
237          CALL DIAGNOSTICS_WRITE_PICKUP(fn,myTime,myIter,myThid)          CALL DIAGNOSTICS_WRITE_PICKUP(permCheckPoint,
238         &       fn,myTime,myIter,myThid)
239        ENDIF        ENDIF
240  #endif  #endif
241    
# Line 211  C     Write pickup file for diagnostics Line 246  C     Write pickup file for diagnostics
246        ENDIF        ENDIF
247  #endif  /* ALLOW_GGL90 */  #endif  /* ALLOW_GGL90 */
248    
249         _END_MASTER( myThid )  C     _END_MASTER( myThid )
250         _BARRIER        _BARRIER
251    
252  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_PTRACERS
253  C      Write restart file for passive tracers  C     Write restart file for passive tracers
254         IF (usePTRACERS) THEN        IF (usePTRACERS) THEN
255           CALL PTRACERS_WRITE_CHECKPOINT(fn,myIter,myTime,myThid)          CALL PTRACERS_WRITE_CHECKPOINT(permCheckPoint,
256         ENDIF       &       fn,myIter,myTime,myThid)
257          ENDIF
258  #endif /* ALLOW_PTRACERS */  #endif /* ALLOW_PTRACERS */
259    
260    #ifdef ALLOW_OFFLINE
261    C     This is quick fix for A/B checkpoints since the main model
262    C     checkpoint routine will not be called in OFFLINE mode and will
263    C     thus not have the chance to set the alternating A/B suffix
264          IF ( .NOT. permCheckPoint ) THEN
265            nCheckLev = MOD(nCheckLev, maxNoChkptLev)+1
266          ENDIF
267    #endif /* ALLOW_OFFLINE */
268    
269        RETURN        RETURN
270        END        END
271    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22