/[MITgcm]/MITgcm/model/src/do_the_model_io.F
ViewVC logotype

Diff of /MITgcm/model/src/do_the_model_io.F

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

revision 1.19 by jmc, Tue Mar 6 16:51:02 2001 UTC revision 1.40 by dimitri, Tue Mar 2 08:45:46 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7        SUBROUTINE DO_THE_MODEL_IO(  CBOP
8       I          forceOutput, myCurrentTime, myIter, myThid)  C     !ROUTINE: DO_THE_MODEL_IO
9  C     /==========================================================\  C     !INTERFACE:
10  C     | SUBROUTINE DO_THE_MODEL_IO                               |        SUBROUTINE DO_THE_MODEL_IO( myTime, myIter, myThid )
11  C     | o Controlling routine for IO in model main time-stepping |  C     !DESCRIPTION: \bv
12  C     |   loop.                                                  |  C     *==========================================================*
13  C     |==========================================================|  C     | SUBROUTINE DO_THE_MODEL_IO                                
14  C     | Many systems do not have thread safe IO so it is easier  |  C     | o Controlling routine for IO in model main time-stepping  
15  C     | to lump everything together and do dumping of fields     |  C     |   loop.                                                  
16  C     | and updating of forcing terms in a single place.         |  C     *==========================================================*
17  C     | The approach to IO used here is that writes are only     |  C     | Many systems do not have thread safe IO so it is easier  
18  C     | performed by thread 1 and that a process only writes out |  C     | to lump everything together and do dumping of fields      
19  C     | its data ( it does not know about anyone elses data!)    |  C     | and updating of forcing terms in a single place.          
20  C     | Reading on the other hand is assumed to be from a file   |  C     | The approach to IO used here is that writes are only      
21  C     | containing all the data for all the processes. Only the  |  C     | performed by thread 1 and that a process only writes out  
22  C     | portion of data of interest to this process is actually  |  C     | its data ( it does not know about anyone elses data!)    
23  C     | loaded. To work well this assumes the existence of some  |  C     | Reading on the other hand is assumed to be from a file    
24  C     | reliable tool to join datasets together at the end of a  |  C     | containing all the data for all the processes. Only the  
25  C     | run - see joinds.p                                       |  C     | portion of data of interest to this process is actually  
26  C     \==========================================================/  C     | loaded. To work well this assumes the existence of some  
27        IMPLICIT NONE  C     | reliable tool to join datasets together at the end of a  
28    C     | run - see joinds.p                                        
29    C     *==========================================================*
30    C     \ev
31    
32    C     !USES:
33          IMPLICIT NONE
34  C     == Global variables ===  C     == Global variables ===
35  #include "SIZE.h"  #include "SIZE.h"
36  #include "EEPARAMS.h"  #include "EEPARAMS.h"
37  #include "PARAMS.h"  #include "PARAMS.h"
38  #include "DYNVARS.h"  #include "DYNVARS.h"
39    
40    
41        LOGICAL  DIFFERENT_MULTIPLE        LOGICAL  DIFFERENT_MULTIPLE
42        EXTERNAL DIFFERENT_MULTIPLE        EXTERNAL DIFFERENT_MULTIPLE
43    
44    C     !INPUT/OUTPUT PARAMETERS:
45  C     == Routine arguments ==  C     == Routine arguments ==
 C     forceOutput - If .TRUE. then force I/O, indepenent of other tests  
46  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
47  C     myIter - Iteration number  C     myIter - Iteration number
48  C     myCurrentTime - Current time of simulation ( s )  C     myTime - Current time of simulation ( s )
       LOGICAL forceOutput  
49        INTEGER myThid        INTEGER myThid
50        INTEGER myIter        INTEGER myIter
51        _RL    myCurrentTime        _RL     myTime
52    
53  C     == Local variables ==  CEOP
54    
55  C--   Generaly only thread 1 does IO here. It can not start until  C--   Generaly only thread 1 does IO here. It can not start until
56  C--   all threads fields are ready.  C--   all threads fields are ready.
57        IF (        IF (debugMode) THEN
58       &  DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,         IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime, myTime-deltaTClock)
59       &                     myCurrentTime-deltaTClock)       &    ) THEN
      & ) THEN  
