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 *, 'JJksurfc', ksurfc(1,69,1,1) |
395 |
|
|
print *, 'JJksurfs', ksurfs(1,69,1,1) |
396 |
|
|
print *, 'JJksurfw', ksurfw(1,69,1,1) |
397 |
|
|
|
398 |
|
|
|
399 |
|
|
print *, 'JJhsurfcSTA',hfac_surfc (1,69,1,1) |
400 |
|
|
print *, 'JJhsurfcnm1STA', hfac_surfnm1c(1,69,1,1) |
401 |
|
|
|
402 |
|
|
print *, 'JJhsurfwSTA',hfac_surfw(1,69,1,1) |
403 |
|
|
print *, 'JJhsurfwnm1STA', hfac_surfnm1w(1,69,1,1) |
404 |
|
|
|
405 |
|
|
print *, 'JJhsurfsSTA',hfac_surfs(1,69,1,1) |
406 |
|
|
print *, 'JJhsurfsnm1STA', hfac_surfnm1s(1,69,1,1) |
407 |
|
|
|
408 |
|
|
print *, 'JJhfaccSTA',hfacc(1,69,49,1,1) |
409 |
|
|
print *, 'JJhfacsSTA',hfacs(1,69,49,1,1) |
410 |
|
|
print *, 'JJhfacwSTA',hfacw(1,69,49,1,1) |
411 |
|
|
|
412 |
|
|
print *, 'JJThetaSTA',theta(1,69,49,1,1) |
413 |
|
|
print *, 'JJSaltSTA',salt(1,69,49,1,1) |
414 |
|
|
|
415 |
|
|
print *, 'JJVvel69STA',vvel(1,69,49,1,1) |
416 |
|
|
print *, 'JJVvel70STA',vvel(1,70,49,1,1) |
417 |
|
|
|
418 |
|
|
print *, 'JJwvelSTA',wvel(1,69,49,1,1) |
419 |
|
|
|
420 |
|
|
print *, 'JJgvnm169STA',gvnm1(1,69,49,1,1) |
421 |
|
|
print *, 'JJgvnm170STA',gvnm1(1,70,49,1,1) |
422 |
|
|
|
423 |
|
|
|
424 |
|
|
|
425 |
|
|
|
426 |
|
|
|
427 |
|
|
#ifdef ALLOW_SHELFICE |
428 |
|
|
C-- Remesh shelfice |
429 |
|
|
CALL TIMER_START('SHELFICE_REMESHING [FORWARD_STEP]',myThid) |
430 |
|
|
CALL SHELFICE_REMESHING (myTime, myIter, myThid ) |
431 |
|
|
CALL TIMER_STOP('SHELFICE_REMESHING [FORWARD_STEP]',myThid) |
432 |
|
|
|
433 |
|
|
#endif /* ALLOW_SHELFICE */ |
434 |
|
|
|
435 |
|
|
print *, 'JJetaNMID', etan(1,69,1,1) |
436 |
|
|
print *, 'JJetaHMID', etah(1,69,1,1) |
437 |
|
|
print *, 'JJdetahdtMID', detahdt(1,69,1,1) |
438 |
|
|
|
439 |
|
|
print *, 'JJksurfc', ksurfc(1,69,1,1) |
440 |
|
|
print *, 'JJksurfs', ksurfs(1,69,1,1) |
441 |
|
|
print *, 'JJksurfw', ksurfw(1,69,1,1) |
442 |
|
|
|
443 |
|
|
|
444 |
|
|
print *, 'JJrhoinsituMID', rhoinsitu(1,69,49,1,1) |
445 |
|
|
|
446 |
|
|
print *, 'JJhsurfcMID',hfac_surfc (1,69,1,1) |
447 |
|
|
print *, 'JJhsurfcnm1MID', hfac_surfnm1c(1,69,1,1) |
448 |
|
|
|
449 |
|
|
print *, 'JJhsurfwMID',hfac_surfw(1,69,1,1) |
450 |
|
|
print *, 'JJhsurfwnm1MID', hfac_surfnm1w(1,69,1,1) |
451 |
|
|
|
452 |
|
|
print *, 'JJhsurfsMID',hfac_surfs(1,69,1,1) |
453 |
|
|
print *, 'JJhsurfsnm1MID', hfac_surfnm1s(1,69,1,1) |
454 |
|
|
|
455 |
|
|
print *, 'JJhfaccMID',hfacc(1,69,49,1,1) |
456 |
|
|
print *, 'JJhfacsMID',hfacs(1,69,49,1,1) |
457 |
|
|
print *, 'JJhfacwMID',hfacw(1,69,49,1,1) |
458 |
|
|
|
459 |
|
|
print *, 'JJThetaMID',theta(1,69,49,1,1) |
460 |
|
|
print *, 'JJSaltMID',salt(1,69,49,1,1) |
461 |
|
|
|
462 |
|
|
print *, 'JJVvel69MID',vvel(1,69,49,1,1) |
463 |
|
|
print *, 'JJVvel70MID',vvel(1,70,49,1,1) |
464 |
|
|
|
465 |
|
|
print *, 'JJwvelMID',wvel(1,69,49,1,1) |
466 |
|
|
|
467 |
|
|
print *, 'JJgvnm169MID',gvnm1(1,69,49,1,1) |
468 |
|
|
print *, 'JJgvnm170MID',gvnm1(1,70,49,1,1) |
469 |
|
|
|
470 |
|
|
|
471 |
|
|
|
472 |
|
|
|
473 |
|
|
#ifdef ALLOW_DEBUG |
474 |
|
|
IF (debugMode) CALL DEBUG_ENTER('FORWARD_STEP',myThid) |
475 |
|
|
#endif |
476 |
|
|
|
477 |
|
|
#ifdef ALLOW_AUTODIFF |
478 |
|
|
CALL AUTODIFF_INADMODE_UNSET( myThid ) |
479 |
|
|
#endif |
480 |
|
|
|
481 |
|
|
#ifdef ALLOW_AUTODIFF |
482 |
|
|
C-- Reset the model iteration counter and the model time. |
483 |
|
|
myIter = nIter0 + (iloop-1) |
484 |
|
|
myTime = startTime + float(iloop-1)*deltaTClock |
485 |
|
|
#endif |
486 |
|
|
|
487 |
|
|
#ifdef ALLOW_LONGSTEP |
488 |
|
|
C store this for longstep_average with staggerTimeStep |
489 |
|
|
C which is called after myIter and myTime are incremented |
490 |
|
|
C but needs iter/time at beginning of time step |
491 |
|
|
myIterBeg = myIter |
492 |
|
|
myTimeBeg = myTime |
493 |
|
|
#endif /* ALLOW_LONGSTEP */ |
494 |
|
|
|
495 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
496 |
|
|
c************************************** |
497 |
|
|
#include "checkpoint_lev1_directives.h" |
498 |
|
|
#include "checkpoint_lev1_template.h" |
499 |
|
|
c************************************** |
500 |
|
|
#endif |
501 |
|
|
C-- Reset geometric factors (hFacC,W,S & recip_hFac) to their current values: |
502 |
|
|
C added to simplify adjoint derivation - no effect in forward run |
503 |
|
|
#ifdef NONLIN_FRSURF |
504 |
|
|
#ifndef ALLOW_AUTODIFF |
505 |
|
|
IF ( doResetHFactors ) THEN |
506 |
|
|
#endif |
507 |
|
|
CALL RESET_NLFS_VARS( myTime, myIter, myThid ) |
508 |
|
|
IF ( select_rStar.GT.0 ) THEN |
509 |
|
|
# ifndef DISABLE_RSTAR_CODE |
510 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
511 |
|
|
CADJ STORE rStarFacC, rStarFacS, rStarFacW = |
512 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
513 |
|
|
# endif |
514 |
|
|
CALL TIMER_START('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
515 |
|
|
CALL UPDATE_R_STAR( .FALSE., myTime, myIter, myThid ) |
516 |
|
|
CALL TIMER_STOP ('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
517 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
518 |
|
|
ELSE |
519 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
520 |
|
|
CADJ STORE hFac_surfC, hFac_surfS, hFac_surfW |
521 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
522 |
|
|
#endif |
523 |
|
|
CALL TIMER_START('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
524 |
|
|
CALL UPDATE_SURF_DR( .FALSE., myTime, myIter, myThid ) |
525 |
|
|
CALL TIMER_STOP ('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
526 |
|
|
ENDIF |
527 |
|
|
|
528 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
529 |
|
|
CADJ STORE hFacC, hFacS, hFacW = |
530 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
531 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW = |
532 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
533 |
|
|
#endif |
534 |
|
|
#ifndef ALLOW_AUTODIFF |
535 |
|
|
ENDIF |
536 |
|
|
#endif |
537 |
|
|
#endif /* NONLIN_FRSURF */ |
538 |
|
|
|
539 |
|
|
#ifdef ALLOW_PTRACERS |
540 |
|
|
C-- Switch on/off individual tracer time-stepping |
541 |
|
|
IF ( usePTRACERS ) THEN |
542 |
|
|
CALL PTRACERS_SWITCH_ONOFF( myTime, myIter, myThid ) |
543 |
|
|
ENDIF |
544 |
|
|
#endif /* ALLOW_PTRACERS */ |
545 |
|
|
|
546 |
|
|
C-- Switch on/off diagnostics for snap-shot output: |
547 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
548 |
|
|
IF ( useDiagnostics ) THEN |
549 |
|
|
CALL DIAGNOSTICS_SWITCH_ONOFF( myTime, myIter, myThid ) |
550 |
|
|
C-- State-variables diagnostics |
551 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
552 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 0, myIter, myThid ) |
553 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
554 |
|
|
ENDIF |
555 |
|
|
#endif /* ALLOW_DIAGNOSTICS */ |
556 |
|
|
|
557 |
|
|
#ifdef ALLOW_NEST_CHILD |
558 |
|
|
IF ( useNEST_CHILD) THEN |
559 |
|
|
CALL NEST_CHILD_SETMEMO( myTime, myIter, myThid ) |
560 |
|
|
ENDIF |
561 |
|
|
#endif /* ALLOW_NEST_CHILD */ |
562 |
|
|
|
563 |
|
|
#ifdef ALLOW_NEST_PARENT |
564 |
|
|
IF ( useNEST_PARENT) THEN |
565 |
|
|
CALL NEST_PARENT_IO_1( myTime, myIter, myThid ) |
566 |
|
|
ENDIF |
567 |
|
|
#endif /* ALLOW_NEST_PARENT */ |
568 |
|
|
|
569 |
|
|
C-- Call driver to load external forcing fields from file |
570 |
|
|
#ifdef ALLOW_DEBUG |
571 |
|
|
IF (debugMode) CALL DEBUG_CALL('LOAD_FIELDS_DRIVER',myThid) |
572 |
|
|
#endif |
573 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
574 |
|
|
cph Important STORE that avoids hidden recomp. of load_fields_driver |
575 |
|
|
CADJ STORE theta = comlev1, key = ikey_dynamics, |
576 |
|
|
CADJ & kind = isbyte |
577 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, |
578 |
|
|
CADJ & kind = isbyte |
579 |
|
|
#endif |
580 |
|
|
CALL TIMER_START('LOAD_FIELDS_DRIVER [FORWARD_STEP]',myThid) |
581 |
|
|
CALL LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) |
582 |
|
|
CALL TIMER_STOP ('LOAD_FIELDS_DRIVER [FORWARD_STEP]',myThid) |
583 |
|
|
|
584 |
|
|
C-- Call Bulk-Formulae forcing package |
585 |
|
|
#ifdef ALLOW_BULK_FORCE |
586 |
|
|
IF ( useBulkForce ) THEN |
587 |
|
|
#ifdef ALLOW_DEBUG |
588 |
|
|
IF (debugMode) CALL DEBUG_CALL('BULKF_FORCING',myThid) |
589 |
|
|
#endif |
590 |
|
|
CALL TIMER_START('BULKF_FORCING [FORWARD_STEP]',myThid) |
591 |
|
|
C- calculate qnet and empmr (and wind stress) |
592 |
|
|
CALL BULKF_FORCING( myTime, myIter, myThid ) |
593 |
|
|
CALL TIMER_STOP ('BULKF_FORCING [FORWARD_STEP]',myThid) |
594 |
|
|
ENDIF |
595 |
|
|
#endif /* ALLOW_BULK_FORCE */ |
596 |
|
|
|
597 |
|
|
C-- Call external chepaml forcing package |
598 |
|
|
#ifdef ALLOW_CHEAPAML |
599 |
|
|
IF ( useCheapAML ) THEN |
600 |
|
|
#ifdef ALLOW_DEBUG |
601 |
|
|
IF (debugMode) CALL DEBUG_CALL('CHEAPAML',myThid) |
602 |
|
|
#endif |
603 |
|
|
CALL TIMER_START('CHEAPAML [FORWARD_STEP]',myThid) |
604 |
|
|
C- calculate qnet (and wind stress) |
605 |
|
|
CALL CHEAPAML( myTime, myIter,myThid ) |
606 |
|
|
CALL TIMER_STOP ('CHEAPAML [FORWARD_STEP]',myThid) |
607 |
|
|
ENDIF |
608 |
|
|
#endif /*ALLOW_CHEAPAML */ |
609 |
|
|
|
610 |
|
|
#ifdef ALLOW_CTRL |
611 |
|
|
C-- Add control vector for forcing and parameter fields |
612 |
|
|
IF ( ( useCTRL ).AND.( myIter .EQ. nIter0 ) ) |
613 |
|
|
& CALL CTRL_MAP_FORCING (myThid) |
614 |
|
|
#endif |
615 |
|
|
|
616 |
|
|
#ifdef ALLOW_AUTODIFF_MONITOR |
617 |
|
|
CALL DUMMY_IN_STEPPING( myTime, myIter, myThid ) |
618 |
|
|
#endif |
619 |
|
|
|
620 |
|
|
#ifdef COMPONENT_MODULE |
621 |
|
|
IF ( useCoupler ) THEN |
622 |
|
|
C Post coupling data that I export. |
623 |
|
|
C Read in coupling data that I import. |
624 |
|
|
CALL TIMER_START('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid) |
625 |
|
|
CALL CPL_EXPORT_MY_DATA( myTime, myIter, myThid ) |
626 |
|
|
CALL CPL_IMPORT_EXTERNAL_DATA( myTime, myIter, myThid ) |
627 |
|
|
CALL TIMER_STOP ('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid) |
628 |
|
|
ENDIF |
629 |
|
|
#endif /* COMPONENT_MODULE */ |
630 |
|
|
#ifdef ALLOW_OASIS |
631 |
|
|
IF ( useOASIS ) THEN |
632 |
|
|
CALL TIMER_START('OASIS_PUT-GET [FORWARD_STEP]',myThid) |
633 |
|
|
C Post coupling data that I export. |
634 |
|
|
CALL OASIS_PUT( myTime, myIter, myThid ) |
635 |
|
|
C Read in coupling data that I import. |
636 |
|
|
CALL OASIS_GET( myTime, myIter, myThid ) |
637 |
|
|
CALL TIMER_STOP ('OASIS_PUT-GET [FORWARD_STEP]',myThid) |
638 |
|
|
ENDIF |
639 |
|
|
#endif /* ALLOW_OASIS */ |
640 |
|
|
|
641 |
|
|
#ifdef ALLOW_EBM |
642 |
|
|
IF ( useEBM ) THEN |
643 |
|
|
# ifdef ALLOW_DEBUG |
644 |
|
|
IF (debugMode) CALL DEBUG_CALL('EBM',myThid) |
645 |
|
|
# endif |
646 |
|
|
CALL TIMER_START('EBM [FORWARD_STEP]',myThid) |
647 |
|
|
CALL EBM_DRIVER ( myTime, myIter, myThid ) |
648 |
|
|
CALL TIMER_STOP ('EBM [FORWARD_STEP]',myThid) |
649 |
|
|
ENDIF |
650 |
|
|
#endif /* ALLOW_EBM */ |
651 |
|
|
|
652 |
|
|
print *, 'JJetaNMID1', etan(1,69,1,1) |
653 |
|
|
print *, 'JJetaHMID1', etah(1,69,1,1) |
654 |
|
|
print *, 'JJdetahdtMID1', detahdt(1,69,1,1) |
655 |
|
|
|
656 |
|
|
print *, 'JJhsurfcMID1',hfac_surfc (1,69,1,1) |
657 |
|
|
print *, 'JJhsurfcnm1MID1', hfac_surfnm1c(1,69,1,1) |
658 |
|
|
|
659 |
|
|
print *, 'JJhsurfwMID1',hfac_surfw(1,69,1,1) |
660 |
|
|
print *, 'JJhsurfwnm1MID1', hfac_surfnm1w(1,69,1,1) |
661 |
|
|
|
662 |
|
|
print *, 'JJhsurfsMID1',hfac_surfs(1,69,1,1) |
663 |
|
|
print *, 'JJhsurfsnm1MID1', hfac_surfnm1s(1,69,1,1) |
664 |
|
|
|
665 |
|
|
print *, 'JJhfaccMID1',hfacc(1,69,49,1,1) |
666 |
|
|
print *, 'JJhfacsMID1',hfacs(1,69,49,1,1) |
667 |
|
|
print *, 'JJhfacwMID1',hfacw(1,69,49,1,1) |
668 |
|
|
|
669 |
|
|
print *, 'JJThetaMID1',theta(1,69,49,1,1) |
670 |
|
|
print *, 'JJSaltMID1',salt(1,69,49,1,1) |
671 |
|
|
|
672 |
|
|
print *, 'JJVvel69MID1',vvel(1,69,49,1,1) |
673 |
|
|
print *, 'JJVvel70MID1',vvel(1,70,49,1,1) |
674 |
|
|
|
675 |
|
|
print *, 'JJwvelMID1',wvel(1,69,49,1,1) |
676 |
|
|
|
677 |
|
|
print *, 'JJgvnm169MID1',gvnm1(1,69,49,1,1) |
678 |
|
|
print *, 'JJgvnm170MID1',gvnm1(1,70,49,1,1) |
679 |
|
|
|
680 |
|
|
|
681 |
|
|
|
682 |
|
|
|
683 |
|
|
|
684 |
|
|
|
685 |
|
|
|
686 |
|
|
|
687 |
|
|
|
688 |
|
|
|
689 |
|
|
|
690 |
|
|
|
691 |
|
|
|
692 |
|
|
C-- Step forward fields and calculate time tendency terms. |
693 |
|
|
|
694 |
|
|
#ifdef ALLOW_DEBUG |
695 |
|
|
IF (debugMode) CALL DEBUG_CALL('DO_ATMOSPHERIC_PHYS',myThid) |
696 |
|
|
#endif |
697 |
|
|
CALL TIMER_START('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',myThid) |
698 |
|
|
CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid ) |
699 |
|
|
CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',myThid) |
700 |
|
|
|
701 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
702 |
|
|
CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics, |
703 |
|
|
CADJ & kind = isbyte |
704 |
|
|
# ifdef ALLOW_KPP |
705 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, |
706 |
|
|
CADJ & kind = isbyte |
707 |
|
|
# endif /* ALLOW_KPP */ |
708 |
|
|
# ifdef EXACT_CONSERV |
709 |
|
|
CADJ STORE EmPmR = comlev1, key=ikey_dynamics, kind=isbyte |
710 |
|
|
CADJ STORE PmEpR = comlev1, key=ikey_dynamics, kind=isbyte |
711 |
|
|
# endif |
712 |
|
|
# ifdef ALLOW_OBCS |
713 |
|
|
CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte |
714 |
|
|
CADJ STORE totphihyd = comlev1, key=ikey_dynamics, kind=isbyte |
715 |
|
|
# ifdef ALLOW_OBCS_STEVENS |
716 |
|
|
CADJ STORE gsNm1 = comlev1, key=ikey_dynamics, kind=isbyte |
717 |
|
|
CADJ STORE gtNm1 = comlev1, key=ikey_dynamics, kind=isbyte |
718 |
|
|
# endif |
719 |
|
|
# endif /* ALLOW_OBCS */ |
720 |
|
|
# ifdef ALLOW_PTRACERS |
721 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
722 |
|
|
CADJ & kind = isbyte |
723 |
|
|
# endif /* ALLOW_PTRACERS */ |
724 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
725 |
|
|
CADJ STORE hFacC = comlev1, key = ikey_dynamics, kind = isbyte |
726 |
|
|
# endif |
727 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
728 |
|
|
|
729 |
|
|
#ifdef ALLOW_DEBUG |
730 |
|
|
IF (debugMode) CALL DEBUG_CALL('DO_OCEANIC_PHYS',myThid) |
731 |
|
|
#endif |
732 |
|
|
CALL TIMER_START('DO_OCEANIC_PHYS [FORWARD_STEP]',myThid) |
733 |
|
|
CALL DO_OCEANIC_PHYS( myTime, myIter, myThid ) |
734 |
|
|
CALL TIMER_STOP ('DO_OCEANIC_PHYS [FORWARD_STEP]',myThid) |
735 |
|
|
|
736 |
|
|
|
737 |
|
|
#ifdef ALLOW_STREAMICE |
738 |
|
|
IF (useStreamIce) THEN |
739 |
|
|
CALL STREAMICE_TIMESTEP ( myThid, myIter, |
740 |
|
|
& iLoop, myTime ) |
741 |
|
|
ENDIF |
742 |
|
|
#endif |
743 |
|
|
|
744 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
745 |
|
|
CADJ STORE EmPmR = comlev1, key = ikey_dynamics, |
746 |
|
|
CADJ & kind = isbyte |
747 |
|
|
# ifdef EXACT_CONSERV |
748 |
|
|
CADJ STORE PmEpR = comlev1, key = ikey_dynamics, |
749 |
|
|
CADJ & kind = isbyte |
750 |
|
|
# endif |
751 |
|
|
cph-test( |
752 |
|
|
CADJ STORE surfaceForcingU = comlev1, key=ikey_dynamics, kind=isbyte |
753 |
|
|
CADJ STORE surfaceForcingV = comlev1, key=ikey_dynamics, kind=isbyte |
754 |
|
|
CADJ STORE qsw = comlev1, key = ikey_dynamics, kind = isbyte |
755 |
|
|
# ifdef ATMOSPHERIC_LOADING |
756 |
|
|
CADJ STORE phi0surf = comlev1, key = ikey_dynamics, kind = isbyte |
757 |
|
|
# endif |
758 |
|
|
cph-test) |
759 |
|
|
|
760 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
761 |
|
|
CADJ STORE hFacC, hFacS, hFacW |
762 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
763 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW |
764 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
765 |
|
|
CADJ STORE surfaceForcingU, surfaceForcingV = |
766 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
767 |
|
|
# endif |
768 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
769 |
|
|
|
770 |
|
|
#ifdef ALLOW_GCHEM |
771 |
|
|
IF ( useGCHEM ) THEN |
772 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
773 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
774 |
|
|
CADJ & kind = isbyte |
775 |
|
|
CADJ STORE theta, salt = comlev1, key = ikey_dynamics, |
776 |
|
|
CADJ & kind = isbyte |
777 |
|
|
#endif |
778 |
|
|
#ifdef ALLOW_DEBUG |
779 |
|
|
IF (debugMode) CALL DEBUG_CALL('GCHEM_CALC_TENDENCY',myThid) |
780 |
|
|
#endif |
781 |
|
|
CALL TIMER_START('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
782 |
|
|
CALL GCHEM_CALC_TENDENCY( myTime, myIter, myThid ) |
783 |
|
|
CALL TIMER_STOP ('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
784 |
|
|
ENDIF |
785 |
|
|
#endif /* ALLOW_GCHEM */ |
786 |
|
|
|
787 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
788 |
|
|
cph needed to be moved here from do_oceanic_physics |
789 |
|
|
cph to be visible down the road |
790 |
|
|
|
791 |
|
|
CADJ STORE rhoInSitu = comlev1, key = ikey_dynamics, |
792 |
|
|
CADJ & kind = isbyte |
793 |
|
|
CADJ STORE surfaceForcingS = comlev1, key = ikey_dynamics, |
794 |
|
|
CADJ & kind = isbyte |
795 |
|
|
CADJ STORE surfaceForcingT = comlev1, key = ikey_dynamics, |
796 |
|
|
CADJ & kind = isbyte |
797 |
|
|
CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics, |
798 |
|
|
CADJ & kind = isbyte |
799 |
|
|
CADJ STORE IVDConvCount = comlev1, key = ikey_dynamics, |
800 |
|
|
CADJ & kind = isbyte |
801 |
|
|
# ifdef ALLOW_PTRACERS |
802 |
|
|
CADJ STORE surfaceForcingPTr = comlev1, key = ikey_dynamics, |
803 |
|
|
CADJ & kind = isbyte |
804 |
|
|
# endif |
805 |
|
|
|
806 |
|
|
# ifdef ALLOW_GMREDI |
807 |
|
|
CADJ STORE Kwx = comlev1, key = ikey_dynamics, |
808 |
|
|
CADJ & kind = isbyte |
809 |
|
|
CADJ STORE Kwy = comlev1, key = ikey_dynamics, |
810 |
|
|
CADJ & kind = isbyte |
811 |
|
|
CADJ STORE Kwz = comlev1, key = ikey_dynamics, |
812 |
|
|
CADJ & kind = isbyte |
813 |
|
|
# ifdef GM_BOLUS_ADVEC |
814 |
|
|
CADJ STORE GM_PsiX = comlev1, key = ikey_dynamics, |
815 |
|
|
CADJ & kind = isbyte |
816 |
|
|
CADJ STORE GM_PsiY = comlev1, key = ikey_dynamics, |
817 |
|
|
CADJ & kind = isbyte |
818 |
|
|
# endif |
819 |
|
|
# endif |
820 |
|
|
|
821 |
|
|
# ifdef ALLOW_KPP |
822 |
|
|
CADJ STORE KPPghat = comlev1, key = ikey_dynamics, |
823 |
|
|
CADJ & kind = isbyte |
824 |
|
|
CADJ STORE KPPfrac = comlev1, key = ikey_dynamics, |
825 |
|
|
CADJ & kind = isbyte |
826 |
|
|
CADJ STORE KPPdiffKzS = comlev1, key = ikey_dynamics, |
827 |
|
|
CADJ & kind = isbyte |
828 |
|
|
CADJ STORE KPPdiffKzT = comlev1, key = ikey_dynamics, |
829 |
|
|
CADJ & kind = isbyte |
830 |
|
|
# endif |
831 |
|
|
|
832 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
833 |
|
|
CADJ STORE theta,salt = comlev1, key = ikey_dynamics, kind = isbyte |
834 |
|
|
CADJ STORE etaH = comlev1, key = ikey_dynamics, kind = isbyte |
835 |
|
|
# ifdef ALLOW_CD_CODE |
836 |
|
|
CADJ STORE etaNm1 = comlev1, key = ikey_dynamics, kind = isbyte |
837 |
|
|
# endif |
838 |
|
|
# ifndef DISABLE_RSTAR_CODE |
839 |
|
|
CADJ STORE rStarExpC = comlev1, key = ikey_dynamics, kind = isbyte |
840 |
|
|
# endif |
841 |
|
|
# endif |
842 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
843 |
|
|
|
844 |
|
|
print *, 'JJetaNMID15', etan(1,69,1,1) |
845 |
|
|
print *, 'JJetaHMID15', etah(1,69,1,1) |
846 |
|
|
print *, 'JJdetahdtMID15', detahdt(1,69,1,1) |
847 |
|
|
|
848 |
|
|
print *, 'JJhsurfcMID15',hfac_surfc (1,69,1,1) |
849 |
|
|
print *, 'JJhsurfcnm1MID15', hfac_surfnm1c(1,69,1,1) |
850 |
|
|
|
851 |
|
|
print *, 'JJhsurfwMID15',hfac_surfw(1,69,1,1) |
852 |
|
|
print *, 'JJhsurfwnm1MID15', hfac_surfnm1w(1,69,1,1) |
853 |
|
|
|
854 |
|
|
print *, 'JJhsurfsMID15',hfac_surfs(1,69,1,1) |
855 |
|
|
print *, 'JJhsurfsnm1MID15', hfac_surfnm1s(1,69,1,1) |
856 |
|
|
|
857 |
|
|
print *, 'JJhfaccMID15',hfacc(1,69,49,1,1) |
858 |
|
|
print *, 'JJhfacsMID15',hfacs(1,69,49,1,1) |
859 |
|
|
print *, 'JJhfacwMID15',hfacw(1,69,49,1,1) |
860 |
|
|
|
861 |
|
|
print *, 'JJThetaMID15',theta(1,69,49,1,1) |
862 |
|
|
print *, 'JJSaltMID15',salt(1,69,49,1,1) |
863 |
|
|
|
864 |
|
|
print *, 'JJVvel69MID15',vvel(1,69,49,1,1) |
865 |
|
|
print *, 'JJVvel70MID15',vvel(1,70,49,1,1) |
866 |
|
|
|
867 |
|
|
print *, 'JJwvelMID15',wvel(1,69,49,1,1) |
868 |
|
|
|
869 |
|
|
print *, 'JJgvnm169MID15',gvnm1(1,69,49,1,1) |
870 |
|
|
print *, 'JJgvnm170MID15',gvnm1(1,70,49,1,1) |
871 |
|
|
|
872 |
|
|
|
873 |
|
|
|
874 |
|
|
|
875 |
|
|
|
876 |
|
|
#ifdef ALLOW_LONGSTEP |
877 |
|
|
IF ( usePTRACERS .AND. LS_whenToSample .EQ. 0 ) THEN |
878 |
|
|
C Average all variables before advection (but after do_oceanic_phys |
879 |
|
|
C where Qsw, KPP and GMRedi stuff is computed). |
880 |
|
|
C This is like diagnostics package and will reproduce offline |
881 |
|
|
C results. |
882 |
|
|
#ifdef ALLOW_DEBUG |
883 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
884 |
|
|
#endif |
885 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
886 |
|
|
CALL LONGSTEP_AVERAGE( myTime, myIter, myThid ) |
887 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
888 |
|
|
|
889 |
|
|
#ifdef ALLOW_DEBUG |
890 |
|
|
IF (debugMode) |
891 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
892 |
|
|
#endif |
893 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
894 |
|
|
& myThid) |
895 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
896 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
897 |
|
|
& myThid) |
898 |
|
|
ENDIF |
899 |
|
|
#endif /* ALLOW_LONGSTEP */ |
900 |
|
|
|
901 |
|
|
IF ( .NOT.staggerTimeStep ) THEN |
902 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
903 |
|
|
CADJ STORE wVel = comlev1, key = ikey_dynamics, kind = isbyte |
904 |
|
|
#endif |
905 |
|
|
#ifdef ALLOW_DEBUG |
906 |
|
|
IF (debugMode) CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
907 |
|
|
#endif |
908 |
|
|
CALL TIMER_START('THERMODYNAMICS [FORWARD_STEP]',myThid) |
909 |
|
|
CALL THERMODYNAMICS( myTime, myIter, myThid ) |
910 |
|
|
CALL TIMER_STOP ('THERMODYNAMICS [FORWARD_STEP]',myThid) |
911 |
|
|
C-- if not staggerTimeStep: end |
912 |
|
|
ENDIF |
913 |
|
|
|
914 |
|
|
#ifdef ALLOW_LONGSTEP |
915 |
|
|
IF ( usePTRACERS .AND. LS_whenToSample .EQ. 1 ) THEN |
916 |
|
|
C Average T and S after thermodynamics, but U,V,W before dynamics. |
917 |
|
|
C This will reproduce online results with staggerTimeStep=.FALSE. |
918 |
|
|
C for LS_nIter=1 |
919 |
|
|
#ifdef ALLOW_DEBUG |
920 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
921 |
|
|
#endif |
922 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
923 |
|
|
CALL LONGSTEP_AVERAGE( myTime, myIter, myThid ) |
924 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
925 |
|
|
|
926 |
|
|
#ifdef ALLOW_DEBUG |
927 |
|
|
IF (debugMode) |
928 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
929 |
|
|
#endif |
930 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
931 |
|
|
& myThid) |
932 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
933 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
934 |
|
|
& myThid) |
935 |
|
|
ENDIF |
936 |
|
|
#endif /* ALLOW_LONGSTEP */ |
937 |
|
|
|
938 |
|
|
c #ifdef ALLOW_NONHYDROSTATIC |
939 |
|
|
IF ( implicitIntGravWave ) THEN |
940 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
941 |
|
|
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
942 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
943 |
|
|
ENDIF |
944 |
|
|
c #endif |
945 |
|
|
|
946 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
947 |
|
|
CADJ STORE etaN = comlev1, key = ikey_dynamics, kind = isbyte |
948 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
949 |
|
|
CADJ STORE hFacC, hFacS, hFacW |
950 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
951 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW |
952 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
953 |
|
|
# endif /* ALLOW_DEPTH_CONTROL */ |
954 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
955 |
|
|
|
956 |
|
|
|
957 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJSALTA',' ',gsnm1,0,myThid) |
958 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJTHETAA',' ',gtnm1,0,myThid) |
959 |
|
|
CALL WRITE_FLD_XYZ_RS( 'JRJWVELA',' ',wVel,0,myThid) |
960 |
|
|
|
961 |
|
|
|
962 |
|
|
|
963 |
|
|
|
964 |
|
|
|
965 |
|
|
print *, 'JJetaNMID155', etan(1,69,1,1) |
966 |
|
|
print *, 'JJetaHMID155', etah(1,69,1,1) |
967 |
|
|
print *, 'JJdetahdtMID155', detahdt(1,69,1,1) |
968 |
|
|
|
969 |
|
|
print *, 'JJhsurfcMID155',hfac_surfc (1,69,1,1) |
970 |
|
|
print *, 'JJhsurfcnm1MID155', hfac_surfnm1c(1,69,1,1) |
971 |
|
|
|
972 |
|
|
print *, 'JJhsurfwMID155',hfac_surfw(1,69,1,1) |
973 |
|
|
print *, 'JJhsurfwnm1MID155', hfac_surfnm1w(1,69,1,1) |
974 |
|
|
|
975 |
|
|
print *, 'JJhsurfsMID155',hfac_surfs(1,69,1,1) |
976 |
|
|
print *, 'JJhsurfsnm1MID155', hfac_surfnm1s(1,69,1,1) |
977 |
|
|
|
978 |
|
|
print *, 'JJhfaccMID155',hfacc(1,69,49,1,1) |
979 |
|
|
print *, 'JJhfacsMID155',hfacs(1,69,49,1,1) |
980 |
|
|
print *, 'JJhfacwMID155',hfacw(1,69,49,1,1) |
981 |
|
|
|
982 |
|
|
print *, 'JJThetaMID155',theta(1,69,49,1,1) |
983 |
|
|
print *, 'JJSaltMID155',salt(1,69,49,1,1) |
984 |
|
|
|
985 |
|
|
print *, 'JJVvel69MID155',vvel(1,69,49,1,1) |
986 |
|
|
print *, 'JJVvel70MID155',vvel(1,70,49,1,1) |
987 |
|
|
|
988 |
|
|
print *, 'JJwvelMID155',wvel(1,69,49,1,1) |
989 |
|
|
|
990 |
|
|
print *, 'JJgvnm169MID155',gvnm1(1,69,49,1,1) |
991 |
|
|
print *, 'JJgvnm170MID155',gvnm1(1,70,49,1,1) |
992 |
|
|
|
993 |
|
|
print *, 'JJgv69MID155',gv(1,69,49,1,1) |
994 |
|
|
print *, 'JJgv70MID155',gv(1,70,49,1,1) |
995 |
|
|
|
996 |
|
|
print *, 'JJrecip_hfacs69MID155',recip_hfacs(1,69,1,1,1) |
997 |
|
|
print *, 'JJrecip_hfacs70MID155',recip_hfacs(1,70,1,1,1) |
998 |
|
|
|
999 |
|
|
print *, 'JJBo_surfMid155', Bo_Surf(1,69,1,1) |
1000 |
|
|
|
1001 |
|
|
print *, 'JJVEDGE',vVel(1,199,49,1,1) |
1002 |
|
|
|
1003 |
|
|
|
1004 |
|
|
|
1005 |
|
|
|
1006 |
|
|
|
1007 |
|
|
|
1008 |
|
|
|
1009 |
|
|
|
1010 |
|
|
|
1011 |
|
|
|
1012 |
|
|
|
1013 |
|
|
C-- Step forward fields and calculate time tendency terms. |
1014 |
|
|
#ifdef ALLOW_MOM_STEPPING |
1015 |
|
|
#ifndef ALLOW_AUTODIFF |
1016 |
|
|
IF ( momStepping ) THEN |
1017 |
|
|
#endif |
1018 |
|
|
#ifdef ALLOW_DEBUG |
1019 |
|
|
IF (debugMode) CALL DEBUG_CALL('DYNAMICS',myThid) |
1020 |
|
|
#endif |
1021 |
|
|
CALL TIMER_START('DYNAMICS [FORWARD_STEP]',myThid) |
1022 |
|
|
CALL DYNAMICS( myTime, myIter, myThid ) |
1023 |
|
|
CALL TIMER_STOP ('DYNAMICS [FORWARD_STEP]',myThid) |
1024 |
|
|
#ifndef ALLOW_AUTODIFF |
1025 |
|
|
ENDIF |
1026 |
|
|
#endif |
1027 |
|
|
#endif /* ALLOW_MOM_STEPPING */ |
1028 |
|
|
|
1029 |
|
|
|
1030 |
|
|
|
1031 |
|
|
|
1032 |
|
|
|
1033 |
|
|
print *, 'JJetaNMID16', etan(1,69,1,1) |
1034 |
|
|
print *, 'JJetaHMID16', etah(1,69,1,1) |
1035 |
|
|
print *, 'JJdetahdtMID16', detahdt(1,69,1,1) |
1036 |
|
|
|
1037 |
|
|
print *, 'JJhsurfcMID16',hfac_surfc (1,69,1,1) |
1038 |
|
|
print *, 'JJhsurfcnm1MID16', hfac_surfnm1c(1,69,1,1) |
1039 |
|
|
|
1040 |
|
|
print *, 'JJhsurfwMID16',hfac_surfw(1,69,1,1) |
1041 |
|
|
print *, 'JJhsurfwnm1MID16', hfac_surfnm1w(1,69,1,1) |
1042 |
|
|
|
1043 |
|
|
print *, 'JJhsurfsMID16',hfac_surfs(1,69,1,1) |
1044 |
|
|
print *, 'JJhsurfsnm1MID16', hfac_surfnm1s(1,69,1,1) |
1045 |
|
|
|
1046 |
|
|
print *, 'JJhfaccMID16',hfacc(1,69,49,1,1) |
1047 |
|
|
print *, 'JJhfacsMID16',hfacs(1,69,49,1,1) |
1048 |
|
|
print *, 'JJhfacwMID16',hfacw(1,69,49,1,1) |
1049 |
|
|
|
1050 |
|
|
print *, 'JJThetaMID16',theta(1,69,49,1,1) |
1051 |
|
|
print *, 'JJSaltMID16',salt(1,69,49,1,1) |
1052 |
|
|
|
1053 |
|
|
print *, 'JJVvel69MID16',vvel(1,69,49,1,1) |
1054 |
|
|
print *, 'JJVvel70MID16',vvel(1,70,49,1,1) |
1055 |
|
|
|
1056 |
|
|
print *, 'JJwvelMID16',wvel(1,69,49,1,1) |
1057 |
|
|
|
1058 |
|
|
print *, 'JJgvnm169MID16',gvnm1(1,69,49,1,1) |
1059 |
|
|
print *, 'JJgvnm170MID16',gvnm1(1,70,49,1,1) |
1060 |
|
|
|
1061 |
|
|
print *, 'JJgv69MID16',gv(1,69,49,1,1) |
1062 |
|
|
print *, 'JJgv70MID16',gv(1,70,49,1,1) |
1063 |
|
|
|
1064 |
|
|
print *, 'JJrecip_hfacs69MID16',recip_hfacs(1,69,1,1,1) |
1065 |
|
|
print *, 'JJrecip_hfacs70MID16',recip_hfacs(1,70,1,1,1) |
1066 |
|
|
|
1067 |
|
|
print *, 'JJBo_surfMid16', Bo_Surf(1,69,1,1) |
1068 |
|
|
|
1069 |
|
|
|
1070 |
|
|
|
1071 |
|
|
|
1072 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1073 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
1074 |
|
|
CADJ STORE gU, gV = comlev1, key = ikey_dynamics, |
1075 |
|
|
CADJ & kind = isbyte |
1076 |
|
|
# endif |
1077 |
|
|
#endif |
1078 |
|
|
|
1079 |
|
|
C-- Update time-counter |
1080 |
|
|
myIter = nIter0 + iLoop |
1081 |
|
|
myTime = startTime + deltaTClock * float(iLoop) |
1082 |
|
|
|
1083 |
|
|
#ifdef ALLOW_MNC |
1084 |
|
|
C Update MNC time information |
1085 |
|
|
IF ( useMNC ) THEN |
1086 |
|
|
CALL MNC_UPDATE_TIME( myTime, myIter, myThid ) |
1087 |
|
|
ENDIF |
1088 |
|
|
#endif /* ALLOW_MNC */ |
1089 |
|
|
|
1090 |
|
|
#ifdef ALLOW_OFFLINE |
1091 |
|
|
C Load new Offline fields and update state-variable |
1092 |
|
|
IF ( useOffLine ) THEN |
1093 |
|
|
#ifdef ALLOW_DEBUG |
1094 |
|
|
IF (debugMode) CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
1095 |
|
|
#endif /* ALLOW_DEBUG */ |
1096 |
|
|
CALL TIMER_START('OFFLINE_FLDS_LOAD [FORWARD_STEP]',myThid) |
1097 |
|
|
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
1098 |
|
|
CALL TIMER_STOP ('OFFLINE_FLDS_LOAD [FORWARD_STEP]',myThid) |
1099 |
|
|
ENDIF |
1100 |
|
|
#endif /* ALLOW_OFFLINE */ |
1101 |
|
|
|
1102 |
|
|
C-- Update geometric factors: |
1103 |
|
|
#ifdef NONLIN_FRSURF |
1104 |
|
|
C- update hfacC,W,S and recip_hFac according to etaH(n+1) : |
1105 |
|
|
IF ( select_rStar.GT.0 ) THEN |
1106 |
|
|
# ifndef DISABLE_RSTAR_CODE |
1107 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1108 |
|
|
CADJ STORE rStarFacC, rStarFacS, rStarFacW = |
1109 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1110 |
|
|
# endif |
1111 |
|
|
CALL TIMER_START('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
1112 |
|
|
CALL UPDATE_R_STAR( .TRUE., myTime, myIter, myThid ) |
1113 |
|
|
CALL TIMER_STOP ('UPDATE_R_STAR [FORWARD_STEP]',myThid) |
1114 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1115 |
|
|
ELSEIF ( selectSigmaCoord.NE.0 ) THEN |
1116 |
|
|
# ifndef DISABLE_SIGMA_CODE |
1117 |
|
|
CALL UPDATE_SIGMA( etaH, myTime, myIter, myThid ) |
1118 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1119 |
|
|
ELSE |
1120 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1121 |
|
|
CADJ STORE hFac_surfC, hFac_surfS, hFac_surfW |
1122 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1123 |
|
|
# endif |
1124 |
|
|
CALL TIMER_START('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
1125 |
|
|
CALL UPDATE_SURF_DR( .TRUE., myTime, myIter, myThid ) |
1126 |
|
|
CALL TIMER_STOP ('UPDATE_SURF_DR [FORWARD_STEP]',myThid) |
1127 |
|
|
ENDIF |
1128 |
|
|
print *, 'JJetaNMID2', etan(1,69,1,1) |
1129 |
|
|
print *, 'JJetaHMID2', etah(1,69,1,1) |
1130 |
|
|
print *, 'JJdetahdtMID2', detahdt(1,69,1,1) |
1131 |
|
|
|
1132 |
|
|
print *, 'JJhsurfcMID2',hfac_surfc (1,69,1,1) |
1133 |
|
|
print *, 'JJhsurfcnm1MID2', hfac_surfnm1c(1,69,1,1) |
1134 |
|
|
|
1135 |
|
|
print *, 'JJhsurfwMID2',hfac_surfw(1,69,1,1) |
1136 |
|
|
print *, 'JJhsurfwnm1MID2', hfac_surfnm1w(1,69,1,1) |
1137 |
|
|
|
1138 |
|
|
print *, 'JJhsurfsMID2',hfac_surfs(1,69,1,1) |
1139 |
|
|
print *, 'JJhsurfsnm1MID2', hfac_surfnm1s(1,69,1,1) |
1140 |
|
|
|
1141 |
|
|
print *, 'JJhfaccMID2',hfacc(1,69,49,1,1) |
1142 |
|
|
print *, 'JJhfacsMID2',hfacs(1,69,49,1,1) |
1143 |
|
|
print *, 'JJhfacwMID2',hfacw(1,69,49,1,1) |
1144 |
|
|
|
1145 |
|
|
print *, 'JJThetaMID2',theta(1,69,49,1,1) |
1146 |
|
|
print *, 'JJSaltMID2',salt(1,69,49,1,1) |
1147 |
|
|
|
1148 |
|
|
print *, 'JJVvel69MID2',vvel(1,69,49,1,1) |
1149 |
|
|
print *, 'JJVvel70MID2',vvel(1,70,49,1,1) |
1150 |
|
|
|
1151 |
|
|
print *, 'JJwvelMID2',wvel(1,69,49,1,1) |
1152 |
|
|
|
1153 |
|
|
print *, 'JJgvnm169MID2',gvnm1(1,69,49,1,1) |
1154 |
|
|
print *, 'JJgvnm170MID2',gvnm1(1,70,49,1,1) |
1155 |
|
|
|
1156 |
|
|
|
1157 |
|
|
|
1158 |
|
|
|
1159 |
|
|
|
1160 |
|
|
|
1161 |
|
|
|
1162 |
|
|
|
1163 |
|
|
|
1164 |
|
|
|
1165 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1166 |
|
|
CADJ STORE hFacC, hFacS, hFacW = |
1167 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1168 |
|
|
CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW = |
1169 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1170 |
|
|
# ifdef ALLOW_CG2D_NSA |
1171 |
|
|
CADJ STORE aW2d, aS2d, aC2d = |
1172 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1173 |
|
|
CADJ STORE pC, pS, pW = |
1174 |
|
|
CADJ & comlev1, key = ikey_dynamics, kind = isbyte |
1175 |
|
|
# endif |
1176 |
|
|
# endif |
1177 |
|
|
C- update also CG2D matrix (and preconditioner) |
1178 |
|
|
IF ( momStepping .AND. nonlinFreeSurf.GT.2 ) THEN |
1179 |
|
|
CALL TIMER_START('UPDATE_CG2D [FORWARD_STEP]',myThid) |
1180 |
|
|
CALL UPDATE_CG2D( myTime, myIter, myThid ) |
1181 |
|
|
CALL TIMER_STOP ('UPDATE_CG2D [FORWARD_STEP]',myThid) |
1182 |
|
|
ENDIF |
1183 |
|
|
#endif /* NONLIN_FRSURF */ |
1184 |
|
|
|
1185 |
|
|
|
1186 |
|
|
C-- Apply Filters to u*,v* before SOLVE_FOR_PRESSURE |
1187 |
|
|
#ifdef ALLOW_SHAP_FILT |
1188 |
|
|
IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN |
1189 |
|
|
CALL TIMER_START('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
1190 |
|
|
IF (implicDiv2Dflow.LT.1.) THEN |
1191 |
|
|
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
1192 |
|
|
C => Filtering of uVel,vVel is necessary |
1193 |
|
|
CALL SHAP_FILT_APPLY_UV( uVel,vVel, |
1194 |
|
|
& myTime, myIter, myThid ) |
1195 |
|
|
ENDIF |
1196 |
|
|
CALL SHAP_FILT_APPLY_UV( gU,gV,myTime,myIter,myThid) |
1197 |
|
|
CALL TIMER_STOP ('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
1198 |
|
|
ENDIF |
1199 |
|
|
#endif |
1200 |
|
|
#ifdef ALLOW_ZONAL_FILT |
1201 |
|
|
IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN |
1202 |
|
|
CALL TIMER_START('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
1203 |
|
|
IF (implicDiv2Dflow.LT.1.) THEN |
1204 |
|
|
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
1205 |
|
|
C => Filtering of uVel,vVel is necessary |
1206 |
|
|
CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid ) |
1207 |
|
|
ENDIF |
1208 |
|
|
CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid ) |
1209 |
|
|
CALL TIMER_STOP ('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
1210 |
|
|
ENDIF |
1211 |
|
|
#endif |
1212 |
|
|
|
1213 |
|
|
C-- Solve elliptic equation(s). |
1214 |
|
|
C Two-dimensional only for conventional hydrostatic or |
1215 |
|
|
C three-dimensional for non-hydrostatic and/or IGW scheme. |
1216 |
|
|
IF ( momStepping ) THEN |
1217 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1218 |
|
|
# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
1219 |
|
|
CADJ STORE uVel, vVel |
1220 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1221 |
|
|
CADJ STORE EmPmR,hFacS,hFacW |
1222 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1223 |
|
|
# endif |
1224 |
|
|
#endif |
1225 |
|
|
CALL TIMER_START('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid) |
1226 |
|
|
CALL SOLVE_FOR_PRESSURE(myTime, myIter, myThid) |
1227 |
|
|
CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid) |
1228 |
|
|
ENDIF |
1229 |
|
|
|
1230 |
|
|
C-- Correct divergence in flow field and cycle time-stepping momentum |
1231 |
|
|
#ifdef ALLOW_MOM_STEPPING |
1232 |
|
|
#ifndef ALLOW_AUTODIFF |
1233 |
|
|
IF ( momStepping ) THEN |
1234 |
|
|
#endif |
1235 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1236 |
|
|
# ifdef ALLOW_DEPTH_CONTROL |
1237 |
|
|
CADJ STORE etaN, uVel,vVel |
1238 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1239 |
|
|
# endif /* ALLOW_DEPTH_CONTROL */ |
1240 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
1241 |
|
|
CALL TIMER_START('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1242 |
|
|
CALL MOMENTUM_CORRECTION_STEP(myTime, myIter, myThid) |
1243 |
|
|
CALL TIMER_STOP ('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1244 |
|
|
#ifndef ALLOW_AUTODIFF |
1245 |
|
|
ENDIF |
1246 |
|
|
#endif |
1247 |
|
|
#endif /* ALLOW_MOM_STEPPING */ |
1248 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1249 |
|
|
CADJ STORE uVel, vVel = comlev1, key = ikey_dynamics, kind = isbyte |
1250 |
|
|
#endif |
1251 |
|
|
|
1252 |
|
|
|
1253 |
|
|
print *, 'JJetaNEND0', etan(1,69,1,1) |
1254 |
|
|
print *, 'JJetaHEND0', etah(1,69,1,1) |
1255 |
|
|
print *, 'JJdetahdtEND0', detahdt(1,69,1,1) |
1256 |
|
|
|
1257 |
|
|
print *, 'JJhsurfcEND0',hfac_surfc (1,69,1,1) |
1258 |
|
|
print *, 'JJhsurfcnm1END0', hfac_surfnm1c(1,69,1,1) |
1259 |
|
|
|
1260 |
|
|
print *, 'JJhsurfwEND0',hfac_surfw(1,69,1,1) |
1261 |
|
|
print *, 'JJhsurfwnm1END0', hfac_surfnm1w(1,69,1,1) |
1262 |
|
|
|
1263 |
|
|
print *, 'JJhsurfsEND0',hfac_surfs(1,69,1,1) |
1264 |
|
|
print *, 'JJhsurfsnm1END0', hfac_surfnm1s(1,69,1,1) |
1265 |
|
|
|
1266 |
|
|
print *, 'JJhfaccEND0',hfacc(1,69,49,1,1) |
1267 |
|
|
print *, 'JJhfacsEND0',hfacs(1,69,49,1,1) |
1268 |
|
|
print *, 'JJhfacwEND0',hfacw(1,69,49,1,1) |
1269 |
|
|
|
1270 |
|
|
print *, 'JJThetaEND0',theta(1,69,49,1,1) |
1271 |
|
|
print *, 'JJSaltEND0',salt(1,69,49,1,1) |
1272 |
|
|
|
1273 |
|
|
print *, 'JJVvel69END0',vvel(1,69,49,1,1) |
1274 |
|
|
print *, 'JJVvel70END0',vvel(1,70,49,1,1) |
1275 |
|
|
|
1276 |
|
|
print *, 'JJwvelEND0',wvel(1,69,49,1,1) |
1277 |
|
|
|
1278 |
|
|
print *, 'JJgvnm169END0',gvnm1(1,69,49,1,1) |
1279 |
|
|
print *, 'JJgvnm170END0',gvnm1(1,70,49,1,1) |
1280 |
|
|
|
1281 |
|
|
|
1282 |
|
|
|
1283 |
|
|
IF ( calc_wVelocity ) THEN |
1284 |
|
|
C-- Integrate continuity vertically for vertical velocity |
1285 |
|
|
C (+ update "etaN" & "etaH", exact volume conservation): |
1286 |
|
|
CALL TIMER_START('INTEGR_CONTINUITY [FORWARD_STEP]',myThid) |
1287 |
|
|
CALL INTEGR_CONTINUITY( uVel, vVel, myTime, myIter, myThid) |
1288 |
|
|
CALL TIMER_STOP ('INTEGR_CONTINUITY [FORWARD_STEP]',myThid) |
1289 |
|
|
ENDIF |
1290 |
|
|
|
1291 |
|
|
print *, 'JJetaNEND1', etan(1,69,1,1) |
1292 |
|
|
print *, 'JJetaHEND1', etah(1,69,1,1) |
1293 |
|
|
print *, 'JJdetahdtEND1', detahdt(1,69,1,1) |
1294 |
|
|
|
1295 |
|
|
print *, 'JJhsurfcEND1',hfac_surfc (1,69,1,1) |
1296 |
|
|
print *, 'JJhsurfcnm1END1', hfac_surfnm1c(1,69,1,1) |
1297 |
|
|
|
1298 |
|
|
print *, 'JJhsurfwEND1',hfac_surfw(1,69,1,1) |
1299 |
|
|
print *, 'JJhsurfwnm1END1', hfac_surfnm1w(1,69,1,1) |
1300 |
|
|
|
1301 |
|
|
print *, 'JJhsurfsEND1',hfac_surfs(1,69,1,1) |
1302 |
|
|
print *, 'JJhsurfsnm1END1', hfac_surfnm1s(1,69,1,1) |
1303 |
|
|
|
1304 |
|
|
print *, 'JJhfaccEND1',hfacc(1,69,49,1,1) |
1305 |
|
|
print *, 'JJhfacsEND1',hfacs(1,69,49,1,1) |
1306 |
|
|
print *, 'JJhfacwEND1',hfacw(1,69,49,1,1) |
1307 |
|
|
|
1308 |
|
|
print *, 'JJThetaEND1',theta(1,69,49,1,1) |
1309 |
|
|
print *, 'JJSaltEND1',salt(1,69,49,1,1) |
1310 |
|
|
|
1311 |
|
|
print *, 'JJVvel69END1',vvel(1,69,49,1,1) |
1312 |
|
|
print *, 'JJVvel70END1',vvel(1,70,49,1,1) |
1313 |
|
|
|
1314 |
|
|
print *, 'JJwvelEND1',wvel(1,69,49,1,1) |
1315 |
|
|
|
1316 |
|
|
print *, 'JJgvnm169END1',gvnm1(1,69,49,1,1) |
1317 |
|
|
print *, 'JJgvnm170END1',gvnm1(1,70,49,1,1) |
1318 |
|
|
|
1319 |
|
|
|
1320 |
|
|
|
1321 |
|
|
|
1322 |
|
|
|
1323 |
|
|
|
1324 |
|
|
#ifdef NONLIN_FRSURF |
1325 |
|
|
IF ( select_rStar.NE.0 ) THEN |
1326 |
|
|
# ifndef DISABLE_RSTAR_CODE |
1327 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1328 |
|
|
CADJ STORE etaH |
1329 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1330 |
|
|
CADJ STORE rStarFacC,rStarFacS,rStarFacW |
1331 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1332 |
|
|
# endif |
1333 |
|
|
C-- r* : compute the future level thickness according to etaH(n+1) |
1334 |
|
|
CALL TIMER_START('CALC_R_STAR [FORWARD_STEP]',myThid) |
1335 |
|
|
CALL CALC_R_STAR(etaH, myTime, myIter, myThid ) |
1336 |
|
|
CALL TIMER_STOP ('CALC_R_STAR [FORWARD_STEP]',myThid) |
1337 |
|
|
# endif /* DISABLE_RSTAR_CODE */ |
1338 |
|
|
ELSEIF ( nonlinFreeSurf.GT.0 .AND. selectSigmaCoord.EQ.0 ) THEN |
1339 |
|
|
C-- compute the future surface level thickness according to etaH(n+1) |
1340 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1341 |
|
|
CADJ STORE etaH = comlev1, key = ikey_dynamics, |
1342 |
|
|
CADJ & kind = isbyte |
1343 |
|
|
# endif |
1344 |
|
|
CALL TIMER_START('CALC_SURF_DR [FORWARD_STEP]',myThid) |
1345 |
|
|
CALL CALC_SURF_DR(etaH, myTime, myIter, myThid ) |
1346 |
|
|
CALL TIMER_STOP ('CALC_SURF_DR [FORWARD_STEP]',myThid) |
1347 |
|
|
ENDIF |
1348 |
|
|
|
1349 |
|
|
|
1350 |
|
|
# ifdef ALLOW_AUTODIFF_TAMC |
1351 |
|
|
CADJ STORE rStarExpC |
1352 |
|
|
CADJ & = comlev1, key = ikey_dynamics, kind = isbyte |
1353 |
|
|
CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, |
1354 |
|
|
CADJ & kind = isbyte |
1355 |
|
|
CADJ STORE salt,theta = comlev1, key = ikey_dynamics, |
1356 |
|
|
CADJ & kind = isbyte |
1357 |
|
|
# endif |
1358 |
|
|
#endif /* NONLIN_FRSURF */ |
1359 |
|
|
|
1360 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
1361 |
|
|
IF ( staggerTimeStep ) THEN |
1362 |
|
|
C-- do exchanges of U,V (needed for multiDim) when using stagger time-step : |
1363 |
|
|
#ifdef ALLOW_DEBUG |
1364 |
|
|
IF (debugMode) |
1365 |
|
|
& CALL DEBUG_CALL('DO_STAGGER_FIELDS_EXCH.',myThid) |
1366 |
|
|
#endif |
1367 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1368 |
|
|
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
1369 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1370 |
|
|
|
1371 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
1372 |
|
|
C-- State-variables diagnostics |
1373 |
|
|
IF ( useDiagnostics ) THEN |
1374 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1375 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 1, myIter, myThid ) |
1376 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1377 |
|
|
ENDIF |
1378 |
|
|
#endif |
1379 |
|
|
|
1380 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1381 |
|
|
CADJ STORE wVel = comlev1, key = ikey_dynamics, kind = isbyte |
1382 |
|
|
#endif |
1383 |
|
|
#ifdef ALLOW_DEBUG |
1384 |
|
|
IF (debugMode) CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
1385 |
|
|
#endif |
1386 |
|
|
CALL TIMER_START('THERMODYNAMICS [FORWARD_STEP]',myThid) |
1387 |
|
|
CALL THERMODYNAMICS( myTime, myIter, myThid ) |
1388 |
|
|
CALL TIMER_STOP ('THERMODYNAMICS [FORWARD_STEP]',myThid) |
1389 |
|
|
|
1390 |
|
|
C-- if staggerTimeStep: end |
1391 |
|
|
ENDIF |
1392 |
|
|
C---+--------+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
1393 |
|
|
|
1394 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1395 |
|
|
cph This is needed because convective_adjustment calls |
1396 |
|
|
cph find_rho which may use pressure() |
1397 |
|
|
CADJ STORE totPhiHyd = comlev1, key = ikey_dynamics, |
1398 |
|
|
CADJ & kind = isbyte |
1399 |
|
|
#endif |
1400 |
|
|
C-- Apply adjustments to Tracers arrays (T,S,+pTracers) |
1401 |
|
|
CALL TIMER_START('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1402 |
|
|
CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid) |
1403 |
|
|
CALL TIMER_STOP ('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1404 |
|
|
|
1405 |
|
|
#ifdef ALLOW_LONGSTEP |
1406 |
|
|
IF ( usePTRACERS ) THEN |
1407 |
|
|
IF ( LS_whenToSample .EQ. 2 ) THEN |
1408 |
|
|
C Average everything at the end of the timestep. This will |
1409 |
|
|
C reproduce online results with staggerTimeStep=.TRUE. |
1410 |
|
|
C when LS_nIter=1 |
1411 |
|
|
#ifdef ALLOW_DEBUG |
1412 |
|
|
IF (debugMode) CALL DEBUG_CALL('LONGSTEP_AVERAGE',myThid) |
1413 |
|
|
#endif |
1414 |
|
|
CALL TIMER_START('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
1415 |
|
|
C myIter has been update after dynamics, but the averaging window |
1416 |
|
|
C should be determined by myIter at beginning of timestep |
1417 |
|
|
CALL LONGSTEP_AVERAGE( myTimeBeg, myIterBeg, myThid ) |
1418 |
|
|
CALL TIMER_STOP ('LONGSTEP_AVERAGE [FORWARD_STEP]',myThid) |
1419 |
|
|
|
1420 |
|
|
#ifdef ALLOW_DEBUG |
1421 |
|
|
IF (debugMode) |
1422 |
|
|
& CALL DEBUG_CALL('LONGSTEP_THERMODYNAMICS',myThid) |
1423 |
|
|
#endif |
1424 |
|
|
CALL TIMER_START('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
1425 |
|
|
& myThid) |
1426 |
|
|
CALL LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid ) |
1427 |
|
|
CALL TIMER_STOP ('LONGSTEP_THERMODYNAMICS [FORWARD_STEP]', |
1428 |
|
|
& myThid) |
1429 |
|
|
C-- if LS_whenToSample.EQ.2: end |
1430 |
|
|
ENDIF |
1431 |
|
|
|
1432 |
|
|
C-- Apply adjustments to passive Tracers arrays (pTracers) |
1433 |
|
|
c CALL TIMER_START('LS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1434 |
|
|
c CALL LONGSTEP_CORRECTION_STEP(myTime, myIter, myThid) |
1435 |
|
|
c CALL TIMER_STOP ('LS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
1436 |
|
|
C-- if usePTRACERS: end |
1437 |
|
|
ENDIF |
1438 |
|
|
#endif /* ALLOW_LONGSTEP */ |
1439 |
|
|
|
1440 |
|
|
#ifdef ALLOW_GCHEM |
1441 |
|
|
C Add separate timestepping of chemical/biological/forcing |
1442 |
|
|
C of ptracers here in GCHEM_FORCING_SEP |
1443 |
|
|
#ifdef ALLOW_LONGSTEP |
1444 |
|
|
IF ( useGCHEM .AND. LS_doTimeStep ) THEN |
1445 |
|
|
#else |
1446 |
|
|
IF ( useGCHEM ) THEN |
1447 |
|
|
#endif |
1448 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
1449 |
|
|
CADJ STORE pTracer = comlev1, key = ikey_dynamics, |
1450 |
|
|
CADJ & kind = isbyte |
1451 |
|
|
CADJ STORE theta, salt = comlev1, key = ikey_dynamics, |
1452 |
|
|
CADJ & kind = isbyte |
1453 |
|
|
#endif |
1454 |
|
|
#ifdef ALLOW_DEBUG |
1455 |
|
|
IF (debugMode) CALL DEBUG_CALL('GCHEM_FORCING_SEP',myThid) |
1456 |
|
|
#endif /* ALLOW_DEBUG */ |
1457 |
|
|
CALL TIMER_START('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
1458 |
|
|
CALL GCHEM_FORCING_SEP( myTime,myIter,myThid ) |
1459 |
|
|
CALL TIMER_STOP ('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
1460 |
|
|
ENDIF |
1461 |
|
|
#endif /* ALLOW_GCHEM */ |
1462 |
|
|
|
1463 |
|
|
C-- Do "blocking" sends and receives for tendency "overlap" terms |
1464 |
|
|
c CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1465 |
|
|
c CALL DO_GTERM_BLOCKING_EXCHANGES( myThid ) |
1466 |
|
|
c CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1467 |
|
|
|
1468 |
|
|
C-- Do "blocking" sends and receives for field "overlap" terms |
1469 |
|
|
CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1470 |
|
|
CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
1471 |
|
|
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
1472 |
|
|
|
1473 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
1474 |
|
|
IF ( useDiagnostics ) THEN |
1475 |
|
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1476 |
|
|
CALL DO_STATEVARS_DIAGS( myTime, 2, myIter, myThid ) |
1477 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
1478 |
|
|
ENDIF |
1479 |
|
|
#endif |
1480 |
|
|
|
1481 |
|
|
#ifdef ALLOW_GRIDALT |
1482 |
|
|
IF (useGRIDALT) THEN |
1483 |
|
|
CALL GRIDALT_UPDATE(myThid) |
1484 |
|
|
ENDIF |
1485 |
|
|
#endif |
1486 |
|
|
|
1487 |
|
|
#ifdef ALLOW_FIZHI |
1488 |
|
|
IF (useFIZHI) THEN |
1489 |
|
|
CALL TIMER_START('FIZHI [FORWARD_STEP]',myThid) |
1490 |
|
|
CALL STEP_FIZHI_CORR ( myTime, myIter, myThid, dTtracerLev(1) ) |
1491 |
|
|
CALL TIMER_STOP ('FIZHI [FORWARD_STEP]',myThid) |
1492 |
|
|
ENDIF |
1493 |
|
|
#endif |
1494 |
|
|
|
1495 |
|
|
#ifdef ALLOW_FLT |
1496 |
|
|
C-- Calculate float trajectories |
1497 |
|
|
IF (useFLT) THEN |
1498 |
|
|
CALL TIMER_START('FLOATS [FORWARD_STEP]',myThid) |
1499 |
|
|
CALL FLT_MAIN( myTime, myIter, myThid ) |
1500 |
|
|
CALL TIMER_STOP ('FLOATS [FORWARD_STEP]',myThid) |
1501 |
|
|
ENDIF |
1502 |
|
|
#endif |
1503 |
|
|
|
1504 |
|
|
#ifdef ALLOW_TIMEAVE |
1505 |
|
|
C-- State-variables time-averaging |
1506 |
|
|
CALL TIMER_START('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
1507 |
|
|
CALL DO_STATEVARS_TAVE( myTime, myIter, myThid ) |
1508 |
|
|
CALL TIMER_STOP ('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
1509 |
|
|
#endif |
1510 |
|
|
|
1511 |
|
|
#ifdef ALLOW_NEST_PARENT |
1512 |
|
|
IF ( useNEST_PARENT) THEN |
1513 |
|
|
CALL NEST_PARENT_IO_2( myTime, myIter, myThid ) |
1514 |
|
|
ENDIF |
1515 |
|
|
#endif /* ALLOW_NEST_PARENT */ |
1516 |
|
|
|
1517 |
|
|
#ifdef ALLOW_NEST_CHILD |
1518 |
|
|
IF ( useNEST_CHILD) THEN |
1519 |
|
|
CALL NEST_CHILD_TRANSP( myTime, myIter, myThid ) |
1520 |
|
|
ENDIF |
1521 |
|
|
#endif /* ALLOW_NEST_CHILD */ |
1522 |
|
|
|
1523 |
|
|
#ifdef ALLOW_SHELFICE |
1524 |
|
|
C-- Remesh shelfice |
1525 |
|
|
c CALL SHELFICE_REMESHING (myTime, myIter, myThid ) |
1526 |
|
|
#endif /* ALLOW_SHELFICE */ |
1527 |
|
|
|
1528 |
|
|
#ifdef ALLOW_MONITOR |
1529 |
|
|
IF ( monitorFreq.GT.0. .OR. adjMonitorFreq.GT.0. ) THEN |
1530 |
|
|
C-- Check status of solution (statistics, cfl, etc...) |
1531 |
|
|
CALL TIMER_START('MONITOR [FORWARD_STEP]',myThid) |
1532 |
|
|
CALL MONITOR( myTime, myIter, myThid ) |
1533 |
|
|
CALL TIMER_STOP ('MONITOR [FORWARD_STEP]',myThid) |
1534 |
|
|
ENDIF |
1535 |
|
|
#endif /* ALLOW_MONITOR */ |
1536 |
|
|
|
1537 |
|
|
#ifdef ALLOW_COST |
1538 |
|
|
C-- compare model with data and compute cost function |
1539 |
|
|
C-- this is done after exchanges to allow interpolation |
1540 |
|
|
CALL TIMER_START('COST_TILE [FORWARD_STEP]',myThid) |
1541 |
|
|
CALL COST_TILE ( myTime, myIter, myThid ) |
1542 |
|
|
CALL TIMER_STOP ('COST_TILE [FORWARD_STEP]',myThid) |
1543 |
|
|
#endif |
1544 |
|
|
|
1545 |
|
|
C-- Check if it has reached the end of simulation |
1546 |
|
|
modelEnd = myTime.EQ.endTime .OR. myIter.EQ.nEndIter |
1547 |
|
|
#ifdef HAVE_SIGREG |
1548 |
|
|
IF ( useSIGREG ) THEN |
1549 |
|
|
modelEnd = modelEnd .OR. ( i_got_signal.GT.0 ) |
1550 |
|
|
ENDIF |
1551 |
|
|
#endif /* HAVE_SIGREG */ |
1552 |
|
|
|
1553 |
|
|
C-- Do IO if needed. |
1554 |
|
|
CALL TIMER_START('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
1555 |
|
|
CALL DO_THE_MODEL_IO( modelEnd, myTime, myIter, myThid ) |
1556 |
|
|
CALL TIMER_STOP ('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
1557 |
|
|
|
1558 |
|
|
#ifdef ALLOW_PTRACERS |
1559 |
|
|
C Reset the ptracers (but after the io is done) |
1560 |
|
|
IF ( usePTRACERS ) THEN |
1561 |
|
|
CALL TIMER_START('PTRACERS_RESET [FORWARD_STEP]',myThid) |
1562 |
|
|
CALL PTRACERS_RESET( myTime, myIter, myThid ) |
1563 |
|
|
CALL TIMER_STOP ('PTRACERS_RESET [FORWARD_STEP]',myThid) |
1564 |
|
|
ENDIF |
1565 |
|
|
#endif /* ALLOW_PTRACERS */ |
1566 |
|
|
|
1567 |
|
|
C-- Save state for restarts |
1568 |
|
|
CALL TIMER_START('DO_WRITE_PICKUP [FORWARD_STEP]',myThid) |
1569 |
|
|
CALL DO_WRITE_PICKUP( modelEnd, myTime, myIter, myThid ) |
1570 |
|
|
CALL TIMER_STOP ('DO_WRITE_PICKUP [FORWARD_STEP]',myThid) |
1571 |
|
|
|
1572 |
|
|
#ifdef HAVE_SIGREG |
1573 |
|
|
IF ( useSIGREG ) THEN |
1574 |
|
|
IF ( modelEnd .AND. i_got_signal.GT.0 ) THEN |
1575 |
|
|
STOP 'Checkpoint completed -- killed by signal handler' |
1576 |
|
|
ENDIF |
1577 |
|
|
ENDIF |
1578 |
|
|
#endif /* HAVE_SIGREG */ |
1579 |
|
|
|
1580 |
|
|
#ifdef ALLOW_AUTODIFF |
1581 |
|
|
CALL AUTODIFF_INADMODE_SET( myThid ) |
1582 |
|
|
#endif |
1583 |
|
|
|
1584 |
|
|
#ifdef ALLOW_SHOWFLOPS |
1585 |
|
|
CALL TIMER_START('SHOWFLOPS_INLOOP [THE_MAIN_LOOP]', myThid) |
1586 |
|
|
CALL SHOWFLOPS_INLOOP( iloop, myThid ) |
1587 |
|
|
CALL TIMER_STOP ('SHOWFLOPS_INLOOP [THE_MAIN_LOOP]', myThid) |
1588 |
|
|
#endif |
1589 |
|
|
|
1590 |
|
|
#ifdef ALLOW_DEBUG |
1591 |
|
|
IF (debugMode) CALL DEBUG_LEAVE('FORWARD_STEP',myThid) |
1592 |
|
|
#endif |
1593 |
|
|
|
1594 |
|
|
|
1595 |
|
|
print *, 'JJetaNEND', etan(1,69,1,1) |
1596 |
|
|
print *, 'JJetaHEND', etah(1,69,1,1) |
1597 |
|
|
print *, 'JJdetahdtEND', detahdt(1,69,1,1) |
1598 |
|
|
|
1599 |
|
|
print *, 'JJhsurfcEND',hfac_surfc (1,69,1,1) |
1600 |
|
|
print *, 'JJhsurfcnm1END', hfac_surfnm1c(1,69,1,1) |
1601 |
|
|
|
1602 |
|
|
print *, 'JJhsurfwEND',hfac_surfw(1,69,1,1) |
1603 |
|
|
print *, 'JJhsurfwnm1END', hfac_surfnm1w(1,69,1,1) |
1604 |
|
|
|
1605 |
|
|
print *, 'JJhsurfsEND',hfac_surfs(1,69,1,1) |
1606 |
|
|
print *, 'JJhsurfsnm1END', hfac_surfnm1s(1,69,1,1) |
1607 |
|
|
|
1608 |
|
|
print *, 'JJhfaccEND',h0facc(1,69,49,1,1) |
1609 |
|
|
print *, 'JJhfacsEND',hfacs(1,69,49,1,1) |
1610 |
|
|
print *, 'JJhfacwEND',hfacw(1,69,49,1,1) |
1611 |
|
|
|
1612 |
|
|
print *, 'JJThetaEND',theta(1,69,49,1,1) |
1613 |
|
|
print *, 'JJSaltEND',salt(1,69,49,1,1) |
1614 |
|
|
|
1615 |
|
|
print *, 'JJVvel69END',vvel(1,69,49,1,1) |
1616 |
|
|
print *, 'JJVvel70END',vvel(1,70,49,1,1) |
1617 |
|
|
|
1618 |
|
|
print *, 'JJwvelEND',wvel(1,69,49,1,1) |
1619 |
|
|
|
1620 |
|
|
print *, 'JJgvnm169END',gvnm1(1,69,49,1,1) |
1621 |
|
|
print *, 'JJgvnm170END',gvnm1(1,70,49,1,1) |
1622 |
|
|
|
1623 |
|
|
|
1624 |
|
|
|
1625 |
|
|
RETURN |
1626 |
|
|
END |