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

Annotation of /manual/s_getstarted/text/customization.tex

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


Revision 1.11 - (hide annotations) (download) (as text)
Mon Aug 30 23:09:20 2010 UTC (14 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint01, HEAD
Changes since 1.10: +1 -1 lines
File MIME type: application/x-tex
clean-up latex built:
 (remove multiple definition of label; fix missing reference; replace
  non-standard latex stuff; ...)

1 molod 1.6 \section[Customizing MITgcm]{Doing it yourself: customizing the model configuration}
2 jmc 1.11 \label{sec:customize}
3 edhill 1.3 \begin{rawhtml}
4     <!-- CMIREDIR:customizing_mitgcm: -->
5     \end{rawhtml}
6 cnh 1.1
7     When you are ready to run the model in the configuration you want, the
8     easiest thing is to use and adapt the setup of the case studies
9     experiment (described previously) that is the closest to your
10     configuration. Then, the amount of setup will be minimized. In this
11     section, we focus on the setup relative to the ``numerical model''
12     part of the code (the setup relative to the ``execution environment''
13     part is covered in the parallel implementation section) and on the
14     variables and parameters that you are likely to change.
15    
16     The CPP keys relative to the ``numerical model'' part of the code are
17     all defined and set in the file \textit{CPP\_OPTIONS.h }in the
18     directory \textit{ model/inc }or in one of the \textit{code
19     }directories of the case study experiments under
20     \textit{verification.} The model parameters are defined and declared
21     in the file \textit{model/inc/PARAMS.h }and their default values are
22     set in the routine \textit{model/src/set\_defaults.F. }The default
23     values can be modified in the namelist file \textit{data }which needs
24     to be located in the directory where you will run the model. The
25     parameters are initialized in the routine
26     \textit{model/src/ini\_parms.F}. Look at this routine to see in what
27 molod 1.6 part of the namelist the parameters are located. Here is a complete list
28     of the model parameters related to the main model (namelist parameters
29     for the packages are located in the package descriptions), their meaning,
30     and their default values:
31    
32 jmc 1.10 \input{s_getstarted/text/main-parms.tex}
33 cnh 1.1
34     In what follows the parameters are grouped into categories related to
35     the computational domain, the equations solved in the model, and the
36     simulation controls.
37    
38 molod 1.6 \subsection{Parameters: Computational domain, geometry and time-discretization}
39 cnh 1.1
40     \begin{description}
41     \item[dimensions] \
42    
43     The number of points in the x, y, and r directions are represented
44     by the variables \textbf{sNx}, \textbf{sNy} and \textbf{Nr}
45     respectively which are declared and set in the file
46     \textit{model/inc/SIZE.h}. (Again, this assumes a mono-processor
47     calculation. For multiprocessor calculations see the section on
48     parallel implementation.)
49    
50     \item[grid] \
51    
52     Three different grids are available: cartesian, spherical polar, and
53     curvilinear (which includes the cubed sphere). The grid is set
54     through the logical variables \textbf{usingCartesianGrid},
55     \textbf{usingSphericalPolarGrid}, and \textbf{usingCurvilinearGrid}.
56     In the case of spherical and curvilinear grids, the southern
57 jmc 1.8 boundary is defined through the variable \textbf{ygOrigin} which
58 cnh 1.1 corresponds to the latitude of the southern most cell face (in
59     degrees). The resolution along the x and y directions is controlled
60     by the 1D arrays \textbf{delx} and \textbf{dely} (in meters in the
61     case of a cartesian grid, in degrees otherwise). The vertical grid
62     spacing is set through the 1D array \textbf{delz} for the ocean (in
63     meters) or \textbf{delp} for the atmosphere (in Pa). The variable
64     \textbf{Ro\_SeaLevel} represents the standard position of Sea-Level
65     in ``R'' coordinate. This is typically set to 0m for the ocean
66     (default value) and 10$^{5}$Pa for the atmosphere. For the
67     atmosphere, also set the logical variable \textbf{groundAtK1} to
68     \texttt{'.TRUE.'} which puts the first level (k=1) at the lower
69     boundary (ground).
70    
71     For the cartesian grid case, the Coriolis parameter $f$ is set
72     through the variables \textbf{f0} and \textbf{beta} which correspond
73     to the reference Coriolis parameter (in s$^{-1}$) and
74     $\frac{\partial f}{ \partial y}$(in m$^{-1}$s$^{-1}$) respectively.
75     If \textbf{beta } is set to a nonzero value, \textbf{f0} is the
76     value of $f$ at the southern edge of the domain.
77    
78     \item[topography - full and partial cells] \
79    
80     The domain bathymetry is read from a file that contains a 2D (x,y)
81     map of depths (in m) for the ocean or pressures (in Pa) for the
82     atmosphere. The file name is represented by the variable
83     \textbf{bathyFile}. The file is assumed to contain binary numbers
84     giving the depth (pressure) of the model at each grid cell, ordered
85     with the x coordinate varying fastest. The points are ordered from
86     low coordinate to high coordinate for both axes. The model code
87     applies without modification to enclosed, periodic, and double
88     periodic domains. Periodicity is assumed by default and is
89     suppressed by setting the depths to 0m for the cells at the limits
90     of the computational domain (note: not sure this is the case for the
91     atmosphere). The precision with which to read the binary data is
92     controlled by the integer variable \textbf{readBinaryPrec} which can
93     take the value \texttt{32} (single precision) or \texttt{64} (double
94     precision). See the matlab program \textit{gendata.m} in the
95     \textit{input} directories under \textit{verification} to see how
96     the bathymetry files are generated for the case study experiments.
97    
98     To use the partial cell capability, the variable \textbf{hFacMin}
99     needs to be set to a value between 0 and 1 (it is set to 1 by
100     default) corresponding to the minimum fractional size of the cell.
101     For example if the bottom cell is 500m thick and \textbf{hFacMin} is
102     set to 0.1, the actual thickness of the cell (i.e. used in the code)
103     can cover a range of discrete values 50m apart from 50m to 500m
104     depending on the value of the bottom depth (in \textbf{bathyFile})
105     at this point.
106    
107     Note that the bottom depths (or pressures) need not coincide with
108     the models levels as deduced from \textbf{delz} or \textbf{delp}.
109     The model will interpolate the numbers in \textbf{bathyFile} so that
110     they match the levels obtained from \textbf{delz} or \textbf{delp}
111     and \textbf{hFacMin}.
112    
113     (Note: the atmospheric case is a bit more complicated than what is
114     written here I think. To come soon...)
115    
116     \item[time-discretization] \
117    
118     The time steps are set through the real variables \textbf{deltaTMom}
119     and \textbf{deltaTtracer} (in s) which represent the time step for
120     the momentum and tracer equations, respectively. For synchronous
121     integrations, simply set the two variables to the same value (or you
122     can prescribe one time step only through the variable
123     \textbf{deltaT}). The Adams-Bashforth stabilizing parameter is set
124     through the variable \textbf{abEps} (dimensionless). The stagger
125     baroclinic time stepping can be activated by setting the logical
126     variable \textbf{staggerTimeStep} to \texttt{'.TRUE.'}.
127    
128     \end{description}
129    
130    
131 molod 1.6 \subsection{Parameters: Equation of state}
132 cnh 1.1
133     First, because the model equations are written in terms of
134     perturbations, a reference thermodynamic state needs to be specified.
135     This is done through the 1D arrays \textbf{tRef} and \textbf{sRef}.
136     \textbf{tRef} specifies the reference potential temperature profile
137     (in $^{o}$C for the ocean and $^{o}$K for the atmosphere) starting
138     from the level k=1. Similarly, \textbf{sRef} specifies the reference
139     salinity profile (in ppt) for the ocean or the reference specific
140     humidity profile (in g/kg) for the atmosphere.
141    
142     The form of the equation of state is controlled by the character
143     variables \textbf{buoyancyRelation} and \textbf{eosType}.
144     \textbf{buoyancyRelation} is set to \texttt{'OCEANIC'} by default and
145     needs to be set to \texttt{'ATMOSPHERIC'} for atmosphere simulations.
146     In this case, \textbf{eosType} must be set to \texttt{'IDEALGAS'}.
147     For the ocean, two forms of the equation of state are available:
148     linear (set \textbf{eosType} to \texttt{'LINEAR'}) and a polynomial
149     approximation to the full nonlinear equation ( set \textbf{eosType} to
150     \texttt{'POLYNOMIAL'}). In the linear case, you need to specify the
151     thermal and haline expansion coefficients represented by the variables
152     \textbf{tAlpha} (in K$^{-1}$) and \textbf{sBeta} (in ppt$^{-1}$). For
153     the nonlinear case, you need to generate a file of polynomial
154     coefficients called \textit{POLY3.COEFFS}. To do this, use the program
155     \textit{utils/knudsen2/knudsen2.f} under the model tree (a Makefile is
156     available in the same directory and you will need to edit the number
157     and the values of the vertical levels in \textit{knudsen2.f} so that
158     they match those of your configuration).
159    
160     There there are also higher polynomials for the equation of state:
161     \begin{description}
162     \item[\texttt{'UNESCO'}:] The UNESCO equation of state formula of
163     Fofonoff and Millard \cite{fofonoff83}. This equation of state
164     assumes in-situ temperature, which is not a model variable; {\em its
165     use is therefore discouraged, and it is only listed for
166     completeness}.
167     \item[\texttt{'JMD95Z'}:] A modified UNESCO formula by Jackett and
168     McDougall \cite{jackett95}, which uses the model variable potential
169     temperature as input. The \texttt{'Z'} indicates that this equation
170     of state uses a horizontally and temporally constant pressure
171     $p_{0}=-g\rho_{0}z$.
172     \item[\texttt{'JMD95P'}:] A modified UNESCO formula by Jackett and
173     McDougall \cite{jackett95}, which uses the model variable potential
174     temperature as input. The \texttt{'P'} indicates that this equation
175     of state uses the actual hydrostatic pressure of the last time
176     step. Lagging the pressure in this way requires an additional pickup
177     file for restarts.
178     \item[\texttt{'MDJWF'}:] The new, more accurate and less expensive
179     equation of state by McDougall et~al. \cite{mcdougall03}. It also
180     requires lagging the pressure and therefore an additional pickup
181     file for restarts.
182     \end{description}
183     For none of these options an reference profile of temperature or
184     salinity is required.
185    
186 molod 1.6 \subsection{Parameters: Momentum equations}
187 cnh 1.1
188     In this section, we only focus for now on the parameters that you are
189     likely to change, i.e. the ones relative to forcing and dissipation
190     for example. The details relevant to the vector-invariant form of the
191     equations and the various advection schemes are not covered for the
192     moment. We assume that you use the standard form of the momentum
193     equations (i.e. the flux-form) with the default advection scheme.
194     Also, there are a few logical variables that allow you to turn on/off
195     various terms in the momentum equation. These variables are called
196     \textbf{momViscosity, momAdvection, momForcing, useCoriolis,
197     momPressureForcing, momStepping} and \textbf{metricTerms }and are
198     assumed to be set to \texttt{'.TRUE.'} here. Look at the file
199     \textit{model/inc/PARAMS.h }for a precise definition of these
200     variables.
201    
202     \begin{description}
203     \item[initialization] \
204    
205 jmc 1.9 The initial horizontal velocity components can be specified from
206     binary files \textbf{uVelInitFile} and \textbf{vVelInitFile}.
207     These files should contain 3D data ordered in an (x,y,r) fashion with
208     k=1 as the first vertical level (surface level).
209     If no file names are provided, the velocity is initialised to zero.
210     The initial vertical velocity is always derived from the horizontal velocity
211     using the continuity equation, even in the case of non-hydrostatic simulation
212     (see, e.g.: {\it tutorial\_deep\_convection/input/data}).
213    
214     In the case of a restart (from the end of a previous simulation),
215     the velocity field is read from a pickup file
216     (see section on simulation control parameters)
217     and the initial velocity files are ignored.
218 cnh 1.1
219     \item[forcing] \
220    
221     This section only applies to the ocean. You need to generate
222     wind-stress data into two files \textbf{zonalWindFile} and
223     \textbf{meridWindFile} corresponding to the zonal and meridional
224     components of the wind stress, respectively (if you want the stress
225     to be along the direction of only one of the model horizontal axes,
226     you only need to generate one file). The format of the files is
227     similar to the bathymetry file. The zonal (meridional) stress data
228     are assumed to be in Pa and located at U-points (V-points). As for
229     the bathymetry, the precision with which to read the binary data is
230     controlled by the variable \textbf{readBinaryPrec}. See the matlab
231     program \textit{gendata.m} in the \textit{input} directories under
232     \textit{verification} to see how simple analytical wind forcing data
233     are generated for the case study experiments.
234    
235     There is also the possibility of prescribing time-dependent periodic
236     forcing. To do this, concatenate the successive time records into a
237     single file (for each stress component) ordered in a (x,y,t) fashion
238     and set the following variables: \textbf{periodicExternalForcing }to
239     \texttt{'.TRUE.'}, \textbf{externForcingPeriod }to the period (in s)
240     of which the forcing varies (typically 1 month), and
241     \textbf{externForcingCycle} to the repeat time (in s) of the forcing
242     (typically 1 year -- note: \textbf{ externForcingCycle} must be a
243     multiple of \textbf{externForcingPeriod}). With these variables set
244     up, the model will interpolate the forcing linearly at each
245     iteration.
246    
247     \item[dissipation] \
248    
249     The lateral eddy viscosity coefficient is specified through the
250     variable \textbf{viscAh} (in m$^{2}$s$^{-1}$). The vertical eddy
251     viscosity coefficient is specified through the variable
252     \textbf{viscAz} (in m$^{2}$s$^{-1}$) for the ocean and
253     \textbf{viscAp} (in Pa$^{2}$s$^{-1}$) for the atmosphere. The
254     vertical diffusive fluxes can be computed implicitly by setting the
255     logical variable \textbf{implicitViscosity }to \texttt{'.TRUE.'}.
256     In addition, biharmonic mixing can be added as well through the
257     variable \textbf{viscA4} (in m$^{4}$s$^{-1}$). On a spherical polar
258     grid, you might also need to set the variable \textbf{cosPower}
259     which is set to 0 by default and which represents the power of
260     cosine of latitude to multiply viscosity. Slip or no-slip conditions
261     at lateral and bottom boundaries are specified through the logical
262     variables \textbf{no\_slip\_sides} and \textbf{no\_slip\_bottom}. If
263     set to \texttt{'.FALSE.'}, free-slip boundary conditions are
264     applied. If no-slip boundary conditions are applied at the bottom, a
265     bottom drag can be applied as well. Two forms are available: linear
266 jmc 1.5 (set the variable \textbf{bottomDragLinear} in m/s) and
267     quadratic (set the variable \textbf{bottomDragQuadratic}, dimensionless).
268 cnh 1.1
269     The Fourier and Shapiro filters are described elsewhere.
270    
271     \item[C-D scheme] \
272    
273     If you run at a sufficiently coarse resolution, you will need the
274     C-D scheme for the computation of the Coriolis terms. The
275     variable\textbf{\ tauCD}, which represents the C-D scheme coupling
276     timescale (in s) needs to be set.
277    
278     \item[calculation of pressure/geopotential] \
279    
280     First, to run a non-hydrostatic ocean simulation, set the logical
281     variable \textbf{nonHydrostatic} to \texttt{'.TRUE.'}. The pressure
282     field is then inverted through a 3D elliptic equation. (Note: this
283     capability is not available for the atmosphere yet.) By default, a
284     hydrostatic simulation is assumed and a 2D elliptic equation is used
285     to invert the pressure field. The parameters controlling the
286     behaviour of the elliptic solvers are the variables
287     \textbf{cg2dMaxIters} and \textbf{cg2dTargetResidual } for
288     the 2D case and \textbf{cg3dMaxIters} and
289     \textbf{cg3dTargetResidual} for the 3D case. You probably won't need to
290     alter the default values (are we sure of this?).
291    
292     For the calculation of the surface pressure (for the ocean) or
293     surface geopotential (for the atmosphere) you need to set the
294     logical variables \textbf{rigidLid} and \textbf{implicitFreeSurface}
295     (set one to \texttt{'.TRUE.'} and the other to \texttt{'.FALSE.'}
296     depending on how you want to deal with the ocean upper or atmosphere
297     lower boundary).
298    
299     \end{description}
300    
301 molod 1.6 \subsection{Parameters: Tracer equations}
302 cnh 1.1
303     This section covers the tracer equations i.e. the potential
304     temperature equation and the salinity (for the ocean) or specific
305     humidity (for the atmosphere) equation. As for the momentum equations,
306     we only describe for now the parameters that you are likely to change.
307     The logical variables \textbf{tempDiffusion} \textbf{tempAdvection}
308     \textbf{tempForcing}, and \textbf{tempStepping} allow you to turn
309     on/off terms in the temperature equation (same thing for salinity or
310     specific humidity with variables \textbf{saltDiffusion},
311     \textbf{saltAdvection} etc.). These variables are all assumed here to
312     be set to \texttt{'.TRUE.'}. Look at file \textit{model/inc/PARAMS.h}
313     for a precise definition.
314    
315     \begin{description}
316     \item[initialization] \
317    
318     The initial tracer data can be contained in the binary files
319     \textbf{hydrogThetaFile} and \textbf{hydrogSaltFile}. These files
320     should contain 3D data ordered in an (x,y,r) fashion with k=1 as the
321     first vertical level. If no file names are provided, the tracers
322     are then initialized with the values of \textbf{tRef} and
323     \textbf{sRef} mentioned above (in the equation of state section). In
324     this case, the initial tracer data are uniform in x and y for each
325     depth level.
326    
327     \item[forcing] \
328    
329     This part is more relevant for the ocean, the procedure for the
330     atmosphere not being completely stabilized at the moment.
331    
332     A combination of fluxes data and relaxation terms can be used for
333     driving the tracer equations. For potential temperature, heat flux
334     data (in W/m$ ^{2}$) can be stored in the 2D binary file
335     \textbf{surfQfile}. Alternatively or in addition, the forcing can
336     be specified through a relaxation term. The SST data to which the
337     model surface temperatures are restored to are supposed to be stored
338     in the 2D binary file \textbf{thetaClimFile}. The corresponding
339     relaxation time scale coefficient is set through the variable
340     \textbf{tauThetaClimRelax} (in s). The same procedure applies for
341     salinity with the variable names \textbf{EmPmRfile},
342     \textbf{saltClimFile}, and \textbf{tauSaltClimRelax} for freshwater
343     flux (in m/s) and surface salinity (in ppt) data files and
344     relaxation time scale coefficient (in s), respectively. Also for
345     salinity, if the CPP key \textbf{USE\_NATURAL\_BCS} is turned on,
346     natural boundary conditions are applied i.e. when computing the
347     surface salinity tendency, the freshwater flux is multiplied by the
348     model surface salinity instead of a constant salinity value.
349    
350     As for the other input files, the precision with which to read the
351     data is controlled by the variable \textbf{readBinaryPrec}.
352     Time-dependent, periodic forcing can be applied as well following
353     the same procedure used for the wind forcing data (see above).
354    
355     \item[dissipation] \
356    
357     Lateral eddy diffusivities for temperature and salinity/specific
358     humidity are specified through the variables \textbf{diffKhT} and
359     \textbf{diffKhS} (in m$^{2}$/s). Vertical eddy diffusivities are
360     specified through the variables \textbf{diffKzT} and
361     \textbf{diffKzS} (in m$^{2}$/s) for the ocean and \textbf{diffKpT
362     }and \textbf{diffKpS} (in Pa$^{2}$/s) for the atmosphere. The
363     vertical diffusive fluxes can be computed implicitly by setting the
364     logical variable \textbf{implicitDiffusion} to \texttt{'.TRUE.'}.
365     In addition, biharmonic diffusivities can be specified as well
366     through the coefficients \textbf{diffK4T} and \textbf{diffK4S} (in
367     m$^{4}$/s). Note that the cosine power scaling (specified through
368     \textbf{cosPower}---see the momentum equations section) is applied to
369     the tracer diffusivities (Laplacian and biharmonic) as well. The
370     Gent and McWilliams parameterization for oceanic tracers is
371     described in the package section. Finally, note that tracers can be
372     also subject to Fourier and Shapiro filtering (see the corresponding
373     section on these filters).
374    
375     \item[ocean convection] \
376    
377     Two options are available to parameterize ocean convection: one is
378     to use the convective adjustment scheme. In this case, you need to
379     set the variable \textbf{cadjFreq}, which represents the frequency
380     (in s) with which the adjustment algorithm is called, to a non-zero
381     value (if set to a negative value by the user, the model will set it
382     to the tracer time step). The other option is to parameterize
383     convection with implicit vertical diffusion. To do this, set the
384     logical variable \textbf{implicitDiffusion} to \texttt{'.TRUE.'}
385     and the real variable \textbf{ivdc\_kappa} to a value (in m$^{2}$/s)
386     you wish the tracer vertical diffusivities to have when mixing
387     tracers vertically due to static instabilities. Note that
388     \textbf{cadjFreq} and \textbf{ivdc\_kappa}can not both have non-zero
389     value.
390    
391     \end{description}
392    
393 molod 1.6 \subsection{Parameters: Simulation controls}
394 cnh 1.1
395     The model ''clock'' is defined by the variable \textbf{deltaTClock}
396     (in s) which determines the IO frequencies and is used in tagging
397     output. Typically, you will set it to the tracer time step for
398     accelerated runs (otherwise it is simply set to the default time step
399     \textbf{deltaT}). Frequency of checkpointing and dumping of the model
400     state are referenced to this clock (see below).
401    
402     \begin{description}
403     \item[run duration] \
404    
405     The beginning of a simulation is set by specifying a start time (in
406     s) through the real variable \textbf{startTime} or by specifying an
407     initial iteration number through the integer variable
408     \textbf{nIter0}. If these variables are set to nonzero values, the
409     model will look for a ''pickup'' file \textit{pickup.0000nIter0} to
410     restart the integration. The end of a simulation is set through the
411     real variable \textbf{endTime} (in s). Alternatively, you can
412     specify instead the number of time steps to execute through the
413     integer variable \textbf{nTimeSteps}.
414    
415     \item[frequency of output] \
416    
417     Real variables defining frequencies (in s) with which output files
418     are written on disk need to be set up. \textbf{dumpFreq} controls
419     the frequency with which the instantaneous state of the model is
420     saved. \textbf{chkPtFreq} and \textbf{pchkPtFreq} control the output
421     frequency of rolling and permanent checkpoint files, respectively.
422     See section 1.5.1 Output files for the definition of model state and
423     checkpoint files. In addition, time-averaged fields can be written
424     out by setting the variable \textbf{taveFreq} (in s). The precision
425     with which to write the binary data is controlled by the integer
426     variable w\textbf{riteBinaryPrec} (set it to \texttt{32} or
427     \texttt{64}).
428    
429     \end{description}
430    
431    
432     %%% Local Variables:
433     %%% mode: latex
434     %%% TeX-master: t
435     %%% End:

  ViewVC Help
Powered by ViewVC 1.1.22