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

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

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


Revision 1.41 - (hide annotations) (download)
Thu Mar 11 14:49:55 2004 UTC (20 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint54d_post, checkpoint52l_post, checkpoint54, checkpoint53, checkpoint53d_post, checkpoint54b_post, checkpoint52m_post, checkpoint54a_pre, checkpoint53c_post, checkpoint54a_post, checkpoint53a_post, checkpoint53g_post, checkpoint53f_post, checkpoint52n_post, checkpoint53b_pre, checkpoint53b_post, checkpoint53d_pre, checkpoint54c_post
Changes since 1.40: +2 -2 lines
call land_write_diags replaces "land_write_tave"

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

  ViewVC Help
Powered by ViewVC 1.1.22