1 |
dgoldberg |
1.1 |
C $Header: /u/gcmpack/MITgcm_contrib/shelfice_remeshing/code/forward_step.F,v 1.2 2015/08/07 10:35:32 dgoldberg Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
|
|
#ifdef ALLOW_AUTODIFF |
8 |
|
|
# include "AUTODIFF_OPTIONS.h" |
9 |
|
|
#endif |
10 |
|
|
#ifdef ALLOW_GENERIC_ADVDIFF |
11 |
|
|
# include "GAD_OPTIONS.h" |
12 |
|
|
#endif |
13 |
|
|
#ifdef ALLOW_GGL90 |
14 |
|
|
# include "GGL90_OPTIONS.h" |
15 |
|
|
#endif |
16 |
|
|
#ifdef ALLOW_GMREDI |
17 |
|
|
# include "GMREDI_OPTIONS.h" |
18 |
|
|
#endif |
19 |
|
|
#ifdef ALLOW_OBCS |
20 |
|
|
# include "OBCS_OPTIONS.h" |
21 |
|
|
#endif |
22 |
|
|
#ifdef ALLOW_THSICE |
23 |
|
|
# include "THSICE_OPTIONS.h" |
24 |
|
|
#endif |
25 |
|
|
#ifdef ALLOW_SEAICE |
26 |
|
|
# include "SEAICE_OPTIONS.h" |
27 |
|
|
#endif |
28 |
|
|
#ifdef ALLOW_PTRACERS |
29 |
|
|
# include "PTRACERS_OPTIONS.h" |
30 |
|
|
#endif |
31 |
|
|
#ifdef ALLOW_EXF |
32 |
|
|
# include "EXF_OPTIONS.h" |
33 |
|
|
#endif |
34 |
|
|
#ifdef ALLOW_STREAMICE |
35 |
|
|
# include "STREAMICE_OPTIONS.h" |
36 |
|
|
#endif |
37 |
|
|
#ifdef ALLOW_COST |
38 |
|
|
# include "COST_OPTIONS.h" |
39 |
|
|
#endif |
40 |
|
|
#ifdef ALLOW_CTRL |
41 |
|
|
# include "CTRL_OPTIONS.h" |
42 |
|
|
#endif |
43 |
|
|
#ifdef ALLOW_ECCO |
44 |
|
|
# include "ECCO_OPTIONS.h" |
45 |
|
|
#endif |
46 |
|
|
|
47 |
|
|
#define ALLOW_MOM_STEPPING |
48 |
|
|
#if ( defined (ALLOW_AUTODIFF) && defined (ALLOW_OFFLINE) ) |
49 |
|
|
# undef ALLOW_MOM_STEPPING |
50 |
|
|
#endif |
51 |
|
|
|
52 |
|
|
CBOP |
53 |
|
|
C !ROUTINE: FORWARD_STEP |
54 |
|
|
C !INTERFACE: |
55 |
|
|
SUBROUTINE FORWARD_STEP( iloop, myTime, myIter, myThid ) |
56 |
|
|
|
57 |
|
|
C !DESCRIPTION: \bv |
58 |
|
|
C *================================================================= |
59 |
|
|
C | SUBROUTINE forward_step |
60 |
|
|
C | o Step forward in time the model variables for one time-step |
61 |
|
|
C *================================================================= |
62 |
|
|
C | The algorithm... |
63 |
|
|
C | |
64 |
|
|
C | "Calculation of Gs" |
65 |
|
|
C | =================== |
66 |
|
|
C | This is where all the accelerations and tendencies (ie. |
67 |
|
|
C | physics, parameterizations etc...) are calculated |
68 |
|
|
C | rho = rho ( theta[n], salt[n] ) |
69 |
|
|
C | b = b(rho, theta) |
70 |
|
|
C | K31 = K31 ( rho ) |
71 |
|
|
C | Gu[n] = Gu( u[n], v[n], wVel, b, ... ) |
72 |
|
|
C | Gv[n] = Gv( u[n], v[n], wVel, b, ... ) |
73 |
|
|
C | Gt[n] = Gt( theta[n], u[n], v[n], wVel, K31, ... ) |
74 |
|
|
C | Gs[n] = Gs( salt[n], u[n], v[n], wVel, K31, ... ) |
75 |
|
|
C | |
76 |
|
|
C | "Time-stepping" or "Prediction" |
77 |
|
|
C | ================================ |
78 |
|
|
C | The models variables are stepped forward with the appropriate |
79 |
|
|
C | time-stepping scheme (currently we use Adams-Bashforth II) |
80 |
|
|
C | - For momentum, the result is always *only* a "prediction" |
81 |
|
|
C | in that the flow may be divergent and will be "corrected" |
82 |
|
|
C | later with a surface pressure gradient. |
83 |
|
|
C | - Normally for tracers the result is the new field at time |
84 |
|
|
C | level [n+1} *BUT* in the case of implicit diffusion the result |
85 |
|
|
C | is also *only* a prediction. |
86 |
|
|
C | - We denote "predictors" with an asterisk (*). |
87 |
|
|
C | U* = U[n] + dt x ( 3/2 Gu[n] - 1/2 Gu[n-1] ) |
88 |
|
|
C | V* = V[n] + dt x ( 3/2 Gv[n] - 1/2 Gv[n-1] ) |
89 |
|
|
C | theta[n+1] = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] ) |
90 |
|
|
C | salt[n+1] = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] ) |
91 |
|
|
C | With implicit diffusion: |
92 |
|
|
C | theta* = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] ) |
93 |
|
|
C | salt* = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] ) |
94 |
|
|
C | (1 + dt * K * d_zz) theta[n+1] = theta* |
95 |
|
|
C | (1 + dt * K * d_zz) salt[n+1] = salt* |
96 |
|
|
C | |
97 |
|
|
C | "Correction Step" |
98 |
|
|
C | ================= |
99 |
|
|
C | Here we update the horizontal velocities with the surface |
100 |
|
|
C | pressure such that the resulting flow is either consistent |
101 |
|
|
C | with the free-surface evolution or the rigid-lid: |
102 |
|
|
C | U[n] = U* + dt x d/dx P |
103 |
|
|
C | V[n] = V* + dt x d/dy P |
104 |
|
|
C | W[n] = W* + dt x d/dz P (NH mode) |
105 |
|
|
C *================================================================= |
106 |
|
|
C \ev |
107 |
|
|
|
108 |
|
|
C !CALLING SEQUENCE: |
109 |
|
|
C FORWARD_STEP |
110 |
|
|
C | |
111 |
|
|
C |-- AUTODIFF_INADMODE_UNSET |
112 |
|
|
C | |
113 |
|
|
C |-- RESET_NLFS_VARS |
114 |
|
|
C |-- UPDATE_R_STAR |
115 |
|
|
C |-- UPDATE_SURF_DR |
116 |
|
|
C | |
117 |
|
|
C |-- PTRACERS_SWITCH_ONOFF |
118 |
|
|
C | |
119 |
|
|
C |-- DIAGNOSTICS_SWITCH_ONOFF |
120 |
|
|
C |-- DO_STATEVARS_DIAGS |
121 |
|
|
C | |
122 |
|
|
C |-- NEST_CHILD_SETMEMO |
123 |
|
|
C |-- NEST_PARENT_IO_1 |
124 |
|
|
C | |
125 |
|
|
C |-- LOAD_FIELDS_DRIVER |
126 |
|
|
C | |
127 |
|
|
C |-- BULKF_FORCING |
128 |
|
|
C | |
129 |
|
|
C |-- CHEAPAML |
130 |
|
|
C | |
131 |
|
|
C |-- CTRL_MAP_FORCING |
132 |
|
|
C |-- DUMMY_IN_STEPPING |
133 |
|
|
C | |
134 |
|
|
C |-- CPL_EXPORT_MY_DATA |
135 |
|
|
C |-- CPL_IMPORT_EXTERNAL_DATA |
136 |
|
|
C | |
137 |
|
|
C |-- OASIS_PUT |
138 |
|
|
C |-- OASIS_GET |
139 |
|
|
C | |
140 |
|
|
C |-- EBM_DRIVER |
141 |
|
|
C | |
142 |
|
|
C |-- DO_ATMOSPHERIC_PHYS |
143 |
|
|
C | |
144 |
|
|
C |-- DO_OCEANIC_PHYS |
145 |
|
|
C | |
146 |
|
|
C |-- STREAMICE_TIMESTEP |
147 |
|
|
C | |
148 |
|
|
C |-- GCHEM_CALC_TENDENCY |
149 |
|
|
C | |
150 |
|
|
C |-- LONGSTEP_AVERAGE |
151 |
|
|
C |-- LONGSTEP_THERMODYNAMICS |
152 |
|
|
C | |
153 |
|
|
C |-- THERMODYNAMICS |
154 |
|
|
C | |
155 |
|
|
C |-- LONGSTEP_AVERAGE |
156 |
|
|
C |-- LONGSTEP_THERMODYNAMICS |
157 |
|
|
C | |
158 |
|
|
C |-- DO_STAGGER_FIELDS_EXCHANGES |
159 |
|
|
C | |
160 |
|
|
C |-- DYNAMICS |
161 |
|
|
C | |
162 |
|
|
C |-- MNC_UPDATE_TIME |
163 |
|
|
C | |
164 |
|
|
C |-- OFFLINE_FIELDS_LOAD |
165 |
|
|
C | |
166 |
|
|
C |-- UPDATE_R_STAR |
167 |
|
|
C |-- UPDATE_SIGMA |
168 |
|
|
C |-- UPDATE_SURF_DR |
169 |
|
|
C |-- UPDATE_CG2D |
170 |
|
|
C | |
171 |
|
|
C |-- SHAP_FILT_APPLY_UV |
172 |
|
|
C |-- ZONAL_FILT_APPLY_UV |
173 |
|
|
C | |
174 |
|
|
C |-- SOLVE_FOR_PRESSURE |
175 |
|
|
C | |
176 |
|
|
C |-- MOMENTUM_CORRECTION_STEP |
177 |
|
|
C | |
178 |
|
|
C |-- INTEGR_CONTINUITY |
179 |
|
|
C | |
180 |
|
|
C |-- CALC_R_STAR |
181 |
|
|
C |-- CALC_SURF_DR |
182 |
|
|
C | |
183 |
|
|
C |-- DO_STAGGER_FIELDS_EXCHANGES |
184 |
|
|
C | |
185 |
|
|
C |-- DO_STATEVARS_DIAGS |
186 |
|
|
C | |
187 |
|
|
C |-- THERMODYNAMICS |
188 |
|
|
C | |
189 |
|
|
C |-- TRACERS_CORRECTION_STEP |
190 |
|
|
C | |
191 |
|
|
C |-- LONGSTEP_AVERAGE |
192 |
|
|
C |-- LONGSTEP_THERMODYNAMICS |
193 |
|
|
C | |
194 |
|
|
C |-- GCHEM_FORCING_SEP |
195 |
|
|
C | |
196 |
|
|
C |-- DO_FIELDS_BLOCKING_EXCHANGES |
197 |
|
|
C | |
198 |
|
|
C |-- DO_STATEVARS_DIAGS |
199 |
|
|
C | |
200 |
|
|
C |-- GRIDALT_UPDATE |
201 |
|
|
C |-- STEP_FIZHI_CORR |
202 |
|
|
C | |
203 |
|
|
C |-- FLT_MAIN |
204 |
|
|
C | |
205 |
|
|
C |-- DO_STATEVARS_TAVE |
206 |
|
|
C | |
207 |
|
|
C |-- NEST_PARENT_IO_2 |
208 |
|
|
C |-- NEST_CHILD_TRANSP |
209 |
|
|
C | |
210 |
|
|
C |-- MONITOR |
211 |
|
|
C | |
212 |
|
|
C |-- COST_TILE |
213 |
|
|
C | |
214 |
|
|
C |-- DO_THE_MODEL_IO |
215 |
|
|
C | |
216 |
|
|
C |-- PTRACERS_RESET |
217 |
|
|
C | |
218 |
|
|
C |-- DO_WRITE_PICKUP |
219 |
|
|
C | |
220 |
|
|
C |-- AUTODIFF_INADMODE_SET |
221 |
|
|
C | |
222 |
|
|
C |-- SHOWFLOPS_INLOOP |
223 |
|
|
|
224 |
|
|
C !USES: |
225 |
|
|
IMPLICIT NONE |
226 |
|
|
C == Global variables == |
227 |
|
|
#include "SIZE.h" |
228 |
|
|
#include "EEPARAMS.h" |
229 |
|
|
#include "PARAMS.h" |
230 |
|
|
#include "DYNVARS.h" |
231 |
|
|
#include "GRID.h" |
232 |
|
|
#include "SURFACE.h" |
233 |
|
|
#include "NH_VARS.h" |
234 |
|
|
#ifdef HAVE_SIGREG |
235 |
|
|
#include "SIGREG.h" |
236 |
|
|
#endif |
237 |
|
|
|
238 |
|
|
#ifdef ALLOW_SHAP_FILT |
239 |
|
|
# include "SHAP_FILT.h" |
240 |
|
|
#endif |
241 |
|
|
#ifdef ALLOW_ZONAL_FILT |
242 |
|
|
# include "ZONAL_FILT.h" |
243 |
|
|
#endif |
244 |
|
|
#ifdef COMPONENT_MODULE |
245 |
|
|
# include "CPL_PARAMS.h" |
246 |
|
|
#endif |
247 |
|
|
|
248 |
|
|
#ifdef ALLOW_LONGSTEP |
249 |
|
|
# include "LONGSTEP_PARAMS.h" |
250 |
|
|
# include "LONGSTEP.h" |
251 |
|
|
#endif |
252 |
|
|
|
253 |
|
|
#ifdef ALLOW_AUTODIFF |
254 |
|
|
# include "AUTODIFF_MYFIELDS.h" |
255 |
|
|
# include "FFIELDS.h" |
256 |
|
|
# include "SURFACE.h" |
257 |
|
|
|
258 |
|
|
# include "tamc.h" |
259 |
|
|
# ifdef ALLOW_CTRL |
260 |
|
|
# include "CTRL_SIZE.h" |
261 |
|
|
# include "ctrl.h" |
262 |
|
|
# include "ctrl_dummy.h" |
263 |
|
|
# include "CTRL_GENARR.h" |
264 |
|
|
# include "CTRL_OBCS.h" |
265 |
|
|
# endif |
266 |
|
|
# ifdef ALLOW_COST |
267 |
|
|
# include "cost.h" |
268 |
|
|
# endif |
269 |
|
|
# ifdef ALLOW_ECCO |
270 |
|
|
# include "ecco_cost.h" |
271 |
|
|
# endif |
272 |
|
|
# include "EOS.h" |
273 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
274 |
|
|
# include "GRID.h" |
275 |
|
|
# endif |
276 |
|
|
# ifdef ALLOW_GMREDI |
277 |
|
|
# include "GMREDI.h" |
278 |
|
|
# endif |
279 |
|
|
# ifdef ALLOW_EXF |
280 |
|
|
# include "EXF_FIELDS.h" |
281 |
|
|
# include "EXF_PARAM.h" |
282 |
|
|
# ifdef ALLOW_BULKFORMULAE |
283 |
|
|
# include "EXF_CONSTANTS.h" |
284 |
|
|
# endif |
285 |
|
|
# endif |
286 |
|
|
# ifdef ALLOW_CD_CODE |
287 |
|
|
# include "CD_CODE_VARS.h" |
288 |
|
|
# endif |
289 |
|
|
# ifdef ALLOW_GENERIC_ADVDIFF |
290 |
|
|
# include "GAD.h" |
291 |
|
|
# include "GAD_SOM_VARS.h" |
292 |
|
|
# endif |
293 |
|
|
# ifdef ALLOW_GGL90 |
294 |
|
|
# include "GGL90.h" |
295 |
|
|
# endif |
296 |
|
|
# ifdef ALLOW_PTRACERS |
297 |
|
|
# include "PTRACERS_SIZE.h" |
298 |
|
|
# include "PTRACERS_FIELDS.h" |
299 |
|
|
# endif |
300 |
|
|
# ifdef ALLOW_GCHEM |
301 |
|
|
# include "GCHEM_FIELDS.h" |
302 |
|
|
# endif |
303 |
|
|
# ifdef ALLOW_CFC |
304 |
|
|
# include "CFC.h" |
305 |
|
|
# endif |
306 |
|
|
# ifdef ALLOW_DIC |
307 |
|
|
# include "DIC_VARS.h" |
308 |
|
|
# include "DIC_LOAD.h" |
309 |
|
|
# include "DIC_ATMOS.h" |
310 |
|
|
# include "DIC_COST.h" |
311 |
|
|
# endif |
312 |
|
|
# ifdef ALLOW_OBCS |
313 |
|
|
# include "OBCS_PARAMS.h" |
314 |
|
|
# include "OBCS_FIELDS.h" |
315 |
|
|
# include "OBCS_SEAICE.h" |
316 |
|
|
# ifdef ALLOW_PTRACERS |
317 |
|
|
# include "OBCS_PTRACERS.h" |
318 |
|
|
# endif |
319 |
|
|
# endif |
320 |
|
|
# ifdef ALLOW_THSICE |
321 |
|
|
# include "THSICE_PARAMS.h" |
322 |
|
|
# include "THSICE_SIZE.h" |
323 |
|
|
# include "THSICE_VARS.h" |
324 |
|
|
# include "THSICE_COST.h" |
325 |
|
|
# endif |
326 |
|
|
# ifdef ALLOW_SEAICE |
327 |
|
|
# include "SEAICE_SIZE.h" |
328 |
|
|
# include "SEAICE.h" |
329 |
|
|
# include "SEAICE_COST.h" |
330 |
|
|
# endif |
331 |
|
|
# ifdef ALLOW_SALT_PLUME |
332 |
|
|
# include "SALT_PLUME.h" |
333 |
|
|
# endif |
334 |
|
|
# ifdef ALLOW_SHELFICE |
335 |
|
|
# include "SHELFICE.h" |
336 |
|
|
# include "SHELFICE_COST.h" |
337 |
|
|
# endif |
338 |
|
|
# ifdef ALLOW_STREAMICE |
339 |
|
|
# include "STREAMICE.h" |
340 |
|
|
# include "STREAMICE_ADV.h" |
341 |
|
|
# include "STREAMICE_BDRY.h" |
342 |
|
|
# include "STREAMICE_CG.h" |
343 |
|
|
# endif |
344 |
|
|
# ifdef ALLOW_EBM |
345 |
|
|
# include "EBM.h" |
346 |
|
|
# endif |
347 |
|
|
# ifdef ALLOW_KPP |
348 |
|
|
# include "KPP.h" |
349 |
|
|
# endif |
350 |
|
|
# ifdef ALLOW_RBCS |
351 |
|
|
# include "RBCS_SIZE.h" |
352 |
|
|
# include "RBCS_FIELDS.h" |
353 |
|
|
# endif |
354 |
|
|
# ifdef ALLOW_OFFLINE |
355 |
|
|
# include "OFFLINE.h" |
356 |
|
|
# endif |
357 |
|
|
# ifdef ALLOW_CG2D_NSA |
358 |
|
|
# include "CG2D.h" |
359 |
|
|
# endif |
360 |
|
|
#endif /* ALLOW_AUTODIFF */ |
361 |
|
|
|
362 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
363 |
|
|
C == Routine arguments == |
364 |
|
|
C note: under the multi-threaded model myIter and |
365 |
|
|
C myTime are local variables passed around as routine |
366 |
|
|
C arguments. Although this is fiddly it saves the need to |
367 |
|
|
C impose additional synchronisation points when they are |
368 |
|
|
C updated. |
369 |
|
|
C myTime :: time counter for this thread |
370 |
|
|
C myIter :: iteration counter for this thread |
371 |
|
|
C myThid :: thread number for this instance of the routine. |
372 |
|
|
INTEGER iloop |
373 |
|
|
_RL myTime |
374 |
|
|
INTEGER myIter |
375 |
|
|
INTEGER myThid |
376 |
|
|
|
377 |
|
|
C !LOCAL VARIABLES: |
378 |
|
|
C == Local variables == |
379 |
|
|
C modelEnd :: true if reaching the end of the run |
380 |
|
|
C myTimeBeg :: time at beginning of time step (needed by longstep) |
381 |
|
|
C myIterBeg :: iteration number at beginning of time step |
382 |
|
|
LOGICAL modelEnd |
383 |
|
|
#ifdef ALLOW_LONGSTEP |
384 |
|
|
INTEGER myIterBeg |
385 |
|
|
_RL myTimeBeg |
386 |
|
|
#endif /* ALLOW_LONGSTEP */ |
387 |
|
|
CEOP |
388 |
|
|
|
389 |
|
|
print *, 'JJetaNSTA', etan(1,69,1,1) |
390 |
|
|
print *, 'JJetaHSTA', etah(1,69,1,1) |
391 |
|
|
print *, 'JJetaHnm1STA', etahnm1(1,69,1,1) |
392 |
|
|
print *, 'JJdetahdtSTA', detahdt(1,69,1,1) |
393 |
|
|
|
394 |
|
|
print *, 'JJrhoinsituSTA', rhoinsitu(1,69,49,1,1) |
395 |
|
|
|
396 |
|
|
print *, 'JJksurfc', ksurfc(1,69,1,1) |
397 |
|
|
print *, 'JJksurfs', ksurfs(1,69,1,1) |
398 |
|
|
print *, 'JJksurfw', ksurfw(1,69,1,1) |
399 |
|
|
|
400 |
|
|
|
401 |
|
|
print *, 'JJhsurfcSTA',hfac_surfc (1,69,1,1) |
402 |
|
|
print *, 'JJhsurfcnm1STA', hfac_surfnm1c(1,69,1,1) |
403 |
|
|
|
404 |
|
|
print *, 'JJhsurfwSTA',hfac_surfw(1,69,1,1) |
405 |
|
|
print *, 'JJhsurfwnm1STA', hfac_surfnm1w(1,69,1,1) |
406 |
|
|
|
407 |
|
|
print *, 'JJhsurfsSTA',hfac_surfs(1,69,1,1) |
408 |
|
|
print *, 'JJhsurfsnm1STA', hfac_surfnm1s(1,69,1,1) |
409 |
|
|
|
410 |
|
|
print *, 'JJhfaccSTA',h0facc(1,69,49,1,1) |
411 |
|
|
print *, 'JJhfacsSTA',hfacs(1,69,49,1,1) |
412 |
|
|
print *, 'JJhfacwSTA',hfacw(1,69,49,1,1) |
413 |
|
|
|
414 |
|
|
print *, 'JJThetaSTA',theta(1,69,49,1,1) |
415 |
|
|
print *, 'JJSaltSTA',salt(1,69,49,1,1) |
416 |
|
|
|
417 |
|
|
print *, 'JJVvel69STA',vvel(1,69,49,1,1) |
418 |
|
|
print *, 'JJVvel70STA',vvel(1,70,49,1,1) |
419 |
|
|
|
420 |
|
|
print *, 'JJwvelSTA',wvel(1,69,49,1,1) |
421 |
|
|
|
422 |
|
|
print *, 'JJgvnm169STA',gvnm1(1,69,49,1,1) |
423 |
|
|
print *, 'JJgvnm170STA',gvnm1(1,70,49,1,1) |
424 |
|
|
|
425 |
|
|
|
426 |
|
|
|
427 |
|
|
|
428 |
|
|
|
429 |
|
|
#ifdef ALLOW_SHELFICE |
430 |
|
|
C-- Remesh shelfice |
431 |
|
|
CALL TIMER_START('SHELFICE_REMESHING [FORWARD_STEP]',myThid) |
432 |
|
|
CALL SHELFICE_REMESHING (myTime, myIter, myThid ) |
433 |
|
|
CALL TIMER_STOP('SHELFICE_REMESHING [FORWARD_STEP]',myThid) |
434 |
|
|
|
435 |
|
|
#endif /* ALLOW_SHELFICE */ |
436 |
|
|
|
437 |
|
|
|
438 |
|
|
|
439 |
|
|
|
440 |
|
|
|
441 |
|
|
|
442 |
|
|
|
443 |
|
|
|
444 |
|
|
print *, 'JJetaNMID', etan(1,69,1,1) |
445 |
|
|
print *, 'JJetaHMID', etah(1,69,1,1) |
446 |
|
|
print *, 'JJdetahdtMID', detahdt(1,69,1,1) |
447 |
|
|
|
448 |
|
|
print *, 'JJksurfc', ksurfc(1,69,1,1) |
449 |
|
|
print *, 'JJksurfs', ksurfs(1,69,1,1) |
450 |
|
|
print *, 'JJksurfw', ksurfw(1,69,1,1) |
451 |
|
|
|
452 |
|
|
|
453 |
|
|
print *, 'JJrhoinsituMID', rhoinsitu(1,69,49,1,1) |
454 |
|
|
|
455 |
|
|
print *, 'JJhsurfcMID',hfac_surfc (1,69,1,1) |
456 |
|
|
print *, 'JJhsurfcnm1MID', hfac_surfnm1c(1,69,1,1) |
457 |
|
|
|
458 |
|
|
print *, 'JJhsurfwMID',hfac_surfw(1,69,1,1) |
459 |
|
|
print *, 'JJhsurfwnm1MID', hfac_surfnm1w(1,69,1,1) |
460 |
|
|
|
461 |
|
|
print *, 'JJhsurfsMID',hfac_surfs(1,69,1,1) |
462 |
|
|
print *, 'JJhsurfsnm1MID', hfac_surfnm1s(1,69,1,1) |
463 |
|
|
|
464 |
|
|
print *, 'JJhfaccMID',hfacc(1,69,49,1,1) |
465 |
|
|
print *, 'JJhfacsMID',hfacs(1,69,49,1,1) |
466 |
|
|
print *, 'JJhfacwMID',hfacw(1,69,49,1,1) |
467 |
|
|
|
468 |
|
|
print *, 'JJThetaMID',theta(1,69,49,1,1) |
469 |
|
|
print *, 'JJSaltMID',salt(1,69,49,1,1) |
470 |
|
|
|
471 |
|
|
print *, 'JJVvel69MID',vvel(1,69,49,1,1) |
472 |
|
|
print *, 'JJVvel70MID',vvel(1,70,49,1,1) |
473 |
|
|
|
474 |
|
|
print *, 'JJwvelMID',wvel(1,69,49,1,1) |
475 |
|
|
|
476 |
|
|
print *, 'JJgvnm169MID',gvnm1(1,69,49,1,1) |
477 |
|
|
print *, 'JJgvnm170MID',gvnm1(1,70,49,1,1) |
478 |
|
|
|
479 |
|
|
|
480 |
|
|
|
481 |
|
|
|
482 |
|
|
#ifdef ALLOW_DEBUG |
483 |
|
|
IF (debugMode) CALL DEBUG_ENTER('FORWARD_STEP',myThid) |
484 |
|
|
#endif |
485 |
|
|
|
486 |
|
|
#ifdef ALLOW_AUTODIFF |
487 |
|
|
CALL AUTODIFF_INADMODE_UNSET( myThid ) |
488 |
|
|
#endif |
489 |
|
|
|
490 |
|
|
#ifdef ALLOW_AUTODIFF |
491 |
|
|
C-- Reset the model iteration counter and the model time. |
492 |
|
|
myIter = nIter0 + (iloop-1) |
493 |
|
|
myTime = startTime + float(iloop-1)*deltaTClock |
494 |
|
|
#endif |
495 |
|
|
|
496 |
|
|
#ifdef ALLOW_LONGSTEP |
497 |
|
|
C store this for longstep_average with staggerTimeStep |
498 |
|
|
C which is called after myIter and myTime are incremented |
499 |
|
|
C but needs iter/time at beginning of time step |
500 |
|
|
myIterBeg = myIter |
501 |
|
|
myTimeBeg = myTime |
502 |
|
|
#endif /* ALLOW_LONGSTEP */ |
503 |
|
|
|
504 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
505 |
|
|
c************************************** |
506 |
|
|
#include "checkpoint_lev1_directives.h" |
507 |
|
|
#include "checkpoint_lev1_template.h" |
508 |
|
|
c************************************** |
509 |
|
|
#endif |
510 |
|
|
C-- Reset geometric factors (hFacC,W,S & recip_hFac) to their current values: |
511 |
|
|
C added to simplify adjoint derivation - no effect in forward run |
512 |
|
|
#ifdef NONLIN_FRSURF |
513 |
|
|
#ifndef ALLOW_AUTODIFF |
514 |
|
|
IF ( doResetHFactors ) THEN |
515 |
|
|
#endif |
516 |
|
|
CALL RESET_NLFS_VARS( myTime, myIter, myThid ) |
517 |
|
|
IF ( select_rStar.GT.0 ) THEN |
518 |
|
|
# ifndef DISABLE_RSTAR_CODE |
519 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
520 |
|
|
CADJ STORE rStarFacC, rStarFacS, rStarFacW = |
521 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
522 |
|
|
# endif |
523 |
|
|
CALL TIMER_START('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
524 |
|
|
CALL UPDATE_R_STAR( .FALSE., myTime, myIter, myThid ) |
525 |
|
|
CALL TIMER_STOP ('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
526 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
527 |
|
|
ELSE |
528 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
529 |
|
|
CADJ STORE hFac_surfC, hFac_surfS, hFac_surfW |
530 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
531 |
|
|
#endif |
532 |
|
|
CALL TIMER_START('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
533 |
|
|
CALL UPDATE_SURF_DR( .FALSE., myTime, myIter, myThid ) |
534 |
|
|
CALL TIMER_STOP ('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
535 |
|
|
ENDIF |
536 |
|
|
|
537 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
538 |
|
|
CADJ STORE hFacC, hFacS, hFacW = |
539 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
540 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW = |
541 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
542 |
|
|
#endif |
543 |
|
|
#ifndef ALLOW_AUTODIFF |
544 |
|
|
ENDIF |
545 |
|
|
#endif |
546 |
|
|
#endif /* NONLIN_FRSURF */ |
547 |
|
|
|
548 |
|
|
#ifdef ALLOW_PTRACERS |
549 |
|
|
C-- Switch on/off individual tracer time-stepping |
550 |
|
|
IF ( usePTRACERS ) THEN |
551 |
|
|
CALL PTRACERS_SWITCH_ONOFF( myTime, myIter, myThid ) |
552 |
|
|
ENDIF |
553 |
|
|
#endif /* ALLOW_PTRACERS */ |
554 |
|
|
|
555 |
|
|
C-- Switch on/off diagnostics for snap-shot output: |
556 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
557 |
|
|
IF ( useDiagnostics ) THEN |
558 |
|
|
CALL DIAGNOSTICS_SWITCH_ONOFF( myTime, myIter, myThid ) |
559 |
|
|
C-- State-variables diagnostics |
560 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
561 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 0, myIter, myThid ) |
562 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
563 |
|
|
ENDIF |
564 |
|
|
#endif /* ALLOW_DIAGNOSTICS */ |
565 |
|
|
|
566 |
|
|
#ifdef ALLOW_NEST_CHILD |
567 |
|
|
IF ( useNEST_CHILD) THEN |
568 |
|
|
CALL NEST_CHILD_SETMEMO( myTime, myIter, myThid ) |
569 |
|
|
ENDIF |
570 |
|
|
#endif /* ALLOW_NEST_CHILD */ |
571 |
|
|
|
572 |
|
|
#ifdef ALLOW_NEST_PARENT |
573 |
|
|
IF ( useNEST_PARENT) THEN |
574 |
|
|
CALL NEST_PARENT_IO_1( myTime, myIter, myThid ) |
575 |
|
|
ENDIF |
576 |
|
|
#endif /* ALLOW_NEST_PARENT */ |
577 |
|
|
|
578 |
|
|
C-- Call driver to load external forcing fields from file |
579 |
|
|
#ifdef ALLOW_DEBUG |
580 |
|
|
IF (debugMode) CALL DEBUG_CALL('LOAD_FIELDS_DRIVER',myThid) |
581 |
|
|
#endif |
582 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
583 |
|
|
cph Important STORE that avoids hidden recomp. of load_fields_driver |
584 |
|
|
CADJ STORE theta = comlev1, key = ikey_dynamics, |
585 |
|
|
CADJ & kind = isbyte |
586 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, |
587 |
|
|
CADJ & kind = isbyte |
588 |
|
|
#endif |
589 |
|
|
CALL TIMER_START('LOAD_FIELDS_DRIVER [FORWARD_STEP]',myThid) |
590 |
|
|
CALL LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) |
591 |
|
|
CALL TIMER_STOP ('LOAD_FIELDS_DRIVER [FORWARD_STEP]',myThid) |
592 |
|
|
|
593 |
|
|
C-- Call Bulk-Formulae forcing package |
594 |
|
|
#ifdef ALLOW_BULK_FORCE |
595 |
|
|
IF ( useBulkForce ) THEN |
596 |
|
|
#ifdef ALLOW_DEBUG |
597 |
|
|
IF (debugMode) CALL DEBUG_CALL('BULKF_FORCING',myThid) |
598 |
|
|
#endif |
599 |
|
|
CALL TIMER_START('BULKF_FORCING [FORWARD_STEP]',myThid) |
600 |
|
|
C- calculate qnet and empmr (and wind stress) |
601 |
|
|
CALL BULKF_FORCING( myTime, myIter, myThid ) |
602 |
|
|
CALL TIMER_STOP ('BULKF_FORCING [FORWARD_STEP]',myThid) |
603 |
|
|
ENDIF |
604 |
|
|
#endif /* ALLOW_BULK_FORCE */ |
605 |
|
|
|
606 |
|
|
C-- Call external chepaml forcing package |
607 |
|
|
#ifdef ALLOW_CHEAPAML |
608 |
|
|
IF ( useCheapAML ) THEN |
609 |
|
|
#ifdef ALLOW_DEBUG |
610 |
|
|
IF (debugMode) CALL DEBUG_CALL('CHEAPAML',myThid) |
611 |
|
|
#endif |
612 |
|
|
CALL TIMER_START('CHEAPAML [FORWARD_STEP]',myThid) |
613 |
|
|
C- calculate qnet (and wind stress) |
614 |
|
|
CALL CHEAPAML( myTime, myIter,myThid ) |
615 |
|
|
CALL TIMER_STOP ('CHEAPAML [FORWARD_STEP]',myThid) |
616 |
|
|
ENDIF |
617 |
|
|
#endif /*ALLOW_CHEAPAML */ |
618 |
|
|
|
619 |
|
|
#ifdef ALLOW_CTRL |
620 |
|
|
C-- Add control vector for forcing and parameter fields |
621 |
|
|
IF ( ( useCTRL ).AND.( myIter .EQ. nIter0 ) ) |
622 |
|
|
& CALL CTRL_MAP_FORCING (myThid) |
623 |
|
|
#endif |
624 |
|
|
|
625 |
|
|
#ifdef ALLOW_AUTODIFF_MONITOR |
626 |
|
|
CALL DUMMY_IN_STEPPING( myTime, myIter, myThid ) |
627 |
|
|
#endif |
628 |
|
|
|
629 |
|
|
#ifdef COMPONENT_MODULE |
630 |
|
|
IF ( useCoupler ) THEN |
631 |
|
|
C Post coupling data that I export. |
632 |
|
|
C Read in coupling data that I import. |
633 |
|
|
CALL TIMER_START('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid) |
634 |
|
|
CALL CPL_EXPORT_MY_DATA( myTime, myIter, myThid ) |
635 |
|
|
CALL CPL_IMPORT_EXTERNAL_DATA( myTime, myIter, myThid ) |
636 |
|
|
CALL TIMER_STOP ('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid) |
637 |
|
|
ENDIF |
638 |
|
|
#endif /* COMPONENT_MODULE */ |
639 |
|
|
#ifdef ALLOW_OASIS |
640 |
|
|
IF ( useOASIS ) THEN |
641 |
|
|
CALL TIMER_START('OASIS_PUT-GET [FORWARD_STEP]',myThid) |
642 |
|
|
C Post coupling data that I export. |
643 |
|
|
CALL OASIS_PUT( myTime, myIter, myThid ) |
644 |
|
|
C Read in coupling data that I import. |
645 |
|
|
CALL OASIS_GET( myTime, myIter, myThid ) |
646 |
|
|
CALL TIMER_STOP ('OASIS_PUT-GET [FORWARD_STEP]',myThid) |
647 |
|
|
ENDIF |
648 |
|
|
#endif /* ALLOW_OASIS */ |
649 |
|
|
|
650 |
|
|
#ifdef ALLOW_EBM |
651 |
|
|
IF ( useEBM ) THEN |
652 |
|
|
# ifdef ALLOW_DEBUG |
653 |
|
|
IF (debugMode) CALL DEBUG_CALL('EBM',myThid) |
654 |
|
|
# endif |
655 |
|
|
CALL TIMER_START('EBM [FORWARD_STEP]',myThid) |
656 |
|
|
CALL EBM_DRIVER ( myTime, myIter, myThid ) |
657 |
|
|
CALL TIMER_STOP ('EBM [FORWARD_STEP]',myThid) |
658 |
|
|
ENDIF |
659 |
|
|
#endif /* ALLOW_EBM */ |
660 |
|
|
|
661 |
|
|
print *, 'JJetaNMID1', etan(1,69,1,1) |
662 |
|
|
print *, 'JJetaHMID1', etah(1,69,1,1) |
663 |
|
|
print *, 'JJdetahdtMID1', detahdt(1,69,1,1) |
664 |
|
|
|
665 |
|
|
print *, 'JJhsurfcMID1',hfac_surfc (1,69,1,1) |
666 |
|
|
print *, 'JJhsurfcnm1MID1', hfac_surfnm1c(1,69,1,1) |
667 |
|
|
|
668 |
|
|
print *, 'JJhsurfwMID1',hfac_surfw(1,69,1,1) |
669 |
|
|
print *, 'JJhsurfwnm1MID1', hfac_surfnm1w(1,69,1,1) |
670 |
|
|
|
671 |
|
|
print *, 'JJhsurfsMID1',hfac_surfs(1,69,1,1) |
672 |
|
|
print *, 'JJhsurfsnm1MID1', hfac_surfnm1s(1,69,1,1) |
673 |
|
|
|
674 |
|
|
print *, 'JJhfaccMID1',hfacc(1,69,49,1,1) |
675 |
|
|
print *, 'JJhfacsMID1',hfacs(1,69,49,1,1) |
676 |
|
|
print *, 'JJhfacwMID1',hfacw(1,69,49,1,1) |
677 |
|
|
|
678 |
|
|
print *, 'JJThetaMID1',theta(1,69,49,1,1) |
679 |
|
|
print *, 'JJSaltMID1',salt(1,69,49,1,1) |
680 |
|
|
|
681 |
|
|
print *, 'JJVvel69MID1',vvel(1,69,49,1,1) |
682 |
|
|
print *, 'JJVvel70MID1',vvel(1,70,49,1,1) |
683 |
|
|
|
684 |
|
|
print *, 'JJwvelMID1',wvel(1,69,49,1,1) |
685 |
|
|
|
686 |
|
|
print *, 'JJgvnm169MID1',gvnm1(1,69,49,1,1) |
687 |
|
|
print *, 'JJgvnm170MID1',gvnm1(1,70,49,1,1) |
688 |
|
|
|
689 |
|
|
|
690 |
|
|
|
691 |
|
|
|
692 |
|
|
|
693 |
|
|
|
694 |
|
|
|
695 |
|
|
|
696 |
|
|
|
697 |
|
|
|
698 |
|
|
|
699 |
|
|
|
700 |
|
|
|
701 |
|
|
C-- Step forward fields and calculate time tendency terms. |
702 |
|
|
|
703 |
|
|
#ifdef ALLOW_DEBUG |
704 |
|
|
IF (debugMode) CALL DEBUG_CALL('DO_ATMOSPHERIC_PHYS',myThid) |
705 |
|
|
#endif |
706 |
|
|
CALL TIMER_START('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',myThid) |
707 |
|
|
CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid ) |
708 |
|
|
CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',myThid) |
709 |
|
|
|
710 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
711 |
|
|
CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics, |
712 |
|
|
CADJ & kind = isbyte |
713 |
|
|
# ifdef ALLOW_KPP |
714 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, |
715 |
|
|
CADJ & kind = isbyte |
716 |
|
|
# endif /* ALLOW_KPP */ |
717 |
|
|
# ifdef EXACT_CONSERV |
718 |
|
|
CADJ STORE EmPmR = comlev1, key=ikey_dynamics, kind=isbyte |
719 |
|
|
CADJ STORE PmEpR = comlev1, key=ikey_dynamics, kind=isbyte |
720 |
|
|
# endif |
721 |
|
|
# ifdef ALLOW_OBCS |
722 |
|
|
CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte |
723 |
|
|
CADJ STORE totphihyd = comlev1, key=ikey_dynamics, kind=isbyte |
724 |
|
|
# ifdef ALLOW_OBCS_STEVENS |
725 |
|
|
CADJ STORE gsNm1 = comlev1, key=ikey_dynamics, kind=isbyte |
726 |
|
|
CADJ STORE gtNm1 = comlev1, key=ikey_dynamics, kind=isbyte |
727 |
|
|
# endif |
728 |
|
|
# endif /* ALLOW_OBCS */ |
729 |
|
|
# ifdef ALLOW_PTRACERS |
730 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
731 |
|
|
CADJ & kind = isbyte |
732 |
|
|
# endif /* ALLOW_PTRACERS */ |
733 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
734 |
|
|
CADJ STORE hFacC = comlev1, key = ikey_dynamics, kind = isbyte |
735 |
|
|
# endif |
736 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
737 |
|
|
|
738 |
|
|
#ifdef ALLOW_DEBUG |
739 |
|
|
IF (debugMode) CALL DEBUG_CALL('DO_OCEANIC_PHYS',myThid) |
740 |
|
|
#endif |
741 |
|
|
CALL TIMER_START('DO_OCEANIC_PHYS [FORWARD_STEP]',myThid) |
742 |
|
|
CALL DO_OCEANIC_PHYS( myTime, myIter, myThid ) |
743 |
|
|
CALL TIMER_STOP ('DO_OCEANIC_PHYS [FORWARD_STEP]',myThid) |
744 |
|
|
|
745 |
|
|
|
746 |
|
|
#ifdef ALLOW_STREAMICE |
747 |
|
|
IF (useStreamIce) THEN |
748 |
|
|
CALL STREAMICE_TIMESTEP ( myThid, myIter, |
749 |
|
|
& iLoop, myTime ) |
750 |
|
|
ENDIF |
751 |
|
|
#endif |
752 |
|
|
|
753 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
754 |
|
|
CADJ STORE EmPmR = comlev1, key = ikey_dynamics, |
755 |
|
|
CADJ & kind = isbyte |
756 |
|
|
# ifdef EXACT_CONSERV |
757 |
|
|
CADJ STORE PmEpR = comlev1, key = ikey_dynamics, |
758 |
|
|
CADJ & kind = isbyte |
759 |
|
|
# endif |
760 |
|
|
cph-test( |
761 |
|
|
CADJ STORE surfaceForcingU = comlev1, key=ikey_dynamics, kind=isbyte |
762 |
|
|
CADJ STORE surfaceForcingV = comlev1, key=ikey_dynamics, kind=isbyte |
763 |
|
|
CADJ STORE qsw = comlev1, key = ikey_dynamics, kind = isbyte |
764 |
|
|
# ifdef ATMOSPHERIC_LOADING |
765 |
|
|
CADJ STORE phi0surf = comlev1, key = ikey_dynamics, kind = isbyte |
766 |
|
|
# endif |
767 |
|
|
cph-test) |
768 |
|
|
|
769 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
770 |
|
|
CADJ STORE hFacC, hFacS, hFacW |
771 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
772 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW |
773 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
774 |
|
|
CADJ STORE surfaceForcingU, surfaceForcingV = |
775 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
776 |
|
|
# endif |
777 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
778 |
|
|
|
779 |
|
|
#ifdef ALLOW_GCHEM |
780 |
|
|
IF ( useGCHEM ) THEN |
781 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
782 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
783 |
|
|
CADJ & kind = isbyte |
784 |
|
|
CADJ STORE theta, salt = comlev1, key = ikey_dynamics, |
785 |
|
|
CADJ & kind = isbyte |
786 |
|
|
#endif |
787 |
|
|
#ifdef ALLOW_DEBUG |
788 |
|
|
IF (debugMode) CALL DEBUG_CALL('GCHEM_CALC_TENDENCY',myThid) |
789 |
|
|
#endif |
790 |
|
|
CALL TIMER_START('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
791 |
|
|
CALL GCHEM_CALC_TENDENCY( myTime, myIter, myThid ) |
792 |
|
|
CALL TIMER_STOP ('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
793 |
|
|
ENDIF |
794 |
|
|
#endif /* ALLOW_GCHEM */ |
795 |
|
|
|
796 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
797 |
|
|
cph needed to be moved here from do_oceanic_physics |
798 |
|
|
cph to be visible down the road |
799 |
|
|
|
800 |
|
|
CADJ STORE rhoInSitu = comlev1, key = ikey_dynamics, |
801 |
|
|
CADJ & kind = isbyte |
802 |
|
|
CADJ STORE surfaceForcingS = comlev1, key = ikey_dynamics, |
803 |
|
|
CADJ & kind = isbyte |
804 |
|
|
CADJ STORE surfaceForcingT = comlev1, key = ikey_dynamics, |
805 |
|
|
CADJ & kind = isbyte |
806 |
|
|
CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics, |
807 |
|
|
CADJ & kind = isbyte |
808 |
|
|
CADJ STORE IVDConvCount = comlev1, key = ikey_dynamics, |
809 |
|
|
CADJ & kind = isbyte |
810 |
|
|
# ifdef ALLOW_PTRACERS |
811 |
|
|
CADJ STORE surfaceForcingPTr = comlev1, key = ikey_dynamics, |
812 |
|
|
CADJ & kind = isbyte |
813 |
|
|
# endif |
814 |
|
|
|
815 |
|
|
# ifdef ALLOW_GMREDI |
816 |
|
|
CADJ STORE Kwx = comlev1, key = ikey_dynamics, |
817 |
|
|
CADJ & kind = isbyte |
818 |
|
|
CADJ STORE Kwy = comlev1, key = ikey_dynamics, |
819 |
|
|
CADJ & kind = isbyte |
820 |
|
|
CADJ STORE Kwz = comlev1, key = ikey_dynamics, |
821 |
|
|
CADJ & kind = isbyte |
822 |
|
|
# ifdef GM_BOLUS_ADVEC |
823 |
|
|
CADJ STORE GM_PsiX = comlev1, key = ikey_dynamics, |
824 |
|
|
CADJ & kind = isbyte |
825 |
|
|
CADJ STORE GM_PsiY = comlev1, key = ikey_dynamics, |
826 |
|
|
CADJ & kind = isbyte |
827 |
|
|
# endif |
828 |
|
|
# endif |
829 |
|
|
|
830 |
|
|
# ifdef ALLOW_KPP |
831 |
|
|
CADJ STORE KPPghat = comlev1, key = ikey_dynamics, |
832 |
|
|
CADJ & kind = isbyte |
833 |
|
|
CADJ STORE KPPfrac = comlev1, key = ikey_dynamics, |
834 |
|
|
CADJ & kind = isbyte |
835 |
|
|
CADJ STORE KPPdiffKzS = comlev1, key = ikey_dynamics, |
836 |
|
|
CADJ & kind = isbyte |
837 |
|
|
CADJ STORE KPPdiffKzT = comlev1, key = ikey_dynamics, |
838 |
|
|
CADJ & kind = isbyte |
839 |
|
|
# endif |
840 |
|
|
|
841 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
842 |
|
|
CADJ STORE theta,salt = comlev1, key = ikey_dynamics, kind = isbyte |
843 |
|
|
CADJ STORE etaH = comlev1, key = ikey_dynamics, kind = isbyte |
844 |
|
|
# ifdef ALLOW_CD_CODE |
845 |
|
|
CADJ STORE etaNm1 = comlev1, key = ikey_dynamics, kind = isbyte |
846 |
|
|
# endif |
847 |
|
|
# ifndef DISABLE_RSTAR_CODE |
848 |
|
|
CADJ STORE rStarExpC = comlev1, key = ikey_dynamics, kind = isbyte |
849 |
|
|
# endif |
850 |
|
|
# endif |
851 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
852 |
|
|
|
853 |
|
|
print *, 'JJetaNMID15', etan(1,69,1,1) |
854 |
|
|
print *, 'JJetaHMID15', etah(1,69,1,1) |
855 |
|
|
print *, 'JJdetahdtMID15', detahdt(1,69,1,1) |
856 |
|
|
|
857 |
|
|
print *, 'JJhsurfcMID15',hfac_surfc (1,69,1,1) |
858 |
|
|
print *, 'JJhsurfcnm1MID15', hfac_surfnm1c(1,69,1,1) |
859 |
|
|
|
860 |
|
|
print *, 'JJhsurfwMID15',hfac_surfw(1,69,1,1) |
861 |
|
|
print *, 'JJhsurfwnm1MID15', hfac_surfnm1w(1,69,1,1) |
862 |
|
|
|
863 |
|
|
print *, 'JJhsurfsMID15',hfac_surfs(1,69,1,1) |
864 |
|
|
print *, 'JJhsurfsnm1MID15', hfac_surfnm1s(1,69,1,1) |
865 |
|
|
|
866 |
|
|
print *, 'JJhfaccMID15',hfacc(1,69,49,1,1) |
867 |
|
|
print *, 'JJhfacsMID15',hfacs(1,69,49,1,1) |
868 |
|
|
print *, 'JJhfacwMID15',hfacw(1,69,49,1,1) |
869 |
|
|
|
870 |
|
|
print *, 'JJThetaMID15',theta(1,69,49,1,1) |
871 |
|
|
print *, 'JJSaltMID15',salt(1,69,49,1,1) |
872 |
|
|
|
873 |
|
|
print *, 'JJVvel69MID15',vvel(1,69,49,1,1) |
874 |
|
|
print *, 'JJVvel70MID15',vvel(1,70,49,1,1) |
875 |
|
|
|
876 |
|
|
print *, 'JJwvelMID15',wvel(1,69,49,1,1) |
877 |
|
|
|
878 |
|
|
print *, 'JJgvnm169MID15',gvnm1(1,69,49,1,1) |
879 |
|
|
print *, 'JJgvnm170MID15',gvnm1(1,70,49,1,1) |
880 |
|
|
|
881 |
|
|
|
882 |
|
|
|
883 |
|
|
|
884 |
|
|
|
885 |
|
|
#ifdef ALLOW_LONGSTEP |
886 |
|
|
IF ( usePTRACERS .AND. LS_whenToSample .EQ. 0 ) THEN |
887 |
|
|
C Average all variables before advection (but after do_oceanic_phys |
888 |
|
|
C where Qsw, KPP and GMRedi stuff is computed). |
889 |
|
|
C This is like diagnostics package and will reproduce offline |
890 |
|
|
C results. |
891 |
|
|
#ifdef ALLOW_DEBUG |
892 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
893 |
|
|
#endif |
894 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
895 |
|
|
CALL LONGSTEP_AVERAGE( myTime, myIter, myThid ) |
896 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
897 |
|
|
|
898 |
|
|
#ifdef ALLOW_DEBUG |
899 |
|
|
IF (debugMode) |
900 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
901 |
|
|
#endif |
902 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
903 |
|
|
& myThid) |
904 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
905 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
906 |
|
|
& myThid) |
907 |
|
|
ENDIF |
908 |
|
|
#endif /* ALLOW_LONGSTEP */ |
909 |
|
|
|
910 |
|
|
IF ( .NOT.staggerTimeStep ) THEN |
911 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
912 |
|
|
CADJ STORE wVel = comlev1, key = ikey_dynamics, kind = isbyte |
913 |
|
|
#endif |
914 |
|
|
#ifdef ALLOW_DEBUG |
915 |
|
|
IF (debugMode) CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
916 |
|
|
#endif |
917 |
|
|
CALL TIMER_START('THERMODYNAMICS [FORWARD_STEP]',myThid) |
918 |
|
|
CALL THERMODYNAMICS( myTime, myIter, myThid ) |
919 |
|
|
CALL TIMER_STOP ('THERMODYNAMICS [FORWARD_STEP]',myThid) |
920 |
|
|
C-- if not staggerTimeStep: end |
921 |
|
|
ENDIF |
922 |
|
|
|
923 |
|
|
#ifdef ALLOW_LONGSTEP |
924 |
|
|
IF ( usePTRACERS .AND. LS_whenToSample .EQ. 1 ) THEN |
925 |
|
|
C Average T and S after thermodynamics, but U,V,W before dynamics. |
926 |
|
|
C This will reproduce online results with staggerTimeStep=.FALSE. |
927 |
|
|
C for LS_nIter=1 |
928 |
|
|
#ifdef ALLOW_DEBUG |
929 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
930 |
|
|
#endif |
931 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
932 |
|
|
CALL LONGSTEP_AVERAGE( myTime, myIter, myThid ) |
933 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
934 |
|
|
|
935 |
|
|
#ifdef ALLOW_DEBUG |
936 |
|
|
IF (debugMode) |
937 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
938 |
|
|
#endif |
939 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
940 |
|
|
& myThid) |
941 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
942 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
943 |
|
|
& myThid) |
944 |
|
|
ENDIF |
945 |
|
|
#endif /* ALLOW_LONGSTEP */ |
946 |
|
|
|
947 |
|
|
c #ifdef ALLOW_NONHYDROSTATIC |
948 |
|
|
IF ( implicitIntGravWave ) THEN |
949 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
950 |
|
|
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
951 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
952 |
|
|
ENDIF |
953 |
|
|
c #endif |
954 |
|
|
|
955 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
956 |
|
|
CADJ STORE etaN = comlev1, key = ikey_dynamics, kind = isbyte |
957 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
958 |
|
|
CADJ STORE hFacC, hFacS, hFacW |
959 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
960 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW |
961 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
962 |
|
|
# endif /* ALLOW_DEPTH_CONTROL */ |
963 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
964 |
|
|
|
965 |
|
|
|
966 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJSALTA',' ',gsnm1,0,myThid) |
967 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJTHETAA',' ',gtnm1,0,myThid) |
968 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJWVELA',' ',wVel,0,myThid) |
969 |
|
|
|
970 |
|
|
|
971 |
|
|
|
972 |
|
|
|
973 |
|
|
|
974 |
|
|
print *, 'JJetaNMID155', etan(1,69,1,1) |
975 |
|
|
print *, 'JJetaHMID155', etah(1,69,1,1) |
976 |
|
|
print *, 'JJdetahdtMID155', detahdt(1,69,1,1) |
977 |
|
|
|
978 |
|
|
print *, 'JJhsurfcMID155',hfac_surfc (1,69,1,1) |
979 |
|
|
print *, 'JJhsurfcnm1MID155', hfac_surfnm1c(1,69,1,1) |
980 |
|
|
|
981 |
|
|
print *, 'JJhsurfwMID155',hfac_surfw(1,69,1,1) |
982 |
|
|
print *, 'JJhsurfwnm1MID155', hfac_surfnm1w(1,69,1,1) |
983 |
|
|
|
984 |
|
|
print *, 'JJhsurfsMID155',hfac_surfs(1,69,1,1) |
985 |
|
|
print *, 'JJhsurfsnm1MID155', hfac_surfnm1s(1,69,1,1) |
986 |
|
|
|
987 |
|
|
print *, 'JJhfaccMID155',hfacc(1,69,49,1,1) |
988 |
|
|
print *, 'JJhfacsMID155',hfacs(1,69,49,1,1) |
989 |
|
|
print *, 'JJhfacwMID155',hfacw(1,69,49,1,1) |
990 |
|
|
|
991 |
|
|
print *, 'JJThetaMID155',theta(1,69,49,1,1) |
992 |
|
|
print *, 'JJSaltMID155',salt(1,69,49,1,1) |
993 |
|
|
|
994 |
|
|
print *, 'JJVvel69MID155',vvel(1,69,49,1,1) |
995 |
|
|
print *, 'JJVvel70MID155',vvel(1,70,49,1,1) |
996 |
|
|
|
997 |
|
|
print *, 'JJwvelMID155',wvel(1,69,49,1,1) |
998 |
|
|
|
999 |
|
|
print *, 'JJgvnm169MID155',gvnm1(1,69,49,1,1) |
1000 |
|
|
print *, 'JJgvnm170MID155',gvnm1(1,70,49,1,1) |
1001 |
|
|
|
1002 |
|
|
print *, 'JJgv69MID155',gv(1,69,49,1,1) |
1003 |
|
|
print *, 'JJgv70MID155',gv(1,70,49,1,1) |
1004 |
|
|
|
1005 |
|
|
print *, 'JJrecip_hfacs69MID155',recip_hfacs(1,69,1,1,1) |
1006 |
|
|
print *, 'JJrecip_hfacs70MID155',recip_hfacs(1,70,1,1,1) |
1007 |
|
|
|
1008 |
|
|
print *, 'JJBo_surfMid155', Bo_Surf(1,69,1,1) |
1009 |
|
|
|
1010 |
|
|
print *, 'JJVEDGE',vVel(1,199,49,1,1) |
1011 |
|
|
|
1012 |
|
|
|
1013 |
|
|
|
1014 |
|
|
|
1015 |
|
|
|
1016 |
|
|
|
1017 |
|
|
|
1018 |
|
|
|
1019 |
|
|
|
1020 |
|
|
|
1021 |
|
|
|
1022 |
|
|
C-- Step forward fields and calculate time tendency terms. |
1023 |
|
|
#ifdef ALLOW_MOM_STEPPING |
1024 |
|
|
#ifndef ALLOW_AUTODIFF |
1025 |
|
|
IF ( momStepping ) THEN |
1026 |
|
|
#endif |
1027 |
|
|
#ifdef ALLOW_DEBUG |
1028 |
|
|
IF (debugMode) CALL DEBUG_CALL('DYNAMICS',myThid) |
1029 |
|
|
#endif |
1030 |
|
|
CALL TIMER_START('DYNAMICS [FORWARD_STEP]',myThid) |
1031 |
|
|
CALL DYNAMICS( myTime, myIter, myThid ) |
1032 |
|
|
CALL TIMER_STOP ('DYNAMICS [FORWARD_STEP]',myThid) |
1033 |
|
|
#ifndef ALLOW_AUTODIFF |
1034 |
|
|
ENDIF |
1035 |
|
|
#endif |
1036 |
|
|
#endif /* ALLOW_MOM_STEPPING */ |
1037 |
|
|
|
1038 |
|
|
|
1039 |
|
|
|
1040 |
|
|
|
1041 |
|
|
|
1042 |
|
|
print *, 'JJetaNMID16', etan(1,69,1,1) |
1043 |
|
|
print *, 'JJetaHMID16', etah(1,69,1,1) |
1044 |
|
|
print *, 'JJdetahdtMID16', detahdt(1,69,1,1) |
1045 |
|
|
|
1046 |
|
|
print *, 'JJhsurfcMID16',hfac_surfc (1,69,1,1) |
1047 |
|
|
print *, 'JJhsurfcnm1MID16', hfac_surfnm1c(1,69,1,1) |
1048 |
|
|
|
1049 |
|
|
print *, 'JJhsurfwMID16',hfac_surfw(1,69,1,1) |
1050 |
|
|
print *, 'JJhsurfwnm1MID16', hfac_surfnm1w(1,69,1,1) |
1051 |
|
|
|
1052 |
|
|
print *, 'JJhsurfsMID16',hfac_surfs(1,69,1,1) |
1053 |
|
|
print *, 'JJhsurfsnm1MID16', hfac_surfnm1s(1,69,1,1) |
1054 |
|
|
|
1055 |
|
|
print *, 'JJhfaccMID16',hfacc(1,69,49,1,1) |
1056 |
|
|
print *, 'JJhfacsMID16',hfacs(1,69,49,1,1) |
1057 |
|
|
print *, 'JJhfacwMID16',hfacw(1,69,49,1,1) |
1058 |
|
|
|
1059 |
|
|
print *, 'JJThetaMID16',theta(1,69,49,1,1) |
1060 |
|
|
print *, 'JJSaltMID16',salt(1,69,49,1,1) |
1061 |
|
|
|
1062 |
|
|
print *, 'JJVvel69MID16',vvel(1,69,49,1,1) |
1063 |
|
|
print *, 'JJVvel70MID16',vvel(1,70,49,1,1) |
1064 |
|
|
|
1065 |
|
|
print *, 'JJwvelMID16',wvel(1,69,49,1,1) |
1066 |
|
|
|
1067 |
|
|
print *, 'JJgvnm169MID16',gvnm1(1,69,49,1,1) |
1068 |
|
|
print *, 'JJgvnm170MID16',gvnm1(1,70,49,1,1) |
1069 |
|
|
|
1070 |
|
|
print *, 'JJgv69MID16',gv(1,69,49,1,1) |
1071 |
|
|
print *, 'JJgv70MID16',gv(1,70,49,1,1) |
1072 |
|
|
|
1073 |
|
|
print *, 'JJrecip_hfacs69MID16',recip_hfacs(1,69,1,1,1) |
1074 |
|
|
print *, 'JJrecip_hfacs70MID16',recip_hfacs(1,70,1,1,1) |
1075 |
|
|
|
1076 |
|
|
print *, 'JJBo_surfMid16', Bo_Surf(1,69,1,1) |
1077 |
|
|
|
1078 |
|
|
|
1079 |
|
|
|
1080 |
|
|
|
1081 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1082 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
1083 |
|
|
CADJ STORE gU, gV = comlev1, key = ikey_dynamics, |
1084 |
|
|
CADJ & kind = isbyte |
1085 |
|
|
# endif |
1086 |
|
|
#endif |
1087 |
|
|
|
1088 |
|
|
C-- Update time-counter |
1089 |
|
|
myIter = nIter0 + iLoop |
1090 |
|
|
myTime = startTime + deltaTClock * float(iLoop) |
1091 |
|
|
|
1092 |
|
|
#ifdef ALLOW_MNC |
1093 |
|
|
C Update MNC time information |
1094 |
|
|
IF ( useMNC ) THEN |
1095 |
|
|
CALL MNC_UPDATE_TIME( myTime, myIter, myThid ) |
1096 |
|
|
ENDIF |
1097 |
|
|
#endif /* ALLOW_MNC */ |
1098 |
|
|
|
1099 |
|
|
#ifdef ALLOW_OFFLINE |
1100 |
|
|
C Load new Offline fields and update state-variable |
1101 |
|
|
IF ( useOffLine ) THEN |
1102 |
|
|
#ifdef ALLOW_DEBUG |
1103 |
|
|
IF (debugMode) CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
1104 |
|
|
#endif /* ALLOW_DEBUG */ |
1105 |
|
|
CALL TIMER_START('OFFLINE_FLDS_LOAD [FORWARD_STEP]',myThid) |
1106 |
|
|
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
1107 |
|
|
CALL TIMER_STOP ('OFFLINE_FLDS_LOAD [FORWARD_STEP]',myThid) |
1108 |
|
|
ENDIF |
1109 |
|
|
#endif /* ALLOW_OFFLINE */ |
1110 |
|
|
|
1111 |
|
|
C-- Update geometric factors: |
1112 |
|
|
#ifdef NONLIN_FRSURF |
1113 |
|
|
C- update hfacC,W,S and recip_hFac according to etaH(n+1) : |
1114 |
|
|
IF ( select_rStar.GT.0 ) THEN |
1115 |
|
|
# ifndef DISABLE_RSTAR_CODE |
1116 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1117 |
|
|
CADJ STORE rStarFacC, rStarFacS, rStarFacW = |
1118 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1119 |
|
|
# endif |
1120 |
|
|
CALL TIMER_START('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
1121 |
|
|
CALL UPDATE_R_STAR( .TRUE., myTime, myIter, myThid ) |
1122 |
|
|
CALL TIMER_STOP ('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
1123 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1124 |
|
|
ELSEIF ( selectSigmaCoord.NE.0 ) THEN |
1125 |
|
|
# ifndef DISABLE_SIGMA_CODE |
1126 |
|
|
CALL UPDATE_SIGMA( etaH, myTime, myIter, myThid ) |
1127 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1128 |
|
|
ELSE |
1129 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1130 |
|
|
CADJ STORE hFac_surfC, hFac_surfS, hFac_surfW |
1131 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1132 |
|
|
# endif |
1133 |
|
|
CALL TIMER_START('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
1134 |
|
|
CALL UPDATE_SURF_DR( .TRUE., myTime, myIter, myThid ) |
1135 |
|
|
CALL TIMER_STOP ('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
1136 |
|
|
ENDIF |
1137 |
|
|
print *, 'JJetaNMID2', etan(1,69,1,1) |
1138 |
|
|
print *, 'JJetaHMID2', etah(1,69,1,1) |
1139 |
|
|
print *, 'JJdetahdtMID2', detahdt(1,69,1,1) |
1140 |
|
|
|
1141 |
|
|
print *, 'JJhsurfcMID2',hfac_surfc (1,69,1,1) |
1142 |
|
|
print *, 'JJhsurfcnm1MID2', hfac_surfnm1c(1,69,1,1) |
1143 |
|
|
|
1144 |
|
|
print *, 'JJhsurfwMID2',hfac_surfw(1,69,1,1) |
1145 |
|
|
print *, 'JJhsurfwnm1MID2', hfac_surfnm1w(1,69,1,1) |
1146 |
|
|
|
1147 |
|
|
print *, 'JJhsurfsMID2',hfac_surfs(1,69,1,1) |
1148 |
|
|
print *, 'JJhsurfsnm1MID2', hfac_surfnm1s(1,69,1,1) |
1149 |
|
|
|
1150 |
|
|
print *, 'JJhfaccMID2',hfacc(1,69,49,1,1) |
1151 |
|
|
print *, 'JJhfacsMID2',hfacs(1,69,49,1,1) |
1152 |
|
|
print *, 'JJhfacwMID2',hfacw(1,69,49,1,1) |
1153 |
|
|
|
1154 |
|
|
print *, 'JJThetaMID2',theta(1,69,49,1,1) |
1155 |
|
|
print *, 'JJSaltMID2',salt(1,69,49,1,1) |
1156 |
|
|
|
1157 |
|
|
print *, 'JJVvel69MID2',vvel(1,69,49,1,1) |
1158 |
|
|
print *, 'JJVvel70MID2',vvel(1,70,49,1,1) |
1159 |
|
|
|
1160 |
|
|
print *, 'JJwvelMID2',wvel(1,69,49,1,1) |
1161 |
|
|
|
1162 |
|
|
print *, 'JJgvnm169MID2',gvnm1(1,69,49,1,1) |
1163 |
|
|
print *, 'JJgvnm170MID2',gvnm1(1,70,49,1,1) |
1164 |
|
|
|
1165 |
|
|
|
1166 |
|
|
|
1167 |
|
|
|
1168 |
|
|
|
1169 |
|
|
|
1170 |
|
|
|
1171 |
|
|
|
1172 |
|
|
|
1173 |
|
|
|
1174 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1175 |
|
|
CADJ STORE hFacC, hFacS, hFacW = |
1176 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1177 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW = |
1178 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1179 |
|
|
# ifdef ALLOW_CG2D_NSA |
1180 |
|
|
CADJ STORE aW2d, aS2d, aC2d = |
1181 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1182 |
|
|
CADJ STORE pC, pS, pW = |
1183 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1184 |
|
|
# endif |
1185 |
|
|
# endif |
1186 |
|
|
C- update also CG2D matrix (and preconditioner) |
1187 |
|
|
IF ( momStepping .AND. nonlinFreeSurf.GT.2 ) THEN |
1188 |
|
|
CALL TIMER_START('UPDATE_CG2D [FORWARD_STEP]',myThid) |
1189 |
|
|
CALL UPDATE_CG2D( myTime, myIter, myThid ) |
1190 |
|
|
CALL TIMER_STOP ('UPDATE_CG2D [FORWARD_STEP]',myThid) |
1191 |
|
|
ENDIF |
1192 |
|
|
#endif /* NONLIN_FRSURF */ |
1193 |
|
|
|
1194 |
|
|
|
1195 |
|
|
C-- Apply Filters to u*,v* before SOLVE_FOR_PRESSURE |
1196 |
|
|
#ifdef ALLOW_SHAP_FILT |
1197 |
|
|
IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN |
1198 |
|
|
CALL TIMER_START('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
1199 |
|
|
IF (implicDiv2Dflow.LT.1.) THEN |
1200 |
|
|
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
1201 |
|
|
C => Filtering of uVel,vVel is necessary |
1202 |
|
|
CALL SHAP_FILT_APPLY_UV( uVel,vVel, |
1203 |
|
|
& myTime, myIter, myThid ) |
1204 |
|
|
ENDIF |
1205 |
|
|
CALL SHAP_FILT_APPLY_UV( gU,gV,myTime,myIter,myThid) |
1206 |
|
|
CALL TIMER_STOP ('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
1207 |
|
|
ENDIF |
1208 |
|
|
#endif |
1209 |
|
|
#ifdef ALLOW_ZONAL_FILT |
1210 |
|
|
IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN |
1211 |
|
|
CALL TIMER_START('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
1212 |
|
|
IF (implicDiv2Dflow.LT.1.) THEN |
1213 |
|
|
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
1214 |
|
|
C => Filtering of uVel,vVel is necessary |
1215 |
|
|
CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid ) |
1216 |
|
|
ENDIF |
1217 |
|
|
CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid ) |
1218 |
|
|
CALL TIMER_STOP ('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
1219 |
|
|
ENDIF |
1220 |
|
|
#endif |
1221 |
|
|
|
1222 |
|
|
C-- Solve elliptic equation(s). |
1223 |
|
|
C Two-dimensional only for conventional hydrostatic or |
1224 |
|
|
C three-dimensional for non-hydrostatic and/or IGW scheme. |
1225 |
|
|
IF ( momStepping ) THEN |
1226 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1227 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
1228 |
|
|
CADJ STORE uVel, vVel |
1229 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1230 |
|
|
CADJ STORE EmPmR,hFacS,hFacW |
1231 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1232 |
|
|
# endif |
1233 |
|
|
#endif |
1234 |
|
|
CALL TIMER_START('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid) |
1235 |
|
|
CALL SOLVE_FOR_PRESSURE(myTime, myIter, myThid) |
1236 |
|
|
CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid) |
1237 |
|
|
ENDIF |
1238 |
|
|
|
1239 |
|
|
C-- Correct divergence in flow field and cycle time-stepping momentum |
1240 |
|
|
#ifdef ALLOW_MOM_STEPPING |
1241 |
|
|
#ifndef ALLOW_AUTODIFF |
1242 |
|
|
IF ( momStepping ) THEN |
1243 |
|
|
#endif |
1244 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1245 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
1246 |
|
|
CADJ STORE etaN, uVel,vVel |
1247 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1248 |
|
|
# endif /* ALLOW_DEPTH_CONTROL */ |
1249 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
1250 |
|
|
CALL TIMER_START('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1251 |
|
|
CALL MOMENTUM_CORRECTION_STEP(myTime, myIter, myThid) |
1252 |
|
|
CALL TIMER_STOP ('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1253 |
|
|
#ifndef ALLOW_AUTODIFF |
1254 |
|
|
ENDIF |
1255 |
|
|
#endif |
1256 |
|
|
#endif /* ALLOW_MOM_STEPPING */ |
1257 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1258 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, kind = isbyte |
1259 |
|
|
#endif |
1260 |
|
|
|
1261 |
|
|
|
1262 |
|
|
print *, 'JJetaNEND0', etan(1,69,1,1) |
1263 |
|
|
print *, 'JJetaHEND0', etah(1,69,1,1) |
1264 |
|
|
print *, 'JJdetahdtEND0', detahdt(1,69,1,1) |
1265 |
|
|
|
1266 |
|
|
print *, 'JJhsurfcEND0',hfac_surfc (1,69,1,1) |
1267 |
|
|
print *, 'JJhsurfcnm1END0', hfac_surfnm1c(1,69,1,1) |
1268 |
|
|
|
1269 |
|
|
print *, 'JJhsurfwEND0',hfac_surfw(1,69,1,1) |
1270 |
|
|
print *, 'JJhsurfwnm1END0', hfac_surfnm1w(1,69,1,1) |
1271 |
|
|
|
1272 |
|
|
print *, 'JJhsurfsEND0',hfac_surfs(1,69,1,1) |
1273 |
|
|
print *, 'JJhsurfsnm1END0', hfac_surfnm1s(1,69,1,1) |
1274 |
|
|
|
1275 |
|
|
print *, 'JJhfaccEND0',hfacc(1,69,49,1,1) |
1276 |
|
|
print *, 'JJhfacsEND0',hfacs(1,69,49,1,1) |
1277 |
|
|
print *, 'JJhfacwEND0',hfacw(1,69,49,1,1) |
1278 |
|
|
|
1279 |
|
|
print *, 'JJThetaEND0',theta(1,69,49,1,1) |
1280 |
|
|
print *, 'JJSaltEND0',salt(1,69,49,1,1) |
1281 |
|
|
|
1282 |
|
|
print *, 'JJVvel69END0',vvel(1,69,49,1,1) |
1283 |
|
|
print *, 'JJVvel70END0',vvel(1,70,49,1,1) |
1284 |
|
|
|
1285 |
|
|
print *, 'JJwvelEND0',wvel(1,69,49,1,1) |
1286 |
|
|
|
1287 |
|
|
print *, 'JJgvnm169END0',gvnm1(1,69,49,1,1) |
1288 |
|
|
print *, 'JJgvnm170END0',gvnm1(1,70,49,1,1) |
1289 |
|
|
|
1290 |
|
|
|
1291 |
|
|
|
1292 |
|
|
IF ( calc_wVelocity ) THEN |
1293 |
|
|
C-- Integrate continuity vertically for vertical velocity |
1294 |
|
|
C (+ update "etaN" & "etaH", exact volume conservation): |
1295 |
|
|
CALL TIMER_START('INTEGR_CONTINUITY [FORWARD_STEP]',myThid) |
1296 |
|
|
CALL INTEGR_CONTINUITY( uVel, vVel, myTime, myIter, myThid) |
1297 |
|
|
CALL TIMER_STOP ('INTEGR_CONTINUITY [FORWARD_STEP]',myThid) |
1298 |
|
|
ENDIF |
1299 |
|
|
|
1300 |
|
|
print *, 'JJetaNEND1', etan(1,69,1,1) |
1301 |
|
|
print *, 'JJetaHEND1', etah(1,69,1,1) |
1302 |
|
|
print *, 'JJdetahdtEND1', detahdt(1,69,1,1) |
1303 |
|
|
|
1304 |
|
|
print *, 'JJhsurfcEND1',hfac_surfc (1,69,1,1) |
1305 |
|
|
print *, 'JJhsurfcnm1END1', hfac_surfnm1c(1,69,1,1) |
1306 |
|
|
|
1307 |
|
|
print *, 'JJhsurfwEND1',hfac_surfw(1,69,1,1) |
1308 |
|
|
print *, 'JJhsurfwnm1END1', hfac_surfnm1w(1,69,1,1) |
1309 |
|
|
|
1310 |
|
|
print *, 'JJhsurfsEND1',hfac_surfs(1,69,1,1) |
1311 |
|
|
print *, 'JJhsurfsnm1END1', hfac_surfnm1s(1,69,1,1) |
1312 |
|
|
|
1313 |
|
|
print *, 'JJhfaccEND1',hfacc(1,69,49,1,1) |
1314 |
|
|
print *, 'JJhfacsEND1',hfacs(1,69,49,1,1) |
1315 |
|
|
print *, 'JJhfacwEND1',hfacw(1,69,49,1,1) |
1316 |
|
|
|
1317 |
|
|
print *, 'JJThetaEND1',theta(1,69,49,1,1) |
1318 |
|
|
print *, 'JJSaltEND1',salt(1,69,49,1,1) |
1319 |
|
|
|
1320 |
|
|
print *, 'JJVvel69END1',vvel(1,69,49,1,1) |
1321 |
|
|
print *, 'JJVvel70END1',vvel(1,70,49,1,1) |
1322 |
|
|
|
1323 |
|
|
print *, 'JJwvelEND1',wvel(1,69,49,1,1) |
1324 |
|
|
|
1325 |
|
|
print *, 'JJgvnm169END1',gvnm1(1,69,49,1,1) |
1326 |
|
|
print *, 'JJgvnm170END1',gvnm1(1,70,49,1,1) |
1327 |
|
|
|
1328 |
|
|
|
1329 |
|
|
|
1330 |
|
|
|
1331 |
|
|
|
1332 |
|
|
|
1333 |
|
|
#ifdef NONLIN_FRSURF |
1334 |
|
|
IF ( select_rStar.NE.0 ) THEN |
1335 |
|
|
# ifndef DISABLE_RSTAR_CODE |
1336 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1337 |
|
|
CADJ STORE etaH |
1338 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1339 |
|
|
CADJ STORE rStarFacC,rStarFacS,rStarFacW |
1340 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1341 |
|
|
# endif |
1342 |
|
|
C-- r* : compute the future level thickness according to etaH(n+1) |
1343 |
|
|
CALL TIMER_START('CALC_R_STAR [FORWARD_STEP]',myThid) |
1344 |
|
|
CALL CALC_R_STAR(etaH, myTime, myIter, myThid ) |
1345 |
|
|
CALL TIMER_STOP ('CALC_R_STAR [FORWARD_STEP]',myThid) |
1346 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1347 |
|
|
ELSEIF ( nonlinFreeSurf.GT.0 .AND. selectSigmaCoord.EQ.0 ) THEN |
1348 |
|
|
C-- compute the future surface level thickness according to etaH(n+1) |
1349 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1350 |
|
|
CADJ STORE etaH = comlev1, key = ikey_dynamics, |
1351 |
|
|
CADJ & kind = isbyte |
1352 |
|
|
# endif |
1353 |
|
|
CALL TIMER_START('CALC_SURF_DR [FORWARD_STEP]',myThid) |
1354 |
|
|
CALL CALC_SURF_DR(etaH, myTime, myIter, myThid ) |
1355 |
|
|
CALL TIMER_STOP ('CALC_SURF_DR [FORWARD_STEP]',myThid) |
1356 |
|
|
ENDIF |
1357 |
|
|
|
1358 |
|
|
|
1359 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1360 |
|
|
CADJ STORE rStarExpC |
1361 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1362 |
|
|
CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, |
1363 |
|
|
CADJ & kind = isbyte |
1364 |
|
|
CADJ STORE salt,theta = comlev1, key = ikey_dynamics, |
1365 |
|
|
CADJ & kind = isbyte |
1366 |
|
|
# endif |
1367 |
|
|
#endif /* NONLIN_FRSURF */ |
1368 |
|
|
|
1369 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
1370 |
|
|
IF ( staggerTimeStep ) THEN |
1371 |
|
|
C-- do exchanges of U,V (needed for multiDim) when using stagger time-step : |
1372 |
|
|
#ifdef ALLOW_DEBUG |
1373 |
|
|
IF (debugMode) |
1374 |
|
|
& CALL DEBUG_CALL('DO_STAGGER_FIELDS_EXCH.',myThid) |
1375 |
|
|
#endif |
1376 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1377 |
|
|
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
1378 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1379 |
|
|
|
1380 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
1381 |
|
|
C-- State-variables diagnostics |
1382 |
|
|
IF ( useDiagnostics ) THEN |
1383 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1384 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 1, myIter, myThid ) |
1385 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1386 |
|
|
ENDIF |
1387 |
|
|
#endif |
1388 |
|
|
|
1389 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1390 |
|
|
CADJ STORE wVel = comlev1, key = ikey_dynamics, kind = isbyte |
1391 |
|
|
#endif |
1392 |
|
|
#ifdef ALLOW_DEBUG |
1393 |
|
|
IF (debugMode) CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
1394 |
|
|
#endif |
1395 |
|
|
CALL TIMER_START('THERMODYNAMICS [FORWARD_STEP]',myThid) |
1396 |
|
|
CALL THERMODYNAMICS( myTime, myIter, myThid ) |
1397 |
|
|
CALL TIMER_STOP ('THERMODYNAMICS [FORWARD_STEP]',myThid) |
1398 |
|
|
|
1399 |
|
|
C-- if staggerTimeStep: end |
1400 |
|
|
ENDIF |
1401 |
|
|
C---+--------+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
1402 |
|
|
|
1403 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1404 |
|
|
cph This is needed because convective_adjustment calls |
1405 |
|
|
cph find_rho which may use pressure() |
1406 |
|
|
CADJ STORE totPhiHyd = comlev1, key = ikey_dynamics, |
1407 |
|
|
CADJ & kind = isbyte |
1408 |
|
|
#endif |
1409 |
|
|
C-- Apply adjustments to Tracers arrays (T,S,+pTracers) |
1410 |
|
|
CALL TIMER_START('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1411 |
|
|
CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid) |
1412 |
|
|
CALL TIMER_STOP ('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1413 |
|
|
|
1414 |
|
|
#ifdef ALLOW_LONGSTEP |
1415 |
|
|
IF ( usePTRACERS ) THEN |
1416 |
|
|
IF ( LS_whenToSample .EQ. 2 ) THEN |
1417 |
|
|
C Average everything at the end of the timestep. This will |
1418 |
|
|
C reproduce online results with staggerTimeStep=.TRUE. |
1419 |
|
|
C when LS_nIter=1 |
1420 |
|
|
#ifdef ALLOW_DEBUG |
1421 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
1422 |
|
|
#endif |
1423 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
1424 |
|
|
C myIter has been update after dynamics, but the averaging window |
1425 |
|
|
C should be determined by myIter at beginning of timestep |
1426 |
|
|
CALL LONGSTEP_AVERAGE( myTimeBeg, myIterBeg, myThid ) |
1427 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
1428 |
|
|
|
1429 |
|
|
#ifdef ALLOW_DEBUG |
1430 |
|
|
IF (debugMode) |
1431 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
1432 |
|
|
#endif |
1433 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
1434 |
|
|
& myThid) |
1435 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
1436 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
1437 |
|
|
& myThid) |
1438 |
|
|
C-- if LS_whenToSample.EQ.2: end |
1439 |
|
|
ENDIF |
1440 |
|
|
|
1441 |
|
|
C-- Apply adjustments to passive Tracers arrays (pTracers) |
1442 |
|
|
c CALL TIMER_START('LS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1443 |
|
|
c CALL LONGSTEP_CORRECTION_STEP(myTime, myIter, myThid) |
1444 |
|
|
c CALL TIMER_STOP ('LS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1445 |
|
|
C-- if usePTRACERS: end |
1446 |
|
|
ENDIF |
1447 |
|
|
#endif /* ALLOW_LONGSTEP */ |
1448 |
|
|
|
1449 |
|
|
#ifdef ALLOW_GCHEM |
1450 |
|
|
C Add separate timestepping of chemical/biological/forcing |
1451 |
|
|
C of ptracers here in GCHEM_FORCING_SEP |
1452 |
|
|
#ifdef ALLOW_LONGSTEP |
1453 |
|
|
IF ( useGCHEM .AND. LS_doTimeStep ) THEN |
1454 |
|
|
#else |
1455 |
|
|
IF ( useGCHEM ) THEN |
1456 |
|
|
#endif |
1457 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1458 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
1459 |
|
|
CADJ & kind = isbyte |
1460 |
|
|
CADJ STORE theta, salt = comlev1, key = ikey_dynamics, |
1461 |
|
|
CADJ & kind = isbyte |
1462 |
|
|
#endif |
1463 |
|
|
#ifdef ALLOW_DEBUG |
1464 |
|
|
IF (debugMode) CALL DEBUG_CALL('GCHEM_FORCING_SEP',myThid) |
1465 |
|
|
#endif /* ALLOW_DEBUG */ |
1466 |
|
|
CALL TIMER_START('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
1467 |
|
|
CALL GCHEM_FORCING_SEP( myTime,myIter,myThid ) |
1468 |
|
|
CALL TIMER_STOP ('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
1469 |
|
|
ENDIF |
1470 |
|
|
#endif /* ALLOW_GCHEM */ |
1471 |
|
|
|
1472 |
|
|
C-- Do "blocking" sends and receives for tendency "overlap" terms |
1473 |
|
|
c CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1474 |
|
|
c CALL DO_GTERM_BLOCKING_EXCHANGES( myThid ) |
1475 |
|
|
c CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1476 |
|
|
|
1477 |
|
|
C-- Do "blocking" sends and receives for field "overlap" terms |
1478 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1479 |
|
|
CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
1480 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1481 |
|
|
|
1482 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
1483 |
|
|
IF ( useDiagnostics ) THEN |
1484 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1485 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 2, myIter, myThid ) |
1486 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1487 |
|
|
ENDIF |
1488 |
|
|
#endif |
1489 |
|
|
|
1490 |
|
|
#ifdef ALLOW_GRIDALT |
1491 |
|
|
IF (useGRIDALT) THEN |
1492 |
|
|
CALL GRIDALT_UPDATE(myThid) |
1493 |
|
|
ENDIF |
1494 |
|
|
#endif |
1495 |
|
|
|
1496 |
|
|
#ifdef ALLOW_FIZHI |
1497 |
|
|
IF (useFIZHI) THEN |
1498 |
|
|
CALL TIMER_START('FIZHI [FORWARD_STEP]',myThid) |
1499 |
|
|
CALL STEP_FIZHI_CORR ( myTime, myIter, myThid, dTtracerLev(1) ) |
1500 |
|
|
CALL TIMER_STOP ('FIZHI [FORWARD_STEP]',myThid) |
1501 |
|
|
ENDIF |
1502 |
|
|
#endif |
1503 |
|
|
|
1504 |
|
|
#ifdef ALLOW_FLT |
1505 |
|
|
C-- Calculate float trajectories |
1506 |
|
|
IF (useFLT) THEN |
1507 |
|
|
CALL TIMER_START('FLOATS [FORWARD_STEP]',myThid) |
1508 |
|
|
CALL FLT_MAIN( myTime, myIter, myThid ) |
1509 |
|
|
CALL TIMER_STOP ('FLOATS [FORWARD_STEP]',myThid) |
1510 |
|
|
ENDIF |
1511 |
|
|
#endif |
1512 |
|
|
|
1513 |
|
|
#ifdef ALLOW_TIMEAVE |
1514 |
|
|
C-- State-variables time-averaging |
1515 |
|
|
CALL TIMER_START('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
1516 |
|
|
CALL DO_STATEVARS_TAVE( myTime, myIter, myThid ) |
1517 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
1518 |
|
|
#endif |
1519 |
|
|
|
1520 |
|
|
#ifdef ALLOW_NEST_PARENT |
1521 |
|
|
IF ( useNEST_PARENT) THEN |
1522 |
|
|
CALL NEST_PARENT_IO_2( myTime, myIter, myThid ) |
1523 |
|
|
ENDIF |
1524 |
|
|
#endif /* ALLOW_NEST_PARENT */ |
1525 |
|
|
|
1526 |
|
|
#ifdef ALLOW_NEST_CHILD |
1527 |
|
|
IF ( useNEST_CHILD) THEN |
1528 |
|
|
CALL NEST_CHILD_TRANSP( myTime, myIter, myThid ) |
1529 |
|
|
ENDIF |
1530 |
|
|
#endif /* ALLOW_NEST_CHILD */ |
1531 |
|
|
|
1532 |
|
|
#ifdef ALLOW_SHELFICE |
1533 |
|
|
C-- Remesh shelfice |
1534 |
|
|
c CALL SHELFICE_REMESHING (myTime, myIter, myThid ) |
1535 |
|
|
#endif /* ALLOW_SHELFICE */ |
1536 |
|
|
|
1537 |
|
|
#ifdef ALLOW_MONITOR |
1538 |
|
|
IF ( monitorFreq.GT.0. .OR. adjMonitorFreq.GT.0. ) THEN |
1539 |
|
|
C-- Check status of solution (statistics, cfl, etc...) |
1540 |
|
|
CALL TIMER_START('MONITOR [FORWARD_STEP]',myThid) |
1541 |
|
|
CALL MONITOR( myTime, myIter, myThid ) |
1542 |
|
|
CALL TIMER_STOP ('MONITOR [FORWARD_STEP]',myThid) |
1543 |
|
|
ENDIF |
1544 |
|
|
#endif /* ALLOW_MONITOR */ |
1545 |
|
|
|
1546 |
|
|
#ifdef ALLOW_COST |
1547 |
|
|
C-- compare model with data and compute cost function |
1548 |
|
|
C-- this is done after exchanges to allow interpolation |
1549 |
|
|
CALL TIMER_START('COST_TILE [FORWARD_STEP]',myThid) |
1550 |
|
|
CALL COST_TILE ( myTime, myIter, myThid ) |
1551 |
|
|
CALL TIMER_STOP ('COST_TILE [FORWARD_STEP]',myThid) |
1552 |
|
|
#endif |
1553 |
|
|
|
1554 |
|
|
C-- Check if it has reached the end of simulation |
1555 |
|
|
modelEnd = myTime.EQ.endTime .OR. myIter.EQ.nEndIter |
1556 |
|
|
#ifdef HAVE_SIGREG |
1557 |
|
|
IF ( useSIGREG ) THEN |
1558 |
|
|
modelEnd = modelEnd .OR. ( i_got_signal.GT.0 ) |
1559 |
|
|
ENDIF |
1560 |
|
|
#endif /* HAVE_SIGREG */ |
1561 |
|
|
|
1562 |
|
|
C-- Do IO if needed. |
1563 |
|
|
CALL TIMER_START('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
1564 |
|
|
CALL DO_THE_MODEL_IO( modelEnd, myTime, myIter, myThid ) |
1565 |
|
|
CALL TIMER_STOP ('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
1566 |
|
|
|
1567 |
|
|
#ifdef ALLOW_PTRACERS |
1568 |
|
|
C Reset the ptracers (but after the io is done) |
1569 |
|
|
IF ( usePTRACERS ) THEN |
1570 |
|
|
CALL TIMER_START('PTRACERS_RESET [FORWARD_STEP]',myThid) |
1571 |
|
|
CALL PTRACERS_RESET( myTime, myIter, myThid ) |
1572 |
|
|
CALL TIMER_STOP ('PTRACERS_RESET [FORWARD_STEP]',myThid) |
1573 |
|
|
ENDIF |
1574 |
|
|
#endif /* ALLOW_PTRACERS */ |
1575 |
|
|
|
1576 |
|
|
C-- Save state for restarts |
1577 |
|
|
CALL TIMER_START('DO_WRITE_PICKUP [FORWARD_STEP]',myThid) |
1578 |
|
|
CALL DO_WRITE_PICKUP( modelEnd, myTime, myIter, myThid ) |
1579 |
|
|
CALL TIMER_STOP ('DO_WRITE_PICKUP [FORWARD_STEP]',myThid) |
1580 |
|
|
|
1581 |
|
|
#ifdef HAVE_SIGREG |
1582 |
|
|
IF ( useSIGREG ) THEN |
1583 |
|
|
IF ( modelEnd .AND. i_got_signal.GT.0 ) THEN |
1584 |
|
|
STOP 'Checkpoint completed -- killed by signal handler' |
1585 |
|
|
ENDIF |
1586 |
|
|
ENDIF |
1587 |
|
|
#endif /* HAVE_SIGREG */ |
1588 |
|
|
|
1589 |
|
|
#ifdef ALLOW_AUTODIFF |
1590 |
|
|
CALL AUTODIFF_INADMODE_SET( myThid ) |
1591 |
|
|
#endif |
1592 |
|
|
|
1593 |
|
|
#ifdef ALLOW_SHOWFLOPS |
1594 |
|
|
CALL TIMER_START('SHOWFLOPS_INLOOP [THE_MAIN_LOOP]', myThid) |
1595 |
|
|
CALL SHOWFLOPS_INLOOP( iloop, myThid ) |
1596 |
|
|
CALL TIMER_STOP ('SHOWFLOPS_INLOOP [THE_MAIN_LOOP]', myThid) |
1597 |
|
|
#endif |
1598 |
|
|
|
1599 |
|
|
#ifdef ALLOW_DEBUG |
1600 |
|
|
IF (debugMode) CALL DEBUG_LEAVE('FORWARD_STEP',myThid) |
1601 |
|
|
#endif |
1602 |
|
|
|
1603 |
|
|
|
1604 |
|
|
print *, 'JJetaNEND', etan(1,69,1,1) |
1605 |
|
|
print *, 'JJetaHEND', etah(1,69,1,1) |
1606 |
|
|
print *, 'JJdetahdtEND', detahdt(1,69,1,1) |
1607 |
|
|
|
1608 |
|
|
print *, 'JJhsurfcEND',hfac_surfc (1,69,1,1) |
1609 |
|
|
print *, 'JJhsurfcnm1END', hfac_surfnm1c(1,69,1,1) |
1610 |
|
|
|
1611 |
|
|
print *, 'JJhsurfwEND',hfac_surfw(1,69,1,1) |
1612 |
|
|
print *, 'JJhsurfwnm1END', hfac_surfnm1w(1,69,1,1) |
1613 |
|
|
|
1614 |
|
|
print *, 'JJhsurfsEND',hfac_surfs(1,69,1,1) |
1615 |
|
|
print *, 'JJhsurfsnm1END', hfac_surfnm1s(1,69,1,1) |
1616 |
|
|
|
1617 |
|
|
print *, 'JJhfaccEND',h0facc(1,69,49,1,1) |
1618 |
|
|
print *, 'JJhfacsEND',hfacs(1,69,49,1,1) |
1619 |
|
|
print *, 'JJhfacwEND',hfacw(1,69,49,1,1) |
1620 |
|
|
|
1621 |
|
|
print *, 'JJThetaEND',theta(1,69,49,1,1) |
1622 |
|
|
print *, 'JJSaltEND',salt(1,69,49,1,1) |
1623 |
|
|
|
1624 |
|
|
print *, 'JJVvel69END',vvel(1,69,49,1,1) |
1625 |
|
|
print *, 'JJVvel70END',vvel(1,70,49,1,1) |
1626 |
|
|
|
1627 |
|
|
print *, 'JJwvelEND',wvel(1,69,49,1,1) |
1628 |
|
|
|
1629 |
|
|
print *, 'JJgvnm169END',gvnm1(1,69,49,1,1) |
1630 |
|
|
print *, 'JJgvnm170END',gvnm1(1,70,49,1,1) |
1631 |
|
|
|
1632 |
|
|
|
1633 |
|
|
|
1634 |
|
|
RETURN |
1635 |
|
|
END |