1 |
% \documentstyle[12pt]{report} |
2 |
% \renewcommand{\baselinestretch}{1} |
3 |
% \textwidth 190mm |
4 |
% \textheight 250mm |
5 |
% \topmargin -20mm |
6 |
% \oddsidemargin -15mm |
7 |
% \begin{document} |
8 |
|
9 |
\section[Offline Example]{Offline Experiments} |
10 |
%\label{www:tutorials} |
11 |
\label{sec:eg-offline} |
12 |
\begin{center} |
13 |
(in directory: {\it verification/tutorial\_offline/})\\ |
14 |
\end{center} |
15 |
|
16 |
%\begin{center} |
17 |
%{\Large \bf Using MITgcm to Perform Offline Tracer Exeriments} |
18 |
% |
19 |
%\vspace*{4mm} |
20 |
% |
21 |
%\vspace*{3mm} |
22 |
%{\large September 2005} |
23 |
%\end{center} |
24 |
|
25 |
This document describes a simple experiment using the offline form of |
26 |
the MITgcm. |
27 |
|
28 |
\subsection{Overview} |
29 |
%\label{www:tutorials} |
30 |
|
31 |
This experiment demonstrates use of the offline form of the MITgcm to |
32 |
study advection of a passive tracer. Time-averaged flow-fields and |
33 |
mixing coefficients, deriving from a prior online run, are re-used |
34 |
leaving only the tracer equation to be integrated. |
35 |
|
36 |
Figure {\it --- missing figure ---} %\ref{fig:eg-ofline_config} |
37 |
shows a movie of tracer being |
38 |
advected using the offline package of the MITgcm. In the top panel the |
39 |
frames of the movie show the monthly surface evolution of an initially |
40 |
local source of passive tracer. In the lower panel, the frames of the |
41 |
movie show the changing monthly surface evolution where the initial |
42 |
tracer field had a global distribution. |
43 |
|
44 |
\subsection{Time-stepping of tracers} |
45 |
%\label{www:tutorials} |
46 |
|
47 |
\noindent see section 2.15 through 2.18 for details of available |
48 |
tracer time-stepping schemes and their characteristics. |
49 |
|
50 |
\subsection{Code Configuration} |
51 |
%\label{www:tutorials} |
52 |
\label{sec:eg_offl_code_config} |
53 |
|
54 |
\noindent The model configuration for this experiment resides under the |
55 |
directory {\it verification/tutorial\_offline}. The experiment files |
56 |
\begin {itemize} |
57 |
\item {\it input/data} |
58 |
\item {\it input/data.off} |
59 |
\item {\it input/data.pkg} |
60 |
\item {\it input/data.ptracers} |
61 |
\item {\it input/eedata} |
62 |
\item {\it input/packages.conf} |
63 |
\item {\it code/PTRACERS\_SIZE.h} |
64 |
\item {\it code/SIZE.h}. |
65 |
\end {itemize} |
66 |
|
67 |
\noindent contain the code customisations and parameter settings |
68 |
required to run the example. In addition the following binary data |
69 |
files are required: |
70 |
|
71 |
\begin {itemize} |
72 |
\item {\it input/depth\_g77.bin} |
73 |
\item {\it input/tracer1\_.bin} |
74 |
\item {\it input/tracer2\_.bin} |
75 |
\item {\it input/input\_off/uVeltave.0000000001-12.data} |
76 |
\item {\it input/input\_off/vVeltave.0000000001-12.data} |
77 |
\item {\it input/input\_off/wVeltave.0000000001-12.data} |
78 |
\item {\it input/input\_off/Convtave.0000000001-12.data} |
79 |
\end {itemize} |
80 |
|
81 |
|
82 |
\subsubsection{File {\it input/data}} |
83 |
%\label{www:tutorials} |
84 |
|
85 |
\noindent This file, reproduced completely below, specifies the main |
86 |
parameters for the experiment. |
87 |
|
88 |
\begin{itemize} |
89 |
\item Line 18, 19 |
90 |
\begin {verbatim} |
91 |
nIter0 = 0, |
92 |
nTimeSteps = 720, |
93 |
\end{verbatim} |
94 |
\end{itemize} |
95 |
|
96 |
\noindent nIter0 and nTimesteps control the start time and the length |
97 |
of the run (in timesteps). If nIter0 is non-zero the model will |
98 |
require appropriate pickup files to be present in the run directory. |
99 |
Where nIter0 is zero, as here, the model makes a fresh start. In this |
100 |
case the model has been prescribed to run for 720 timesteps or 1 year. |
101 |
|
102 |
\begin{itemize} |
103 |
\item Line 20 |
104 |
\begin {verbatim} |
105 |
deltaTtracer= 43200.0, |
106 |
\end{verbatim} |
107 |
\end{itemize} |
108 |
|
109 |
\noindent deltaTtracer is the tracer timestep in seconds, in this |
110 |
case, 12 hours (43200s = 12 hours). Note that deltatTracer must be |
111 |
specified in {\it input/data} as well as specifying deltaToffline in |
112 |
{\it input/data.off}. |
113 |
|
114 |
\begin{itemize} |
115 |
\item Line 21 |
116 |
\begin {verbatim} |
117 |
deltaTClock= 43200.0, |
118 |
\end{verbatim} |
119 |
\end{itemize} |
120 |
|
121 |
\noindent When using the MITgcm in offline mode deltaTClock (an |
122 |
internal model counter) should be made equal to the value assigned to |
123 |
deltatTtracer. |
124 |
|
125 |
\begin{itemize} |
126 |
\item Line 27 |
127 |
\begin {verbatim} |
128 |
periodicExternalForcing=.TRUE., |
129 |
\end{verbatim} |
130 |
\end{itemize} |
131 |
|
132 |
\noindent periodicExternalForcing is a flag telling the model whether |
133 |
to cyclically re-use forcing data where there is external forcing (see |
134 |
`A More Complcated Example', below). Where there is no external |
135 |
forcing, as here, but where there is to be cyclic re-use of the |
136 |
offline flow and mixing fields, periodicExternalForcing must be |
137 |
assigned the value .TRUE. |
138 |
|
139 |
\begin{itemize} |
140 |
\item Line 28 |
141 |
\begin {verbatim} |
142 |
externForcingPeriod=2592000., |
143 |
\end{verbatim} |
144 |
\end{itemize} |
145 |
|
146 |
\noindent externForcingPeriod specifies the period of the external |
147 |
forcing data in seconds. In the absence of external forcing, as in |
148 |
this example, it must be made equal to the value of |
149 |
externForcingPeriod in {\it input/data.off}, in this case, monthly |
150 |
(2592000s = 1 month). |
151 |
|
152 |
\begin{itemize} |
153 |
\item Line 29 |
154 |
\begin {verbatim} |
155 |
externForcingCycle=31104000., |
156 |
\end{verbatim} |
157 |
\end{itemize} |
158 |
|
159 |
\noindent externForcingCycle specifies the duration of the external |
160 |
forcing data cycle in seconds. In the absence of external forcing, as |
161 |
in this example, it must be made equal to the value of |
162 |
externForcingCycle in {\it input/data.off}, in this case, the cycle is |
163 |
one year(31104000s = 1 year). |
164 |
|
165 |
\begin{itemize} |
166 |
\item Line 35 |
167 |
\begin {verbatim} |
168 |
usingSphericalPolarGrid=.TRUE., |
169 |
\end{verbatim} |
170 |
\end{itemize} |
171 |
|
172 |
\noindent This line requests that the simulation be performed in a |
173 |
spherical polar coordinate system. It affects the interpretation of |
174 |
grid input parameters and causes the grid generation routines to |
175 |
initialize an internal grid based on spherical polar geometry. |
176 |
|
177 |
\begin{itemize} |
178 |
\item Line 36 |
179 |
\begin {verbatim} |
180 |
delR= 50., 70., 100., 140., 190., |
181 |
240., 290., 340., 390., 440., |
182 |
490., 540., 590., 640., 690., |
183 |
\end{verbatim} |
184 |
\end{itemize} |
185 |
|
186 |
\noindent This line sets the vertical grid spacing between each |
187 |
z-coordinate line in the discrete grid. Here the total model depth is |
188 |
$5200\,{\rm m}$. |
189 |
|
190 |
\begin{itemize} |
191 |
\item Line 39 |
192 |
\begin {verbatim} |
193 |
ygOrigin=-90., |
194 |
\end{verbatim} |
195 |
\end{itemize} |
196 |
|
197 |
\noindent This line sets the southern boundary of the modeled domain |
198 |
to $-90^{\circ}$ latitude N ($90^{\circ}$ S). This value affects both |
199 |
the generation of the |
200 |
locally orthogonal grid that the model uses internally and affects the |
201 |
initialization of the coriolis force. Note - it is not required to |
202 |
set a longitude boundary, since the absolute longitude does not alter |
203 |
the kernel equation discretisation. |
204 |
|
205 |
\begin{itemize} |
206 |
\item Line 40 |
207 |
\begin {verbatim} |
208 |
dxSpacing=2.8125, |
209 |
\end{verbatim} |
210 |
\end{itemize} |
211 |
|
212 |
\noindent This line sets the horizontal grid spacing between each |
213 |
y-coordinate line in the discrete grid to $2.8125^{\circ}$ in |
214 |
longitude. |
215 |
|
216 |
\begin{itemize} |
217 |
\item Line 41 |
218 |
\begin {verbatim} |
219 |
dySpacing=2.8125, |
220 |
\end{verbatim} |
221 |
\end{itemize} |
222 |
|
223 |
\noindent This line sets the vertical grid spacing between each |
224 |
x-coordinate line in the discrete grid to $2.8125^{\circ}$ in |
225 |
latitude. |
226 |
|
227 |
\begin{itemize} |
228 |
\item Line 46 |
229 |
\begin {verbatim} |
230 |
bathyFile='depth_g77.bin', |
231 |
\end{verbatim} |
232 |
\end{itemize} |
233 |
|
234 |
\noindent This line specifies the name of the file, in this case {\it |
235 |
depth\_g77.bin}, from which the domain bathymetry is read. This file |
236 |
contains a two-dimensional ($x,y$) map of (assumed 64-bit) binary |
237 |
numbers giving the depth of the model at each grid cell, ordered with |
238 |
the x coordinate varying fastest. The points are ordered from low |
239 |
coordinate to high coordinate for both axes. The units and orientation |
240 |
of the depths in this file are the same as used in the MITgcm code. In |
241 |
this experiment, a depth of $0m$ indicates land. |
242 |
|
243 |
|
244 |
\begin {verbatim} |
245 |
1 # ==================== |
246 |
2 # | Model parameters | |
247 |
3 # ==================== |
248 |
4 # |
249 |
5 # Continuous equation parameters |
250 |
6 &PARM01 |
251 |
7 & |
252 |
8 # |
253 |
9 # Elliptic solver parameters |
254 |
10 &PARM02 |
255 |
11 cg2dMaxIters=1000, |
256 |
12 cg2dTargetResidual=1.E-13, |
257 |
13 & |
258 |
14 # |
259 |
15 |
260 |
16 # Time stepping parameters |
261 |
17 &PARM03 |
262 |
18 nIter0 = 0, |
263 |
19 nTimeSteps = 720, |
264 |
20 deltaTtracer= 43200.0, |
265 |
21 deltaTClock = 43200.0, |
266 |
22 pChkptFreq=31104000., |
267 |
23 chkptFreq= 31104000., |
268 |
24 dumpFreq= 2592000., |
269 |
25 taveFreq= 311040000., |
270 |
26 monitorFreq= 1., |
271 |
27 periodicExternalForcing=.TRUE., |
272 |
28 externForcingPeriod=2592000., |
273 |
29 externForcingCycle=31104000., |
274 |
30 & |
275 |
31 # |
276 |
32 # Gridding parameters |
277 |
33 &PARM04 |
278 |
34 usingCartesianGrid=.FALSE., |
279 |
35 usingSphericalPolarGrid=.TRUE., |
280 |
36 delR= 50., 70., 100., 140., 190., |
281 |
37 240., 290., 340., 390., 440., |
282 |
38 490., 540., 590., 640., 690., |
283 |
39 ygOrigin=-90., |
284 |
40 dxSpacing=2.8125, |
285 |
41 dySpacing=2.8125, |
286 |
42 & |
287 |
43 # |
288 |
44 # Input datasets |
289 |
45 &PARM05 |
290 |
46 bathyFile= 'depth_g77.bin', |
291 |
47 & |
292 |
\end{verbatim} |
293 |
|
294 |
\subsubsection{File {\it input/data.off}} |
295 |
%\label{www:tutorials} |
296 |
|
297 |
\noindent {\it input/data.off} provides the MITgcm offline package |
298 |
with package specific parameters. {\it input/data.off} specifies the |
299 |
location (relative to the run directory) and prefix of files |
300 |
describing the flow field (UvelFile, VvelFile, WvelFile) and the |
301 |
corresponding convective mixing coefficients (ConvFile) which together |
302 |
prescribe the three dimensional, time varying dynamic system within |
303 |
which the offline model will advect the tracer. |
304 |
|
305 |
\begin{itemize} |
306 |
\item Lines 2 to 5 |
307 |
\begin {verbatim} |
308 |
UvelFile= '../input/input_off/uVeltave', |
309 |
VvelFile= '../input/input_off/vVeltave', |
310 |
WvelFile= '../input/input_off/wVeltave', |
311 |
ConvFile= '../input/input_off/Convtave', |
312 |
\end{verbatim} |
313 |
\end{itemize} |
314 |
|
315 |
\noindent In the example the offline data is located in the |
316 |
sub-directory {\it input/input\_off}. In this directory are fields |
317 |
describing the velocity and convective mixing histories of a prior |
318 |
forward integration of the MITgcm required for the offline package and |
319 |
identified in {\it input/data\_off}. Based on the values of {\it |
320 |
deltatToffline}, {\it offlineForcingPeriod} and {\it |
321 |
offlineForcingCycle} specified in {\it input/data.off}, since {\it |
322 |
offlineForcingCycle} corresponds to 12 forcing periods {\it |
323 |
offlineForcingPeriod} and since offlineIter0 is zero, there needs to |
324 |
be 12 uVeltave, 12 vVeltave, 12 wVeltave and 12 Convtave files each |
325 |
having a 10 digit sequence identifier between 0000000001 to |
326 |
0000000012, that is, a total of 48 files. |
327 |
|
328 |
|
329 |
\begin{itemize} |
330 |
\item Line 9 |
331 |
\begin {verbatim} |
332 |
offlineIter0=0, |
333 |
\end{verbatim} |
334 |
\end{itemize} |
335 |
|
336 |
\noindent offlineIter0, here specified to be 0 timesteps, corresponds |
337 |
to the timestep at which the tracer model is initialised. Note that |
338 |
offlineIter0 and nIter0 (set in {\it input/data}) need not be the |
339 |
same. |
340 |
|
341 |
\begin{itemize} |
342 |
\item Line 10 |
343 |
\begin {verbatim} |
344 |
deltaToffline=43200., |
345 |
\end{verbatim} |
346 |
\end{itemize} |
347 |
|
348 |
|
349 |
\noindent deltatToffline sets the timestep associated with the offline |
350 |
model data in seconds, here 12 hours (43200s = 12 hours). |
351 |
|
352 |
\begin{itemize} |
353 |
\item Line 11 |
354 |
\begin {verbatim} |
355 |
offlineForcingPeriod=43200., |
356 |
\end{verbatim} |
357 |
\end{itemize} |
358 |
|
359 |
\noindent offlineForcingPeriod sets the forcing period associated with |
360 |
the offline model data in seconds. |
361 |
|
362 |
\begin{itemize} |
363 |
\item Line 12 |
364 |
\begin {verbatim} |
365 |
offlineForcingCycle=518400., |
366 |
\end{verbatim} |
367 |
\end{itemize} |
368 |
|
369 |
\noindent offlineForcingCycle sets the forcing cycle length associated |
370 |
with the offline model data in seconds. In this example the offline |
371 |
forcing cycle is 6 days, or 12 offline forcing periods. Together |
372 |
deltatToffline, offlineForcingPeriod and offlineForcingCycle determine |
373 |
the value of the 10 digit sequencing tag the model expects files in |
374 |
{\it input/input\_off} to have. |
375 |
|
376 |
|
377 |
\begin {verbatim} |
378 |
1 &OFFLINE_PARM01 |
379 |
2 UvelFile= 'input_off/uVeltave', |
380 |
3 VvelFile= 'input_off/vVeltave', |
381 |
4 WvelFile= 'input_off/wVeltave', |
382 |
5 ConvFile= 'input_off/Convtave', |
383 |
6 &end |
384 |
|
385 |
7 &OFFLINE_PARM02 |
386 |
8 offlineIter0=0, |
387 |
9 deltaToffline=43200., |
388 |
10 offlineForcingPeriod=43200., |
389 |
11 offlineForcingCycle=518400., |
390 |
12 &end |
391 |
\end{verbatim} |
392 |
|
393 |
|
394 |
\subsubsection{File {\it input/data.pkg}} |
395 |
%\label{www:tutorials} |
396 |
|
397 |
\noindent File {\it input/data.pkg}, reproduced completely below, |
398 |
specifies which MITgcm packages ({\it ~/MITgcm/pkg}) are to be used. |
399 |
|
400 |
|
401 |
\begin {itemize} |
402 |
\item Line 3 |
403 |
\begin {verbatim} |
404 |
usePTRACERS=.TRUE., |
405 |
\end{verbatim} |
406 |
\end{itemize} |
407 |
|
408 |
\noindent usePTRACERS is a flag invoking the ptracers package which is |
409 |
responsible for the advection of the tracer within the model. |
410 |
|
411 |
\begin {verbatim} |
412 |
1 # Packages |
413 |
2 &PACKAGES |
414 |
3 usePTRACERS=.TRUE., |
415 |
4 & |
416 |
\end{verbatim} |
417 |
|
418 |
\subsubsection{File {\it input/data.ptracers}} |
419 |
%\label{www:tutorials} |
420 |
|
421 |
\noindent File {\it input/data.ptracers}, reproduced completely below, |
422 |
provides the MITgcm ptracers package with package specific parameters, |
423 |
prescribing the nature of the the tracer/tracers as well as the |
424 |
variables associated with their advection. |
425 |
|
426 |
\begin{itemize} |
427 |
\item Line 2 |
428 |
\begin {verbatim} |
429 |
PTRACERS_numInUse=2, |
430 |
\end{verbatim} |
431 |
\end{itemize} |
432 |
|
433 |
\noindent PTRACERS\_numInUse tells the model how many separate tracers |
434 |
are to be advected, in this case 2. Note: The value of |
435 |
PTRACERS\_numInUse must agree with the value specified in {\it |
436 |
code/PTRACERS\_SIZE.h} - see {\it code/PTRACERS\_SIZE.h} below. |
437 |
|
438 |
\begin{itemize} |
439 |
\item Line 3 |
440 |
\begin {verbatim} |
441 |
PTRACERS_Iter0= 0, |
442 |
\end{verbatim} |
443 |
\end{itemize} |
444 |
|
445 |
\noindent PTRACERS\_Iter0 specifies the iteration at which the tracer |
446 |
is to be introduced. In this case the tracer is initialised at the |
447 |
start of the simulation. i.e. PTRACERS\_Iter0 = PTRACERS\_nIter0. |
448 |
|
449 |
\begin{itemize} |
450 |
\item Lines 5 and 10 |
451 |
\begin {verbatim} |
452 |
PTRACERS_advScheme(1)=77, |
453 |
\end{verbatim} |
454 |
\end{itemize} |
455 |
|
456 |
\noindent PTRACERS\_advScheme(n) identifies which advection scheme |
457 |
will be used for tracer n, where n is the number of the tracer up to |
458 |
PTRACERS\_numInUse. See section 2.18, 'Comparison of advection |
459 |
schemes', to identify the numerical codes used to specify different |
460 |
advection schemes (e.g. centered 2nd order, 3rd order upwind) as well |
461 |
as details of each. |
462 |
|
463 |
\begin{itemize} |
464 |
\item Lines 6 and 11 |
465 |
\begin{verbatim} |
466 |
PTRACERS_diffKh(1)=1.E3, |
467 |
\end{verbatim} |
468 |
\end{itemize} |
469 |
|
470 |
\noindent PTRACERS\_diffKh(n) is the horizontal diffusion coefficient |
471 |
for tracer n, where n is the number of the tracer up to |
472 |
PTRACERS\_numInUse. |
473 |
|
474 |
\begin {itemize} |
475 |
\item Lines 7 and 12 |
476 |
\begin{verbatim} |
477 |
PTRACERS_diffKr(1)=5.E-5, |
478 |
\end{verbatim} |
479 |
\end{itemize} |
480 |
|
481 |
\noindent PTRACERS\_diffKr(n) is the vertical diffusion coefficient |
482 |
for tracer n, where n is the number of the tracer up to |
483 |
PTRACERS\_numInUse. |
484 |
|
485 |
\begin {itemize} |
486 |
\item Lines 8 and 13 |
487 |
\begin{verbatim} |
488 |
PTRACERS_initialFile(1)='tracer1.bin', |
489 |
\end{verbatim} |
490 |
\end{itemize} |
491 |
|
492 |
\noindent PTRACERS\_initialFile(n) identifies the initial tracer field |
493 |
to be associated with tracer n, where n is the number of the tracer up |
494 |
to PTRACERS\_numInUse. In this example file {\it input/tracer1.bin} |
495 |
contains localised tracer, {\it input/tracer2.bin} contains an |
496 |
arbitrary global distribution. Included Matlab script {\it |
497 |
input/makeinitialtracer.m} provides a template for generating or |
498 |
manipulating initial tracer fields. |
499 |
|
500 |
\begin {verbatim} |
501 |
1 &PTRACERS_PARM01 |
502 |
2 PTRACERS_numInUse=2, |
503 |
3 PTRACERS_Iter0= 0, |
504 |
4 # tracer 1 |
505 |
5 PTRACERS_advScheme(1)=77, |
506 |
6 PTRACERS_diffKh(1)=1.E3, |
507 |
7 PTRACERS_diffKr(1)=5.E-5, |
508 |
8 PTRACERS_initialFile(1)='tracer1.bin', |
509 |
9 # tracer 2 |
510 |
10 PTRACERS_advScheme(2)=77, |
511 |
11 PTRACERS_diffKh(2)=1.E3, |
512 |
12 PTRACERS_diffKr(2)=5.E-5, |
513 |
13 PTRACERS_initialFile(2)='tracer2.bin', |
514 |
14 & |
515 |
\end{verbatim} |
516 |
|
517 |
\noindent Note {\it input/data.ptracers} requires a set of entries for |
518 |
each tracer. |
519 |
|
520 |
\subsubsection{File {\it input/eedata}} |
521 |
%\label{www:tutorials} |
522 |
\noindent This file uses standard default values and does not contain |
523 |
customisations for this experiment. |
524 |
|
525 |
\noindent The following code changes are required to run this exaperiment. |
526 |
|
527 |
\subsubsection{File {\it code/packages.conf}} |
528 |
%\label{www:tutorials} |
529 |
|
530 |
\noindent This file is used to invoke the model components required |
531 |
for a particuylar implementation of the MITgcm. In this case the {\it |
532 |
code/packages.conf} contains the component names: |
533 |
|
534 |
\begin {verbatim} |
535 |
ptracers |
536 |
generic_advdiff |
537 |
mdsio |
538 |
mom_fluxform |
539 |
mom_vecinv |
540 |
timeave |
541 |
rw |
542 |
monitor |
543 |
offline |
544 |
\end{verbatim} |
545 |
|
546 |
\subsubsection{File {\it code/PTRACERS\_SIZE.h}} |
547 |
%\label{www:tutorials} |
548 |
\begin{itemize} |
549 |
\item Line |
550 |
\begin{verbatim} |
551 |
PARAMETER(PTRACERS_num = 2 ) |
552 |
\end{verbatim} |
553 |
\end{itemize} |
554 |
|
555 |
\noindent This line sets the parameters PTRACERS\_num (the number of |
556 |
tracers to be integrated) to 2 (in agreement with {\it |
557 |
input/data.ptracers}). |
558 |
|
559 |
\subsubsection{File {\it code/SIZE.h}} |
560 |
%\label{www:tutorials} |
561 |
|
562 |
\noindent Two lines are customized in this file for the current |
563 |
experiment |
564 |
|
565 |
\begin{itemize} |
566 |
|
567 |
\item Line 39, |
568 |
\begin{verbatim} sNx=128, \end{verbatim} \noindent this line sets |
569 |
the lateral domain extent in grid points for the |
570 |
axis aligned with the x-coordinate. |
571 |
|
572 |
\item Line 40, |
573 |
\begin{verbatim} sNy=64, \end{verbatim} |
574 |
\noindent this line sets |
575 |
the lateral domain extent in grid points for the |
576 |
axis aligned with the y-coordinate. |
577 |
|
578 |
\item Line 49, |
579 |
\begin{verbatim} Nr=15, \end{verbatim} |
580 |
\noindent this line sets |
581 |
the vertical domain extent in grid points. |
582 |
|
583 |
\end{itemize} |
584 |
|
585 |
|
586 |
\subsection{Running The Example} |
587 |
%\label{www:tutorials} |
588 |
%\label{sec:running_the_example} |
589 |
|
590 |
\subsubsection{Code Download} |
591 |
%\label{www:tutorials} |
592 |
|
593 |
In order to run the examples you must first download the code |
594 |
distribution. Instructions for downloading the code can be found in |
595 |
section \ref{sec:obtainingCode}. |
596 |
|
597 |
\subsubsection{Experiment Location} |
598 |
%\label{www:tutorials} |
599 |
|
600 |
This example experiment is located under the release sub-directory |
601 |
|
602 |
\vspace{5mm} |
603 |
{\it verification/offline/ } |
604 |
|
605 |
\subsubsection{Running the Experiment} |
606 |
%\label{www:tutorials} |
607 |
|
608 |
To run the experiment |
609 |
|
610 |
\begin{enumerate} |
611 |
\item Set the current directory to {\it input/ } |
612 |
|
613 |
\begin{verbatim} |
614 |
% cd input |
615 |
\end{verbatim} |
616 |
|
617 |
\item Verify that current directory is now correct |
618 |
|
619 |
\begin{verbatim} |
620 |
% pwd |
621 |
\end{verbatim} |
622 |
|
623 |
You should see a response on the screen ending in {\it |
624 |
verification/offline/input } |
625 |
|
626 |
\item Copy the contents of {\it input/} including subdirectory {\it |
627 |
input/input\_off/} to a new directory called {\it run/} |
628 |
|
629 |
\item Listing directory {\it run/} you should see: |
630 |
|
631 |
\begin {verbatim} |
632 |
data data.pkg depth_g77.bin input_off tracer2.bin |
633 |
data.off data.ptracers eedata tracer1.bin |
634 |
\end{verbatim} |
635 |
|
636 |
|
637 |
\item Set the current directory to {\it run/ } |
638 |
|
639 |
|
640 |
\item Run the genmake script to create the experiment {\it Makefile} |
641 |
|
642 |
\begin {verbatim} |
643 |
% ../../../tools/genmake2 -mods=../code |
644 |
\end{verbatim} |
645 |
|
646 |
\item Create a list of header file dependencies in {\it Makefile} |
647 |
|
648 |
\begin {verbatim} |
649 |
% make depend |
650 |
\end{verbatim} |
651 |
|
652 |
\item Build the executable file. |
653 |
|
654 |
\begin {verbatim} |
655 |
% make |
656 |
\end{verbatim} |
657 |
|
658 |
\item Run the {\it mitgcmuv} executable |
659 |
|
660 |
\begin {verbatim} |
661 |
% ./mitgcmuv |
662 |
\end{verbatim} |
663 |
|
664 |
\end{enumerate} |
665 |
|
666 |
Besides the input files and the files the model generates describing |
667 |
the grid (prefixed Depth, DXC, DXG, hFacC, hFacS and hFacW, you should |
668 |
now have 26 single precision binary files |
669 |
PTRACER01.0000000000-0000000720.001.001.data and |
670 |
PTRACER02.0000000000-0000000720.001.001.data and their 26 |
671 |
corresponding meta files as well as a single pickup file, |
672 |
pickup\_ptracers.0000000720.001.001.data and its corresponding meta |
673 |
file pickup\_ptracers.0000000720.001.001.meta. To run on simply change |
674 |
nIter0 in file {\it run/data} to 720... |
675 |
|
676 |
\subsection{A more complicated example} |
677 |
\label{sec:eg-offline-cfc} |
678 |
\begin{center} |
679 |
(in directory: {\it verification/tutorial\_cfc\_offline/})\\ |
680 |
\end{center} |
681 |
|
682 |
\noindent The last example demonstrated simple advection of a passive |
683 |
tracer using the offline form of the MITgcm. Now we present a more |
684 |
complicated example in which the model is used to explore |
685 |
contamination of the global ocean through surface exposure to CFC's |
686 |
during the last century. In invoking packages gchem, gmredi and cfc it |
687 |
provides a starting point and template for more complicated offline |
688 |
modeling, involving as it does surface forcing through wind and ice |
689 |
fields, more sophisticated mixing and a time-varying forcing funtion. |
690 |
|
691 |
\vspace{0.5cm} |
692 |
|
693 |
\noindent The model configuration for this experiment resides under |
694 |
the directory {\it verification/cfc\_offline}. The experiment files |
695 |
|
696 |
\begin{itemize} |
697 |
\item {\it input/data} |
698 |
\item {\it input/data.gchem} |
699 |
\item {\it input/data.gmredi} |
700 |
\item {\it input/data.off} |
701 |
\item {\it input/data.pkg} |
702 |
\item {\it input/data.ptracers} |
703 |
\item {\it input/eedata} |
704 |
\item {\it code/GCHEM\_OPTIONS.h} |
705 |
\item {\it code/GMREDI\_OPTIONS.h} |
706 |
\item {\it input/packages.conf} |
707 |
\item {\it code/PTRACERS\_SIZE.h} |
708 |
\item {\it code/SIZE.h}. |
709 |
\end{itemize} |
710 |
|
711 |
\noindent contain all the code customisations and parameter settings |
712 |
required. |
713 |
|
714 |
\noindent The full list of other files required becomes: |
715 |
|
716 |
\begin{verbatim} |
717 |
cfc1112.atm data.ptracers |
718 |
data depth_g77.bin pickup.0004269600.data |
719 |
data.gchem eedata |
720 |
data.gmredi ice.bin pickup_ptracers.0004269600.data |
721 |
data.off data.pkg tren_speed.bin |
722 |
\end{verbatim} |
723 |
|
724 |
\noindent and |
725 |
|
726 |
\begin{verbatim} |
727 |
input_off/: |
728 |
Convtave.0004248060.data GM_Kwz-T.0004248060.data uVeltave.0004248060.data |
729 |
Convtave.0004248060.meta GM_Kwz-T.0004248060.meta uVeltave.0004248060.meta |
730 |
Convtave.0004248720.data GM_Kwz-T.0004248720.data uVeltave.0004248720.data |
731 |
Convtave.0004248720.meta GM_Kwz-T.0004248720.meta uVeltave.0004248720.meta |
732 |
GM_Kwx-T.0004248060.data Stave.0004248060.data vVeltave.0004248060.data |
733 |
GM_Kwx-T.0004248060.meta Stave.0004248060.meta vVeltave.0004248060.meta |
734 |
GM_Kwx-T.0004248720.data Stave.0004248720.data vVeltave.0004248720.data |
735 |
GM_Kwx-T.0004248720.meta Stave.0004248720.meta vVeltave.0004248720.meta |
736 |
GM_Kwy-T.0004248060.data Ttave.0004248060.data wVeltave.0004248060.data |
737 |
GM_Kwy-T.0004248060.meta Ttave.0004248060.meta wVeltave.0004248060.meta |
738 |
GM_Kwy-T.0004248720.data Ttave.0004248720.data wVeltave.0004248720.data |
739 |
GM_Kwy-T.0004248720.meta Ttave.0004248720.meta wVeltave.0004248720.meta |
740 |
\end{verbatim} |
741 |
|
742 |
|
743 |
\subsubsection{File {\it input/data}} |
744 |
%\label{www:tutorials} |
745 |
|
746 |
\noindent A single line must be added (under PARM01, between lines 6 |
747 |
and 7) in file {\it input/data} from the previous example |
748 |
|
749 |
\begin{verbatim} |
750 |
&PARM01 |
751 |
implicitDiffusion=.TRUE., |
752 |
& |
753 |
\end{verbatim} |
754 |
|
755 |
\noindent When package GMREDI is used, the flag implicitDiffusion must |
756 |
be assigned the value .TRUE. For information about MITgcm package |
757 |
GMREDI see... |
758 |
|
759 |
\vspace{0.5cm} |
760 |
\noindent In this example the starting timestep nIter0 is set to |
761 |
4269600 requiring model access to pickup files with the timetag |
762 |
0004269600. The model will run for 4 timesteps (nTimeSteps = 4). In |
763 |
this case the frequencies with which permanent and rolling checkpoints |
764 |
(pChkptFreq and chkptFreq) have been set is sufficiently long to |
765 |
ensure that only one from the last timestep will be written. This is |
766 |
also true of the values that have been assigned to the frequency with |
767 |
which dumps are written (dumpFreq) and time averaging (taveFreq) is |
768 |
performed however since the model always dumps the state of the model |
769 |
when it stops without error a dump will be written with timetag |
770 |
0004269604 upon completion. |
771 |
|
772 |
|
773 |
\subsubsection{File {\it input/data.off}} |
774 |
%\label{www:tutorials} |
775 |
|
776 |
\noindent File {\it input/data.off}, reproduced in full below, |
777 |
specifies the prefixes and locations of additional input files |
778 |
required to run the offline model. Note that {\it input/input\_off} |
779 |
contains only as many offline files as are required to successfully |
780 |
run for 4 timesteps. Where the GMREDI scheme was used in the forward |
781 |
run, as here, package GMREDI must again be invoked when running |
782 |
offline. In this example tracer is specified as having beeen |
783 |
introduced with a non-zero starttime, at timestep 4248000. |
784 |
|
785 |
\begin {verbatim} |
786 |
1 &OFFLINE_PARM01 |
787 |
2 UvelFile= '../input/input_off/uVeltave', |
788 |
3 VvelFile= '../input/input_off/vVeltave', |
789 |
4 WvelFile= '../input/input_off/wVeltave', |
790 |
5 GMwxFile= '../input/input_off/GM_Kwx-T', |
791 |
6 GMwyFile= '../input/input_off/GM_Kwy-T', |
792 |
7 GMwzFile= '../input/input_off/GM_Kwz-T', |
793 |
8 ConvFile= '../input/input_off/Convtave', |
794 |
9 &end |
795 |
|
796 |
10 &OFFLINE_PARM02 |
797 |
11 offlineIter0=4248000, |
798 |
12 deltaToffline=43200., |
799 |
13 offlineForcingPeriod=2592000., |
800 |
14 offlineForcingCycle=31104000., |
801 |
15 &end |
802 |
\end{verbatim} |
803 |
|
804 |
\subsubsection{File {\it input/data.pkg}} |
805 |
%\label{www:tutorials} |
806 |
|
807 |
\noindent File {\it input/data.pkg}, reproduced completely below, |
808 |
specifies which MITgcm packages ({\it ~/MITgcm/pkg}) are to be used. |
809 |
It now invokes additional packages {\it pkg/gmredi} and {pkg/gchem}. |
810 |
|
811 |
\begin {verbatim} |
812 |
1 # Packages |
813 |
2 &PACKAGES |
814 |
3 useGMRedi=.TRUE., |
815 |
4 usePTRACERS=.TRUE., |
816 |
5 useGCHEM=.TRUE., |
817 |
6 & |
818 |
|
819 |
\end{verbatim} |
820 |
|
821 |
|
822 |
\subsubsection{File {\it input/data.ptracers}} |
823 |
%\label{www:tutorials} |
824 |
|
825 |
\noindent File {\it input/data.ptracers}, reproduced completely below, |
826 |
specifies parameters associated with the CFC11 and CFC12 tracer fields |
827 |
advected in this example. |
828 |
|
829 |
|
830 |
\begin{itemize} |
831 |
\item Line 3 |
832 |
\begin {verbatim} |
833 |
PTRACERS_Iter0= 4248000, |
834 |
\end{verbatim} |
835 |
\end{itemize} |
836 |
|
837 |
\noindent In this example the tracers were introduced at iteration |
838 |
4248000. |
839 |
|
840 |
\begin{itemize} |
841 |
\item Lines 7 and 14 |
842 |
\begin {verbatim} |
843 |
PTRACERS_diffKh(n)=0.E3, |
844 |
\end{verbatim} |
845 |
\end{itemize} |
846 |
|
847 |
\noindent Since package GMREDI is being used, regular horizontal |
848 |
diffusion is set to zero. |
849 |
|
850 |
\begin{itemize} |
851 |
\item Lines 9,10 and 16,17 |
852 |
\begin {verbatim} |
853 |
PTRACERS_useGMRedi(n)=.TRUE. , |
854 |
PTRACERS_useKPP(n)=.FALSE. , |
855 |
\end{verbatim} |
856 |
\end{itemize} |
857 |
|
858 |
\noindent Setting flag PTRACERS\_useGMRedi(n) to .TRUE. identifies |
859 |
that package GMREDI is to be used. Setting flag PTRACERS\_useKPP(n) to |
860 |
.FALSE. explicitly turns off KPP mixing. |
861 |
|
862 |
\begin{itemize} |
863 |
\item Lines 11 and 18 |
864 |
\begin {verbatim} |
865 |
PTRACERS_initialFile(n)=' ', |
866 |
\end{verbatim} |
867 |
\end{itemize} |
868 |
|
869 |
\noindent Since this is a `pickup' run the initial tracer files |
870 |
PTRACERS\_initialFile(1) and PTRACERS\_initialFile(2) aree not needed. |
871 |
The model will obtain the tracer state from |
872 |
pickup\_ptracers.0004269600.data |
873 |
|
874 |
\begin {verbatim} |
875 |
1 &PTRACERS_PARM01 |
876 |
2 PTRACERS_numInUse=2, |
877 |
3 PTRACERS_Iter0= 4248000, |
878 |
4 # |
879 |
5 # tracer 1 - CFC11 |
880 |
6 PTRACERS_advScheme(1)=77, |
881 |
7 PTRACERS_diffKh(1)=0.E3, |
882 |
8 PTRACERS_diffKr(1)=5.E-5, |
883 |
9 PTRACERS_useGMRedi(1)=.TRUE. , |
884 |
10 PTRACERS_useKPP(1)=.FALSE. , |
885 |
11 PTRACERS_initialFile(1)=' ', |
886 |
12 # tracer 2 - CFC12 |
887 |
13 PTRACERS_advScheme(2)=77, |
888 |
14 PTRACERS_diffKh(2)=0.E3, |
889 |
15 PTRACERS_diffKr(2)=5.E-5, |
890 |
16 PTRACERS_useGMRedi(2)=.TRUE. , |
891 |
17 PTRACERS_useKPP(2)=.FALSE. , |
892 |
18 PTRACERS_initialFile(2)=' ', |
893 |
19 & |
894 |
\end{verbatim} |
895 |
|
896 |
|
897 |
\subsubsection{File {\it input/data.gchem}} |
898 |
%\label{www:tutorials} |
899 |
|
900 |
\noindent File {\it input/data.gchem}, reproduced completely below, |
901 |
names the forcing files needed in package GCHEM. |
902 |
|
903 |
\begin{itemize} |
904 |
\item Line 3 |
905 |
\begin {verbatim} |
906 |
iceFile='ice.bin', |
907 |
\end{verbatim} |
908 |
\end{itemize} |
909 |
|
910 |
\noindent File {\it input/ice.bin} contains 12, monthly surface ice |
911 |
fields. |
912 |
|
913 |
\begin{itemize} |
914 |
\item Line 3 |
915 |
\begin {verbatim} |
916 |
iceFile='tren_speed.bin', |
917 |
\end{verbatim} |
918 |
\end{itemize} |
919 |
|
920 |
\noindent File {\it input/tren\_speed.bin} contains 12, monthly |
921 |
surface wind fields. |
922 |
|
923 |
\begin {verbatim} |
924 |
1 &GCHEM_PARM01 |
925 |
2 iceFile='fice.bin', |
926 |
3 windFile='tren_speed.bin', |
927 |
4 & |
928 |
\end{verbatim} |
929 |
|
930 |
\noindent Package GCHEM is described in detail in section ?? |
931 |
|
932 |
\subsubsection{File {\it input/data.gmredi}} |
933 |
%\label{www:tutorials} |
934 |
|
935 |
\noindent File {\it input/data.gmredi}, reproduced completely below, |
936 |
provides the parameters required for package GMREDI. |
937 |
|
938 |
\begin {verbatim} |
939 |
1 &GM_PARM01 |
940 |
2 GM_background_K = 1.e+3, |
941 |
3 GM_taper_scheme = 'gkw91', |
942 |
4 GM_maxSlope = 1.e-2, |
943 |
5 GM_Kmin_horiz = 100., |
944 |
6 GM_Scrit = 4.e-3, |
945 |
7 GM_Sd = 1.e-3, |
946 |
8 & |
947 |
\end{verbatim} |
948 |
|
949 |
\noindent Package GMREDI is described in detail in section ?? |
950 |
|
951 |
\subsubsection{File {\it input/cfc1112.atm}} |
952 |
%\label{www:tutorials} |
953 |
|
954 |
\noindent File {\it input/cfc1112.atm} is a text file containing the |
955 |
CFC source functions over the northern and southern hemispheres |
956 |
annually from 1931 through 1998. |
957 |
|
958 |
\subsubsection{File {\it code/packages.conf}} |
959 |
%\label{www:tutorials} |
960 |
|
961 |
\noindent In this example {\it code/packages.conf} additionally |
962 |
invokes components gchem, cfc and rmredi: |
963 |
|
964 |
\begin {verbatim} |
965 |
ptracers |
966 |
generic_advdiff |
967 |
mdsio |
968 |
mom_fluxform |
969 |
mom_vecinv |
970 |
timeave |
971 |
rw |
972 |
monitor |
973 |
offline |
974 |
gchem |
975 |
cfc |
976 |
gmredi |
977 |
\end{verbatim} |
978 |
|
979 |
\subsubsection{File {\it code/GCHEM\_OPTIONS.h}} |
980 |
%\label{www:tutorials} |
981 |
|
982 |
\noindent File {\it code/GCHEM\_OPTIONS.h}, specifies options for |
983 |
package GCHEM. In this case defining the flag ALLOW\_CFC to activate |
984 |
the cfc code. |
985 |
|
986 |
\subsubsection{File {\it code/GMREDI\_OPTIONS.h}} |
987 |
%\label{www:tutorials} |
988 |
|
989 |
\noindent File {\it code/GCHEM\_OPTIONS.h}, specifies options for |
990 |
package GMREDI. |
991 |
|
992 |
\subsubsection{File {\it code/PTRACERS\_SIZE.h}} |
993 |
%\label{www:tutorials} |
994 |
|
995 |
\noindent File {\it code/PTRACERS\_SIZE.h} is unchanged from the |
996 |
simpler example. |
997 |
|
998 |
\subsubsection{File {\it code/SIZE.h}} |
999 |
%\label{www:tutorials} |
1000 |
|
1001 |
\noindent File {\it code/SIZE.h} is unchanged from the simpler |
1002 |
example. |
1003 |
|
1004 |
|
1005 |
\subsubsection{Running the Experiment} |
1006 |
%\label{www:tutorials} |
1007 |
|
1008 |
The model is run as before and produces the files the model generates |
1009 |
describing the grid (prefixed Depth, DXC, DXG, hFacC, hFacS and hFacW) |
1010 |
as well as 2, single precision, binary files |
1011 |
PTRACER01.0004269600-0004269604.001.001.data and |
1012 |
PTRACER02.0004269600-0004269604.001.001.data and their 2 corresponding |
1013 |
meta files as well as a single pickup file, |
1014 |
pickup\_ptracers.ckptA.001.001.data and its corresponding meta file |
1015 |
pickup\_ptracers.ckptA.001.001.meta from which you could run the model |
1016 |
on. |
1017 |
|
1018 |
%% \end{document} |
1019 |
|
1020 |
|
1021 |
|