60    
61         _BARRIER         _BARRIER
62    
# Line 65  C--    Write "text-plots" of certain fie Line 70  C--    Write "text-plots" of certain fie
70         CALL PLOT_FIELD_XYRL( etaN  , 'Current etaN  ' ,         CALL PLOT_FIELD_XYRL( etaN  , 'Current etaN  ' ,
71       &                        myIter, myThid )       &                        myIter, myThid )
72    
73           ENDIF
74        ENDIF        ENDIF
75    
76  C--   Write model state to binary file  C--   Write model state to binary file
77        CALL WRITE_STATE( forceOutput, myCurrentTime, myIter, myThid )        CALL WRITE_STATE( myTime, myIter, myThid )
78    
79  #ifdef ALLOW_TIMEAVE  #ifdef ALLOW_TIMEAVE
80  C--   Do time averages  C--   Do time averages
81        IF (taveFreq.GT.0.) THEN        IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN
82         CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid )         CALL TIMEAVE_STATV_WRITE( myTime, myIter, myThid )
83    #ifdef ALLOW_PTRACERS
84           IF ( usePTRACERS )
85         & CALL PTRACERS_STATV_WRITE( myTime, myIter, myThid )
86    #endif
87        ENDIF        ENDIF
88  #endif  #endif
89    
90    #ifdef ALLOW_FIZHI
91          if(useFIZHI) call fizhi_write_state( myTime, myIter, myThid )
92    #endif
93    
94    #ifdef ALLOW_AIM
95    C--   Do AIM time averages
96          IF ( useAIM )
97         &  CALL AIM_WRITE_TAVE( myTime, myIter, myThid )
98    #endif                                                            
99    #ifdef ALLOW_LAND
100    C--   Do LAND time averages
101          IF ( useLAND )
102         &  CALL LAND_WRITE_TAVE( myTime, myIter, myThid )
103    #endif                                                            
104    
105    #ifdef ALLOW_OBCS
106          IF (useOBCS .AND. myIter.NE.nIter0 )
107         & CALL OBCS_DIAGS( myTime, myIter, myThid )
108    #endif
109    
110  #ifdef ALLOW_GMREDI  #ifdef ALLOW_GMREDI
111  C--   Do KPP diagnostics.  C--   Do KPP diagnostics.
112        IF (useGMRedi)        IF (useGMRedi .AND. myIter.NE.nIter0 )
113       & CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid )       & CALL GMREDI_DIAGS( myTime, myIter, myThid )
114  #endif  #endif
115    
116  #ifdef ALLOW_KPP  #ifdef ALLOW_KPP
117  C--   Do KPP diagnostics.  C--   Do KPP diagnostics.
118        IF (useKPP)        IF (useKPP .AND. myIter.NE.nIter0 )
119       & CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid )       & CALL KPP_DO_DIAGS( myTime, myIter, myThid )
120    #endif
121    
122    #ifdef ALLOW_SBO
123    C--   Do SBO diagnostics.
124          IF (useSBO .AND. myIter.NE.nIter0 ) THEN
125             CALL SBO_CALC ( myTime, myIter, myThid )
126             CALL SBO_DIAGS( myTime, myIter, myThid )
127          ENDIF
128    #endif
129    
130    #ifdef  ALLOW_SEAICE
131            IF ( useSEAICE ) THEN
132               CALL SEAICE_DO_DIAGS( myTime, myIter, myThid )
133            ENDIF
134    #endif  /* ALLOW_SEAICE */
135    
136    #ifdef ALLOW_BULK_FORCE
137    C--   Do bulkf diagnostics.
138          IF (useBulkForce .AND. myIter.NE.nIter0 )
139         & CALL BULKF_DIAGS( myTime, myIter, myThid )
140    #endif
141    
142    #ifdef ALLOW_THSICE
143    C--   Do seaice diagnostics.
144          IF (useThSIce)
145         & CALL THSICE_DIAGS( myTime, myIter, myThid )
146    #endif
147    
148    cswdptr ---  add ---
149    #ifdef ALLOW_GCHEM
150    ceh3 ???  why is one package depending upon another here?
151    C--   Do ptracer diagnostics.
152          IF (usePTRACERS)
153         & CALL GCHEM_DIAGS( myTime, myIter, myThid )
154    #endif
155    cswdptr -- end add ---
156    
157    #ifdef COMPONENT_MODULE
158          IF ( useCoupler )
159         &  CALL CPL_WRITE_DIAGS( myTime, myIter, myThid )
160    #endif
161    
162    #ifdef ALLOW_DIAGNOSTICS
163          IF ( usediagnostics ) call diagnostics_write (myThid, myIter)
164  #endif  #endif
165    
166        RETURN        RETURN
167        END        END
   

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.22