\chapter{Advanced simulations}\label{advance}

\vk
In this chapter, useful advice to perform more sophisticated simulations is provided to advanced users of the model. 

\mk
\section{Running nested simulations}\label{nests}

\paragraph{Parameter files} In case you run simulations with \ttt{max\_dom} nested domains, you have to set \ttt{max\_dom} parameters wherever there is a ``," in the \ttt{namelist.input} template in chapter~\ref{zeparam}. Below we reproduce an example of the resulting syntax of the \ttt{\&time\_control}, \ttt{\&domains} and \ttt{\&bdy\_control} categories in \ttt{namelist.input}. We recommend running hydrostatic nested simulations\footnote{Non-hydrostatic nested simulations are sometimes unstable at boundaries; this should be fixed in future versions of the model.} by setting \ttt{non\_hydrostatic = F} in \ttt{\&dynamics} in \ttt{namelist.input}. If you run a simulation with, say, $3$ domains, please ensure that you defined three files \ttt{callphys.def}, \ttt{callphys\_d2.def} and \ttt{callphys\_d3.def} (one per nest). Usually all settings in these files are similar except \ttt{iradia}.

\scriptsize
\codesource{OMG_namelist.input}
\normalsize

\paragraph{Preprocessing steps} The additional settings for nests in \ttt{namelist.input} must correspond to the ones in the \ttt{namelist.wps} file which define the domain settings for \ttt{geogrid.exe}. A typical \ttt{namelist.wps} file for nested simulations is given below. An automated generation of \ttt{namelist.wps} from \ttt{namelist.input} is provided in the \ttt{runmeso} script as for single-domain simulations. Defining several domains yield one output per domain: e.g. for three domains \ttt{geogrid.exe} yields \ttt{geo\_em.d01.nc}, \ttt{geo\_em.d02.nc}, \ttt{geo\_em.d03.nc}\ldots, \ttt{real.exe} yields \ttt{wrfinput\_d02}, \ttt{wrfinput\_d03}, \ldots 

\scriptsize
\codesource{namelist.wps_NEST}
\normalsize

\paragraph{Useful remarks} The model presently supports 3 nests, but more nests can be included by adaptating \ttt{runmeso} and the following files: 
\begin{verbatim}
$LMDMOD/LMD_MM_MARS/SRC/WRFV2/call_meso_inifis3.inc
$LMDMOD/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq3.inc
$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/duplicate3
$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/generate3
$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/makegcm*  ## search for 'nest'
\end{verbatim}

grid points - 1 est divisé par nproc et ratio dx
exemple: 4 domaines et ratio 3 : il faut multiple de 12 (+1)

attention seulement 4 processeurs

nests >> commencer par faire un test nest par nest en en rajoutant un n-1 à chaque succès au niveau n
-- une instabilité dans le nest 2 peut provenir du nest 1. stabiliser le nest 1 tout d'abord.

resolution à virgule au moins précis à deux chiffres entre WPS et WRF

\mk
\section{Running simulations with tracers}

mars: number of corresponding tracers



\mk
\section{Running simulations with the new physics}
different callphys.def
the step datafile.h is not needed anymore ! use callphys.def.
traceur.def
run.def
different callphys.def
makemeso -p

\mk
\section{Running Large-Eddy Simulations}

\mk
\section{Controlling which fields to output}
%\section{geogrid.tbl}

\scriptsize
\codesource{Registry.EM.extract}
\normalsize

ne pas déclarer un 2D en 3D et cioce versa
FAIRE registry.bash UNEFOISFINI

\mk
\section{Interpolating outputs on altitude and pressure levels}\label{postproc}
\ttt{api}

\mk
\section{Generating maps for winds and meteorological fields}\label{plots}

\ttt{python}
\ttt{idl} ?

