\documentclass[a4paper]{article}

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

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

\usepackage{amsmath}

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

\usepackage{geometry}

\usepackage[np]{numprint}

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

\author{LMDZ team}
\title{LDMZ tutorial: aerosol effects}
\date{December 7th, 2021}

\geometry{top=2cm,bottom=2cm,left=2.5cm,right=2.5cm}

\begin{document}

\maketitle

\noindent
This tutorial focuses on how to activate and diagnose aerosol effects in LMDZ.\\

\noindent
This document can be downloaded as a pdf file (so you could copy/paste command lines from it):
\begin{verbatim}
wget http://www.lmd.jussieu.fr/~lmdz/pub/Training/Tutorials/Tutorial_Aerosols.pdf
\end{verbatim}

\section{Prerequisites}
If you have already installed the model with the script \verb+install_lmdz.sh+ as described in tutorial \#1, then follow the instructions at point (A) below. Otherwise, start by installing the model, following the instructions at point (B):\\

\textbf{(A) If you have already installed the model} :\\

\noindent
In the \verb+modipsl/modeles/LMDZ+ folder, download and unpack the BENCH48x36x39 :
\begin{verbatim} 
cd modipsl/modeles/LMDZ
wget https://www.lmd.jussieu.fr/~lmdz/pub/3DBenchs/bench_lmdz_48x36x39.tar.gz
tar -xvf bench_lmdz_48x36x39.tar.gz
 \end{verbatim}
\noindent
Go in the new folder  BENCH48x36x39 (created in \verb+modipsl/modeles/LMDZ+) and compile the model at the 48x36x39 resolution, using the script compilegcm.sh. At the end, check that you have in your folder the executable \verb+gcm.e+ :
\begin{verbatim} 
cd BENCH48x36x39
./compilegcm.sh
ll gcm.e
 \end{verbatim}
