/[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.11 by dimitri, Sun Feb 20 19:41:11 2005 UTC revision 1.13 by molod, Fri May 13 18:32:46 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"
24    #ifdef ALLOW_FIZHI
25    #include "chronos.h"
26    #endif
27    
28        _RL     myTime        _RL     myTime
29        INTEGER myIter, myThid        INTEGER myIter, myThid
# Line 32  c =============== Line 35  c ===============
35        LOGICAL   dump2fileNow        LOGICAL   dump2fileNow
36        INTEGER thisdate(4), prevdate(4)        INTEGER thisdate(4), prevdate(4)
37        _RL     freqSec        _RL     freqSec
38          integer realfreq,nsecf2,yymmdd,hhmmss
39    
40        IF ( myIter.NE.nIter0 ) THEN        IF ( myIter.NE.nIter0 ) THEN
41          myItM1 = myIter - 1          myItM1 = myIter - 1
# Line 49  C-    Determine calendar dates for this Line 53  C-    Determine calendar dates for this
53  #endif  #endif
54    
55          DO n = 1,nlists          DO n = 1,nlists
56            IF ( freq(n).LT.0 ) THEN           realfreq = freq(n)
57              dump2fileNow = MOD(myItM1,-freq(n)) .EQ. INT(-freq(n)/2)  #ifdef ALLOW_FIZHI
58             if( useFIZHI) then
59              yymmdd = int(freq(n))
60              hhmmss = int((freq(n) - int(freq(n)))*1.e6)
61              realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock
62             endif
63    #endif
64    
65              IF ( realfreq.LT.0 ) THEN
66                dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2)
67  C--     write snap-shot with suffix = myIter to be consistent with  C--     write snap-shot with suffix = myIter to be consistent with
68  C       time-average diagnostics (e.g., freq=-1 & freq=1):  C       time-average diagnostics (e.g., freq=-1 & freq=1):
69  c           wrIter = myIter  c           wrIter = myIter
# Line 58  C--     write snap-shot with suffix = my Line 71  C--     write snap-shot with suffix = my
71  C       state-variable time-step:  C       state-variable time-step:
72              wrIter = myItM1              wrIter = myItM1
73            ELSE            ELSE
74              dump2fileNow = MOD(myIter,freq(n)) .EQ. 0              dump2fileNow = MOD(myIter,realfreq) .EQ. 0
75              wrIter = myIter              wrIter = myIter
76            ENDIF            ENDIF
77    
78  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
79            freqSec = freq(n) * deltaTClock            freqSec = realfreq * deltaTClock
80            IF ( calendarDumps .AND. (            IF ( calendarDumps .AND. (
81       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.       &     ( freqSec.GE. 2592000 .AND. freqSec.LE. 2678400 ) .OR.
82       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN       &     ( freqSec.GE.31104000 .AND. freqSec.LE.31968000 ))) THEN
# Line 87  C-    Yearly  freqSec: Line 100  C-    Yearly  freqSec:
100  C-      wait for everyone before setting arrays to zero:  C-      wait for everyone before setting arrays to zero:
101          _BARRIER          _BARRIER
102          DO n = 1,nlists          DO n = 1,nlists
103            IF ( freq(n).LT.0 ) THEN           realfreq = freq(n)
104              dump2fileNow = MOD(myItM1,-freq(n)) .EQ. INT(-freq(n)/2)  #ifdef ALLOW_FIZHI
105             if( useFIZHI) then
106              yymmdd = int(freq(n))
107              hhmmss = int((freq(n) - int(freq(n)))*1.e6)
108              realfreq = nsecf2(hhmmss,yymmdd,nymd) / deltaTclock
109             endif
110    #endif
111              IF ( realfreq.LT.0 ) THEN
112                dump2fileNow = MOD(myItM1,-realfreq) .EQ. INT(-realfreq/2)
113            ELSE            ELSE
114              dump2fileNow = MOD(myIter,freq(n)) .EQ. 0              dump2fileNow = MOD(myIter,realfreq) .EQ. 0
115            ENDIF            ENDIF
116            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)            IF ( dump2fileNow ) CALL CLRINDX(n,myThid)
117          ENDDO          ENDDO

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

  ViewVC Help
Powered by ViewVC 1.1.22