/[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.28 by jmc, Mon Mar 20 15:15:39 2006 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
# Line 50  C*************************************** Line 47  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)
74           endif            ENDIF
75  #endif  #endif
   
76  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
77            IF ( calendarDumps .AND. (            IF ( useCAL ) THEN
78       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.              CALL CAL_TIME2DUMP( freqSec, deltaTClock,
79       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN       U                          dump2fileNow,
80  C--   Convert approximate months (30-31 days) and years (360-372 days)       I                          myTime, myIter, myThid )
 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.  
81            ENDIF            ENDIF
82  #endif  #endif /* ALLOW_CAL */
   
83            IF ( dump2fileNow .OR.            IF ( dump2fileNow .OR.
84       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN
85              write2file = .TRUE.              write2file = .TRUE.
# Line 130  C       state-variable time-step: Line 109  C       state-variable time-step:
109            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
110       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
111  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
112           if( useFIZHI) then            IF( useFIZHI) THEN
113            write(tagname,'(A,I2.2)')'diagStg',n             write(tagname,'(A,I2.2)')'diagStg',n
114            dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
115           endif            ENDIF
116  #endif  #endif
   
117            IF ( dump2fileNow .OR.            IF ( dump2fileNow .OR.
118       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN       &        (myTime.EQ.endTime .AND. dumpatlast) ) THEN
119              write2file = .TRUE.              write2file = .TRUE.
# Line 164  C--     Clear storage space: Line 142  C--     Clear storage space:
142            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
143       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
144  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
145            if( useFIZHI) then            IF( useFIZHI) THEN
146             write(tagname,'(A,I2.2)')'diagtag',n             write(tagname,'(A,I2.2)')'diagtag',n
147             dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
148            endif            ENDIF
149  #endif  #endif
   
150  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
151            IF ( calendarDumps .AND. (            IF ( useCAL ) THEN
152       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.              CALL CAL_TIME2DUMP( freqSec, deltaTClock,
153       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN       U                          dump2fileNow,
154  C--   Convert approximate months (30-31 days) and years (360-372 days)       I                          myTime, myIter, myThid )
 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.  
155            ENDIF            ENDIF
156  #endif  #endif /* ALLOW_CAL */
   
157            IF ( dump2fileNow .OR.            IF ( dump2fileNow .OR.
158       &        (myTime.EQ.endTime .AND. dumpatlast)       &        (myTime.EQ.endTime .AND. dumpatlast)
159       &       ) CALL DIAGNOSTICS_CLEAR(n,myThid)       &       ) CALL DIAGNOSTICS_CLEAR(n,myThid)
# Line 199  C-    Yearly  freqSec: Line 167  C-    Yearly  freqSec:
167            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,            dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
168       &                                        wrTime, deltaTclock )       &                                        wrTime, deltaTclock )
169  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
170           if( useFIZHI) then            IF( useFIZHI) THEN
171            write(tagname,'(A,I2.2)')'diagStg',n             write(tagname,'(A,I2.2)')'diagStg',n
172            dump2fileNow = alarm2(tagname)             dump2fileNow = alarm2(tagname)
173           endif            ENDIF
174  #endif  #endif
175            IF ( dump2fileNow .OR.            IF ( dump2fileNow .OR.
176       &        (myTime.EQ.endTime .AND. dumpatlast)       &        (myTime.EQ.endTime .AND. dumpatlast)

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

  ViewVC Help
Powered by ViewVC 1.1.22