\noindent
Now you can go the exercice described in section 2 \textbf{"Activating aerosols}".\\


\textbf{(B) If you haven't installed the model yet} :\\

\noindent
Create a working folder, named for exemple LMDZwork :
\begin{verbatim}
mkdir LMDZwork
cd LMDZwork
\end{verbatim}

\noindent
Download and run the script \verb+install_lmdz.sh+,  with the appropriate options to (i) install the version dated Nov. 2nd 2021, corresponding to {\em svn release} 3998, and (ii) compile for resolution 48x36x39 (different than the one indicated in tutorial 1, which is 32x32x39) :

\begin{verbatim}
wget http://lmdz.lmd.jussieu.fr/pub/install_lmdz.sh
chmod +x install_lmdz.sh
./install_lmdz.sh -v 20211102.trunk -d 48x36x39
\end{verbatim}

\noindent
The LMDZ model is now installed in your folder \verb+LMDZwork+, in \verb+LMDZ20211102.trunk/modipsl/modeles/LMDZ+.
A "benchmark" simulation was automatically run therein, in the folder \verb+BENCH48x36x39+.
It's in this folder that you'll do the exercice in section 2 :\\

\noindent\verb+cd LMDZ20211102.trunk/modipsl/modeles/LMDZ/BENCH48x36x39+



\section{Activating aerosols}

\subsection{Switching on tropospheric aerosol effects}

\noindent
Aerosols are switched off by default in the basic LMDZ configuration. To switch on aerosols, you need to change some flags in
\begin{verbatim} modipsl/modeles/LMDZ/BENCH48x36x39/config.def \end{verbatim}

\noindent
Specifically the following changes should be made: 
\begin{itemize}
\item \verb|flag_aerosol=6| or any other relevant number
\item \verb|ok_ade=y| to activate aerosol-radiation interactions
\item \verb|ok_aie=y| to activate aerosol-cloud interactions
\end{itemize}

\noindent
As \verb|aer_type=actuel|, only these two aerosol files are required for the simulation:
\begin{itemize}
\item \verb|aerosols1980.nc|  : "present-day" aerosol file
\item \verb|aerosols.nat.nc|   : preindustrial (year 1850) aerosol file
\end{itemize}

NOTE : The input aerosol files must have the same horizontal grid (resolution, zoom if any) as the simulation you want to run.
The vertical interpolation, if needed, will be done by the model.\\

\noindent
No need to recompile the model. You may just rerun the benchmark experiment. 
\begin{verbatim}
./gcm.e
\end{verbatim}

\noindent
This returns an error message as one additional flag needs to be activated. Return to \verb|config.def|
and change the following flag (or add it if it's missing) : 
\begin{itemize}
\item \verb|ok_cdnc=y|  to activate the computation of cloud droplet number concentrations as required for \verb|ok_aie=y|. 
\end{itemize}

\noindent
This time, the model runs, and 3 output files are created : histhf.nc, histday.nc and histmth.nc . As you run by default for 1 day only (nday=1 in run.def),  histmth.nc will be "empty" (the variables are listed in it, but no values; \verb+time_counter+ contains 0 timesteps ; a minimum of 5 days of run are needed for histmth.nc to be filled in ).\\

\noindent
The following diagnostics for tropospheric aerosols can be made available in the different output files :
\begin{itemize}
\item \verb+topswad+ : top-of-atmosphere shortwave aerosol direct forcing
\item \verb+topswad0+  : top-of-atmosphere shortwave aerosol direct forcing in clear-sky
\item \verb+topswai+  : top-of-atmosphere shortwave aerosol indirect forcing
\item \verb+od550aer+  : aerosol optical depth at 550 nm
\item \verb+od550lt1aer+  : aerosol optical depth at 550 nm for the fine aerosol mode
\item \verb+od550*****+ : optical depth for the different aerosol tracers, named according to their mode (Accumulation/Coarse/Super-coarse) + Soluble/Insoluble + Name (BC/POM/SO4/NO3/SS/DUST) + M for "mode" (Ex : CIDUSTM= Coarse Insoluble DUST Mode).
\end{itemize}

\noindent
With the default settings in the \verb+BENCH48x36x39+ folder (see \verb+phys_out_filelevels+ in  \verb+config.def+), all aerosol diagnostics are available in  \verb+histday.nc+, none of them in  \verb+histhf.nc+
To be sure that a given diagnostic (ex: " \verb+topswad+") will be present in all output files, you can insert in the \verb|config.def| file this type of lines :

\verb|flag_topswad=0 0 0 0 0| \\
\noindent
and then rerun the model.\\

\noindent
You may visualise the variables that are available in your output files.


\subsection{Switching on stratospheric aerosol effects}

\noindent
You need to link the stratospheric aerosol input files to the sample file:
\begin{verbatim}
ln -s tauswstrat.2D.1991.nc tauswstrat.2D.nc 
ln -s taulwstrat.2D.1991.nc taulwstrat.2D.nc 
\end{verbatim}
Year 1991 was chosen because it is the year of Mount Pinatubo eruption.\\

\noindent
In order to activate the stratospheric aerosols in the model, you need the following flags :
\begin{itemize}
\item \verb|iflag_rrtm=1| to activate RRTM (radiative transfer scheme) (flag to be changed in \verb|physiq.def|)
\item \verb|NSW=6| to select 6 wavebands in the SW in (flag to be added in \verb|physiq.def|)
\item \verb|flag_aerosol_strat=2| to select CMIP6 stratospheric aerosols (flag to be added in \verb|config.def|)
\end{itemize}

\noindent
You may also add in \verb+config.def+ the flag \verb|ok_volcan=y| to calculate aerosol forcing diagnostics \verb+topswad+ and \verb+topswad0+ (via double radiation calls) for stratospheric instead of anthropogenic aerosols.
The \verb+topswai+ diagnostic, for aerosol-cloud interaction, has no interest for stratospheric aerosols, because the stratosphere is very dry, there are no (or very few) clouds (see also the last note in section 2.3 below).\\

\noindent
You can run the model (a full year if you want to see the effects of Pinatubo in June 1991).\\

\noindent
In the output, you can visualise these 2 diagnostics : 
\begin{itemize}
\item \verb+od550_STRAT+ : stratospheric aerosol optical depth at 550 nm
\item \verb+od_10um_STRAT+ : stratospheric aerosol optical depth at 10 um
\end{itemize}

\subsection{Notes about the interaction between the different flags concerning strato- vs tropospheric aerosols}
\begin{itemize}
\item If \verb+ok_ade=n+ and \verb+ok_aie =n+, then the topswa* variables for stratospheric aerosols will NOT be calculated, even if the other conditions are fulfilled (i.e., \verb+ok_volcan=y+, and the output of \verb+topswa*+ variables is activated).
\item If \verb+ok_ade=y+ or \verb+ok_aie=y+, then \verb+flag_aerosols+ different of 0 is required, so at least one tropospheric aerosol must be activated.
\item If both tropospheric and stratospheric aerosols are activated, and \verb+ok_ade=ok_aie=y+, then \verb+ok_volcan=y+ will redirect topswad* calculation from tropo- to stratospheric aerosols ; topswai (which would be 0 for strato) is still calculated for tropospheric aerosols.
\end{itemize}

\end{document}
