% ================================================================
% Chapter Ñ Surface Boundary Condition (SBC) 
% ================================================================
\chapter{Surface Boundary Condition (SBC) }
\label{SBC}
\minitoc

\begin{verbatim}
At the time of this writing, the new surface module 
that is described in this chapter (SBC) is not yet part
of the current distribution. The current way to specify 
the surface boundary condition is such a mess that we 
did not attempt to describe it. Nevertheless, apart from 
the way the surface forcing is implemented, the infor-
mation given here are relevant for a NEMO v2.3 user.
\end{verbatim}

The ocean needs 7 fields as surface boundary condition:

The two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$

The incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$

The surface freshwater budget $\left( {\text{EMP}\;,\;\text{EMP}_S } \right)$

\colorbox {yellow}{ The river runoffs (RUNOFF)}

Four different ways are offered to provide those 7 fields to the ocean: an 
analytical formulation, a flux formulation, a bulk formulae formulation 
(CORE or CLIO bulk formulae) and a coupled formulation (exchanges with a 
atmospheric model via OASIS coupler). In addition, the resulting fields can 
be further modified on used demand via several namelist option. These option 
control the addition of a surface restoring term to observed SST and/or SSS, 
the modification of fluxes below ice-covered area (using observed ice-cover 
or a sea-ice model), the addition of river runoffs as surface freshwater 
fluxes, and the addition of a freshwater flux adjustment on order to avoid a 
mean sea-level drift.

In this chapter we first discuss where the surface boundary condition 
appears in the model equations. Then we present the four ways of providing 
the surface boundary condition. Finally, the different options that modify 
the fluxes inside the ocean are discussed.











% ================================================================
% Surface boundary condition for the ocean
% ================================================================
\section{Surface boundary condition for the ocean}
\label{SBC_general}


The surface ocean stress is the stress exerted by the wind and the sea-ice 
on the ocean. Their two components are assumed to be interpolated on the 
ocean mesh, i.e. provided at U- and V-points and projected onto the 
(\textbf{i},\textbf{j}) referential. They are applied as a surface boundary 
condition of the computation of the momentum vertical mixing trend 
(\textbf{dynzdf} module) :
\begin{equation} \label{Eq_sbc_dynzdf}
\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1}
	 = \frac{1}{\rho _o} \binom{\tau _u}{\tau _v }
\end{equation}
where $(\tau _u ,\;\tau _v )=(utau,vtau)$ are the two components of the wind 
stress vector in the $(\textbf{i},\textbf{j})$ coordinate system.

The surface heat flux is decomposed in two parts, a non solar and solar heat 
fluxes. The former is the non penetrative part of the heat flux (i.e. 
sensible plus latent plus long wave heat fluxes). It is applied as a surface 
boundary condition trend of the first level temperature time evolution 
equation (\mdl{trasbc} module). 
\begin{equation} \label{Eq_sbc_trasbc_q}
\frac{\partial T}{\partial t}\equiv \cdots \;+\;\left. {\frac{Q_{ns} }{\rho 
_o \;C_p \;e_{3T} }} \right|_{k=1} \quad
\end{equation}

The latter is the penetrative part of the heat flux. It is applied as a 3D 
trends of the temperature equation (\mdl{traqsr} module) when \np{ln\_traqsr}=T.

\begin{equation} \label{Eq_sbc_traqsr}
\frac{\partial T}{\partial t}\equiv \cdots \;+\frac{Q_{sr} }{\rho _o C_p 
\,e_{3T} }\delta _k \left[ {I_w } \right]
\end{equation}

where $I_w$ is an adimensional function that describes the way the light 
penetrates inside the water column. It is generally a sum of decreasing 
exponential (see \S\ref{TRA_qsr}).

The surface freshwater budget is provided through two non-necessary 
identical fields EMP and EMP$_S $. Indeed, a surface freshwater 
flux has two effects: it changes the volume of the ocean and it changes the 
surface concentration of salt (an others tracers). Therefore it appears in 
the sea surface height and salinity time evolution equations as a volume 
flux, EMP (\textit{dynspg\_xxx} modules), and concentration/dilution effect, 
EMP$_{S}$ (\mdl{trasbc} module), respectively. 
\begin{equation} \label{Eq_trasbc_emp}
\begin{aligned}
&\frac{\partial \eta }{\partial t}\equiv \cdots \;+\;\text{EMP}\quad  \\ 
\\
 &\frac{\partial S}{\partial t}\equiv \cdots \;+\left. {\frac{\text{EMP}_S \;S}{e_{3T} }} \right|_{k=1} \\ 
 \end{aligned}
\end{equation} 

In the real ocean, EMP=EMP$_S$ and the ocean salt content is conserved, 
but it exist several numerical reason why this equality should be broken. 
For example:

