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 |
|
INTEGER thisdate(4), prevdate(4) |
58 |
CEOP |
CEOP |
59 |
|
|
60 |
permCheckPoint = .FALSE. |
permCheckPoint = .FALSE. |
61 |
tempCheckPoint = .FALSE. |
tempCheckPoint = .FALSE. |
62 |
permCheckPoint= |
permCheckPoint= |
63 |
& DIFFERENT_MULTIPLE(pChkptFreq,myTime,myTime-deltaTClock) |
& DIFFERENT_MULTIPLE(pChkptFreq,myTime,deltaTClock) |
64 |
tempCheckPoint= |
tempCheckPoint= |
65 |
& DIFFERENT_MULTIPLE( ChkptFreq,myTime,myTime-deltaTClock) |
& DIFFERENT_MULTIPLE( ChkptFreq,myTime,deltaTClock) |
66 |
|
|
67 |
|
#ifdef ALLOW_CAL |
68 |
|
IF ( calendarDumps ) THEN |
69 |
|
C-- Convert approximate months (30-31 days) and years (360-372 days) |
70 |
|
C to exact calendar months and years. |
71 |
|
C- First determine calendar dates for this and previous time step. |
72 |
|
call cal_GetDate( myiter ,mytime ,thisdate,mythid ) |
73 |
|
call cal_GetDate( myiter-1,mytime-deltaTClock,prevdate,mythid ) |
74 |
|
C- Monthly pChkptFreq: |
75 |
|
IF( pChkptFreq.GE. 2592000 .AND. pChkptFreq.LE. 2678400 ) THEN |
76 |
|
permCheckPoint = .FALSE. |
77 |
|
IF((thisdate(1)-prevdate(1)) .GT. 50 )permCheckPoint=.TRUE. |
78 |
|
ENDIF |
79 |
|
C- Yearly pChkptFreq: |
80 |
|
IF( pChkptFreq.GE.31104000 .AND. pChkptFreq.LE.31968000 ) THEN |
81 |
|
permCheckPoint = .FALSE. |
82 |
|
IF((thisdate(1)-prevdate(1)) .GT. 5000)permCheckPoint=.TRUE. |
83 |
|
ENDIF |
84 |
|
C- Monthly ChkptFreq: |
85 |
|
IF( ChkptFreq.GE. 2592000 .AND. ChkptFreq.LE. 2678400 ) THEN |
86 |
|
tempCheckPoint = .FALSE. |
87 |
|
IF((thisdate(1)-prevdate(1)) .GT. 50 )tempCheckPoint=.TRUE. |
88 |
|
ENDIF |
89 |
|
C- Yearly ChkptFreq: |
90 |
|
IF( ChkptFreq.GE.31104000 .AND. ChkptFreq.LE.31968000 ) THEN |
91 |
|
tempCheckPoint = .FALSE. |
92 |
|
IF((thisdate(1)-prevdate(1)) .GT. 5000)tempCheckPoint=.TRUE. |
93 |
|
ENDIF |
94 |
|
ENDIF |
95 |
|
#endif |
96 |
|
|
97 |
IF ( |
IF ( |
98 |
& ( .NOT.modelEnd .AND. (permCheckPoint.OR.tempCheckPoint) ) |
& ( .NOT.modelEnd .AND. (permCheckPoint.OR.tempCheckPoint) ) |
99 |
& .OR. |
& .OR. |
213 |
#endif |
#endif |
214 |
|
|
215 |
#ifdef ALLOW_LAND |
#ifdef ALLOW_LAND |
216 |
C Write pickup file for Lnad package: |
C Write pickup file for Land package: |
217 |
IF (useLand) THEN |
IF (useLand) THEN |
218 |
CALL LAND_WRITE_PICKUP(fn,myTime,myIter,myThid) |
CALL LAND_WRITE_PICKUP(permCheckPoint,fn, |
219 |
|
& myTime,myIter,myThid) |
220 |
ENDIF |
ENDIF |
221 |
#endif |
#endif |
222 |
|
|
243 |
ENDIF |
ENDIF |
244 |
#endif /* ALLOW_GGL90 */ |
#endif /* ALLOW_GGL90 */ |
245 |
|
|
246 |
_END_MASTER( myThid ) |
_END_MASTER( myThid ) |
247 |
_BARRIER |
_BARRIER |
248 |
|
|
249 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
250 |
C Write restart file for passive tracers |
C Write restart file for passive tracers |
251 |
IF (usePTRACERS) THEN |
IF (usePTRACERS) THEN |
252 |
CALL PTRACERS_WRITE_CHECKPOINT(fn,myIter,myTime,myThid) |
CALL PTRACERS_WRITE_CHECKPOINT(permCheckPoint, |
253 |
ENDIF |
& fn,myIter,myTime,myThid) |
254 |
|
ENDIF |
255 |
#endif /* ALLOW_PTRACERS */ |
#endif /* ALLOW_PTRACERS */ |
256 |
|
|
257 |
|
#ifdef ALLOW_OFFLINE |
258 |
|
C This is quick fix for A/B checkpoints since the main model |
259 |
|
C checkpoint routine will not be called in OFFLINE mode and will |
260 |
|
C thus not have the chance to set the alternating A/B suffix |
261 |
|
IF ( .NOT. permCheckPoint ) THEN |
262 |
|
nCheckLev = MOD(nCheckLev, maxNoChkptLev)+1 |
263 |
|
ENDIF |
264 |
|
#endif /* ALLOW_OFFLINE */ |
265 |
|
|
266 |
RETURN |
RETURN |
267 |
END |
END |
268 |
|
|