/[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.14 by jmc, Sat May 14 20:45:27 2005 UTC revision 1.18 by jmc, Sat May 21 22:33:40 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,yymmdd,hhmmss        logical alarm2
40          character *9 tagname
41  #endif  #endif
42    
43        LOGICAL  DIFF_PHASE_MULTIPLE        LOGICAL  DIFF_PHASE_MULTIPLE
# Line 63  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  
           yymmdd = int(freq(n))  
           hhmmss = int((freq(n) - int(freq(n)))*1.e6)  
           freqSec = nsecf2(hhmmss,yymmdd,nymd)  
           yymmdd = int(phase(n))  
           hhmmss = int((phase(n) - int(phase(n)))*1.e6)  
           phiSec = nsecf2(hhmmss,yymmdd,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 89  C       state-variable time-step: Line 77  C       state-variable time-step:
77            ENDIF            ENDIF
78            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
79       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
80    #ifdef ALLOW_FIZHI
81             if( useFIZHI) then
82              write(tagname,'(A,I2.2)')'diagtag',n
83              dump2fileNow = alarm2(tagname)
84             endif
85    #endif
86    
87  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
88            IF ( calendarDumps .AND. (            IF ( calendarDumps .AND. (
# Line 111  C-    Yearly  freqSec: Line 105  C-    Yearly  freqSec:
105            ENDIF            ENDIF
106          ENDDO          ENDDO
107    
108    C---   Check to see IF its time for Statistics Diag. Output
109    
110            DO n = 1,diagSt_nbLists
111              freqSec = diagSt_freq(n)
112              phiSec = diagSt_phase(n)
113    
114              IF ( freqSec.LT.0. ) THEN
115    C--     write snap-shot with suffix = myIter to be consistent with
116    C       time-average diagnostics (e.g., freq=-1 & freq=1):
117    c           wrIter = myIter
118    c           wrTime = myTime
119    C--     write snap-shot with suffix = myIter-1 to be consistent with
120    C       state-variable time-step:
121                wrIter = myItM1
122                wrTime = myTime - deltaTclock
123              ELSE
124                wrIter = myIter
125                wrTime = myTime
126              ENDIF
127              dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
128         &                                        wrTime, deltaTclock )
129    #ifdef ALLOW_FIZHI
130             if( useFIZHI) then
131              write(tagname,'(A,I2.2)')'diagStg',n
132              dump2fileNow = alarm2(tagname)
133             endif
134    #endif
135    
136              IF ( dump2fileNow ) THEN
137                CALL DIAGSTATS_OUTPUT(n,wrIter,myThid)
138              ENDIF
139            ENDDO
140    
141    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
142  C-      wait for everyone before setting arrays to zero:  C-      wait for everyone before setting arrays to zero:
143          _BARRIER          _BARRIER
144    
145    C--     Clear storage space:
146    
147          DO n = 1,nlists          DO n = 1,nlists
148            freqSec = freq(n)            freqSec = freq(n)
149            phiSec = phase(n)            phiSec = phase(n)
150    
151              wrTime = myTime
152              IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock
153              dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
154         &                                        wrTime, deltaTclock )
155  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
156           if( useFIZHI) then            if( useFIZHI) then
157            yymmdd = int(freq(n))             write(tagname,'(A,I2.2)')'diagtag',n
158            hhmmss = int((freq(n) - int(freq(n)))*1.e6)             dump2fileNow = alarm2(tagname)
159            freqSec = nsecf2(hhmmss,yymmdd,nymd)            endif
           yymmdd = int(phase(n))  
           hhmmss = int((phase(n) - int(phase(n)))*1.e6)  
           phiSec = nsecf2(hhmmss,yymmdd,nymd)  
          endif  
160  #endif  #endif
161              IF ( dump2fileNow ) CALL CLRINDX(n,myThid)
162            ENDDO
163    
164            DO n = 1,diagSt_nbLists
165              freqSec = diagSt_freq(n)
166              phiSec = diagSt_phase(n)
167            wrTime = myTime            wrTime = myTime
168            IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock            IF ( freqSec.LT.0. ) wrTime = myTime - deltaTclock
169            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
170       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
171    #ifdef ALLOW_FIZHI
172            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)           if( useFIZHI) then
173              write(tagname,'(A,I2.2)')'diagStg',n
174              dump2fileNow = alarm2(tagname)
175             endif
176    #endif
177              IF ( dump2fileNow ) CALL DIAGSTATS_CLEAR(n,myThid)
178          ENDDO          ENDDO
179    
180  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.22