%% ==============================================================================
%% NEMO_book.tex: build the NEMO Reference Manual
%% ==============================================================================


%% Run ../build_NEMO_manual.sh to generate the PDF version (with pdflatex)

%% Document layout
%% ==============================================================================

\documentclass[a4paper, 11pt]{book}


%% Preamble
%% ==============================================================================

%% Custom style
\usepackage{../main/NEMO_manual}
\usepackage{../main/NEMO_minted}

\makeindex


%% 
%% ==============================================================================

%% Trick to include biblio in subfile compilation
\newcommand{\biblio}{
  \bibliographystyle{../main/ametsoc}
  \bibliography{../main/NEMO_manual}
}

\begin{document}

%% Trick to include biblio in subfile compilation
\def\biblio{}


%% Frontmatter
%% ==============================================================================

%% Frontpage

\title{
%\vspace{-6.0cm}\includegraphics[width=1.1\textwidth]{logo_ALL}				\\
%\vspace{ 5.1cm}\includegraphics[width=0.9\textwidth]{NEMO_logo_Black}	\\
\vspace{ 1.4cm}\rule{345pt}{1.5pt}													\\
\vspace{0.45cm}{\Huge NEMO ocean engine}											\\
\rule{345pt}{1.5pt}
}

\author{
\Large Gurvan Madec, and the NEMO team					                                             \\
\texttt{\small\href{mailto:gurvan.madec@locean-ipsl.umpc.fr}{gurvan.madec@locean-ipsl.umpc.fr}}	\\
}

\date{
Decembre 2017																											\\
{\small  -- version 4.0 alpha --}																				\\
~																															\\
\textit{\small Note du P\^ole de mod\'{e}lisation de l'Institut Pierre-Simon Laplace No 27 }	\\
\vspace{0.45cm}{ ISSN No 1288-1619.}
}
%\date{\today}

\maketitle
\frontmatter


%% ToC i.e. Table of Contents

\dominitoc
\tableofcontents


%% Mainmatter
%% ==============================================================================

\mainmatter


%% Foreword

\subfile{../subfiles/foreword}


% Introduction

\subfile{../subfiles/introduction}


% Chapters

\subfile{../subfiles/chap_model_basics}

\subfile{../subfiles/chap_time_domain}   % Time discretisation (time stepping strategy)

\subfile{../subfiles/chap_DOM}           % Space discretisation

\subfile{../subfiles/chap_TRA}           % Tracer advection/diffusion equation

\subfile{../subfiles/chap_DYN}           % Dynamics : momentum equation

\subfile{../subfiles/chap_SBC}           % Surface Boundary Conditions

\subfile{../subfiles/chap_LBC}           % Lateral Boundary Conditions

\subfile{../subfiles/chap_LDF}           % Lateral diffusion

\subfile{../subfiles/chap_ZDF}           % Vertical diffusion

\subfile{../subfiles/chap_DIA}           % Outputs and Diagnostics

\subfile{../subfiles/chap_OBS}           % Observation operator

\subfile{../subfiles/chap_ASM}           % Assimilation increments

\subfile{../subfiles/chap_STO}           % Stochastic param.

\subfile{../subfiles/chap_misc}          % Miscellaneous topics

\subfile{../subfiles/chap_CONFIG}        % Predefined configurations


%% Appendix

\appendix

\subfile{../subfiles/annex_A}					% Generalised vertical coordinate

\subfile{../subfiles/annex_B}					% Diffusive operator

\subfile{../subfiles/annex_C}					% Discrete invariants of the eqs.

\subfile{../subfiles/annex_iso}				% Isoneutral diffusion using triads

\subfile{../subfiles/annex_D}					% Coding rules

%% Not included
%\subfile{../subfiles/chap_conservation}	%
%\subfile{../subfiles/annex_E}				% Notes on some on going staff
%\subfile{../subfiles/annex_Fox-Kemper}	% Notes on Fox-Kemper
%\subfile{../subfiles/annex_EVP}				% Notes on EVP


%% Backmatter
%% ==============================================================================

\backmatter


%% Bibliography

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{../main/NEMO_manual}


%% Index

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex


\end{document}
