/[MITgcm]/manual/s_getstarted/text/getting_started.tex
ViewVC logotype

Contents of /manual/s_getstarted/text/getting_started.tex

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


Revision 1.3 - (show annotations) (download) (as text)
Thu Oct 11 19:18:41 2001 UTC (23 years, 9 months ago) by adcroft
Branch: MAIN
Changes since 1.2: +10 -6 lines
File MIME type: application/x-tex
Changed details about downloading with CVS.

1 % $Header: /u/gcmpack/mitgcmdoc/part3/getting_started.tex,v 1.2 2001/09/28 15:46:09 adcroft Exp $
2 % $Name: $
3
4 \section{Getting started}
5
6 In this part, we describe how to use the model. In the first section, we
7 provide enough information to help you get started with the model. We
8 believe the best way to familiarize yourself with the model is to run the
9 case study examples provided with the base version. Information on how to
10 obtain, compile, and run the code is found there as well as a brief
11 description of the model structure directory and the case study examples.
12 The latter and the code structure are described more fully in sections 2 and
13 3, respectively. In section 4, we provide information on how to customize
14 the code when you are ready to try implementing the configuration you have
15 in mind.
16
17 \subsection{Obtaining the code}
18
19 The reference web site for the model is:
20 \begin{verbatim}
21 http://mitgcm.org
22 \end{verbatim}
23
24 On this site, you can download the model as well as find useful information,
25 some of which might overlap with what is written here. There is also a
26 support news group for the model located at (send your message to \texttt{%
27 support@mitgcm.org}):
28 \begin{verbatim}
29 news://mitgcm.org/mitgcm.support
30 \end{verbatim}
31
32 If CVS is available on your system, we strongly encourage you to use it. CVS
33 provides an efficient and elegant way of organizing your code and keeping
34 track of your changes. If CVS is not available on your machine, you can also
35 download a tar file.
36
37 \subsubsection{Using CVS}
38
39 Before you can use CVS, the following environment variable has to be set in
40 your .cshrc or .tcshrc:
41 \begin{verbatim}
42 % setenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/u0/gcmpack
43 % cvs login ( CVS password: cvsanon )
44 \end{verbatim}
45
46 You only need to do ``cvs login'' once. To obtain the source for the release:
47 \begin{verbatim}
48 % cvs co -d directory -P -r release1 MITgcmUV
49 \end{verbatim}
50
51 This creates a directory called \textit{directory}. If \textit{directory}
52 exists this command updates your code based on the repository. Each
53 directory in the source tree contains a directory \textit{CVS}. This
54 information is required by CVS to keep track of your file versions with
55 respect to the repository. Don't edit the files in \textit{CVS}! To obtain a
56 different \textit{version} that is not the latest source:
57 \begin{verbatim}
58 % cvs co -d directory -P -r version MITgcm
59 \end{verbatim}
60 or the latest development version:
61 \begin{verbatim}
62 % cvs co -d directory -P MITgcm
63 \end{verbatim}
64
65 \subsubsection{other methods}
66
67 You can download the model as a tar file from the reference web site at:
68 \begin{verbatim}
69 http://mitgcm.org/download/
70 \end{verbatim}
71
72 \subsection{Model and directory structure}
73
74 The ``numerical'' model is contained within a execution environment support
75 wrapper. This wrapper is designed to provide a general framework for
76 grid-point models. MITgcmUV is a specific numerical model that uses the
77 framework. Under this structure the model is split into execution
78 environment support code and conventional numerical model code. The
79 execution environment support code is held under the \textit{eesupp}
80 directory. The grid point model code is held under the \textit{model}
81 directory. Code execution actually starts in the \textit{eesupp} routines
82 and not in the \textit{model} routines. For this reason the top-level
83 \textit{MAIN.F} is in the \textit{eesupp/src} directory. In general,
84 end-users should not need to worry about this level. The top-level routine
85 for the numerical part of the code is in \textit{model/src/THE\_MODEL\_MAIN.F%
86 }. Here is a brief description of the directory structure of the model under
87 the root tree (a detailed description is given in section 3: Code structure).
88
89 \begin{itemize}
90 \item \textit{bin}: this directory is initially empty. It is the default
91 directory in which to compile the code.
92
93 \item \textit{diags}: contains the code relative to time-averaged
94 diagnostics. It is subdivided into two subdirectories \textit{inc} and
95 \textit{src} that contain include files (*.\textit{h} files) and fortran
96 subroutines (*.\textit{F} files), respectively.
97
98 \item \textit{doc}: contains brief documentation notes.
99
100 \item \textit{eesupp}: contains the execution environment source code. Also
101 subdivided into two subdirectories \textit{inc} and \textit{src}.
102
103 \item \textit{exe}: this directory is initially empty. It is the default
104 directory in which to execute the code.
105
106 \item \textit{model}: this directory contains the main source code. Also
107 subdivided into two subdirectories \textit{inc} and \textit{src}.
108
109 \item \textit{pkg}: contains the source code for the packages. Each package
110 corresponds to a subdirectory. For example, \textit{gmredi} contains the
111 code related to the Gent-McWilliams/Redi scheme, \textit{aim} the code
112 relative to the atmospheric intermediate physics. The packages are described
113 in detail in section 3.
114
115 \item \textit{tools}: this directory contains various useful tools. For
116 example, \textit{genmake} is a script written in csh (C-shell) that should
117 be used to generate your makefile. The directory \textit{adjoint} contains
118 the makefile specific to the Tangent linear and Adjoint Compiler (TAMC) that
119 generates the adjoint code. The latter is described in details in part V.
120
121 \item \textit{utils}: this directory contains various utilities. The
122 subdirectory \textit{knudsen2} contains code and a makefile that compute
123 coefficients of the polynomial approximation to the knudsen formula for an
124 ocean nonlinear equation of state. The \textit{matlab} subdirectory contains
125 matlab scripts for reading model output directly into matlab. \textit{scripts%
126 } contains C-shell post-processing scripts for joining processor-based and
127 tiled-based model output.
128
129 \item \textit{verification}: this directory contains the model examples. See
130 below.
131 \end{itemize}
132
133 \subsection{Model examples}
134
135 Now that you have successfully downloaded the model code we recommend that
136 you first try to run the examples provided with the base version. You will
137 probably want to run the example that is the closest to the configuration
138 you will use eventually. The examples are located in subdirectories under
139 the directory \textit{verification} and are briefly described below (a full
140 description is given in section 2):
141
142 \subsubsection{List of model examples}
143
144 \begin{itemize}
145 \item \textit{exp0} - single layer, ocean double gyre (barotropic with
146 free-surface).
147
148 \item \textit{exp1} - 4 layers, ocean double gyre.
149
150 \item \textit{exp2} - 4x4 degree global ocean simulation with steady
151 climatological forcing.
152
153 \item \textit{exp4} - flow over a Gaussian bump in open-water or channel
154 with open boundaries.
155
156 \item \textit{exp5} - inhomogenously forced ocean convection in a doubly
157 periodic box.
158
159 \item \textit{front\_relax} - relaxation of an ocean thermal front (test for
160 Gent/McWilliams scheme). 2D (Y-Z).
161
162 \item \textit{internal wave} - ocean internal wave forced by open boundary
163 conditions.
164
165 \item \textit{natl\_box} - eastern subtropical North Atlantic with KPP
166 scheme; 1 month integration
167
168 \item \textit{hs94.1x64x5} - zonal averaged atmosphere using Held and Suarez
169 '94 forcing.
170
171 \item \textit{hs94.128x64x5} - 3D atmosphere dynamics using Held and Suarez
172 '94 forcing.
173
174 \item \textit{hs94.cs-32x32x5} - 3D atmosphere dynamics using Held and
175 Suarez '94 forcing on the cubed sphere.
176
177 \item \textit{aim.5l\_zon-ave} - Intermediate Atmospheric physics, 5 layers
178 Molteni physics package. Global Zonal Mean configuration, 1x64x5 resolution.
179
180 \item \textit{aim.5l\_XZ\_Equatorial\_Slice} - Intermediate Atmospheric
181 physics, 5 layers Molteni physics package. Equatorial Slice configuration.
182 2D (X-Z).
183
184 \item \textit{aim.5l\_Equatorial\_Channel} - Intermediate Atmospheric
185 physics, 5 layers Molteni physics package. 3D Equatorial Channel
186 configuration (not completely tested).
187
188 \item \textit{aim.5l\_LatLon} - Intermediate Atmospheric physics, 5 layers
189 Molteni physics package. Global configuration, 128x64x5 resolution.
190
191 \item \textit{adjustment.128x64x1}
192
193 \item \textit{adjustment.cs-32x32x1}
194 \end{itemize}
195
196 \subsubsection{Directory structure of model examples}
197
198 Each example directory has the following subdirectories:
199
200 \begin{itemize}
201 \item \textit{code}: contains the code particular to the example. At a
202 minimum, this directory includes the following files:
203
204 \begin{itemize}
205 \item \textit{code/CPP\_EEOPTIONS.h}: declares CPP keys relative to the
206 ``execution environment'' part of the code. The default version is located
207 in \textit{eesupp/inc}.
208
209 \item \textit{code/CPP\_OPTIONS.h}: declares CPP keys relative to the
210 ``numerical model'' part of the code. The default version is located in
211 \textit{model/inc}.
212
213 \item \textit{code/SIZE.h}: declares size of underlying computational grid.
214 The default version is located in \textit{model/inc}.
215 \end{itemize}
216
217 In addition, other include files and subroutines might be present in \textit{%
218 code} depending on the particular experiment. See section 2 for more details.
219
220 \item \textit{input}: contains the input data files required to run the
221 example. At a mimimum, the \textit{input} directory contains the following
222 files:
223
224 \begin{itemize}
225 \item \textit{input/data}: this file, written as a namelist, specifies the
226 main parameters for the experiment.
227
228 \item \textit{input/data.pkg}: contains parameters relative to the packages
229 used in the experiment.
230
231 \item \textit{input/eedata}: this file contains ``execution environment''
232 data. At present, this consists of a specification of the number of threads
233 to use in $X$ and $Y$ under multithreaded execution.
234 \end{itemize}
235
236 In addition, you will also find in this directory the forcing and topography
237 files as well as the files describing the initial state of the experiment.
238 This varies from experiment to experiment. See section 2 for more details.
239
240 \item \textit{results}: this directory contains the output file \textit{%
241 output.txt} produced by the simulation example. This file is useful for
242 comparison with your own output when you run the experiment.
243 \end{itemize}
244
245 Once you have chosen the example you want to run, you are ready to compile
246 the code.
247
248 \subsection{Compiling the code}
249
250 \subsubsection{The script \textit{genmake}}
251
252 To compile the code, use the script \textit{genmake} located in the \textit{%
253 tools} directory. \textit{genmake} is a script that generates the makefile.
254 It has been written so that the code can be compiled on a wide diversity of
255 machines and systems. However, if it doesn't work the first time on your
256 platform, you might need to edit certain lines of \textit{genmake} in the
257 section containing the setups for the different machines. The file is
258 structured like this:
259 \begin{verbatim}
260 .
261 .
262 .
263 general instructions (machine independent)
264 .
265 .
266 .
267 - setup machine 1
268 - setup machine 2
269 - setup machine 3
270 - setup machine 4
271 etc
272 .
273 .
274 .
275 \end{verbatim}
276
277 For example, the setup corresponding to a DEC alpha machine is reproduced
278 here:
279 \begin{verbatim}
280 case OSF1+mpi:
281 echo "Configuring for DEC Alpha"
282 set CPP = ( '/usr/bin/cpp -P' )
283 set DEFINES = ( ${DEFINES} '-DTARGET_DEC -DWORDLENGTH=1' )
284 set KPP = ( 'kapf' )
285 set KPPFILES = ( 'main.F' )
286 set KFLAGS1 = ( '-scan=132 -noconc -cmp=' )
287 set FC = ( 'f77' )
288 set FFLAGS = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' )
289 set FOPTIM = ( '-O5 -fast -tune host -inline all' )
290 set NOOPTFLAGS = ( '-O0' )
291 set LIBS = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' )
292 set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F')
293 set RMFILES = ( '*.p.out' )
294 breaksw
295 \end{verbatim}
296
297 Typically, these are the lines that you might need to edit to make \textit{%
298 genmake} work on your platform if it doesn't work the first time. \textit{%
299 genmake} understands several options that are described here:
300
301 \begin{itemize}
302 \item -rootdir=dir
303
304 indicates where the model root directory is relative to the directory where
305 you are compiling. This option is not needed if you compile in the \textit{%
306 bin} directory (which is the default compilation directory) or within the
307 \textit{verification} tree.
308
309 \item -mods=dir1,dir2,...
310
311 indicates the relative or absolute paths directories where the sources
312 should take precedence over the default versions (located in \textit{model},
313 \textit{eesupp},...). Typically, this option is used when running the
314 examples, see below.
315
316 \item -enable=pkg1,pkg2,...
317
318 enables packages source code \textit{pkg1}, \textit{pkg2},... when creating
319 the makefile.
320
321 \item -disable=pkg1,pkg2,...
322
323 disables packages source code \textit{pkg1}, \textit{pkg2},... when creating
324 the makefile.
325
326 \item -platform=machine
327
328 specifies the platform for which you want the makefile. In general, you
329 won't need this option. \textit{genmake} will select the right machine for
330 you (the one you're working on!). However, this option is useful if you have
331 a choice of several compilers on one machine and you want to use the one
332 that is not the default (ex: \texttt{pgf77} instead of \texttt{f77} under
333 Linux).
334
335 \item -mpi
336
337 this is used when you want to run the model in parallel processing mode
338 under mpi (see section on parallel computation for more details).
339
340 \item -jam
341
342 this is used when you want to run the model in parallel processing mode
343 under jam (see section on parallel computation for more details).
344 \end{itemize}
345
346 For some of the examples, there is a file called \textit{.genmakerc} in the
347 \textit{input} directory that has the relevant \textit{genmake} options for
348 that particular example. In this way you don't need to type the options when
349 invoking \textit{genmake}.
350
351 \subsubsection{Compiling}
352
353 Let's assume that you want to run, say, example \textit{exp2} in the \textit{%
354 input} directory. To compile the code, type the following commands from the
355 model root tree:
356 \begin{verbatim}
357 % cd verification/exp2/input
358 % ../../../tools/genmake
359 % make depend
360 % make
361 \end{verbatim}
362
363 If there is no \textit{.genmakerc} in the \textit{input} directory, you have
364 to use the following options when invoking \textit{genmake}:
365 \begin{verbatim}
366 % ../../../tools/genmake -mods=../code
367 \end{verbatim}
368
369 In addition, you will probably want to disable some of the packages. Taking
370 again the case of \textit{exp2}, the full \textit{genmake} command will
371 probably look like this:
372 \begin{verbatim}
373 % ../../../tools/genmake -mods=../code -disable=kpp,gmredi,aim,...
374 \end{verbatim}
375
376 The make command creates an executable called \textit{mitgcmuv}.
377
378 Note that you can compile and run the code in another directory than \textit{%
379 input}. You just need to make sure that you copy the input data files into
380 the directory where you want to run the model. For example to compile from
381 \textit{code}:
382 \begin{verbatim}
383 % cd verification/exp2/code
384 % ../../../tools/genmake
385 % make depend
386 % make
387 \end{verbatim}
388
389 \subsection{Running the model}
390
391 The first thing to do is to run the code by typing \textit{mitgcmuv} and see
392 what happens. You can compare what you get with what is in the \textit{%
393 results} directory. Unless noted otherwise, most examples are set up to run
394 for a few time steps only so that you can quickly figure out whether the
395 model is working or not.
396
397 \subsubsection{Output files}
398
399 The model produces various output files. At a minimum, the instantaneous
400 ``state'' of the model is written out, which is made of the following files:
401
402 \begin{itemize}
403 \item \textit{U.00000nIter} - zonal component of velocity field (m/s and $>
404 0 $ eastward).
405
406 \item \textit{V.00000nIter} - meridional component of velocity field (m/s
407 and $> 0$ northward).
408
409 \item \textit{W.00000nIter} - vertical component of velocity field (ocean:
410 m/s and $> 0$ upward, atmosphere: Pa/s and $> 0$ towards increasing pressure
411 i.e. downward).
412
413 \item \textit{T.00000nIter} - potential temperature (ocean: $^{0}$C,
414 atmosphere: $^{0}$K).
415
416 \item \textit{S.00000nIter} - ocean: salinity (psu), atmosphere: water vapor
417 (g/kg).
418
419 \item \textit{Eta.00000nIter} - ocean: surface elevation (m), atmosphere:
420 surface pressure anomaly (Pa).
421 \end{itemize}
422
423 The chain \textit{00000nIter} consists of ten figures that specify the
424 iteration number at which the output is written out. For example, \textit{%
425 U.0000000300} is the zonal velocity at iteration 300.
426
427 In addition, a ``pickup'' or ``checkpoint'' file called:
428
429 \begin{itemize}
430 \item \textit{pickup.00000nIter}
431 \end{itemize}
432
433 is written out. This file represents the state of the model in a condensed
434 form and is used for restarting the integration. If the C-D scheme is used,
435 there is an additional ``pickup'' file:
436
437 \begin{itemize}
438 \item \textit{pickup\_cd.00000nIter}
439 \end{itemize}
440
441 containing the D-grid velocity data and that has to be written out as well
442 in order to restart the integration. Rolling checkpoint files are the same
443 as the pickup files but are named differently. Their name contain the chain
444 \textit{ckptA} or \textit{ckptB} instead of \textit{00000nIter}. They can be
445 used to restart the model but are overwritten every other time they are
446 output to save disk space during long integrations.
447
448 \subsubsection{Looking at the output}
449
450 All the model data are written according to a ``meta/data'' file format.
451 Each variable is associated with two files with suffix names \textit{.data}
452 and \textit{.meta}. The \textit{.data} file contains the data written in
453 binary form (big\_endian by default). The \textit{.meta} file is a
454 ``header'' file that contains information about the size and the structure
455 of the \textit{.data} file. This way of organizing the output is
456 particularly useful when running multi-processors calculations. The base
457 version of the model includes a few matlab utilities to read output files
458 written in this format. The matlab scripts are located in the directory
459 \textit{utils/matlab} under the root tree. The script \textit{rdmds.m} reads
460 the data. Look at the comments inside the script to see how to use it.
461
462 \section{Code structure}
463
464 \section{Doing it yourself: customizing the code}
465
466 \subsection{\protect\bigskip Configuration and setup}
467
468 When you are ready to run the model in the configuration you want, the
469 easiest thing is to use and adapt the setup of the case studies experiment
470 (described previously) that is the closest to your configuration. Then, the
471 amount of setup will be minimized. In this section, we focus on the setup
472 relative to the ''numerical model'' part of the code (the setup relative to
473 the ''execution environment'' part is covered in the parallel implementation
474 section) and on the variables and parameters that you are likely to change.
475
476 The CPP keys relative to the ''numerical model'' part of the code are all
477 defined and set in the file \textit{CPP\_OPTIONS.h }in the directory \textit{%
478 model/inc }or in one of the \textit{code }directories of the case study
479 experiments under \textit{verification.} The model parameters are defined
480 and declared in the file \textit{model/inc/PARAMS.h }and their default
481 values are set in the routine \textit{model/src/set\_defaults.F. }The
482 default values can be modified in the namelist file \textit{data }which
483 needs to be located in the directory where you will run the model. The
484 parameters are initialized in the routine \textit{model/src/ini\_parms.F}.
485 Look at this routine to see in what part of the namelist the parameters are
486 located.
487
488 In what follows the parameters are grouped into categories related to the
489 computational domain, the equations solved in the model, and the simulation
490 controls.
491
492 \subsubsection{Computational domain, geometry and time-discretization}
493
494 \begin{itemize}
495 \item dimensions
496 \end{itemize}
497
498 The number of points in the x, y,\textit{\ }and r\textit{\ }directions are
499 represented by the variables \textbf{sNx}\textit{, }\textbf{sNy}\textit{, }%
500 and \textbf{Nr}\textit{\ }respectively which are declared and set in the
501 file \textit{model/inc/SIZE.h. }(Again, this assumes a mono-processor
502 calculation. For multiprocessor calculations see section on parallel
503 implementation.)
504
505 \begin{itemize}
506 \item grid
507 \end{itemize}
508
509 Three different grids are available: cartesian, spherical polar, and
510 curvilinear (including the cubed sphere). The grid is set through the
511 logical variables \textbf{usingCartesianGrid}\textit{, }\textbf{%
512 usingSphericalPolarGrid}\textit{, }and \textit{\ }\textbf{%
513 usingCurvilinearGrid}\textit{. }In the case of spherical and curvilinear
514 grids, the southern boundary is defined through the variable \textbf{phiMin}%
515 \textit{\ }which corresponds to the latitude of the southern most cell face
516 (in degrees). The resolution along the x and y directions is controlled by
517 the 1D arrays \textbf{delx}\textit{\ }and \textbf{dely}\textit{\ }(in meters
518 in the case of a cartesian grid, in degrees otherwise). The vertical grid
519 spacing is set through the 1D array \textbf{delz }for the ocean (in meters)
520 or \textbf{delp}\textit{\ }for the atmosphere (in Pa). The variable \textbf{%
521 Ro\_SeaLevel} represents the standard position of Sea-Level in ''R''
522 coordinate. This is typically set to 0m for the ocean (default value) and 10$%
523 ^{5}$Pa for the atmosphere. For the atmosphere, also set the logical
524 variable \textbf{groundAtK1} to '.\texttt{TRUE}.'. which put the first level
525 (k=1) at the lower boundary (ground).
526
527 For the cartesian grid case, the Coriolis parameter $f$ is set through the
528 variables \textbf{f0}\textit{\ }and \textbf{beta}\textit{\ }which correspond
529 to the reference Coriolis parameter (in s$^{-1}$) and $\frac{\partial f}{%
530 \partial y}$(in m$^{-1}$s$^{-1}$) respectively. If \textbf{beta }\textit{\ }%
531 is set to a nonzero value, \textbf{f0}\textit{\ }is the value of $f$ at the
532 southern edge of the domain.
533
534 \begin{itemize}
535 \item topography - full and partial cells
536 \end{itemize}
537
538 The domain bathymetry is read from a file that contains a 2D (x,y) map of
539 depths (in m) for the ocean or pressures (in Pa) for the atmosphere. The
540 file name is represented by the variable \textbf{bathyFile}\textit{. }The
541 file is assumed to contain binary numbers giving the depth (pressure) of the
542 model at each grid cell, ordered with the x coordinate varying fastest. The
543 points are ordered from low coordinate to high coordinate for both axes. The
544 model code applies without modification to enclosed, periodic, and double
545 periodic domains. Periodicity is assumed by default and is suppressed by
546 setting the depths to 0m for the cells at the limits of the computational
547 domain (note: not sure this is the case for the atmosphere). The precision
548 with which to read the binary data is controlled by the integer variable
549 \textbf{readBinaryPrec }which can take the value \texttt{32} (single
550 precision) or \texttt{64} (double precision). See the matlab program \textit{%
551 gendata.m }in the \textit{input }directories under \textit{verification }to
552 see how the bathymetry files are generated for the case study experiments.
553
554 To use the partial cell capability, the variable \textbf{hFacMin}\textit{\ }%
555 needs to be set to a value between 0 and 1 (it is set to 1 by default)
556 corresponding to the minimum fractional size of the cell. For example if the
557 bottom cell is 500m thick and \textbf{hFacMin}\textit{\ }is set to 0.1, the
558 actual thickness of the cell (i.e. used in the code) can cover a range of
559 discrete values 50m apart from 50m to 500m depending on the value of the
560 bottom depth (in \textbf{bathyFile}) at this point.
561
562 Note that the bottom depths (or pressures) need not coincide with the models
563 levels as deduced from \textbf{delz}\textit{\ }or\textit{\ }\textbf{delp}%
564 \textit{. }The model will interpolate the numbers in \textbf{bathyFile}%
565 \textit{\ }so that they match the levels obtained from \textbf{delz}\textit{%
566 \ }or\textit{\ }\textbf{delp}\textit{\ }and \textbf{hFacMin}\textit{. }
567
568 (Note: the atmospheric case is a bit more complicated than what is written
569 here I think. To come soon...)
570
571 \begin{itemize}
572 \item time-discretization
573 \end{itemize}
574
575 The time steps are set through the real variables \textbf{deltaTMom }and
576 \textbf{deltaTtracer }(in s) which represent the time step for the momentum
577 and tracer equations, respectively. For synchronous integrations, simply set
578 the two variables to the same value (or you can prescribe one time step only
579 through the variable \textbf{deltaT}). The Adams-Bashforth stabilizing
580 parameter is set through the variable \textbf{abEps }(dimensionless). The
581 stagger baroclinic time stepping can be activated by setting the logical
582 variable \textbf{staggerTimeStep }to '.\texttt{TRUE}.'.
583
584 \subsubsection{Equation of state}
585
586 First, because the model equations are written in terms of perturbations, a
587 reference thermodynamic state needs to be specified. This is done through
588 the 1D arrays \textbf{tRef}\textit{\ }and \textbf{sRef}. \textbf{tRef }%
589 specifies the reference potential temperature profile (in $^{o}$C for
590 the ocean and $^{o}$K for the atmosphere) starting from the level
591 k=1. Similarly, \textbf{sRef}\textit{\ }specifies the reference salinity
592 profile (in ppt) for the ocean or the reference specific humidity profile
593 (in g/kg) for the atmosphere.
594
595 The form of the equation of state is controlled by the character variables
596 \textbf{buoyancyRelation}\textit{\ }and \textbf{eosType}\textit{. }\textbf{%
597 buoyancyRelation}\textit{\ }is set to '\texttt{OCEANIC}' by default and
598 needs to be set to '\texttt{ATMOSPHERIC}' for atmosphere simulations. In
599 this case, \textbf{eosType}\textit{\ }must be set to '\texttt{IDEALGAS}'.
600 For the ocean, two forms of the equation of state are available: linear (set
601 \textbf{eosType}\textit{\ }to '\texttt{LINEAR}') and a polynomial
602 approximation to the full nonlinear equation ( set \textbf{eosType}\textit{\
603 }to '\texttt{POLYNOMIAL}'). In the linear case, you need to specify the
604 thermal and haline expansion coefficients represented by the variables
605 \textbf{tAlpha}\textit{\ }(in K$^{-1}$) and \textbf{sBeta}\textit{\ }(in ppt$%
606 ^{-1}$). For the nonlinear case, you need to generate a file of polynomial
607 coefficients called \textit{POLY3.COEFFS. }To do this, use the program
608 \textit{utils/knudsen2/knudsen2.f }under the model tree (a Makefile is
609 available in the same directory and you will need to edit the number and the
610 values of the vertical levels in \textit{knudsen2.f }so that they match
611 those of your configuration). \textit{\ }
612
613 \subsubsection{Momentum equations}
614
615 In this section, we only focus for now on the parameters that you are likely
616 to change, i.e. the ones relative to forcing and dissipation for example.
617 The details relevant to the vector-invariant form of the equations and the
618 various advection schemes are not covered for the moment. We assume that you
619 use the standard form of the momentum equations (i.e. the flux-form) with
620 the default advection scheme. Also, there are a few logical variables that
621 allow you to turn on/off various terms in the momentum equation. These
622 variables are called \textbf{momViscosity, momAdvection, momForcing,
623 useCoriolis, momPressureForcing, momStepping}\textit{, }and \textit{\ }%
624 \textbf{metricTerms }and are assumed to be set to '.\texttt{TRUE}.' here.
625 Look at the file \textit{model/inc/PARAMS.h }for a precise definition of
626 these variables.
627
628 \begin{itemize}
629 \item initialization
630 \end{itemize}
631
632 The velocity components are initialized to 0 unless the simulation is
633 starting from a pickup file (see section on simulation control parameters).
634
635 \begin{itemize}
636 \item forcing
637 \end{itemize}
638
639 This section only applies to the ocean. You need to generate wind-stress
640 data into two files \textbf{zonalWindFile}\textit{\ }and \textbf{%
641 meridWindFile }corresponding to the zonal and meridional components of the
642 wind stress, respectively (if you want the stress to be along the direction
643 of only one of the model horizontal axes, you only need to generate one
644 file). The format of the files is similar to the bathymetry file. The zonal
645 (meridional) stress data are assumed to be in Pa and located at U-points
646 (V-points). As for the bathymetry, the precision with which to read the
647 binary data is controlled by the variable \textbf{readBinaryPrec}.\textbf{\ }
648 See the matlab program \textit{gendata.m }in the \textit{input }directories
649 under \textit{verification }to see how simple analytical wind forcing data
650 are generated for the case study experiments.
651
652 There is also the possibility of prescribing time-dependent periodic
653 forcing. To do this, concatenate the successive time records into a single
654 file (for each stress component) ordered in a (x, y, t) fashion and set the
655 following variables: \textbf{periodicExternalForcing }to '.\texttt{TRUE}.',
656 \textbf{externForcingPeriod }to the period (in s) of which the forcing
657 varies (typically 1 month), and \textbf{externForcingCycle }to the repeat
658 time (in s) of the forcing (typically 1 year -- note: \textbf{%
659 externForcingCycle }must be a multiple of \textbf{externForcingPeriod}).
660 With these variables set up, the model will interpolate the forcing linearly
661 at each iteration.
662
663 \begin{itemize}
664 \item dissipation
665 \end{itemize}
666
667 The lateral eddy viscosity coefficient is specified through the variable
668 \textbf{viscAh}\textit{\ }(in m$^{2}$s$^{-1}$). The vertical eddy viscosity
669 coefficient is specified through the variable \textbf{viscAz }(in m$^{2}$s$%
670 ^{-1}$) for the ocean and \textbf{viscAp}\textit{\ }(in Pa$^{2}$s$^{-1}$)
671 for the atmosphere. The vertical diffusive fluxes can be computed implicitly
672 by setting the logical variable \textbf{implicitViscosity }to '.\texttt{TRUE}%
673 .'. In addition, biharmonic mixing can be added as well through the variable
674 \textbf{viscA4}\textit{\ }(in m$^{4}$s$^{-1}$). On a spherical polar grid,
675 you might also need to set the variable \textbf{cosPower} which is set to 0
676 by default and which represents the power of cosine of latitude to multiply
677 viscosity. Slip or no-slip conditions at lateral and bottom boundaries are
678 specified through the logical variables \textbf{no\_slip\_sides}\textit{\ }%
679 and \textbf{no\_slip\_bottom}. If set to '\texttt{.FALSE.}', free-slip
680 boundary conditions are applied. If no-slip boundary conditions are applied
681 at the bottom, a bottom drag can be applied as well. Two forms are
682 available: linear (set the variable \textbf{bottomDragLinear}\textit{\ }in s$%
683 ^{-1}$) and quadratic (set the variable \textbf{bottomDragQuadratic}\textit{%
684 \ }in m$^{-1}$).
685
686 The Fourier and Shapiro filters are described elsewhere.
687
688 \begin{itemize}
689 \item C-D scheme
690 \end{itemize}
691
692 If you run at a sufficiently coarse resolution, you will need the C-D scheme
693 for the computation of the Coriolis terms. The variable\textbf{\ tauCD},
694 which represents the C-D scheme coupling timescale (in s) needs to be set.
695
696 \begin{itemize}
697 \item calculation of pressure/geopotential
698 \end{itemize}
699
700 First, to run a non-hydrostatic ocean simulation, set the logical variable
701 \textbf{nonHydrostatic} to '.\texttt{TRUE}.'. The pressure field is then
702 inverted through a 3D elliptic equation. (Note: this capability is not
703 available for the atmosphere yet.) By default, a hydrostatic simulation is
704 assumed and a 2D elliptic equation is used to invert the pressure field. The
705 parameters controlling the behaviour of the elliptic solvers are the
706 variables \textbf{cg2dMaxIters}\textit{\ }and \textbf{cg2dTargetResidual }%
707 for the 2D case and \textbf{cg3dMaxIters}\textit{\ }and \textbf{%
708 cg3dTargetResidual }for the 3D case. You probably won't need to alter the
709 default values (are we sure of this?).
710
711 For the calculation of the surface pressure (for the ocean) or surface
712 geopotential (for the atmosphere) you need to set the logical variables
713 \textbf{rigidLid} and \textbf{implicitFreeSurface}\textit{\ }(set one to '.%
714 \texttt{TRUE}.' and the other to '.\texttt{FALSE}.' depending on how you
715 want to deal with the ocean upper or atmosphere lower boundary).
716
717 \subsubsection{Tracer equations}
718
719 This section covers the tracer equations i.e. the potential temperature
720 equation and the salinity (for the ocean) or specific humidity (for the
721 atmosphere) equation. As for the momentum equations, we only describe for
722 now the parameters that you are likely to change. The logical variables
723 \textbf{tempDiffusion}\textit{, }\textbf{tempAdvection}\textit{, }\textbf{%
724 tempForcing}\textit{,} and \textbf{tempStepping} allow you to turn on/off
725 terms in the temperature equation (same thing for salinity or specific
726 humidity with variables \textbf{saltDiffusion}\textit{, }\textbf{%
727 saltAdvection}\textit{\ }etc). These variables are all assumed here to be
728 set to '.\texttt{TRUE}.'. Look at file \textit{model/inc/PARAMS.h }for a
729 precise definition.
730
731 \begin{itemize}
732 \item initialization
733 \end{itemize}
734
735 The initial tracer data can be contained in the binary files \textbf{%
736 hydrogThetaFile }and \textbf{hydrogSaltFile}. These files should contain 3D
737 data ordered in an (x, y, r) fashion with k=1 as the first vertical level.
738 If no file names are provided, the tracers are then initialized with the
739 values of \textbf{tRef }and \textbf{sRef }mentioned above (in the equation
740 of state section). In this case, the initial tracer data are uniform in x
741 and y for each depth level.
742
743 \begin{itemize}
744 \item forcing
745 \end{itemize}
746
747 This part is more relevant for the ocean, the procedure for the atmosphere
748 not being completely stabilized at the moment.
749
750 A combination of fluxes data and relaxation terms can be used for driving
751 the tracer equations. \ For potential temperature, heat flux data (in W/m$%
752 ^{2}$) can be stored in the 2D binary file \textbf{surfQfile}\textit{. }%
753 Alternatively or in addition, the forcing can be specified through a
754 relaxation term. The SST data to which the model surface temperatures are
755 restored to are supposed to be stored in the 2D binary file \textbf{%
756 thetaClimFile}\textit{. }The corresponding relaxation time scale coefficient
757 is set through the variable \textbf{tauThetaClimRelax}\textit{\ }(in s). The
758 same procedure applies for salinity with the variable names \textbf{EmPmRfile%
759 }\textit{, }\textbf{saltClimFile}\textit{, }and \textbf{tauSaltClimRelax}%
760 \textit{\ }for freshwater flux (in m/s) and surface salinity (in ppt) data
761 files and relaxation time scale coefficient (in s), respectively. Also for
762 salinity, if the CPP key \textbf{USE\_NATURAL\_BCS} is turned on, natural
763 boundary conditions are applied i.e. when computing the surface salinity
764 tendency, the freshwater flux is multiplied by the model surface salinity
765 instead of a constant salinity value.
766
767 As for the other input files, the precision with which to read the data is
768 controlled by the variable \textbf{readBinaryPrec}. Time-dependent, periodic
769 forcing can be applied as well following the same procedure used for the
770 wind forcing data (see above).
771
772 \begin{itemize}
773 \item dissipation
774 \end{itemize}
775
776 Lateral eddy diffusivities for temperature and salinity/specific humidity
777 are specified through the variables \textbf{diffKhT }and \textbf{diffKhS }%
778 (in m$^{2}$/s). Vertical eddy diffusivities are specified through the
779 variables \textbf{diffKzT }and \textbf{diffKzS }(in m$^{2}$/s) for the ocean
780 and \textbf{diffKpT }and \textbf{diffKpS }(in Pa$^{2}$/s) for the
781 atmosphere. The vertical diffusive fluxes can be computed implicitly by
782 setting the logical variable \textbf{implicitDiffusion }to '.\texttt{TRUE}%
783 .'. In addition, biharmonic diffusivities can be specified as well through
784 the coefficients \textbf{diffK4T }and \textbf{diffK4S }(in m$^{4}$/s). Note
785 that the cosine power scaling (specified through \textbf{cosPower }- see the
786 momentum equations section) is applied to the tracer diffusivities
787 (Laplacian and biharmonic) as well. The Gent and McWilliams parameterization
788 for oceanic tracers is described in the package section. Finally, note that
789 tracers can be also subject to Fourier and Shapiro filtering (see the
790 corresponding section on these filters).
791
792 \begin{itemize}
793 \item ocean convection
794 \end{itemize}
795
796 Two options are available to parameterize ocean convection: one is to use
797 the convective adjustment scheme. In this case, you need to set the variable
798 \textbf{cadjFreq}, which represents the frequency (in s) with which the
799 adjustment algorithm is called, to a non-zero value (if set to a negative
800 value by the user, the model will set it to the tracer time step). The other
801 option is to parameterize convection with implicit vertical diffusion. To do
802 this, set the logical variable \textbf{implicitDiffusion }to '.\texttt{TRUE}%
803 .' and the real variable \textbf{ivdc\_kappa }to a value (in m$^{2}$/s) you
804 wish the tracer vertical diffusivities to have when mixing tracers
805 vertically due to static instabilities. Note that \textbf{cadjFreq }and
806 \textbf{ivdc\_kappa }can not both have non-zero value.
807
808 \subsubsection{Simulation controls}
809
810 The model ''clock'' is defined by the variable \textbf{deltaTClock }(in s)
811 which determines the IO frequencies and is used in tagging output.
812 Typically, you will set it to the tracer time step for accelerated runs
813 (otherwise it is simply set to the default time step \textbf{deltaT}).
814 Frequency of checkpointing and dumping of the model state are referenced to
815 this clock (see below).
816
817 \begin{itemize}
818 \item run duration
819 \end{itemize}
820
821 The beginning of a simulation is set by specifying a start time (in s)
822 through the real variable \textbf{startTime }or by specifying an initial
823 iteration number through the integer variable \textbf{nIter0}. If these
824 variables are set to nonzero values, the model will look for a ''pickup''
825 file \textit{pickup.0000nIter0 }to restart the integration\textit{. }The end
826 of a simulation is set through the real variable \textbf{endTime }(in s).
827 Alternatively, you can specify instead the number of time steps to execute
828 through the integer variable \textbf{nTimeSteps}.
829
830 \begin{itemize}
831 \item frequency of output
832 \end{itemize}
833
834 Real variables defining frequencies (in s) with which output files are
835 written on disk need to be set up. \textbf{dumpFreq }controls the frequency
836 with which the instantaneous state of the model is saved. \textbf{chkPtFreq }%
837 and \textbf{pchkPtFreq }control the output frequency of rolling and
838 permanent checkpoint files, respectively. See section 1.5.1 Output files for the
839 definition of model state and checkpoint files. In addition, time-averaged
840 fields can be written out by setting the variable \textbf{taveFreq} (in s).
841 The precision with which to write the binary data is controlled by the
842 integer variable w\textbf{riteBinaryPrec }(set it to \texttt{32} or \texttt{%
843 64}).

  ViewVC Help
Powered by ViewVC 1.1.22