/[MITgcm]/MITgcm/pkg/timeave/timeave_statv_write.F
ViewVC logotype

Diff of /MITgcm/pkg/timeave/timeave_statv_write.F

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

revision 1.37 by jmc, Mon Mar 20 15:15:39 2006 UTC revision 1.38 by jmc, Sun Aug 6 23:30:33 2006 UTC
# Line 7  CBOP Line 7  CBOP
7  C     !ROUTINE: TIMEAVE_STATV_WRITE  C     !ROUTINE: TIMEAVE_STATV_WRITE
8    
9  C     !INTERFACE:  C     !INTERFACE:
10        SUBROUTINE TIMEAVE_STATV_WRITE(myTime, myIter, myThid)        SUBROUTINE TIMEAVE_STATV_WRITE( myTime, myIter, myThid )
11    
12  C     !DESCRIPTION:  C     !DESCRIPTION:
13  C     At the end of average period, write the time-average  C     At the end of average period, write the time-average
# Line 18  C     !USES: Line 18  C     !USES:
18  #include "SIZE.h"  #include "SIZE.h"
19  #include "EEPARAMS.h"  #include "EEPARAMS.h"
20  #include "PARAMS.h"  #include "PARAMS.h"
 #ifdef ALLOW_MNC  
 #include "MNC_PARAMS.h"  
 #endif  
21  #include "DYNVARS.h"  #include "DYNVARS.h"
22  #include "GRID.h"  #include "GRID.h"
23  #include "TIMEAVE_STATV.h"  #include "TIMEAVE_STATV.h"
24        LOGICAL  DIFFERENT_MULTIPLE  #ifdef ALLOW_MNC
25        EXTERNAL DIFFERENT_MULTIPLE  #include "MNC_PARAMS.h"
26        INTEGER  IO_ERRCOUNT  #endif
       EXTERNAL IO_ERRCOUNT  
27    
28  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
29  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
# Line 39  C     myTime - Current time of simulatio Line 35  C     myTime - Current time of simulatio
35  CEOP  CEOP
36    
37  #ifdef ALLOW_TIMEAVE  #ifdef ALLOW_TIMEAVE
38    C     Functions:
39          LOGICAL  DIFFERENT_MULTIPLE
40          EXTERNAL DIFFERENT_MULTIPLE
41          INTEGER  IO_ERRCOUNT
42          EXTERNAL IO_ERRCOUNT
43    
44  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
45  C     suff         :: Hold suffix part of a filename  C     suff         :: Hold suffix part of a filename
46  C     TimeAve      :: total time over average  C     TimeAve      :: total time over average
# Line 70  C     Final Time Averages and Dump Files Line 72  C     Final Time Averages and Dump Files
72          WRITE(suff,'(I10.10)') myIter          WRITE(suff,'(I10.10)') myIter
73    
74          DO bj = myByLo(myThid), myByHi(myThid)          DO bj = myByLo(myThid), myByHi(myThid)
75          DO bi = myBxLo(myThid), myBxHi(myThid)           DO bi = myBxLo(myThid), myBxHi(myThid)
76    
77  C         Normalize by integrated time  C         Normalize by integrated time
78            CALL TIMEAVE_NORMALIZ(uFluxtave,TimeAve_full,1 ,bi,bj,myThid)            CALL TIMEAVE_NORMALIZ(uFluxtave,TimeAve_full,1 ,bi,bj,myThid)
# Line 118  C         CALL TIMEAVE_NORMALIZ(hFacStav Line 120  C         CALL TIMEAVE_NORMALIZ(hFacStav
120       &         bi,bj,myThid)       &         bi,bj,myThid)
121            CALL TIMEAVE_NORMALIZ(ConvectCountTave,TimeAve_full,Nr,            CALL TIMEAVE_NORMALIZ(ConvectCountTave,TimeAve_full,Nr,
122       &         bi,bj,myThid)       &         bi,bj,myThid)
123          ENDDO           ENDDO
124          ENDDO          ENDDO
125    
126  C       Write to files  C       Write to files
127          _BARRIER          _BARRIER
 C       _BEGIN_MASTER( myThid )  
128    
129          IF (timeave_mdsio) THEN          IF (timeave_mdsio) THEN
130    
# Line 196  C         Reread IO error counter Line 197  C         Reread IO error counter
197    
198  C         Check for IO errors  C         Check for IO errors
199            IF ( endIOErrCount .NE. beginIOErrCount ) THEN            IF ( endIOErrCount .NE. beginIOErrCount ) THEN
200    C-          any thread that detects an error should report
201              WRITE(msgBuf,'(A)')  'S/R WRITE_TIME_AVERAGES'              WRITE(msgBuf,'(A)')  'S/R WRITE_TIME_AVERAGES'
202              CALL PRINT_ERROR( msgBuf, 1 )              CALL PRINT_ERROR( msgBuf, myThid )
203              WRITE(msgBuf,'(A)')  'Error writing out data'              WRITE(msgBuf,'(A)')  'Error writing out data'
204              CALL PRINT_ERROR( msgBuf, 1 )              CALL PRINT_ERROR( msgBuf, myThid )
205              WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter              WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
206              CALL PRINT_ERROR( msgBuf, 1 )              CALL PRINT_ERROR( msgBuf, myThid )
207            ELSE            ELSE
208    C-          normal case: 1 message is enough
209                _BEGIN_MASTER( myThid )
210              WRITE(msgBuf,'(A,I10)')              WRITE(msgBuf,'(A,I10)')
211       &           '// Time-average data written, t-step', myIter       &           '// Time-average data written, t-step', myIter
212              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
213       &           SQUEEZE_RIGHT, 1 )       &           SQUEEZE_RIGHT, myThid )
214              WRITE(msgBuf,'(A)')  ' '              WRITE(msgBuf,'(A)')  ' '
215              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
216       &           SQUEEZE_RIGHT, 1 )       &           SQUEEZE_RIGHT, myThid )
217                _END_MASTER( myThid )
218            ENDIF            ENDIF
219    
220          ENDIF          ENDIF
# Line 287  C         CALL MNC_CW_RL_W(pf,'tave',0,0 Line 292  C         CALL MNC_CW_RL_W(pf,'tave',0,0
292          ENDIF          ENDIF
293  #endif /* ALLOW_MNC */  #endif /* ALLOW_MNC */
294    
 C       _END_MASTER( myThid )  
295          _BARRIER          _BARRIER
296    
297          DO bj = myByLo(myThid), myByHi(myThid)          DO bj = myByLo(myThid), myByHi(myThid)

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.22