21 |
#include "DIAGNOSTICS.h" |
#include "DIAGNOSTICS.h" |
22 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
23 |
#include "PARAMS.h" |
#include "PARAMS.h" |
24 |
|
#ifdef ALLOW_FIZHI |
25 |
|
#include "chronos.h" |
26 |
|
#endif |
27 |
|
|
28 |
_RL myTime |
_RL myTime |
29 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
35 |
LOGICAL dump2fileNow |
LOGICAL dump2fileNow |
36 |
INTEGER thisdate(4), prevdate(4) |
INTEGER thisdate(4), prevdate(4) |
37 |
_RL freqSec |
_RL freqSec |
38 |
|
integer realfreq,nsecf2,yymmdd,hhmmss |
39 |
|
|
40 |
IF ( myIter.NE.nIter0 ) THEN |
IF ( myIter.NE.nIter0 ) THEN |
41 |
myItM1 = myIter - 1 |
myItM1 = myIter - 1 |
53 |
#endif |
#endif |
54 |
|
|
55 |
DO n = 1,nlists |
DO n = 1,nlists |
56 |
IF ( freq(n).LT.0 ) THEN |
realfreq = freq(n) |
57 |
dump2fileNow = MOD(myItM1,-freq(n)) .EQ. INT(-freq(n)/2) |
#ifdef ALLOW_FIZHI |
58 |
|
if( useFIZHI) then |
59 |
|
yymmdd = int(freq(n)) |
60 |
|
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
61 |
|
realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock |
62 |
|
endif |
63 |
|
#endif |
64 |
|
|
65 |
|
IF ( realfreq.LT.0 ) THEN |
66 |
|
dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2) |
67 |
C-- write snap-shot with suffix = myIter to be consistent with |
C-- write snap-shot with suffix = myIter to be consistent with |
68 |
C time-average diagnostics (e.g., freq=-1 & freq=1): |
C time-average diagnostics (e.g., freq=-1 & freq=1): |
69 |
c wrIter = myIter |
c wrIter = myIter |
71 |
C state-variable time-step: |
C state-variable time-step: |
72 |
wrIter = myItM1 |
wrIter = myItM1 |
73 |
ELSE |
ELSE |
74 |
dump2fileNow = MOD(myIter,freq(n)) .EQ. 0 |
dump2fileNow = MOD(myIter,realfreq) .EQ. 0 |
75 |
wrIter = myIter |
wrIter = myIter |
76 |
ENDIF |
ENDIF |
77 |
|
|
78 |
#ifdef ALLOW_CAL |
#ifdef ALLOW_CAL |
79 |
freqSec = freq(n) * deltaTClock |
freqSec = realfreq * deltaTClock |
80 |
IF ( calendarDumps .AND. ( |
IF ( calendarDumps .AND. ( |
81 |
& ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR. |
& ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR. |
82 |
& ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 )) THEN |
& ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN |
83 |
C-- Convert approximate months (30-31 days) and years (360-372 days) |
C-- Convert approximate months (30-31 days) and years (360-372 days) |
84 |
C to exact calendar months and years. |
C to exact calendar months and years. |
85 |
dump2fileNow = .FALSE |
dump2fileNow = .FALSE. |
86 |
C- Monthly freqSec: |
C- Monthly freqSec: |
87 |
IF( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 .AND. |
IF( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 .AND. |
88 |
& thisdate-prevdate.GT.50 ) dump2fileNow = .TRUE. |
& (thisdate(1)-prevdate(1)).GT.50 ) dump2fileNow = .TRUE. |
89 |
C- Yearly freqSec: |
C- Yearly freqSec: |
90 |
IF( freqSec.GE.31104000 .AND. freqSec.LE.31968000 .AND. |
IF( freqSec.GE.31104000 .AND. freqSec.LE.31968000 .AND. |
91 |
& thisdate-prevdate.GT.5000 ) dump2fileNow = .TRUE. |
& (thisdate(1)-prevdate(1)).GT.5000 ) dump2fileNow = .TRUE. |
92 |
ENDIF |
ENDIF |
93 |
#endif |
#endif |
94 |
|
|
100 |
C- wait for everyone before setting arrays to zero: |
C- wait for everyone before setting arrays to zero: |
101 |
_BARRIER |
_BARRIER |
102 |
DO n = 1,nlists |
DO n = 1,nlists |
103 |
IF ( freq(n).LT.0 ) THEN |
realfreq = freq(n) |
104 |
dump2fileNow = MOD(myItM1,-freq(n)) .EQ. INT(-freq(n)/2) |
#ifdef ALLOW_FIZHI |
105 |
|
if( useFIZHI) then |
106 |
|
yymmdd = int(freq(n)) |
107 |
|
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
108 |
|
realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock |
109 |
|
endif |
110 |
|
#endif |
111 |
|
IF ( realfreq.LT.0 ) THEN |
112 |
|
dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2) |
113 |
ELSE |
ELSE |
114 |
dump2fileNow = MOD(myIter,freq(n)) .EQ. 0 |
dump2fileNow = MOD(myIter,realfreq) .EQ. 0 |
115 |
ENDIF |
ENDIF |
116 |
IF ( dump2fileNow ) CALL CLRINDX(n,myThid) |
IF ( dump2fileNow ) CALL CLRINDX(n,myThid) |
117 |
ENDDO |
ENDDO |