\documentclass[a4paper]{article}

                                % Packages

\usepackage[utf8]{inputenc}
\usepackage{ifpdf}

\ifpdf
\else
\usepackage[active]{srcltx}
\fi

\usepackage{amsmath}

\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[np]{numprint}

\usepackage{hyperref}
\ifpdf
\hypersetup{pdftitle={Tutorial \#2}, pdfauthor={LMDZ team},
  hypertexnames=false, pdfstartview=FitBH}
\fi

\author{LMDZ team}
\title{Tutorial \#2}

                                %---------------

\begin{document}

\maketitle
\tableofcontents

\newpage

This tutorial makes use of a zoomed configuration of LMDZ. Section
\ref{sec:setting-up-case} is an initialization phase. In section
\ref{sec:experiments}, you can either take a closer look at tracers,
or the Orchidee model or switch some parameterizations of the physics
part of the program. The three experiments in section
\ref{sec:experiments} are independent. In section \ref{sec:nudging},
you will nudge the model toward analyzed wind fields.

Start by installing the model with the script \verb+install.sh+, if
you have not already done so in tutorial \#1.

\section{Setting up a case with a zoomed grid}
\label{sec:setting-up-case}

\begin{itemize}
\item Go to the directory \verb+LMDZ20151130.trunk/modipsl/modeles/LMDZ5+,
  which contains files \verb+makelmdz_fcm+, \verb+libf+\dots In this
  directory, download the following tar file :
\begin{verbatim}
wget http://www.lmd.jussieu.fr/~lmdz/Distrib/tutorial.tar
tar -xf tutorial.tar
cd TUTORIAL
\end{verbatim}
\item In the directory \verb+TUTORIAL+, take a look at the extracted
  files. You should edit file \verb+gcm.def+ if you want to place the
  center of the zoom at your preferred location. For that you just
  have to change the longitude and latitude of the zoom center,
  \verb+clon+ and \verb+clat+.
\item If you are interested in coupling LMDZ with the surface scheme
  Orchidee, edit the \verb+init.sh+ file and set option
  \verb+veget=1+.  If not (\verb+veget=0+), the model will be run with
  a simplified scheme for surface hydrology: the ``bucket'' scheme.
\item Increase the stack memory you can use by typing the following
  command:
\begin{verbatim}
ulimit -Ss unlimited
\end{verbatim}
  or, even better, add this command in you shell start-up file (if you
  use Bash, your start-up file can be \verb+.profile+ or
  \verb+.bash_profile+).
\item Run the script :
\begin{verbatim}
./init.sh
\end{verbatim}
  The script first compiles the model (\verb+gcm.e+) again because it
  uses a different resolution, 48 $\times$ 36 -- L39, than the one
  used in \verb+install.sh+. \verb+init.sh+ also compiles the program
  \verb+ce0l.e+, which creates initial state and boundary
  conditions. \verb+init.sh+ then downloads new NetCDF files which
  contain the surface orography, sea-surface temperature, and so on,
  as well as 3D meteorological files taken from ECMWF analyses at a
  particular date. \verb+init.sh+ then runs \verb+ce0l.e+ which
  creates files \verb+start.nc+, \verb+startphy.nc+ and
  \verb+limit.nc+. Check that these files have actually been
  created. If not, please ask for our help. If you set \verb+veget=1+,
  the program \verb+gcm.e+ should also have run automatically for one
  day and created a start file for Orchidée, called
  \verb+sechiba_rest_in.nc+.
\item If you have the files \verb+start.nc+, \verb+startphy.nc+ and
  \verb+limit.nc+ (and optionally \verb+sechiba_rest_in.nc+ for
  \verb+veget=1+), you are almost done. In the file \verb+config.def+,
  add the line:
\begin{verbatim}
flag_pres__00003 =           4
\end{verbatim}
Thus, the NetCDF variable pres, which contains the pressure at model
layers, will be included in the file \#3, \verb+histhf.nc+.
\item You can now run the model by executing the command
  \verb+./gcm.e+.
\end{itemize}

\section{Experiments}
\label{sec:experiments}

The three subsections \ref{sec:tracers}, \ref{sec:switch-phys-param}
and \ref{sec:sens-soil-scheme} are independent.

\input{tracers.tex}

\input{physics.tex}

\input{orchid.tex}

\section{Nudging}
\label{sec:nudging}

\begin{itemize}
\item The program \verb+ce0l.e+ (which was run by \verb+init.sh+ in
  the first part of this tutorial) created the file
  \verb+grilles_gcm.nc+. \verb+grilles_gcm.nc+ contains the longitudes
  and latitudes of the model grids (staggered grids for zonal wind,
  meridional wind and temperature). You can visualize the orography
  map as seen by the zoomed grid, by opening this file with
  \verb+ferret+ or \verb+grads+ and plotting the variable \verb+phis+
  (which, despite its name, actually contains the surface altitude, in
  m). You can also easily plot the horizontal resolution of the model
  as the square root of the grid mesh area (variable \verb+aire+, in
  m$^2$).
\item We will nudge the model with reanalysis fields. The script
  \verb+get_era.sh+, in the directory \verb+TUTORIAL+, gets the
  reanalysis files. Run the script. It will also interpolate the winds
  on the model grid (by reading the model grid from file
  \verb+grilles_gcm.nc+). You should end up with files \verb+u.nc+ and
  \verb+v.nc+ in your current directory. Note that for this tutorial
  we have given open access to a subset of the ERA-interim wind
  fields.  ERA-interim files are stored at IDRIS, CCRT and Climserv,
  with restricted access. To access these files at IDRIS or on
  Climserv, you should contact Sophie Bouffies-Cloché (IPSL). For
  access at CCRT, contact Anne Cozic (LSCE). \verb+get_era.sh+ is a
  very simplified script for the tutorial, but more general scripts
  are available on the
  \href{http://forge.ipsl.jussieu.fr/igcmg/browser/CONFIG/LMDZOR/branches/LMDZOR_v4/CREATE/SCRIPT}{Subversion
    server of IGCMG}.
\item Take a look at file \verb+guide.def+. Nudging is activated for
  variables u and v only (as is often the case). The relaxation time
  is set to 3 hours inside the zoomed area (\verb+tau_max=0.125+ days)
  and half an hour outside (\verb+tau_min+=0.0208333 days). The
  smaller the relaxation time, the stronger the nudging. You can
  change parameters in this file if you want.
\item Add the line:
\begin{verbatim}
INCLUDEDEF=guide.def
\end{verbatim}
  in \verb+run.def+.
\item Rename your \verb+hist*+ files so that they are not overwritten
  by the next run, and delete the file \verb+sechiba_rest_out.nc+.
\item Run the model again with nudging:
\begin{verbatim}
../gcm.e
\end{verbatim}
\item Compare the results of the simulations with and without nudging.
\end{itemize}

\end{document}
