% $Id: exercise_cbl.tex 1515 2015-01-02 11:35:51Z boeske $
\input{header_tmp.tex}
%\input{header_lectures.tex}

\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{pgf}
\usepackage{subfigure}
\usepackage{units}
\usepackage{multimedia}
\usepackage{hyperref}
\newcommand{\event}[1]{\newcommand{\eventname}{#1}}
\usepackage{xmpmulti}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usetikzlibrary{calc}                             %neues paket
\usetikzlibrary{decorations.markings}             %neues paket
\usetikzlibrary{decorations.pathreplacing}        %neues paket
\def\Tiny{\fontsize{4pt}{4pt}\selectfont}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{pdfcomment}
\usepackage{graphicx}
\usepackage{listings}
\lstset{showspaces=false,language=fortran,basicstyle=
        \ttfamily,showstringspaces=false,captionpos=b}

\institute{Institute of Meteorology and Climatology, Leibniz Universit{\"a}t Hannover}
\selectlanguage{english}
\date{last update: \today}
\event{PALM Seminar}
\setbeamertemplate{navigation symbols}{}

\setbeamertemplate{footline}
  {
    \begin{beamercolorbox}[rightskip=-0.1cm]&
     {\includegraphics[height=0.65cm]{imuk_logo.pdf}\hfill \includegraphics[height=0.65cm]{luh_logo.pdf}}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,
      leftskip=.3cm,rightskip=0.3cm plus1fil]{title in head/foot}
      {\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor} \hfill \eventname \hfill \insertframenumber \; / \inserttotalframenumber}
    \end{beamercolorbox}
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
  }
%\logo{\includegraphics[width=0.3\textwidth]{luhimuk_logo.pdf}}


\title[Exercise 10: Cumulus Cloud]{Exercise 10: \\Cumulus Cloud With Bulk Cloud Physics}
\author{PALM group}

\begin{document}

% Folie 1
\begin{frame}
\titlepage
\end{frame}

\section{Exercise}
\subsection{Exercise}

% Folie 2
\begin{frame}
   \frametitle{Exercise 10: Cumulus Cloud With Cloud Physics}
   
   Simulate a cumulus cloud:
   \begin{itemize}
%      \scriptsize
	   \item<2-> Initialize the simulation with a marine, cumulus-topped, trade-wind region boundary layer.
	   \item<3-> Trigger the cloud by a bubble of rising warm air.
	   \item<4-> Parameterize condensation using a simple bulk cloud physics scheme.
	   \item<5-> Learn how to carry out conditional averages.
   \end{itemize}   
 \end{frame}

% Folie 3
\section{Hints}
\subsection{Hints}
\begin{frame}
   \frametitle{Hints I}

   The setup of this exercise is based on the LES-intercomparison BOMEX (Siebesma et al., 2003, JAS): 
%   \only<2>{\begin{center}
%      \includegraphics[width=0.7\textwidth]{exercise_cumulus_figures/ptq.pdf}
%   \end{center}}
   \only<2->{
   \begin{itemize}
      \scriptsize
      
      \item<2-> In order to prescribe vertical profiles of temperature and humidity, set:\\
                         \texttt{initializing\_actions = 'set\_constant\_profiles',}
	    \item<3-> \texttt{pt\_surface = 297.9,}
	    
	    \texttt{pt\_vertical\_gradient = 0.0, 0.58588957,}
	    
	    \texttt{pt\_vertical\_gradient\_level = 0.0, 740.0,}
	    \item<4-> \texttt{q\_surface = 0.016,}
	    
	    \texttt{q\_vertical\_gradient = -2.97297E-4, -4.5238095E-4, -8.108108E-5,}
	    
	    \texttt{q\_vertical\_gradient\_level = 0.0, 740.0, 3260.0,}
	    
	    \item<5-> \texttt{surface\_pressure = 1015.4,}
	    
	    \item<6-> Note that contrary to BOMEX, no geostrophic wind, no surface fluxes, and no subsidence is prescribed in this setup.
	    
	      \item<7-> domain size: about $\unit[1000 \times 3600 \times 3000]{m^3}$ ($x$/$y$/$z$)
	   \item<8-> grid size: $\unit[50]{m}$ equidistant
	   \item<9-> simulated time:	$\unit[1800]{s}$
   \end{itemize}  
   }
\end{frame}


% Folie 4
\begin{frame}
   \frametitle{Hints II}
   
   How to initialize a bubble of warm air?
   \begin{itemize}
      \scriptsize
      \item<2-> In the subroutine \texttt{user\_init}, initialize the bubble of warm air by a temperature excess at the first time step (\texttt{current\_timestep\_number == 0})
      \item<3-> The temperature excess can be added directly to the three-dimensional field of liquid water potential temperature:
      
      \texttt{pt(k,j,i) = pt(k,j,i) + EXP( -0.5 * ( y / bubble\_sigma\_y )**2 ) * \&}
      
      \texttt{\hphantom{pt(k,j,i) = pt(k,j,i) + }EXP( -0.5 * ( z / bubble\_sigma\_z )**2 ) * \&}
      
      \texttt{\hphantom{pt(k,j,i) = pt(k,j,i) + }initial\_temperature\_difference}
      
      
      with the locations:
      
      \texttt{y = j * dy - bubble\_center\_y}
      
      \texttt{z = zu(k) - bubble\_center\_z}
      
      \item<4-> Initialize the bubble by the following parameters:
      
      \texttt{bubble\_center\_y = 1800.0, bubble\_center\_z = 170.0,}
      
      \texttt{bubble\_sigma\_y = 300.0, bubble\_sigma\_z = 150.0,}
      
      \texttt{initial\_temperature\_difference = 0.4}
      \item<5-> Think parallel: Mind that the domain of each PE extends only from \texttt{nxlg} to \texttt{nxrg} and \texttt{nysg} to \texttt{nyng}!
    \end{itemize}
\end{frame}

% Folie 5
\begin{frame}
   \frametitle{Hints III}
   Bulk cloud physics in PALM:
   \begin{itemize}
      \scriptsize
	    \item<2-> PALM offers two bulk cloud physics schemes: A very simple, one-moment scheme by Kessler (1969, MM) and a state-of-the-art two-moment scheme by Seifert and Beheng (2006, MAP).
	    
	    \item<3-> You will use the saturation adjustment scheme, as applied in the Kessler-scheme, for parameterizing condensation. (Note that this kind of scheme is used in the vast majority of today's bulk cloud physics parameterizations.)
	    
	    \item<4-> The liquid water is diagnosed by $q_\text{l} = \max(0, q_\text{t} - q_\text{s})$: If the total water content $q_\text{t}$ exceeds the saturation water content $q_\text{s}$, all supersaturations condensate immediately to liquid water. On the other hand, no liquid water is present in subsaturated conditions.  
	    
   \end{itemize}  
   
    \onslide<4-> Turn on simple cloud microphysics in your parameter file (\texttt{inipar} namelist): 
   
   \begin{itemize}
      \scriptsize
	    \item<5-> \texttt{humidity = .TRUE., cloud\_physics = .TRUE.,}
	    
	    \item<6-> \texttt{cloud\_scheme = 'kessler', precipitation = .FALSE.}
   \end{itemize}  
 \end{frame}
   
   
% Folie 6
\begin{frame}
   \frametitle{Hints IV}
   
   What is conditional averaging?
   \begin{itemize}
      \scriptsize
      \item<2-> A horizontal average (e.\,g., for retrieving vertical profiles) might be inappropriate for the analysis of a heterogeneous phenomenon (e.\,g., cumulus clouds).
      \item<3-> A conditional average can restrict the analysis to the regions of interest (e.\,g., cloudy and non-cloudy regions).
    \end{itemize}
   \onslide<4->What kind of conditional average are you going to derive?
   \begin{itemize}
      \scriptsize
      \item<5-> You will derive vertical profiles of \textbf{cloud cover} and \textbf{cloud core cover}. These profiles are the basis for more complex profiles (e.\,g., the cloud core vertical velocity).
      \item<6-> Cloudy grid cells are defined as grid cells with a non-zero liquid water content ($q_\text{l}>0$, \texttt{ql(k,j,i) > 0.0}). Cloud core grid cells are defined as cloudy grid cells, which are also positively buoyant with respect to the slab average ($\theta_\text{v}>\langle \theta_\text{v} \rangle$, \texttt{vpt(k,j,i) > hom(k,1,44,sr)}).
      \end{itemize}
\end{frame}

% Folie 7
\begin{frame}
   \frametitle{Hints V}

    PALM offers a convenient to compute and output user-profiles:
     \begin{itemize}
      \scriptsize
      \item<2-> In the subroutine \texttt{user\_statistics}, you can compute the cloud cover profile by counting all cloudy grid cells at a certain grid level \texttt{k}:
      
      \texttt{IF ( ql(k,j,i) > 0.0 )  THEN}
      
      \texttt{\hphantom{aaa}sums\_l(k,pr\_palm+1,tn) = sums\_l(k,pr\_palm+1,tn) + 1.0}
      
      \texttt{ENDIF}
      
      \item<3-> The computation of the cloud core cover profile is up to you!

      
       \item<4-> PALM automatically cares for the summation across the PE's boundaries and the normalization of the profiles (i.\,e., dividing it by the total amount of grid cells in horizontal directions).
      
      \item<5-> Do not forget to adapt \texttt{user\_check\_data\_output\_pr} (for defining your user-profiles) and your parameter file (\texttt{userpar} namelist) for the output (with the parameter \texttt{data\_output\_pr\_user = 'your\_profile'})!
      \item<6-> \textbf{Check also the examples provided in \texttt{user\_statistics} and \texttt{user\_check\_data\_output\_pr} for the implementation of user profiles!}
      
      


      \end{itemize}
\end{frame}

\section{Tasks}
\subsection{Tasks}
% Folie 8
\begin{frame}
   \frametitle{Tasks to be done:}
   
   \begin{itemize}
    \item<1-> Output instantaneous yz-cross sections of \texttt{ql} and \texttt{w} at \texttt{section\_yz = 0}. (\texttt{pt}, \texttt{q} and \texttt{vpt} are also interesting!) An output interval of $60\,\text{s}$ is adequate. 
   \item<2-> Output instantaneous vertical profiles of cloud cover and cloud core cover! Again, an output interval of $60\,\text{s}$ is adequate.
   \item<3-> Answer the following questions:
   \begin{itemize}
   \item How does the cloud develop?
   \item Can you identify the \textit{actively growing} and the \textit{decaying stage} of the cloud's life cycle by comparing the profiles of cloud and cloud core cover profiles? (Mind the profiles' definitions and physical implications!)
   \end{itemize}
   \item<4-> If you are really fast: What changes during the cloud's development turning on precipitation (\texttt{precipitation = .TRUE.})?
   \end{itemize}

\end{frame}

% Folie 9
\section{Results}
\subsection{Results}

\begin{frame}
   \frametitle{$yz$-cross sections at $t \approx \unit[500]{s}$}
%   The bubble of warm air rises, but has not reached its condensation level. 
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_cumulus_figures/500.pdf}
   \end{center}
\end{frame}

% Folie 8
\begin{frame}
   \frametitle{$yz$-cross sections at $t \approx \unit[800]{s}$}
%   Condensation starts, and the cloud appears as the the visible top of the rising bubble. 
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_cumulus_figures/800.pdf}
   \end{center}
