/[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.8 - (hide annotations) (download) (as text)
Tue Jan 27 16:26:43 2009 UTC (16 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.7: +1 -1 lines
File MIME type: application/x-tex
rename thetaMin,phiMin -> xgOrigin,ygOrigin

1 molod 1.6 \section[Customizing MITgcm]{Doing it yourself: customizing the model configuration}
2 molod 1.4 \label{sect: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 molod 1.7 \input{./part3/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     The velocity components are initialized to 0 unless the simulation
206     is starting from a pickup file (see section on simulation control
207     parameters).
208    
209     \item[forcing] \
210    
211     This section only applies to the ocean. You need to generate
212     wind-stress data into two files \textbf{zonalWindFile} and
213     \textbf{meridWindFile} corresponding to the zonal and meridional
214     components of the wind stress, respectively (if you want the stress
215     to be along the direction of only one of the model horizontal axes,
216     you only need to generate one file). The format of the files is
217     similar to the bathymetry file. The zonal (meridional) stress data
218     are assumed to be in Pa and located at U-points (V-points). As for
219     the bathymetry, the precision with which to read the binary data is
220     controlled by the variable \textbf{readBinaryPrec}. See the matlab
221     program \textit{gendata.m} in the \textit{input} directories under
222     \textit{verification} to see how simple analytical wind forcing data
223     are generated for the case study experiments.
224    
225     There is also the possibility of prescribing time-dependent periodic
226     forcing. To do this, concatenate the successive time records into a
227     single file (for each stress component) ordered in a (x,y,t) fashion
228     and set the following variables: \textbf{periodicExternalForcing }to
229     \texttt{'.TRUE.'}, \textbf{externForcingPeriod }to the period (in s)
230     of which the forcing varies (typically 1 month), and
231     \textbf{externForcingCycle} to the repeat time (in s) of the forcing
232     (typically 1 year -- note: \textbf{ externForcingCycle} must be a
233     multiple of \textbf{externForcingPeriod}). With these variables set
234     up, the model will interpolate the forcing linearly at each
235     iteration.
236    
237     \item[dissipation] \
238    
239     The lateral eddy viscosity coefficient is specified through the
240     variable \textbf{viscAh} (in m$^{2}$s$^{-1}$). The vertical eddy
241     viscosity coefficient is specified through the variable
242     \textbf{viscAz} (in m$^{2}$s$^{-1}$) for the ocean and
243     \textbf{viscAp} (in Pa$^{2}$s$^{-1}$) for the atmosphere. The
244     vertical diffusive fluxes can be computed implicitly by setting the
245     logical variable \textbf{implicitViscosity }to \texttt{'.TRUE.'}.
246     In addition, biharmonic mixing can be added as well through the
247     variable \textbf{viscA4} (in m$^{4}$s$^{-1}$). On a spherical polar
248     grid, you might also need to set the variable \textbf{cosPower}
249     which is set to 0 by default and which represents the power of
250     cosine of latitude to multiply viscosity. Slip or no-slip conditions
251     at lateral and bottom boundaries are specified through the logical
252     variables \textbf{no\_slip\_sides} and \textbf{no\_slip\_bottom}. If
253     set to \texttt{'.FALSE.'}, free-slip boundary conditions are
254     applied. If no-slip boundary conditions are applied at the bottom, a
255     bottom drag can be applied as well. Two forms are available: linear
256 jmc 1.5 (set the variable \textbf{bottomDragLinear} in m/s) and
257     quadratic (set the variable \textbf{bottomDragQuadratic}, dimensionless).
258 cnh 1.1
259     The Fourier and Shapiro filters are described elsewhere.
260    
261     \item[C-D scheme] \
262    
263     If you run at a sufficiently coarse resolution, you will need the
264     C-D scheme for the computation of the Coriolis terms. The
265     variable\textbf{\ tauCD}, which represents the C-D scheme coupling
266     timescale (in s) needs to be set.
267    
268     \item[calculation of pressure/geopotential] \
269    
270     First, to run a non-hydrostatic ocean simulation, set the logical
271     variable \textbf{nonHydrostatic} to \texttt{'.TRUE.'}. The pressure
272     field is then inverted through a 3D elliptic equation. (Note: this
273     capability is not available for the atmosphere yet.) By default, a
274     hydrostatic simulation is assumed and a 2D elliptic equation is used
275     to invert the pressure field. The parameters controlling the
276     behaviour of the elliptic solvers are the variables
277     \textbf{cg2dMaxIters} and \textbf{cg2dTargetResidual } for
278     the 2D case and \textbf{cg3dMaxIters} and
279     \textbf{cg3dTargetResidual} for the 3D case. You probably won't need to
280     alter the default values (are we sure of this?).
281    
282     For the calculation of the surface pressure (for the ocean) or
283     surface geopotential (for the atmosphere) you need to set the
284     logical variables \textbf{rigidLid} and \textbf{implicitFreeSurface}
285     (set one to \texttt{'.TRUE.'} and the other to \texttt{'.FALSE.'}
286     depending on how you want to deal with the ocean upper or atmosphere
287     lower boundary).
288    
289     \end{description}
290    
291 molod 1.6 \subsection{Parameters: Tracer equations}
292 cnh 1.1
293     This section covers the tracer equations i.e. the potential
294     temperature equation and the salinity (for the ocean) or specific
295     humidity (for the atmosphere) equation. As for the momentum equations,
296     we only describe for now the parameters that you are likely to change.
297     The logical variables \textbf{tempDiffusion} \textbf{tempAdvection}
298     \textbf{tempForcing}, and \textbf{tempStepping} allow you to turn
299     on/off terms in the temperature equation (same thing for salinity or
300     specific humidity with variables \textbf{saltDiffusion},
301     \textbf{saltAdvection} etc.). These variables are all assumed here to
302     be set to \texttt{'.TRUE.'}. Look at file \textit{model/inc/PARAMS.h}
303     for a precise definition.
304    
305     \begin{description}
306     \item[initialization] \
307    
308     The initial tracer data can be contained in the binary files
309     \textbf{hydrogThetaFile} and \textbf{hydrogSaltFile}. These files
310     should contain 3D data ordered in an (x,y,r) fashion with k=1 as the
311     first vertical level. If no file names are provided, the tracers
312     are then initialized with the values of \textbf{tRef} and
313     \textbf{sRef} mentioned above (in the equation of state section). In
314     this case, the initial tracer data are uniform in x and y for each
315     depth level.
316    
317     \item[forcing] \
318    
319     This part is more relevant for the ocean, the procedure for the
320     atmosphere not being completely stabilized at the moment.
321    
322     A combination of fluxes data and relaxation terms can be used for
323     driving the tracer equations. For potential temperature, heat flux
324     data (in W/m$ ^{2}$) can be stored in the 2D binary file
325     \textbf{surfQfile}. Alternatively or in addition, the forcing can
326     be specified through a relaxation term. The SST data to which the
327     model surface temperatures are restored to are supposed to be stored
328     in the 2D binary file \textbf{thetaClimFile}. The corresponding
329     relaxation time scale coefficient is set through the variable
330     \textbf{tauThetaClimRelax} (in s). The same procedure applies for
331     salinity with the variable names \textbf{EmPmRfile},
332     \textbf{saltClimFile}, and \textbf{tauSaltClimRelax} for freshwater
333     flux (in m/s) and surface salinity (in ppt) data files and
334     relaxation time scale coefficient (in s), respectively. Also for
335     salinity, if the CPP key \textbf{USE\_NATURAL\_BCS} is turned on,
336     natural boundary conditions are applied i.e. when computing the
337     surface salinity tendency, the freshwater flux is multiplied by the
338     model surface salinity instead of a constant salinity value.
339    
340     As for the other input files, the precision with which to read the
341     data is controlled by the variable \textbf{readBinaryPrec}.
342     Time-dependent, periodic forcing can be applied as well following
343     the same procedure used for the wind forcing data (see above).
344    
345     \item[dissipation] \
346    
347     Lateral eddy diffusivities for temperature and salinity/specific
348     humidity are specified through the variables \textbf{diffKhT} and
349     \textbf{diffKhS} (in m$^{2}$/s). Vertical eddy diffusivities are
350     specified through the variables \textbf{diffKzT} and
351     \textbf{diffKzS} (in m$^{2}$/s) for the ocean and \textbf{diffKpT
352     }and \textbf{diffKpS} (in Pa$^{2}$/s) for the atmosphere. The
353     vertical diffusive fluxes can be computed implicitly by setting the
354     logical variable \textbf{implicitDiffusion} to \texttt{'.TRUE.'}.
355     In addition, biharmonic diffusivities can be specified as well
356     through the coefficients \textbf{diffK4T} and \textbf{diffK4S} (in
357     m$^{4}$/s). Note that the cosine power scaling (specified through
358     \textbf{cosPower}---see the momentum equations section) is applied to
359     the tracer diffusivities (Laplacian and biharmonic) as well. The
360     Gent and McWilliams parameterization for oceanic tracers is
361     described in the package section. Finally, note that tracers can be
362     also subject to Fourier and Shapiro filtering (see the corresponding
363     section on these filters).
364    
365     \item[ocean convection] \
366    
367     Two options are available to parameterize ocean convection: one is
368     to use the convective adjustment scheme. In this case, you need to
369     set the variable \textbf{cadjFreq}, which represents the frequency
370     (in s) with which the adjustment algorithm is called, to a non-zero
371     value (if set to a negative value by the user, the model will set it
372     to the tracer time step). The other option is to parameterize
373     convection with implicit vertical diffusion. To do this, set the
374     logical variable \textbf{implicitDiffusion} to \texttt{'.TRUE.'}
375     and the real variable \textbf{ivdc\_kappa} to a value (in m$^{2}$/s)
376     you wish the tracer vertical diffusivities to have when mixing
377     tracers vertically due to static instabilities. Note that
378     \textbf{cadjFreq} and \textbf{ivdc\_kappa}can not both have non-zero
379     value.
380    
381     \end{description}
382    
383 molod 1.6 \subsection{Parameters: Simulation controls}
384 cnh 1.1
385     The model ''clock'' is defined by the variable \textbf{deltaTClock}
386     (in s) which determines the IO frequencies and is used in tagging
387     output. Typically, you will set it to the tracer time step for
388     accelerated runs (otherwise it is simply set to the default time step
389     \textbf{deltaT}). Frequency of checkpointing and dumping of the model
390     state are referenced to this clock (see below).
391    
392     \begin{description}
393     \item[run duration] \
394    
395     The beginning of a simulation is set by specifying a start time (in
396     s) through the real variable \textbf{startTime} or by specifying an
397     initial iteration number through the integer variable
398     \textbf{nIter0}. If these variables are set to nonzero values, the
399     model will look for a ''pickup'' file \textit{pickup.0000nIter0} to
400     restart the integration. The end of a simulation is set through the
401     real variable \textbf{endTime} (in s). Alternatively, you can
402     specify instead the number of time steps to execute through the
403     integer variable \textbf{nTimeSteps}.
404    
405     \item[frequency of output] \
406    
407     Real variables defining frequencies (in s) with which output files
408     are written on disk need to be set up. \textbf{dumpFreq} controls
409     the frequency with which the instantaneous state of the model is
410     saved. \textbf{chkPtFreq} and \textbf{pchkPtFreq} control the output
411     frequency of rolling and permanent checkpoint files, respectively.
412     See section 1.5.1 Output files for the definition of model state and
413     checkpoint files. In addition, time-averaged fields can be written
414     out by setting the variable \textbf{taveFreq} (in s). The precision
415     with which to write the binary data is controlled by the integer
416     variable w\textbf{riteBinaryPrec} (set it to \texttt{32} or
417     \texttt{64}).
418    
419     \end{description}
420    
421    
422     %%% Local Variables:
423     %%% mode: latex
424     %%% TeX-master: t
425     %%% End:

  ViewVC Help
Powered by ViewVC 1.1.22