/[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.15 by molod, Mon May 16 23:41:32 2005 UTC revision 1.22 by molod, Tue Jun 14 23:06:15 2005 UTC
# Line 21  C*************************************** Line 21  C***************************************
21  #include "DIAGNOSTICS.h"  #include "DIAGNOSTICS.h"
22  #include "EEPARAMS.h"  #include "EEPARAMS.h"
23  #include "PARAMS.h"  #include "PARAMS.h"
 #ifdef ALLOW_FIZHI  
 #include "chronos.h"  
 #endif  
24    
25  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
26        _RL     myTime        _RL     myTime
# Line 39  c =============== Line 36  c ===============
36        INTEGER thisdate(4), prevdate(4)        INTEGER thisdate(4), prevdate(4)
37  #endif  #endif
38  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
39        integer nsecf2,mmdd,hhmmss,alarm2        logical alarm2
40        character *9 tagname        character *9 tagname
41  #endif  #endif
42    
# Line 64  C-    Determine calendar dates for this Line 61  C-    Determine calendar dates for this
61          DO n = 1,nlists          DO n = 1,nlists
62            freqSec = freq(n)            freqSec = freq(n)
63            phiSec = phase(n)            phiSec = phase(n)
 #ifdef ALLOW_FIZHI  
          if( useFIZHI) then  
           mmdd = int(freq(n))  
           hhmmss = int((freq(n) - int(freq(n)))*1.e6)  
           freqSec = nsecf2(hhmmss,mmdd,nymd)  
          endif  
 #endif  
64    
65            IF ( freqSec.LT.0. ) THEN            IF ( freqSec.LT.0. ) THEN
66  C--     write snap-shot with suffix = myIter to be consistent with  C--     write snap-shot with suffix = myIter to be consistent with
# Line 110  C-    Yearly  freqSec: Line 100  C-    Yearly  freqSec:
100            ENDIF            ENDIF
101  #endif  #endif
102    
103            IF ( dump2fileNow ) THEN            IF ( dump2fileNow .or. ((myIter.eq.nIter0+nTimeSteps).and.
104              CALL DIAGNOSTICS_OUT(n,wrIter,myThid)       .                                                dumpatlast) ) THEN
105                CALL DIAGNOSTICS_OUT(n,wrIter,myTime,myThid)
106              ENDIF
107            ENDDO
108    
109    C---   Check to see IF its time for Statistics Diag. Output
110    
111            DO n = 1,diagSt_nbLists
112              freqSec = diagSt_freq(n)
113              phiSec = diagSt_phase(n)
114    
115              IF ( freqSec.LT.0. ) THEN
116    C--     write snap-shot with suffix = myIter to be consistent with
117    C       time-average diagnostics (e.g., freq=-1 & freq=1):
118    c           wrIter = myIter
119    c           wrTime = myTime
120    C--     write snap-shot with suffix = myIter-1 to be consistent with
121    C       state-variable time-step:
122                wrIter = myItM1
123                wrTime = myTime - deltaTclock
124              ELSE
125                wrIter = myIter
126                wrTime = myTime
127              ENDIF
128              dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
129         &                                        wrTime, deltaTclock )
130    #ifdef ALLOW_FIZHI
131             if( useFIZHI) then
132              write(tagname,'(A,I2.2)')'diagStg',n
133              dump2fileNow = alarm2(tagname)
134             endif
135    #endif
136    
137              IF ( dump2fileNow .or. ((myIter.eq.nIter0+nTimeSteps).and.
138         .                                                dumpatlast) ) THEN
139                CALL DIAGSTATS_OUTPUT(n,wrIter,myThid)
140            ENDIF            ENDIF
141          ENDDO          ENDDO
142    
143    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
144  C-      wait for everyone before setting arrays to zero:  C-      wait for everyone before setting arrays to zero:
145          _BARRIER          _BARRIER
146    
147    C--     Clear storage space:
148    
149          DO n = 1,nlists          DO n = 1,nlists
150            freqSec = freq(n)            freqSec = freq(n)
151            phiSec = phase(n)            phiSec = phase(n)
152  #ifdef ALLOW_FIZHI  
          if( useFIZHI) then  
           mmdd = int(freq(n))  
           hhmmss = int((freq(n) - int(freq(n)))*1.e6)  
           freqSec = nsecf2(hhmmss,mmdd,nymd)  
          endif  
 #endif  
153            wrTime = myTime            wrTime = myTime
154            IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock            IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock
155            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
# Line 137  C-      wait for everyone before setting Line 160  C-      wait for everyone before setting
160             dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
161            endif            endif
162  #endif  #endif
163            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)  
164    #ifdef ALLOW_CAL
165              IF ( calendarDumps .AND. (
166         &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.
167         &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN
168    C--   Convert approximate months (30-31 days) and years (360-372 days)
169    C     to exact calendar months and years.
170               dump2fileNow = .FALSE.
171    C-    Monthly freqSec:
172               IF( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 .AND.
173         &        (thisdate(1)-prevdate(1)).GT.50   ) dump2fileNow = .TRUE.
174    C-    Yearly  freqSec:
175               IF( freqSec.GE.31104000 .AND. freqSec.LE.31968000 .AND.
176         &        (thisdate(1)-prevdate(1)).GT.5000 ) dump2fileNow = .TRUE.
177              ENDIF
178    #endif
179    
180              IF ( dump2fileNow .or. ((myIter.eq.nIter0+nTimeSteps).and.
181         .                                                dumpatlast) )
182         .                             CALL CLRINDX(n,myThid)
183            ENDDO
184    
185            DO n = 1,diagSt_nbLists
186              freqSec = diagSt_freq(n)
187              phiSec = diagSt_phase(n)
188              wrTime = myTime
189              IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock
190              dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
191         &                                        wrTime, deltaTclock )
192    #ifdef ALLOW_FIZHI
193             if( useFIZHI) then
194              write(tagname,'(A,I2.2)')'diagStg',n
195              dump2fileNow = alarm2(tagname)
196             endif
197    #endif
198              IF ( dump2fileNow .or. ((myIter.eq.nIter0+nTimeSteps).and.
199         .                                                dumpatlast) )
200         .                             CALL DIAGSTATS_CLEAR(n,myThid)
201          ENDDO          ENDDO
202    
203  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

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

  ViewVC Help
Powered by ViewVC 1.1.22