\end{frame}

% Folie 9
\begin{frame}
   \frametitle{$yz$-cross sections at $t \approx \unit[1200]{s}$}
%   The cloud is vigorously growing.
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_cumulus_figures/1200.pdf}
   \end{center}
\end{frame}

% Folie 9
\begin{frame}
   \frametitle{$yz$-cross sections at $t \approx \unit[1500]{s}$}
%   The cloud dilutes and dissipates due to turbulent entrainment of environmental air.
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_cumulus_figures/1500.pdf}
   \end{center}
\end{frame}

% Folie 10
\begin{frame}
   \frametitle{Cloud cover (clcov) and cloud core cover (cocov) profiles}
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_cumulus_figures/prof.pdf}
   \end{center}
\end{frame}

%\section{Answers}
\subsection*{Answers}
% Folie 13
\begin{frame}
   \frametitle{Answers to questions I}
   {\footnotesize }
   How does the cloud develop?
   {\footnotesize }
   \begin{itemize}
   \item See frames 9 -- 12: The clouds develops from a rising bubble of warm air ($t \approx \unit[500]{s}$). Reaching the condensation level ($t \approx \unit[800]{s}$), the cloud appears as the bubbles visible top. Afterwards, the cloud starts to grow more vigorously by the release of latent heat ($t \approx \unit[1200]{s}$). In the end of the cloud's life-cycle, the cloud dissipates by turbulent entrainment of environmental air and the subsequent evaporation of the cloud ($t \approx \unit[1500]{s}$).
   \end{itemize}
\end{frame}

\begin{frame}
   \frametitle{Answers to questions II}
   {\footnotesize }
Can you identify the (i) actively growing and (ii) decaying stage of the cloud's life cycle by comparing the profiles of cloud and cloud core cover profiles?
   {\footnotesize }
      \begin{itemize}
   \item See Frame 13: As long as the cloud core is present, i.\,e., a positively buoyant region producing upward motion, the cloud grows actively (until $1400\,\text{s}$). From $1500\,\text{s}$ on, no cloud core is visible. As a result, the cloud's upward motion decelerates and the rate of condensation decreases. Thus, the cloud's dilution by the entrainment of environmental air can not be counterbalanced anymore. As a consequence, the cloud decays and finally dissipates.
   \end{itemize}
\end{frame}

\begin{frame}
   \frametitle{Answers to questions III}
   {\footnotesize }
What changes during the cloud's development turning on precipitation (\texttt{precipitation = .TRUE.})?
      {\footnotesize }
      \begin{itemize}
   \item Almost nothing. The simulated cloud is very shallow, therefore no significant masses of rain are produced that might alter the cloud.
   \end{itemize}
\end{frame}

\end{document}