When rigid-lid assumption is made, the ocean volume becomes constant and 
thus, EMP=0, not EMP$_{S }$.

When a sea-ice model is considered, the water exchanged between ice and 
ocean is not fresh as mean ice salinity is $\sim $\textit{4 psu}. In this case, 
EMP$_{S}$ take into account both concentration/dilution effect associated with 
freezing/melting together with salt flux between ice and ocean, while EMP is 
only the volume flux. In addition, in the current version of \NEMO, the 
sea-ice is assumed to be above the ocean. Freezing/melting does not change 
the ocean volume (not impact on EMP) while it modifies the SSS 
\colorbox{yellow}{(see {\S} on LIM sea-ice model)}.

Note that SST can also be modified by a freshwater flux. Precipitations (in 
particular solid one) may have a temperature significantly different from 
the SST. Due to the lack of information about the temperature of 
precipitations, we assume it is equal to the SST. Therefore, no 
concentration/dilution term appears in the temperature equation. It has to 
be emphasised that this absence does not mean that there is not heat flux 
associated with precipitation! An excess of precipitation will change the 
ocean heat content and is therefore associated with a heat flux (not 
diagnosed in the model) \citep{Roullet2000}).

\colorbox{yellow}{Miss: }

A extensive description of all namsbc namelist (parameter that have to be 
created!)

Especially the \np{nf\_sbc}, the \mdl{sbc\_oce} module (fluxes + mean sst sss ssu 
ssv) i.e. information required by flux computation or sea-ice

\colorbox{red}{Add nqsr = 0 / 1 replace key{\_}traqsr}

\mdl{sbc\_oce} containt the definition in memory of the 7 fields (6+runoff), add 
a word on runoff: included in surface bc or add as lateral obc{\ldots}.

Sbcmod manage the ``providing'' (fourniture) to the ocean the 7 fields

Fluxes update only each nf{\_}sbc time step (namsbc) explain relation 
between nf{\_}sbc and nf{\_}ice, do we define nf{\_}blk??? ? only one 
nf{\_}sbc

Explain here all the namlist namsbc variable{\ldots}.

\colorbox{yellow}{End Miss }

The ocean model provides the following variables averaged over nf{\_}sbc 
time-step:

%-------------------------------------------------TABLE---------------------------------------------------
\begin{table}[htbp]  \label{Tab_ssm}
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
Variable desciption					& Computer name	& Units	& point \\	\hline
i-component of the surface current	& ssu\_u	& $m.s^{-1}$	& U \\	\hline
j-component of the surface current	& ssv\_m	& $m.s^{-1}$	& V \\	\hline
Sea surface temperature				& sst\_m	& \r{}$K$		& T \\	\hline
Sea surface salinty					& sss\_m	& $psu$			& T \\	\hline
\end{tabular}
\end{center}
\end{table}
%--------------------------------------------------------------------------------------------------------------

The mean computation is done in sbcmod (

\colorbox{yellow}{Penser a} mettre dans le restant l'info nf{\_}sbc ET nf{\_}sbc*rdt de sorte de 
reinitialiser la moyenne si on change la frequence ou le pdt

NB: creer cn{\_}sbc{\_}ice (cn{\_} = character in the namelist) with 3 
cases:

= `noice' no specific call

= `iceif ` ``ice-if'' sea ice, i.e. read observed ice-cover and modified sbc 
bellow those area.

= `lim' LIM sea-ice model is called which update the sbc fields in ice 
covered area

? modify the nsbc{\_}ice variable depending of this parameter (from --1, 0 
to 1)
\colorbox{yellow}{End Penser a}

% ================================================================
% Analytical formulation (sbcana module) 
% ================================================================
\section{Analytical formulation (\textit{sbcana} module) }
\label{SBC_ana}

%---------------------------------------namtau - namflx--------------------------------------------------
\namdisplay{namtau}
\namdisplay{namflx}
%--------------------------------------------------------------------------------------------------------------


The analytical formulation of the surface boundary condition is set by 
default. In this case, all the 6 fluxes needed by the ocean are assumed to 
be uniform in space. They take constant values given in the namlist 
namsbc{\_}ana : \textit{utau0}, \textit{vtau0}, \textit{qns0}, \textit{qsr0}, \textit{emp0} and \textit{emps0}. while the runoff is set to zero. In addition, 
the wind is allowed to reach its nominal value within a given number of time 
step (\textit{ntau000}).

If a user wants to applied a different analytical forcing, \mdl{sbcana} 
module is the very place to do that. As an example, one can have a look to 
the \mdl{sbc\_ana\_gyre} routine which provides the analytical forcing of the 
GYRE configuration (see GYRE configuration manual, in preparation).


% ================================================================
% Flux formulation 
% ================================================================
\section{Flux formulation (\mdl{sbcflx} module, \key{sbcflx}) }
\label{SBC_flx}

In the flux formulation (\key{sbcflx} defined), the surface boundary 
condition fields are directly read from input files. The user has to define 
in the namelist namsbc{\_}flx the name of the file, the name of the variable 
read in the file, the time frequency at which it is given, and a logical 
setting whether a time interpolation to the model time step is asked are not 
for this field). (fld\_i namelist structure).

