/[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.27 by jmc, Mon Jan 23 22:21:15 2006 UTC revision 1.30 by jmc, Wed Jan 3 00:29:59 2007 UTC
# Line 32  c =============== Line 32  c ===============
32        INTEGER   myItM1, wrIter        INTEGER   myItM1, wrIter
33        LOGICAL   dump2fileNow, write2file        LOGICAL   dump2fileNow, write2file
34        _RL       phiSec, freqSec, wrTime        _RL       phiSec, freqSec, wrTime
 #ifdef ALLOW_CAL  
       INTEGER thisdate(4), prevdate(4)  
 #endif  
35  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
36        logical alarm2        LOGICAL alarm2
37        character *9 tagname        CHARACTER *9 tagname
38  #endif  #endif
39    
40        LOGICAL  DIFF_PHASE_MULTIPLE        LOGICAL  DIFF_PHASE_MULTIPLE
# Line 47  c =============== Line 44  c ===============
44          myItM1 = myIter - 1          myItM1 = myIter - 1
45    
46  C***********************************************************************  C***********************************************************************
47  C***   Check to see IF its time for Diagnostic Output                ***  C***   Check to see if its time for Diagnostic Output                ***
48  C***********************************************************************  C***********************************************************************
49    
 #ifdef ALLOW_CAL  
         IF ( calendarDumps ) THEN  
 C-    Determine calendar dates for this and previous time step.  
            call cal_GetDate(myiter  ,mytime            ,thisdate,mythid)  
            call cal_GetDate(myiter-1,mytime-deltaTClock,prevdate,mythid)  
         ENDIF  
 #endif  
   
50          write2file = .FALSE.          write2file = .FALSE.
51          DO n = 1,nlists          DO n = 1,nlists
52            freqSec = freq(n)            freqSec = freq(n)
# Line 79  C       state-variable time-step: Line 68  C       state-variable time-step:
68            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
69       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
70  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
71           if( useFIZHI) then            IF ( useFIZHI ) THEN
72            write(tagname,'(A,I2.2)')'diagtag',n             WRITE(tagname,'(A,I2.2)')'diagtag',n
73            dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
          endif  
 #endif  
   
 #ifdef ALLOW_CAL  
           IF ( calendarDumps .AND. (  
      &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.  
      &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN  
 C--   Convert approximate months (30-31 days) and years (360-372 days)  
 C     to exact calendar months and years.  
            dump2fileNow = .FALSE.  
 C-    Monthly freqSec:  
            IF( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 .AND.  
      &        (thisdate(1)-prevdate(1)).GT.50   ) dump2fileNow = .TRUE.  
 C-    Yearly  freqSec:  
            IF( freqSec.GE.31104000 .AND. freqSec.LE.31968000 .AND.  
      &        (thisdate(1)-prevdate(1)).GT.5000 ) dump2fileNow = .TRUE.  
74            ENDIF            ENDIF
75  #endif  #endif
76    #ifdef ALLOW_CAL
77            IF ( dump2fileNow .OR.            IF ( useCAL ) THEN
78       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN              CALL CAL_TIME2DUMP( freqSec, deltaTClock,
79         U                          dump2fileNow,
80         I                          myTime, myIter, myThid )
81              ENDIF
82    #endif /* ALLOW_CAL */
83              IF ( dumpAtLast .AND. myTime.EQ.endTime
84         &                    .AND. freqSec.GE.0. ) dump2fileNow = .TRUE.
85              IF ( dump2fileNow ) THEN
86              write2file = .TRUE.              write2file = .TRUE.
87              CALL DIAGNOSTICS_OUT(n,wrIter,wrTime,myThid)              CALL DIAGNOSTICS_OUT(n,wrIter,wrTime,myThid)
88            ENDIF            ENDIF
89          ENDDO          ENDDO
90    
91  C---   Check to see IF its time for Statistics Diag. Output  C---   Check to see if its time for Statistics Diag. Output
92    
93          DO n = 1,diagSt_nbLists          DO n = 1,diagSt_nbLists
94            freqSec = diagSt_freq(n)            freqSec = diagSt_freq(n)
# Line 130  C       state-variable time-step: Line 110  C       state-variable time-step:
110            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
111       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
112  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
113           if( useFIZHI) then            IF ( useFIZHI ) THEN
114            write(tagname,'(A,I2.2)')'diagStg',n             WRITE(tagname,'(A,I2.2)')'diagStg',n
115            dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
116           endif            ENDIF
117  #endif  #endif
118              IF ( dumpAtLast .AND. myTime.EQ.endTime
119            IF ( dump2fileNow .OR.       &                    .AND. freqSec.GE.0. ) dump2fileNow = .TRUE.
120       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN            IF ( dump2fileNow ) THEN
121              write2file = .TRUE.              write2file = .TRUE.
122              CALL DIAGSTATS_OUTPUT(n,wrTime,wrIter,myThid)              CALL DIAGSTATS_OUTPUT(n,wrTime,wrIter,myThid)
123            ENDIF            ENDIF
# Line 164  C--     Clear storage space: Line 144  C--     Clear storage space:
144            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
145       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
146  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
147            if( useFIZHI) then            IF ( useFIZHI ) THEN
148             write(tagname,'(A,I2.2)')'diagtag',n             WRITE(tagname,'(A,I2.2)')'diagtag',n
149             dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
           endif  
 #endif  
   
 #ifdef ALLOW_CAL  
           IF ( calendarDumps .AND. (  
      &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.  
      &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN  
 C--   Convert approximate months (30-31 days) and years (360-372 days)  
 C     to exact calendar months and years.  
            dump2fileNow = .FALSE.  
 C-    Monthly freqSec:  
            IF( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 .AND.  
      &        (thisdate(1)-prevdate(1)).GT.50   ) dump2fileNow = .TRUE.  
 C-    Yearly  freqSec:  
            IF( freqSec.GE.31104000 .AND. freqSec.LE.31968000 .AND.  
      &        (thisdate(1)-prevdate(1)).GT.5000 ) dump2fileNow = .TRUE.  
150            ENDIF            ENDIF
151  #endif  #endif
152    #ifdef ALLOW_CAL
153            IF ( dump2fileNow .OR.            IF ( useCAL ) THEN
154       &        (myTime.EQ.endTime .AND. dumpatlast)              CALL CAL_TIME2DUMP( freqSec, deltaTClock,
155       &       ) CALL DIAGNOSTICS_CLEAR(n,myThid)       U                          dump2fileNow,
156         I                          myTime, myIter, myThid )
157              ENDIF
158    #endif /* ALLOW_CAL */
159              IF ( dumpAtLast .AND. myTime.EQ.endTime
160         &                    .AND. freqSec.GE.0. ) dump2fileNow = .TRUE.
161              IF ( dump2fileNow ) CALL DIAGNOSTICS_CLEAR(n,myThid)
162          ENDDO          ENDDO
163    
164          DO n = 1,diagSt_nbLists          DO n = 1,diagSt_nbLists
# Line 199  C-    Yearly  freqSec: Line 169  C-    Yearly  freqSec:
169            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
170       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
171  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
172           if( useFIZHI) then            IF ( useFIZHI ) THEN
173            write(tagname,'(A,I2.2)')'diagStg',n             WRITE(tagname,'(A,I2.2)')'diagStg',n
174            dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
175           endif            ENDIF
176  #endif  #endif
177            IF ( dump2fileNow .OR.            IF ( dumpAtLast .AND. myTime.EQ.endTime
178       &        (myTime.EQ.endTime .AND. dumpatlast)       &                    .AND. freqSec.GE.0. ) dump2fileNow = .TRUE.
179       &       ) CALL DIAGSTATS_CLEAR( n, myThid )            IF ( dump2fileNow ) CALL DIAGSTATS_CLEAR( n, myThid )
180          ENDDO          ENDDO
181    
182  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.22