/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_write.F
ViewVC logotype

Diff of /MITgcm/pkg/diagnostics/diagnostics_write.F

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

revision 1.13 by molod, Fri May 13 18:32:46 2005 UTC revision 1.15 by molod, Mon May 16 23:41:32 2005 UTC
# Line 25  C*************************************** Line 25  C***************************************
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    
# Line 33  c =============== Line 34  c ===============
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,mmdd,hhmmss,alarm2
43          character *9 tagname
44    #endif
45    
46          LOGICAL  DIFF_PHASE_MULTIPLE
47          EXTERNAL DIFF_PHASE_MULTIPLE
48    
49        IF ( myIter.NE.nIter0 ) THEN        IF ( myIter.NE.nIter0 ) THEN
50          myItM1 = myIter - 1          myItM1 = myIter - 1
# Line 53  C-    Determine calendar dates for this Line 62  C-    Determine calendar dates for this
62  #endif  #endif
63    
64          DO n = 1,nlists          DO n = 1,nlists
65           realfreq = freq(n)            freqSec = freq(n)
66              phiSec = phase(n)
67  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
68           if( useFIZHI) then           if( useFIZHI) then
69            yymmdd = int(freq(n))            mmdd = int(freq(n))
70            hhmmss = int((freq(n) - int(freq(n)))*1.e6)            hhmmss = int((freq(n) - int(freq(n)))*1.e6)
71            realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock            freqSec = nsecf2(hhmmss,mmdd,nymd)
72           endif           endif
73  #endif  #endif
74    
75            IF ( realfreq.LT.0 ) THEN            IF ( freqSec.LT.0. ) THEN
             dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2)  
76  C--     write snap-shot with suffix = myIter to be consistent with  C--     write snap-shot with suffix = myIter to be consistent with
77  C       time-average diagnostics (e.g., freq=-1 & freq=1):  C       time-average diagnostics (e.g., freq=-1 & freq=1):
78  c           wrIter = myIter  c           wrIter = myIter
79    c           wrTime = myTime
80  C--     write snap-shot with suffix = myIter-1 to be consistent with  C--     write snap-shot with suffix = myIter-1 to be consistent with
81  C       state-variable time-step:  C       state-variable time-step:
82              wrIter = myItM1              wrIter = myItM1
83                wrTime = myTime - deltaTclock
84            ELSE            ELSE
             dump2fileNow = MOD(myIter,realfreq) .EQ. 0  
85              wrIter = myIter              wrIter = myIter
86                wrTime = myTime
87            ENDIF            ENDIF
88              dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
89         &                                        wrTime, deltaTclock )
90    #ifdef ALLOW_FIZHI
91             if( useFIZHI) then
92              write(tagname,'(A,I2.2)')'diagtag',n
93              dump2fileNow = alarm2(tagname)
94             endif
95    #endif
96    
97  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
           freqSec = realfreq * deltaTClock  
98            IF ( calendarDumps .AND. (            IF ( calendarDumps .AND. (
99       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.
100       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN
# Line 100  C-    Yearly  freqSec: Line 118  C-    Yearly  freqSec:
118  C-      wait for everyone before setting arrays to zero:  C-      wait for everyone before setting arrays to zero:
119          _BARRIER          _BARRIER
120          DO n = 1,nlists          DO n = 1,nlists
121           realfreq = freq(n)            freqSec = freq(n)
122              phiSec = phase(n)
123  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
124           if( useFIZHI) then           if( useFIZHI) then
125            yymmdd = int(freq(n))            mmdd = int(freq(n))
126            hhmmss = int((freq(n) - int(freq(n)))*1.e6)            hhmmss = int((freq(n) - int(freq(n)))*1.e6)
127            realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock            freqSec = nsecf2(hhmmss,mmdd,nymd)
128           endif           endif
129  #endif  #endif
130            IF ( realfreq.LT.0 ) THEN            wrTime = myTime
131              dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2)            IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock
132            ELSE            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
133              dump2fileNow = MOD(myIter,realfreq) .EQ. 0       &                                        wrTime, deltaTclock )
134            ENDIF  #ifdef ALLOW_FIZHI
135              if( useFIZHI) then
136               write(tagname,'(A,I2.2)')'diagtag',n
137               dump2fileNow = alarm2(tagname)
138              endif
139    #endif
140            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)
141          ENDDO          ENDDO
142    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22