/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_switch_onoff.F
ViewVC logotype

Diff of /MITgcm/pkg/diagnostics/diagnostics_switch_onoff.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.7 by molod, Mon May 16 23:41:32 2005 UTC revision 1.12 by jmc, Sun Jun 26 16:51:49 2005 UTC
# Line 28  C     !USES: Line 28  C     !USES:
28  #include "PARAMS.h"  #include "PARAMS.h"
29  #include "DIAGNOSTICS_SIZE.h"  #include "DIAGNOSTICS_SIZE.h"
30  #include "DIAGNOSTICS.h"  #include "DIAGNOSTICS.h"
 #ifdef ALLOW_FIZHI  
 #include "chronos.h"  
 #endif  
31    
32  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
33  C     myTime     :: current Time of simulation ( s )  C     myTime     :: current Time of simulation ( s )
# Line 46  C      newIter :: future iteration numbe Line 43  C      newIter :: future iteration numbe
43  C      j,m,n   :: loop index  C      j,m,n   :: loop index
44  c     CHARACTER*(MAX_LEN_MBUF) msgBuf  c     CHARACTER*(MAX_LEN_MBUF) msgBuf
45  c     INTEGER newIter  c     INTEGER newIter
46        INTEGER j, m, n        INTEGER m, n, nd
47          INTEGER bi, bj, ip, iSp
48        LOGICAL time4SnapShot        LOGICAL time4SnapShot
49        _RL     phiSec, freqSec        _RL     phiSec, freqSec
50          LOGICAL dBugFlag
51  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
52        integer mmdd,hhmmss,nsecf2,alarm2        logical alarm2,alarm2next
53        character *9 tagname        character *9 tagname
54  #endif  #endif
55    
56        LOGICAL  DIFF_PHASE_MULTIPLE        LOGICAL  DIFF_PHASE_MULTIPLE
57        EXTERNAL DIFF_PHASE_MULTIPLE        EXTERNAL DIFF_PHASE_MULTIPLE
58    
       _BEGIN_MASTER(myThid)  
   
59  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
60    
61  c     newIter = 1 + myIter  c     newIter = 1 + myIter
# Line 73  C--    Select diagnostics list that uses Line 70  C--    Select diagnostics list that uses
70       &                                       myTime, deltaTclock )       &                                       myTime, deltaTclock )
71  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
72          if( useFIZHI) then          if( useFIZHI) then
          mmdd = int(freq(n))  
          hhmmss = int((freq(n) - int(freq(n)))*1.e6)  
          freqSec = nsecf2(hhmmss,mmdd,nymd)  
73           write(tagname,'(A,I2.2)')'diagtag',n           write(tagname,'(A,I2.2)')'diagtag',n
74           time4SnapShot = alarm2(tagname)           time4SnapShot = alarm2next(tagname,deltaT)
75          endif          endif
76  #endif  #endif
77    
78          IF ( time4SnapShot ) THEN          DO bj=myByLo(myThid), myByHi(myThid)
79  C--     switch ON diagnostics of output-stream # n           DO bi=myBxLo(myThid), myBxHi(myThid)
80            DO m=1,nActive(n)            IF ( time4SnapShot ) THEN
81              j = jdiag(m,n)  C--       switch ON diagnostics of output-stream # n
82  c           IF (ndiag(j).NE.0) WRITE(0,*) myIter,j,ndiag(j),' ->',0              DO m=1,nActive(n)
83              ndiag(j) = 0  c             nd = jdiag(m,n)
84            ENDDO  c             IF (ndiag(nd).NE.0) WRITE(0,*) myIter,nd,ndiag(nd),' ->',0
85          ELSE                ip = idiag(m,n)
86  C--     switch OFF diagnostics of output-stream # n                IF (ip.GT.0) ndiag(ip,bi,bj) = 0
87            DO m=1,nActive(n)              ENDDO
88              j = jdiag(m,n)            ELSE
89  c           IF (ndiag(j).NE.-1) WRITE(0,*) myIter,j,ndiag(j),' ->',-1  C--       switch OFF diagnostics of output-stream # n
90              ndiag(j) = -1              DO m=1,nActive(n)
91            ENDDO  c             nd = jdiag(m,n)
92          ENDIF  c             IF (ndiag(nd).NE.-1) WRITE(0,*) myIter,nd,ndiag(nd),' ->',-1
93                  ip = idiag(m,n)
94                  IF (ip.GT.0) ndiag(ip,bi,bj) = -1
95                ENDDO
96              ENDIF
97             ENDDO
98            ENDDO
99    
100         ENDIF         ENDIF
101        ENDDO        ENDDO
102    
103  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
104    
105        _END_MASTER(myThid)        DO n = 1,diagSt_nbLists
106    
107           IF ( diagSt_freq(n).LT.0. ) THEN
108    C--    Select diagnostics list that uses instantaneous output
109    
110            dBugFlag = debugLevel.GT.debLevB
111    
112            freqSec = diagSt_freq(n)
113            phiSec = diagSt_phase(n)
114            time4SnapShot = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
115         &                                       myTime, deltaTclock )
116    
117  C-jmc: do we need a "BARRIER" at this point ?  #ifdef ALLOW_FIZHI
118  c     _BARRIER          if( useFIZHI) then
119             write(tagname,'(A,I2.2)')'diagStg',n
120             time4SnapShot = alarm2(tagname)
121            endif
122    #endif
123    
124            DO bj=myByLo(myThid), myByHi(myThid)
125             DO bi=myBxLo(myThid), myBxHi(myThid)
126              dBugFlag = dBugFlag.AND.(bi.EQ.1.AND.bj.EQ.1.AND.myThid.EQ.1)
127              IF ( time4SnapShot ) THEN
128    C--     switch ON diagnostics of output-stream # n
129                DO m=1,diagSt_nbActv(n)
130                 iSp = iSdiag(m,n)
131                 IF (iSp.GT.0) THEN
132                   nd = jSdiag(m,n)
133                   IF (dBugFlag.AND.qSdiag(0,0,iSp,bi,bj).NE. 0.)
134         &          WRITE(0,'(I8,I4,3A,1PE10.3,A,I3)') myIter,
135         &           nd,' ',cdiag(nd),' :',qSdiag(0,0,iSp,bi,bj),' ->', 0
136                   qSdiag(0,0,iSp,bi,bj) = 0.
137                 ENDIF
138                ENDDO
139              ELSE
140    C--     switch OFF diagnostics of output-stream # n
141                DO m=1,diagSt_nbActv(n)
142                 iSp = iSdiag(m,n)
143                 IF (iSp.GT.0) THEN
144                   nd = jSdiag(m,n)
145                   IF (dBugFlag.AND.qSdiag(0,0,iSp,bi,bj).NE.-1.)
146         &          WRITE(0,'(I8,I4,3A,1PE10.3,A,I3)') myIter,
147         &           nd,' ',cdiag(nd),' :',qSdiag(0,0,iSp,bi,bj),' ->',-1
148                   qSdiag(0,0,iSp,bi,bj) = -1.
149                 ENDIF
150                ENDDO
151              ENDIF
152             ENDDO
153            ENDDO
154    
155           ENDIF
156          ENDDO
157    
158        RETURN        RETURN
159        END        END

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22