1 |
adcroft |
1.1 |
C |
2 |
|
|
C Invocation from WRAPPER level... |
3 |
jmc |
1.2 |
C |
4 |
adcroft |
1.1 |
C | |
5 |
|
|
C |-THE_MODEL_MAIN :: Primary driver for the MITgcm algorithm |
6 |
|
|
C | :: Called from WRAPPER level numerical |
7 |
jmc |
1.2 |
C | :: code invocation routine. On entry |
8 |
adcroft |
1.1 |
C | :: to THE_MODEL_MAIN separate thread and |
9 |
|
|
C | :: separate processes will have been established. |
10 |
|
|
C | :: Each thread and process will have a unique ID |
11 |
|
|
C | :: but as yet it will not be associated with a |
12 |
|
|
C | :: specific region in decomposed discrete space. |
13 |
|
|
C | |
14 |
jmc |
1.2 |
C |-INITIALISE_FIXED :: Set fixed model arrays such as topography, |
15 |
adcroft |
1.1 |
C | | :: grid, solver matrices etc.. |
16 |
jmc |
1.2 |
C | | |
17 |
adcroft |
1.1 |
C | |-INI_PARMS :: Routine to set kernel model parameters. |
18 |
jmc |
1.2 |
C | | :: Kernel parameters are read from file "data" |
19 |
|
|
C | | :: in directory in which code executes. |
20 |
|
|
C | | |
21 |
|
|
C | |-PACKAGES_BOOT :: Start up the optional package environment. |
22 |
|
|
C | | :: Runtime selection of active packages. |
23 |
|
|
C | |-PACKAGES_READPARMS :: read all packages input parameter file |
24 |
|
|
C | | |- ${PKG}_READPARMS |
25 |
adcroft |
1.1 |
C | | |
26 |
jmc |
1.2 |
C | |-SET_PARMS :: Finalise model parameter setting (if fct of pkg usage) |
27 |
adcroft |
1.1 |
C | | |
28 |
jmc |
1.2 |
C | |-INI_MODEL_IO :: Initialise Input/Ouput setting |
29 |
|
|
C | | |-MNC_INIT |
30 |
|
|
C | | |-MNC_CW_INIT |
31 |
|
|
C | | | |
32 |
|
|
C | | |-MON_INIT :: Initialises monitor pacakge ( see pkg/monitor ) |
33 |
|
|
C | | |
34 |
|
|
C | |-INI_GRID :: Control grid array (vert. and hori.) initialisation. |
35 |
|
|
C | | | :: Grid arrays are held and described in GRID.h. |
36 |
|
|
C | | |-LOAD_GRID_SPACING :: Load grid spacing (vector) from files |
37 |
|
|
C | | |-INI_VERTICAL_GRID :: Set up vertical grid and coordinate |
38 |
adcroft |
1.1 |
C | | |-INI_CARTESIAN_GRID :: Cartesian horiz. grid initialisation |
39 |
|
|
C | | | :: (calculate grid from kernel parameters). |
40 |
jmc |
1.2 |
C | | |-INI_SPHERICAL_POLAR_GRID :: Spherical polar horiz. grid setting |
41 |
|
|
C | | | :: (calculate grid from kernel parameters). |
42 |
adcroft |
1.1 |
C | | |-INI_CURVILINEAR_GRID :: General orthogonal, structured horiz. |
43 |
jmc |
1.2 |
C | | | :: grid initialisations. ( input from raw |
44 |
|
|
C | | | :: grid files, LONC.bin, DXF.bin etc... ) |
45 |
|
|
C | | |-INI_CYLINDER_GRID :: Cylindrical horiz. grid setting |
46 |
|
|
C | | |
47 |
|
|
C | |-LOAD_REF_FILES :: |
48 |
|
|
C | |-INI_EOS :: |
49 |
|
|
C | |-SET_REF_STATE :: |
50 |
|
|
C | |-SET_GRID_FACTORS :: |
51 |
adcroft |
1.1 |
C | | |
52 |
jmc |
1.2 |
C | |-INI_DEPTHS :: Read (from "bathyFile") or set bathymetry/orography. |
53 |
adcroft |
1.1 |
C | |-INI_MASKS_ETC :: Derive horizontal and vertical cell fractions and |
54 |
|
|
C | | :: land masking for solid-fluid boundaries. |
55 |
|
|
C | | |
56 |
jmc |
1.2 |
C | |-PACKAGES_INIT_FIXED :: do all packages fixed-initialisation setting |
57 |
|
|
C | | |- ${PKG}_INIT_FIXED |
58 |
|
|
C | | |
59 |
|
|
C | |-INI_GLOBAL_DOMAIN |
60 |
adcroft |
1.1 |
C | |-INI_LINEAR_PHSURF :: Set ref. surface Bo_surf |
61 |
|
|
C | | |
62 |
|
|
C | |-INI_CORI :: Set coriolis term. zero, f-plane, beta-plane, |
63 |
|
|
C | | :: sphere optins are coded. |
64 |
jmc |
1.2 |
C | |-INI_CG2D :: 2d con. grad solver initialisation. |
65 |
|
|
C | |-INI_CG3D :: 3d con. grad solver initialisation. |
66 |
|
|
C | | |
67 |
|
|
C | |-CONFIG_SUMMARY :: Provide synopsis of kernel setup. Includes |
68 |
|
|
C | | :: annotated table of kernel parameter settings. |
69 |
|
|
C | | |
70 |
|
|
C | |-PACKAGES_CHECK :: call each package configuration checking S/R |
71 |
|
|
C | | |- ${PKG}_CHECK |
72 |
adcroft |
1.1 |
C | | |
73 |
jmc |
1.2 |
C | |-CONFIG_CHECK :: Check config and parameter consistency. |
74 |
adcroft |
1.1 |
C | | |
75 |
jmc |
1.2 |
C | |-WRITE_GRID |
76 |
|
|
C | |-CPL_EXCH_CONFIGS |
77 |
adcroft |
1.1 |
C | |
78 |
jmc |
1.2 |
C |-CTRL_UNPACK :: Control vector support package. see pkg/ctrl |
79 |
|
|
C |-COST_DEPENDENT_INIT :: |
80 |
adcroft |
1.1 |
C | |
81 |
|
|
C |-ADTHE_MAIN_LOOP :: Derivative evaluating form of main time stepping loop |
82 |
jmc |
1.2 |
C ! :: Automatically generated by TAMC/TAF. |
83 |
adcroft |
1.1 |
C | |
84 |
jmc |
1.2 |
C |-THE_MAIN_LOOP :: Main timestepping loop routine. |
85 |
adcroft |
1.1 |
C | | |
86 |
jmc |
1.2 |
C | |-INITIALISE_VARIA :: Set the initial conditions for time evolving |
87 |
adcroft |
1.1 |
C | | | |
88 |
jmc |
1.2 |
C #ifdef ALLOW_AUTODIFF |
89 |
|
|
C | | |-INI_DEPTHS \ |
90 |
|
|
C | | |-CTRL_DEPTH_INI \ |
91 |
|
|
C | | |-UPDATE_MASKS_ETC } ALLOW_DEPTH_CONTROL case |
92 |
|
|
C | | |-UPDATE_CG2D / |
93 |
|
|
C #endif |
94 |
|
|
C | | |-INI_NLFS_VARS :: Initialise all Non-Lin Free-Surf arrays (SURFACE.h) |
95 |
|
|
C | | |-INI_DYNVARS :: Initialise to zero all DYNVARS.h arrays |
96 |
|
|
C | | |-INI_NH_VARS :: Initialise to zero all NH_VARS.h arrays |
97 |
adcroft |
1.1 |
C | | | |
98 |
|
|
C | | |-INI_FIELDS :: Control initialising model fields to non-zero |
99 |
|
|
C | | | |-INI_VEL :: Initialize 3D flow field. |
100 |
|
|
C | | | |-INI_THETA :: Set model initial temperature field. |
101 |
|
|
C | | | |-INI_SALT :: Set model initial salinity field. |
102 |
|
|
C | | | |-INI_PSURF :: Set model initial free-surface height/pressure. |
103 |
jmc |
1.2 |
C | | | |-READ_PICKUP |
104 |
adcroft |
1.1 |
C | | | |
105 |
jmc |
1.2 |
C | | |-INI_MIXING :: Initialise diapycnal diffusivity. |
106 |
|
|
C | | |-TAUEDDY_INIT_VARIA |
107 |
adcroft |
1.1 |
C | | | |
108 |
jmc |
1.2 |
C | | |-INI_FORCING :: initialise forcing fields |
109 |
|
|
C | | |-INI_FORCING :: Set model initial forcing fields. |
110 |
|
|
C | | | | :: Either set in-line or from file as shown. |
111 |
adcroft |
1.1 |
C | | | |-READ_FLD_XY_RS(zonalWindFile) |
112 |
|
|
C | | | |-READ_FLD_XY_RS(meridWindFile) |
113 |
jmc |
1.2 |
C | | | |-READ_FLD_XY_RS(surfQnetFile) |
114 |
adcroft |
1.1 |
C | | | |-READ_FLD_XY_RS(EmPmRfile) |
115 |
|
|
C | | | |-READ_FLD_XY_RS(thetaClimFile) |
116 |
|
|
C | | | |-READ_FLD_XY_RS(saltClimFile) |
117 |
|
|
C | | | |-READ_FLD_XY_RS(surfQswFile) |
118 |
|
|
C | | | |
119 |
jmc |
1.2 |
C | | |-AUTODIFF_INIT_VARIA |
120 |
|
|
C | | | |
121 |
|
|
C | | |-PACKAGES_INIT_VARIABLES :: Does initialisation of time evolving |
122 |
|
|
C | | | | ${PKG}_INIT_VARIA :: package data. |
123 |
|
|
C | | | |
124 |
|
|
C | | |-COST_INIT_VARIA |
125 |
|
|
C | | |-CONVECTIVE_ADJUSTMENT_INI |
126 |
|
|
C | | | |
127 |
|
|
C | | |-CALC_R_STAR :: Calculate the new level thickness factor (r* coord) |
128 |
|
|
C | | |-UPDATE_R_STAR :: Update the level thickness fraction (r* coord). |
129 |
|
|
C | | |-UPDATE_SIGMA :: Update the level thickness fraction (sigma-coord). |
130 |
adcroft |
1.1 |
C | | |-CALC_SURF_DR :: Calculate the new surface level thickness. |
131 |
|
|
C | | |-UPDATE_SURF_DR :: Update the surface-level thickness fraction. |
132 |
jmc |
1.2 |
C | | | |
133 |
adcroft |
1.1 |
C | | |-UPDATE_CG2D :: Update 2d conjugate grad. for Free-Surf. |
134 |
jmc |
1.2 |
C | | | |
135 |
|
|
C | | |-INTEGR_CONTINUITY :: Integrate the continuity Eqiuation |
136 |
|
|
C | | | |-INTEGRATE_FOR_W :: Integrate for vertical velocity |
137 |
|
|
C | | | |-OBCS_APPLY_W :: Open boundary package (see pkg/obcs). |
138 |
|
|
C | | | |-UPDATE_ETAH :: Update Surface height/pressure |
139 |
|
|
C | | | |
140 |
|
|
C | | |-CALC_R_STAR :: Calculate the new level thickness factor (r* coord) |
141 |
|
|
C | | |-CALC_SURF_DR :: Calculate the new surface level thickness. |
142 |
|
|
C | | | |
143 |
|
|
C | | |-STATE_SUMMARY :: Summarise model prognostic variables. |
144 |
|
|
C | | | |
145 |
|
|
C | | |-MONITOR :: Monitor state (see pkg/monitor) |
146 |
|
|
C | | | |
147 |
|
|
C | | |-DO_STATEVARS_TAVE :: Time averaging package ( see pkg/timeave ). |
148 |
|
|
C | | | |-TIMEAVE_STATVARS :: |
149 |
|
|
C | | | |-PTRACERS_TIMEAVE :: |
150 |
|
|
C | | | |
151 |
|
|
C | | |-DO_THE_MODEL_IO :: Controlling routine for IO |
152 |
|
|
C | | | |-WRITE_STATE :: Write model state variables. |
153 |
|
|
C | | | |-TIMEAVE_STATV_WRITE :: Write Time averaged output (see pkg/timeave) |
154 |
|
|
C | | | |-FIZHI_WRITE_STATE |
155 |
|
|
C | | | |-AIM_WRITE_TAVE |
156 |
|
|
C | | | |-LAND_OUTPUT |
157 |
|
|
C | | | |-OBCS_OUTPUT |
158 |
|
|
C | | | |-GMREDI_OUTPUT |
159 |
|
|
C | | | |-KPP_OUTPUT |
160 |
|
|
C | | | |-PP81_OUTPUT |
161 |
|
|
C | | | |-KL10_OUTPUT |
162 |
|
|
C | | | |-MY82_OUTPUT |
163 |
|
|
C | | | |-OPPS_OUTPUT |
164 |
|
|
C | | | |-GGL90_OUTPUT |
165 |
|
|
C | | | |-SBO_CALC |
166 |
|
|
C | | | |-SBO_OUTPUT |
167 |
|
|
C | | | |-SEAICE_OUTPUT |
168 |
|
|
C | | | |-SHELFICE_OUTPUT |
169 |
|
|
C | | | |-BULKF_OUTPUT |
170 |
|
|
C | | | |-THSICE_OUTPUT |
171 |
|
|
C | | | |-PTRACERS_OUTPUT |
172 |
|
|
C | | | |-MATRIX_OUTPUT |
173 |
|
|
C | | | |-GCHEM_OUTPUT |
174 |
|
|
C | | | |-CPL_OUTPUT |
175 |
|
|
C | | | |-LAYERS_CALC |
176 |
|
|
C | | | |-LAYERS_OUTPUT |
177 |
|
|
C | | | |-DIAGNOSTICS_WRITE :: Write pkg/diagnostics output |
178 |
|
|
C | | | |
179 |
adcroft |
1.1 |
C====|>| **************************** |
180 |
|
|
C====|>| BEGIN MAIN TIMESTEPPING LOOP |
181 |
|
|
C====|>| **************************** |
182 |
jmc |
1.2 |
C | |-COST_AVERAGESFIELDS :: time-averaged Cost function terms (see pkg/cost) |
183 |
|
|
C | |-PROFILES_INLOOP :: |
184 |
|
|
C | / |
185 |
|
|
C | |-MAIN_DO_LOOP :: Open-AD case: Main timestepping loop routine |
186 |
|
|
C | \ otherwise: just call FORWARD_STEP |
187 |
|
|
C | | |
188 |
|
|
C/\ | |-FORWARD_STEP :: Step forward a time-step ( AT LAST !!! ) |
189 |
|
|
C/\ | | | |
190 |
|
|
C/\ | | |-LOAD_FIELDS_DRIVER :: control loading of input fields from files |
191 |
|
|
C/\ | | | |
192 |
|
|
C/\ | | |-CTRL_MAP_FORCING :: Control vector support package. (see pkg/ctrl) |
193 |
adcroft |
1.1 |
C/\ | | | |
194 |
jmc |
1.2 |
C/\ | | |-CPL_EXPORT_MY_DATA :: Send coupling fields to coupler |
195 |
|
|
C/\ | | |-CPL_IMPORT_EXTERNAL_DATA :: Receive coupling fields from coupler |
196 |
adcroft |
1.1 |
C/\ | | | |
197 |
jmc |
1.2 |
C/\ | | |-DO_ATMOSPHERIC_PHYS :: Atmospheric physics computation |
198 |
|
|
C/\ | | | |
199 |
|
|
C/\ | | |-DO_OCEANIC_PHYS :: Oceanic (& seaice) physics computation |
200 |
|
|
C/\ | | | |-OBCS_CALC :: Open boundary. package (see pkg/obcs). |
201 |
|
|
C/\ | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned |
202 |
adcroft |
1.1 |
C/\ | | | | :: forcing terms. |
203 |
jmc |
1.2 |
C/\ | | | |
204 |
|
|
C/\ | | |-GCHEM_CALC_TENDENCY :: geochemistry driver routine (see pkg/gchem) |
205 |
|
|
C/\ | | | |
206 |
|
|
C/\ | | |-THERMODYNAMICS :: (synchronous time-stepping) |
207 |
|
|
C/\ | | | theta, salt + tracer equations driver. |
208 |
|
|
C/\ | | | |-GMREDI_RESIDUAL_FLOW :: Get the flow field used to advect tracer |
209 |
|
|
C/\ | | | | |
210 |
|
|
C/\ | | | |-TEMP_INTEGRATE :: Step forward Prognostic Eq for Temperature. |
211 |
|
|
C/\ | | | | |-GAD_ADVECTION :: Generalised advection driver (multi-dim |
212 |
|
|
C/\ | | | | | advection case) (see pkg/gad). |
213 |
|
|
C/\ | | | | |-GAD_CALC_RHS :: Calculate Advection-Diffusion tendency terms |
214 |
|
|
C/\ | | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
215 |
|
|
C/\ | | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. |
216 |
|
|
C/\ | | | | |-CYCLE_AB_TRACER :: Cycle time-stepping arrays for tracer field |
217 |
|
|
C/\ | | | | |
218 |
|
|
C/\ | | | |-SALT_INTEGRATE :: Step forward Prognostic Eq for Salinity. |
219 |
|
|
C/\ | | | | | same sequence of calls as in TEMP_INTEGRATE |
220 |
|
|
C/\ | | | | |
221 |
|
|
C/\ | | | |-PTRACERS_INTEGRATE :: Integrate other tracer(s) (see pkg/ptracers). |
222 |
|
|
C/\ | | | | | same sequence of calls as in TEMP_INTEGRATE |
223 |
|
|
C/\ | | | | |-OBCS_APPLY_PTRACER :: Open boundary package for pTracers |
224 |
adcroft |
1.1 |
C/\ | | | | |
225 |
jmc |
1.2 |
C/\ | | | |-OBCS_APPLY_TS :: Open boundary package (see pkg/obcs ). |
226 |
adcroft |
1.1 |
C/\ | | | |
227 |
|
|
C/\ | | |-DYNAMICS :: Momentum equations driver. |
228 |
|
|
C/\ | | | | |
229 |
jmc |
1.2 |
C/\ | | | |-CALC_GRAD_PHI_SURF :: Calculate the gradient of the surface |
230 |
adcroft |
1.1 |
C/\ | | | | Potential anomaly. |
231 |
jmc |
1.2 |
C/\ | | | |-CALC_VISCOSITY :: Calculate net vertical viscosity |
232 |
|
|
C/\ | | | |-CALC_PHI_HYD :: Integrate the hydrostatic relation. |
233 |
|
|
C/\ | | | |-MOM_FLUXFORM :: Flux form mom eqn. package (pkg/mom_fluxform) |
234 |
|
|
C/\ | | | |-MOM_VECINV :: Vector invariant form mom eqn (pkg/mom_vecinv) |
235 |
|
|
C/\ | | | |-TIMESTEP :: Step momentum fields forward in time |
236 |
|
|
C/\ | | | |-OBCS_APPLY_UV :: Open boundary package (see pkg/obcs). |
237 |
|
|
C/\ | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. |
238 |
|
|
C/\ | | | |-CALC_GW :: vert. momentum tendency terms (Non-Hydrostatic) |
239 |
adcroft |
1.1 |
C/\ | | | |
240 |
|
|
C/\ | | |-UPDATE_SURF_DR :: Update the surface-level thickness fraction. |
241 |
jmc |
1.2 |
C/\ | | |-UPDATE_R_STAR :: Update the level thickness fraction. |
242 |
adcroft |
1.1 |
C/\ | | |-UPDATE_CG2D :: Update 2d conjugate grad. for Free-Surf. |
243 |
|
|
C/\ | | | |
244 |
jmc |
1.2 |
C/\ | | |-SOLVE_FOR_PRESSURE :: Find surface pressure. |
245 |
adcroft |
1.1 |
C/\ | | | |-CG2D :: Two-dim pre-con. conjugate-gradient. |
246 |
|
|
C/\ | | | |-CG3D :: Three-dim pre-con. conjugate-gradient solver. |
247 |
|
|
C/\ | | | |
248 |
jmc |
1.2 |
C/\ | | |-MOMENTUM_CORRECTION_STEP :: Finalise momentum stepping |
249 |
adcroft |
1.1 |
C/\ | | | |-CALC_GRAD_PHI_SURF :: Return DDx and DDy of surface pressure |
250 |
|
|
C/\ | | | |-CORRECTION_STEP :: Pressure correction to momentum |
251 |
jmc |
1.2 |
C/\ | | | |-OBCS_APPLY_UV :: Open boundary package (see pkg/obcs). |
252 |
|
|
C/\ | | | |
253 |
|
|
C/\ | | |-INTEGR_CONTINUITY :: Integrate continuity equation |
254 |
adcroft |
1.1 |
C/\ | | | |
255 |
jmc |
1.2 |
C/\ | | |-THERMODYNAMICS :: (staggered time-stepping) |
256 |
|
|
C/\ | | | theta, salt + tracer equations driver. |
257 |
|
|
C/\ | | | |
258 |
|
|
C/\ | | |-TRACERS_CORRECTION_STEP :: Finalise tracer steppin: |
259 |
|
|
C/\ | | | apply filter, conv.adjustment |
260 |
adcroft |
1.1 |
C/\ | | | |
261 |
jmc |
1.2 |
C/\ | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if tracer |
262 |
|
|
C/\ | | | dependent tendencies calculated separately) |
263 |
adcroft |
1.1 |
C/\ | | | |
264 |
jmc |
1.2 |
C/\ | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions. |
265 |
adcroft |
1.1 |
C/\ | | | |
266 |
jmc |
1.2 |
C/\ | | |-MONITOR :: Monitor package (pkg/monitor). |
267 |
adcroft |
1.1 |
C/\ | | |-DO_THE_MODEL_IO :: Standard diagnostic I/O. |
268 |
jmc |
1.2 |
C/\ | | | |
269 |
|
|
C/\ | | |-DO_WRITE_PICKUP :: Write restart files. |
270 |
|
|
C | | |
271 |
adcroft |
1.1 |
C<===|=| ************************** |
272 |
|
|
C<===|=| END MAIN TIMESTEPPING LOOP |
273 |
|
|
C<===|=| ************************** |
274 |
jmc |
1.2 |
C | | |
275 |
|
|
C | |-COST_AVERAGESFIELDS :: time-averaged Cost function terms (see pkg/cost) |
276 |
|
|
C | |-PROFILES_INLOOP :: |
277 |
|
|
C | |-COST_FINAL :: Cost function package. (see pkg/cost) |
278 |
|
|
C | |
279 |
|
|
C |-CTRL_PACK :: Control vector support package. see pkg/ctrl |
280 |
adcroft |
1.1 |
C | |
281 |
jmc |
1.2 |
C |-GRDCHK_MAIN :: Gradient check package. see pkg/grdchk |
282 |
adcroft |
1.1 |
C | |
283 |
jmc |
1.2 |
C |-TIMER_PRINTALL :: Computational timing summary |
284 |
adcroft |
1.1 |
C | |
285 |
jmc |
1.2 |
C |-COMM_STATS :: Summarise inter-proc and inter-thread communication |
286 |
|
|
C :: events. |