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

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

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

revision 1.42 by jmc, Tue Aug 4 18:00:29 2009 UTC revision 1.46 by jmc, Fri Jan 8 19:19:44 2010 UTC
# Line 62  C              diagnostic storage qdiag Line 62  C              diagnostic storage qdiag
62        COMMON /LOCAL_DIAGNOSTICS_OUT/ qtmp1        COMMON /LOCAL_DIAGNOSTICS_OUT/ qtmp1
63        _RL qtmp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,NrMax,nSx,nSy)        _RL qtmp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,NrMax,nSx,nSy)
64    
65        INTEGER i, j, k, lm, klev        INTEGER i, j, k, lm
66        INTEGER bi, bj        INTEGER bi, bj
67        INTEGER md, ndId, ip, im        INTEGER md, ndId, ip, im
68        INTEGER mate, mVec        INTEGER mate, mVec
# Line 75  C              diagnostic storage qdiag Line 75  C              diagnostic storage qdiag
75        CHARACTER*(MAX_LEN_FNAM) fn        CHARACTER*(MAX_LEN_FNAM) fn
76        CHARACTER*(MAX_LEN_MBUF) suff        CHARACTER*(MAX_LEN_MBUF) suff
77        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
78        INTEGER prec, nRec        INTEGER prec, nRec, nTimRec
79          _RL     timeRec(2)
80  #ifdef ALLOW_MDSIO  #ifdef ALLOW_MDSIO
81        LOGICAL glf        LOGICAL glf
       _RL timeRec(1)  
82  #endif  #endif
83  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
84        INTEGER ll, llMx, jj, jjMx        INTEGER ll, llMx, jj, jjMx
85        INTEGER ii        INTEGER ii, klev
86        CHARACTER*(MAX_LEN_FNAM) diag_mnc_bn        CHARACTER*(MAX_LEN_FNAM) diag_mnc_bn
87        INTEGER CW_DIMS, NLEN        INTEGER CW_DIMS, NLEN
88        PARAMETER ( CW_DIMS = 10 )        PARAMETER ( CW_DIMS = 10 )
# Line 104  C              diagnostic storage qdiag Line 104  C              diagnostic storage qdiag
104    
105  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
106    
107    C---  set file properties
108        ioUnit= standardMessageUnit        ioUnit= standardMessageUnit
109        undef = UNSET_RL        undef = UNSET_RL
110  #ifdef ALLOW_FIZHI  #ifdef ALLOW_FIZHI
# Line 114  c     IF ( useFIZHI ) undef = getcon('UN Line 115  c     IF ( useFIZHI ) undef = getcon('UN
115        ilen = ILNBLNK(fnames(listId))        ilen = ILNBLNK(fnames(listId))
116        WRITE( fn, '(A,A,A)' ) fnames(listId)(1:ilen),'.',suff(1:10)        WRITE( fn, '(A,A,A)' ) fnames(listId)(1:ilen),'.',suff(1:10)
117    
118    C--   Set time information:
119          IF ( freq(listId).LT.0. ) THEN
120    C-    Snap-shot: store a unique time (which is consistent with State-Var timing)
121            nTimRec = 1
122            timeRec(1) = myTime
123          ELSE
124    C-    Time-average: store the 2 edges of the time-averaging interval.
125    C      this time is consitent with intermediate Var (i.e., non-state, e.g, flux,
126    C      tendencies) timing. For State-Var, this is shifted by + halt time-step.
127            nTimRec = 2
128    
129    C-    end of time-averaging interval:
130            timeRec(2) = myTime
131    
132    C-    begining of time-averaging interval:
133    c       timeRec(1) = myTime - freq(listId)
134    C     a) find the time of the previous multiple of output freq:
135            timeRec(1) = myTime-deltaTClock*0.5 _d 0
136            timeRec(1) = (timeRec(1)-phase(listId))/freq(listId)
137            i = INT( timeRec(1) )
138            IF ( timeRec(1).LT.0. ) THEN
139              tmpLev = FLOAT(i)
140              IF ( timeRec(1).NE.tmpLev ) i = i - 1
141            ENDIF
142            timeRec(1) = phase(listId) + freq(listId)*FLOAT(i)
143    c       if ( listId.eq.2 ) write(0,*) 'f',i,timeRec(1)/deltaTClock
144            timeRec(1) = MAX( timeRec(1), startTime )
145    
146    C     b) round off to nearest multiple of time-step:
147            timeRec(1) = (timeRec(1)-baseTime)/deltaTClock
148            i = NINT( timeRec(1) )
149    C     if just half way, NINT will return the next time-step: correct this
150            tmpLev = FLOAT(i) - 0.5 _d 0
151            IF ( timeRec(1).EQ.tmpLev ) i = i - 1
152            timeRec(1) = baseTime + deltaTClock*FLOAT(i)
153    c       if ( listId.eq.2 ) write(0,*) i,timeRec(1)/deltaTClock
154          ENDIF
155    C--   Convert time to iteration number (debug)
156    c     DO i=1,nTimRec
157    c       timeRec(i) = timeRec(i)/deltaTClock
158    c     ENDDO
159    
160  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
161  C-- this is a trick to reverse the order of the loops on md (= field)  C-- this is a trick to reverse the order of the loops on md (= field)
162  C   and lm (= averagePeriod): binary output: lm loop inside md loop ;  C   and lm (= averagePeriod): binary output: lm loop inside md loop ;
# Line 512  C     and now use the missing values for Line 555  C     and now use the missing values for
555                  klev = NINT(levs(k,listId))                  klev = NINT(levs(k,listId))
556                  DO j = 1-OLy,sNy+OLy                  DO j = 1-OLy,sNy+OLy
557                   DO i = 1-OLx,sNx+OLx                   DO i = 1-OLx,sNx+OLx
558                    IF ( _hFacC(I,J,klev,bi,bj) .EQ. 0. )                    IF ( maskC(i,j,klev,bi,bj) .EQ. 0. )
559       &                 qtmp1(i,j,k,bi,bj) = misvalLoc       &                 qtmp1(i,j,k,bi,bj) = misvalLoc
560                   ENDDO                   ENDDO
561                  ENDDO                  ENDDO
# Line 568  C     all MDSIO S/R, uses instead this s Line 611  C     all MDSIO S/R, uses instead this s
611  C     meta files but with more informations in it.  C     meta files but with more informations in it.
612              glf = globalFiles              glf = globalFiles
613              nRec = nfields(listId)*averageCycle(listId)              nRec = nfields(listId)*averageCycle(listId)
             timeRec(1) = myTime  
614              CALL MDS_WR_METAFILES(fn, prec, glf, .FALSE.,              CALL MDS_WR_METAFILES(fn, prec, glf, .FALSE.,
615       &              0, 0, nlevels(listId), ' ',       &              0, 0, nlevels(listId), ' ',
616       &              nfields(listId), flds(1,listId), 1, timeRec,       &              nfields(listId), flds(1,listId), nTimRec, timeRec,
617       &              nRec, myIter, myThid)       &              nRec, myIter, myThid)
618        ENDIF        ENDIF
619  #endif /*  ALLOW_MDSIO  */  #endif /*  ALLOW_MDSIO  */

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.22