/[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.17 by heimbach, Mon Sep 11 23:00:49 2000 UTC revision 1.28 by jmc, Thu Jun 12 18:29:35 2003 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
5    
6        SUBROUTINE DO_THE_MODEL_IO(  CBOP
7       I          forceOutput, myCurrentTime, myIter, myThid)  C     !ROUTINE: DO_THE_MODEL_IO
8  C     /==========================================================\  C     !INTERFACE:
9  C     | SUBROUTINE DO_THE_MODEL_IO                               |        SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid)
10  C     | o Controlling routine for IO in model main time-stepping |  C     !DESCRIPTION: \bv
11  C     |   loop.                                                  |  C     *==========================================================*
12  C     |==========================================================|  C     | SUBROUTINE DO_THE_MODEL_IO                                
13  C     | Many systems do not have thread safe IO so it is easier  |  C     | o Controlling routine for IO in model main time-stepping  
14  C     | to lump everything together and do dumping of fields     |  C     |   loop.                                                  
15  C     | and updating of forcing terms in a single place.         |  C     *==========================================================*
16  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  
17  C     | performed by thread 1 and that a process only writes out |  C     | to lump everything together and do dumping of fields      
18  C     | its data ( it does not know about anyone elses data!)    |  C     | and updating of forcing terms in a single place.          
19  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      
20  C     | containing all the data for all the processes. Only the  |  C     | performed by thread 1 and that a process only writes out  
21  C     | portion of data of interest to this process is actually  |  C     | its data ( it does not know about anyone elses data!)    
22  C     | loaded. To work well this assumes the existence of some  |  C     | Reading on the other hand is assumed to be from a file    
23  C     | reliable tool to join datasets together at the end of a  |  C     | containing all the data for all the processes. Only the  
24  C     | run - see joinds.p                                       |  C     | portion of data of interest to this process is actually  
25  C     \==========================================================/  C     | loaded. To work well this assumes the existence of some  
26        IMPLICIT NONE  C     | reliable tool to join datasets together at the end of a  
27    C     | run - see joinds.p                                        
28    C     *==========================================================*
29    C     \ev
30    
31    C     !USES:
32          IMPLICIT NONE
33  C     == Global variables ===  C     == Global variables ===
34  #include "SIZE.h"  #include "SIZE.h"
35  #include "EEPARAMS.h"  #include "EEPARAMS.h"
36  #include "PARAMS.h"  #include "PARAMS.h"
37  #include "DYNVARS.h"  #include "DYNVARS.h"
38  #include "CG2D.h"  cswdblk --- add ---
39    #ifdef ALLOW_BULK_FORCE
40    #include "BULKF.h"
41    #include "FFIELDS.h"
42    #endif
43    cswdblk -- end add ---
44    cswdice -- add ---
45    #ifdef ALLOW_THERM_SEAICE
46    #include "ICE.h"
47    #include "ICE_DIAGS.h"
48    #endif
49    cswdice -- end add ---
50    
51    
52    
53        LOGICAL  DIFFERENT_MULTIPLE        LOGICAL  DIFFERENT_MULTIPLE
54        EXTERNAL DIFFERENT_MULTIPLE        EXTERNAL DIFFERENT_MULTIPLE
55    
56    C     !INPUT/OUTPUT PARAMETERS:
57  C     == Routine arguments ==  C     == Routine arguments ==
 C     forceOutput - If .TRUE. then force I/O, indepenent of other tests  
58  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
59  C     myIter - Iteration number  C     myIter - Iteration number
60  C     myCurrentTime - Current time of simulation ( s )  C     myCurrentTime - Current time of simulation ( s )
       LOGICAL forceOutput  
61        INTEGER myThid        INTEGER myThid
62        INTEGER myIter        INTEGER myIter
63        _RL    myCurrentTime        _RL    myCurrentTime
64    
65  C     == Local variables ==  CEOP
66    
67  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
68  C--   all threads fields are ready.  C--   all threads fields are ready.
# Line 55  C--   all threads fields are ready. Line 73  C--   all threads fields are ready.
73    
74         _BARRIER         _BARRIER
75    
76           IF (debugMode) THEN
77  C--    Write "text-plots" of certain fields  C--    Write "text-plots" of certain fields
78         CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel  ' ,         CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel  ' ,
79       &                        Nr, myIter, myThid )       &                        Nr, myIter, myThid )
# Line 62  C--    Write "text-plots" of certain fie Line 81  C--    Write "text-plots" of certain fie
81       &                        Nr, myIter, myThid )       &                        Nr, myIter, myThid )
82         CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' ,         CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' ,
83       &                        Nr, myIter, myThid )       &                        Nr, myIter, myThid )
84         CALL PLOT_FIELD_XYRL( cg2d_x, 'Current cg2d_x ' ,         CALL PLOT_FIELD_XYRL( etaN  , 'Current etaN  ' ,
85       &                        myIter, myThid )       &                        myIter, myThid )
86           ENDIF
87    
88        ENDIF        ENDIF
89    
90  C--   Write model state to binary file  C--   Write model state to binary file
91        CALL WRITE_STATE( forceOutput, myCurrentTime, myIter, myThid )        CALL WRITE_STATE( myCurrentTime, myIter, myThid )
92    
93  #ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE  #ifdef ALLOW_TIMEAVE
94  C--   Do time averages  C--   Do time averages
95        IF (taveFreq.GT.0.) THEN        IF (taveFreq.GT.0.) THEN
96         CALL WRITE_TIME_AVERAGES( myCurrentTime, myIter, myThid )         CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid )
97        ENDIF        ENDIF
98  #endif  #endif
99    #ifdef ALLOW_AIM
100    C--   Do AIM time averages
101          IF (useAIM)
102         &  CALL AIM_WRITE_TAVE( myCurrentTime, myIter, myThid )
103    #endif                                                            
104    #ifdef ALLOW_LAND
105    C--   Do LAND time averages
106          IF (useLAND)
107         &  CALL LAND_WRITE_TAVE( myCurrentTime, myIter, myThid )
108    #endif                                                            
109    
110  #ifdef ALLOW_GMREDI  #ifdef ALLOW_GMREDI
111  C--   Do KPP diagnostics.  C--   Do KPP diagnostics.
# Line 89  C--   Do KPP diagnostics. Line 119  C--   Do KPP diagnostics.
119       & CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid )       & CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid )
120  #endif  #endif
121    
122    #ifdef ALLOW_SBO
123    C--   Do SBO diagnostics.
124          IF (useSBO) THEN
125             CALL SBO_CALC ( myCurrentTime, myIter, myThid )
126             CALL SBO_DIAGS( myCurrentTime, myIter, myThid )
127          ENDIF
128    #endif
129    
130    cswdblk ---  add ---
131    #ifdef ALLOW_BULK_FORCE
132    C--   Do bulkf diagnostics.
133          IF (useBulkforce)
134         & CALL BULKF_DIAGS( myCurrentTime, myIter, myThid )
135    #endif
136    cswdblk -- end add ---
137    
138    cswdice ---  add ---
139    #ifdef ALLOW_THERM_SEAICE
140    C--   Do seaice diagnostics.
141          IF (useThermSeaice)
142         & CALL ICE_DIAGS( myCurrentTime, myIter, myThid )
143    #endif
144    cswdice -- end add ---
145    
146        RETURN        RETURN
147        END        END
148    

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.22