/[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.45 by jmc, Thu Jan 7 23:48:01 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. ) i = i - 1
139            timeRec(1) = phase(listId) + freq(listId)*FLOAT(i)
140    c       if ( listId.eq.2 ) write(0,*) 'f',i,timeRec(1)/deltaTClock
141            timeRec(1) = MAX( timeRec(1), startTime )
142    
143    C     b) round off to nearest multiple of time-step:
144            timeRec(1) = (timeRec(1)-baseTime)/deltaTClock
145            i = NINT( timeRec(1) )
146    C     if just half way, NINT will return the next time-step: correct this
147            tmpLev = FLOAT(i) - 0.5 _d 0
148            IF ( timeRec(1).EQ.tmpLev ) i = i - 1
149            timeRec(1) = baseTime + deltaTClock*FLOAT(i)
150    c       if ( listId.eq.2 ) write(0,*) i,timeRec(1)/deltaTClock
151          ENDIF
152    
153  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
154  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)
155  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 548  C     and now use the missing values for
548                  klev = NINT(levs(k,listId))                  klev = NINT(levs(k,listId))
549                  DO j = 1-OLy,sNy+OLy                  DO j = 1-OLy,sNy+OLy
550                   DO i = 1-OLx,sNx+OLx                   DO i = 1-OLx,sNx+OLx
551                    IF ( _hFacC(I,J,klev,bi,bj) .EQ. 0. )                    IF ( maskC(i,j,klev,bi,bj) .EQ. 0. )
552       &                 qtmp1(i,j,k,bi,bj) = misvalLoc       &                 qtmp1(i,j,k,bi,bj) = misvalLoc
553                   ENDDO                   ENDDO
554                  ENDDO                  ENDDO
# Line 568  C     all MDSIO S/R, uses instead this s Line 604  C     all MDSIO S/R, uses instead this s
604  C     meta files but with more informations in it.  C     meta files but with more informations in it.
605              glf = globalFiles              glf = globalFiles
606              nRec = nfields(listId)*averageCycle(listId)              nRec = nfields(listId)*averageCycle(listId)
             timeRec(1) = myTime  
607              CALL MDS_WR_METAFILES(fn, prec, glf, .FALSE.,              CALL MDS_WR_METAFILES(fn, prec, glf, .FALSE.,
608       &              0, 0, nlevels(listId), ' ',       &              0, 0, nlevels(listId), ' ',
609       &              nfields(listId), flds(1,listId), 1, timeRec,       &              nfields(listId), flds(1,listId), nTimRec, timeRec,
610       &              nRec, myIter, myThid)       &              nRec, myIter, myThid)
611        ENDIF        ENDIF
612  #endif /*  ALLOW_MDSIO  */  #endif /*  ALLOW_MDSIO  */

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

  ViewVC Help
Powered by ViewVC 1.1.22