\colorbox{yellow}{ Describe the information given?  }

\colorbox{yellow}{  Add an info about on-line interpolation or not ? at with which scale{\ldots} }


\textbf{Caution}: when the frequency is set to --12, the data are monthly 
values. There are assumed to be climatological values, so time interpolation 
between December the 15$^{th}$ and January the 15$^{th}$ is done using 
record 12 and 1

When higher frequency is set and time interpolation is demanded, the model 
will try to read the last (first) record of previous (next) year in a file 
having the same name but a suffix {\_}prev{\_}year (next{\_}year) being 
added. These file must only content a single record. If they don't exist, 
the will assume that the previous year last record is equal to the first 
record of the previous year, and similarly, that the first record of the 
next year is equal to the last record of the current year. This will cause 
the forcing to remain constant over the first and last half fld\_frequ 
hours.

Note that in general, a flux formulation is used in associated with a 
damping term to observed SST and/or SSS. See \S\ref{SBC_ssr} for its 
specification.


% ================================================================
% Bulk formulation
% ================================================================
\section{Bulk formulation (\mdl{sbcblk\_core} or\mdl{sbcblk\_clio} module) }
\label{SBC_blk}

In the bulk formulation, the surface boundary condition fields are computed 
using bulk formulae and atmospheric fields and ocean (and ice) variables. 

The atmospheric fields used depends on the bulk formulae used. Two of them 
are available : the CORE and CLIO bulk formulea. The choice is made by 
activating the CPP key \key{sbcblk\_core} or 
\key{sbcblk\_clio}, respectively.

\colorbox{yellow}{Note : if a sea-ice model is used then blah blah blah{\ldots}}

CORE bulk formulea

The CORE bulk formulae have been developed by \citet{LargeYeager2004}. They 
have been design to handle the CORE forcing, a mixture of NCEP reanalysis 
and satellite data. They use an inertial dissipative method to compute the 
turbulent transfer coefficients (momentum, sensible heat and evaporation) 
from the 10 meter wind speed, air temperature and specific humidity).

The required 8 input fields are:

%--------------------------------------------------TABLE--------------------------------------------------
\begin{table}[htbp]   \label{Tab_CORE}
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
Variable desciption					& Computer name	& Units			& point \\		\hline
i-component of the 10m air velocity	& utau		& $m.s^{-1}$			& T or U \\ 	\hline
j-component of the 10m air velocity	& vtau		& $m.s^{-1}$			& T or V \\	\hline
10m air temperature					& tair		& \r{}$K$				& T 	\\	\hline
Specific humidity					& humi		& \%					& T \\		\hline
Incoming long wave radiation		& qlw		& $W.m^{-2}$			& T \\		\hline
Incoming short wave radiation		& qsr		& $W.m^{-2}$			& T \\		\hline
Total precipitation (liquid + solid)	& precip	& $Kg.m^{-2}.s^{-1}$	& T \\ 	\hline
Solid precipitation					& snow		& $Kg.m^{-2}.s^{-1}$	& T \\	\hline
\end{tabular}
\end{center}
\end{table}
%--------------------------------------------------------------------------------------------------------------

Note that the air velocity can be provided at either tracer ocean point or 
velocity ocean point. 

\colorbox{yellow}{Explain low resolution, better to provide it at U-V, high resolution better}

\colorbox{yellow}{at T-point{\ldots} Explain why, scheme?}

\colorbox{yellow}{Add a namelist parameter to provide a switch from U/V or T (or I??) point}

\colorbox{yellow}{ for utau/vtau}

CLIO bulk formulea

The CLIO bulk formulae have been developed several years ago for the 
Louvain-la-neuve coupled ice-ocean model (CLIO, Goosse et al. 1997). It is a 
simpler bulk formulae that assumed the stress to be known and computes the 
radiative fluxes from a climatological cloud cover. 

The required 7 input fields are:

%--------------------------------------------------TABLE--------------------------------------------------
\begin{table}[htbp]   \label{Tab_CLIO}
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
Variable desciption				& Computer name	& Units					& point \\	\hline
i-component of the ocean stress		& utau			& $N.m^{-2}$			& U \\	\hline
j-component of the ocean stress		& vtau			& $N.m^{-2}$			& V \\	\hline
Wind speed module					& vatm			& $m.s^{-1}$			& T \\	\hline
10m air temperature					& tair			& \r{}$K$				& T \\	\hline
Secific humidity						& humi			& \%					& T \\	\hline
Cloud cover							& 				& \%					& T \\	\hline
Total precipitation (liquid + solid)	& precip		& $Kg.m^{-2}.s^{-1}$	& T \\	\hline
Solid precipitation 					& snow			& $Kg.m^{-2}.s^{-1}$	& T \\	\hline
\end{tabular}
\end{center}
\end{table}
%--------------------------------------------------------------------------------------------------------------

