source: trunk/LMDZ.GENERIC/DOC/run.tex

Last change on this file was 1424, checked in by milmd, 10 years ago

Update user manuel to compile and run LMDZ.COMMON model in parallel.

File size: 25.4 KB
Line 
1
2\chapter{Running the model: a practice simulation}
3
4\label{loc:contact1}
5
6This chapter is meant for first-time users of the LMD model.
7As the best introduction to the model is surely to run a simulation,
8here we explain how to go about it.
9All you will need are files necessary to build the GCM (all are in
10the {\tt LMDZ.GENERIC} directory) as well as some initial states
11to initiate simulations (see below).\\
12Once you have followed the example given below,
13you can then go on to change the control parameters and the initial states
14as you wish. A more detailed description of the model's organization
15as well as associated inputs and
16outputs are given in sections~\ref{sc:info} and~\ref{sc:io}.
17
18\section{Installing the model from SVN}
19
20The first thing is to download the model from our SVN server. If you cannot use SVN, just find an old school way to get a copy of the basic model directory \verb"LMDZ.GENERIC" (and all the other source files needed for visualization) and download it to your account. Then start directly from the fifth point.
21
22\begin{description}
23\item[$\bullet$] Go to the directory where you want to download the model. Not that only one directory (the root directory) will be added in the current directory.
24
25\item[$\bullet$] If svn is installed on your system, set up the root directory by tipping
26\begin{verbatim}
27svn co "http://svn.lmd.jussieu.fr/Planeto/trunk" -N Name_of_root_directory
28cd Name_of_root_directory
29\end{verbatim}
30
31\item[$\bullet$] You can now download one of the LMDZ models (for Generic, Mars, Venus, Titan, ...) by tipping
32\begin{verbatim}
33svn update LMDZ.MODEL_YOU_WANT
34\end{verbatim}
35For the Generic model, just tipe
36\begin{verbatim}
37svn update LMDZ.GENERIC
38\end{verbatim}
39The contents of the directory that has been created are described in Chapter \ref{loc:contenu}.
40
41\item[$\bullet$] For visualization of the simulations, yo will need some utilities that we might as well download now by doing
42\begin{verbatim}
43svn update UTIL
44\end{verbatim}
45
46\item[$\bullet$] Now we must set up the {\tt makegcm} script that will perform the compilation of the model. Go into the {\tt LMDZ.GENERIC} directory and edit the appropriate \verb"makegcm_mycompiler" (hereafter called \verb"makegcm"), where \verb"mycompiler" is the compiler that you want to use.
47There are two important environment variables concerning source files that are initialized by \verb"makegcm" and that we need to set properly:
48\begin{enumerate}
49\item \verb"LMDGCM", the path to the source files. By default, the line
50\begin{verbatim}
51setenv LMDGCM `readlink -f $scriptdir`
52\end{verbatim}
53allows \verb"makegcm" to assume that it is executed in the root source directory so that this should work without any change. If \verb"makegcm" does not find the source, you can enter manually the path by changing the above line by
54 \begin{verbatim}
55setenv LMDGCM "path/to/source/directory/LMDZ.GENERIC"
56\end{verbatim}
57\item \verb"LIBOGCM", the path to the compilation directory where all object files will be kept. By default, the line
58\begin{verbatim}
59setenv LIBOGCM $LMDGCM/libo
60\end{verbatim}
61specifies that source will be kept in a \verb"libo" directory created in \verb"LMDZ.GENERIC". You can also change that if needed.
62\end{enumerate} 
63
64\item[$\bullet$]Install NetCDF
65%\item {\bf -} \htmladdnormallink{Install NetCDF}
66{http://www.unidata.ucar.edu/packages/netcdf/INSTALL.html}
67and set environment variables  \verb"NCDFINC" and \verb"NCDFLIB":
68
69  \begin{description}
70  \item The latest version of the NetCDF package is available on the web at the following address: {http://www.unidata.ucar.edu/software/netcdf}
71  along with instructions for building (or downloading precompiled
72  binaries of) the library.
73  \item Once the NetCDF library has been compiled (or downloaded),
74  you should have access to the library {\tt libnetcdf.a} itself,
75  the various files ({\tt netcdf.inc}, {\tt netcdf.mod}, ...)
76  to include in programs, and basic NetCDF software ({\it ncdump}
77  and {\it ncgen}).
78
79  \item To ensure that during compilation, the model can find the
80  NetCDF library and include files,
81  you must declare environment variables \verb"NCDFLIB" and \verb"NCDFINC".
82
83  \item \verb"NCDFLIB" must contain the path to the directory containing
84   the object library {\tt libnetcdf.a}
85   and \verb"NCDFINC" must contain the path to the directory containing
86   the include files ({\tt netcdf.inc},...)\\
87As for \verb"LMDGCM" variable, these variables can be declared by changing the right line in \verb"makegcm"
88  \begin{verbatim}
89  setenv NCDFINC /wherever/is/netcdf/include
90  setenv NCDFLIB /wherever/is/netcdf/lib
91  \end{verbatim}
92For example, if working at LMD and with \verb"ifort", the path is 
93   \begin{verbatim}
94  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_ifort/include
95  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_ifort/lib
96  \end{verbatim}
97  \end{description}
98 
99\item[$\bullet$] Install software for loading and displaying NetCDF files
100   such as GrAdS (http://grads.iges.org/grads/), Ferret (http://ferret.wrc.noaa.gov/Ferret), or Python. Some visualization scripts, especially for Python, can be found in the
101\verb"UTIL" directory and will be described later.
102
103
104\item[$\bullet$] Finally, make sure that you have access to all the executables
105needed for building and using the model and
106remember to set environment variables to the correct corresponding pathes
107(note that if you do not want to have to redefine these every session,
108you should put the definitions in the corresponding {\tt .cshrc} or
109{\tt .bashrc} files).
110
111  \begin{description}
112  \item {\bf -} UNIX function {\it make}
113  \item {\bf -} a Fortran compiler
114  \item {\bf -} ncdump
115  \item {\bf -} grads (or ferret)
116  \end{description}
117
118\end{description}
119
120
121\section{Installing the model without SVN}
122
123 Create an alias so that the compilation script {\bf makegcm}
124  is available from anywhere (more convinient than having to type the full
125  path to the script, or copying it over where you want to run it).
126  The {\tt makegcm} script is in the LMDZ.GENERIC directory, which
127  is referenced by the {\bf LMDGCM} variable, so:\\
128  If using Csh:
129  \begin{verbatim}
130  alias makegcm $LMDGCM'/makegcm'
131  \end{verbatim}
132  if using Bash:
133  \begin{verbatim}
134  alias makegcm=$LMDGCM/makegcm
135  \end{verbatim}
136
137\section{Compiling the LMDZ.GENERIC model (sequential only)}
138\label{sc:run1}
139
140Two options exist to compile the model.
141\begin{enumerate}
142\item Create an alias so that the compilation script \verb"makegcm"
143  is available from anywhere.
144  If using Csh:
145  \begin{verbatim}
146  alias makegcm 'path/to/LMDZ.GENERIC/makegcm'
147  \end{verbatim}
148  if using Bash:
149  \begin{verbatim}
150  alias makegcm=path/to/LMDZ.GENERIC/makegcm
151  \end{verbatim}
152Then the compilation is done by tipping
153  \begin{verbatim}
154makegcm -options gcm
155  \end{verbatim}
156This solution can be convenient but is less flexible if you want to compile the model in many different configurations and keep track of it.
157
158\item Create and edit an executable script (that we will call \verb"compile") in the directory where you will want to run the model. Put the line
159  \begin{verbatim}
160/path/to/the/model/I/use/makegcm -options gcm
161  \end{verbatim}
162The advantage of this option is that the \verb"compile" is present in all of the working directories where the model is ran, allowing you to keep track of the options used.
163\end{enumerate}
164
165Just remains to choose the options. The basic options are as follows
166\begin{verbatim}
167makegcm -d LONxLATxALT -p std -t XX -s YY -b IRxVI gcm
168\end{verbatim}
169where \verb"LONxLATxALT" are the number of grid cells in longitude, latitude and altitude, \verb"XX" is the number of tracers, \verb"YY" is the number of scatterers that will be taken into account in the radiative code and \verb"IRxVI" is the number of spectral bands in the thermal emission and stellar part of the radiative code. The option \verb"-debug" is available with most compilers. The code runs much more slowly but can output more user friendly bug report messages.
170
171{\bf -} Example 1: Compiling the generic model at grid resolution 64x48x20
172for example, type (in compliance with the manual for the makegcm function
173given in section~\ref{sc:compil1})
174
175\begin{verbatim}
176makegcm -d 64x48x20 -p std gcm
177\end{verbatim}
178
179\noindent
180You can find executable {\bf gcm.e} (the compiled model) in the directory
181where you ran the makegcm command.
182
183{\bf -} Example 2: Compiling the generic model with 2 tracers
184(e.g. water vapour and ice to simulate the water cycle):
185\begin{verbatim}
186makegcm -d 32x32x20 -t 2 -p std gcm
187\end{verbatim}
188
189{\bf -} Example 3:
190Compiling the the generic model to check for and trace errors (with ifort compiler -
191useful for debugging - warning, the model then runs very slowly!):
192\begin{verbatim}
193makegcm -d 32x32x20 -p std -O "-g -fpe0 -traceback" gcm
194\end{verbatim}
195%**********
196\section{Compiling the LMDZ.COMMON model (sequential or parallel)}
197\label{sc:run1_common}
198\begin{enumerate}
199\item Prerequisites:
200\begin{itemize}
201\item[$\bullet$] Downloaded LMDZ.COMMON and LMDZ.OTHER\_MODEL containing the physic you want.
202\item[$\bullet$] Available MPI library and wrapped compiler (mpif90, mpiifort,...)
203\item[$\bullet$] Optional (but recommended) fcm:
204\begin{itemize}
205\item LMD: /distrib/local/fcm/bin
206\item Ciclad: /home/millour/FCM\_V1.2/bin
207\item Gnome: /san/home/millour/FCM\_V1.2/bin
208\item Other: fcm is just a collection of perl scripts; can be copied over on any other machine, or simply downloaded using svn:\\
209svn checkout http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM\_V1.2
210\end{itemize}
211\end{itemize}
212\item Then choose the physic you want to couple with the LMDZ.COMMON dynamic core by creating a symbolic link in the LMDZ.COMMON/libf directory.\\
213If you want to use mars physic:
214\begin{verbatim}
215cd LMDZ.COMMON/libf
216ln -s path/to/LMDZ.MARS/libf/phymars .
217ln -s path/to/LMDZ.MARS/libf/aeronomars .
218\end{verbatim}
219Here, we want the LMDZ.GENERIC physic phystd:
220\begin{verbatim}
221cd LMDZ.COMMON/libf
222ln -s path/to/LMDZ.GENERIC/libf/phystd .
223\end{verbatim}
224\item  To compile in LMDZ.COMMON directory:
225\begin{verbatim}
226./makelmdz_fcm -s XX -t XX -d LONxLATxALT -b IRxVI -p physicSuffix
227-arch archFile [-parallel mpi/mpi_omp] gcm
228\end{verbatim}
229\begin{itemize}
230\item[$\bullet$] \textbf{physicSuffix} is \verb|mars| for phymars, \verb|std| for phystd...
231\item[$\bullet$] \textbf{archFile} is the name of configuration files from LMDZ.COMMON/arch: use \verb|CICLADifort| the ifort compiler in a CICLAD environment, \verb|X64_ADA| for the ADA architecture...
232\item[$\bullet$] To compile in parallel with mpi, add \verb|-parallel mpi| option. By default it is serial code.
233\item[$\bullet$] For hybrid MPI-OpenMP parallelisation, add \verb|-parallel mpi_omp| option.
234\item[$\bullet$] For faster compilation, the option \verb|-j N| uses N simultaneous tasks.
235\item[$\bullet$] \verb|-full| option forces full (re)-compilation from scratch.
236\item[$\bullet$] Created program is in LMDZ.COMMON/bin directory, with dimensions included in the program name. e.g.: gcm\_64x48x29\_phymars\_para.e
237\end{itemize}
238\end{enumerate}
239NB: It is possible to compile without fcm by replacing \verb|makelmdz_fcm| by \verb|makelmdz|. Created program is in LMDZ.COMMON directory and named gcm.e.
240%**********
241\section{Input files (initial states and def files)}
242{\bf -} In directory \verb+LMDZ.GENERIC/deftank+
243you will find some examples of run
244parameter files ({\tt .def} files) which the model needs at runtime.
245The four files the model requires (they must be in the same directory as the
246executable {\tt gcm.e}) are:
247{\bf run.def} (described in
248section~\ref{loc:entrees}) {\bf callphys.def}
249(see section~\ref{sc:callphys.def}),
250{\bf gases.def}, {\bf z2sig.def} and {\bf traceur.def}.\\
251
252The example {\tt .def} files given in the {\tt deftank} directory
253are for various configurations (e.g. model resolution, planet type), copy (and eventually
254rename these files to match the generic names) to the directory where
255you will run the model.\\
256
257\noindent
258{\bf -} Copy initial condition files
259{\bf start.nc} and {startfi.nc}  (described in section
260\ref{loc:entrees}) to the same directory.\\
261You can extract such files from {\bf start\_archive}
262`banks of initial states' (i.e. files which
263contain collections of initial states from
264stndard scenarios and which can thus be used
265to check if the model is installed correctly) stored on the LMD website at\\
266\verb+http://www.lmd.jussieu.fr/~forget/datagcm/Starts+.
267See section~\ref{sc:newstart} for a description of how to proceed to
268extract {\bf start} files from {\bf start\_archives}.\\
269
270[NOTE: WITH THE GENERIC MODEL WE ALMOST ALWAYS START FROM ``startplanet'' FILES]
271%**********
272\section{Running the model}
273\begin{figure}
274\centerline{\framebox[1.4\textwidth][c]{\includegraphics[width=1.2\textwidth]{Fig/inout.eps}}}
275\caption{Input/output data}
276\label{fig:inout}
277\end{figure}
278
279IMPORTANT: The following line MUST be in file run.def (or callphys.def):
280\begin{verbatim}
281planet_type = mars
282\end{verbatim}
283for using LMDZ.MARS model or
284\begin{verbatim}
285planet_type = generic
286\end{verbatim}
287for using LMDZ.GENERIC model.
288
289\begin{itemize}
290\item[$\bullet$] To run the serial {\bf gcm.e} interactively:\\
291Once you have the program {\bf gcm.e},
292input files {\bf start.nc} {\bf startfi.nc},
293and parameter files {\bf run.def, callphys.def, gases.def, traceur.def, and z2sig.def}
294in the same directory, simply execute the program to run a simulation:
295\begin{verbatim}
296gcm.e
297\end{verbatim}
298
299You might need more memory. Use \verb|ulimit -s unlimited| to change user limits.\\
300You might also want to keep all messages and diagnostics written to standard
301output (i.e. the screen). You should then redirect the standard output
302(and error) to some file, e.g. {\tt gcm.out}:\\
303If using Csh:
304\begin{verbatim}
305gcm.e >! gcm.out
306\end{verbatim}
307If using Bash:
308\begin{verbatim}
309gcm.e > gcm.out 2>&1
310\end{verbatim}
311
312
313\item [$\bullet$] To run the MPI-parallel {\bf gcm.e} interactively:
314\begin{verbatim}
315mpirun -np N gcm.e > gcm.out 2>&1
316\end{verbatim}
317\verb|-np N| specifies the number of procs to run on.\\
318IMPORTANT: one MUST use the \verb|mpirun| command corresponding to the \verb|mpif90| compiler specified in the \verb|arch| file.\\
319Output files (restart.nc, diagfi.nc ,etc.) are just as when running in serial. But standard output messages are written by each process.\\
320If using chained simulations (run\_mcd/run0 scripts), then the command line to run the gcm in \verb|run0| must be adapted for local settings.\\
321NB: LMDZ.COMMON dynamics set to run in double precision, so keep \verb|NC_DOUBLE| declaration (and real to double precision promotion) in the arch files.
322\item [$\bullet$] To run the hybrid parallel {\bf gcm.e} interactively:
323\begin{verbatim}
324export OMP_NUM_THREADS=2
325export OMP_STACKSIZE=2500MB
326mpirun -np 2 gcm.e > gcm.out 2>&1
327\end{verbatim}
328In this exemple, each of the 2 process MPI have 2 OpenMP tasks with a 2500MB memory.
329\item[$\bullet$] To run the MPI-parallel {\bf gcm.e} with a job scheduler (different on each machine):
330\begin{verbatim}
331PBS example (on Ciclad):
332#PBS -S  /bin/bash
333#PBS -N  job_mpi08
334#PBS -q short
335#PBS -j eo
336#PBS -l "nodes=1:ppn=8"
337# go to directory where the job was launched
338cd $PBS_O_WORKDIR
339mpirun gcm_64x48x29_phymars_para.e > gcm.out 2>&1
340\end{verbatim}
341\begin{verbatim}
342LoadLeveler example (on Gnome):
343# @ job_name = job_mip8
344# standard output file 
345# @ output = job_mpi8.out.$(jobid)
346# standard error file
347# @ error =  job_mpi8.err.$(jobid)
348# job type
349# @ job_type = mpich
350# @ blocking = unlimited
351# time
352# @ class = AP
353# Number of procs
354# @ total_tasks = 8
355# @ resources=ConsumableCpus(1) ConsumableMemory(2500 mb)
356# @ queue
357set -vx
358mpirun gcm_32x24x11_phymars_para.e > gcm.out 2>&1
359\end{verbatim}
360\begin{verbatim}
361LoadLeveler example (on Ada):
362module load intel/2012.0
363# @ output  =  output.$(jobid)
364# @ error = $(output)
365# @ job_type = parallel
366## Number of MPI process
367# @ total_tasks = 8
368## Memory used by each MPI process
369# @ as_limit = 2500mb
370# @ wall_clock_limit=01:00:00
371# @ core_limit = 0
372# @ queue
373set -x
374poe ./gcm.e -labelio yes > LOG 2>&1
375\end{verbatim}
376\item[$\bullet$] To run the hybrid MPI/OpenMP-parallel {\bf gcm.e} with a job scheduler (different on each machine):
377\begin{verbatim}
378LoadLeveler example (on Gnome):
379# @ job_name = job_mip8
380# standard output file 
381# @ output = job_mpi8.out.$(jobid)
382# standard error file
383# @ error =  job_mpi8.err.$(jobid)
384# job type
385# @ job_type = mpich
386# @ blocking = unlimited
387# time
388# @ class = AP
389# Number of procs
390# @ total_tasks = 8
391# @ resources=ConsumableCpus(1) ConsumableMemory(5000 mb)
392# @ queue
393set -vx
394export OMP_NUM_THREADS=2 #sinon par defaut, lance 8 threads OpenMP
395export OMP_STACKSIZE=2500MB
396mpirun gcm_32x24x11_phymars_para.e > gcm.out 2>&1
397\end{verbatim}
398IMPORTANT: ConsumableMemory must be equal to OMP\_NUM\_THREADSxOMP\_STACKSIZE.\\
399In this case, we are using 8x2 cores.
400\begin{verbatim}
401LoadLeveler example (on Ada):
402module load intel/2012.0
403# @ output  =  output.$(jobid)
404# @ error = $(output)
405# @ job_type = parallel
406## Number of MPI process
407# @ total_tasks = 8
408## Number of OpenMP tasks attached to each MPI process
409# @ parallel_threads = 2
410## Memory used by each MPI process
411# @ as_limit = 5gb
412# @ wall_clock_limit=01:00:00
413# @ core_limit = 0
414# @ queue
415set -x
416export OMP_STACKSIZE=2500MB
417poe ./gcm.e -labelio yes > LOG 2>&1
418\end{verbatim}
419IMPORTANT: In this case, each core needs 2.5gb and we are using 2 OpenMP tasks for each MPI process so $\verb|as_limit|=2 \times 2.5$.
420\end{itemize}
421%**********
422\section{Visualizing the output files}
423
424As the model runs it generates output files {\bf diagfi.nc} and
425{\bf stats.nc} files. The former contains instantaneous values of
426various fields and the later statistics (over the whole run) of some
427variables.
428
429\subsection{Using GrAds to visualize outputs}
430If you have never used the graphic software {\bf GrAds}, we strongly
431recommend spending half an hour to familiarize yourself with it by following
432the demonstration provided for that purpose.
433The demo is fast and easy to follow and you will learn the basic commands.
434To do this read file
435\begin{verbatim}
436/distrib/local/grads/sample
437\end{verbatim}
438
439For example, to visualize files {\tt diagfi.nc} and {\tt stats.nc}
440
441NetCDF files {\tt diagfi.nc} and {\tt stats.nc} can be accessed directly
442using GrAdS thanks to utility program gradsnc,
443(the user does not need to intervene).\\
444
445\noindent
446To visualize the temperature in the 5th layer using file
447{\tt diagfi.nc} for example:
448\label{loc:visu}
449
450\begin{description}
451\item {\bf -} GrAdS session:
452
453  \begin{description}
454  \item \verb+grads+ {\it return}
455
456  \item {\it return} (opens a landscape window)
457
458  \item \verb+ga-> sdfopen diagfi.nc+
459
460  \item \verb+ga-> query file+ (displays info about the open file, including the name of the stored variables. Shortcut: {\it q file})
461
462  \item \verb+ga-> set z 5+ (fixes the altitude to the 5th layer)
463
464  \item \verb+ga-> set t 1+ (fixes the time to the first stored value)
465
466  \item \verb+ga-> query dims+ (indicates the fixed values for the 4
467  dimensions. Shortcut: {\it q dims})
468
469  \item \verb+ga-> display temp+ (displays the temperature card for the 5th layer and for the first time value stored. Shortcut: {\it d
470  T})
471
472  \item \verb+ga-> clear+ (clears the display. Shortcut: {\it c})
473
474  \item \verb+ga-> set gxout shaded+ (not a contour plot, but a shaded one)
475
476  \item \verb+ga-> display temp+
477
478  \item \verb+ga-> set gxout contour+ (returns to contour mode to display the levels)
479
480  \item \verb+ga-> display temp+ (superimposes the contours if the clear command is not used)
481
482  \end{description}
483\end{description}
484
485
486
487%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488
489\section{Resuming a simulation}
490At the end of a simulation, the model generates {\bf restart} files
491(files {\tt restart.nc} and {\tt restartfi.nc})
492which contain the final state of the model.
493As shown in figure~\ref{fig:inout},
494these files (which are of the same format as the start files)
495can later be used as initial
496states for a new simulation.\\
497
498\noindent
499The {\bf restart} files just need to be renamed:
500\begin{verbatim}
501mv restart.nc start.nc
502mv restartfi.nc startfi.nc
503\end{verbatim}
504\noindent
505and running a simulation with these will in fact resume the simulation
506from where the previous run ended.
507
508\section{Chain simulations}
509
510In practice, we recommend running a chain of simulations lasting several
511days or longer (or hundreds of days at low resolution).
512
513To do this, a script named {\tt run0} is available in
514\verb+LMDZ.GENERIC/deftank+ , which should be used as follows:
515\begin{itemize}
516\item Set the length of each simulation in {\tt run.def}
517 (i.e. set the value of {\tt nday})
518\item Set the maximum number of simulations at the beginning of the {\tt run0}
519script (i.e. set the value of {\tt nummax})
520\item Copy start files {\tt start.nc  startfi.nc} over and rename them
521      {\tt start0.nc startfi0.nc}.
522\item Run script {\tt run0}
523\end{itemize}
524
525{\tt run0} runs a series of simulations that generate the indexed output
526files (e.g. {\tt start1, startfi1, diagfi1}, etc.)
527including files {\tt lrun1, lrun2}, etc. containing the redirection of the
528display and the information about the run.
529
530{\it NOTE:} to restart a series of simulations after a first series
531(for example, starting from {\tt start5 and  startfi5}), just write the
532index of the initial files (e.g. 5) in the file named {\tt num\_run}.
533If {\tt num\_run} exists, the model will start from the index written in
534{\tt num\_run}. If not it will start from, {\tt start0 and startfi0}.
535
536
537{\it NOTE}: A script is available for performing annual runs with 12 seasons
538at 30$^o$ solar longitude
539as it is in the database (script {\bf \tt run\_mcd}, also found in directory
540{\tt deftank}).
541This script functions with script run0. Just set the number of simulations to
5421 in run0. Then copy run.def into run.def.ref and set nday to 9999 in this
543file. To start from startN.c, edit the file run\_mcd and comment
544(with a \#) the N months already created and describe N in {\tt num\_run}.
545Then run  {\bf \tt run\_mcd}.
546
547
548\section{Creating and modifying initial states}
549
550\label{sc:newstart}
551
552\subsection{Using program ``newstart''}
553
554When working with the generic model, it is common to start with simple initial conditions (e.g., isothermal, motionless atmosphere). For this we create an initial state using {\bf newstart}. In practice, we usually take an old initial state, and simply modify it.
555
556Like the GCM, the program {\bf newstart} must be compiled (using the {\tt makegcm} script) to the required grid resolution.
557For example:
558\begin{verbatim}
559makegcm -d 32x32x20 -p std newstart
560\end{verbatim}
561
562Then run
563
564\begin{verbatim}
565newstart.e
566\end{verbatim}
567
568The program then gives you two options:
569
570\begin{verbatim}
571 From which kind of files do you want to create newstart and startfi files
572     0 - from a file start_archive
573     1 - from files start and startfi
574\end{verbatim}
575
576\begin{itemize}
577\item{-} Option ``1'' allows you to read and modify the information needed
578to create a new initial state  from the files
579\verb+ start.nc, startfi.nc +
580\item{-} Option ``0'' allows you to read and modify the information needed to
581create a new initial state from file
582\verb+ start_archive.nc + (whatever the \verb+ start_archive.nc +
583grid resolution is).\\
584\end{itemize}
585If you use tracers, make sure that they are taken into account in your
586start files (either start or start\_archive).\\ \\
587Then answer to the various questions in the scroll menu.
588These questions allow you to modify the initial state for the following
589parameters.\\
590
591
592\input{input/questions_inistate.tex}
593
594Program {\bf newstart.e} creates files
595{\tt restart.nc} and {\tt restartfi.nc}
596that you generally need to rename (for instance rename them in start0.nc
597and startfi0.nc if you want to use run0 or run\_mcd, starting with season 0;
598rename them {\tt start.nc} and {\tt startfi.nc} if you just want to perform
599one run with {\tt gcm.e}).
600
601
602\subsection{Creating the initial start\_archive.nc file }
603
604Archive file
605{\tt start\_archive.nc} is created from files
606{\tt start.nc} and {\tt startfi.nc} by program {\bf start2archive}.
607Program {\bf start2archive} compiles to the same grid resolution as the
608{\tt start.nc} and {\tt startfi.nc} grid resolution. For example:
609
610\begin{verbatim}
611makegcm -d 32x32x20 -p std start2archive
612\end{verbatim}
613Then run \verb+ start2archive.e+ \\ \\
614You now have a \verb+ start_archive.nc+ file for one season that you can
615use with newstart.
616If you want to gather other states obtained at other times of year, rerun
617{\tt start2archive.e} with the {\tt start.nc} and {\tt startfi.nc}
618 corresponding to these.
619These additional initial states will automatically be added to the
620{\tt start\_archive.nc} file present in the directory.
621
622\subsection{Changing the horizontal or vertical grid resolution}
623
624To run at a different grid resolution than available initial conditions
625files, one needs to use tools {\bf newstart} and {\bf start2archive}
626
627For example, to create initial states at grid resolution
62832$\times$24$\times$25 from NetCDF files
629\verb+ start + and \verb+ startfi + at grid resolution
630  64$\times$48$\times$32 :
631
632\begin{itemize}
633\item Create file \verb+ start_archive.nc +
634with {\bf start2archive.e} compiled at grid resolution
63564$\times$48$\times$32 using {\bf old file {\tt z2sig.def}
636 used previously}
637
638\item Create files
639{\tt newstart.nc} and {\tt newstartfi.nc}
640 with {\bf newstart.e}
641compiled at grid resolution 32$\times$24$\times$25,
642using {\bf new file {\tt z2sig.def}}
643
644\end{itemize}
645
646[NOT RELEVANT??]
647If you want to create starts files with tracers for 50 layers using a
648{\tt start\_archive.nc} obtained for 32 layers, do not forget to use the
649\verb+ ini_q+ option in newstart in order to correctly initialize tracers
650value for layer 33 to layer 50.
651You just have to answer yes to the question on thermosphere initialization
652if you want to initialize the thermosphere part only (l=33 to l=50),
653and no if you want to initialize tracers for all layers (l=0 to l=50).\\ \\
654
Note: See TracBrowser for help on using the repository browser.