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

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

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


Revision 1.42 - (show annotations) (download)
Thu Sep 2 09:13:49 2004 UTC (19 years, 9 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint54e_post
Changes since 1.41: +13 -1 lines
o add calls for two new packages
  - pp81 (Packanowski and Philander, 1981), Richardson number and
    stratification dependent mixing
  - my82 (Mellor and Yamada, 1982) level 2 turbulence closure scheme

1 C $Header: /u/gcmpack/MITgcm/model/src/do_the_model_io.F,v 1.41 2004/03/11 14:49:55 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: DO_THE_MODEL_IO
9 C !INTERFACE:
10 SUBROUTINE DO_THE_MODEL_IO( myTime, myIter, myThid )
11 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 IMPLICIT NONE
34 C == Global variables ===
35 #include "SIZE.h"
36 #include "EEPARAMS.h"
37 #include "PARAMS.h"
38 #include "DYNVARS.h"
39
40
41 LOGICAL DIFFERENT_MULTIPLE
42 EXTERNAL DIFFERENT_MULTIPLE
43
44 C !INPUT/OUTPUT PARAMETERS:
45 C == Routine arguments ==
46 C myThid - Thread number for this instance of the routine.
47 C myIter - Iteration number
48 C myTime - Current time of simulation ( s )
49 INTEGER myThid
50 INTEGER myIter
51 _RL myTime
52
53 CEOP
54
55 C-- Generaly only thread 1 does IO here. It can not start until
56 C-- all threads fields are ready.
57 IF (debugMode) THEN
58 IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime, myTime-deltaTClock)
59 & ) THEN
60
61 _BARRIER
62
63 C-- Write "text-plots" of certain fields
64 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 CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' ,
71 & myIter, myThid )
72
73 ENDIF
74 ENDIF
75
76 C-- Write model state to binary file
77 CALL WRITE_STATE( myTime, myIter, myThid )
78
79 #ifdef ALLOW_TIMEAVE
80 C-- Do time averages
81 IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN
82 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
88 #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_DIAGS( 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
111 C-- Do KPP diagnostics.
112 IF (useGMRedi .AND. myIter.NE.nIter0 )
113 & CALL GMREDI_DIAGS( myTime, myIter, myThid )
114 #endif
115
116 #ifdef ALLOW_KPP
117 C-- Do KPP diagnostics.
118 IF (useKPP .AND. myIter.NE.nIter0 )
119 & CALL KPP_DO_DIAGS( myTime, myIter, myThid )
120 #endif
121
122 #ifdef ALLOW_PP81
123 C-- Do PP81 diagnostics.
124 IF (usePP81 .AND. myIter.NE.nIter0 )
125 & CALL PP81_DO_DIAGS( myTime, myIter, myThid )
126 #endif
127
128 #ifdef ALLOW_MY82
129 C-- Do MY82 diagnostics.
130 IF (useMY82 .AND. myIter.NE.nIter0 )
131 & CALL MY82_DO_DIAGS( myTime, myIter, myThid )
132 #endif
133
134 #ifdef ALLOW_SBO
135 C-- Do SBO diagnostics.
136 IF (useSBO .AND. myIter.NE.nIter0 ) THEN
137 CALL SBO_CALC ( myTime, myIter, myThid )
138 CALL SBO_DIAGS( myTime, myIter, myThid )
139 ENDIF
140 #endif
141
142 #ifdef ALLOW_SEAICE
143 IF ( useSEAICE ) THEN
144 CALL SEAICE_DO_DIAGS( myTime, myIter, myThid )
145 ENDIF
146 #endif /* ALLOW_SEAICE */
147
148 #ifdef ALLOW_BULK_FORCE
149 C-- Do bulkf diagnostics.
150 IF (useBulkForce .AND. myIter.NE.nIter0 )
151 & CALL BULKF_DIAGS( myTime, myIter, myThid )
152 #endif
153
154 #ifdef ALLOW_THSICE
155 C-- Do seaice diagnostics.
156 IF (useThSIce)
157 & CALL THSICE_DIAGS( myTime, myIter, myThid )
158 #endif
159
160 cswdptr --- add ---
161 #ifdef ALLOW_GCHEM
162 ceh3 ??? why is one package depending upon another here?
163 C-- Do ptracer diagnostics.
164 IF (usePTRACERS)
165 & CALL GCHEM_DIAGS( myTime, myIter, myThid )
166 #endif
167 cswdptr -- end add ---
168
169 #ifdef COMPONENT_MODULE
170 IF ( useCoupler )
171 & CALL CPL_WRITE_DIAGS( myTime, myIter, myThid )
172 #endif
173
174 #ifdef ALLOW_DIAGNOSTICS
175 IF ( usediagnostics ) call diagnostics_write (myThid, myIter)
176 #endif
177
178 RETURN
179 END

  ViewVC Help
Powered by ViewVC 1.1.22