As for the flux formulation, the input data information required by the 
model is provided in the namsbc\_blk\_core or namsbc\_blk\_clio 
namelist (via the structure fld\_i). The same assumption is made about the 
value of the first and last record in each file.


% ================================================================
% Coupled formulation
% ================================================================
\section{Coupled formulation (\mdl{sbccpl} module)}
\label{SBC_cpl}

In the coupled formulation of the surface boundary condition, the fluxes are 
provided by the OASIS coupler at each \np{nf\_cpl} time-step, while sea and ice 
surface temperature, ocean and ice albedo, and ocean currents are sent to 
the atmospheric component.


% ================================================================
% Miscellanea options
% ================================================================
\section{Miscellanea options}
\label{SBC_misc}

% -------------------------------------------------------------------------------------------------------------
%        Surface restoring to observed SST and/or SSS
% -------------------------------------------------------------------------------------------------------------
\subsection{Surface restoring to observed SST and/or SSS (\mdl{sbcssr})}
\label{SBC_ssr}

In forced mode using flux formulation (default option or \key{flx} defined), a 
feedback term \emph{must} be added to the specified surface heat flux $Q_{ns}^o$:
\begin{equation} \label{Eq_sbc_dmp_q}
Q_{ns} = Q_{ns}^o + \frac{dQ}{dT} \left( \left. T \right|_{k=1} - SST_{Obs} \right)
\end{equation}
where SST is a sea surface temperature field (observed or climatological), $T$ is 
the model surface layer temperature and $\frac{dQ}{dT}$ is a negative feedback 
coefficient usually taken equal to $-40~W.m^{-2}.$\r{}K$^{-1}$. For a $50~m$ mixed-layer depth, 
this value corresponds to a relaxation time scale of two months. This term 
ensures that if $T$ perfectly fits SST then $Q$ is equal to $Q_o$. 

In the fresh water budget, a feedback term can also be added:

\begin{equation} \label{Eq_sbc_dmp_emp}
EMP = EMP_o +\gamma_s^{-1} \left(S-SSS_{Obs}\right)\left|S\right.
\end{equation}

where EMP$_{o }$ is a net surface fresh water flux (observed, climatological or 
atmospheric model product), \textit{SSS}$_{Obs}$is a sea surface salinity (usually a time 
interpolation of the monthly mean PHC climatology \citep{Steele2001}, $S$ is the model 
surface layer salinity and $\gamma_s$ is a negative feedback coefficient 
which is provided as a namelist parameter. Unlike heat flux, there is no 
physical justification for the feedback term in (III.4.4) as the atmosphere 
does not care about ocean surface salinity \citep{Madec1997}. The 
SSS restoring term can only be view as a flux correction on freshwater 
fluxes to reduce the uncertainties we have on the observed freshwater 
budget.

% -------------------------------------------------------------------------------------------------------------
%        Handling of ice-covered area
% -------------------------------------------------------------------------------------------------------------
\subsection{Handling of ice-covered area}
\label{SBC_ice-cover}
The presence of sea-ice at the top of the ocean 
strongly modify the surface fluxes

The presence at the sea surface of an ice cover area modified all the fluxes 
transmitted to the ocean. There is two cases whereas a sea-ice model is used 
or not. 

Without sea ice model, the information of ice-cover / open ocean is read in 
a file (either the directly the ice-cover or the observed SST from which 
ice-cover is deduced using a criteria on freezing point temperature). 

% -------------------------------------------------------------------------------------------------------------
%        Addition of river runoffs
% -------------------------------------------------------------------------------------------------------------
\subsection{Addition of river runoffs (\mdl{sbcrnf})}
\label{SBC_rnf}

It is convenient to introduce the river runoff in the model as a surface 
fresh water fluxes. \colorbox{yellow}{{\ldots} blah blah{\ldots}.}

\colorbox{yellow}{Nevertheless, Pb of vertical resolution and increase of Kz in vicinity of }

\colorbox{yellow}{river mouths{\ldots}}

Control of the mean sea level

% -------------------------------------------------------------------------------------------------------------
%        Addition of river runoffs
% -------------------------------------------------------------------------------------------------------------
\subsection{Freshwater budget control (\mdl{sbcfwb})}
\label{SBC_fwb}
%--------------------------------------------namfwb--------------------------------------------------------
\namdisplay{namfwb}
%--------------------------------------------------------------------------------------------------------------

\colorbox{yellow}{freshwater budget correction{\ldots}}




