25 |
#include "chronos.h" |
#include "chronos.h" |
26 |
#endif |
#endif |
27 |
|
|
28 |
|
C !INPUT PARAMETERS: |
29 |
_RL myTime |
_RL myTime |
30 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
31 |
|
|
34 |
INTEGER n |
INTEGER n |
35 |
INTEGER myItM1, wrIter |
INTEGER myItM1, wrIter |
36 |
LOGICAL dump2fileNow |
LOGICAL dump2fileNow |
37 |
|
_RL phiSec, freqSec, wrTime |
38 |
|
#ifdef ALLOW_CAL |
39 |
INTEGER thisdate(4), prevdate(4) |
INTEGER thisdate(4), prevdate(4) |
40 |
_RL freqSec |
#endif |
41 |
integer realfreq,nsecf2,yymmdd,hhmmss |
#ifdef ALLOW_FIZHI |
42 |
|
integer nsecf2,yymmdd,hhmmss |
43 |
|
#endif |
44 |
|
|
45 |
|
LOGICAL DIFF_PHASE_MULTIPLE |
46 |
|
EXTERNAL DIFF_PHASE_MULTIPLE |
47 |
|
|
48 |
IF ( myIter.NE.nIter0 ) THEN |
IF ( myIter.NE.nIter0 ) THEN |
49 |
myItM1 = myIter - 1 |
myItM1 = myIter - 1 |
61 |
#endif |
#endif |
62 |
|
|
63 |
DO n = 1,nlists |
DO n = 1,nlists |
64 |
realfreq = freq(n) |
freqSec = freq(n) |
65 |
|
phiSec = phase(n) |
66 |
#ifdef ALLOW_FIZHI |
#ifdef ALLOW_FIZHI |
67 |
if( useFIZHI) then |
if( useFIZHI) then |
68 |
yymmdd = int(freq(n)) |
yymmdd = int(freq(n)) |
69 |
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
70 |
realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock |
freqSec = nsecf2(hhmmss,yymmdd,nymd) |
71 |
|
yymmdd = int(phase(n)) |
72 |
|
hhmmss = int((phase(n) - int(phase(n)))*1.e6) |
73 |
|
phiSec = nsecf2(hhmmss,yymmdd,nymd) |
74 |
endif |
endif |
75 |
#endif |
#endif |
76 |
|
|
77 |
IF ( realfreq.LT.0 ) THEN |
IF ( freqSec.LT.0. ) THEN |
|
dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2) |
|
78 |
C-- write snap-shot with suffix = myIter to be consistent with |
C-- write snap-shot with suffix = myIter to be consistent with |
79 |
C time-average diagnostics (e.g., freq=-1 & freq=1): |
C time-average diagnostics (e.g., freq=-1 & freq=1): |
80 |
c wrIter = myIter |
c wrIter = myIter |
81 |
|
c wrTime = myTime |
82 |
C-- write snap-shot with suffix = myIter-1 to be consistent with |
C-- write snap-shot with suffix = myIter-1 to be consistent with |
83 |
C state-variable time-step: |
C state-variable time-step: |
84 |
wrIter = myItM1 |
wrIter = myItM1 |
85 |
|
wrTime = myTime - deltaTclock |
86 |
ELSE |
ELSE |
|
dump2fileNow = MOD(myIter,realfreq) .EQ. 0 |
|
87 |
wrIter = myIter |
wrIter = myIter |
88 |
|
wrTime = myTime |
89 |
ENDIF |
ENDIF |
90 |
|
dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec, |
91 |
|
& wrTime, deltaTclock ) |
92 |
|
|
93 |
#ifdef ALLOW_CAL |
#ifdef ALLOW_CAL |
|
freqSec = realfreq * deltaTClock |
|
94 |
IF ( calendarDumps .AND. ( |
IF ( calendarDumps .AND. ( |
95 |
& ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR. |
& ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR. |
96 |
& ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN |
& ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN |
114 |
C- wait for everyone before setting arrays to zero: |
C- wait for everyone before setting arrays to zero: |
115 |
_BARRIER |
_BARRIER |
116 |
DO n = 1,nlists |
DO n = 1,nlists |
117 |
realfreq = freq(n) |
freqSec = freq(n) |
118 |
|
phiSec = phase(n) |
119 |
#ifdef ALLOW_FIZHI |
#ifdef ALLOW_FIZHI |
120 |
if( useFIZHI) then |
if( useFIZHI) then |
121 |
yymmdd = int(freq(n)) |
yymmdd = int(freq(n)) |
122 |
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
hhmmss = int((freq(n) - int(freq(n)))*1.e6) |
123 |
realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock |
freqSec = nsecf2(hhmmss,yymmdd,nymd) |
124 |
|
yymmdd = int(phase(n)) |
125 |
|
hhmmss = int((phase(n) - int(phase(n)))*1.e6) |
126 |
|
phiSec = nsecf2(hhmmss,yymmdd,nymd) |
127 |
endif |
endif |
128 |
#endif |
#endif |
129 |
IF ( realfreq.LT.0 ) THEN |
wrTime = myTime |
130 |
dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2) |
IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock |
131 |
ELSE |
dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec, |
132 |
dump2fileNow = MOD(myIter,realfreq) .EQ. 0 |
& wrTime, deltaTclock ) |
133 |
ENDIF |
|
134 |
IF ( dump2fileNow ) CALL CLRINDX(n,myThid) |
IF ( dump2fileNow ) CALL CLRINDX(n,myThid) |
135 |
ENDDO |
ENDDO |
136 |
|
|