\documentclass{book}
%aps,%
%12pt,%
%final,%
%notitlepage,%
%oneside,%
%onecolumn,%
%nobibnotes,%
%nofootinbib,% 
%superscriptaddress,%
%noshowpacs,%
%centertags]%
%{revtex4}


\usepackage{amsmath}
\usepackage{authblk}
\usepackage{listings}
\usepackage{geometry}
\usepackage{array}
\usepackage{longtable}
\usepackage{gensymb}
\usepackage[font={Large}]{caption}

% Tables settings
\setlength\extrarowheight{5pt}

% Page geometry
 \geometry{
 a4paper,
 total={210mm,297mm},
 left=20mm,
 right=20mm,
 top=20mm,
 bottom=20mm,
 }

% Title
\title{The LAKE model. \\
Short Users's guide on Linux}
\author{Victor Stepanenko}
\affil{Moscow State University}
\date{\today}


\begin{document}
 
\maketitle 

\section{Compiling the model and creating a project}
The only prerequisite to install LAKE model is Fortran compiler.
The model can be built from source code by GNU and Intel Fortran compilers. GNU compiler is set by default in the model install configuration. Install configuration is given in files \emph{./Makefile} and \emph{./source/Makefile}. If you want to use Intel compiler, you have to change variable \emph{FC} in these makefiles to \emph{ifort}. 

Once you unpacked the LAKE model archive just type in the model root folder

\begin{lstlisting}
user@computer:~/LAKE/lake$ make all
\end{lstlisting}

to build the model from the source code. The next step is to configure the
model for you needs. This means that you create a project, identified
by the project name (hereafter we will refer to it as \emph{project\_name},
it may be any text, e.g. combination of the lake name and the time span you need to simulate this lake, for instance, "Valkea-Kotinen2006"). Once you've chosen the project name, type

\begin{lstlisting}
user@computer:~/LAKE/lake$ ./crproj <project_name>
\end{lstlisting}

This creates the folder structure in \emph{./results}, to which the output
files will be written. After that, create \emph{./setup/project\_name\_driver.dat} and \emph{./setup/project\_name\_setup.dat} files. These files must have
a certain structure, so that we recommend that you create them by copying from
sample files already existing in \emph{./setup}. Once copied, you can modify them appropriately. This is what the next two sections are devoted to.

Top run the model you have to provide a file with meteorological data. It must be an ASCII table, where each column contains a time series of a certain meteorological variable. A sequence of columns is set in \emph{./setup/project\_name\_driver.dat}. Shortly after start, the model will seek the file with meteorological data as \emph{./data/project\_name.dat}.

\section{Configuring the driver file}
Driver file is used to set the outer environment of the LAKE model
that is normally the atmospheric model. This means, that atmospheric
model calculates the atmospheric forcing for the LAKE model, and some
external parameters are also being passed to the LAKE model through
the driver interface. When the LAKE model is coupled to atmospheric 
model the driver file is not needed. \par
The format of the driver file is following. Each string of the file
starts with a comment (indicated by \emph{\#}) or with a keyword. The last
string of the file contains the keyword \emph{end}. The keywords may
be listed in any order, but we recommend to keep them in thematic groups,
as it is done in sample files. Each keyword, excepting \emph{end}, must 
have a value that is set after the keyword at the same string separated
by at least one space. Some keywords are followed by a group of numbers. 

\captionof{table}{The parameters of driver file}
\begin{longtable}{| l | p{10cm}|}
%\begin{tabular}{| l | p{10cm}|}
\hline
\large{Keyword} (optional denoted by 'opt') & \large{Values and explanation} \\ 
\hline
\emph{dataname} & The project name, character, enclosed by ' ' \\
\hline
\emph{forc\_format} & The input file format: 0 - ASCII(text), 1 - netcdf \\
\hline
\emph{npoints} & Number of lakes to be simulated \\
\hline
\emph{select\_call}, opt & The list of up to 20 numbers, each at new line,
                          denoting particular lakes, that will be simulated.
                          Relevant only if \emph{npoints} $>$ 1. Other lakes 
                          are omitted in the simulation. \\
\hline
\emph{lakinterac} & The number of interacting lakes: 1 - no interaction,
                    2 - two lakes are linked by a channel, 
                    $>$ 2 - not operational. \\
\hline
\emph{form} & obsolete, put 0 (means adjustable ASCII format, see below) \\
\hline 
\emph{height\_T\_q} & The height above the lake surface at which temperature and humidity are given (calculated by the atmospheric model or measured), m\\
\hline
\emph{height\_u} & The height above the lake surface at which the wind speed is given (calculated by the atmospheric model or measured), m\\
\hline
\emph{interval} & The time step of meteorological data, s \\
\hline
\emph{rad} & Defines, atmospheric radiation (1) or net radiation (2) is
in the relevant column of datafile, relevant if input file is ASCII (forc\_format = 0) \\
\hline
\multicolumn{2}{|c|}{\large{The parameters for adjustable format of input text file, relevant if forc\_format = 0, form = 0}} \\
\hline
\emph{N\_header\_lines} & The number of lines in a file header  \\
\hline
\emph{N\_coloumns} & The total number of coloumns in a file \\
\hline
\emph{N\_Year} & The number of coloumn with the number of a year (not used in the model) \\
\hline
\emph{N\_Month} & The number of coloumn with the number of a month (not used in the model) \\
\hline
\emph{N\_Day} & The number of coloumn with the number of a day (not used in the model) \\
\hline
\emph{N\_Hour} & The number of coloumn with the number of a hour (not used in the model) \\
\hline
\emph{N\_Uspeed} & The number of coloumn with x-component speed, m/s \\
\hline
\emph{N\_Vspeed} & The number of coloumn with y-component speed, m/s \\
\hline
\emph{N\_Temp} & The number of coloumn with air temperature, K \\
\hline
\emph{N\_Hum} & The number of coloumn with air humidity, kg/kg \\
\hline
\emph{N\_Pres} & The number of coloumn with atmospheric pressure, Pa \\
\hline
\emph{N\_SWdown} & The number of coloumn with total solar radiation, W/$m^2$ \\
\hline
\emph{N\_LWdown} & The number of coloumn with atmospheric radiation, W/$m^2$) \\
\hline
\emph{N\_Precip} & The number of coloumn with precipitation, m/s \\
\hline
\emph{N\_SensFlux} & The number of coloumn with sensible heat flux, W/$m^2$ \\
\hline
\emph{N\_LatentFlux} & The number of coloumn with latent heat flux, W/$m^2$ \\
\hline
\emph{N\_Ustar} & The number of coloumn with friction velocity, m/s \\
\hline
\emph{N\_surfrad} & The number of coloumn with radiation emitted by the surface, W/$m^2$ \\
\hline
\emph{N\_cloud} & The number of coloumn with total cloudiness, fraction \\
\hline
\emph{N\_SurfTemp} & The number of coloumn with water surface temperature, K; if not -1, then the surface temperature is used as Dirichlet boundary condition for temperature equation \\
\hline
\multicolumn{2}{|c|}{\large{The parameters of time integration}} \\
\hline
\emph{year0} & Julian year of initial moment of integration \\
\hline
\emph{month0} & Julian month of initial moment of integration \\
\hline
\emph{day0} & Julian day of initial moment of integration \\
\hline	
\emph{hour0} & Julian hour (may be fraction) of initial moment of integration \\
\hline
\emph{tinteg} & The duration of integration, days \\
\hline
\emph{spinup\_times} & Number of spinup periods \\
\hline
\emph{spinup\_period} & The duration of spinup period, days \\
\hline
\emph{control\_point} & 0 -- no control point, 1 -- starting with initial conditions defined by \emph{init\_T} and writing control point regularly with \emph{cp\_period} interval, 2 -- the same as 1 but starting with last saved control point \\
\hline
\emph{cp\_period} & The interval of control point output, days; relevant if \emph{control\_point}$>0$ \\
\hline
\emph{dt} & Time step of integration, s \\
\hline
\emph{call\_Flake} & The switch for integrating FLake model: 1 - on, 0 - off \\
\hline
\multicolumn{2}{|c|}{\large{External physical parameters of a lake}} \\
\hline
\emph{extwat} & Solar radiation extinction in a water body, $m^{-1}$ \\
\hline
\emph{extice} & Solar radiation extinction in an ice, $m^{-1}$ \\
\hline
\emph{alphax} & Slope of water surface in the x-direction, deg \\
\hline
\emph{alphay} & Slope of water surface in the y-direction, deg \\
\hline
\emph{a\_veg} & Effective cross-section of vegetation, $m^2/m^2$ \\
\hline
\emph{c\_veg} & Friction coefficient of vegetation in water, n/d \\
\hline
\emph{h\_veg} & The height of vegetation in the lake, m \\
\hline
\emph{kor} & Coriolis parameter, $s^{-1}$; if -999., then it is computed from
latitude \\
\hline
\emph{phi} & Latitude, deg \\
\hline
\emph{lam} & Longitude, deg \\
\hline
\emph{fetch} & Average wind fetch, m \\
\hline
\emph{area\_lake} & Lake area, $m^2$ \\
\hline
\emph{cellipt} & The ratio of x dimension to y dimension of a lake, n/d \\
\hline
\emph{lakeform} & The form of the lake's horizontal cross-section: 1 -- ellipse, 2 -- rectangle \\
\hline
\emph{trib\_inflow} & Total tributaries' inflow, $m^3/s$; obsolete, put to -9999.; then
it is dynamically adjusted to keep the lake depth nearly constant \\
\hline
\emph{morphometry} & Depth - lake cross-section area table, $m^2$; if not given, the area is constant with depth \\
\hline
\emph{effl\_outflow} & effluent discharge parameters group, specifying polynomial dependence of discharge on water level; the last value is relative altitude of effluent bottom over lake bottom (at deepest points, respectively); the first N values are polynomial coefficients, where N stands after 'effl\_outflow' keyword \\
\hline
\multicolumn{2}{|c|}{\large{Initial conditions}} \\
\hline
\emph{l10} & Initial ice thickness, m \\
\hline
\emph{h10} & Initial water thickness (lake depth), m \\
\hline
\emph{select\_h10}, opt & The list of up to 20 depths, each at new line,
                          specifying lakes' depths, for lakes selected
                          by \emph{select\_call}. \\
\hline
\emph{ls10} & Initial bottom ice thickness, m \\
\hline
\emph{hs10} & Initial snow thickness, m \\
\hline
\emph{Ts0} & Initial temperature of the top mixed layer, \celsius \\
\hline
\emph{Tb0} & Initial bottom temperature, \celsius \\
\hline
\emph{Tbb0} & Initial temperature at the bottom of soil layer, \celsius \\
\hline
\emph{Tbb0} & Initial mean temperature of the water column, \celsius \\
\hline
\emph{h\_ML0} & Initial mixed-layer depth, m \\
\hline
\emph{Sals0} & Initial salinity in the mixed layer, kg/kg \\
\hline
\emph{Salb0} & Initial bottom salinity, kg/kg \\
\hline
\emph{us0} & Initial x-component of velocity in the mixed layer, m/s \\
\hline
\emph{vs0} & Initial y-component of velocity in the mixed layer, m/s \\
\hline
\emph{init\_T} & The type of profiles initialization: 
               1 - using h\_ML0, Ts0 and Tb0;
               2 - using Tm,    Ts0 and Tb0;
               3 - using the temperature profile, specified in *\_setup.dat;  file after keyword \emph{T\_profile}; The temperature, salinity, $CH_4,CO_2,O_2$ profiles are controlled by this parameter. \emph{init\_T}=2 works only for temperature \\
\hline
\multicolumn{2}{|c|}{\large{Output parameters}} \\
\hline
\emph{nstep\_ncout} & the interval of netcdf output from driver, timesteps (if -1 no netcdf output from driver) \\
\hline
\emph{nstep\_out\_Flake} & the interval of output of Flake variables from driver, timesteps (if -1 the output of FLake variables from driver is not implemented), relevant if \emph{call\_Flake} = 1 \\
\hline	
\emph{moving\_average\_window} & the interval of moving average, netcdf output steps (intervals) \\
\hline
\emph{mean\_cycle\_period} & the length of mean cycle, netcdf output steps (intervals) \\
\hline


%end{tabular}
\end{longtable}
 
\section{Configuring the setup file}
Setup file has the same format, as the driver file. The list of parameters is given in a table below. 

\captionof{table}{The parameters of setup file}
\begin{longtable}{| l | p{10cm}|}
%\begin{tabular}{| l | p{10cm}|}
\hline
\large{Keyword} (optional denoted by 'opt') & \large{Values and explanation} \\ 
\hline
\multicolumn{2}{|c|}{\large{General parameters}} \\
\hline
\emph{path} & The full path to the model root, needed on some systems;
normally, specify it as '' \\
\hline
\emph{runmode} & The mode of LAKE model: 1 - standalone, 2 - driven by 
atmospheric model\\
\hline
\emph{omp} & The OpenMP: 0 - not used, 1 - used; normally OpenMP does not
give significant speedup \\
\hline

\multicolumn{2}{|c|}{\large{Spatio-temporal resolution group}} \\
\hline
\emph{nstep\_keps} & Number of tim esteps of k-epsilon parameterization per on model timestep, recommended value is 1 \\
\hline
\emph{M} & Number of layers in water \\
\hline
\emph{ns} & Number of layers in soil \\
\hline
\emph{nsoilcols} & Number of soil columns (1 - single soil column contacting with the lowest numerical layer (of water or deep ice) only, $>$ 1 - additional soil columns at the bottom slope, contacting with all numerical layers of water, ice and deep ice; morphometry information is necessary in driver file, if \emph{nsoilcols} $>$ 1) \\
\hline
\emph{Mice} & Number of layers in bottom ice \\
\hline
\emph{d\_surf} & Grid zooming parameter at the surface, n/d \\
\hline
\emph{d\_bot} & Grid zooming parameter at the bottom, n/d \\
\hline

\multicolumn{2}{|c|}{\large{Physical parameterizations}} \\
\hline
\emph{varalb} & Water albedo: 0 - constant, 1 - zenith-angle dependent \\
\hline
\emph{PBLpar} & Surface fluxes scheme: -1 - sensible, latent heat and momentum fluxes are given as input for the model; 0 - the latent heat flux is set to zero, while sensible heat and momentum fluxes are constant in time, specified by \emph{sensflux0} and \emph{momflux0}; 1 - Businger-Dayer formulas (Monin-Obukhov theory) for exchange coefficients, the code from INM RAS climate model; 2 - formulation from NH3d (Louis, 1979); 3 - formulation from FLake;
4 -  formulation implemented by D.Chechin \\
\hline
\emph{waveenh} & The shallow water correction of surface fluxes (Panin et al., 1996) (0 - off, 1 - on) \\
\hline
\emph{momflxpart} & Momentum flux treatment: 0 - all momentum flux from the atmosphere is consumed by currents acceleration; 2 - momentum flux from the atmosphere is partitioned between wave development (controlled by fetch) and currents acceleration (Stepanenko et al., 2014) \\
\hline
\emph{c\_d} & The momentum exchange coefficient, n/d; if -999, momentum flux is calculated by surface flux scheme \\
\hline
\emph{kwe} & The factor of turbulence enhancement by wave breaking (wave energy factor), n/d (used in boundary conditions of $K-\epsilon$ model) \\
\hline
\emph{relwind} & In momentum flux calculation the currents speed is substracted from wind speed: 1 - on, 0 - off \\
\hline
\emph{eos} & Equation of state: 1 - from Hostetler model (freshwater), 2 - TEOS-2010 (currently not operational), 3 - for Kivu lake (Schmid et al., 2003), 4 - UNESCO formula (freshwater), 5 - McCatcheon et al., 1993  \\
\hline
\emph{lindens} & Switch for using linearized equation of state respective to temperature and salinity: 1 - on, 0 - off \\
\hline
\emph{lindens} & Linear dependency of density on temperature and salinity: 0 - off, 1 - on  \\
\hline
\emph{nmeltpoint} & Melting point: 0 - constant, 0 \celsius, 1 - linearly dependent on salinity,
2 - TEOS-2010 formula \\
\hline
\emph{Turbpar} & Turbulence model: 2 - $K-\epsilon$ closure; 8 - Hendersson-Sellers diffusivity (1985); 9 - Henderson-Sellers diffusivity adopted for shallow lakes \\
\hline
\emph{stabfunc} & Stability function in $K-\epsilon$: 1 - constant coefficients (standard $K-\epsilon$ model); 2 - stability functions according to (Canuto et al., 2001); 3 - stability functions according to (Galperin et al., 1988) \\
\hline
\emph{kepsbc} & Boundary conditions in $K-\epsilon$ model: 1 - Neuman boundary conditions for unstratified sheared flow (Burchard, 2002); 2 -  Neuman boundary conditions for unstratified non-sheared flow with wave breaking; 3 - Neuman boundary conditions for unstratified sheared flow with wave breaking; 4 - Neuman boundary conditions for free convection; 5 - Dirichlet boundary conditions from logarithmic law of the wall \\
\hline
\emph{soiltype} & The soil type: 1 - sand, 2 - loamy sand, 3 - sandy loam, 4 - loam, 5 - silt loam, 6 - sandy clay loam, 7 - clay loam, 8 - silty clay loam, 9 - sandy clay, 10 - silty clay, 11 - clay \\
\hline
\emph{soil\_depth} & The depth of the soil layer, m \\
\hline
\emph{soilswitch} & The switch for soil model: 0 - off, 1 - on \\
\hline
\emph{saltice} & The switch for salinity in ice: 0 - off, 1 - on \\
\hline
\emph{tricemethhydr} & The ice treatment in the soil pores: 0. - treat as pure ice; 1. - treat as methane hydrate \\
\hline
\emph{skin} & The skin temperature parameterization: 0 - off, 1 - on \\
\hline
\emph{massflux} & The massflux parameterization of convection (Siebesma et al., 2007): 0 - off, 1 - on. \\
\hline
\emph{ifrad} & Radiation fluxes at the water surface: 0 - set to zero; 1 - full treatment of surface radiation budget \\
\hline
\emph{ifbubble} & Switch for the bubble model: 0 - off (bubbles do not change with depth); 1 - on \\
\hline
\emph{carbon\_model} & Switch for the carbon model: 1 - Stefan and Fang model; 2 - Hanson et al. model \\
\hline
\emph{sedim} & Gravitational sedimentation of tracer in water: 0 - off, 1 - on \\
\hline
\emph{salsoil} & Switch for salinity transport in soil: 0 - off (zero flux at the bottom), 1 - on \\
\hline
\emph{dyn\_pgrad} & Dynamic pressure gradient: 0 -- off, 1 -- barotropic pressure gradient, 2 -- two-layer approximation for pressure gradient, 3 -- multilayer model for pressure gradient, 4 -- multilayer model for pressure gradient with automatic layer identification, 5 -- river case: pressure gradient is found from Manning's formula, 6 -- pressure gradient is given by constant value after \emph{pgrad} keyword \\
\hline
\emph{pgrad} & Constant longitudinal pressure gradient, N/m$^3$, relevant if \emph{dyn\_pgrad}=6 \\
\hline
\emph{botfric} & The law for friction at the sloping bottom: 0 - no bottom friction, 1 - linear friction, 2 - quadratic friction \\
\hline
\emph{horvisc} & Horizontal viscosity, m$^2$/s, used to damp the 1-st horizontal velocity mode \\
\hline
\hline
\emph{backdiff} & Switch for background diffusivity: 0 -- off, 1 -- background diffusivity by Hondzo and Stefan (1993); 2 -- background diffusivity from KPP model, based in Ri number, 3 -- constant background diffusivity \\
\hline
\emph{backdiff0} & A reference value in background diffusivity, m$^2$/s, expression by Hondzo and Stefan (1993) or KPP model, or a value of constant background diffusivity, relevant if \emph{backdiff}>0; if \emph{backdiff0}$<$0., then the reference values are used \\
\hline
\emph{nManning} & Manning's coefficient, relevant for \emph{dyn\_pgrad}=5 \\
\hline
\emph{zero\_model} & Switch for zero-dimensional model: 0 -off, 1 - on \\
\hline
\emph{thermokarst\_meth\_prod} & Switch for old organics methane production under thermokarst lakes: 1. - on, 0. - off \\
\hline
\emph{soil\_meth\_prod} & Switch for new organics methane production under lakes: 1. - on, 0. - off \\
\hline
\emph{VmaxCH4aeroboxid} & Maximal methane aerobic oxidation rate in Monod equation throughout water column; if \emph{VmaxCH4aeroboxid}$<$0., then a reference value is used\\
\hline
\emph{khsCH4} & Methane half-saturation constant in methane aerobic oxidation rate in Monod equation throughout water column; if \emph{khsCH4}$<$0., then a reference value is used \\
\hline
\emph{khsO2} & Oxygen half-saturation constant in methane aerobic oxidation rate in Monod equation throughout water column; if \emph{khsO2}$<$0., then a reference value is used \\
\hline
\emph{r0methprod} & A constant multiplier in the expression for methane production in sediments; if \emph{r0methprod}$<$0., then a reference value is used \\
\hline
\emph{outflpar} & The treatment of effluent temperature: 0 - value at the outflow = cross-section mean; 1 - the cross-section mean = 0.5*(inflow value + outflow value); 2 - variables at the outflow are calculated using Lagrangian approach \\
\hline
\emph{sensflux0} & Sensible heat flux upwards, constant in time (relevant if PBLpar = 0), $W/m^2$ \\
\hline
\emph{momflux0} & Momentum flux downwards (positive), constant in time (relevant if PBLpar = 0), $N/m^2$ \\
\hline
\emph{soilbotflx} & The constant heat flux at the soil or lake bottom (depending on if soil is switched on or off), $W/m^2$ \\
\hline
\hline
\emph{cuette} & The switch for Cuette flow boundary conditions: 0 - no, 1 - Dirichlet conditions for temperature and velocities at both top and bottom boundaries, 11 - the same as 1, but momentum flux is imposed at the top boundary; \emph{Note!} Other switches for physical parameterizations and initial conditions must be adjusted to the Cuette flow configuration \\
\hline
\emph{deadvol} & Variables at the outflow are calculated using Lagrangian approach \\
\hline

\multicolumn{2}{|c|}{\large{Initial conditions}} \\
\hline
\emph{T\_profile} & Initial temperature (\celsius, col.2), salinity ($kg/kg$, col.3), $CH_4$ ($mol/m^3$, col.4), $CO_2$ ($mol/m^3$, col.5), $O_2$ ($mol/m^3$, col.6) profiles, at depth levels ($m$, col.1); used if \emph{init\_T}=3 \\
\hline
\emph{T\_soilprofile} & Initial soil temperature (\celsius, col.2) profiles, at depth levels ($m$, col.1); used if \emph{init\_T}=3 \\
\hline

\multicolumn{2}{|c|}{\large{Tributaries and effluents}} \\
\hline
\emph{tribheat} & The switch for thermal effect of tributaries and effluents: 0 -- off, 1 -- on, constant inflow vertical profiles, 2 -- on, time-dependent inflow vertical profiles from input ASCII files, 3 -- on, time-dependent vertically-mixed inflow from input ASCII files, 4 -- on, time-dependent vertically-mixed inflow from  the driver (when coupled to land surface model) \\
\hline
\emph{N\_tribin} & The number of tributaries, the next line should be a sequence of \emph{N\_tribin} numbers, from 1 to 4, describing the location of each tributary \\
\hline
\emph{N\_triblev} & The number of levels in tributaries data, relevant if tribheat = 1 or 2 \\
\hline
\emph{iefflloc} & from 1 to 4, the location of an effluent \\
%\hline
%\emph{inflowprof} & The profiles in inflows given at the levels of model grid: tributary width (m), velocity normal to lake's margin, (m/s), temperature (\celsius), salinity (kg/kg), x-component of speed, (m/s), y-component of speed (m/s). This table is given for each tributary (i.e. \emph{N\_tribin} times) one by one without blank lines in between.\\
%\hline
%\emph{outflowprof} & The profiles in outflow given at the levels of model grid: tributary width (m), velocity normal to lake's margin, (m/s) \\
\hline
\emph{fileinflow} & The name of file in \emph{data} folder with time-dependent inflow profiles. Relevant if \emph{tribheat}=2, 3 \\
\hline
\emph{fileoutflow} & The name of file in \emph{data} folder with time-dependent outflow profiles. Relevant if \emph{tribheat}=2, 3 \\
\hline
\emph{dttribupdate} & Time step for profiles update in \emph{fileinflow} and \emph{fileoutflow}, days. Relevant if \emph{tribheat}=2, 3 \\
\hline

\multicolumn{2}{|c|}{\large{Output controls}} \\
\hline
\emph{turb\_out} & Switch for output of turbulence characteristics: 0 - off, 1 - on \\
\hline
\emph{monthly} & Switch for monthly output : 0 - off, 1 - on \\
\hline
\emph{daily} & Switch for daily output : 0 - off, 1 - on \\
\hline
\emph{hourly} & Switch for hourly output : 0 - off, 1 - on \\
\hline
\emph{everystep} & Switch for everystep output : 0 - off, 1 - on \\
\hline
\emph{time\_series} & Switch for time series output : 0 - off, 1 - on \\
\hline
\emph{zserout} & The depth of time series that are written in output (excluding time series at surface, bottom, bulk parameters, etc.), m \\
\hline
\emph{dt\_out} & Time interval for time series output, hours \\
\hline
\emph{nscreen} & The period of screen output, time steps \\
\hline
\emph{scale\_output} & the switch for scaling of output of turbulent characteristics: 0 - off, 1 - on \\
\hline
\emph{accum\_begin} & The date and time for beginning accumulating fluxes \\
\hline
\emph{accum\_end} & The date and time for finishing accumulating fluxes \\
\hline
\emph{ngrid\_out} & the number of output levels for vertical water temperature profiles, the depths of levels (in meters, in respect to water surface) are given below \\
\hline
\emph{ngridice\_out} & the number of output levels for vertical ice temperature profiles, the depths of levels (in meters, in respect to ice surface) are given below \\
\hline
\emph{ngridsoil\_out} & the number of output levels for vertical soil temperature profiles, the depths of levels (in meters, in respect to sediments surface) are given below \\
\hline
\emph{rtemp} & the number of locations for scalars (temperature, CH$_4$, ...) output, followed by triples (x,y,z) of respective coordinates; x and y relative to a lake center, and z measured from the lake top \\
\hline

\end{longtable}

\section{Running the model}
The model is launched by typing in the terminal

\begin{lstlisting}
user@computer:~/LAKE/lake$ ./lake.out
\end{lstlisting}

However, it usually happen that you need to run the model with different configurations (input parameters). In this case we recommend to use the script \emph{launch} in a root folder. To run the model you invoke this script with an argument specifying the experiment label

\begin{lstlisting}
user@computer:~/LAKE/lake$ ./launch <project_name>_<spec>
\end{lstlisting}
for instance

\begin{lstlisting}
user@computer:~/LAKE/lake$ ./launch Valkea-Kotinen2006_base
\end{lstlisting}
This script does the following. It runs the model, the model writes output data to \emph{results/Valkea-Kotinen2006}, then the script creates \emph{results/Valkea-Kotinen2006\_base} and copies there the content of \emph{results/Valkea-Kotinen2006}, \emph{setup/Valkea-Kotinen2006\_setup.dat} and \emph{setup/Valkea-Kotinen2006\_driver.dat}. As a result, both model output and configuration files of an experiment labeled as $base$ are written in a specific directory, so you will not mix them with that from other experiments.  



\section{Model output}
The model output is written in \emph{./results/project\_name} folder. 

\begin{lstlisting}
user@computer:~/LAKE/lake/results/project\_name$ ls
daily  everystep  hourly  monthly  netcdf  time_series
user@computer:~/LAKE/lake/results/project\_name$
\end{lstlisting}

The folders \emph{hourly, daily, monthly} contain vertical profiles
of different variables in a lake, averaged over respective time intervals. Output files in netCDF format are being placed in \emph{netcdf}, and files 
with time series - in \emph{time\_series}. Sometimes, for debugging purposes,
it is advantageous to use the output at every time step of the model's numerical scheme, the respective files residing in \emph{time\_series}.

\end{document}
