Index: trunk/DOC/TexFiles/Namelist/nam_sbc_tot
===================================================================
 trunk/DOC/BETA/Namelist/nam_sbc_tot (revision 781)
+++ (revision )
@@ 1,42 +1,0 @@
!
&namtau ! surface wind stress
!
 ntau000 = 0 ! gently increase the stress over the first ntau_rst timesteps
 tau0x = 0.e0 ! uniform value used as default surface heat flux
 tau0y = 0.e0 ! uniform value used as default solar radiation flux
/
!
&namflx ! surface fluxes
!
 q0 = 0.e0 ! uniform value used as default surface heat flux
 qsr0 = 0.e0 ! uniform value used as default solar radiation flux
 emp0 = 0.e0 ! uniform value used as default surface freswater budget (EP)
 dqdt0 = 40. ! feedback coefficient for SST damping (W/m2/K)
 deds0 = 0. ! feedback coefficient for SSS damping (mm/day)
/
!
&namqsr ! penetrative solar radiation
!
 ln_traqsr = .true. ! penetrative solar radiation (T) or not (F)
 rabs = 0.58 ! fraction of qsr associated with xsi1
 xsi1 = 0.35 ! first depth of extinction
 xsi2 = 23.0 ! second depth of extinction
/
!
&namfwb ! freshwater budget correction
!
 ln_fwb = .true. ! flag for freshwater budget correction (0 annual mean)
/
!
&namalb ! albedo parameters
!
 cgren = 0.06 ! correction of the snow or ice albedo to take into account
 albice = 0.5 ! albedo of melting ice in the arctic and antarctic
 alphd = 0.80 ! coefficients for linear interpolation used to
 alphc = 0.65 ! compute albedo between two extremes values
 alphdi = 0.72 ! (Pyane, 1972)
/
!
&namcpl ! coupled ocean/atmosphere model ("key_coupled")
!
/
Index: trunk/DOC/TexFiles/Namelist/namalb
===================================================================
 trunk/DOC/BETA/Namelist/namalb (revision 781)
+++ (revision )
@@ 1,9 +1,0 @@
!
&namalb ! albedo parameters
!
 cgren = 0.06 ! correction of the snow or ice albedo
 albice = 0.5 ! albedo of melting ice
 alphd = 0.80 ! coefficients for linear interpolation used to
 alphc = 0.65 ! compute albedo between two extremes values
 alphdi = 0.72 ! (Pyane, 1972)
/
Index: trunk/DOC/TexFiles/Namelist/namflx
===================================================================
 trunk/DOC/BETA/Namelist/namflx (revision 781)
+++ (revision )
@@ 1,9 +1,0 @@
!
&namflx ! surface fluxes
!
 q0 = 0.e0 ! uniform value used as default surface heat flux
 qsr0 = 0.e0 ! uniform value used as default solar radiation flux
 emp0 = 0.e0 ! uniform value used as default surface freswater budget (EP)
 dqdt0 = 40. ! feedback coefficient for SST damping (W/m2/K)
 deds0 = 0. ! feedback coefficient for SSS damping (mm/day)
/
Index: trunk/DOC/TexFiles/Namelist/namtau
===================================================================
 trunk/DOC/BETA/Namelist/namtau (revision 781)
+++ (revision )
@@ 1,7 +1,0 @@
!
&namtau ! surface wind stress
!
 ntau000 = 0 ! gently increase the stress over the first ntau_rst timesteps
 tau0x = 0.e0 ! uniform value used as default surface heat flux
 tau0y = 0.e0 ! uniform value used as default solar radiation flux
/
Index: trunk/DOC/TexFiles/Biblio/Biblio.bib
===================================================================
 trunk/DOC/BETA/Biblio/Biblio.bib (revision 781)
+++ trunk/DOC/TexFiles/Biblio/Biblio.bib (revision 994)
@@ 85,4 +85,15 @@
@STRING{Tellus = {Tellus}}
+
+@ARTICLE{Adcroft_Campin_OM04,
+ author = {A. Adcroft and J.M. Campin},
+ title = {Rescaled height coordinates for accurate representation of freesurface
+ flows in ocean circulation models},
+ journal = {Ocean Modelling},
+ year = {2004},
+ volume = {7},
+ owner = {gm},
+ timestamp = {2008.01.27}
+}
@ARTICLE{Arakawa1966,
@@ 154,12 +165,12 @@
@ARTICLE{Arhan2006,
 author = {M. Arhan and A.M. Treguier and B. Bourles and S. Michel},
 year = { 2006 },
 title = {Diagnosing the annual cycle of the Equatorial Undercurrent in the Atlantic Ocean from a general circulation model},
 journal = JPO,
 volume = { 36},
+ author = {M. Arhan and A.M. Treguier and B. Bourles and S. Michel},
+ title = {Diagnosing the annual cycle of the Equatorial Undercurrent in the
+ Atlantic Ocean from a general circulation model},
+ journal = JPO,
+ year = {2006},
+ volume = { 36},
pages = {15021522}
}

@ARTICLE{ASSELIN1972,
@@ 185,4 +196,41 @@
owner = {gm},
timestamp = {2007.08.03}
+}
+
+@ARTICLE{Barnier_al_OD06,
+ author = {B. Barnier and G. Madec and T. Penduff and J.M. Molines and A.M.
+ Treguier and J. Le Sommer and A. Beckmann and A. Biastoch and C.
+ Boning and J. Dengg and C. Derval and E. Durand and S. Gulev and
+ E. Remy and C. Talandier and S. Theetten and M. Maltrud and J. McClean
+ and B. De Cuevas},
+ title = {Impact of partial steps and momentum advection schemes in a global
+ ocean circulation model at eddypermitting resolution.},
+ journal = {Ocean Dyn.},
+ year = {2006},
+ pages = {doi: 10.1007/s1023600600821.},
+ owner = {gm},
+ timestamp = {2008.01.25}
+}
+
+@INCOLLECTION{Barnier1996,
+ author = {B. Barnier and P. Marchesiello and A.P. de Miranda},
+ title = {Modeling the ocean circulation in the South Atlantic: A strategy
+ for dealing with open boundaries},
+ booktitle = {The South Atlantic: Present and Past Circulation},
+ publisher = {SpringerVerlag, Berlin},
+ year = {1996},
+ editor = {G.Wefer and W.H. Berger and G Siedler and D. Webb},
+ pages = {289304}
+}
+
+@ARTICLE{Barnier1998,
+ author = {B. Barnier and P. Marchesiello and A. P. de Miranda and J.M. Molines
+ and M. Coulibaly},
+ title = {A sigmacoordinate primitive equation model for studying the circulation
+ in the South Atlantic I, Model configuration with error estimates},
+ journal = {Deep Sea Res.},
+ year = {1998},
+ volume = {45},
+ pages = {543572}
}
@@ 256,4 +304,16 @@
}
+@ARTICLE{Blanke_al_JPO99,
+ author = {B. Blanke and M. Arhan and G. Madec and S. Roche},
+ title = {Warm Water Paths in the Equatorial Atlantic as Diagnosed with a General
+ Circulation Model},
+ journal = JPO,
+ year = {1999},
+ volume = {29, 11},
+ pages = {27532768},
+ owner = {gm},
+ timestamp = {2008.05.27}
+}
+
@ARTICLE{Blanke1993,
author = {B. Blanke and P. Delecluse},
@@ 334,4 +394,26 @@
predictability.},
pdf = {Blanke_etal_JC97.pdf}
+}
+
+@ARTICLE{Blanke_Raynaud_JPO97,
+ author = {B. Blanke and S. Raynaud},
+ title = {Kinematics of the Pacific Equatorial Undercurrent: An Eulerian and
+ Lagrangian Approach from GCM Results},
+ journal = JPO,
+ year = {1997},
+ volume = {27, 6},
+ pages = {10381053},
+ owner = {gm},
+ timestamp = {2008.05.27}
+}
+
+@ARTICLE{Blayo2005,
+ author = {E. Blayo and L. Debreu},
+ title = {Revisiting open boundary conditions from the point of view of characteristic
+ variables},
+ journal = {Ocean Modelling},
+ year = {2005},
+ volume = {9},
+ pages = {231252}
}
@@ 429,4 +511,16 @@
}
+@ARTICLE{Campin_Goosse_Tel99,
+ author = {J. M. Campin and H. Goosse},
+ title = {Parameterization of densitydriven downsloping flow for a coarseresolution
+ ocean model in zcoordinate},
+ journal = {Tellus},
+ year = {1999},
+ volume = {51},
+ pages = {412430},
+ owner = {gm},
+ timestamp = {2008.01.20}
+}
+
@ARTICLE{Cox1987,
author = {M. Cox},
@@ 435,7 +529,43 @@
year = {1987},
volume = {74},
 pages = {15},
+ pages = {19},
owner = {gm},
timestamp = {2007.08.03}
+}
+
+@ARTICLE{Dorscher_Beckmann_JAOT00,
+ author = {R. D\"{o}scher and A. Beckmann},
+ title = {Effects of a Bottom Boundary Layer Parameterization in a CoarseResolution
+ Model of the North Atlantic Ocean},
+ journal = JAOT,
+ year = {2000},
+ volume = {17},
+ pages = {698707},
+ owner = {gm},
+ timestamp = {2008.01.23}
+}
+
+@ARTICLE{Debreu_al_CG2008,
+ author = {L. Debreu and C. Vouland and E. Blayo},
+ title = {AGRIF: Adaptive Grid Refinement In Fortran},
+ journal = {Computers and Geosciences},
+ year = {2008},
+ volume = {34},
+ pages = {813},
+ owner = {gm},
+ timestamp = {2008.02.03}
+}
+
+@ARTICLE{Delecluse_Madec_Bk00,
+ author = {P. Delecluse and G. Madec},
+ title = {Ocean modelling and the role of the ocean in the climate system},
+ journal = {In \textit{Modeling the Earth's Climate and its Variability}, Les
+ Houches, Session, LXVII 1997,
+
+ Eds. W. R. Holland, S. Joussaume and F. David, Elsevier Science,},
+ year = {2000},
+ pages = {237313},
+ owner = {gm},
+ timestamp = {2008.02.03}
}
@@ 449,4 +579,13 @@
owner = {gm},
timestamp = {2007.08.03}
+}
+
+@INCOLLECTION{Durran2001,
+ author = {D.R. Durran },
+ title = {Open boundary conditions: fact and fiction},
+ booktitle = {Advances in Mathematical Modelling of Atmosphere and Ocean Dynamics},
+ publisher = {Kluwer Academic Publishers},
+ year = {2001},
+ editor = {P.F. Hodnett}
}
@@ 621,4 +760,13 @@
}
+@TECHREPORT{Gibson_TR86,
+ author = {J. K. Gibson},
+ title = {Standard software development and maintenance},
+ institution = {Operational Dep., ECMWF, Reading, UK.},
+ year = {1986},
+ owner = {gm},
+ timestamp = {2008.02.03}
+}
+
@BOOK{Gill1982,
title = {AtmosphereOcean Dynamics},
@@ 626,4 +774,16 @@
year = {1982},
author = {A. E. Gill}
+}
+
+@ARTICLE{Goosse_al_JGR99,
+ author = {H. Goosse and E. Deleersnijder and T. Fichefet and M. England},
+ title = {Sensitivity of a global coupled oceansea ice model to the parameterization
+ of vertical mixing},
+ journal = JGR,
+ year = {1999},
+ volume = {104},
+ pages = {13,68113,695},
+ owner = {gm},
+ timestamp = {2008.05.27}
}
@@ 769,4 +929,27 @@
}
+@ARTICLE{Guyon_al_EP99,
+ author = {M. Guyon and G. Madec and F.X. Roux and M. Imbard},
+ title = {A Parallel ocean model for high resolution studies},
+ journal = {Lecture Notes in Computer Science},
+ year = {1999},
+ volume = {EuroPar'99},
+ pages = {603607},
+ owner = {gm},
+ timestamp = {2008.05.27}
+}
+
+@ARTICLE{Guyon_al_CalPar99,
+ author = {M. Guyon and G. Madec and F.X. Roux and M. Imbard and C. Herbaut
+ and P. Fronier},
+ title = {Parallelization of the OPA ocean model},
+ journal = {Calculateurs Paralleles},
+ year = {1999},
+ volume = {11, 4},
+ pages = {499517},
+ owner = {gm},
+ timestamp = {2008.05.27}
+}
+
@BOOK{Haltiner1980,
title = {Numerical prediction and dynamic meteorology},
@@ 883,4 +1066,13 @@
}
+@ARTICLE{Killworth1992,
+ author = {P. D. Killworth},
+ title = {An equivalentbarotropic mode in the fine resolution Antarctic model},
+ journal = JPO,
+ year = {1992},
+ volume = {22},
+ pages = {13791387}
+}
+
@ARTICLE{Killworth1991,
author = {Killworth, P. D. and Stainforth, D. and Webb, D. J. and Paterson,
@@ 909,14 +1101,4 @@
timestamp = {2007.08.03}
}

@ARTICLE{Killworth1992,
 author = {P. D. Killworth},
 year = {1992},
 title = {An equivalentbarotropic mode in the fine resolution Antarctic model},
 journal = JPO,
 volume = {22},
 pages = {13791387}
}.

@ARTICLE{Kolmogorov1942,
@@ 1043,4 +1225,16 @@
}
+@ARTICLE{Lengaigne_al_JGR03,
+ author = {M. Lengaigne and G. Madec and G. Alory and C. Menkes},
+ title = {Sensitivity of the tropical Pacific Ocean to isopycnal diffusion
+ on tracer and dynamics},
+ journal = JGR,
+ year = {2003},
+ volume = {108 (C11)},
+ pages = {3345, doi:10.1029/2002JC001704},
+ owner = {gm},
+ timestamp = {2008.01.26}
+}
+
@ARTICLE{Leonard1991,
author = {B. P. Leonard},
@@ 1121,5 +1315,5 @@
title = {La formation d'eau profonde et son impact sur la circulation r\'{e}gionale
en M\'{e}diterran\'{e}e Occidentale  une approche num\'{e}rique},
 school = {Universit\'{e}Pierre et Marie Curie, Paris, France, 194pp.},
+ school = {Universit\'{e}Pierre et Marie Curie, Paris, France, 194pp.},
year = {1990},
owner = {gm},
@@ 1254,4 +1448,14 @@
}
+@ARTICLE{Marchesiello2001,
+ author = { P. Marchesiello and J. Mc Williams and A. Shchepetkin },
+ title = {Open boundary conditions for longterm integrations of Regional Oceanic
+ Models},
+ journal = {Ocean Modelling},
+ year = {2001},
+ volume = {3},
+ pages = {120}
+}
+
@PHDTHESIS{MartiTh1992,
author = {O. Marti},
@@ 1314,4 +1518,16 @@
}
+@ARTICLE{McDougall_Taylor_JMR84,
+ author = {T. J. McDougall and J. R. Taylor},
+ title = {Flux measurements across a finger interface at low values of the
+ stability ratio},
+ journal = {Journal of Marine Research},
+ year = {1984},
+ volume = {42},
+ pages = {114},
+ owner = {gm},
+ timestamp = {2008.05.20}
+}
+
@ARTICLE{Merryfield1999,
author = {W. J. Merryfield and G. Holloway and A. E. Gargett},
@@ 1336,4 +1552,13 @@
owner = {gm},
timestamp = {2007.08.06}
+}
+
+@BOOK{Mesinger_Arakawa_Bk76,
+ title = {Numerical methods used in Atmospheric models},
+ publisher = {GARP Publication Series No 17},
+ year = {1976},
+ author = {F. Mesinger and A. Arakawa},
+ owner = {gm},
+ timestamp = {2008.02.09}
}
@@ 1387,4 +1612,18 @@
owner = {gm},
timestamp = {2007.08.03}
+}
+
+@ARTICLE{Pacanowski_Gnanadesikan_MWR98,
+ author = {R. C. Pacanowski and A. Gnanadesikan},
+ title = {Transient response in a zlevel ocean model that resolves topography
+
+
+ with partialcells},
+ journal = MWR,
+ year = {1998},
+ volume = {126},
+ pages = {32483270},
+ owner = {gm},
+ timestamp = {2008.01.26}
}
@@ 1422,6 +1661,27 @@
}
+@ARTICLE{Penduff2000,
+ author = {T. Penduff and B. Barnier and A. Colin de Verdi\`{e}re},
+ title = { Selfadapting open boundaries for a regional model of the eastern
+ North Atlantic},
+ journal = JGR,
+ year = {2000},
+ volume = {105},
+ pages = {11,27911,297}
+}
+
+@ARTICLE{Penduff2007,
+ author = {T. Penduff and J. Le Sommer and B. Barnier and A.M. Treguier and
+ J. Molines and G. Madec},
+ title = {Influence of numerical schemes on currenttopography interactions
+ in 1/4$^{\circ}$ global ocean simulations},
+ journal = {Ocean Science},
+ year = {2007},
+ volume = {?},
+ pages = {in revision}
+}
+
@ARTICLE{Phillips1959,
 author = {R. S. Phillips},
+ author = {R. S. Phillips},
title = {Dissipative Operators and Hyperbolic Systems of Partial Differential
Equations},
@@ 1433,4 +1693,15 @@
owner = {gm},
timestamp = {2007.08.10}
+}
+
+@ARTICLE{Redi_JPO82,
+ author = {M. H. Redi},
+ title = {Oceanic isopycnal mixing by coordinate rotation},
+ journal = JPO,
+ year = {1982},
+ volume = {13},
+ pages = {11541158},
+ owner = {gm},
+ timestamp = {2008.02.02}
}
@@ 1466,4 +1737,13 @@
owner = {gm},
timestamp = {2007.08.04}
+}
+
+@INCOLLECTION{Roed1986,
+ author = {L.P. Roed and C.K. Cooper},
+ title = {Open boundary conditions in numerical ocean models},
+ booktitle = {Advanced Physical Oceanography Numerical Modelling},
+ publisher = { NATO ASI Series, vol. 186.},
+ year = {1986},
+ editor = {J.J. O'Brien}
}
@@ 1804,12 +2084,25 @@
timestamp = {2007.08.05}
}

+
@ARTICLE{Treguier1992,
 author = {A.M. Treguier},
 year = { 1992},
 title = {Kinetic energy analysis of an eddy resolving, primitive equation North Atlantic model},
 journal = JGR,
 volume = {97},
+ author = {A.M. Tr\'{e}guier},
+ title = {Kinetic energy analysis of an eddy resolving, primitive equation
+ North Atlantic model},
+ journal = JGR,
+ year = {1992},
+ volume = {97},
pages = {687701}
+}
+
+@ARTICLE{Treguier2001,
+ author = {A.M Tr\'{e}guier and B. Barnier and A.P. de Miranda and J.M. Molines
+ and N. Grima and M. Imbard and G. Madec and C. Messager and T. Reynaud
+ and S. Michel},
+ title = {An Eddy Permitting model of the Atlantic circulation: evaluating
+ open boundary conditions},
+ journal = JGR,
+ year = {2001},
+ volume = {106},
+ pages = {2211522129}
}
@@ 1970,99 +2263,4 @@
month = jul,
owner = {gm}
}

@ARTICLE{Marchesiello2001,
 author = { P. Marchesiello and J. Mc Williams and A. Shchepetkin },
 title = {Open boundary conditions for longterm integrations of Regional Oceanic Models},
 journal = {Ocean Modelling},
 year = {2001},
 volume = {3},
 pages = {120}
}

@INCOLLECTION{Durran2001,
 author = {D.R. Durran },
 title = {Open boundary conditions: fact and fiction},
 booktitle = {Advances in Mathematical Modelling of Atmosphere and Ocean Dynamics},
 year = {2001},
 editor = {P.F. Hodnett},
 publisher = {Kluwer Academic Publishers}
}

@ARTICLE{Treguier2001,
 author = {A.M Treguier and B. Barnier and A.P. de Miranda and J.M. Molines and N. Grima and M. Imbard and G. Madec and C. Messager and T. Reynaud and S. Michel},
 title = {An Eddy Permitting model of the Atlantic circulation: evaluating open boundary conditions},
 journal = JGR,
 year = {2001},
 volume = {106},
 pages = {2211522129}
}

@ARTICLE{Blayo2005,
 author = {E. Blayo and L. Debreu},
 title = {Revisiting open boundary conditions from the point of view of characteristic variables},
 journal = {Ocean Modelling},
 year = {2005},
 volume = {9},
 pages = {231252}
}

@ARTICLE{Barnier1998,
 author = {B. Barnier and P. Marchesiello and A. P. de Miranda and J.M. Molines and M. Coulibaly},
 title = {A sigmacoordinate primitive equation model for studying the circulation in the South Atlantic I, Model configuration with error estimates},
 journal = {Deep Sea Res.},
 volume = {45},
 pages = {543572},
 year = {1998}
}

@ARTICLE{Penduff2000,
 author = {T. Penduff and B. Barnier and A. Colin de Verdi\`{e}re},
 title = { Selfadapting open boundaries for a regional model of the eastern North Atlantic},
 journal = JGR,
 volume = {105},
 pages = {11,27911,297},
 year = {2000}
}

@ARTICLE{Penduff2007,
 author = {T. Penduff and J. Le Sommer and B. Barnier and A.M. Treguier and J. Molines and G. Madec},
 title = {Influence of numerical schemes on currenttopography interactions in 1/4$^{\circ}$ global ocean simulations},
 journal = {Ocean Science},
 volume = {?},
 pages = {in revision},
 year = {2007}
}


@INCOLLECTION{Barnier1996,
 author = { B. Barnier and P. Marchesiello and A.P. de Miranda },
 title = {Modeling the ocean circulation in the South Atlantic : A strategy for dealing with open boundaries},
 booktitle = {The South Atlantic : Present and Past Circulation},
 editor = {G.Wefer and W.H. Berger and G Siedler and D. Webb},
 publisher ={SpringerVerlag, Berlin},
 pages = {289304},
 year = {1996}
}

@INCOLLECTION{Roed1986,
 author = {L.P. Roed and C.K. Cooper},
 year = {1986},
 title = {Open boundary conditions in numerical ocean models},
 booktitle = {Advanced Physical Oceanography Numerical Modelling},
 editor = {J.J. O'Brien},
 publisher = { NATO ASI Series, vol. 186.}
}


@INCOLLECTION{Delecluse2000,
 author = {P. Delecluse},
 title = {Ocean modelling and the role of the ocean in the climate system},
 pages = {237313},
 booktitle = {Modeling the Earth's Climate and its Variability, Les Houches, 1997},
 year = {2000},
 editor = {W. R. Holland and S. Joussaume and F. David},
 owner = {gm},
 timestamp = {2007.08.17}
}
Index: trunk/DOC/TexFiles/Chapters/Abstracts_Foreword.tex
===================================================================
 trunk/DOC/BETA/Chapters/Abstracts_Foreword.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Abstracts_Foreword.tex (revision 994)
@@ 9,10 +9,10 @@
\small{
The ocean engine of NEMO is a primitive equation model adapted to regional and global ocean circulation. It is intended to be a flexible tool for studying the ocean and its interactions with the others components of the earth climate system (atmosphere, seaice, biogeochemical tracers, ...) over a wide range of space and time scales. Prognostic variables are the threedimensional velocity field, the sea surface height, the temperature and the salinity. In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, a z full or partial step coordinate, or scoordinate, or a mixture of the two. The distribution of variables is a threedimensional Arakawa Ctype grid. Various physical choices are available to describe ocean physics, including TKE and KPP turbulent closures for the vertical mixing. Within NEMO, the ocean is interfaced with a seaice model (LIM), passive tracer and biogeochemical models (TOP) and, via the OASIS coupler, with several atmospheric general circulation models.
+The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive equation model adapted to regional and global ocean circulation problems. It is intended to be a flexible tool for studying the ocean and its interactions with the others components of the earth climate system (atmosphere, seaice, biogeochemical tracers, ...) over a wide range of space and time scales. Prognostic variables are the threedimensional velocity field, a linear or nonlinear sea surface height, the temperature and the salinity. In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, a full or partial step $z$coordinate, or $s$coordinate, or a mixture of the two. The distribution of variables is a threedimensional Arakawa Ctype grid. Various physical choices are available to describe ocean physics, including TKE and KPP vertical physics. Within NEMO, the ocean is interfaced with a seaice model (LIM), passive tracer and biogeochemical models (TOP) and, via the OASIS coupler, with several atmospheric general circulation models.
% ================================================================
 \vspace{0.25cm}
+ \vspace{0.5cm}
Le moteur oc\'{e}anique de NEMO est un mod\`{e}le aux \'{e}quations primitives de la circulation oc\'{e}anique r\'{e}gionale et globale. Il se veut un outil flexible pour \'{e}tudier sur un vaste spectre spatiotemporel l'oc\'{e}an et ses interactions avec les autres composantes du syst\`{e}me climatique terrestre (atmosph\`{e}re, glace de mer, traceurs biog\'{e}ochimiques...). Les variables pronostiques sont le champ tridimensionnel de vitesse, la hauteur de la mer, la temperature et la salinit\'{e}. La distribution des variables se fait sur une grille C d'Arakawa tridimensionnelle utilisant une coordonn\'{e}e verticale z \`{a} niveaux entiers ou partiels, ou une coordonn\'{e}e s, ou encore une combinaison des deux. Diff\'{e}rents choix sont propos\'{e}s pour d\'{e}crire la physique oc\'{e}anique, incluant notamment une fermeture turbulente TKE et KPP pour le m\'{e}lange vertical. Via l'infrastructure NEMO, l'oc\'{e}an est interfac\'{e} avec un mod\`{e}le de glace de mer, des mod\`{e}les biog\'{e}ochimiques et de traceur passif, et, via le coupleur OASIS, \`{a} plusieurs mod\`{e}les de circulation g\'{e}n\'{e}rale atmosph\'{e}rique.
+Le moteur oc\'{e}anique de NEMO (Nucleus for European Modelling of the Ocean) est un mod\`{e}le aux \'{e}quations primitives de la circulation oc\'{e}anique r\'{e}gionale et globale. Il se veut un outil flexible pour \'{e}tudier sur un vaste spectre spatiotemporel l'oc\'{e}an et ses interactions avec les autres composantes du syst\`{e}me climatique terrestre (atmosph\`{e}re, glace de mer, traceurs biog\'{e}ochimiques...). Les variables pronostiques sont le champ tridimensionnel de vitesse, une hauteur de la mer lin\'{e}aire ou non, la temperature et la salinit\'{e}. La distribution des variables se fait sur une grille C d'Arakawa tridimensionnelle utilisant une coordonn\'{e}e verticale $z$ \`{a} niveaux entiers ou partiels, ou une coordonn\'{e}e s, ou encore une combinaison des deux. Diff\'{e}rents choix sont propos\'{e}s pour d\'{e}crire la physique oc\'{e}anique, incluant notamment des physiques verticales TKE et KPP . A travers l'infrastructure NEMO, l'oc\'{e}an est interfac\'{e} avec un mod\`{e}le de glace de mer, des mod\`{e}les biog\'{e}ochimiques et de traceur passif, et, via le coupleur OASIS, \`{a} plusieurs mod\`{e}les de circulation g\'{e}n\'{e}rale atmosph\'{e}rique.
}
@@ 22,10 +22,15 @@
\chapter*{Disclaimer}
OPA (an acronym for Ocean PArall\'{e}lis\'{e}) is the ocean component of NEMO (Nucleus for European Modelling of the Ocean (www.loceanipsl.upmc.fr/NEMO). Like all components of NEMO, it is developed under the CECILL license, which is a french adaptation of the GNU GPL (General Public license). Anyone may use OPA freely for research purposes, and is encouraged to communicate back to the NEMO team its own developments and improvements. The model and the present document have been made available as a service to the community. We cannot certify that the code and its manual are free of errors. Bugs are inevitable and some have undoubtedly survived the testing phase. Users are encouraged to bring them to our attention. The author assumes no responsibility for problems, errors, or incorrect usage of OPA.
+Like all components of NEMO, the ocean component is developed under the CECILL license, which is a French adaptation of the GNU GPL (General Public License). Anyone may use it freely for research purposes, and is encouraged to communicate back to the NEMO team its own developments and improvements. The model and the present document have been made available as a service to the community. We cannot certify that the code and its manual are free of errors. Bugs are inevitable and some have undoubtedly survived the testing phase. Users are encouraged to bring them to our attention. The author assumes no responsibility for problems, errors, or incorrect usage of NEMO.
\vspace{1cm}
The OPA OGCM reference in papers and other publications is as follows:
+NEMO reference in papers and other publications is as follows:
\vspace{0.5cm}
Madec, G., 2007: NEMO ocean engine. \textit{Note du P\^ole de mod\'{e}lisation}, Institut PierreSimon Laplace (IPSL), France, NXX, \colorbox{yellow}{YYpp}.\\
+Madec, G., 2008: NEMO ocean engine. \textit{Note du P\^ole de mod\'{e}lisation}, Institut PierreSimon Laplace (IPSL), France, No 27, ISSN No 12881619.\\
+
+ \vspace{0.5cm}
+Additional information can be found on www.loceanipsl.upmc.fr/NEMO
+ \vspace{0.5cm}
+
Index: trunk/DOC/TexFiles/Chapters/Annex_A.tex
===================================================================
 trunk/DOC/BETA/Chapters/Annex_A.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Annex_A.tex (revision 994)
@@ 3,79 +3,87 @@
% Chapter Ñ Appendix A : Curvilinear sCoordinate Equations
% ================================================================
\chapter{Appendix A : Curvilinear $s$Coordinate Equations}
+\chapter{Curvilinear $s$Coordinate Equations}
\label{Apdx_A}
\minitoc
In order to establish the set of Primitive Equation in curvilinear
$s$coordinates (i.e. orthogonal curvilinear coordinates in the horizontal and
$s$coordinates in the vertical), we start from the set of equation established
in {\S}~I.3 for the special case $k = z$ and thus $e_3 = 1$, and we introduce an arbitrary
vertical coordinate $s = s(i,j,z)$. Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z)$) and the horizontal slope of $s$surfaces by :
\begin{equation} \label{Apdx_A_A1}
+In order to establish the set of Primitive Equation in curvilinear $s$coordinates ($i.e.$
+orthogonal curvilinear coordinate in the horizontal and $s$coordinate in the vertical), we
+start from the set of equation established in \S\ref{PE_zco_Eq} for the special case
+$k = z$ and thus $e_3 = 1$, and we introduce an arbitrary vertical coordinate
+$s = s(i,j,z,t)$. Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$
+(which now depends on $(i,j,z,t)$) and the horizontal slope of $s$surfaces by :
+\begin{equation} \label{Apdx_A_s_slope}
\sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right_s
\quad \text{and}
+\quad \text{and} \quad
\sigma _2 =\frac{1}{e_2 }\;\left. {\frac{\partial z}{\partial j}} \right_s
\end{equation}
The chain rule to establish the model equations in the curvilinear
scoordinate system is:
\begin{equation} \label{Apdx_A_A2}
+The chain rule to establish the model equations in the curvilinear $s$coordinate system
+is:
+\begin{equation} \label{Apdx_A_s_chain_rule}
\begin{aligned}
&\left. {\frac{\partial \bullet }{\partial i}} \right_z =\left.
{\frac{\partial \bullet }{\partial i}} \right_s +\frac{\partial \bullet
}{\partial s}\;\frac{\partial s}{\partial i}=\left. {\frac{\partial \bullet
}{\partial i}} \right_s \frac{e_1 }{e_3 }\sigma _1 \frac{\partial \bullet
}{\partial s} \\
&\left. {\frac{\partial \bullet }{\partial j}} \right_z =\left.
{\frac{\partial \bullet }{\partial j}} \right_s +\frac{\partial \bullet
}{\partial s}\;\frac{\partial s}{\partial j}=\left. {\frac{\partial \bullet
}{\partial j}} \right_s \frac{e_2 }{e_3 }\sigma _2 \frac{\partial \bullet
}{\partial s} \\
&\;\frac{\partial \bullet }{\partial z} =\frac{1}{e_3 }\frac{\partial \bullet
}{\partial s} \\
+&\left. {\frac{\partial \bullet }{\partial t}} \right_z =
+\left. {\frac{\partial \bullet }{\partial t}} \right_s
+ \frac{\partial \bullet }{\partial s}\;\frac{\partial s}{\partial t} \\
+&\left. {\frac{\partial \bullet }{\partial i}} \right_z =
+ \left. {\frac{\partial \bullet }{\partial i}} \right_s
+ \frac{\partial \bullet }{\partial s}\;\frac{\partial s}{\partial i}=
+ \left. {\frac{\partial \bullet }{\partial i}} \right_s
+ \frac{e_1 }{e_3 }\sigma _1 \frac{\partial \bullet }{\partial s} \\
+&\left. {\frac{\partial \bullet }{\partial j}} \right_z =
+\left. {\frac{\partial \bullet }{\partial j}} \right_s
+  \frac{\partial \bullet }{\partial s}\;\frac{\partial s}{\partial j}=
+\left. {\frac{\partial \bullet }{\partial j}} \right_s
+  \frac{e_2 }{e_3 }\sigma _2 \frac{\partial \bullet }{\partial s} \\
+&\;\frac{\partial \bullet }{\partial z} \;\; = \frac{1}{e_3 }\frac{\partial \bullet }{\partial s} \\
\end{aligned}
\end{equation}
Using (\ref{Apdx_A_A2}), the divergence of the velocity is transformed as follows:


\begin{equation*}
\nabla \cdot {\rm {\bf U}}=\frac{1}{e_1 \,e_2 }\left[ {\left.
{\frac{\partial (e_2 \,u)}{\partial i}} \right_z +\left. {\frac{\partial
(e_1 \,v)}{\partial j}} \right_z } \right]+\frac{\partial w}{\partial z} \\
\end{equation*}

%\begin{equation} \label{ }
\begin{multline*}
=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,u)}{\partial i}}
\right_s \frac{e_1 }{e_3 }\sigma _1 \frac{\partial (e_2 \,u)}{\partial s}}
\right. \\
\shoveright { \left. { +\left. {\frac{\partial (e_1 \,v)}{\partial j}} \right_s \frac{e_2 }{e_3 }\sigma _2 \frac{\partial (e_1 v)}{\partial s}} \right]+\frac{\partial w}{\partial s}\frac{\partial s}{\partial z} }\\
\end{multline*}
%\end{equation}

\begin{equation*}
%\begin{multline}
=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,u)}{\partial i}}
\right_s +\left. {\frac{\partial (e_1 \,v)}{\partial j}} \right_s }
\right]+\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}\sigma _1
\frac{\partial u}{\partial s}\sigma _2 \frac{\partial v}{\partial s}}
\right]
%\end{multline}
\end{equation*}

%\begin{equation} \label{ }
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3
\,u)}{\partial i}} \right_s \left. {e_2 \,u\frac{\partial e_3 }{\partial
i}} \right_s +\left. {\frac{\partial (e_1 \,e_3 \,v)}{\partial j}}
\right_s \left. {e_1 v\frac{\partial e_3 }{\partial j}} \right_s }
\right] \\
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}\sigma _1
\frac{\partial u}{\partial s}\sigma _2 \frac{\partial v}{\partial s}}
\right]} \\
\end{multline*}
%\end{equation}

+In particular applying the time derivative chain rule to $z$ provide the expression of $w_s$, the vertical velocity of the $s$surfaces:
+\begin{equation} \label{Apdx_A_w_in_s}
+w_s = \left. \frac{\partial z }{\partial t} \right_s
+ = \frac{\partial z}{\partial s} \; \frac{\partial s}{\partial t}
+ = e_3 \, \frac{\partial s}{\partial t}
+\end{equation}
+
+% ================================================================
+% continuity equation
+% ================================================================
+\section{Continuity Equation}
+\label{Apdx_B_continuity}
+
+Using (\ref{Apdx_A_s_chain_rule}) and the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate, the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows:
+
+\begin{align*}
+\nabla \cdot {\rm {\bf U}}
+&= \frac{1}{e_1 \,e_2 } \left[ \left. {\frac{\partial (e_2 \,u)}{\partial i}} \right_z
+ +\left. {\frac{\partial(e_1 \,v)}{\partial j}} \right_z \right]
++ \frac{\partial w}{\partial z} \\
+\\
+& = \frac{1}{e_1 \,e_2 } \left[
+ \left. \frac{\partial (e_2 \,u)}{\partial i} \right_s
+  \frac{e_1 }{e_3 } \sigma _1 \frac{\partial (e_2 \,u)}{\partial s}
+ + \left. \frac{\partial (e_1 \,v)}{\partial j} \right_s
+  \frac{e_2 }{e_3 } \sigma _2 \frac{\partial (e_1 \,v)}{\partial s} \right]
+ + \frac{\partial w}{\partial s} \; \frac{\partial s}{\partial z} \\
+\\
+& = \frac{1}{e_1 \,e_2 } \left[
+ \left. \frac{\partial (e_2 \,u)}{\partial i} \right_s
+ + \left. \frac{\partial (e_1 \,v)}{\partial j} \right_s \right]
+ + \frac{1}{e_3 }\left[ \frac{\partial w}{\partial s}
+  \sigma _1 \frac{\partial u}{\partial s}
+  \sigma _2 \frac{\partial v}{\partial s} \right] \\
+\\
+& = \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ \left. e_2 \,u \frac{\partial e_3 }{\partial i} \right_s
+ + \left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s
+  \left. e_1 v \frac{\partial e_3 }{\partial j} \right_s \right] \\
+& \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
+ + \frac{1}{e_3 } \left[ \frac{\partial w}{\partial s}
+  \sigma _1 \frac{\partial u}{\partial s}
+  \sigma _2 \frac{\partial v}{\partial s} \right] \\
+\\
+\end{align*}
Noting that $\frac{1}{e_1 }\left. {\frac{\partial e_3 }{\partial i}}
@@ 86,90 +94,126 @@
\right_s =\frac{\partial \sigma _2 }{\partial s}$, it becomes:
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3
\,u)}{\partial i}} \right_s +\left. {\frac{\partial (e_1 \,e_3
\,v)}{\partial j}} \right_s } \right] \\
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}u\frac{\partial \sigma _1 }{\partial s}v\frac{\partial \sigma _2 }{\partial s}\sigma _1 \frac{\partial u}{\partial s}\sigma _2 \frac{\partial v}{\partial s}} \right]} \\
 \end{multline*}
+\begin{align*}
+\nabla \cdot {\rm {\bf U}}
+& = \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right] \\
+& \qquad \qquad \qquad \qquad \qquad \quad
+ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}u\frac{\partial \sigma _1 }{\partial s}v\frac{\partial \sigma _2 }{\partial s}\sigma _1 \frac{\partial u}{\partial s}\sigma _2 \frac{\partial v}{\partial s}} \right] \\
+\\
+& = \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right]
+ + \frac{1}{e_3 } \; \frac{\partial}{\partial s} \left[ w  u\;\sigma _1  v\;\sigma _2 \right]
+ \end{align*}
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3
\,u)}{\partial i}} \right_s +\left. {\frac{\partial (e_1 \,e_3
\,v)}{\partial j}} \right_s } \right] \\
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial
s}\frac{\partial (u\;\sigma _1 )}{\partial s}\frac{\partial (v\;\sigma _2
)}{\partial s}} \right]} \\
 \end{multline*}

Introducing a "vertical" velocity $\omega $ as the velocity normal to $s$surfaces:

\begin{equation} \label{Apdx_A_A3}
\omega =w\sigma _1 \,u\sigma _2 \,v
\end{equation}

the divergence of the velocity is given in curvilinear $s$coordinates by:
\begin{equation} \label{Apdx_A_A4}
\nabla \cdot {\rm {\bf U}}=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left.
{\frac{\partial (e_2 \,e_3 \,u)}{\partial i}} \right_s +\left.
{\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} \right_s }
\right]+\frac{1}{e_3 }\frac{\partial \omega }{\partial s}
\end{equation}


As a result, the continuity equation (I.1.3) in $s$coordinates becomes:
+Here, $w$ is the vertical velocity relative to the $z$coordinate system. Introducing the diasurface velocity component, $\omega $, defined as the velocity relative to the moving $s$surfaces and normal to them:
+\begin{equation} \label{Apdx_A_w_s}
+\omega = w  w_s  \sigma _1 \,u  \sigma _2 \,v \\
+\end{equation}
+with $w_s$ given by \eqref{Apdx_A_w_in_s}, we obtain the expression of the divergence of the velocity in the curvilinear $s$coordinate system:
+\begin{align*} \label{Apdx_A_A4}
+\nabla \cdot {\rm {\bf U}}
+&= \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right]
++ \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
++ \frac{1}{e_3 } \frac{\partial w_s }{\partial s} \\
+\\
+&= \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right]
++ \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
++ \frac{1}{e_3 } \frac{\partial}{\partial s} \left( e_3 \; \frac{\partial s}{\partial t} \right) \\
+\\
+&= \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right]
++ \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
++ \frac{\partial}{\partial s} \frac{\partial s}{\partial t}
++ \frac{1}{e_3 } \frac{\partial s}{\partial t} \frac{\partial e_3}{\partial s} \\
+\\
+&= \frac{1}{e_1 \,e_2 \,e_3 } \left[
+ \left. \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right_s
+ +\left. \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right_s \right]
++ \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
++ \frac{1}{e_3 } \frac{\partial e_3}{\partial t} \\
+\end{align*}
+
+As a result, the continuity equation \eqref{Eq_PE_continuity} in $s$coordinates becomes:
\begin{equation} \label{Apdx_A_A5}
\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3
\,u)}{\partial i}} \right_s +\left. {\frac{\partial (e_1 \,e_3
\,v)}{\partial j}} \right_s } \right]+\frac{1}{e_3 }\frac{\partial \omega
}{\partial s}=0
\end{equation}


\textbf{Momentum equation:}

As an example let us consider (I.3.10), the first component of the momentum
equation. Its non linear term can be transformed as follows:

\begin{equation*}
\begin{aligned}
&+\left. \zeta \right_z v\frac{1}{2e_1 }\left. {\frac{\partial
(u^2+v^2)}{\partial i}} \right_z w\frac{\partial u}{\partial z} \\
&=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}}
+\frac{1}{e_3 } \frac{\partial e_3}{\partial t}
++ \frac{1}{e_1 \,e_2 \,e_3 }\left[
+ {\left. {\frac{\partial (e_2 \,e_3 \,u)}{\partial i}} \right_s
+ + \left. {\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} \right_s } \right]
+ +\frac{1}{e_3 }\frac{\partial \omega }{\partial s} = 0
+\end{equation}
+
+% ================================================================
+% momentum equation
+% ================================================================
+\section{Momentum Equation}
+\label{Apdx_B_momentum}
+
+Let us consider \eqref{Eq_PE_dyn_vect}, the first component of the
+momentum equation in the vector invariant form (similar manipulations can be performed on the second one). Its non linear term can be transformed
+as follows:
+
+\begin{align*}
+&+\left. \zeta \right_z v\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_z
+ w \;\frac{\partial u}{\partial z} \\
+\\
+&\qquad=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}}
\right_z \left. {\frac{\partial (e_1 \,u)}{\partial j}} \right_z }
\right]\;v\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}}
\right_z w\frac{\partial u}{\partial z}
\end{aligned}
\end{equation*}
\begin{multline*}
 =\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}}
\right_s \left. {\frac{\partial (e_1 \,u)}{\partial j}} \right_s }
\right. \\
+\right_z w\frac{\partial u}{\partial z} \\
+\\
+&\qquad =\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}}
+\right_s \left. {\frac{\partial (e_1 \,u)}{\partial j}} \right_s } \right.
\left. {\frac{e_1 }{e_3 }\sigma _1 \frac{\partial (e_2 \,v)}{\partial s}+\frac{e_2 }{e_3 }\sigma _2 \frac{\partial (e_1 \,u)}{\partial s}} \right]\;v \\
\shoveright{ \frac{1}{2e_1 }\left( {\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s \frac{e_1 }{e_3 }\sigma _1 \frac{\partial (u^2+v^2)}{\partial s}} \right)\frac{w}{e_3 }\frac{\partial u}{\partial s} }\\
 \end{multline*}

\begin{equation*}
 =\left. \zeta \right_s \;v\frac{1}{2e_1 }\left. {\frac{\partial
(u^2+v^2)}{\partial i}} \right_s \frac{w}{e_3 }\frac{\partial u}{\partial
s}\left[ {\frac{\sigma _1 }{e_3 }\frac{\partial v}{\partial s}\frac{\sigma
_2 }{e_3 }\frac{\partial u}{\partial s}} \right]\;v \\
 +\frac{\sigma _1 }{2e_3 }\frac{\partial (u^2+v^2)}{\partial s}
\end{equation*}


\begin{multline*}
 =\left. \zeta \right_s \;v\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s \\
\shoveright{ \frac{1}{e_3 }\left[ {w\frac{\partial u}{\partial s}+\sigma _1 v\frac{\partial v}{\partial s}\sigma _2 v\frac{\partial u}{\partial s}\sigma _1 u\frac{\partial u}{\partial s}\sigma _1 v\frac{\partial v}{\partial s}} \right] }\\
 \end{multline*}

\begin{equation} \label{Apdx_A_A6}
=\left. \zeta \right_s \;v\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s \frac{1}{e_3 }\omega \frac{\partial u}{\partial s}
\end{equation}
+&\qquad \qquad \qquad \qquad \qquad
+{ \frac{1}{2e_1 }\left( {\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s \frac{e_1 }{e_3 }\sigma _1 \frac{\partial (u^2+v^2)}{\partial s}} \right)
+\frac{w}{e_3 }\frac{\partial u}{\partial s} } \\
+\end{align*}
+\begin{align*}
+\qquad &= \left. \zeta \right_s \;v
+  \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s
+  \frac{w}{e_3 }\frac{\partial u}{\partial s}
+  \left[ {\frac{\sigma _1 }{e_3 }\frac{\partial v}{\partial s}
+  \frac{\sigma_2 }{e_3 }\frac{\partial u}{\partial s}} \right]\;v \\
+\qquad&\qquad \qquad \qquad \qquad \qquad \qquad
+\qquad \qquad \qquad \qquad \quad
+ +\frac{\sigma _1 }{2e_3 }\frac{\partial (u^2+v^2)}{\partial s} \\
+%\\
+\qquad &= \left. \zeta \right_s \;v
+  \frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s \\
+\qquad&\qquad \qquad \qquad
+ \frac{1}{e_3} \left[ {w\frac{\partial u}{\partial s}
+ +\sigma _1 v\frac{\partial v}{\partial s}  \sigma _2 v\frac{\partial u}{\partial s}
+ \sigma _1 u\frac{\partial u}{\partial s}  \sigma _1 v\frac{\partial v}{\partial s}} \right] \\
+\\
+\qquad &= \left. \zeta \right_s \;v
+  \frac{1}{2e_1 }\left. \frac{\partial (u^2+v^2)}{\partial i} \right_s
+  \frac{1}{e_3} \left[ w  \sigma _2 v  \sigma _1 u \right]
+ \; \frac{\partial u}{\partial s} \\
+\\
+\qquad &= \left. \zeta \right_s \;v
+  \frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s
+  \frac{1}{e_3 }\omega \frac{\partial u}{\partial s}
+  \frac{\partial s}{\partial t} \frac{\partial u}{\partial s}
+\end{align*}
Therefore, the nonlinear terms of the momentum equation have the same form
in $z $and $s$coordinates
+in $z$ and $s$coordinates but with the addition of the time derivative of the velocity:
+\begin{multline} \label{Apdx_A_momentum_NL}
++\left. \zeta \right_z v\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_z
+ w \;\frac{\partial u}{\partial z} \\
+=  \frac{\partial u}{\partial t} + \left. \zeta \right_s \;v
+  \frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right_s
+  \frac{1}{e_3 }\omega \frac{\partial u}{\partial s}
+\end{multline}
The pressure gradient term can be transformed as follows:
\begin{equation} \label{Apdx_A_A7}
+\begin{equation} \label{Apdx_A_grad_p}
\begin{split}
\frac{1}{\rho _o e_1 }\left. {\frac{\partial p}{\partial i}} \right_z& =\frac{1}{\rho _o e_1 }\left[ {\left. {\frac{\partial p}{\partial i}} \right_s \frac{e_1 }{e_3 }\sigma _1 \frac{\partial p}{\partial s}} \right] \\
@@ 179,21 +223,50 @@
\end{equation}
An additional term appears in (\ref{Apdx_A_A7}) which accounts for the tilt of model
+An additional term appears in (\ref{Apdx_A_grad_p}) which accounts for the tilt of model
levels.
\textbf{Tracer equation:}
+Introducing \eqref{Apdx_A_momentum_NL} and \eqref{Apdx_A_grad_p} in \eqref{Eq_PE_dyn_vect} and regrouping the time derivative terms in the left hand side, and performing the same manipulation on the second component, we obtain the vector invariant form of momentum equation in $s$coordinate :
+\begin{subequations} \label{Apdx_A_dyn_vect}
+\begin{multline} \label{Apdx_A_PE_dyn_vect_u}
+ \frac{1}{e_3} \frac{\partial \left( e_3\,u \right) }{\partial t}=
+ + \left( {\zeta +f} \right)\,v
+  \frac{1}{2\,e_1} \frac{\partial}{\partial i} \left( u^2+v^2 \right)
+  \frac{1}{e_3} \omega \frac{\partial u}{\partial k} \\
+  \frac{1}{e_1} \frac{\partial}{\partial i} \left( \frac{p_s + p_h}{\rho _o} \right)
+ + g\frac{\rho }{\rho _o}\sigma _1
+ + D_u^{\vect{U}} + F_u^{\vect{U}}
+\end{multline}
+\begin{multline} \label{Apdx_A_dyn_vect_v}
+ \frac{1}{e_3}\frac{\partial \left( e_3\,v \right) }{\partial t}=
+  \left( {\zeta +f} \right)\,u
+  \frac{1}{2\,e_2 }\frac{\partial }{\partial j}\left( u^2+v^2 \right)
+  \frac{1}{e_3 } \omega \frac{\partial v}{\partial k} \\
+  \frac{1}{e_2 }\frac{\partial }{\partial j}\left( \frac{p_s+p_h }{\rho _o} \right)
+ + g\frac{\rho }{\rho _o }\sigma _2
+ + D_v^{\vect{U}} + F_v^{\vect{U}}
+\end{multline}
+\end{subequations}
+
+It has the same form as in $z$coordinate but the vertical scale factor that has appeared inside the time derivative. The form of the vertical physics and forcing terms remain unchanged. The form of the lateral physics is discussed in appendix~\ref{Apdx_B}.
+
+% ================================================================
+% Tracer equation
+% ================================================================
+\section{Tracer Equation}
+\label{Apdx_B_tracer}
The tracer equation is obtained using the same calculation as for the
continuity equation:

%\begin{equation} \label{Eq_ }
\begin{multline} \label{Apdx_A_A8}
 \frac{\partial T}{\partial t} = \frac{1}{e_1 \,e_2 \,e_3 } \left[ {\frac{\partial }{\partial i}} \left( {e_2 \,e_3 \;Tu} \right) + \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right) \;\right .\\
 \shoveright{\left . +\frac{\partial }{\partial k} \left( {e_1 \,e_2 \;T\omega } \right) \right] +D^{lT} +D^{vT} }\\
\end{multline}
%\end{equation}
+continuity equation and then regrouping the time derivative terms in the left hand side :
+
+\begin{multline} \label{Apdx_A_tracer}
+ \frac{1}{e_3} \frac{\partial \left( e_3 T \right)}{\partial t}
+ = \frac{1}{e_1 \,e_2 \,e_3 }
+ \left[ {\frac{\partial }{\partial i}} \left( {e_2 \,e_3 \;Tu} \right) \right .
+ + \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right) \\
+ + \left. \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right) \right] +D^{T} +F^{T} \; \;
+\end{multline}
The expression of the advection term is a straight consequence of (A.4), the
expression of the 3D divergence in $s$coordinates established above.

+expression of the 3D divergence in $s$coordinates established above.
+
Index: trunk/DOC/TexFiles/Chapters/Annex_B.tex
===================================================================
 trunk/DOC/BETA/Chapters/Annex_B.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Annex_B.tex (revision 994)
@@ 13,29 +13,19 @@
In $z$coordinates, the horizontal/vertical second order tracer diffusive
operator is given by:



\begin{equation} \label{Apdx_B1}
\begin{split}
 D^T&=D^{lT}+D^{vT} \\
 &=\frac{1}{e_1 e_2 }\left[ {\left. {\frac{\partial }{\partial i}\left(
{\frac{e_2 }{e_1 }A^{lT} \;\left. {\frac{\partial T}{\partial i}} \right_z
} \right)} \right_z +\left. {\frac{\partial }{\partial j}\left( {\frac{e_1
}{e_2 }A^{lT} \;\left. {\frac{\partial T}{\partial j}} \right_z } \right)}
\right_z } \right] +\frac{\partial }{\partial z}\left( {A^{vT} \;\frac{\partial T}{\partial
z}} \right) \\
\end{split}
\end{equation}


In $s$coordinates, we defined the slopes of $s$surfaces, $\sigma_1$ and $\sigma_2$ by (A.1), the vertical/horizontal ratio of diffusive coefficient by $\epsilon = A^{vT} / A^{lT}$. The diffusive operator is given by:
+In $z$coordinate, the horizontal/vertical second order tracer diffusive operator is given by:
+\begin{multline} \label{Apdx_B1}
+ D^T = \frac{1}{e_1 \, e_2} \left[
+ \left. \frac{\partial}{\partial i} \left( \frac{e_2}{e_1}A^{lT} \;\left. \frac{\partial T}{\partial i} \right_z \right) \right_z \right. \\
+ \left.
++ \left. \frac{\partial}{\partial j} \left( \frac{e_1}{e_2}A^{lT} \;\left. \frac{\partial T}{\partial j} \right_z \right) \right_z \right]
++ \frac{\partial }{\partial z}\left( {A^{vT} \;\frac{\partial T}{\partial z}} \right)
+\end{multline}
+
+In $s$coordinate, we defined the slopes of $s$surfaces, $\sigma_1$ and $\sigma_2$ by (A.1) and the vertical/horizontal ratio of diffusive coefficient by $\epsilon = A^{vT} / A^{lT}$. The diffusive operator is given by:
\begin{equation} \label{Apdx_B2}
\begin{aligned}
&D^T=D^{lT}+D^{vT} =\left. \nabla \right_s \cdot \left[ {A^{lT} \;\Re \cdot \left. \nabla
\right_s \left( T \right)} \right] \\
&\text{where} \;\Re =\left( {{\begin{array}{*{20}c}
+D^T = \left. \nabla \right_s \cdot
+ \left[ A^{lT} \;\Re \cdot \left. \nabla \right_s T \right] \\
+\;\;\text{where} \;\Re =\left( {{\begin{array}{*{20}c}
1 \hfill & 0 \hfill & {\sigma _1 } \hfill \\
0 \hfill & 1 \hfill & {\sigma _2 } \hfill \\
@@ 43,38 +33,27 @@
^2+\sigma _2 ^2} \hfill \\
\end{array} }} \right)
\end{aligned}
\end{equation}

or in expended form:

\begin{multline} \label{Apdx_B3}
D^T=\frac{1}{e_1 e_2 e_3 }\;\left[ {\;\,e_2 e_3 A^{lT} \;\left.
+D^T=\frac{1}{e_1\,e_2\,e_3 }\;\left[ {\quad \; \; e_2\,e_3\,A^{lT} \;\left.
{\frac{\partial }{\partial i}\left( {\frac{1}{e_1 }\;\left. {\frac{\partial
T}{\partial i}} \right_s \frac{\sigma _1 }{e_3 }\;\frac{\partial
T}{\partial s}} \right)} \right_s } \right. \\
\;\;+e_1 e_3 A^{lT} \;\left. {\frac{\partial }{\partial j}\left( {\frac{1}{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right_s \frac{\sigma _2 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right_s \\
 \;\;+e_1 e_2 A^{lT} \;\frac{\partial }{\partial s}\left( {\frac{\sigma _1 }{e_1 }\;\left. {\frac{\partial T}{\partial i}} \right_s \frac{\sigma _2 }{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right_s } \right. \\
\shoveright{\;\;\left. {\left. {+\left( {\varepsilon +\sigma _1^2+\sigma _2 ^2} \right)\;\frac{1}{e_3 }\;\frac{\partial T}{\partial s}} \right)\;\;\,} \right]} \\
++e_1\,e_3\,A^{lT} \;\left. {\frac{\partial }{\partial j}\left( {\frac{1}{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right_s \frac{\sigma _2 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right_s \\
+ \;\;+e_1\,e_2\,A^{lT} \;\frac{\partial }{\partial s}\left( {\frac{\sigma _1 }{e_1 }\;\left. {\frac{\partial T}{\partial i}} \right_s \frac{\sigma _2 }{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right_s } \right. \; \\
+\shoveright{\;\;\left. {\left. {+\left( {\varepsilon +\sigma _1^2+\sigma _2 ^2} \right)\;\frac{1}{e_3 }\;\frac{\partial T}{\partial s}} \right)\;\;\,} \right]}
\end{multline}
Equation (\ref{Apdx_B2}) (or equivalently (\ref{Apdx_B3})~) is obtained from (\ref{Apdx_B1}) without any additional assumption. Indeed, for the special case $k=z$ and thus $e_3 =1$,
we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in Appendix A
\newline
\newline
and use (A.1) and (A.2). Since no cross horizontal derivate $\partial _i \,\partial _j $ appears neither in (B.1) nor in (A.2), there is a decoupling between $(i,z)$ and $(j,z)$ plans as well as
$(i,s)$ and $(j,s)$ plans. The demonstration can then be done for the $(i,s)\;\to \;(j,s)$ transformation without loss of generality:

\begin{equation*}
D^T=\frac{1}{e_1 \,e_2 }\left. {\frac{\partial }{\partial i}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_z } \right)} \right_z +\frac{\partial }{\partial z}\left( {A^{vT}\;\frac{\partial T}{\partial z}} \right)
\end{equation*}

\begin{multline*}
 =\frac{1}{e_1 \,e_2 }\left[ {\left. {\;\frac{\partial }{\partial i}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left( {\left. {\frac{\partial T}{\partial i}} \right_s \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right)} \right_s } \right. \\
 \left. { \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\left( {\left. {\frac{\partial T}{\partial i}} \right_s \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right_s } \right)\;} \right] \\
+Equation \eqref{Apdx_B2} (or equivalently \eqref{Apdx_B3}) is obtained from \eqref{Apdx_B1} without any additional assumption. Indeed, for the special case $k=z$ and thus $e_3 =1$, we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in Appendix~\ref{Apdx_A} and use \eqref{Apdx_A_s_slope} and \eqref{Apdx_A_s_chain_rule}. Since no cross horizontal derivate $\partial _i \partial _j $ appears in \eqref{Apdx_B1}, the ($i$,$z$) and ($j$,$z$) planes are independent. The demonstration can then be done for the ($i$,$z$)~$\to$~($j$,$s$) transformation without any loss of generality:
+
+\begin{equation*}
+D^T=\frac{1}{e_1\,e_2 }\left. {\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_z } \right)} \right_z +\frac{\partial }{\partial z}\left( {A^{vT}\;\frac{\partial T}{\partial z}} \right) \qquad \qquad \qquad \qquad \qquad \qquad \qquad \\
+\end{equation*}
+\begin{multline*}
+ =\frac{1}{e_1\,e_2 }\left[ {\left. {\;\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left( {\left. {\frac{\partial T}{\partial i}} \right_s \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right)} \right_s } \right. \\
+ \left. { \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\left( {\left. {\frac{\partial T}{\partial i}} \right_s \frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right_s } \right)\;} \right]
\shoveright{ +\frac{1}{e_3 }\frac{\partial }{\partial s}\left[ {\frac{A^{vT}}{e_3 }\;\frac{\partial T}{\partial s}} \right]} \\
\end{multline*}


\begin{multline*}
=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right)} \right_s \left. {\frac{e_2 }{e_1
@@ 85,14 +64,12 @@
\end{multline*}

Noting that $\frac{1}{e_1} \left. \frac{\partial e_3 }{\partial i} \right_s = \frac{\partial \sigma _1 }{\partial s}$, it becomes:
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right)} \right_s \left. {e_3 \frac{\partial }{\partial
i}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right_s } \right. \\
 e_2 A^{lT}\;\frac{\partial \sigma _1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right_s e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right) \\
+ =\frac{1}{e_1\,e_2\,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2\,e_3 }{e_1}\,A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right)} \right_s \left.
+\, {e_3 \frac{\partial }{\partial i}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right_s } \right. \\
+\qquad e_2 A^{lT}\;\frac{\partial \sigma _1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right_s e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right) \\
\shoveright{ \left. { +e_1 \,\sigma _1 \frac{\partial }{\partial s}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial z}} \right)\;\;\;} \right] }\\
\end{multline*}

\begin{multline*}
=\frac{1}{e_1 \,e_2 \,e_3 } \left[ {\left. {\;\;\;\frac{\partial }{\partial i} \left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s } \right)} \right_s \left. {\frac{\partial }{\partial
@@ 110,5 +87,6 @@
\end{multline*}
Since the horizontal scale factor do not depend on the vertical coordinates, the last term of the first line and the first term of the last line cancel, while the second line reduces to a single vertical derivative, so it becomes:
+Since the horizontal scale factor do not depend on the vertical coordinate, the last term of the first line and the first term of the last line cancel, while the second line reduces to a single vertical derivative, so it becomes:
+
\begin{multline*}
=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right_s e_2 \,\sigma _1 \,A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right_s } \right. \\
@@ 116,19 +94,19 @@
\end{multline*}
in other words:
+in other words, the horizontal Laplacian operator in the ($i$,$s$)plane takes the following expression :
\begin{equation*}
D^T = {\frac{1}{e_1\,e_2\,e_3}}
\left( {{\begin{array}{*{20}c}
+\left( {{\begin{array}{*{30}c}
{\left. {\frac{\partial \left( {e_2 e_3 \bullet } \right)}{\partial i}} \right_s } \hfill \\
{\frac{\partial \left( {e_1 e_2 \bullet } \right)}{\partial s}} \hfill \\
\end{array}}}\right)
\cdot \left[ {A^{lT}
\left( {{\begin{array}{*{20}c}
+\left( {{\begin{array}{*{30}c}
{1} \hfill & {\sigma_1 } \hfill \\
{\sigma_1} \hfill & {\varepsilon_1^2} \hfill \\
\end{array} }} \right)
\cdot
\left( {{\begin{array}{*{20}c}
+\left( {{\begin{array}{*{30}c}
{\frac{1}{e_1 }\;\left. {\frac{\partial \bullet }{\partial i}} \right_s } \hfill \\
{\frac{1}{e_3 }\;\frac{\partial \bullet }{\partial s}} \hfill \\
@@ 136,14 +114,14 @@
\right) \left( T \right)} \right]
\end{equation*}


% ================================================================
% Isopycnal/Vertical Second Order Tracer Diffusive Operators
% ================================================================
\section{Isopycnal/Vertical Second Order Tracer Diffusive Operators}
+
+
+% ================================================================
+% Isopycnal/Vertical 2nd Order Tracer Diffusive Operators
+% ================================================================
+\section{Iso/diapycnal 2nd Order Tracer Diffusive Operators}
\label{Apdx_B_2}
The isopycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the curvilinear coordinate system $(i,j,k)$, in which the equations of the ocean circulation model are formulated, takes the following expression [Redi 1982]:
+The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the ($i$,$j$,$k$) curvilinear coordinate system in which the equations of the ocean circulation model are formulated, takes the following expression \citep{Redi_JPO82}:
\begin{equation*}
@@ 155,15 +133,15 @@
\end{array} }} \right]
\end{equation*}
where$(a_1$, $a_2)$ are the isopycnal slopes in $(\textbf{i}$, $\textbf{j})$ directions:
+where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions:
\begin{equation*}
a_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{1}
\end{equation*}
\begin{equation*}
+\qquad , \qquad
a_2 =\frac{e_3 }{e_2 }\left( {\frac{\partial \rho }{\partial j}}
\right)\left( {\frac{\partial \rho }{\partial k}} \right)^{1}
\end{equation*}
In practice, the isopycnal slopes are generally less than $10${\small $^{2}$ in the ocean, so $\textbf {A}_{\textbf I}$ can be simplified appreciably (Cox, 1987) :
\begin{equation*}
{\textbf{A}_{\textbf{I}}} =A^{lT}
+
+In practice, the isopycnal slopes are generally less than $10^{2}$ in the ocean, so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}:
+\begin{equation*}
+{\textbf{A}_{\textbf{I}}} \approx A^{lT}
\left[ {{\begin{array}{*{20}c}
1 \hfill & 0 \hfill & {a_1 } \hfill \\
@@ 172,29 +150,26 @@
\end{array} }} \right]
\end{equation*}
The resulting isopycnal operator conserves the quantity it diffuses, and dissipates the square of this quantity. The demonstration of the first property is trivial. Let us demonstrate the second one:
+
+The resulting isopycnal operator conserves the quantity and dissipates its square. The demonstration of the first property is trivial as \eqref{Apdx_B2} is the divergence of fluxes. Let us demonstrate the second one:
\begin{equation*}
\iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv = \iiint\limits_D \nabla T\;.\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv
\end{equation*}
since
\begin{multline*}
+\begin{align*}
\nabla T\;.\left( {{\rm {\bf A}}_{\rm {\bf I}} \nabla T}
\right)=A^{lT}\left[ {\left( {\frac{\partial T}{\partial i}} \right)^22a_1
+\right)&=A^{lT}\left[ {\left( {\frac{\partial T}{\partial i}} \right)^22a_1
\frac{\partial T}{\partial i}\frac{\partial T}{\partial k}+\left(
{\frac{\partial T}{\partial j}} \right)^2} \right. \\
\shoveright{ \left. {2a_2 \frac{\partial T}{\partial j}\frac{\partial T}{\partial
+&\qquad \qquad \qquad \quad
+{ \left. \,{2a_2 \frac{\partial T}{\partial j}\frac{\partial T}{\partial
k}+\left( {a_1 ^2+a_2 ^2} \right)\left( {\frac{\partial T}{\partial k}}
\right)^2} \right]} \\
\end{multline*}

\begin{equation*}
=A_h \left[ {\left( {\frac{\partial T}{\partial i}a_1 \frac{\partial T}{\partial k}} \right)^2+\left( {\frac{\partial T}{\partial j}a_2 \frac{\partial T}{\partial k}} \right)^2} \right]\quad \geq 0
\end{equation*}
the property becomes obvious.
\\
Note that the resulting tensor is similar to those obtained for geopotential diffusion in $s$coordinates. The simplification leads to a decoupling between $(i,z)$ and $(j,z)$ plans.
+&=A_h \left[ {\left( {\frac{\partial T}{\partial i}a_1 \frac{\partial T}{\partial k}} \right)^2+\left( {\frac{\partial T}{\partial j}a_2 \frac{\partial T}{\partial k}} \right)^2} \right]\quad \geq 0
+\end{align*}
+the property becomes obvious.
The resulting diffusive operator in $z$coordinates has the following
expression :
\begin{multline*}
+\begin{multline*} \label{Apdx_B_ldfiso}
D^T=\frac{1}{e_1 e_2 }\left\{ {\;\frac{\partial }{\partial i}\left[ {A_h \left( {\frac{e_2 }{e_1 }\frac{\partial T}{\partial i}a_1 \frac{e_2}{e_3}\frac{\partial T}{\partial k}} \right)} \right]\;} \right.\;\; \\
\;\left. {\;\;\;+\frac{\partial}{\partial j}\left[ {A_h \left( {\frac{e_1 }{e_2 }\frac{\partial T}{\partial j}a_2 \frac{e_1 }{e_3 }\frac{\partial T}{\partial k}} \right)} \right]\;} \right\} \\
@@ 202,4 +177,5 @@
\end{multline*}
+It has to be emphasised that the simplification introduced leads to a decoupling between ($i$,$z$) and ($j$,$z$) planes. The operator has therefore the same expression as \eqref{Apdx_B3}, the diffusive operator obtained for geopotential diffusion in $s$coordinate.
% ================================================================
@@ 209,17 +185,11 @@
\label{Apdx_B_3}

*{\footnotesize }lateral/vertical{\footnotesize }2{\small nd}{\footnotesize
}order{\footnotesize }momentum diffusive operator

Following (I.3.6), the Laplacian of the horizontal velocity can be expressed
in $z$coordinates:
\begin{equation*}
\Delta {\textbf{U}}_h =\nabla \left( {\nabla \cdot {\textbf{U}}_h } \right)
\nabla \times \left( {\nabla \times {\textbf{U}}_h } \right)
\end{equation*}

\begin{equation*}
=\left( {{\begin{array}{*{20}c}
+The second order momentum diffusive operator (Laplacian) in $z$coordinate is found by applying \eqref{Eq_PE_lap_vector}, the expression of the Laplacian of a vector, to the horizontal velocity vector :
+\begin{align*}
+\Delta {\textbf{U}}_h
+&=\nabla \left( {\nabla \cdot {\textbf{U}}_h } \right)
+\nabla \times \left( {\nabla \times {\textbf{U}}_h } \right) \\
+\\
+&=\left( {{\begin{array}{*{20}c}
{\frac{1}{e_1 }\frac{\partial \chi }{\partial i}} \hfill \\
{\frac{1}{e_2 }\frac{\partial \chi }{\partial j}} \hfill \\
@@ 237,7 +207,7 @@
\hfill \\
\end{array} }} \right)
\end{equation*}
\begin{equation*}
=\left( {{\begin{array}{*{20}c}
+\\
+\\
+&=\left( {{\begin{array}{*{20}c}
{\frac{1}{e_1 }\frac{\partial \chi }{\partial i}\frac{1}{e_2 }\frac{\partial \zeta }{\partial j}} \\
{\frac{1}{e_2 }\frac{\partial \chi }{\partial j}+\frac{1}{e_1 }\frac{\partial \zeta }{\partial i}} \\
@@ 250,42 +220,32 @@
{\frac{\partial \chi }{\partial k}\frac{1}{e_1 e_2 }\left( {\frac{\partial ^2\left( {e_2 \,u} \right)}{\partial i\partial k}+\frac{\partial ^2\left( {e_1 \,v} \right)}{\partial j\partial k}} \right)} \\
\end{array} }} \right)
\end{equation*}
Using (I.3.8), the definition of the horizontal divergence, the third componant of the second vector is obviously zero and thus :
+\end{align*}
+Using \eqref{Eq_PE_div}, the definition of the horizontal divergence, the third componant of the second vector is obviously zero and thus :
\begin{equation*}
\Delta {\textbf{U}}_h = \nabla _h \left( \chi \right)  \nabla _h \times \left( \zeta \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right)
\end{equation*}

The lateral/vertical second order (Laplacian type) operator used to diffuse
horizontal momentum in $z$coordinates therefore takes the following expression :
\begin{equation*}
\begin{split}
 {\textbf{D}}^{\textbf{U}}&={\textbf{D}}^{lm}+{\textbf{D}}^{vm} \\
&=\nabla _h \left( {A^{lm}\;\chi } \right)\nabla _h \times \left( {A^{lm}\;\zeta \;{\textbf{k}}} \right)+\frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{A^{vm}\;}{e_3 }\frac{\partial {\rm {\bf U}}_h }{\partial k}} \right) \\
\end{split}
\end{equation*}

\begin{equation*}
{\textbf{D}}^{\textbf{U}}=
\left( {{\begin{array}{*{20}c}
{\frac{1}{e_1 }\frac{\partial \left( {A^{lm}\chi } \right)}{\partial i}\frac{1}{e_2 }\frac{\partial \left( {A^{lm}\zeta } \right)}{\partial j}} \\
{\frac{1}{e_2 }\frac{\partial \left( {A^{lm}\chi } \right)}{\partial j}+\frac{1}{e_1 }\frac{\partial \left( {A^{lm}\zeta } \right)}{\partial i}} \\
\end{array} }} \right)
+\frac{1}{e_3 }\frac{\partial }{\partial k}
\left( {{\begin{array}{*{20}c}
{\frac{A^{vm}}{e_3 }\frac{\partial u}{\partial k}} \\
{\frac{A^{vm}}{e_3 }\frac{\partial v}{\partial k}} \\
\end{array} }} \right)
\end{equation*}

% ================================================================
% References
% ================================================================
\section{References}


{\small Cox, M. D., 1987 : Isopycnal diffusion in a zcoordinate ocean
model. }{\small \textit{Ocean Modelling}}{\small , 74, 19.}

{\small Redi, M. H., 1982 : oceanic isopycnal mixing by coordinate rotation.
}{\small \textit{J. Phys. Oceanogr., 13}}{\small , 11541158.}
+Note that this operator ensures a full separation between the vorticity and horizontal divergence fields (see Appendix~\ref{Apdx_C}). It is only equal to a Laplacian applied on each component in Cartesian coordinate, not on the sphere.
+
+The horizontal/vertical second order (Laplacian type) operator used to diffuse
+horizontal momentum in $z$coordinate takes therefore the following expression :
+\begin{equation} \label{Apdx_B_Lap_U}
+ {\textbf{D}}^{\textbf{U}} =
+ \nabla _h \left( {A^{lm}\;\chi } \right)
+  \nabla _h \times \left( {A^{lm}\;\zeta \;{\textbf{k}}} \right)
+ + \frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{A^{vm}\;}{e_3 }
+ \frac{\partial {\rm {\bf U}}_h }{\partial k}} \right) \\
+\end{equation}
+that is in expanded form:
+\begin{align*}
+D^{\textbf{U}}_u
+& = \frac{1}{e_1} \frac{\partial \left( {A^{lm}\chi } \right)}{\partial i}
+ \frac{1}{e_2} \frac{\partial \left( {A^{lm}\zeta } \right)}{\partial j}
+ +\frac{1}{e_3} \frac{\partial u}{\partial k} \\
+D^{\textbf{U}}_v
+& = \frac{1}{e_2 }\frac{\partial \left( {A^{lm}\chi } \right)}{\partial j}
+ +\frac{1}{e_1 }\frac{\partial \left( {A^{lm}\zeta } \right)}{\partial i}
+ +\frac{1}{e_3} \frac{\partial v}{\partial k}
+\end{align*}
+
+Note Bene: introducing a rotation in \eqref{Apdx_B_Lap_U} does not lead to any useful expression for the iso/diapycnal Laplacian operator in $z$coordinate. Similarly, we did not found an expression of practical use for the geopotential horizontal/vertical Laplacian operator in $s$coordinate. Generally, \eqref{Apdx_B_Lap_U} is used in both $z$ and $s$coordinate system, that is a Laplacian diffusion is applied on momentum along the coordinate directions.
Index: trunk/DOC/TexFiles/Chapters/Annex_C.tex
===================================================================
 trunk/DOC/BETA/Chapters/Annex_C.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Annex_C.tex (revision 994)
@@ 2,7 +2,12 @@
% Chapter Ñ Appendix C : Discrete Invariants of the Equations
% ================================================================
\chapter{Appendix C : Discrete Invariants of the Equations}
+\chapter{Discrete Invariants of the Equations}
\label{Apdx_C}
\minitoc
+
+%%% Appendix put in gmcomment as it has not been updated for z* and s coordinate
+I'm writting this appendix. It will be available in a forthcoming release of the documentation
+
+%\gmcomment{
% ================================================================
@@ 14,5 +19,8 @@
First, the boundary condition on the vertical velocity (no flux through the surface and the bottom) is established for the discrete set of momentum equations. Then, it is shown that the non linear terms of the momentum equation are written such that the potential enstrophy of a horizontally non divergent flow is preserved while all the other nondiffusive terms preserve the kinetic energy: the energy is also preserved in practice. In addition, an option is also offer for the vorticity term discretization which provides
a total kinetic energy conserving discretization for that term. Note that although these properties are established in the curvilinear $s$coordinate system, they still hold in the curvilinear $z$coordinate system.
+a total kinetic energy conserving discretization for that term.
+
+Nota Bene: these properties are established here in the rigidlid case and for the 2nd order centered scheme. A forthcoming update will be their generalisation to the free surface case
+and higher order scheme.
% 
@@ 25,18 +33,12 @@
The discrete set of momentum equations used in rigid lid approximation
automatically satisfies the surface and bottom boundary conditions
($w_{surface} =w_{bottom} =~0$, no flux through the surface and the bottom).
+(no flux through the surface and the bottom: $w_{surface} =w_{bottom} =~0$).
Indeed, taking the discrete horizontal divergence of the vertical sum of the
horizontal momentum equations (Eqs. (II.2.1) and (II.2.2)~) wheighted by the
vertical scale factors, it becomes:
\begin{flalign*}
\frac{\partial } {\partial t}
 \left(
 \sum\limits_k \chi
 \right)
\equiv \frac{\partial } {\partial t}
 \left(
 w_{surface} w_{bottom}
 \right)
 &&&\\
+\frac{\partial } {\partial t} \left( \sum\limits_k \chi \right)
+\equiv
+\frac{\partial } {\partial t} \left( w_{surface} w_{bottom} \right)&&&\\
\end{flalign*}
\begin{flalign*}
@@ 91,5 +93,5 @@
% 
\subsection{Coriolis and advection terms: vector invariant form}
\label{Apdx_C.1.2}
+\label{Apdx_C_vor_zad}
% 
@@ 97,116 +99,75 @@
% 
\subsubsection{Vorticity Term}
\label{Apdx_C.1.2.1}

Potential vorticity is located at $f$points and defined as: $\zeta / e_{3f}$. The standard discrete formulation of the relative vorticity term obviously conserves potential vorticity. It also conserves the potential enstrophy for a horizontally nondivergent flow (i.e. $\chi $=0) but not the total kinetic energy. Indeed, using the symmetry or skew symmetry properties of the operators (Eqs (II.1.10) and (II.1.11)), it can be shown that:
+\label{Apdx_C_vor}
+
+Potential vorticity is located at $f$points and defined as: $\zeta / e_{3f}$. The standard discrete formulation of the relative vorticity term obviously conserves potential vorticity (ENS scheme). It also conserves the potential enstrophy for a horizontally nondivergent flow (i.e. $\chi $=0) but not the total kinetic energy. Indeed, using the symmetry or skew symmetry properties of the operators (Eqs \eqref{DOM_mi_adj} and \eqref{DOM_di_adj}), it can be shown that:
\begin{equation} \label{Apdx_C_1.1}
\int_D {\zeta / e_3\,\;{\textbf{k}}\cdot \frac{1} {e_3 }\nabla \times \left( {\zeta \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0
+\int_D {\zeta / e_3\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {\zeta \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0
\end{equation}

where $dv=e_1 \,e_2 \,e_3 \;di\,dj\,dk$ is the volume element. Indeed, using
(II.2.11), the discrete form of the right hand side of (C.1.1) can be
transformed as follow:
+where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. Indeed, using
+\eqref{Eq_dynvor_ens}, the discrete form of the right hand side of \eqref{Apdx_C_1.1}
+can be transformed as follow:
\begin{flalign*}
\int_D \zeta / e_3\,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times
+&\int_D \zeta / e_3\,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times
\left(
\zeta \; \textbf{k} \times \textbf{U}_h
\right)\;
dv
 &&&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+ &&& \displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
\frac{\zeta / e_{3f}} {e_{1f}\,e_{2f}\,e_{3f}}
\biggl\{ \quad
\delta_{i+1/2}
 &\left[
+ \left[
 \overline {\left( {\zeta / e_{3f}} \right)}^{\,i}\;
\overline{\overline {\left( e_{2u}\,e_{3u}\,u \right)}}^{\,i,j+1/ 2}
\right]
 &&
 \biggr. \\
 \biggl.
+ && \\ & \qquad \qquad \qquad \;\;
 \delta_{j+1/2}
 &\left[ \;\;\;
+ \left[ \;\;\;
\overline {\left( \zeta / e_{3f} \right)}^{\,j}\;
\overline{\overline {\left( e_{1v}\,e_{3v}\,v \right)}}^{\,i+1/2,j}
\right]
 \biggr\} \;
 e_{1f}\,e_{2f}\,e_{3f}
 &&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
 \biggl\{ \quad
 \delta_i
 &\left[ \zeta / e_{3f} \right] \;
 \overline {\left( \zeta / e_{3f} \right)}^{\,i}\;
 \overline{\overline {\left( e_{1u}\,e_{3u}\,u \right)}}^{\,i,j+1/2}
 &&
 \biggr. \\
 \biggl.
 + \delta_j
 &\left[ \zeta / e_{3f} \right] \;
 \overline {\left( \zeta / e_{3f} \right)}^{\,j} \;
 \overline{\overline {\left( e_{2v}\,e_{3v}\,v \right)}}^{\,i+1/2,j} \;
+ \;\;\biggr\} \; e_{1f}\,e_{2f}\,e_{3f} && \displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
+ \biggl\{ \delta_i \left[ \frac{\zeta} {e_{3f}} \right] \;
+ \overline{ \left( \frac{\zeta} {e_{3f}} \right) }^{\,i}\;
+ \overline{ \overline{ \left( e_{1u}\,e_{3u}\,u \right) } }^{\,i,j+1/2}
+ + \delta_j \left[ \frac{\zeta} {e_{3f}} \right] \;
+ \overline{ \left( \frac{\zeta} {e_{3f}} \right) }^{\,j} \;
+ \overline{\overline {\left( e_{2v}\,e_{3v}\,v \right)}}^{\,i+1/2,j} \biggr\}
+ &&&& \displaybreak[0] \\
+%
+\equiv& \frac{1} {2} \sum\limits_{i,j,k}
+ \biggl\{ \delta_i \Bigl[ \left( \frac{\zeta} {e_{3f}} \right)^2 \Bigr]\;
+ \overline{\overline {\left( e_{2u}\,e_{3u}\,u \right)}}^{\,i,j+1/2}
+ + \delta_j \Bigl[ \left( \zeta / e_{3f} \right)^2 \Bigr]\;
+ \overline{\overline {\left( e_{1v}\,e_{3v}\,v \right)}}^{\,i+1/2,j}
\biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \frac{1} {2} \sum\limits_{i,j,k}
 \biggl\{ \quad
 \delta_i
 &\Bigl[
 \left( \zeta / e_{3f} \right)^2
 \Bigr]\;
 \overline{\overline {\left( e_{2u}\,e_{3u}\,u \right)}}^{\,i,j+1/2}
 &&
 \biggr. \\
 \biggl.
 + \delta_j
 &\Bigl[
 \left( \zeta / e_{3f} \right)^2
 \Bigr]\;
 \overline{\overline {\left( e_{1v}\,e_{3v}\,v \right)}}^{\,i+1/2,j}
 \biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv  \frac{1} {2} \sum\limits_{i,j,k} \left( \zeta / e_{3f} \right)^2\;
 \biggl\{ \quad
 \delta_{i+1/2}
 &\left[
 \overline{\overline {\left( e_{2u}\,e_{3u}\,u \right)}}^{\,i,j+1/2}
 \right]
 &&
 \biggr. \\
 \biggl.
 + \delta_{j+1/2}
 &\left[
 \overline{\overline {\left( e_{1v}\,e_{3v}\,v \right)}}^{\,i+1/2,j}
 \right]
 \biggr\}
 && \\
\end{flalign*}


+ && \displaybreak[0] \\
+%
+\equiv&  \frac{1} {2} \sum\limits_{i,j,k} \left( \frac{\zeta} {e_{3f}} \right)^2\;
+ \biggl\{ \delta_{i+1/2}
+ \left[ \overline{\overline {\left( e_{2u}\,e_{3u}\,u \right)}}^{\,i,j+1/2} \right]
+ + \delta_{j+1/2}
+ \left[ \overline{\overline {\left( e_{1v}\,e_{3v}\,v \right)}}^{\,i+1/2,j} \right]
+ \biggr\} && \\
+\end{flalign*}
Since $\overline {\;\cdot \;} $ and $\delta $ operators commute: $\delta_{i+1/2}
\left[ {\overline a^{\,i}} \right] = \overline {\delta_i \left[ a \right]}^{\,i+1/2}$,
and introducing the horizontal divergence $\chi $, it becomes:
+\begin{align*}
+\equiv& \sum\limits_{i,j,k}  \frac{1} {2} \left( \frac{\zeta} {e_{3f}} \right)^2 \; \overline{\overline{ e_{1T}\,e_{2T}\,e_{3T}\, \chi}}^{\,i+1/2,j+1/2} \;\;\equiv 0
+\qquad \qquad \qquad \qquad \qquad \qquad \qquad &&&&\\
+\end{align*}
+
+Note that the demonstration is done here for the relative potential
+vorticity but it still hold for the planetary ($f/e_3$) and the total
+potential vorticity $((\zeta +f) /e_3 )$. Another formulation of
+the two components of the vorticity term is optionally offered (ENE scheme) :
\begin{equation*}
\equiv \sum\limits_{i,j,k}  \frac{1} {2} \left( \zeta / e_{3f} \right)^2 \; \overline{\overline{ e_1T\,e_2T\,e_3T\, \chi}}^{\,i+1/2,j+1/2} \equiv 0
\end{equation*}

Note that the demonstration is done here for the relative potential
vorticity but it still hold for the planetary ($f/e_3$ ) and the total
potential vorticity $((\zeta +f) /e_3 )$. Another formulation of
the two components of the vorticity term is optionally offered :
\begin{equation*}
\frac{1} {e_3 }\nabla \times
 \left(
 \zeta \;{\textbf{k}}\times {\textbf {U}}_h
 \right)
+  \zeta \;{\textbf{k}}\times {\textbf {U}}_h
\equiv
\left( {{
@@ 228,43 +189,21 @@
enstrophy on the relative vorticity term and energy on the Coriolis term.
\begin{flalign*}
\int\limits_D \textbf{U}_h \times
 \left(
 \zeta \;\textbf{k} \times \textbf{U}_h
 \right)\;
 dv
 &&& \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
 \biggl\{ \quad
 & \overline {\left( \zeta / e_{3f} \right)
 \overline {\left( e_{1v}\,e_{3v}\,v \right)}^{\,i+1/2}} ^{\,j} \; e_{2u}\,e_{3u}\,u
 &&
 \biggr. \\
 \biggl.
 & \overline {\left( \zeta / e_{3f} \right)
 \overline {\left( e_{2u}\,e_{3u}\,u \right)}^{\,j+1/2}} ^{\,i} \; e_{1v}\,e_{3v}\,v \;
 \biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
\Bigl(
\zeta / e_{3f}
\Bigr)\;
 \biggl\{ \quad
 & \overline {\left( e_{1v}\,e_{3v} \,v \right)}^{\,i+1/2}\;\;
 \overline {\left( e_{2u}\,e_{3u} \,u \right)}^{\,j+1/2}
 &&
 \biggr. \\
 \biggl.
 & \overline {\left( e_{2u}\,e_{3u} \,u \right)}^{\,j+1/2}\;\;
 \overline {\left( e_{1v}\,e_{3v} \,v \right)}^{\,i+1/2}\;
 \biggr\} \;
+&\int\limits_D  \textbf{U}_h \cdot \left( \zeta \;\textbf{k} \times \textbf{U}_h \right) \; dv && \\
+\equiv& \sum\limits_{i,j,k} \biggl\{
+ \overline {\left( \frac{\zeta} {e_{3f}} \right)
+ \overline {\left( e_{1v}e_{3v}v \right)}^{\,i+1/2}} ^{\,j} \, e_{2u}e_{3u}u
+  \overline {\left( \frac{\zeta} {e_{3f}} \right)
+ \overline {\left( e_{2u}e_{3u}u \right)}^{\,j+1/2}} ^{\,i} \, e_{1v}e_{3v}v \;
+ \biggr\}
+\\
+\equiv& \sum\limits_{i,j,k} \frac{\zeta} {e_{3f}}
+ \biggl\{ \overline {\left( e_{1v}e_{3v} v \right)}^{\,i+1/2}\;
+ \overline {\left( e_{2u}e_{3u} u \right)}^{\,j+1/2}
+  \overline {\left( e_{2u}e_{3u} u \right)}^{\,j+1/2}\;
+ \overline {\left( e_{1v}e_{3v} v \right)}^{\,i+1/2}
+ \biggr\}
\equiv 0
 && \\
\end{flalign*}
+\end{flalign*}
+
% 
@@ 272,56 +211,30 @@
% 
\subsubsection{Gradient of Kinetic Energy / Vertical Advection}
\label{Apdx_C.1.2.2}
+\label{Apdx_C_zad}
The change of Kinetic Energy (KE) due to the vertical advection is exactly
balanced by the change of KE due to the horizontal gradient of KE~:
\begin{equation*}
 \int_D \textbf{U}_h \cdot \nabla_h \left( 1/2\;\textbf{U}_h^2 \right)\;dv
+ \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv
=  \int_D \textbf{U}_h \cdot w \frac{\partial \textbf{U}_h} {\partial k}\;dv
\end{equation*}
Indeed, using successively (II.1.10) and the continuity of mass (II.2.5),
(II.1.10), and the commutativity of operators $\overline {\,\cdot \,} $ and
$\delta$, and finally (II.1.11) successively in the horizontal and in the vertical
direction, it becomes:
\begin{flalign*}
\int_D \textbf{U}_h \cdot \nabla_h \left( 1/2\; \textbf{U}_h^2 \right)\;dv &&&\\
\end{flalign*}

\begin{flalign*}
\equiv \frac{1} {2} \sum\limits_{i,j,k}
 \biggl\{ \quad
 &\frac{1} {e_{1u}} \delta_{i+1/2}
 \left[
 \overline {u^2}^{\,i}
 + \overline {v^2}^{\,j}
 \right]
 \;u\;e_{1u}\,e_{2u}\,e_{3u}
 &&
 \biggr. \\
 \biggl.
 & + \frac{1} {e_{2v}} \delta_{j+1/2}
 \left[
 \overline {u^2}^{\,i}
 + \overline {v^2}^{\,j}
 \right]
 \;v\;e_{1v}\,e_{2v}\,e_{3v} \;
+Indeed, using successively \eqref{DOM_di_adj} ($i.e.$ the skew symmetry property of the $\delta$ operator) and the incompressibility, then again \eqref{DOM_di_adj}, then
+the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \eqref{DOM_mi_adj} ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) applied in the horizontal and vertical direction, it becomes:
+\begin{flalign*}
+&\int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv &&&\\
+\equiv& \frac{1}{2} \sum\limits_{i,j,k}
+ \biggl\{
+ \frac{1} {e_{1u}} \delta_{i+1/2}
+ \left[ \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right] u\,e_{1u}e_{2u}e_{3u}
+ + \frac{1} {e_{2v}} \delta_{j+1/2}
+ \left[ \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right] v\,e_{1v}e_{2v}e_{3v}
\biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv &\frac{1} {2}\quad \sum\limits_{i,j,k}
 \left(
 \overline {u^2}^{\,i}
 + \overline {v^2}^{\,j}
 \right)\;
\delta_k
 \left[
 e_{1T}\,e_{2T} \,w
 \right]
 && \\
\end{flalign*}
\begin{flalign*}
\equiv &\frac{1} {2}  \sum\limits_{i,j,k} \delta_{k+1/2}
+ &&& \displaybreak[0] \\
+%
+\equiv& \frac{1}{2} \sum\limits_{i,j,k}
+ \left( \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right)\;
+ \delta_k \left[ e_{1T}\,e_{2T} \,w \right]
+%
+\;\; \equiv \frac{1}{2} \sum\limits_{i,j,k} \delta_{k+1/2}
\left[
\overline{ u^2}^{\,i}
@@ 329,38 +242,26 @@
\right] \;
e_{1v}\,e_{2v}\,w
 && \\
\end{flalign*}
\begin{flalign*}
\equiv &\frac{1} {2} \quad \sum\limits_{i,j,k}
 \left(
 \overline {\delta_{k+1/2} \left[ u^2 \right]}^{\,i}
 + \overline {\delta_{k+1/2} \left[ v^2 \right]}^{\,j}
 \right)\;
 e_{1T}\,e_{2T} \,w
 && \\
\end{flalign*}
\begin{flalign*}
\equiv \frac{1} {2} \quad \sum\limits_{i,j,k}
 \biggl\{ \quad
 & \overline {e_{1T}\,e_{2T} \,w}^{\,i+1/2}\;2 \overline {u}^{\,k+1/2}\; \delta_{k+1/2}
 \left[ u \right]
 &&
 \biggr. \\
 \biggl.
 & + \overline {e_{1T}\,e_{2T} \,w}^{\,j+1/2}\;2 \overline {v}^{\,k+1/2}\; \delta_{k+1/2} \left[ v \right] \;
+ &&& \displaybreak[0]\\
+%
+\equiv &\frac{1} {2} \sum\limits_{i,j,k}
+ \left( \overline {\delta_{k+1/2} \left[ u^2 \right]}^{\,i}
+ + \overline {\delta_{k+1/2} \left[ v^2 \right]}^{\,j} \right) \; e_{1T}\,e_{2T} \,w
+ && \displaybreak[0] \\
+%
+\equiv &\frac{1} {2} \sum\limits_{i,j,k}
+ \biggl\{ \overline {e_{1T}\,e_{2T} \,w}^{\,i+1/2}\;2
+ \overline {u}^{\,k+1/2}\; \delta_{k+1/2} \left[ u \right] %&&& \\
+ + \overline {e_{1T}\,e_{2T} \,w}^{\,j+1/2}\;2 \overline {v}^{\,k+1/2}\; \delta_{k+1/2} \left[ v \right] \;
\biggr\}
 &&\\
\end{flalign*}
\begin{flalign*}
\equiv \quad \sum\limits_{i,j,k}
 \biggl\{ \quad
 &\frac{1} {b_u } \;
+ &&\displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
+ \biggl\{
+ \quad \frac{1} {b_u } \;
\overline {\Bigl\{ \overline {e_{1T}\,e_{2T} \,w}^{\,i+1/2}\,\delta_{k+1/2}
\left[ u \right]
\Bigr\} }^{\,k} \;u\;e_{1u}\,e_{2u}\,e_{3u}
 &&
 \biggr. \\
 \biggl.
 & + \frac{1} {b_v } \;
+ && \\
+ &\qquad \quad\; + \frac{1} {b_v } \;
\overline {\Bigl\{ \overline {e_{1T}\,e_{2T} \,w}^{\,j+1/2} \delta_{k+1/2}
\left[ v \right]
@@ 368,10 +269,8 @@
\biggr\}
&& \\
\end{flalign*}
\begin{flalign*}
\equiv \int\limits_D \textbf{U}_h \cdot w \frac{\partial \textbf{U}_h} {\partial k}\;dv &&&\\
\end{flalign*}

The main point here is that the respect of this property links the choice of the discrete formulation of vertical advection and of horizontal gradient of KE. Choosing one imposes the other. For example KE can also be defined as $1/2(\overline u^{\,i} + \overline v^{\,j})$, but this leads to the following expression for the vertical advection~:
+\equiv& \int\limits_D \textbf{U}_h \cdot w \frac{\partial \textbf{U}_h} {\partial k}\;dv &&&\\
+\end{flalign*}
+
+The main point here is that the satisfaction of this property links the choice of the discrete formulation of vertical advection and of horizontal gradient of KE. Choosing one imposes the other. For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. This leads to the following expression for the vertical advection:
\begin{equation*}
\frac{1} {e_3 }\; w\; \frac{\partial \textbf{U}_h } {\partial k}
@@ 385,6 +284,6 @@
\end{array}} } \right)
\end{equation*}

This formulation requires one more horizontal mean, and thus the use of 9 velocity points instead of 3. This is the reason why it has not been retained in the model.
+a formulation that requires a additional horizontal mean compare to the one used in NEMO. Nine velocity points have to be used instead of 3. This is the reason why it has not been choosen.
+
% 
% Coriolis and advection terms: flux form
@@ 399,5 +298,5 @@
\label{Apdx_C.1.3.1}
In flux from the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the ``metric'' term. This altered Coriolis parameter is thus discretised at Fpoint. It is given by:
+In flux from the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the ``metric'' term. This altered Coriolis parameter is discretised at Fpoint. It is given by:
\begin{equation*}
f+\frac{1} {e_1 e_2 }
@@ 409,5 +308,5 @@
\end{equation*}
Then any of the scheme presented above for the vorticity term in the vector invariant formulation can be used, except of course the mixed scheme. However, the energy conserving scheme has exclusively been used to date.
+The ENE scheme is then applied to obtain the vorticity term in flux form. It therefore conserves the total KE. The demonstration is same as for the vorticity term in vector invariant form (\S\ref{Apdx_C_vor}).
% 
@@ 417,5 +316,5 @@
\label{Apdx_C.1.3.2}
The flux form operator of the momentum advection is evaluated using a second order finite difference scheme. Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum. Moreover, it conserves the horizontal kinetic energy, that is :
+The flux form operator of the momentum advection is evaluated using a centered second order finite difference scheme. Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum. Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is :
\begin{equation} \label{Apdx_C_I.3.10}
@@ 429,100 +328,49 @@
Let us demonstrate this property for the first term of the scalar product (i.e. considering just the the terms associated with the icomponent of the advection):
\begin{flalign*}
\int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right)\;dv &&&\\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+&\int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv &&&\\
+%
+\equiv& \sum\limits_{i,j,k}
+\biggl\{ \frac{1} {e_{1u}\, e_{2u}\,e_{3u}} \biggl(
+ \delta_{i+1/2} \left[ \overline {e_{2u}\,e_{3u}\,u}^{\,i} \;\overline u^{\,i} \right]
+ + \delta_j \left[ \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\;\overline u^{\,j+1/2} \right]
+ &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad
+ + \delta_k \left[ \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2}\;\overline u^{\,k+1/2} \right]
+ \biggr) \; \biggr\} \, e_{1u}\,e_{2u}\,e_{3u} \;u
+ &&& \displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
\biggl\{
 \frac{1} {e_{1u}\, e_{2u}\,e_{3u}}
 \biggl( \quad \biggr.
 & \delta_{i+1/2}
 \left[
 \overline {e_{2u}\,e_{3u}\,u}^{\,i}\;\overline u^{\,i}
 \right]
 && \\
 & + \delta_j
 \left[
 \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\;\overline u^{\,j+1/2}
 \right]
 &&
 \biggr.\\
 \biggl.
 & + \delta_k \biggl.
 \left[
 \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2}\;\overline u^{\,k+1/2}
 \right]\;
 \biggr)\;
 \biggr\} \,
 e_{1u}\,e_{2u}\,e_{3u} \;u
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
 \biggl\{
 \delta_{i+1/2}
 \left[
 \overline {e_{2u}\,e_{3u}\,u}^{\,i}\; \overline u^{\,i}
 \right]
 & + \delta_j
 \left[
 \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\;\overline u^{\,j+1/2}
 \right]
 &&
 \biggr.\\
 \biggl.
 & + \delta_k
 \left[
 \overline {e_{1w}\,e_{2w}\,w}^{\,i+12}\;\overline u^{\,k+1/2}
 \right]\;
 \biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+ \delta_{i+1/2} \left[ \overline {e_{2u}\,e_{3u}\,u}^{\,i}\; \overline u^{\,i} \right]
+ + \delta_j \left[ \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\;\overline u^{\,j+1/2} \right]
+ &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
+ + \delta_k \left[ \overline {e_{1w}\,e_{2w}\,w}^{\,i+12}\;\overline u^{\,k+1/2} \right]
+ \; \biggr\} \; u &&& \displaybreak[0] \\
+%
+\equiv&  \sum\limits_{i,j,k}
\biggl\{
\overline {e_{2u}\,e_{3u}\,u}^{\,i}\; \overline u^{\,i} \delta_i
\left[ u \right]
 & + \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\; \overline u^{\,j+1/2} \delta_{j+1/2}
+ + \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2}\; \overline u^{\,j+1/2} \delta_{j+1/2}
\left[ u \right]
 &&
 \biggr. \\
 \biggl.
 & + \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2}\; \overline u^{\,k+1/2} \delta_{k+1/2}
 \left[ u \right]
 \biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+ &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
+ + \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2}\; \overline u^{\,k+1/2} \delta_{k+1/2} \left[ u \right] \biggr\} && \displaybreak[0] \\
+%
+\equiv&  \sum\limits_{i,j,k}
\biggl\{
\overline {e_{2u}\,e_{3u}\,u}^{\,i} \delta_i \left[ u^2 \right]
 & + \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2} \delta_{j+/2} \left[ u^2 \right]
 &&
 \biggr. \\
 \biggl.
 & + \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2} \delta_{k+1/2} \left[ u^2 \right]
+ + \overline {e_{1u}\,e_{3u}\,v}^{\,i+1/2} \delta_{j+/2} \left[ u^2 \right]
+ + \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2} \delta_{k+1/2} \left[ u^2 \right]
\biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+ && \displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
\bigg\{
e_{2u}\,e_{3u}\,u\; \delta_{i+1/2} \left[ \overline {u^2}^{\,i} \right]
 & + e_{1u}\,e_{3u}\,v\; \delta_{j+1/2} \; \left[ \overline {u^2}^{\,i} \right]
 &&
 \biggr.\\
 \biggl.
 & + e_{1w}\,e_{2w}\,w\; \delta_{k+1/2} \left[ \overline {u^2}^{\,i} \right]
+ + e_{1u}\,e_{3u}\,v\; \delta_{j+1/2} \; \left[ \overline {u^2}^{\,i} \right]
+ + e_{1w}\,e_{2w}\,w\; \delta_{k+1/2} \left[ \overline {u^2}^{\,i} \right]
\biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+ && \displaybreak[0] \\
+%
+\equiv& \sum\limits_{i,j,k}
\overline {u^2}^{\,i}
\biggl\{
@@ 530,11 +378,9 @@
+ \delta_{j+1/2} \left[ e_{1u}\,e_{3u}\,v \right]
+ \delta_{k+1/2} \left[ e_{1w}\,e_{2w}\,w \right]
 \biggr\}
+ \biggr\} \;\; \equiv 0
&&& \\
\end{flalign*}
\begin{flalign*}
\equiv 0 &&&\\
\end{flalign*}
+When the UBS scheme is used to evaluate the flux form momentum advection, the discrete operator does not contribute to the global budget of linear momentum (flux form). The horizontal kinetic energy is not conserved, but forced to decrease (the scheme is diffusive).
% 
@@ 545,5 +391,5 @@
A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. In $z$coordinates, this properties is satisfied locally with the choice of discretization we have made (property (II.1.9)~). When the equation of state is linear (i.e. when a advectivediffusive equation for density can be derived from those of temperature and salinity) the change of KE due to the work of pressure forces is balanced by the change of potential energy due to buoyancy forces.
+A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. In $z$coordinate, this properties is satisfied locally on a Cgrid with 2nd order finite differences (property \eqref{Eq_DOM_curl_grad}). When the equation of state is linear ($i.e.$ when an advectivediffusive equation for density can be derived from those of temperature and salinity) the change of KE due to the work of pressure forces is balanced by the change of potential energy due to buoyancy forces:
\begin{equation*}
\int_D  \frac{1} {\rho_o} \left. \nabla p^h \right_z \cdot \textbf{U}_h \;dv
@@ 551,80 +397,49 @@
\end{equation*}
This property is satisfied in both $z $and $s$coordinates. Indeed, defining the depth of a $T$point, $z_T$ defined as the sum of the vertical scale factors at $w$points starting from the surface, it can be written as:
\begin{flalign*}
\int_D  \frac{1} {\rho_o} \left. \nabla p^h \right_z \cdot \textbf{U}_h \;dv &&& \\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
 \biggl\{ \;
 &  \frac{1} {\rho_o e_{1u}}
 \Bigl(
 \delta_{i+1/2} \left[ p^h \right]  g\;\overline \rho^{\,i+1/2}\;\delta_{i+1/2}
 \left[ z_T \right]
 \Bigr)\;
 u\;e_{1u}\,e_{2u}\,e_{3u}
 &&
 \biggr. \\
 \biggl.
 &  \frac{1} {\rho_o e_{2v}}
 \Bigl(
 \delta_{j+1/2} \left[ p^h \right]  g\;\overline \rho^{\,j+1/2}\delta_{j+1/2}
 \left[ z_T \right]
 \Bigr)\;
 v\;e_{1v}\,e_{2v}\,e_{3v} \;
 \biggr\}
 && \\
\end{flalign*}

Using (II.1.10), the continuity equation (II.2.5), and the hydrostatic
equation (II.2.4), it turns out to be:
\begin{multline*}
\equiv \frac{1} {\rho_o} \sum\limits_{i,j,k}
 \biggl\{
+This property can be satisfied in discrete sense for both $z$ and $s$coordinates. Indeed, defining the depth of a $T$point, $z_T$ defined as the sum of the vertical scale factors at $w$points starting from the surface, the workof pressure forces can be written as:
+\begin{flalign*}
+&\int_D  \frac{1} {\rho_o} \left. \nabla p^h \right_z \cdot \textbf{U}_h \;dv &&& \\
+\equiv& \sum\limits_{i,j,k} \biggl\{ \;  \frac{1} {\rho_o e_{1u}} \Bigl(
+\delta_{i+1/2} \left[ p^h \right]  g\;\overline \rho^{\,i+1/2}\;\delta_{i+1/2} \left[ z_T \right]
+ \Bigr) \; u\;e_{1u}\,e_{2u}\,e_{3u}
+ && \\ & \qquad \qquad
+  \frac{1} {\rho_o e_{2v}} \Bigl(
+\delta_{j+1/2} \left[ p^h \right]  g\;\overline \rho^{\,j+1/2}\delta_{j+1/2} \left[ z_T \right]
+ \Bigr) \; v\;e_{1v}\,e_{2v}\,e_{3v} \;
+ \biggr\} && \\
+\end{flalign*}
+
+Using \eqref{DOM_di_adj}, $i.e.$ the skew symmetry property of the $\delta$ operator, \eqref{Eq_wzv}, the continuity equation), and \eqref{Eq_dynhpg_sco}, the hydrostatic
+equation in $s$coordinate, it turns out to be:
+\begin{flalign*}
+\equiv& \frac{1} {\rho_o} \sum\limits_{i,j,k} \biggl\{
e_{2u}\,e_{3u} \;u\;g\; \overline \rho^{\,i+1/2}\;\delta_{i+1/2}[ z_T]
 + e_{1v}\,e_{3v} \;v\;g\; \overline \rho^{\,j+1/2}\;\delta_{j+1/2}[ z_T]
 \biggr. \\
\shoveright {
 +\biggl.
 \Bigl(
 \delta_i[ e_{2u}\,e_{3u}\,u] + \delta_j [ e_{1v}\,e_{3v}\,v]
 \Bigr)\;p^h
 \biggr\} } \\
\end{multline*}

\begin{multline*}
\equiv \frac{1} {\rho_o } \sum\limits_{i,j,k}
+ + e_{1v}\,e_{3v} \;v\;g\; \overline \rho^{\,j+1/2}\;\delta_{j+1/2}[ z_T]
+&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \;\;\,
+ +\Bigl( \delta_i[ e_{2u}\,e_{3u}\,u] + \delta_j [ e_{1v}\,e_{3v}\,v] \Bigr)\;p^h \biggr\} &&\\
+%
+\equiv& \frac{1} {\rho_o } \sum\limits_{i,j,k}
\biggl\{
e_{2u}\,e_{3u} \;u\;g\; \overline \rho^{\,i+1/2} \delta_{i+1/2} \left[ z_T \right]
+ e_{1v}\,e_{3v} \;v\;g\; \overline \rho^{\,j+1/2} \delta_{j+1/2} \left[ z_T \right]
 \biggr. \\
\shoveright {
 \biggl.
  \delta_k
 \left[ e_{1w} e_{2w}\,w \right]\;p^h
 \biggr\} } \\
\end{multline*}

\begin{multline*}
\equiv \frac{1} {\rho_o } \sum\limits_{i,j,k}
+ &&&\\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \;\;\,
+  \delta_k \left[ e_{1w} e_{2w}\,w \right]\;p^h \biggr\} &&&\\
+%
+\equiv& \frac{1} {\rho_o } \sum\limits_{i,j,k}
\biggl\{
e_{2u}\,e_{3u} \;u\;g\; \overline \rho^{\,i+1/2}\;\delta_{i+1/2} \left[ z_T \right]
 + e_{1v}\,e_{3v} \;v\;g\; \overline \rho^{\,j+1/2} \;\delta_{j+1/2} \left[ z_T \right] \biggr. \\
\shoveright{
 \biggl.
+ + e_{1v}\,e_{3v} \;v\;g\; \overline \rho^{\,j+1/2} \;\delta_{j+1/2} \left[ z_T \right]
+ &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \;\;\,
+ e_{1w} e_{2w} \;w\;\delta_{k+1/2} \left[ p_h \right]
 \biggr\} } \\
\end{multline*}

\begin{multline*}
\equiv \frac{g} {\rho_o} \sum\limits_{i,j,k}
+ \biggr\} &&&\\
+%
+\equiv& \frac{g} {\rho_o} \sum\limits_{i,j,k}
\biggl\{
e_{2u}\,e_{3u} \;u\; \overline \rho^{\,i+1/2}\;\delta_{i+1/2} \left[ z_T \right]
 + e_{1v}\,e_{3v} \;v\; \overline \rho^{\,j+1/2}\;\delta_{j+1/2} \left[ z_T \right] \biggr. \\
\shoveright{
 \biggl.
+ + e_{1v}\,e_{3v} \;v\; \overline \rho^{\,j+1/2}\;\delta_{j+1/2} \left[ z_T \right]
+ &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \;\;\,
 e_{1w} e_{2w} \;w\;e_{3w} \overline \rho^{\,k+1/2}
 \biggr\} } \\
\end{multline*}
+ \biggr\} &&&\\
+\end{flalign*}
noting that by definition of $z_T$, $\delta_{k+1/2} \left[ z_T \right] \equiv  e_{3w} $, thus:
\begin{multline*}
@@ 639,7 +454,7 @@
\biggr\} } \\
\end{multline*}
Using (II.1.10), it becomes~:
\begin{flalign*}
\equiv  \frac{g} {\rho_o} \sum\limits_{i,j,k} z_T
+Using \eqref{DOM_di_adj}, it becomes:
+\begin{flalign*}
+\equiv&  \frac{g} {\rho_o} \sum\limits_{i,j,k} z_T
\biggl\{
\delta_i \left[ e_{2u}\,e_{3u}\,u\; \overline \rho^{\,i+1/2} \right]
@@ 648,12 +463,12 @@
\biggr\}
&&& \\
\end{flalign*}
\begin{flalign*}
\equiv \int_D \nabla \cdot \left( \rho \, \textbf{U} \right)\;g\;z\;\;dv &&& \\
+%
+\equiv& \int_D \nabla \cdot \left( \rho \, \textbf{U} \right)\;g\;z\;\;dv &&& \\
\end{flalign*}
Note that this property strongly constraints the discrete expression of both
the depth of $T$points and of the term added to the pressure gradient in
$s$coordinates.
+$s$coordinate. Nevertheless, it is almost never satisfied as a linear equation of state
+is rarely used.
% 
@@ 669,62 +484,34 @@
With the rigidlid approximation, the change of KE due to the work of surface pressure forces is exactly zero. This is satisfied in discrete form, at the precision required on the elliptic solver used to solve this equation. This can be demonstrated as follows:
\begin{flalign*}
\int\limits_D  \frac{1} {\rho_o} \nabla_h \left( p_s \right) \cdot \textbf{U}_h \;dv &&& \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
 \biggl\{ \quad
 & \left(
  M_u  \frac{1} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right]
 \right)\;
 u\;e_{1u}\,e_{2u}\,e_{3u}
 &&
 \biggr. \\
 \biggl.
 + & \left(
  M_v + \frac{1} {H_v \,e_{1v}} \delta_i \left[ \partial_t \psi \right]
 \right)\;
 v\;e_{1v}\,e_{2v}\,e_{3v} \;
 \biggr\}
 && \\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j}
 \Biggl\{ \quad
 &\biggl(
  M_u  \frac{1} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right]
 \biggr)
 \biggl(
 \sum\limits_k u\;e_{3u}
 \biggr)\;
 e_{1u}\,e_{2u}
 &&
 \Biggr. \\
 \Biggl.
 + & \biggl(
  M_v + \frac{1} {H_v \,e_{1v}} \delta_i \left[ \partial_t \psi \right]
 \biggr)
 \biggl(
 \sum\limits_k v\;e_{3v}
 \biggr)\;
 e_{1v}\,e_{2v} \;
 \Biggr\}
+\int\limits_D  \frac{1} {\rho_o} \nabla_h \left( p_s \right) \cdot \textbf{U}_h \;dv% &&& \\
+%
+&\equiv \sum\limits_{i,j,k} \biggl\{ \;
+ \left(  M_u  \frac{1} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right] \right)\;
+ u\;e_{1u}\,e_{2u}\,e_{3u}
+&&&\\& \qquad \;\;\,
+ + \left(  M_v + \frac{1} {H_v \,e_{1v}} \delta_i \left[ \partial_t \psi \right] \right)\;
+ v\;e_{1v}\,e_{2v}\,e_{3v} \; \biggr\}
+&&&\\
+\\
+%
+&\equiv \sum\limits_{i,j} \Biggl\{ \;
+ \biggl(  M_u  \frac{1} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right] \biggr)
+ \biggl( \sum\limits_k u\;e_{3u} \biggr)\; e_{1u}\,e_{2u}
+&&&\\& \qquad \;\;\,
+ + \biggl(  M_v + \frac{1} {H_v \,e_{1v}} \delta_i \left[ \partial_t \psi \right] \biggr)
+ \biggl( \sum\limits_k v\;e_{3v} \biggr)\; e_{1v}\,e_{2v} \; \Biggr\}
&& \\
\end{flalign*}
using the relation between \textit{$\psi $} and the vertically sum of the velocity, it becomes~:

\begin{flalign*}
\equiv \sum\limits_{i,j}
 \biggl\{ \quad
 &\left(
+%
+\intertext{using the relation between \textit{$\psi $} and the vertically sum of the velocity, it becomes:}
+%
+&\equiv \sum\limits_{i,j}
+ \biggl\{ \;
+ \left( \;\;\,
M_u + \frac{1} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right]
\right)\;
e_{1u} \,\delta_j
\left[ \partial_t \psi \right]
 &&
 \biggr. \\
 \biggl.
 +& \left(
+ && \\ & \qquad \;\;\,
+ + \left(
 M_v + \frac{1} {H_v \,e_{1v}} \delta_i \left[ \partial_t \psi \right]
\right)\;
@@ 732,16 +519,13 @@
\biggr\}
&& \\
\end{flalign*}
applying the adjoint of the $\delta$ operator, it is now:

\begin{flalign*}
\equiv \sum\limits_{i,j}  \partial_t \psi \;
 \biggl\{ \quad
 & \delta_{j+1/2} \left[ e_{1u} M_u \right]
+%
+\intertext{applying the adjoint of the $\delta$ operator, it is now:}
+%
+&\equiv \sum\limits_{i,j}  \partial_t \psi \;
+ \biggl\{ \;
+ \delta_{j+1/2} \left[ e_{1u} M_u \right]
 \delta_{i+1/2} \left[ e_{1v} M_v \right]
 &&
 \biggr. \\
 \biggl.
 +& \delta_{i+1/2}
+ && \\ & \qquad \;\;\,
+ + \delta_{i+1/2}
\left[ \frac{e_{2v}} {H_v \,e_{2v}} \delta_i \left[ \partial_t \psi \right]
\right]
@@ 749,10 +533,9 @@
\left[ \frac{e_{1u}} {H_u \,e_{2u}} \delta_j \left[ \partial_t \psi \right]
\right]
 \biggr\}
 \equiv 0
 && \\
\end{flalign*}

The last equality is obtained using (II.2.3), the discrete barotropic streamfunction time evolution equation. By the way, this shows that (II.2.3) is the only way do compute the streamfunction, otherwise the surface pressure forces will work. Nevertheless, since the elliptic equation verified by $\psi $ is solved numerically by an iterative solver, the property is only satisfied at the precision required on the solver.
+ \biggr\} &&&\\
+ &\equiv 0 && \\
+\end{flalign*}
+
+The last equality is obtained using \eqref{Eq_dynspg_rl}, the discrete barotropic streamfunction time evolution equation. By the way, this shows that \eqref{Eq_dynspg_rl} is the only way do compute the streamfunction, otherwise the surface pressure forces will work. Nevertheless, since the elliptic equation verified by $\psi $ is solved numerically by an iterative solver, the property is only satisfied at the precision required on the solver.
% ================================================================
@@ 763,6 +546,5 @@
The numerical schemes are written such that the heat and salt contents are conserved by the internal dynamics (equations in flux form, second order centered finite differences). As a form flux is used to compute the temperature and salinity, the quadratic form of these quantities (i.e. their variance) is globally conserved, too. There is generally no strict conservation of mass, as the equation of state is non linear with respect to $T$ and $S$. In practice, the mass is conserved with a very good accuracy.

+All the numerical schemes used in NEMO are written such that the tracer content is conserved by the internal dynamics and physics (equations in flux form). For advection, only the CEN2 scheme ($i.e.$ 2nd order finite different scheme) conserves the global variance of tracer. Nevertheless the other schemes ensure that the global variance decreases ($i.e.$ they are at least slightly diffusive). For diffusion, all the schemes ensure the decrease of the total tracer variance, but the isoneutral operator. There is generally no strict conservation of mass, as the equation of state is non linear with respect to $T$ and $S$. In practice, the mass is conserved with a very good accuracy.
% 
% Advection Term
@@ 771,40 +553,25 @@
\label{Apdx_C.2.1}
Conservation of the tracer

The flux form
\begin{flalign*}
\int_D \nabla \cdot \left( T \textbf{U} \right)\;dv &&&
\end{flalign*}
\begin{flalign*}
 \equiv \sum\limits_{i,j,k} \left\{
+Whatever the advection scheme considered it conserves of the tracer content as all the scheme are written in flux form. Let $\tau$ be the tracer interpolated at velocity point (whatever the interpolation is). The conservation of the tracer content is obtained as follows:
+\begin{flalign*}
+&\int_D \nabla \cdot \left( T \textbf{U} \right)\;dv &&&\\
+&\equiv \sum\limits_{i,j,k} \biggl\{
\frac{1} {e_{1T}\,e_{2T}\,e_{3T}}
 \left(
 \delta_i
 \left[
 e_{2u}\,e_{3u} \,\overline T^{\,i+1/2}\,u
 \right]
 \right. \right.
& + \left. \delta_j \left[ e_{1v}\,e_{3v} \,\overline T^{\,j+1/2}\,v \right] \right) && \\
 & + \left. \frac{1} {e_{3T}} \delta_k \left[ \overline T^{\,k+1/2}\,w \right] \ \ \right\}
 \ \ e_{1T}\,e_{2T}\,e_{3T} &&
\end{flalign*}

\begin{flalign*}
 \equiv& \sum\limits_{i,j,k} \left\{
+ \left( \delta_i \left[ e_{2u}\,e_{3u}\; u \;\tau_u \right]
+ + \delta_j \left[ e_{1v}\,e_{3v}\; v \;\tau_v \right] \right)
+&&&\\& \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
+ + \frac{1} {e_{3T}} \delta_k \left[ w\;\tau \right] \biggl\} e_{1T}\,e_{2T}\,e_{3T} &&&\\
+%
+&\equiv \sum\limits_{i,j,k} \left\{
\delta_i \left[ e_{2u}\,e_{3u} \,\overline T^{\,i+1/2}\,u \right]
+ \delta_j \left[ e_{1v}\,e_{3v} \,\overline T^{\,j+1/2}\,v \right]
+ \delta_k \left[ e_{1T}\,e_{2T} \,\overline T^{\,k+1/2}\,w \right] \right\}
 &&
\end{flalign*}
\begin{flalign*}
 \equiv 0 &&&
\end{flalign*}

Conservation of the variance of tracer
\begin{flalign*}
\int\limits_D T\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\
\end{flalign*}
\begin{flalign*}
+ && \\
+&\equiv 0 &&&
+\end{flalign*}
+
+The conservation of the variance of tracer can be achieved only with the CEN2 scheme. It can be demonstarted as follows:
+\begin{flalign*}
+&\int\limits_D T\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\
\equiv& \sum\limits_{i,j,k} T\;
\left\{
@@ 814,16 +581,12 @@
\right\}
&& \\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+\equiv& \sum\limits_{i,j,k}
\left\{
 e_{2u}\,e_{3u} \overline T^{\,i+1/2}\,u\,\delta_{i+1/2} \left[ T \right] \right.
 & e_{1v}\,e_{3v} \overline T^{\,j+1/2}\,v\;\delta_{j+1/2} \left[ T \right]
 &&\\
 & \left. e_{1T}\,e_{2T} \overline T^{\,k+1/2}w\;\delta_{k+1/2} \left[ T \right]
+  e_{1v}\,e_{3v} \overline T^{\,j+1/2}\,v\;\delta_{j+1/2} \left[ T \right]
+&&&\\& \qquad \qquad \qquad \qquad \qquad \qquad \quad \;
+  \left. e_{1T}\,e_{2T} \overline T^{\,k+1/2}w\;\delta_{k+1/2} \left[ T \right]
\right\}
&&\\
\end{flalign*}
\begin{flalign*}
\equiv& \frac{1} {2} \sum\limits_{i,j,k}
\Bigl\{
@@ 833,6 +596,4 @@
\Bigr\}
&& \\
\end{flalign*}
\begin{flalign*}
\equiv& \frac{1} {2} \sum\limits_{i,j,k} T^2
\Bigl\{
@@ 841,8 +602,5 @@
+ \delta_k \left[ e_{1T}\,e_{2T}\,w \right]
\Bigr\}
 &&\\
\end{flalign*}
\begin{flalign*}
\equiv 0 &&&
+\quad \equiv 0 &&&
\end{flalign*}
@@ 866,7 +624,5 @@
These properties of the horizontal diffusive operator are a direct
consequence of properties (II.1.8) and (II.1.9). When the vertical curl of
the horizontal diffusion of momentum (discrete sense) is taken, the term
associated to the horizontal gradient of the divergence is zero locally.
+consequence of properties \eqref{Eq_DOM_curl_grad} and \eqref{Eq_DOM_div_curl}. When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, the term associated to the horizontal gradient of the divergence is zero locally.
% 
@@ 878,11 +634,12 @@
The lateral momentum diffusion term conserves the potential vorticity :
\begin{flalign*}
\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times
+&\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times
\Bigl[ \nabla_h
\left( A^{\,lm}\;\chi \right)
 \nabla_h \times
\left( A^{\,lm}\;\zeta \; \textbf{k} \right)
 \Bigr]\;dv &&& \\
\end{flalign*}
+ \Bigr]\;dv = 0
+\end{flalign*}
+%%%%%%%%%% recheck here.... (gm)
\begin{flalign*}
= \int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times
@@ 891,5 +648,4 @@
\Bigr]\;dv &&& \\
\end{flalign*}

\begin{flalign*}
\equiv& \sum\limits_{i,j}
@@ 907,8 +663,7 @@
\right\}
&& \\
\end{flalign*}
Using (II.1.10), it follows:

\begin{flalign*}
+%
+\intertext{Using \eqref{DOM_di_adj}, it follows:}
+%
\equiv& \sum\limits_{i,j,k}
\,\left\{
@@ 928,76 +683,49 @@
The lateral momentum diffusion term dissipates the horizontal kinetic
energy:
\begin{flalign*}
+The lateral momentum diffusion term dissipates the horizontal kinetic energy:
+%\begin{flalign*}
+\begin{equation*}
+\begin{split}
\int_D \textbf{U}_h \cdot
 \left[ \nabla_h
 \left( A^{\,lm}\;\chi \right)
  \nabla_h \times
 \left( A^{\,lm}\;\zeta \;\textbf{k} \right)
 \right]\;dv &&& \\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k} \quad
 &\left\{
 \frac{1} {e_{1u}} \delta_{i+1/2}
 \left[ A_T^{\,lm} \chi \right]
  \frac{1} {e_{2u}\,e_{3u}} \delta_j
 \left[ A_f^{\,lm} e_{3f} \zeta \right]
 \right\}\;
 e_{1u}\,e_{2u}\,e_{3u} \;u
 &&\\
 & + \left\{
 \frac{1} {e_{2u}} \delta_{j+1/2}
 \left[ A_T^{\,lm} \chi \right]
 + \frac{1} {e_{1v}\,e_{3v}} \delta_i
 \left[ A_f^{\,lm} e_{3f} \zeta \right]
 \right\}\;
 e_{1v}\,e_{2u}\,e_{3v} \;v
 && \\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k} \quad
 &\left\{
 e_{2u}\,e_{3u} \;u\;\delta_{i+1/2}
 \left[ A_T^{\,lm} \chi \right]
  e_{1u} \;u\;\delta_j
 \left[ A_f^{\,lm} e_{3f} \zeta \right]
 \right\}
 &&\\
 & + \left\{
 e_{1v}\,e_{3v} \;v\;\delta_{j+1/2}
 \left[ A_T^{\,lm} \chi \right]
 + e_{2v} \;v\;\delta_i
 \left[ A_f^{\,lm} e_{3f} \zeta \right]
 \right\}
 &&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k} \quad
 & \Bigl(
 \delta_i
 \left[ e_{2u}\,e_{3u} \;u \right]
 + \delta_j
 \left[ e_{1v}\,e_{3v} \;v \right]
 \Bigr)\;
 A_T^{\,lm} \chi
 && \\
 & \Bigl(
 \delta_{i+1/2}
 \left[ e_{2v} \;v \right]
  \delta_{j+1/2}
 \left[ e_{1u} \;u \right]
 \Bigr)\;
 A_f^{\,lm} e_{3f} \zeta
 &&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
  A_T^{\,lm} \,\chi^2 \;e_{1T}\,e_{2T}\,e_{3T}
  A_f^{\,lm} \,\zeta^2 \;e_{1f}\,e_{2f}\,e_{3f}
 \quad \leq 0
 &&&\\
\end{flalign*}
+ \left[ \nabla_h \right. & \left. \left( A^{\,lm}\;\chi \right)
+  \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right) \right] \; dv \\
+\\ %%%
+\equiv& \sum\limits_{i,j,k}
+ \left\{
+ \frac{1} {e_{1u}} \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right]
+  \frac{1} {e_{2u}\,e_{3u}} \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right]
+ \right\} \; e_{1u}\,e_{2u}\,e_{3u} \;u \\
+&\;\; + \left\{
+ \frac{1} {e_{2u}} \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right]
+ + \frac{1} {e_{1v}\,e_{3v}} \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right]
+ \right\} \; e_{1v}\,e_{2u}\,e_{3v} \;v \qquad \\
+\\ %%%
+\equiv& \sum\limits_{i,j,k}
+ \Bigl\{
+ e_{2u}\,e_{3u} \;u\; \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right]
+  e_{1u} \;u\; \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right]
+ \Bigl\}
+ \\
+&\;\; + \Bigl\{
+ e_{1v}\,e_{3v} \;v\; \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right]
+ + e_{2v} \;v\; \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right]
+ \Bigl\} \\
+\\ %%%
+\equiv& \sum\limits_{i,j,k}
+  \Bigl(
+ \delta_i \left[ e_{2u}\,e_{3u} \;u \right]
+ + \delta_j \left[ e_{1v}\,e_{3v} \;v \right]
+ \Bigr) \; A_T^{\,lm} \chi \\
+&\;\;  \Bigl(
+ \delta_{i+1/2} \left[ e_{2v} \;v \right]
+  \delta_{j+1/2} \left[ e_{1u} \;u \right]
+ \Bigr)\; A_f^{\,lm} e_{3f} \zeta \\
+\\ %%%
+\equiv& \sum\limits_{i,j,k}
+  A_T^{\,lm} \,\chi^2 \;e_{1T}\,e_{2T}\,e_{3T}
+  A_f ^{\,lm} \,\zeta^2 \;e_{1f }\,e_{2f }\,e_{3f}
+\quad \leq 0 \\
+\end{split}
+\end{equation*}
% 
@@ 1011,5 +739,5 @@
coefficients are horizontally uniform:
\begin{flalign*}
\int\limits_D \zeta \; \textbf{k} \cdot \nabla \times
+&\int\limits_D \zeta \; \textbf{k} \cdot \nabla \times
\left[
\nabla_h
@@ 1018,14 +746,10 @@
\left( A^{\,lm}\;\zeta \; \textbf{k} \right)
\right]\;dv &&&\\
\end{flalign*}
\begin{flalign*}
 = A^{\,lm} \int \limits_D \zeta \textbf{k} \cdot \nabla \times
+&= A^{\,lm} \int \limits_D \zeta \textbf{k} \cdot \nabla \times
\left[
\nabla_h \times
\left( \zeta \; \textbf{k} \right)
 \right]\;dv &&&\\
\end{flalign*}
\begin{flalign*}
\equiv A^{\,lm} \sum\limits_{i,j,k} \zeta \;e_{3f}
+ \right]\;dv &&&\displaybreak[0]\\
+&\equiv A^{\,lm} \sum\limits_{i,j,k} \zeta \;e_{3f}
\left\{
\delta_{i+1/2}
@@ 1041,9 +765,8 @@
\right\}
&&&\\
\end{flalign*}
Using (II.1.10), it becomes~:

\begin{flalign*}
\equiv  A^{\,lm} \sum\limits_{i,j,k}
+%
+\intertext{Using \eqref{DOM_di_adj}, it follows:}
+%
+&\equiv  A^{\,lm} \sum\limits_{i,j,k}
\left\{
\left(
@@ 1055,7 +778,6 @@
\left[ e_{3f} \zeta \right]
\right)^2 e_{1u}\,e_{2u}\,e_{3u}
 \right\}
 \; \leq \;0
 &&&\\
+ \right\} &&&\\
+& \leq \;0 &&&\\
\end{flalign*}
@@ 1072,5 +794,5 @@
horizontally uniform.
\begin{flalign*}
 \int\limits_D \nabla_h \cdot
+& \int\limits_D \nabla_h \cdot
\Bigl[
\nabla_h
@@ 1084,7 +806,5 @@
dv
&&&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+&\equiv \sum\limits_{i,j,k}
\left\{
\delta_i
@@ 1100,9 +820,8 @@
\right\}
&&&\\
\end{flalign*}
Using (II.1.10), it follows:

\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+%
+\intertext{Using \eqref{DOM_di_adj}, it follows:}
+%
+&\equiv \sum\limits_{i,j,k}
 \left\{
\frac{e_{2u}\,e_{3u}} {e_{1u}} A_u^{\,lm} \delta_{i+1/2}
@@ 1126,53 +845,23 @@
\begin{flalign*}
 \int\limits_D \chi \;\nabla_h \cdot
 \left[
 \nabla_h
 \left( A^{\,lm}\;\chi \right)
  \nabla_h \times
 \left( A^{\,lm}\;\zeta \;\textbf{k} \right)
 \right]\;
 dv
 = A^{\,lm} \int\limits_D \chi \;\nabla_h \cdot \nabla_h
 \left( \chi \right)\;
 dv
&&&\\
\end{flalign*}

\begin{flalign*}
\equiv A^{\,lm} \sum\limits_{i,j,k} \frac{1} {e_{1T}\,e_{2T}\,e_{3T}} \chi
+&\int\limits_D \chi \;\nabla_h \cdot
+ \left[ \nabla_h \left( A^{\,lm}\;\chi \right)
+  \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right) \right]\; dv
+ = A^{\,lm} \int\limits_D \chi \;\nabla_h \cdot \nabla_h \left( \chi \right)\; dv &&&\\
+%
+&\equiv A^{\,lm} \sum\limits_{i,j,k} \frac{1} {e_{1T}\,e_{2T}\,e_{3T}} \chi
\left\{
 \delta_i
 \left[
 \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2}
 \left[ \chi \right]
 \right]
 + \delta_j
 \left[
 \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2}
 \left[ \chi \right]
 \right]
 \right\} \;
 e_{1T}\,e_{2T}\,e_{3T}
 &&&\\
\end{flalign*}
Using (II.1.10), it turns out to be:

\begin{flalign*}
\equiv  A^{\,lm} \sum\limits_{i,j,k}
+ \delta_i \left[ \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[ \chi \right] \right]
+ + \delta_j \left[ \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[ \chi \right] \right]
+ \right\} \; e_{1T}\,e_{2T}\,e_{3T} &&&\\
+%
+\intertext{Using \eqref{DOM_di_adj}, it turns out to be:}
+%
+&\equiv  A^{\,lm} \sum\limits_{i,j,k}
\left\{
 \left(
 \frac{1} {e_{1u}} \delta_{i+1/2}
 \left[ \chi \right]
 \right)^2
 e_{1u}\,e_{2u}\,e_{3u}
 + \left(
 \frac{1} {e_{2v}} \delta_{j+1/2}
 \left[ \chi \right]
 \right)^2
 e_{1v}\,e_{2v}\,e_{3v}
 \right\} \;
 \leq 0
 &&&\\
+ \left( \frac{1} {e_{1u}} \delta_{i+1/2} \left[ \chi \right] \right)^2 e_{1u}\,e_{2u}\,e_{3u}
++ \left( \frac{1} {e_{2v}} \delta_{j+1/2} \left[ \chi \right] \right)^2 e_{1v}\,e_{2v}\,e_{3v}
+ \right\} \; &&&\\
+&\leq 0 &&&\\
\end{flalign*}
@@ 1185,5 +874,5 @@
As for the lateral momentum physics, the continuous form of the vertical diffusion of momentum satisfies the several integral constraints. The first two are associated to the conservation of momentum and the dissipation of horizontal kinetic energy:
\begin{flalign*}
+\begin{align*}
\int\limits_D
\frac{1} {e_3 }\; \frac{\partial } {\partial k}
@@ 1191,9 +880,9 @@
\frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}
\right)\;
 dv \quad = \vec{\textbf{0}}
 &&&\\
\end{flalign*}
and
\begin{flalign*}
+ dv \qquad \quad &= \vec{\textbf{0}}
+ \\
+%
+\intertext{and}
+%
\int\limits_D
\textbf{U}_h \cdot
@@ 1202,7 +891,7 @@
\frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}
\right)\;
 dv \quad \leq 0
 &&&\\
\end{flalign*}
+ dv \quad &\leq 0
+ \\
+\end{align*}
The first property is obvious. The second results from:
@@ 1217,5 +906,5 @@
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+&\equiv \sum\limits_{i,j,k}
\left(
u\; \delta_k
@@ 1233,9 +922,8 @@
\right)
&&&\\
\end{flalign*}
as the horizontal scale factor do not depend on $k$, it follows:

\begin{flalign*}
\equiv  \sum\limits_{i,j,k}
+%
+\intertext{as the horizontal scale factor do not depend on $k$, it follows:}
+%
+&\equiv  \sum\limits_{i,j,k}
\left(
\frac{A_u^{\,vm}} {e_{3uw}}
@@ 1254,4 +942,5 @@
&&&\\
\end{flalign*}
+
The vorticity is also conserved. Indeed:
\begin{flalign*}
@@ 1532,8 +1221,7 @@
constraint of conservation of tracers:
\begin{flalign*}
\int\limits_D T\;\nabla \cdot \left( A\;\nabla T \right)\;dv &&&\\
\end{flalign*}
\begin{flalign*}
\equiv \sum\limits_{i,j,k}
+&\int\limits_D \nabla \cdot \left( A\;\nabla T \right)\;dv &&&\\
+\\
+&\equiv \sum\limits_{i,j,k}
\biggl\{ \biggr.
\delta_i
@@ 1543,22 +1231,19 @@
\right]
+ \delta_j
 &\left[
+ \left[
A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2}
\left[ T \right]
\right]
 &&\\
 \biggl.
+ &&\\ & \qquad \qquad \qquad \qquad \qquad \qquad \quad \;\;\;
+ \delta_k
 &\left[
+ \left[
A_w^{\,vT} \frac{e_{1T}\,e_{2T}} {e_{3T}} \delta_{k+1/2}
\left[ T \right]
\right]
 \biggr\}
+ \biggr\} \quad \equiv 0
&&\\
\end{flalign*}
\begin{flalign*}
\equiv 0 &&&\\
\end{flalign*}

+
+In fact, this property is simply resulting from the flux form of the operator.
% 
@@ 1570,31 +1255,14 @@
constraint of dissipation of tracer variance:
\begin{flalign*}
\int\limits_D T\;\nabla \cdot \left( A\;\nabla T \right)\;dv &&&\\
\end{flalign*}

\begin{flalign*}
\equiv \sum\limits_{i,j,k} T
 \biggl\{ \biggr.
 \delta_i
 \left[
 A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2}
 \left[ T \right]
 \right]
 + \delta_j
 &\left[
 A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2}
 \left[ T \right]
 \right]
 && \\
 \biggl.
 + \delta_k
 &\left[
 A_w^{\,vT} \frac{e_{1T}\,e_{2T}} {e_{3T}} \delta_{k+1/2}
 \left[ T \right]
 \right]
 \biggr\}
 &&\\
\end{flalign*}

+\int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv &&&\\
+&\equiv \sum\limits_{i,j,k} \; T
+\biggl\{ \biggr.
+ \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[T\right] \right]
+& + \delta_j \left[ A_v^{\,lT} \frac{e_{1v} \,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[T\right] \right]
+ \quad&& \\
+ \biggl.
+&&+ \delta_k \left[A_w^{\,vT}\frac{e_{1T}\,e_{2T}} {e_{3T}}\delta_{k+1/2}\left[T\right]\right]
+\biggr\} &&
+\end{flalign*}
\begin{flalign*}
\equiv  \sum\limits_{i,j,k}
@@ 1626,2 +1294,5 @@
\end{flalign*}
+
+%%%% end of appendix in gm comment
+%}
Index: trunk/DOC/TexFiles/Chapters/Annex_D.tex
===================================================================
 trunk/DOC/BETA/Chapters/Annex_D.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Annex_D.tex (revision 994)
@@ 1,12 +1,12 @@
% ================================================================
% Chapter Ñ Appendix D : Coding Rules
+% Appendix D Ñ Coding Rules
% ================================================================
\chapter{Appendix D : Coding Rules}
+\chapter{Coding Rules}
\label{Apdx_D}
\minitoc
The "model life" is about ten years and its software, composed by about one
hundred programs, is used by many people who are scientists or students and
+A "model life" is more than ten years. Its software, composed by a few
+hundred modules, is used by many people who are scientists or students and
do not necessary know very well all computer aspects. Moreover, a well
thoughtout programme is easy to read and understand, less difficult to
@@ 26,17 +26,18 @@
 flexible.
To satisfy part of these aims, OPA is written with a coding standard which
is close to the ECMWF rule, named DOCTOR [Gibson,1986]. These rules present
some advantages like :
+To satisfy part of these aims, \NEMO is written with a coding standard which
+is close to the ECMWF rules, named DOCTOR \citep{Gibson_TR86}. These rules present some advantages like :
 to provide a well presented program
 to enable the extraction of several levels of online documentation

 to use rules for variable names which allow recognition of their type
(integer, real, parameter, common variables, etc. ) so that debugging is
+(integer, real, parameter, local or shared variables, etc. ) so that debugging is
facilitated.
\textbf{The program structure}
+% ================================================================
+% The program structure
+% ================================================================
+\section{The program structure}
+\label{Apdx_D_structure}
Each program begins with a set of headline comments containing :
@@ 61,5 +62,9 @@
 A program has not more than 200 to 300 lines.
\textbf{Coding conventions}
+% ================================================================
+% Coding conventions
+% ================================================================
+\section{Coding conventions}
+\label{Apdx_D_coding}
 Use of the universal language \textsc{Fortran} 5 ANSI 77, with non
@@ 106,5 +111,9 @@
 STOP must be well documented with the name of the subroutine or a number.
\textbf{Naming Conventions.}
+% ================================================================
+% Naming Conventions
+% ================================================================
+\section{Naming Conventions}
+\label{Apdx_D_naming}
The purpose of the naming conventions is to use prefix letters to classify
@@ 117,14 +126,7 @@
\begin{center}
\begin{tabular}{p{50pt}p{50pt}p{50pt}p{50pt}p{50pt}p{50pt}p{50pt}}
+\hline Type \par / Status & integer& real& logical & character& double \par precision& complex \\
\hline
Type \par / \par Status &
integer&
real&
logical &
character&
double \par precision&
complex \\
\hline
global \par or \par common&
+public &
\textbf{m n} \par \textit{but not } \par \textbf{nam}&
\textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{sf}&
@@ 179,7 +181,2 @@
\end{table}
%

\textbf{References}

{\small Gibson, J. K., 1986: Standard software development and maintenance. }{\small \textit{Tech. memorandum}}{\small , Operational Dep., ECMWF, Reading, UK.}

Index: trunk/DOC/TexFiles/Chapters/Chap_DOM.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_DOM.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_DOM.tex (revision 994)
@@ 8,14 +8,25 @@
% Missing things:
%  istate: description of the initial state
+%  istate: description of the initial state ==> this has to be put elsewhere..
+% perhaps in MISC ? By the way the initialisation of T S and dynamics
+% should be put outside of DOM routine (better with TRC staff and offline
+% tracers)
%  daymod: definition of the time domain (nit000, nitend andd the calendar)
% geo2ocean: how to switch from geographic to mesh coordinate
%  domclo: closed sea and lakes.... management of closea sea area : specific to global configuration, both forced and coupled




Having defined the continuous equations in Chap.~\ref{PE}, we need to choose a discretization on a grid, and numerical algorithms. In the present chapter, we provide a general description of the staggered grid used in OPA, and other information relevant to the main directory routines (time stepping, main program) as well as the DOM (DOMain) directory.
+\gmcomment{STEVEN :maybe a picture of the directory structure in the introduction which could be referred to here, would help ==> to be added}
+%%%%
+
+
+\newpage
+$\ $\newline % force a new ligne
+
+
+Having defined the continuous equations in Chap.~\ref{PE}, we need to choose a
+discretization on a grid, and numerical algorithms. In the present chapter, we
+provide a general description of the staggered grid used in \NEMO, and other
+information relevant to the main directory routines (time stepping, main program)
+as well as the DOM (DOMain) directory.
% ================================================================
@@ 34,13 +45,40 @@
\begin{figure}[!tb] \label{Fig_cell} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_cell.pdf}
\caption{Arrangement of variables. $T$ indicates scalar points where temperature, salinity, density, pressure and horizontal divergence are defined. ($u$,$v$,$w$) indicates vector points, and $f$ indicates vorticity points where both relative and planetary vorticities are defined}
+\caption{Arrangement of variables. $T$ indicates scalar points where temperature,
+salinity, density, pressure and horizontal divergence are defined. ($u$,$v$,$w$)
+indicates vector points, and $f$ indicates vorticity points where both relative and
+planetary vorticities are defined}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The numerical techniques used to solve the Primitive Equations in this model are based on the traditional, centred secondorder finite difference approximation. Special attention has been given to the homogeneity of the solution in the three space directions. The arrangement of variables is the
same in all directions. It consists in cells centred on scalar points ($T$, $S$, $p$, $\rho$) with vector points $(u, v, w)$ defined in the centre of each face of the cells (Fig. \ref{Fig_cell}). This is the generalisation to three dimensions of the wellknown ``C'' grid in Arakawa's classification. The relative and planetary vorticity, $\zeta$ and $f$, are defined in the centre of each vertical edge and the barotropic stream function $\psi$ is defined at horizontal points overlying the $\zeta$ and $f$points.

The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined by the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$. The gridpoints are located at integer or integer and a half value of $(i,j,k)$ as indicated on Table \ref{Tab_cell}. In all the following, subscripts $u$, $v$, $w$, $f$, $uw$, $vw$ or $fw$ indicate the position of the gridpoint where the scale factors are defined. Each scale factor is defined as the local analytical value provided by \eqref{Eq_scale_factors}. As a result, the mesh on which partial derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, and $\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size unity. Discrete partial derivatives are formulated by the traditional, centred second order finite difference approximation while the scale factors are chosen equal to their local analytical value. An important point here is that the partial derivative of the scale factors must be evaluated by centred finite difference approximation, not from their
analytical expression. This preserves the symmetry of the discrete set of equations and therefore allows satisfying many of the continuous properties (see { \colorbox{yellow}{Annexe C}). A similar, related remark can be made about the domain size: when needed, an area, volume, or the total ocean depth must be evaluated as the sum of the relevant scale factors (see \eqref{DOM_bar}) in the next section).
+The numerical techniques used to solve the Primitive Equations in this model are
+based on the traditional, centred secondorder finite difference approximation.
+Special attention has been given to the homogeneity of the solution in the three
+space directions. The arrangement of variables is the same in all directions.
+It consists of cells centred on scalar points ($T$, $S$, $p$, $\rho$) with vector
+points $(u, v, w)$ defined in the centre of each face of the cells (Fig. \ref{Fig_cell}).
+This is the generalisation to three dimensions of the wellknown ``C'' grid in
+Arakawa's classification \citep{Mesinger_Arakawa_Bk76}. The relative and
+planetary vorticity, $\zeta$ and $f$, are defined in the centre of each vertical edge
+and the barotropic stream function $\psi$ is defined at horizontal points overlying
+the $\zeta$ and $f$points.
+
+The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined
+by the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$.
+The gridpoints are located at integer or integer and a half value of $(i,j,k)$ as
+indicated on Table \ref{Tab_cell}. In all the following, subscripts $u$, $v$, $w$,
+$f$, $uw$, $vw$ or $fw$ indicate the position of the gridpoint where the scale
+factors are defined. Each scale factor is defined as the local analytical value
+provided by \eqref{Eq_scale_factors}. As a result, the mesh on which partial
+derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, and
+$\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size of unity. Discrete partial derivatives are formulated by the traditional, centred second order
+finite difference approximation while the scale factors are chosen equal to their
+local analytical value. An important point here is that the partial derivative of the
+scale factors must be evaluated by centred finite difference approximation, not
+from their analytical expression. This preserves the symmetry of the discrete set
+of equations and therefore satisfies many of the continuous properties (see
+Appendix~\ref{Apdx_C}). A similar, related remark can be made about the domain
+size: when needed, an area, volume, or the total ocean depth must be evaluated
+as the sum of the relevant scale factors (see \eqref{DOM_bar}) in the next section).
\begin{table}[!tb] \label{Tab_cell}
@@ 56,5 +94,8 @@
fw & $i+1/2$ & $j+1/2$ & $k+1/2$ \\ \hline
\end{tabular}
\caption{Location of gridpoints as a function of integer or integer and a half value of the column, line or level. This indexation is only used for the writing of semidiscrete equation. In the code, the indexation use integer value only and has a reverse direction in the vertical (see \S\ref{DOM_Num_Index})}
+\caption{Location of gridpoints as a function of integer or integer and a half value
+of the column, line or level. This indexing is only used for the writing of the semi
+discrete equation. In the code, the indexing uses integer values only and has a
+reverse direction in the vertical (see \S\ref{DOM_Num_Index})}
\end{center}
\end{table}
@@ 66,14 +107,18 @@
\label{DOM_operators}
Given the values of a variable $q$ at adjacent points, the derivation and averaging operators at the midpoint between them are:
+Given the values of a variable $q$ at adjacent points, the differencing and
+averaging operators at the midpoint between them are:
\begin{subequations} \label{Eq_di_mi}
\begin{align}
 \delta _i [q] &= \ \ q(i+1/2)  q(i1/2) \\
 \overline q^i &= \left\{ q(i+1/2) + q(i1/2) \right\} \; / \; 2
+ \delta _i [q] &= \ \ q(i+1/2)  q(i1/2) \\
+ \overline q^{\,i} &= \left\{ q(i+1/2) + q(i1/2) \right\} \; / \; 2
\end{align}
\end{subequations}
Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and $k+1/2$. Following
\eqref{Eq_PE_grad} and \eqref{Eq_PE_lap}, the gradient of a variable $q$ defined at $T$point has its three components defined at $(u,v,w)$ while its Laplacien is defined at $T$point. These operators have the following discrete forms in the curvilinear $s$coordinate system:
+Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and
+$k+1/2$. Following \eqref{Eq_PE_grad} and \eqref{Eq_PE_lap}, the gradient of a
+variable $q$ defined at a $T$point has its three components defined at $u$, $v$
+and $w$points while its Laplacien is defined at $T$point. These operators have
+the following discrete forms in the curvilinear $s$coordinate system:
\begin{equation} \label{Eq_DOM_grad}
\nabla q\equiv \frac{1}{e_{1u} }\delta _{i+1/2} \left[ q \right]\;\,{\rm {\bf i}}
@@ 91,5 +136,7 @@
\end{multline}
Following \eqref{Eq_PE_curl} and \eqref{Eq_PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ defined at vector points $(u,v,w)$ has its three curl components defined at $(vw,uw,f)$ and its divergence defined at $T$points:
+Following \eqref{Eq_PE_curl} and \eqref{Eq_PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ defined at vector points $(u,v,w)$ has its three curl
+components defined at $vw$, $uw$, and $f$points, and its divergence defined
+at $T$points:
\begin{equation} \label{Eq_DOM_curl}
\begin{split}
@@ 110,14 +157,26 @@
\end{equation}
In the special case of pure $z$coordinates system, \eqref{Eq_DOM_lap} and \eqref{Eq_DOM_div} can be simplified. In this case, the vertical scale factor becomes a function of the single variable $k$ and thus does not depend on the horizontal location of a grid point. It can be simplified from outside and inside the $\delta _i$ and $\delta_j$ operators.

The vertical average over the whole water column denoted by an overbar becomes for a quantity $q$ which is a masked field (i.e. equal to zero inside solid area):
+In the special case of a pure $z$coordinate system, \eqref{Eq_DOM_lap} and
+\eqref{Eq_DOM_div} can be simplified. In this case, the vertical scale factor
+becomes a function of the single variable $k$ and thus does not depend on the
+horizontal location of a grid point. For example \eqref{Eq_DOM_div} reduces to:
+\begin{equation*}
+\nabla \cdot {\rm {\bf A}}=\frac{1}{e_{1T} e_{2T} }\left( {\delta
+_i \left[ {e_{2u} a_1 } \right]+\delta _j \left[ {e_{1v} a_2 }
+\right]} \right)+\frac{1}{e_{3T} }\delta _k \left[ {a_3 } \right]
+\end{equation*}
+
+The vertical average over the whole water column denoted by an overbar becomes
+for a quantity $q$ which is a masked field (i.e. equal to zero inside solid area):
\begin{equation} \label{DOM_bar}
\bar q = \frac{1}{H}\int_{k^b}^{k^o} {q\;e_{3q} \,dk}
\equiv \frac{1}{H_q }\sum\limits_k {q\;e_{3q} }
\end{equation}
where $H_q$ the ocean depth, is the masked sum of the vertical scale factors at q points, $k^b$ and $k^o$ are the bottom and surface $k$index, and the symbol $k^o$ referring to a summation over all grid points of the same species in the direction indicated by the subscript (here $k$).

In continuous, the following properties are satisfied:
+where $H_q$ is the ocean depth, which is the masked sum of the vertical scale
+factors at $q$ points, $k^b$ and $k^o$ are the bottom and surface $k$indices,
+and the symbol $k^o$ refers to a summation over all grid points of the same type
+in the direction indicated by the subscript (here $k$).
+
+In continuous form, the following properties are satisfied:
\begin{equation} \label{Eq_DOM_curl_grad}
\nabla \times \nabla q ={\rm {\bf {0}}}
@@ 127,22 +186,33 @@
\end{equation}
It is straight forward to demonstrate that these properties are verified locally in discrete form as soon as the scalar $q$ is taken at $T$points and the vector \textbf{A} has its components defined at vector points $(u,v,w)$.

Let $a$ and $b$ be two fields defined on the ocean mesh, extended to zero inside continental area. By integration by part it can be shown that the derivation operators ($\delta_i$, $\delta_j$ and $\delta_k$) are antisymmetric linear operators, and further that the averaging operators $\overline{\cdot}^i$, $\overline{\cdot}^j$ and $\overline{\cdot}^k$) are symmetric linear operators, i.e.,
\begin{equation} \label{DOM_di_adj}
\sum\limits_i {a_i \;\delta _i \left[ b \right]} \equiv \sum\limits_i
{\delta _{i+1/2} \left[ a \right]\;b_{i+1/2} }
\end{equation}
\begin{equation} \label{DOM_mi_adj}
\sum\limits_i {a_i \;\overline b ^i} \equiv \sum\limits_i {\overline a ^{i+1/2}\;b_{i+1/2} }
\end{equation}

In other words, the adjoint of the derivation and averaging operators are $\delta_i^*=\delta_{i+1/2}$ and $\overline{\cdot}^{i\,*}= \overline{\cdot}^{i+1/2}$, respectively. These two properties will be used extensively in the \colorbox{yellow} {Appendix C} to
+It is straightforward to demonstrate that these properties are verified locally in
+discrete form as soon as the scalar $q$ is taken at $T$points and the vector
+\textbf{A} has its components defined at vector points $(u,v,w)$.
+
+Let $a$ and $b$ be two fields defined on the mesh, with value zero inside
+continental area. Using integration by parts it can be shown that the differencing
+operators ($\delta_i$, $\delta_j$ and $\delta_k$) are antisymmetric linear
+operators, and further that the averaging operators $\overline{\,\cdot\,}^{\,i}$,
+$\overline{\,\cdot\,}^{\,k}$ and $\overline{\,\cdot\,}^{\,k}$) are symmetric linear
+operators, $i.e.$
+\begin{align}
+\label{DOM_di_adj}
+\sum\limits_i { a_i \;\delta _i \left[ b \right]}
+ &\equiv \sum\limits_i {\delta _{i+1/2} \left[ a \right]\;b_{i+1/2} } \\
+\label{DOM_mi_adj}
+\sum\limits_i { a_i \;\overline b^{\,i}}
+ & \equiv \quad \sum\limits_i {\overline a ^{\,i+1/2}\;b_{i+1/2} }
+\end{align}
+
+In other words, the adjoint of the differencing and averaging operators are
+$\delta_i^*=\delta_{i+1/2}$ and
+${(\overline{\,\cdot \,}^{\,i})}^*= \overline{\,\cdot\,}^{\,i+1/2}$, respectively.
+These two properties will be used extensively in the Appendix~\ref{Apdx_C} to
demonstrate integral conservative properties of the discrete formulation chosen.
% 
% Numerical Indexation
% 
\subsection{Numerical Indexation}
+% Numerical Indexing
+% 
+\subsection{Numerical Indexing}
\label{DOM_Num_Index}
@@ 150,47 +220,95 @@
\begin{figure}[!tb] \label{Fig_index_hor} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_index_hor.pdf}
\caption{Horizontal integer indexation used in the \textsc{Fortran} code. The dashed area indicates the cell in which variables contained in arrays have the same $i$ and $j$indices}
+\caption{Horizontal integer indexing used in the \textsc{Fortran} code. The dashed
+area indicates the cell in which variables contained in arrays have the same
+$i$ and $j$indices}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The array representation used in the \textsc{Fortran} code requires an integer indexation while the analytical definition of the mesh (see \S\ref{DOM_cell}) is associated with the use of integer values of $(i,j,k)$ for $T$points whereas all the other points use both integer and integer and a half values of $(i,j,k)$. Therefore a specific integer indexation must be defined for the latter gridpoints
(i.e. velocity and vorticity gridpoints). Furthermore, it has been chosen to change the direction of the vertical indexation so that the surface level is at $k=1$.
+The array representation used in the \textsc{Fortran} code requires an integer
+indexing while the analytical definition of the mesh (see \S\ref{DOM_cell}) is
+associated with the use of integer values for $T$points and both integer and
+integer and a half values for all the other points. Therefore a specific integer
+indexing must be defined for points other than $T$points ($i.e.$ velocity and
+vorticity gridpoints). Furthermore, the direction of the vertical indexing has
+been changed so that the surface level is at $k=1$.
% 
% Horizontal Indexation
+% Horizontal Indexing
% 
\subsubsection{Horizontal Indexation}
+\subsubsection{Horizontal Indexing}
\label{DOM_Num_Index_hor}
The indexation in the horizontal plane has been chosen as shown in Fig.\ref{Fig_index_hor}. For an increasing $i$ index ($j$ index), the $T$point and the eastward $u$point (northward $v$point) have the same index (see the dashed area in Fig.\ref{Fig_index_hor}). A $T$point and its nearby northeast $f$point have the same $i$and $j$indices.
+The indexing in the horizontal plane has been chosen as shown in Fig.\ref{Fig_index_hor}. For an increasing $i$ index ($j$ index), the $T$point
+and the eastward $u$point (northward $v$point) have the same index
+(see the dashed area in Fig.\ref{Fig_index_hor}). A $T$point and its
+nearest northeast $f$point have the same $i$and $j$indices.
% 
% Vertical Indexation
+% Vertical indexing
% 
\subsubsection{Vertical Indexation}
+\subsubsection{Vertical Indexing}
\label{DOM_Num_Index_vertical}
In the vertical plane, the chosen indexation requires special attention since the $k$axis is reoriented downward in the \textsc{Fortran} code compared to the indexation used for the semidiscrete equations and given in \S\ref{DOM_cell}. The sea surface corresponds to the $w$level $k=1$ like the $T$level just below (Fig.\ref{Fig_index_vert}). The last $w$level ($k=jpk$) is either the ocean bottom or inside the ocean floor while the last $T$level is always inside the floor (Fig.\ref{Fig_index_vert}). Note that for an increasing $k$ index, a $w$point and the $T$point just below have the same $k$ index, in opposition to what is done in the horizontal plane where
it is the $T$point and the nearby velocity points in the direction of the horizontal axis that have the same $i$ or $j$ index (compare the dashed area in Fig.\ref{Fig_index_hor} and \ref{Fig_index_vert}). As the scale factors are chosen to be strictly positive, \emph{a minus sign appears in the \textsc{Fortran} code before all the vertical derivatives of the discrete equations given in this documentation}.
+In the vertical, the chosen indexing requires special attention since the
+$k$axis is reorientated downward in the \textsc{Fortran} code compared
+to the indexing used in the semidiscrete equations and given in \S\ref{DOM_cell}.
+The sea surface corresponds to the $w$level $k=1$ which is the same index
+as $T$level just below (Fig.\ref{Fig_index_vert}). The last $w$level ($k=jpk$)
+either corresponds to the ocean floor or is inside the bathymetry while the last
+$T$level is always inside the bathymetry (Fig.\ref{Fig_index_vert}). Note that
+for an increasing $k$ index, a $w$point and the $T$point just below have the
+same $k$ index, in opposition to what is done in the horizontal plane where
+it is the $T$point and the nearest velocity points in the direction of the horizontal
+axis that have the same $i$ or $j$ index (compare the dashed area in Fig.\ref{Fig_index_hor} and \ref{Fig_index_vert}). Since the scale factors are chosen
+to be strictly positive, a \emph{minus sign} appears in the \textsc{Fortran} code
+\emph{before all the vertical derivatives} of the discrete equations given in this
+documentation.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!pt] \label{Fig_index_vert} \begin{center}
\includegraphics[width=.90\textwidth]{./Figures/Fig_index_vert.pdf}
\caption{Vertical integer indexation used in the \textsc{Fortran } code. Note that the $k$axis is oriented downward. The dashed area indicates the cell in which variables contained in arrays have the same $k$index.}
+\caption{Vertical integer indexing used in the \textsc{Fortran } code. Note that
+the $k$axis is orientated downward. The dashed area indicates the cell in
+which variables contained in arrays have the same $k$index.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
% 
% Vertical Indexation
+% Domain Size
% 
\subsubsection{Domain size}
+\subsubsection{Domain Size}
\label{DOM_size}
The total size of the computational domain is set by the parameters \jp{jpiglo}, \jp{jpjglo} and \jp{jpk} in the $i$, $j$ and $k$ directions respectively. They are given as parameters in the \mdl{par\_oce} module (or additional files included in this module such as \textit{par\_ORCA\_R2.h90}, specific to a given configuration). The use of parameters rather than variables (together with dynamic allocation of arrays) was made because it ensured that the compiler would optimize the executable code efficiently, especially on vector machines (optimization may be less efficient when the problem size is unknown at the time of compilation). Nevertheless, it is possible to set up the code with full dynamical allocation by using the AGRIF packaged \colorbox{yellow}{(ref agrif!+ ref part of the doc)}. Note that are other parameters in \mdl{par\_oce} that refer to the domain size. The two parameters $jpidta$ and $jpjdta$, may be larger than $jpiglo$, $jpjglo$ when the user wants to use only a subregion of a given configuration. This is the "zoom" capability described in \S\ref{MISC_zoom}. In most applications of the model, $jpidta=jpiglo$, $jpjdta=jpjglo$, and $jpizoom=jpjzoom=1$. Parameters $jpi$ and $jpj$ refer to the size of each processor subdomain when the code is run in parallel using domain decomposition (\key{mpp\_mpi} defined, see \S\ref{LBC_mpp}).
+The total size of the computational domain is set by the parameters \jp{jpiglo},
+\jp{jpjglo} and \jp{jpk} in the $i$, $j$ and $k$ directions respectively. They are
+given as parameters in the \mdl{par\_oce} module\footnote{When a specific
+configuration is used (ORCA2 global ocean, etc...) the parameter are actually
+defined in additional files introduced by \mdl{par\_oce} module via CPP
+\textit{include} command. For example, ORCA2 parameters are set in
+\textit{par\_ORCA\_R2.h90} file}. The use of parameters rather than variables
+(together with dynamic allocation of arrays) was chosen because it ensured that
+the compiler would optimize the executable code efficiently, especially on vector
+machines (optimization may be less efficient when the problem size is unknown
+at the time of compilation). Nevertheless, it is possible to set up the code with full
+dynamical allocation by using the AGRIF packaged \citep{Debreu_al_CG2008}.
+%
+\gmcomment{ add the following ref
+\colorbox{yellow}{(ref part of the doc)} }
+%
+Note that are other parameters in \mdl{par\_oce} that refer to the domain size.
+The two parameters $jpidta$ and $jpjdta$ may be larger than $jpiglo$, $jpjglo$
+when the user wants to use only a subregion of a given configuration. This is
+the "zoom" capability described in \S\ref{MISC_zoom}. In most applications of
+the model, $jpidta=jpiglo$, $jpjdta=jpjglo$, and $jpizoom=jpjzoom=1$. Parameters
+$jpi$ and $jpj$ refer to the size of each processor subdomain when the code is
+run in parallel using domain decomposition (\key{mpp\_mpi} defined, see
+\S\ref{LBC_mpp}).
% ================================================================
% Domain: Horizontal Grid (mesh)
% ================================================================
\section{Domain: Horizontal Grid (mesh) (\mdl{domhgr} module)}
+\section [Domain: Horizontal Grid (mesh) (\textit{domhgr})]
+ {Domain: Horizontal Grid (mesh) \small{(\mdl{domhgr} module)} }
\label{DOM_hgr}
@@ 201,16 +319,31 @@
\label{DOM_hgr_coord_e}
The ocean mesh (i.e. the position of all the scalar and vector points) is defined by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. The gridpoints are located at integer or integer and a half values of as indicated in Table~\ref{Tab_cell}. The associated scale factors are defined using the analytical first derivative of the transformation \eqref{Eq_scale_factors}. These definitions are done in two modules, \mdl{domhgr} and \mdl{domzgr}, which provide the horizontal and vertical meshes, respectively. This section deals with the horizontal mesh parameters.

In a horizontal plane, the location of all the model grid points is defined from the analytical expressions of the latitude $\varphi$ and the longitude $\lambda$ as a function of $(i,j)$. The horizontal scale factors are calculated using \eqref{Eq_scale_factors}. For example, when the latitude and longitude are function of a single value ($j$ and $i$, respectively) (geographical configuration of the mesh), the horizontal mesh definition reduces to define the wanted $\varphi(j)$, $\varphi'(j)$, $\lambda(i)$, and $\lambda'(i)$ in the \mdl{domhgr} module. The model computes the gridpoint positions and scale factors in the horizontal plane as follows:
+The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined
+by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$.
+The gridpoints are located at integer or integer and a half values of as indicated
+in Table~\ref{Tab_cell}. The associated scale factors are defined using the
+analytical first derivative of the transformation \eqref{Eq_scale_factors}. These
+definitions are done in two modules, \mdl{domhgr} and \mdl{domzgr}, which
+provide the horizontal and vertical meshes, respectively. This section deals with
+the horizontal mesh parameters.
+
+In a horizontal plane, the location of all the model grid points is defined from the
+analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a
+function of $(i,j)$. The horizontal scale factors are calculated using
+\eqref{Eq_scale_factors}. For example, when the longitude and latitude are
+function of a single value ($i$ and $j$, respectively) (geographical configuration
+of the mesh), the horizontal mesh definition reduces to define the wanted
+$\lambda(i)$, $\varphi(j)$, and their derivatives $\lambda'(i)$ $\varphi'(j)$ in the
+\mdl{domhgr} module. The model computes the gridpoint positions and scale
+factors in the horizontal plane as follows:
\begin{flalign*}
\lambda_T &\equiv \text{glamt} = \lambda(i) & \varphi_T &\equiv \text{gphit} = \varphi(j)\\
\lambda_u &\equiv \text{glamu}= \lambda(i+1/2)& \varphi_u &\equiv \text{gphiu}= \varphi(j)\\
\lambda_v &\equiv \text{glamv}= \lambda(i) & \varphi_v &\equiv \text{gphiv} = \varphi(j+1/2)\\
\lambda_f &\equiv \text{glamf }= \lambda(i+1/2)& \varphi_f &\equiv \text{gphif }= \varphi(j+1/2)
+\lambda_T &\equiv \text{glamt}= \lambda(i) & \varphi_T &\equiv \text{gphit} = \varphi(j)\\
+\lambda_u &\equiv \text{glamu}= \lambda(i+1/2)& \varphi_u &\equiv \text{gphiu}= \varphi(j)\\
+\lambda_v &\equiv \text{glamv}= \lambda(i) & \varphi_v &\equiv \text{gphiv} = \varphi(j+1/2)\\
+\lambda_f &\equiv \text{glamf }= \lambda(i+1/2)& \varphi_f &\equiv \text{gphif }= \varphi(j+1/2)
\end{flalign*}
\begin{flalign*}
e_{1T} &\equiv \text{e1t} = r_a \lambda'(i) \; \cos\varphi(j) &
e_{2T} &\equiv \text{e2t} = r_a \varphi'(j)\\
+e_{2T} &\equiv \text{e2t} = r_a \varphi'(j) \\
e_{1u} &\equiv \text{e1t} = r_a \lambda'(i+1/2) \; \cos\varphi(j) &
e_{2u} &\equiv \text{e2t} = r_a \varphi'(j)\\
@@ 220,33 +353,91 @@
e_{2f} &\equiv \text{e2t} = r_a \varphi'(j+1/2)
\end{flalign*}
where the last letter of each computational name indicates the grid point considered and $r_a$ is the earth radius (defined in \mdl{phycst} along with all universal constants). Note that the horizontal position and scale factors of $w$points are exactly equal to those of $T$points, thus no specific arrays are defined at those gridpoints.

Note that the definition of the scale factors  as the analytical first derivative of the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$  is specific to the OPA model \citep{Marti1992}. As an example, $e_{1T}$ is defined locally at a $T$point, whereas many other models on a C grid choose to define such a scale factor as the distance between the $U$points on each side of the $T$point. Relying on an analytical transformation has two advantages: firstly, there is no ambiguity in the scale factors appearing in the discrete equations, since they are first introduced in the continuous equations; secondly, analytical transformations encourage good practice by the definition of smooth grids \citep{Treguier1996}. An example of the effect of such a choice is shown in Fig.~\ref{Fig_zgr_e3}.
+where the last letter of each computational name indicates the grid point
+considered and $r_a$ is the earth radius (defined in \mdl{phycst} along with
+all universal constants). Note that the horizontal position of and scale factors
+at $w$points are exactly equal to those of $T$points, thus no specific arrays
+are defined at $w$points.
+
+Note that the definition of the scale factors ($i.e.$ as the analytical first derivative
+of the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) is
+specific to the \NEMO model \citep{Marti1992}. As an example, $e_{1T}$ is defined
+locally at a $T$point, whereas many other models on a C grid choose to define
+such a scale factor as the distance between the $U$points on each side of the
+$T$point. Relying on an analytical transformation has two advantages: firstly, there
+is no ambiguity in the scale factors appearing in the discrete equations, since they
+are first introduced in the continuous equations; secondly, analytical transformations
+encourage good practice by the definition of smoothly varying grids (rather than
+allowing the user to set arbitrary jumps in thickness between adjacent layers)
+\citep{Treguier1996}. An example of the effect of such a choice is shown in
+Fig.~\ref{Fig_zgr_e3}.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!t] \label{Fig_zgr_e3} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_zgr_e3.pdf}
\caption{(a) Traditional definition of gridpoint position and gridsize in the vertical versus (b) analytically derived gridpoint position and scale factors. For both grid here,a same $w$point depth has been chosen but in (a) the $T$points are set at the middle of $w$points while in (b) they are defined from an analytical function: $z(k)=5\,(i1/2)^3  45\,(i1/2)^2 + 140\,(i1/2)  150$. Note the resulting difference between the value of the gridsize $\Delta_k$ and those of the scale factor $e_k$. }
+\caption{Comparison of (a) traditional definitions of gridpoint position and gridsize
+in the vertical, and (b) analytically derived gridpoint position and scale factors. For
+both grids here, the same $w$point depth has been chosen but in (a) the
+$T$points are set half way between $w$points while in (b) they are defined from
+an analytical function: $z(k)=5\,(i1/2)^3  45\,(i1/2)^2 + 140\,(i1/2)  150$.
+Note the resulting difference between the value of the gridsize $\Delta_k$ and
+those of the scale factor $e_k$. }
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
% 
% Choice of horizontal grids
% 
\subsection{Choice of horizontal grids}
+% Choice of horizontal grid
+% 
+\subsection{Choice of horizontal grid}
\label{DOM_hgr_msh_choice}
The user has three options to define a horizontal grid, involving the parameter $jphgr\_mesh$ of the \mdl{par\_oce} module.
\begin{enumerate}
\item For the most general curvilinear orthogonal grids, the coordinates and their first derivatives with respect to $i$ and $j$ are provided in a file, read in \rou{hgr\_read} subroutine of the domhgr module: \jp{jphgr\_mesh}=0.
\item A few simple analytical grids are provided as examples, that can be selected by setting \jp{jphgr\_mesh}=1 to 5 (see below)
\item For other analytical grids, the \mdl{domhgr} module must be modified by the user.
\end{enumerate}

There are two simple cases of geographical grids on the sphere. With \jp{jphgr\_mesh}=1, the grid is regular in space, with grid sizes specified by parameters \pp{ppe1\_deg} and \pp{ppe2\_deg}, respectively. A geographical grid
can be very anisotropic at high latitudes, because of the convergence of meridians (the zonal scale factors $e_1$ become much smaller than the meridional scale factors $e_2$). The Mercator grid (\jp{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale factors in the same way as the zonal ones. In that case, meridional scale factors and latitudes are calculated analytically using the formulae appropriate for a Mercator projection, based on \pp{ppe1\_deg} which is a reference grid spacing at the equator (this applies even when the geographical equator is situated outside the model domain). In those two cases (\jp{jphgr\_mesh}=1 or 4), the grid position is defined by the longitude and latitude of the southwesthernmost point (\pp{ppglamt0} and \pp{ppgphi0}). Note that for the Mercator grid the user need only provide an approximate starting latitude: the real latitude will be recalculated analytically, so as to ensure that the equator corresponds to a $T$ and$ U$point.

Rectangular grids ignoring the spherical geometry are defined with \jp{jphgr\_mesh} = 2, 3, 5. The domain is either a $f$plane (\jp{jphgr\_mesh} = 2, Coriolis factor is constant) or a betaplane (\jp{jphgr\_mesh} = 3, the Coriolis factor is linear in the $j$direction). The grid size is uniform in each direction, and given in meters by the parameters \pp{ppe1\_m} and \pp{ppe2\_m} respectively. The zonal grid coordinate (glam. arrays) is in kilometers, starting at zero with the first T point. The meridional coordinate (gphi. arrays) is in kilometers, and the second $T$point corresponds to coordinate gphit=0. The input parameter \pp{ppglam0} is ignored. \pp{ppgphi0} is used to set the reference latitude for computation of the Coriolis parameter. In the case of the beta plane, \pp{ppgphi0} corresponds to the center of the domain. Finally, the special case \jp{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the GYRE configuration representing a classical midlatitude double gyre system. The rotation allows to maximize the jet length relative to the gyre areas (and the number of grid points).

The choice of the grid must be consistent with the boundary conditions specified by the parameter \jp{jperio} (see {\S\ref{LBC}).
+The user has three options available in defining a horizontal grid, which involve
+the parameter $jphgr\_mesh$ of the \mdl{par\_oce} module.
+\begin{description}
+\item[\jp{jphgr\_mesh}=0] The most general curvilinear orthogonal grids.
+The coordinates and their first derivatives with respect to $i$ and $j$ are
+provided in a file, read in \rou{hgr\_read} subroutine of the domhgr module.
+\item[\jp{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below).
+For other analytical grids, the \mdl{domhgr} module must be modified by the user.
+\end{description}
+
+There are two simple cases of geographical grids on the sphere. With
+\jp{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,
+with grid sizes specified by parameters \pp{ppe1\_deg} and \pp{ppe2\_deg},
+respectively. Such a geographical grid can be very anisotropic at high latitudes
+because of the convergence of meridians (the zonal scale factors $e_1$
+become much smaller than the meridional scale factors $e_2$). The Mercator
+grid (\jp{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale
+factors in the same way as the zonal ones. In this case, meridional scale factors
+and latitudes are calculated analytically using the formulae appropriate for
+a Mercator projection, based on \pp{ppe1\_deg} which is a reference grid spacing
+at the equator (this applies even when the geographical equator is situated outside
+the model domain).
+%%%
+\gmcomment{ give here the analytical expression of the Mercator mesh}
+%%%
+In these two cases (\jp{jphgr\_mesh}=1 or 4), the grid position is defined by the
+longitude and latitude of the southwesternmost point (\pp{ppglamt0}
+and \pp{ppgphi0}). Note that for the Mercator grid the user need only provide
+an approximate starting latitude: the real latitude will be recalculated analytically,
+in order to ensure that the equator corresponds to line passing through $T$
+and $u$points.
+
+Rectangular grids ignoring the spherical geometry are defined with
+\jp{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$plane (\jp{jphgr\_mesh} = 2,
+Coriolis factor is constant) or a betaplane (\jp{jphgr\_mesh} = 3, the Coriolis factor
+is linear in the $j$direction). The grid size is uniform in meter in each direction,
+and given by the parameters \pp{ppe1\_m} and \pp{ppe2\_m} respectively.
+The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero
+with the first $T$point. The meridional coordinate (gphi. arrays) is in kilometers,
+and the second $T$point corresponds to coordinate $gphit=0$. The input
+parameter \pp{ppglam0} is ignored. \pp{ppgphi0} is used to set the reference
+latitude for computation of the Coriolis parameter. In the case of the beta plane,
+\pp{ppgphi0} corresponds to the center of the domain. Finally, the special case
+\jp{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the
+GYRE configuration, representing a classical midlatitude double gyre system.
+The rotation allows us to maximize the jet length relative to the gyre areas
+(and the number of grid points).
+
+The choice of the grid must be consistent with the boundary conditions specified
+by the parameter \jp{jperio} (see {\S\ref{LBC}).
% 
@@ 256,10 +447,19 @@
\label{DOM_hgr_files}
All the arrays related to a particular ocean model configuration (gridpoint position, scale factors, masks) can be saved in files if $\np{nmsh} \not= 0$ (namelist parameter). This can be particularly useful for plots and offline diagnostics. In some cases, the user may choose to make a local modification of a scale factor in the code. This is the case in global configurations when restricting the width of a specific strait (usually a onegridpoint strait that happens to be too wide due to the insufficient model resolution). On example is Lombok Strait in the ORCA2 configuration. When such modifications are done, the output grid written when $\np{nmsh} \not=0$ is not exactly equal to the input grid.
+All the arrays relating to a particular ocean model configuration (gridpoint
+position, scale factors, masks) can be saved in files if $\np{nmsh} \not= 0$
+(namelist parameter). This can be particularly useful for plots and offline
+diagnostics. In some cases, the user may choose to make a local modification
+of a scale factor in the code. This is the case in global configurations when
+restricting the width of a specific strait (usually a onegridpoint strait that
+happens to be too wide due to insufficient model resolution). An example
+is Gibraltar Strait in the ORCA2 configuration. When such modifications are done,
+the output grid written when $\np{nmsh} \not=0$ is no more equal to the input grid.
% ================================================================
% Domain: Vertical Grid (domzgr)
% ================================================================
\section{Domain: Vertical Grid (\mdl{domzgr} module)}
+\section [Domain: Vertical Grid (\textit{domzgr})]
+ {Domain: Vertical Grid \small{(\mdl{domzgr} module)} }
\label{DOM_zgr}
%nam_zgr & namdom
@@ 268,30 +468,73 @@
%
In the vertical, the model mesh is determined by four things: (1) the bathymetry given in meters ; (2) the number of levels of the model (\jp{jpk}) ; (3) the analytical transformation $z(i,j,k)$ and the vertical scale factors
(derivatives of the transformation) ; and (4) the masking system, i.e. the number of wet model levels at each $(i,j)$.
+In the vertical, the model mesh is determined by four things:
+(1) the bathymetry given in meters ;
+(2) the number of levels of the model (\jp{jpk}) ;
+(3) the analytical transformation $z(i,j,k)$ and the vertical scale factors
+(derivatives of the transformation) ;
+and (4) the masking system, $i.e.$ the number of wet model levels at each
+$(i,j)$ column of points.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!tb] \label{Fig_z_zps_s_sps} \begin{center}
\includegraphics[width=1.0\textwidth]{./Figures/Fig_z_zps_s_sps.pdf}
\caption{The ocean bottom as seen by the model: (a) $z$coordinate with full step, (b) $z$coordinate with partial step, (c) $s$coordinate: terrain following representation, (d) hybrid $sz$ coordinate, (e) hybrid $sz$ coordinate with partial step, and (f) same as (e) but with variable volume level associated with the nonlinear free surface. Note that the variable volume level (\key{vvl}) could be used with any of the 5 coordinates (a) to (e).}
+\caption{The ocean bottom as seen by the model:
+(a) $z$coordinate with full step,
+(b) $z$coordinate with partial step,
+(c) $s$coordinate: terrain following representation,
+(d) hybrid $sz$ coordinate,
+(e) hybrid $sz$ coordinate with partial step, and
+(f) same as (e) but with variable volume associated with the nonlinear free surface.
+Note that the variable volume option (\key{vvl}) can be used with any of the
+5 coordinates (a) to (e).}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The choice of a vertical coordinate among all those offered in NEMO, even if it is made through a namelist parameter, must be done once of all at the beginning of an experiment. It is not intended as an option which can be
enabled or disabled in the middle of an experiment. Three main choices are offered (Fig.~\ref{Fig_z_zps_s_sps}a to c): $z$coordinate with full step bathymetry (\np{ln\_zco}=true), $z$coordinate with partial step bathymetry (\np{ln\_zps}=true), or generalized, $s$coordinate (\np{ln\_sco}=true). Hybridation of the three main
coordinates are available: hybrid $sz$ or $szps$ coordinate (Fig.~\ref{Fig_z_zps_s_sps}d and \ref{Fig_z_zps_s_sps}e). When using the variable volume option \key{vvl}), the coordinate follow the timevariation of the free surface so that the transformation is time dependent: $z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). This option can be used with full step bathymetry or $s$coordinates (hybride and partial step coordinates not yet implemented in NEMO v2.3).

Contrary to the horizontal grid, the vertical grid is computed in the code and no provision is made for reading it from a file. The only input file is the bathymetry (in meters). After reading the bathymetry, the algorithm for vertical grid definition differs between the different options:
+The choice of a vertical coordinate, even if it is made through a namelist parameter,
+must be done once of all at the beginning of an experiment. It is not intended as an
+option which can be enabled or disabled in the middle of an experiment. Three main
+choices are offered (Fig.~\ref{Fig_z_zps_s_sps}a to c): $z$coordinate with full step
+bathymetry (\np{ln\_zco}=true), $z$coordinate with partial step bathymetry
+(\np{ln\_zps}=true), or generalized, $s$coordinate (\np{ln\_sco}=true).
+Hybridation of the three main coordinates are available: $sz$ or $szps$ coordinate
+(Fig.~\ref{Fig_z_zps_s_sps}d and \ref{Fig_z_zps_s_sps}e). When using the variable
+volume option \key{vvl}) ($i.e.$ nonlinear free surface), the coordinate follow the
+timevariation of the free surface so that the transformation is time dependent:
+$z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). This option can be used with full step
+bathymetry or $s$coordinate (hybride and partial step coordinates have not
+yet been tested in NEMO v2.3).
+
+Contrary to the horizontal grid, the vertical grid is computed in the code and no
+provision is made for reading it from a file. The only input file is the bathymetry
+(in meters)\footnote{N.B. in full step $z$coordinate, a \textit{bathy\_level} file can
+replace the \textit{bathy\_meter} file, so that the computation of the number of
+wet ocean point in each water column is bypassed}. After reading the bathymetry,
+the algorithm for vertical grid definition differs between the different options:
\begin{description}
\item[\textit{zco}] set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$.
\item[\textit{zps}] set a reference coordinate transformation $z_0 (k)$, and
calculate the height at the deepest levels using the bathymetry, to obtain the final threedimensional depth and scale factor arrays.
\item[\textit{sco}] Smooth the bathymetry to fullfill the hydrostatic consistency criteria and set the threedimensional transformation.
\item[\textit{sz} and \textit{szps}] Smooth the bathymetry to fullfill the hydrostatic consistency criteria and set the threedimensional transformation $z(i,j,k)$, and possibly introduce masking of extra land points to better fit the original bathymetry file
+calculate the thickness of the deepest level at each $(i,j)$ point using the
+bathymetry, to obtain the final threedimensional depth and scale factor arrays.
+\item[\textit{sco}] smooth the bathymetry to fulfil the hydrostatic consistency
+criteria and set the threedimensional transformation.
+\item[\textit{sz} and \textit{szps}] smooth the bathymetry to fulfil the hydrostatic
+consistency criteria and set the threedimensional transformation $z(i,j,k)$, and
+possibly introduce masking of extra land points to better fit the original bathymetry file
\end{description}

Generally, the arrays describing the grid point depths and vertical scale factors are three dimensional arrays $(i,j,k)$. In the special case of $z$coordinates with full step bottom topography, it is possible to define
those arrays as onedimensional, in order to save memory. This is performed by defining the \key{zco} CPreProcessor (CPP) key. To improve the code readability while providing this flexibility, the vertical coordinates and scale factors are defined as functions of $(i,j,k)$ with "fs" as prefix (examples: \textit{fsdeptht, fse3t,} etc) that can be equal to threedimensional arrays, or a one dimensional array when \key{zco} is defined. These functions are defined in the file
\textit{domzgr\_substitute.h90} of the DOM directory. They are used through the code, and replaced by the corresponding arrays at the time of preprocessing (CPP capability).
+%%%
+\gmcomment{ add the description of the smoothing: envelop topography...}
+%%%
+
+Generally, the arrays describing the grid point depths and vertical scale factors
+are three dimensional arrays $(i,j,k)$. In the special case of $z$coordinates with
+full step bottom topography, it is possible to define those arrays as onedimensional,
+in order to save memory. This is performed by defining the \key{zco}
+CPreProcessor (CPP) key. To improve the code readability while providing this
+flexibility, the vertical coordinate and scale factors are defined as functions of
+$(i,j,k)$ with "fs" as prefix (examples: \textit{fsdeptht, fse3t,} etc) that can be either
+threedimensional arrays, or a one dimensional array when \key{zco} is defined.
+These functions are defined in the file \hf{domzgr\_substitute} of the DOM directory.
+They are used throughout the code, and replaced by the corresponding arrays at
+the time of preprocessing (CPP capability).
% 
@@ 304,23 +547,35 @@
namelist variable \np{ntopo}:
\begin{description}
\item[\np{ntopo} = 0] a flatbottom domain is defined. The total depth $z_w (jpk)$ is given by the coordinate transformation. The domain can either a closed basin or a periodic channel according to the parameter \jp{jperio}.
\item[\np{ntopo} = 1] a domain with a bump of topography at the central latitude and 1/3 of the domain width. This is meant for the "EELR5" configuration, a periodic or open boundary channel with a seamount.
\item[\np{ntopo} = 1] read a bathymetry. The bathymetry file (Netcdf format) provides the ocean depth (positive, in meters) at each grid point of the model grid. The bathymetry is usually built by interpolating a standard bathymetry product (e.g., ETOPO2) onto the horizontal ocean mesh. The bathymetry file defines the coastline: where the bathymetry is zero, no model levels are defined (all levels are masked).
+\item[\np{ntopo} = 0] a flatbottom domain is defined. The total depth $z_w (jpk)$
+is given by the coordinate transformation. The domain can either be a closed
+basin or a periodic channel depending on the parameter \jp{jperio}.
+\item[\np{ntopo} = 1] a domain with a bump of topography one third of the
+domain width at the central latitude. This is meant for the "EELR5" configuration,
+a periodic or open boundary channel with a seamount.
+\item[\np{ntopo} = 1] read a bathymetry. The bathymetry file (Netcdf format)
+provides the ocean depth (positive, in meters) at each grid point of the model grid.
+The bathymetry is usually built by interpolating a standard bathymetry product
+($e.g.$ ETOPO2) onto the horizontal ocean mesh. Defining the bathymetry also
+defines the coastline: where the bathymetry is zero, no model levels are defined
+(all levels are masked).
\end{description}
When using the rigid lid approximation (\key{dynspg\_rl} defined) isolated land masses (islands) must be identified by negative integers in the input bathymetry file (see \S\ref{MISC_solisl}).

When the ocean is coupled to an atmospheric model it is better to represent
+When using the rigid lid approximation (\key{dynspg\_rl} is defined) isolated land
+masses (islands) must be identified by negative integers in the input bathymetry file
+(see \S\ref{MISC_solisl}).
+
+When a global ocean is coupled to an atmospheric model it is better to represent
all large water bodies (e.g, great lakes, Caspian sea...) even if the model
resolution does not allow to represent their communication with the rest of
the ocean. This is unnecessary when the ocean is forced by fixed atmospheric
conditions. A possibility is offered to the user to set to zero the
bathymetry in rectangular regions covering those closed seas (see \S\ref{MISC_closea}), but the code has to be adapted to the user's configuration.
+resolution does not allow their communication with the rest of the ocean.
+This is unnecessary when the ocean is forced by fixed atmospheric conditions,
+so these seas can be removed from the ocean domain. The user has the option
+to set the bathymetry in closed seas to zero (see \S\ref{MISC_closea}), but the
+code has to be adapted to the user's configuration.
% 
% zcoordinate and reference coordinate transformation
% 
\subsection [$z$coordinate (\np{ln\_zco}=T or \key{zco})]
 {$z$coordinate (\np{ln\_zco}=T or \key{zco}) and reference coordinate}
+\subsection[$z$coordinate (\np{ln\_zco} or \key{zco})]
+ {$z$coordinate (\np{ln\_zco}=.true. or \key{zco}) and reference coordinate}
\label{DOM_zco}
@@ 328,13 +583,25 @@
\begin{figure}[!tb] \label{Fig_zgr} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_zgr.pdf}
\caption{Default vertical mesh for ORCA2L30. Vertical level functions for (a) Tpoint depth and (b) the associated scale factor as computed from (III.2.1) in zcoordinates.}
+\caption{Default vertical mesh for ORCA2: 30 ocean levels (L30). Vertical level
+functions for (a) Tpoint depth and (b) the associated scale factor as computed
+from \eqref{DOM_zgr_ana} using \eqref{DOM_zgr_coef} in $z$coordinate.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The reference coordinate transformation $z_0 (k)$ defines the arrays \textit{gdept0} and \textit{gdepw0} for $T$ and $w$points, respectively. As indicated on Fig.\ref{Fig_index_vert} \jp{jpk} is the number of $w$levels. $gdepw(1)$ being the ocean surface. There are at most \jp{jpk}1 $T$points in the ocean, the additional $T$point at $jk=jpk$ is below the sea floor and is not used. The vertical location of $w$ and $T$levels is defined from the analytic expression of the depth $z_0 (k)$ whose analytic derivative with respect to $k$ provides the vertical scale factors. The user must provide the analytical expression of both $z_0 $and its first derivative with respect to $k$. This is done in routine \mdl{domzgr} through statement functions, using parameters provided in the \textit{par\_oce.h90} file.
+The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$
+and $gdepw_0$ for $T$ and $w$points, respectively. As indicated on
+Fig.\ref{Fig_index_vert} \jp{jpk} is the number of $w$levels. $gdepw_0(1)$ is the
+ocean surface. There are at most \jp{jpk}1 $T$points inside the ocean, the
+additional $T$point at $jk=jpk$ is below the sea floor and is not used.
+The vertical location of $w$ and $T$levels is defined from the analytic expression
+of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides the
+vertical scale factors. The user must provide the analytical expression of both
+$z_0$ and its first derivative with respect to $k$. This is done in routine \mdl{domzgr}
+through statement functions, using parameters provided in the \textit{par\_oce.h90} file.
It is possible to define a simple regular vertical grid by giving zero stretching (\pp{ppacr=0}). In that case, the parameters \jp{jpk} (number of $w$levels) and \pp{pphmax} (total ocean depth in meters) fully define the grid.
For climaterelated studies it is often desirable to concentrate the vertical resolution near the ocean surface. The following function is proposed as a standard for $z$coordinates and partial steps:
+For climaterelated studies it is often desirable to concentrate the vertical resolution
+near the ocean surface. The following function is proposed as a standard for a $z$coordinate (with either full or partial steps):
\begin{equation} \label{DOM_zgr_ana}
\begin{split}
@@ 343,7 +610,12 @@
\end{split}
\end{equation}
where $k=1$ to \jp{jpk} for $w$levels and $k=1$ to $k=1$ for $T$levels. Such an expression allows us to define a nearly uniform vertical location of levels at the ocean top and bottom with a smooth hyperbolic tangent transition in between (Fig.~\ref{Fig_zgr}).

The first grid defined for ORCA2 had $10~m$ ($500~m)$ resolution in the surface (bottom) layers and a depth which varies from 0 at the sea surface to a minimum of $5000~m$. This leads to the following conditions:
+where $k=1$ to \jp{jpk} for $w$levels and $k=1$ to $k=1$ for $T$levels. Such an
+expression allows us to define a nearly uniform vertical location of levels at the
+ocean top and bottom with a smooth hyperbolic tangent transition in between
+(Fig.~\ref{Fig_zgr}).
+
+The most used vertical grid for ORCA2 has $10~m$ ($500~m)$ resolution in the
+surface (bottom) layers and a depth which varies from 0 at the sea surface to a
+minimum of $5000~m$. This leads to the following conditions:
\begin{equation} \label{DOM_zgr_coef}
\begin{split}
@@ 355,17 +627,29 @@
\end{equation}
With the choice of the stretching $h_{cr} =3$ and the number of levels \jp{jpk}=$31$, the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in \eqref{DOM_zgr_ana} have been determined such that \eqref{DOM_zgr_coef} is satisfied, through an optimisation procedure using a bisection method. For the first standard
ORCA2 vertial grid this led to the following values: $h_{sur} =4762.96$, $h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. The resulting depths and scale factors as a function of the model levels are shown in Fig.~\ref{Fig_zgr} and given in Table \ref{Tab_orca_zgr}. Those values correspond to the parameters \pp{ppsur}, \pp{ppa0}, \pp{ppa1}, \pp{ppkth} in the parameter file \mdl{par\_oce}.
+With the choice of the stretching $h_{cr} =3$ and the number of levels
+\jp{jpk}=$31$, the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in
+\eqref{DOM_zgr_ana} have been determined such that \eqref{DOM_zgr_coef} is
+satisfied, through an optimisation procedure using a bisection method. For the first
+standard ORCA2 vertical grid this led to the following values: $h_{sur} =4762.96$,
+$h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. The resulting depths and
+scale factors as a function of the model levels are shown in Fig.~\ref{Fig_zgr} and
+given in Table \ref{Tab_orca_zgr}. Those values correspond to the parameters
+\pp{ppsur}, \pp{ppa0}, \pp{ppa1}, \pp{ppkth} in the parameter file \mdl{par\_oce}.
Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is
possible to recalculate them. In that case the user sets
\pp{ppsur}=\pp{ppa0}=\pp{ppa1}=\pp{pp\_to\_be\_computed}, in \mdl{par\_oce}, and specifies instead the four following parameters:
+\pp{ppsur}=\pp{ppa0}=\pp{ppa1}=\pp{pp\_to\_be\_computed}, in \mdl{par\_oce},
+and specifies instead the four following parameters:
\begin{itemize}
\item \pp{ppacr}=$h_{cr} $: stretching factor (nondimensional). The larger \pp{ppacr}, the smaller the stretching. Values from $3$ to $10$ are usual.
\item \pp{ppkth}=$h_{th} $: is approximately the model level at which maximum stretching occurs (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
+\item \pp{ppacr}=$h_{cr} $: stretching factor (nondimensional). The larger
+\pp{ppacr}, the smaller the stretching. Values from $3$ to $10$ are usual.
+\item \pp{ppkth}=$h_{th} $: is approximately the model level at which maximum
+stretching occurs (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
\item \pp{ppdzmin}: minimum thickness for the top layer (in meters)
\item \pp{pphmax}: total depth of the ocean (meters).
\end{itemize}
As an example, for the $45$ layers used in DRAKKAR configuration those parameters are: \jp{jpk}=46, \pp{ppacr}=9, \pp{ppkth}=23.563, \pp{ppdzmin}=6m, \pp{pphmax}=5750m.
+As an example, for the $45$ layers used in the DRAKKAR configuration those
+parameters are: \jp{jpk}=46, \pp{ppacr}=9, \pp{ppkth}=23.563, \pp{ppdzmin}=6m,
+\pp{pphmax}=5750m.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 396,15 +680,17 @@
21 & \textbf{732.20} & 611.89 & \textbf{261.03} & 220.35 \\ \hline
22 & \textbf{1033.22}& 872.87 & \textbf{339.39} & 301.42 \\ \hline
23 & \textbf{1405.70}& 1211.59 & \textbf{402.26} & 373.31 \\ \hline
24 & \textbf{1830.89}& 1612.98 & \textbf{444.87} & 426.00 \\ \hline
25 & \textbf{2289.77}& 2057.13 & \textbf{470.55} & 459.47 \\ \hline
26 & \textbf{2768.24}& 2527.22 & \textbf{484.95} & 478.83 \\ \hline
27 & \textbf{3257.48}& 3011.90 & \textbf{492.70} & 489.44 \\ \hline
28 & \textbf{3752.44}& 3504.46 & \textbf{496.78} & 495.07 \\ \hline
29 & \textbf{4250.40}& 4001.16 & \textbf{498.90} & 498.02 \\ \hline
30 & \textbf{4749.91}& 4500.02 & \textbf{500.00} & 499.54 \\ \hline
+23 & \textbf{1405.70}& 1211.59 & \textbf{402.26} & 373.31 \\ \hline
+24 & \textbf{1830.89}& 1612.98 & \textbf{444.87} & 426.00 \\ \hline
+25 & \textbf{2289.77}& 2057.13 & \textbf{470.55} & 459.47 \\ \hline
+26 & \textbf{2768.24}& 2527.22 & \textbf{484.95} & 478.83 \\ \hline
+27 & \textbf{3257.48}& 3011.90 & \textbf{492.70} & 489.44 \\ \hline
+28 & \textbf{3752.44}& 3504.46 & \textbf{496.78} & 495.07 \\ \hline
+29 & \textbf{4250.40}& 4001.16 & \textbf{498.90} & 498.02 \\ \hline
+30 & \textbf{4749.91}& 4500.02 & \textbf{500.00} & 499.54 \\ \hline
31 & \textbf{5250.23}& 5000.00 & \textbf{500.56} & 500.33 \\ \hline
\end{tabular} \end{center}
\caption{Default vertical mesh in $z$coordinate for 30 layers ORCA2 configuration as computed from \eqref{DOM_zgr_ana} using the coefficients given in \eqref{DOM_zgr_coef}}
+\caption{Default vertical mesh in $z$coordinate for 30 layers ORCA2 configuration
+as computed from \eqref{DOM_zgr_ana} using the coefficients given in
+\eqref{DOM_zgr_coef}}
\end{table}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 413,13 +699,14 @@
% zcoordinate with partial step
% 
\subsection{zcoordinate with partial step (\np{ln\_zps}=T)}
+\subsection [$z$coordinate with partial step (\np{ln\_zps})]
+ {$z$coordinate with partial step (\np{ln\_zps}=.true.)}
\label{DOM_zps}
%namdom
+%namdom
\namdisplay{namdom}
%
In that case, the depths of the model levels are still defined by the
+In $z$coordinate partial step, the depths of the model levels are defined by the
reference analytical function $z_0 (k)$ as described in the previous
section, excepted in the bottom layer. The thickness of the bottom layer is
+section, \emph{except} in the bottom layer. The thickness of the bottom layer is
allowed to vary as a function of geographical location $(\lambda,\varphi)$ to allow a
better representation of the bathymetry, especially in the case of small
@@ 431,5 +718,5 @@
maximum thickness allowed is $2*e_{3t}(jpk1)$. This has to be kept in mind when
specifying the maximum depth \pp{pphmax} in partial steps: for example, with
\pp{pphmax}$=5750~m$ for the DRAKKAR 45 layers grid, the maximum ocean depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk1)$ being $250~m$). Two
+\pp{pphmax}$=5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk1)$ being $250~m$). Two
variables in the namdom namelist are used to define the partial step
vertical grid. The mimimum water thickness (in meters) allowed for a cell
@@ 443,22 +730,23 @@
% scoordinate
% 
\subsection{$s$coordinate (\np{ln\_sco}=T)}
+\subsection [$s$coordinate (\np{ln\_sco})]
+ {$s$coordinate (\np{ln\_sco}=true)}
\label{DOM_sco}
%nam_zgr_sco
+%nam_zgr_sco
\namdisplay{nam_zgr_sco}
%
In scoordinate (\key{sco} defined), the depths of the model
levels are defined from the product of a depth field and a stretching
function and its derivative, respectively:
+In $s$coordinate (\key{sco} is defined), the depth and thickness of the model
+levels are defined from the product of a depth field and either a stretching
+function or its derivative, respectively:
\begin{equation} \label{DOM_sco_ana}
\begin{split}
 z(k) &= h(i,j) \; z_0(k) \\
+ z(k) &= h(i,j) \; z_0(k) \\
e_3(k) &= h(i,j) \; z_0'(k)
\end{split}
\end{equation}
where $h$ is the depth of the last $w$level ($z_0(k)$) defined at $T$point location
in the horizontal and $z_0 (k)$ is a function which varies from $0$ at the sea
+where $h$ is the depth of the last $w$level ($z_0(k)$) defined at the $T$point
+location in the horizontal and $z_0(k)$ is a function which varies from $0$ at the sea
surface to $1$ at the ocean bottom. The depth field $h$ is not necessary the ocean
depth as a mixed steplike and bottom following representation of the
+depth, since a mixed steplike and bottomfollowing representation of the
topography can be used (Fig.~\ref{Fig_z_zps_s_sps}de). In the example provided (\hf{zgr\_s} file) $h$ is a smooth envelope bathymetry and steps are used to represent sharp bathymetric gradients.
@@ 472,12 +760,12 @@
\end{split}
\end{equation}
where $h_c $is the thermocline depth and $\theta $ and $b$ are the surface and
+where $h_c$ is the thermocline depth and $\theta$ and $b$ are the surface and
bottom control parameters such that $0\leqslant \theta \leqslant 20$, and
$0\leqslant b\leqslant 1$. Examples of the stretching function applied to a seamount are given in Fig.~\ref{Fig_sco_function}.
+$0\leqslant b\leqslant 1$. $b$ has been designed to allow surface and/or bottom increase of the vertical resolution (Fig.~\ref{Fig_sco_function}).
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!tb] \label{Fig_sco_function} \begin{center}
\includegraphics[width=1.0\textwidth]{./Figures/Fig_sco_function.pdf}
\caption{examples of the stretching function applied to a sea mont: from left to right, surface, surface and bottom, and bottom intensified resolution}
+\caption{Examples of the stretching function applied to a sea mont; from left to right: surface, surface and bottom, and bottom intensified resolutions}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 489,5 +777,6 @@
\label{DOM_zgr_vvl}
This option is described in the report by Levier \textit{et al.} (2007), available on the NEMO web site.
+This option is described in the Report by Levier \textit{et al.} (2007), available on
+the \NEMO web site.
%gm% key advantage: minimise the diffusion/dispertion associated with advection in response to high frequency surface disturbances
@@ 511,49 +800,75 @@
Modifications of the model bathymetry are performed in the \textit{bat\_ctl}
routine (see \mdl{domzgr} module) after mbathy is computed. Isolated grid points that do not
communicate with another ocean point at the same level are eliminated.

In case of rigidlid approximation and islands in the computational domain (\np{ln\_dynspg\_rl}=true and \key{island} defined), the \textit{mbathy} array must be provided and takes values from $N$ to \jp{jpk}1. It provides the
following information: $mbathy(i,j) = n, \ n \in \left] 0,N \right]$, $T$points are land points of the $n^{th}$ island ; $mbathy(i,j) =0$, $T$points are land points of the main land (continent) ; $mbathy(i,j) =k$, the first $k$ $T$ and $w$points are ocean points, the others land points. This is used to compute the island barotropic stream function used in rigid lid computation (see \S\ref{MISC_solisl}).
+routine (see \mdl{domzgr} module) after mbathy is computed. Isolated grid points
+that do not communicate with another ocean point at the same level are eliminated.
+
+In the case of the rigidlid approximation when islands occur in the computational
+domain (\np{ln\_dynspg\_rl}=.true. and \key{island} is defined), the \textit{mbathy}
+array must be provided and takes values from $N$ to \jp{jpk}1. It provides the
+following information: $mbathy(i,j) = n, \ n \in \left] 0,N \right]$, $T$points are
+land points on the $n^{th}$ island ; $mbathy(i,j) =0$, $T$points are land points
+on the main land (continent) ; $mbathy(i,j) =k$, the first $k$ $T$ and $w$points
+are ocean points, the others are points below the ocean floor.
+
+This is used to compute the island barotropic stream function used in the rigid lid
+computation (see \S\ref{MISC_solisl}).
From the \textit{mbathy} array, the mask fields are defined as follows:
\begin{align*}
tmask(i,j,k) &= \begin{cases} 1& \text{ if $k\leq mbathy(i,j)$ } \\
 0& \text{ if $k\leq mbathy(i,j)$ } \end{cases} \\
umask(i,j,k) &= \; tmask(i,j,k) \;.\; tmask(i+1,j,k) \\
umask(i,j,k) &= \; tmask(i,j,k) \;.\; tmask(i,j+1,k) \\
umask(i,j,k) &= \; tmask(i,j,k) \;.\; tmask(i+1,j,k) \\
 & \quad . \; tmask(i,j,k) \;.\; tmask(i+1,j,k)
+tmask(i,j,k) &= \begin{cases} \; 1& \text{ if $k\leq mbathy(i,j)$ } \\
+ \; 0& \text{ if $k\leq mbathy(i,j)$ } \end{cases} \\
+umask(i,j,k) &= \; tmask(i,j,k) \ * \ tmask(i+1,j,k) \\
+vmask(i,j,k) &= \; tmask(i,j,k) \ * \ tmask(i,j+1,k) \\
+fmask(i,j,k) &= \; tmask(i,j,k) \ * \ tmask(i+1,j,k) \\
+ & \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k)
\end{align*}
Note that \textit{wmask} is not defined as it is exactly equal to \textit{tmask} with the numerical
indexation used (\S~\ref{DOM_Num_Index}). Moreover, the specification of closed lateral
boundaries requires that at least the first and last rows and columns of
\textit{mbathy} array are set to zero. In the particular case of an eastwest cyclic
boundary condition, \textit{mbathy} has its last column equal to the second one and its
first column equal to the last but one (and so the mask arrays) (see \S~\ref{LBC_jperio}).

\colorbox{yellow}{Add one word on tricky trick !} mbathy in further modified in zdfbfr{\ldots}.
+\gmcomment{ STEVEN: are the dots multiplications?}
+
+Note that \textit{wmask} is not defined as it is exactly equal to \textit{tmask} with
+the numerical indexing used (\S~\ref{DOM_Num_Index}). Moreover, the
+specification of closed lateral boundaries requires that at least the first and last
+rows and columns of the \textit{mbathy} array are set to zero. In the particular
+case of an eastwest cyclical boundary condition, \textit{mbathy} has its last
+column equal to the second one and its first column equal to the last but one
+(and so too the mask arrays) (see \S~\ref{LBC_jperio}).
+
+%%%
+\gmcomment{ \colorbox{yellow}{Add one word on tricky trick !} mbathy in further modified in zdfbfr{\ldots}. }
+%%%
% ================================================================
% Time discretisation
+% Time Discretisation
% ================================================================
\section{Time Discretisation}
\label{DOM_nxt}
The time stepping used in OPA is a three level scheme that can be presented as follows:
+The time stepping used in \NEMO is a three level scheme that can be
+represented as follows:
\begin{equation} \label{Eq_DOM_nxt}
x^{t+\Delta t} = x^{t\Delta t} + 2 \, \Delta t \ \text{RHS}_x^{t\Delta t,t,t+\Delta t}
\end{equation}
where $x$ stand for $u$, $v$, $T$ or $S$, RHS is the RightHandSide of the corresponding time
evolution equation, $\Delta t$ is the time step and the overscripts indicate
the time at which a quantity is evaluated. Each term of the RHS is evaluated at
specific time step(s) depending on the physics to which it is associated.
+where $x$ stands for $u$, $v$, $T$ or $S$; RHS is the RightHandSide of the
+corresponding time evolution equation; $\Delta t$ is the time step; and the
+superscripts indicate the time at which a quantity is evaluated. Each term of the
+RHS is evaluated at a specific time step(s) depending on the physics with which
+it is associated.
+
The choice of the time step used for this evaluation is discussed below as
well as the implication in term of starting or restarting a model
+well as the implications in terms of starting or restarting a model
simulation. Note that the time stepping is generally performed in a one step
operation. With such a complex and nonlinear system of equations it would be dangerous to let a prognostic variable evolve in time for each term successively.

The three level scheme requires three arrays for the prognostic variables. For each variable $x$ there is $x_b$ (before) and $x_n$ (now). The third array, although referred to as $x_a$ (after) in the code, is usually not the variable $x_a$ at the next time step; rather, it is used to store the time derivative (RHS in \eqref{Eq_DOM_nxt}) prior to timestepping the equation. Generally, the time stepping is performed once at each time step in \mdl{tranxt} and \mdl{dynnxt} modules, excepted for implicit vertical diffusion or sea surface height when timesplitting options are used.
+operation. With such a complex and nonlinear system of equations it would be dangerous to let a prognostic variable evolve in time for each term separately.
+%%%
+\gmcomment{ STEVEN suggest separately instead of successively... wrong?}
+%%%
+
+The three level scheme requires three arrays for each prognostic variables.
+For each variable $x$ there is $x_b$ (before) and $x_n$ (now). The third array,
+although referred to as $x_a$ (after) in the code, is usually not the variable at
+the next time step; but rather it is used to store the time derivative (RHS in
+\eqref{Eq_DOM_nxt}) prior to timestepping the equation. Generally, the time
+stepping is performed once at each time step in \mdl{tranxt} and \mdl{dynnxt}
+modules, except for implicit vertical diffusion or sea surface height when
+timesplitting options are used.
% 
@@ 564,7 +879,7 @@
The time stepping used for nondiffusive processes is the wellknown
leapfrog scheme. It is a time centred scheme, i.e. the RHS are evaluated at
+leapfrog scheme. It is a time centred scheme, i.e. the RHS is evaluated at
time step $t$, the now time step. It is only used for nondiffusive terms,
that is momentum and tracer advection, pressure gradient, and coriolis
+that is momentum and tracer advection, pressure gradient, and Coriolis
terms. This scheme is widely used for advective processes in lowviscosity
fluids. It is an efficient method that achieves secondorder accuracy with
@@ 578,37 +893,51 @@
"timesplitting" \citep{Haltiner1980} that develops when the method
is used to model non linear fluid dynamics: the even and odd time steps tend
to diverge between a physical and a computational mode. Time splitting can
+to diverge into a physical and a computational mode. Time splitting can
be controlled through the use of an Asselin time filter (first designed by
\citep{Robert1966} and more comprehensively studied by \citet{Asselin1972}) or by
+\citep{Robert1966} and more comprehensively studied by \citet{Asselin1972}), or by
periodically reinitialising the leapfrog solution through a single
integration step with a twolevel scheme. In OPA we follow the first
+integration step with a twolevel scheme. In \NEMO we follow the first
strategy:
\begin{equation} \label{Eq_DOM_nxt_asselin}
x_F^t = x^t + \gamma \, \left[ x_f^{t\Delta t}  2 x^t + x^{t+\Delta t} \right]
\end{equation}
where the subscript $f$ denotes filtered values and $\gamma$ is the asselin coefficient. $\gamma$ is initialized as \np{atfp} (namelist parameter). Its default value is \np{atfp}=0.1. This default value causes a significant dissipation of high frequency motions. Recommanded values in idealized studies of shallow water turbulence are two order of magnitude lower (\citep{Farge1987}). Both strategies do, nevertheless, degrade the accuracy of the calculation from second to first order. The leapfrog scheme associated to a RobertAsselin
+where the subscript $f$ denotes filtered values and $\gamma$ is the Asselin
+coefficient. $\gamma$ is initialized as \np{atfp} (namelist parameter).
+Its default value is \np{atfp}=0.1. This default value causes a significant dissipation
+of high frequency motions. Recommended values in idealized studies of shallow
+water turbulence are two orders of magnitude smaller (\citep{Farge1987}).
+Both strategies do, nevertheless, degrade the accuracy of the calculation from
+second to first order. The leapfrog scheme combined with a RobertAsselin
time filter has been preferred to other time differencing schemes such as
predictor corrector or trapezoidal schemes because the user can better
control the magnitude and the spatial structure of the time diffusion of the
scheme. In association with the centred space discretisation of the
+predictor corrector or trapezoidal schemes, because the user has an explicit
+and simple control of the magnitude of the time diffusion of the scheme.
+In association with the 2nd order centred space discretisation of the
advective terms in the momentum and tracer equations, it avoids implicit
numerical diffusion in both the time and space discretisation of the
advective term: they are both set explicitly by the user through the RobertAsselin filter parameter and the viscous and diffusive coefficients.

+numerical diffusion in both the time and space discretisations of the
+advective term: they are both set explicitly by the user through the RobertAsselin
+filter parameter and the viscous and diffusive coefficients.
+
+\gmcomment{
%gm  reflexion about leapfrog: ongoing work with Matthieu Leclair
% to be updated latter with addition of new time stepping strategy
\amtcomment{
\colorbox{yellow}{Note}:
1 There is no reason why one should apply a same value of $\gamma$ on both momentum and tracer equations. In climate applications, one could found useful to use a lower value on tracer (quantity that one wants to conserve) than on the dynamics. We never explore this possibility.
The RobertAsselin time filter slightly departs from a simple second order time diffusive operator computed with a forward time stepping due to the presence of $x_f^{t\Delta t}$ in the right hand side of \ref{Eq_DOM_nxt_asselin}. The original willing of Robert1966 and Asselin1972 was to design a time filter that allow much larger parameter than 0.5. is due to computer saving consideration. In the original asselin filter, $x^{t\Delta t}$ is used instead:
+The RobertAsselin time filter slightly departs from a simple second order time
+diffusive operator computed with a forward time stepping due to the presence of
+$x_f^{t\Delta t}$ in the right hand side of \ref{Eq_DOM_nxt_asselin}. The original
+willing of Robert1966 and Asselin1972 was to design a time filter that allow much
+larger parameter than 0.5. is due to computer saving consideration. In the original
+asselin filter, $x^{t\Delta t}$ is used instead:
\begin{equation} \label{Eq_DOM_nxt_asselin_true}
x_f^t = x^t + \gamma \, \left[ x^{t\Delta t}  2 x^t + x^{t+\Delta t} \right]
\end{equation}
Applying a "true" Asselin time filter is nothing more than adding a harmonic diffusive operator in time. Indeed, equations \ref{Eq_DOM_nxt} and \ref{Eq_DOM_nxt_asselin_true} can be rewritten together as:
+Applying a "true" Asselin time filter is nothing more than adding a harmonic
+diffusive operator in time. Indeed, equations \ref{Eq_DOM_nxt} and
+\ref{Eq_DOM_nxt_asselin_true} can be rewritten together as:
\begin{equation} \label{Eq_DOM_nxt2}
\begin{split}
\frac{ x^{t+\Delta t}  x^{t\Delta t} } { 2 \,\Delta t }
&= \text{RHS}_x^{t\Delta t,t,t+\Delta t} + \frac{ x_f^t  x^t }{2 \,\Delta t} \\
 &= \text{RHS}_x^{t\Delta t,t,t+\Delta t} + \gamma\ \frac{ \, \left[ x^{t\Delta t}  2 x^t + x^{t+\Delta t} \right] }{2 \,\Delta t} \\
+ &= \text{RHS}_x^{t\Delta t,t,t+\Delta t}
+ + \gamma\ \frac{ \, \left[ x^{t\Delta t}  2 x^t + x^{t+\Delta t} \right] }{2 \,\Delta t} \\
&= \text{RHS}_x^{t\Delta t,t,t+\Delta t}
+ 2 \Delta t \ \gamma \ \frac{1}{{2 \Delta t}^2}
@@ 621,5 +950,12 @@
\end{equation}
Equations \ref{Eq_DOM_nxt2} and \ref{Eq_DOM_nxt3} suggest several remarks. First the Asselin filter is definitively a second order time diffusive operator which is evaluated at centered time step. The magnitude of this diffusion is proportional to the time step (with $\gamma$ usually taken between $10^{1}$ to $10^{3}$) . Second, this term has to be taken into account in all budgets of the equations (mass, heat content, salt content, kinetic energy...). Nevertheless,we stress here that it is small and does not create systematic biases. Indeed let us evaluate how it contributes to the time evolution of $x$ between $t_o$ and $t_1$:
+Equations \ref{Eq_DOM_nxt2} and \ref{Eq_DOM_nxt3} suggest several remarks.
+First the Asselin filter is definitively a second order time diffusive operator which is
+evaluated at centered time step. The magnitude of this diffusion is proportional to
+the time step (with $\gamma$ usually taken between $10^{1}$ to $10^{3}$).
+Second, this term has to be taken into account in all budgets of the equations
+(mass, heat content, salt content, kinetic energy...). Nevertheless,we stress here
+that it is small and does not create systematic biases. Indeed let us evaluate how
+it contributes to the time evolution of $x$ between $t_o$ and $t_1$:
\begin{equation} \label{Eq_DOM_nxt4}
\begin{split}
@@ 640,14 +976,15 @@
\label{DOM_nxt_forward_imp}
The leapfrog differencing is unsuitable for the representation of diffusive
and damping processes. For $D$, a horizontal diffusive terms and/or the
restoring terms to a tracer climatology (when they are present, see
\S~\ref{TRA_dmp}), a forward time differencing scheme is used :
+The leapfrog differencing scheme is unsuitable for the representation of
+diffusive and damping processes. For a tendancy $D_x$, representing a
+diffusive term or a restoring term to a tracer climatology
+(when present, see \S~\ref{TRA_dmp}), a forward time differencing scheme
+ is used :
\begin{equation} \label{Eq_DOM_nxt_euler}
 x^{t+\Delta t} = x^{t\Delta t} + 2 \, \Delta t \ \text{RHS}_x^{t\Delta t}
+ x^{t+\Delta t} = x^{t\Delta t} + 2 \, \Delta t \ {D_x}^{t\Delta t}
\end{equation}
This is diffusive in time and conditionally stable. For example, the
condition of stability for a second and fourth order horizontal diffusions are \citep{Griffies2004}:
+conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies2004}:
\begin{equation} \label{Eq_DOM_nxt_euler_stability}
A^h < \left\{
@@ 658,12 +995,12 @@
\right.
\end{equation}
where $e$ is the smallest grid size in the two horizontal direction and $A^h$ the mixing coefficient. The linear constraint \eqref{Eq_DOM_nxt_euler_stability} is a necessary condition, but not sufficient. If it is not satisfied, even mildly, then the model soon becomes wildly unstable. The instability can be removed by either reducing the time steps or reducing the mixing coefficient.
+where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient. The linear constraint \eqref{Eq_DOM_nxt_euler_stability} is a necessary condition, but not sufficient. If it is not satisfied, even mildly, then the model soon becomes wildly unstable. The instability can be removed by either reducing the length of the time steps or reducing the mixing coefficient.
For the vertical diffusion terms, a forward time differencing scheme can be
used, but usually the numerical stability condition implies a strong
constraint on the time step. Two solutions are available in OPA to overcome
+constraint on the time step. Two solutions are available in \NEMO to overcome
the stability constraint: $(a)$ a forward time differencing scheme using a
time splitting technique (\np{ln\_zdfexp}=T) or $(b)$ a backward (or implicit)
time differencing scheme by \np{ln\_zdfexp}=F). In $(a)$, the master
+time splitting technique (\np{ln\_zdfexp}=.true.) or $(b)$ a backward (or implicit)
+time differencing scheme by \np{ln\_zdfexp}=.false.). In $(a)$, the master
time step $\Delta $t is cut into $N$ fractional time steps so that the
stability criterion is reduced by a factor of $N$. The computation is done as
@@ 678,5 +1015,7 @@
\end{split}
\end{equation}
with DF a vertical diffusion term. The number of fractional time steps, $N$, is given by setting \np{n\_zdfexp}, (namelist parameter). The scheme $(b)$ is unconditionally stable but diffusive. It can be written as follows:
+with DF a vertical diffusion term. The number of fractional time steps, $N$, is given
+by setting \np{n\_zdfexp}, (namelist parameter). The scheme $(b)$ is unconditionally
+stable but diffusive. It can be written as follows:
\begin{equation} \label{Eq_DOM_nxt_imp}
x^{t+\Delta t} = x^{t\Delta t} + 2 \, \Delta t \ \text{RHS}_x^{t+\Delta t}
@@ 692,5 +1031,5 @@
\right]
\end{equation}
where RHS is the right hand side of the equation except the vertical diffusion term. We rewrite \eqref{Eq_DOM_nxt_imp} as:
+where RHS is the right hand side of the equation except for the vertical diffusion term. We rewrite \eqref{Eq_DOM_nxt_imp} as:
\begin{equation} \label{Eq_DOM_nxt_imp_mat}
c(k+1)\;u^{t+1}(k+1)+d(k)\;u^{t+1}(k)\;c(k)\;u^{t+1}(k1) \equiv b(k)
@@ 703,6 +1042,9 @@
\end{align*}
\eqref{Eq_DOM_nxt_imp_mat} is a linear system of equations. All the elements of the corresponding matrix vanish except those on the diagonals. Moreover, $c(k)$ and $d(k)$ are positive and the diagonal term is greater than the sum of the
two extradiagonal terms, therefore a special adaptation of the Gauss elimination procedure is used to find the solution (see for example \citet{Richtmyer1967}).
+\eqref{Eq_DOM_nxt_imp_mat} is a linear system of equations which associated
+matrix is tridiagonal. Moreover, $c(k)$ and $d(k)$ are positive and the diagonal
+term is greater than the sum of the two extradiagonal terms, therefore a special
+adaptation of the Gauss elimination procedure is used to find the solution
+(see for example \citet{Richtmyer1967}).
% 
@@ 714,5 +1056,10 @@
\namdisplay{namrun}
%
The first time step of this three level scheme when starting from initial conditions is a forward step (Euler time integration): $x^1 = x^0 + \Delta t \ \text{RHS}^0$.
+
+The first time step of this three level scheme when starting from initial conditions
+is a forward step (Euler time integration):
+\begin{equation} \label{Eq_DOM_euler}
+ x^1 = x^0 + \Delta t \ \text{RHS}^0
+\end{equation}
It is also possible to restart from a previous computation, by using a
@@ 720,8 +1067,17 @@
restartability of the code: the user should obtain the same results to
machine precision either by running the model for $2N$ time steps in one go,
or by performing two consecutive experiments of $N$ steps with a restart. This
requires saving two time levels and many auxiliary data in the restart files
in double precision.

+or by performing two consecutive experiments of $N$ steps with a restart.
+This requires saving two time levels and many auxiliary data in the restart
+files in machine precision.
+
+Note that when a semiimplicit scheme is used to evaluate the hydrostatic pressure
+gradient (see \S\ref{DYN_hpg_imp}), an extra threedimensional field has to be
+added in the restart file to ensure an exact restartability. This is done only optionally
+via the namelist parameter \np{nn\_dynhpg\_rst}, so that a reduction of the size of restart file can be obtained when the restartability is not a key issue (operational oceanography or ensemble simulation for seasonal forcast).
+%%%
+\gmcomment{add here how to force the restart to contain only one time step for operational purposes}
+%%%
+
+\gmcomment{ % add a subsection here
%
@@ 735,4 +1091,4 @@
\colorbox{yellow}{Write documentation on the calendar and the key variable adatrj}


+} %% end add
+
Index: trunk/DOC/TexFiles/Chapters/Chap_DYN.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_DYN.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_DYN.tex (revision 994)
@@ 11,5 +11,10 @@
$\ $\newline %force an empty line
Using the representation described in Chap.~\ref{DOM}, several semidiscrete space forms of the dynamical equations are available depending on the vertical coordinate used and on the conservative properties of the vorticity term. In all the equations presented here, the masking has been omitted for simplicity. One must be aware that all the quantities are masked fields and that each time a mean or difference operator is used, the resulting field is multiplied by a mask.
+Using the representation described in Chap.\ref{DOM}, several semidiscrete
+space forms of the dynamical equations are available depending on the vertical
+coordinate used and on the conservation properties of the vorticity term. In all
+the equations presented here, the masking has been omitted for simplicity.
+One must be aware that all the quantities are masked fields and that each time a
+average or difference operator is used, the resulting field is multiplied by a mask.
The prognostic ocean dynamics equation can be summarized as follows:
@@ 20,11 +25,36 @@
\end{equation*}
NXT stands for next, referring to the timestepping. The first group of terms on the rhs of the momentum equations corresponds to the Coriolis and advection terms that are decomposed in a vorticity part (VOR), a kinetic energy part (KEG) and the vertical advection (ZAD) in the vector invariant formulation, and into Coriolis and advection (COR+ADV) in the flux formulation. The following terms are the pressure gradient contributions (HPG, Hydrostatic Pressure Gradient, and SPG, Surface Pressure Gradient). Contributions from lateral diffusion and vertical diffusion are added to the rhs in the \mdl{dynldf} and \mdl{dynzdf} modules; the latter includes the surface and bottom stresses. The external forcings and parameterisations require complex inputs (surface wind stress calculation using bulk formulae, estimation of mixing coefficients) that are carried out in modules of the SBC, LDF and ZDF categories and described in Chapters \ref{SBC}, \ref{LDF} and \ref{ZDF}, respectively.

In the present chapter we also describe the diagnostic equations used to compute the horizontal divergence and curl of the velocities (\emph{divcur} module) as well as the vertical velocity (\emph{wzvmod} module).

The different options available to the user are managed by namelist variables. For equation term \textit{ttt}, the logical namelist variables are \textit{ln\_dynttt\_xxx}, where \textit{xxx} is a 3 or 4 letter acronym accounting for each optional scheme. If a CPP key is used for this term its name is \textbf{key\_ttt}. The corresponding code can be found in the \textit{dynttt\_xxx} module, in the DYN directory, and it is usually computed in the \textit{dyn\_ttt\_xxx} subroutine.

The user has the option of extracting each tendency term on the rhs of the 3D momentum equation (\key{trddyn} defined) and of the 2D barotropic vorticity balance (\key{trdvor} defined), as described in Chap.~\ref{MISC}.
+NXT stands for next, referring to the timestepping. The first group of terms on
+the rhs of the momentum equations corresponds to the Coriolis and advection
+terms that are decomposed into a vorticity part (VOR), a kinetic energy part (KEG)
+and, a vertical advection part (ZAD) in the vector invariant formulation or a Coriolis
+and advection part(COR+ADV) in the flux formulation. The terms following these
+are the pressure gradient contributions (HPG, Hydrostatic Pressure Gradient,
+and SPG, Surface Pressure Gradient); and contributions from lateral diffusion
+(LDF) and vertical diffusion (ZDF), which are added to the rhs in the \mdl{dynldf}
+and \mdl{dynzdf} modules. The vertical diffusion term includes the surface and
+bottom stresses. The external forcings and parameterisations require complex
+inputs (surface wind stress calculation using bulk formulae, estimation of mixing
+coefficients) that are carried out in modules SBC, LDF and ZDF and are described
+in Chapters \ref{SBC}, \ref{LDF} and \ref{ZDF}, respectively.
+
+In the present chapter we also describe the diagnostic equations used to compute
+the horizontal divergence and curl of the velocities (\emph{divcur} module) as well
+as the vertical velocity (\emph{wzvmod} module).
+
+The different options available to the user are managed by namelist variables.
+For equation term \textit{ttt}, the logical namelist variables are \textit{ln\_dynttt\_xxx},
+where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.
+If a CPP key is used for this term its name is \textbf{key\_ttt}. The corresponding
+code can be found in the \textit{dynttt\_xxx} module in the DYN directory, and it is
+usually computed in the \textit{dyn\_ttt\_xxx} subroutine.
+
+The user has the option of extracting each tendency term of both the rhs of the
+3D momentum equation (\key{trddyn} defined) for output, as described in
+Chap.\ref{MISC}. Furthermore, the tendency terms associated to the 2D
+barotropic vorticity balance (\key{trdvor} defined) can be derived online from the
+3D terms.
+%%%
+\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does MISC correspond to "extracting tendency terms" or "vorticity balance"?}
% ================================================================
@@ 37,11 +67,18 @@
%
The vector invariant form of the momentum equations is the most often used in applications of the ocean model. The flux form option (next section) has been introduced recently in version $2$ of NEMO. Coriolis and momentum
advection terms are evaluated using a leapfrog scheme, i.e. the velocity appearing in their expressions is centred in time (\textit{now} velocity). At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following Chap.~\ref{LBC}.
+The vector invariant form of the momentum equations is the one most
+often used in applications of \NEMO ocean model. The flux form option
+(see next section) has been recently introduced in version $2$.
+Coriolis and momentum
+advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity
+appearing in these expressions is centred in time (\textit{now} velocity).
+At the lateral boundaries either free slip, no slip or partial slip boundary
+conditions are applied following Chap.\ref{LBC}.
% 
% Vorticity term
% 
\subsection{Vorticity term (\mdl{dynvor})}
+\subsection [Vorticity term (\textit{dynvor}) ]
+ {Vorticity term (\mdl{dynvor})}
\label{DYN_vor}
%nam_dynvor
@@ 49,19 +86,27 @@
%
Different discretisations of the vorticity term (selected by the \textit{ln\_dynvor\_xxx} namelist variable to true) are available, that conserve potential enstrophy of horizontally nondivergent flow, horizontal kinetic energy, or potential enstrophy for the relative vorticity term and horizontal kinetic energy for the planetary vorticity term (see \colorbox{yellow} { appendix C } ). The vorticity terms are given below for the general case ($s$coordinate or partial step topography), but note that in full step $z$coordinate (\key{zco} defined), $e_{3u} =e_{3v} =e_{3f}$ so that the vertical scale factors disappear.
+Different discretisations of the vorticity term (\textit{ln\_dynvor\_xxx}=.true.) are
+available: conserving potential enstrophy of horizontally nondivergent flow;
+conserving horizontal kinetic energy; or conserving potential enstrophy for the
+relative vorticity term and horizontal kinetic energy for the planetary vorticity term
+(see Appendix~\ref{Apdx_C}). The vorticity terms are given below for the general
+case, but note that in the full step $z$coordinate (\key{zco} is defined),
+$e_{3u} =e_{3v} =e_{3f}$ so that the vertical scale factors disappear.
%
% enstrophy conserving scheme
%
\subsubsection{enstrophy conserving scheme (\np{ln\_dynvor\_ens}=T)}
+\subsubsection{Enstrophy conserving scheme (\np{ln\_dynvor\_ens}=.true.)}
\label{DYN_vor_ens}
In this case, the discrete formulation of the vorticity term provides a global conservation of the enstrophy ($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$coordinates) for a horizontally nondivergent flow (i.e. $\chi=0$), but does not conserve of the total kinetic energy. It is given by:

+In the enstrophy conserving case (ENS scheme), the discrete formulation of the
+vorticity term provides a global conservation of the enstrophy
+($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$coordinates) for a horizontally nondivergent
+flow ($i.e.$ $\chi=0$), but does not conserve the total kinetic energy. It is given by:
\begin{equation} \label{Eq_dynvor_ens}
\left\{
\begin{aligned}
{\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} & {\overline{\overline {\left( {e_{1v} e_{3v} v} \right)}} }^{\,i, j+1/2} \\
{+\frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j} & {\overline{\overline {\left( {e_{2u} e_{3u} u} \right)}} }^{\,i+1/2, j}
+{+\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} & {\overline{\overline {\left( {e_{1v} e_{3v} v} \right)}} }^{\,i, j+1/2} \\
+{\frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j} & {\overline{\overline {\left( {e_{2u} e_{3u} u} \right)}} }^{\,i+1/2, j}
\end{aligned}
\right.
@@ 71,15 +116,15 @@
% energy conserving scheme
%
\subsubsection{energy conserving scheme (\np{ln\_dynvor\_ene}=T)}
+\subsubsection{Energy conserving scheme (\np{ln\_dynvor\_ene}=.true.)}
\label{DYN_vor_ene}
The kinetic energy conserving scheme conserves the global kinetic energy but
not the global enstrophy. It is given by:
+The kinetic energy conserving scheme (ENE scheme) conserves the global
+kinetic energy but not the global enstrophy. It is given by:
\begin{equation} \label{Eq_dynvor_ene}
\left\{ {
\begin{aligned}
{\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
+{+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
\;\overline {\left( {e_{1v} e_{3v} v} \right)} ^{\,i+1/2}} }^{\,j} } \\
{+\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
+{\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
\;\overline {\left( {e_{2u} e_{3u} u} \right)} ^{\,j+1/2}} }^{\,i} }
\end{aligned}
@@ 90,16 +135,19 @@
% mix energy/enstrophy conserving scheme
%
\subsubsection{mixed energy/enstrophy conserving scheme (\np{ln\_dynvor\_mix}=T) }
+\subsubsection{Mixed energy/enstrophy conserving scheme (\np{ln\_dynvor\_mix}=.true.) }
\label{DYN_vor_mix}
In this case, a mixture of the two previous schemes is used. It consists of the enstrophy conserving scheme (\ref{Eq_dynvor_ens}) applied to the relative vorticity term and of the horizontal kinetic energy conserving scheme (\ref{Eq_dynvor_ene}) applied to the planetary vorticity term.
+The mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the
+two previous schemes is used. It consists of the ENS scheme (\ref{Eq_dynvor_ens})
+to the relative vorticity term, and of the ENE scheme (\ref{Eq_dynvor_ene}) applied
+to the planetary vorticity term.
\begin{equation} \label{Eq_dynvor_mix}
\left\{ {
\begin{aligned}
 {\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i}
+ {+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i}
\; {\overline{\overline {\left( {e_{1v} \; e_{3v} \ v} \right)}} }^{\,i,j+1/2} \frac{1}{e_{1u} }
\; {\overline {\left( {\frac{f}{e_{3f} }} \right)
\;\overline {\left( {e_{1v} \; e_{3v} \ v} \right)} ^{\,i+1/2}} }^{\,j} } \\
{+\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j
+{\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j
\; {\overline{\overline {\left( {e_{2u} \; e_{3u} \ u} \right)}} }^{\,i+1/2,j} +\frac{1}{e_{2v} }
\; {\overline {\left( {\frac{f}{e_{3f} }} \right)
@@ 112,16 +160,26 @@
% energy and enstrophy conserving scheme
%
\subsubsection{energy and enstrophy conserving scheme (\np{ln\_dynvor\_een}=T) }
+\subsubsection{Energy and enstrophy conserving scheme (\np{ln\_dynvor\_een}=.true.) }
\label{DYN_vor_een}
In this case, the vorticity term is evaluated using the vorticity advection scheme of \citet{Arakawa1990}. This scheme conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow (i.e. $\chi$=0), While this scheme is more complicated that the vorticity advection scheme of \citet{Sadourny1975} and does not conserve potential enstrophy and total energy in general flow, as does a scheme from \citet{Arakawa1981}, it tolerates arbitrarily thin layers. This feature is essential for simulating either outcropping isopycnals or large amplitude topography.

The \citet{Arakawa1990} vorticity advection scheme for a single layer is modified for spherical coordinates as described by \citet{Arakawa1981}.

The potential vorticity, defined at $f$point, is:
+In the energy and enstrophy conserving scheme (EEN scheme), the vorticity term
+is evaluated using the vorticity advection scheme of \citet{Arakawa1990}.
+This scheme conserves both total energy and potential enstrophy in the limit of
+horizontally nondivergent flow ($i.e. \ \chi=0$). While EEN is more complicated
+than ENS or ENE and does not conserve potential enstrophy and total energy in
+general flow, it tolerates arbitrarily thin layers. This feature is essential for
+$z$coordinate with partial step.
+%%%
+\gmcomment{gm : it actually conserve kinetic energy ! show that in appendix C }
+%%%
+
+The \citet{Arakawa1990} vorticity advection scheme for a single layer is modified
+for spherical coordinates as described by \citet{Arakawa1981} to obtain the EEN
+scheme. The potential vorticity, defined at an $f$point, is:
\begin{equation} \label{Eq_pot_vor}
q_f = \frac{\zeta +f} {e_{3f} }
\end{equation}
where the relative vorticity is defined by (\ref{Eq_divcur_cur}), the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $F$points is:
+where the relative vorticity is defined by (\ref{Eq_divcur_cur}), the Coriolis parameter
+is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$points is:
\begin{equation} \label{Eq_een_e3f}
e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2}
@@ 132,10 +190,18 @@
\begin{center}
\includegraphics[width=0.70\textwidth]{./Figures/Fig_DYN_een_triad.pdf}
\caption{Triads used in the energy and enstrophy conserving scheme (een) for ucomponent (upper panel) and vcomponent (lower panel).}
+\caption{Triads used in the energy and enstrophy conserving scheme (een) for
+$u$component (upper panel) and $v$component (lower panel).}
\end{center}
\end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Note that a key point in \eqref{Eq_een_e3f} is that the averaging in \textbf{i} and \textbf{j} directions uses the masked vertical scale factor but is always divided by $4$, not by the sum of the mask at $T$point. This preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3T}$ tends to zero and extends by continuity the value of $e_{3f}$ in the land areas.
+Note that a key point in \eqref{Eq_een_e3f} is that the averaging in \textbf{i} and
+\textbf{j} directions uses the masked vertical scale factor but is always divided by
+$4$, not by the sum of the mask at $T$point. This preserves the continuity of
+$e_{3f}$ when one or more of the neighbouring $e_{3T}$ tends to zero and
+extends by continuity the value of $e_{3f}$ in the land areas.
+%%%
+\gmcomment{this has to be further investigate in case of several step topography}
+%%%
The vorticity terms are represented as:
@@ 154,14 +220,15 @@
q\,e_3 \,u &\equiv \frac{1}{e_{2v} } \left[
{{\begin{array}{*{20}c}
 {\,\ \ a_{j1/2}^{i } \left( {e_{2u} e_{3v} \ u} \right)_{j+1}^{i+1/2} }
 {\,+\,b_{j1/2}^{i+1} \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i+1} } \\
+ {\,\ \ a_{j1/2}^{i } \left( {e_{2u} e_{3u} \ u} \right)_{j+1}^{i+1/2} }
+ {\,+\,b_{j1/2}^{i+1} \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} } \\
\\
 { +\,c_{j+1/2}^{i+1} \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i+1} }
 {\,+\,d_{j+1/2}^{i } \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i } } \\
+ { +\,c_{j+1/2}^{i+1} \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} }
+ {\,+\,d_{j+1/2}^{i } \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i } } \\
\end{array} }} \right]
\end{aligned}
} \right.
\end{equation}
where $a$, $b$, $c$ and $d$ are triad combinations of the neighbouring potential vorticities (Fig. \ref{Fig_DYN_een_triad}):
+where $a$, $b$, $c$ and $d$ are triad combinations of the neighbouring
+potential vorticities (Fig. \ref{Fig_DYN_een_triad}):
\begin{equation} \label{Eq_een_triads}
\left\{
@@ 181,8 +248,11 @@
% Kinetic Energy Gradient term
%
\subsection{Kinetic Energy Gradient term (\mdl{dynkeg})}
+\subsection [Kinetic Energy Gradient term (\textit{dynkeg})]
+ {Kinetic Energy Gradient term (\mdl{dynkeg})}
\label{DYN_keg}
There is a single discrete formulation of the kinetic energy gradient term, that conserves the total kinetic energy together with the formulation chosen for the vertical advection (see below).
+As demonstarted in Appendix~\ref{Apdx_C}, there is a single discrete formulation
+of the kinetic energy gradient term that, together with the formulation chosen for
+the vertical advection (see below), conserves the total kinetic energy:
\begin{equation} \label{Eq_dynkeg}
\left\{ \begin{aligned}
@@ 197,8 +267,12 @@
% Vertical advection term
%
\subsection{Vertical advection term (\mdl{dynzad}) }
+\subsection [Vertical advection term (\textit{dynzad}) ]
+ {Vertical advection term (\mdl{dynzad}) }
\label{DYN_zad}
The discrete formulation of the vertical advection term conserves the total kinetic energy together with the formulation chosen for the gradient of kinetic energy (KE). Indeed, the change of KE due to the vertical advection is exactly balanced by the change of KE due to the gradient of KE (see \colorbox{yellow}{Annexe C}).
+The discrete formulation of the vertical advection, together with the formulation
+chosen for the gradient of kinetic energy (KE) term, conserves the total kinetic
+energy. Indeed, the change of KE due to the vertical advection is exactly
+balanced by the change of KE due to the gradient of KE (see Appendix~\ref{Apdx_C}).
\begin{equation} \label{Eq_dynzad}
\left\{ \begin{aligned}
@@ 219,5 +293,9 @@
%
In the flux form (as in the vector invariant form), the Coriolis and momentum advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity appearing in their expressions is centred in time (\textit{now} velocity). At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following Chap.~\ref{LBC}.
+In the flux form (as in the vector invariant form), the Coriolis and momentum
+advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity
+appearing in their expressions is centred in time (\textit{now} velocity). At the
+lateral boundaries either free slip, no slip or partial slip boundary conditions
+are applied following Chap.\ref{LBC}.
@@ 225,8 +303,11 @@
% Coriolis plus curvature metric terms
%
\subsection{Coriolis plus curvature metric terms (\mdl{dynvor}) }
+\subsection [Coriolis plus curvature metric terms (\textit{dynvor}) ]
+ {Coriolis plus curvature metric terms (\mdl{dynvor}) }
\label{DYN_cor_flux}
In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the "metric" term. This altered Coriolis parameter is thus discretised at $F$points. It is given by:
+In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis
+parameter has been modified to account for the "metric" term. This altered
+Coriolis parameter is thus discretised at $f$points. It is given by:
\begin{multline} \label{Eq_dyncor_metric}
f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i}  u\frac{\partial e_1 }{\partial j}} \right) \\
@@ 236,10 +317,15 @@
\end{multline}
Any of the (\ref{Eq_dynvor_ens}), (\ref{Eq_dynvor_ene}) and (\ref{Eq_dynvor_een}) schemes can be used to compute the product of the Coriolis parameter and the vorticity. However, the energyconserving scheme (\ref{Eq_dynvor_een}) has exclusively been used to date. This term is evaluated using a leapfrog scheme, i.e. the velocity is centred in time (\textit{now} velocity).
+Any of the (\ref{Eq_dynvor_ens}), (\ref{Eq_dynvor_ene}) and (\ref{Eq_dynvor_een})
+schemes can be used to compute the product of the Coriolis parameter and the
+vorticity. However, the energyconserving scheme (\ref{Eq_dynvor_een}) has
+exclusively been used to date. This term is evaluated using a leapfrog scheme,
+$i.e.$ the velocity is centred in time (\textit{now} velocity).
%
% Flux form Advection term
%
\subsection{Flux form Advection term (\mdl{dynadv}) }
+\subsection [Flux form Advection term (\textit{dynadv}) ]
+ {Flux form Advection term (\mdl{dynadv}) }
\label{DYN_adv_flux}
@@ 261,10 +347,17 @@
\end{equation}
Two advection schemes ($2^{nd}$ order centered finite difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS). The latter is described in \citet{Sacha2005}. The schemes are selected using the namelist variable \textit{ln\_dynadv\_xxx} In flux form, the advection schemes differ by the choice of a space and time interpolation to define the value of $u$ and $v$ at the centre of each face of $u$ and $v$cells, i.e. at the $T$, $f$, and $uw$points and $f$, $T$ and $vw$points for $u$ and $v$, respectively.
+Two advection schemes are available: a $2^{nd}$ order centered finite
+difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS.
+The latter is described in \citet{Sacha2005}. The schemes are selected using
+the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}. In flux
+form, the schemes differ by the choice of a space and time interpolation to
+define the value of $u$ and $v$ at the centre of each face of $u$ and $v$cells,
+$i.e.$ at the $T$, $f$, and $uw$points for $u$ and at the $f$, $T$ and
+$vw$points for $v$.
%
% 2nd order centred scheme
%
\subsubsection{$2^{nd}$ order centred scheme (cen2) (\np{ln\_dynadv\_cen2}=T)}
+\subsubsection{$2^{nd}$ order centred scheme (cen2) (\np{ln\_dynadv\_cen2}=.true.)}
\label{DYN_adv_cen2}
@@ 274,5 +367,5 @@
\left\{ \begin{aligned}
u_T^{cen2} &=\overline u^{i } \quad &
 u_F^{cen2} &=\overline u^{j+1/2} \quad &
+ u_F^{cen2} &=\overline u^{j+1/2} \quad &
u_{uw}^{cen2} &=\overline u^{k+1/2} \\
v_F^{cen2} &=\overline v ^{i+1/2} \quad &
@@ 282,10 +375,14 @@
\end{equation}
The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive (i.e. it may create false extrema). It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to produce a sensible solution. The associated timestepping is performed using a leapfrog scheme in conjunction with an Asselin timefilter, so $u$ and $v$ are the \emph{now} velocities.
+The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive
+($i.e.$ it may create false extrema). It is therefore notoriously noisy and must
+be used in conjunction with an explicit diffusion operator to produce a sensible
+solution. The associated timestepping is performed using a leapfrog scheme in conjunction with an Asselin timefilter, so $u$ and $v$ are the \emph{now}
+velocities.
%
% UBS scheme
%
\subsubsection{Upstream Biased Scheme (UBS) (\np{ln\_dynadv\_ubs}=T)}
+\subsubsection{Upstream Biased Scheme (UBS) (\np{ln\_dynadv\_ubs}=.true.)}
\label{DYN_adv_ubs}
@@ 299,19 +396,43 @@
\end{cases}
\end{equation}
where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. This results in a dissipatively dominant (i.e. hyperdiffusive) truncation error \citep{Sacha2005}. The overall performance of the advection scheme is similar to that reported in \citet{Farrow1995}. It is a relatively good compromise between accuracy and smoothness. It is not a \emph{positive} scheme, meaning that false extrema are permitted but their amplitude is significantly reduced over the centred second order method.

The UBS scheme is not used in all the direction. In the vertical, it has been preferred to keep the centred $2^{nd}$ order evaluation of the advection, i.e. $u_{uw}^{ubs}$ and $u_{vw}^{ubs}$ in (\ref{Eq_dynadv_cen2}) are used. Indeed, UBS is diffusive, it is associated with vertical mixing of momentum. Since vertical mixing of momentum is source term of the TKE equation{\ldots}

For stability reasons, in (\ref{Eq_dynadv_ubs}), the first term which corresponds to a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while the second term which is the diffusive part of the scheme, is
evaluated using the \textit{before} velocity (forward in time). This is discussed by \citet{Webb1998} in the context of the Quick advection scheme.

NB 1: UBS and Quadratic Upstream Interpolation for Convective Kinematics (QUICK) schemes only differ by one coefficient. Substituting $1/6$ with $1/8$ in (\ref{Eq_dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}. This option is not available through a namelist parameter, since the $1/6$ coefficient is hard coded. Nevertheless it is quite easy to make the substitution in \mdl{dynadv\_ubs} module and obtain a QUICK scheme.

NB 2 : In the current version of \mdl{dynadv\_ubs}, there is also a possibility of using a $4^{th}$ order evaluation of the advective velocity as in ROMS. This is an error and should be suppressed soon.
+where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. This results
+in a dissipatively dominant ($i.e.$ hyperdiffusive) truncation error \citep{Sacha2005}.
+The overall performance of the advection scheme is similar to that reported in
+\citet{Farrow1995}. It is a relatively good compromise between accuracy and
+smoothness. It is not a \emph{positive} scheme, meaning that false extrema are
+permitted. But the amplitudes of the false extrema are significantly reduced over
+those in the centred second order method.
+
+The UBS scheme is not used in all directions. In the vertical, the centred $2^{nd}$
+order evaluation of the advection is preferred, $i.e.$ $u_{uw}^{ubs}$ and
+$u_{vw}^{ubs}$ in \eqref{Eq_dynadv_cen2} are used. UBS is diffusive and is
+associated with vertical mixing of momentum. \gmcomment{ gm pursue the
+sentence:Since vertical mixing of momentum is a source term of the TKE equation... }
+
+For stability reasons, the first term in (\ref{Eq_dynadv_ubs}), which corresponds
+to a second order centred scheme, is evaluated using the \textit{now} velocity
+(centred in time), while the second term, which is the diffusive part of the scheme,
+is evaluated using the \textit{before} velocity (forward in time). This is discussed
+by \citet{Webb1998} in the context of the Quick advection scheme.
+
+Note that the UBS and Quadratic Upstream Interpolation for Convective Kinematics
+(QUICK) schemes only differ by one coefficient. Substituting $1/6$ with $1/8$ in
+(\ref{Eq_dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}.
+This option is not available through a namelist parameter, since the $1/6$ coefficient
+is hard coded. Nevertheless it is quite easy to make the substitution in
+\mdl{dynadv\_ubs} module and obtain a QUICK scheme.
+
+Note also that in the current version of \mdl{dynadv\_ubs}, there is also the
+possibility of using a $4^{th}$ order evaluation of the advective velocity as in
+ROMS. This is an error and should be suppressed soon.
+%%%
+\gmcomment{action : this have to be done}
+%%%
% ================================================================
% Hydrostatic pressure gradient term
% ================================================================
\section{Hydrostatic pressure gradient (\mdl{dynhpg})}
+\section [Hydrostatic pressure gradient (\textit{dynhpg})]
+ {Hydrostatic pressure gradient (\mdl{dynhpg})}
\label{DYN_hpg}
%nam_dynhpg
@@ 319,17 +440,31 @@
\namdisplay{namflg}
%
\colorbox{red} {Suppress the namflg namelist and incorporate it in the namhpg namelist}

The key distinction between the different algorithms is the vertical coordinate used, since HPG is a horizontal pressure gradient, i.e. computed along geopotential surfaces. As a result, any tilt of the surface of the computational levels will require a specific treatment to compute the hydrostatic pressure gradient.

The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme, i.e. the density appearing in its expression is centred in time (\emph{now} velocity), or a semiimplcit scheme. At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied.
+%%%
+\gmcomment{Suppress the namflg namelist and incorporate it in the namhpg namelist}
+%%%
+
+The key distinction between the different algorithms used for the hydrostatic
+pressure gradient is the vertical coordinate used, since HPG is a \emph{horizontal}
+pressure gradient, $i.e.$ computed along geopotential surfaces. As a result, any
+tilt of the surface of the computational levels will require a specific treatment to
+compute the hydrostatic pressure gradient.
+
+The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme,
+$i.e.$ the density appearing in its expression is centred in time (\emph{now} rho), or
+a semiimplcit scheme. At the lateral boundaries either free slip, no slip or partial slip
+boundary conditions are applied.
%
% zcoordinate with full step
%
\subsection{\textit{z}coordinate with full step (\np{ln\_dynhpg\_zco}=T)}
+\subsection [$z$coordinate with full step (\np{ln\_dynhpg\_zco}) ]
+ {$z$coordinate with full step (\np{ln\_dynhpg\_zco}=.true.)}
\label{DYN_hpg_zco}
The hydrostatic pressure can be obtained by integrating the hydrostatic equation vertically from the surface. Nevertheless, the pressure is quite large at great depth while its horizontal gradient is several orders of magnitude smaller. This may lead to large truncation error in the pressure gradient terms. Thus, the two horizontal components of the hydrostatic pressure gradient are computed directly as follows:
+The hydrostatic pressure can be obtained by integrating the hydrostatic equation
+vertically from the surface. However, the pressure is large at great depth while its
+horizontal gradient is several orders of magnitude smaller. This may lead to large
+truncation errors in the pressure gradient terms. Thus, the two horizontal components
+of the hydrostatic pressure gradient are computed directly as follows:
for $k=km$ (surface layer, $jk=1$ in the code)
@@ 355,53 +490,89 @@
\end{equation}
Note that the $1/2$ factor in (\ref{Eq_dynhpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as the vertical derivative of the scale factor at the surface level ($z=0)$.
+Note that the $1/2$ factor in (\ref{Eq_dynhpg_zco_surf}) is adequate because of
+the definition of $e_{3w}$ as the vertical derivative of the scale factor at the surface
+level ($z=0)$.
%
% zcoordinate with partial step
%
\subsection{\textit{z}coordinate with partial step (\np{ln\_dynhpg\_zps}=T )}
+\subsection [$z$coordinate with partial step (\np{ln\_dynhpg\_zps})]
+ {$z$coordinate with partial step (\np{ln\_dynhpg\_zps}=.true.)}
\label{DYN_hpg_zps}
With partial bottom cells, tracers in horizontally adjacent cells generally live at different depths. Before taking horizontal gradients between these tracers, a linear interpolation is used to approximate the deeper tracer as if it actually lived at the depth of the shallower tracer point.

It is necessary to do so at the last ocean level; otherwise the horizontal hydrostatic pressure gradient evaluated in zcoordinate with partial step is exactly as in pure zcoordinate case. As explained in detail in section \S\ref{TRA_zpshde}, the nonlinearity of pressure effects in the equation of state is such that it is better to interpolate vertically temperature and salinity before computing the density. Horizontal gradients of and salinity are needed for the TRA modules, which is the reason why the horizontal gradients of density at the deepest model level are computed in module \mdl{zpsdhe} located in the TRA directory and described in \S\ref{TRA_zpshde}.
+With partial bottom cells, tracers in horizontally adjacent cells generally live at
+different depths. Before taking horizontal gradients between these tracer points,
+a linear interpolation is used to approximate the deeper tracer as if it actually lived
+at the depth of the shallower tracer point.
+
+Apart from this modification, the horizontal hydrostatic pressure gradient evaluated
+in the $z$coordinate with partial step is exactly as in the pure $z$coordinate case.
+As explained in detail in section \S\ref{TRA_zpshde}, the nonlinearity of pressure
+effects in the equation of state is such that it is better to interpolate temperature and
+salinity vertically before computing the density. Horizontal gradients of temperature
+and salinity are needed for the TRA modules, which is the reason why the horizontal
+gradients of density at the deepest model level are computed in module \mdl{zpsdhe}
+located in the TRA directory and described in \S\ref{TRA_zpshde}.
%
% s and szcoordinates
%
\subsection{\textit{s} and \textit{sz} coordinates}
+\subsection{$s$ and $z$$s$coordinates}
\label{DYN_hpg_sco}
Pressure gradient formulations in $s$ coordinates have been the subject of a vast literature ($e.g.$, \citet{Song1998, Sacha2003}). A number of different pressure gradient options are coded, but they are not yet fully documented nor tested.

Traditional coding (see for example \citet{Madec1996}: (\np{ln\_dynhpg\_sco}, \np{ln\_dynhpg\_hel})
+Pressure gradient formulations in $s$coordinate have been the subject of a vast
+literature ($e.g.$, \citet{Song1998, Sacha2003}). A number of different pressure
+gradient options are coded, but they are not yet fully documented or tested.
+
+$\bullet$ Traditional coding (see for example \citet{Madec1996}: (\np{ln\_dynhpg\_sco}=.true.,
+\np{ln\_dynhpg\_hel}=.true.)
\begin{equation} \label{Eq_dynhpg_sco}
\left\{ \begin{aligned}
  \frac{1} {\rho_o \, e_{1u}} \; \delta _{i+1/2} \left[ p^h \right]
+  \frac{1} {\rho_o \, e_{1u}} \; \delta _{i+1/2} \left[ p^h \right]
+ \frac{g\; \overline {\rho}^{i+1/2}} {\rho_o \, e_{1u}} \; \delta _{i+1/2} \left[ z_T \right] \\
  \frac{1} {\rho_o \, e_{2v}} \; \delta _{j+1/2} \left[ p^h \right]
+  \frac{1} {\rho_o \, e_{2v}} \; \delta _{j+1/2} \left[ p^h \right]
+ \frac{g\; \overline {\rho}^{j+1/2}} {\rho_o \, e_{2v}} \; \delta _{j+1/2} \left[ z_T \right] \\
\end{aligned} \right.
\end{equation}
Where the first term is the pressure gradient along coordinates, computed as in (II.3.2), and $z_T$ is the depth of $T$point evaluated from the sum of the vertical scale factor at Wpoint ($e_{3w})$. The version \np{ln\_dynhpg\_hel} has been added by Aike Beckmann and involves a redefinition of the relative position of $T$ points relative to $w$ points.

Weighted density Jacobian (wdj) \citep{Song1998} (\np{ln\_dynhpg\_wdj}=T)

Density Jacobian with cubic polynomial scheme (djc) \citep{Sacha2003} (\np{ln\_dynhpg\_djc}=T)

Rotated axes scheme (rot) \citep{Thiem2006} (\np{ln\_dynhpg\_rot}=T)

Note that expression (\ref{Eq_dynhpg_sco}) is used when the variable volume formulation is activated (key\_vvl) because in that case, even with a flat bottom, the coordinate surface are not horizontal but follow the free surface \citep{Levier2007}. The other pressure gradient options are not yet available.
+Where the first term is the pressure gradient along coordinates, computed as in
+\eqref{Eq_dynhpg_zco_surf}  \eqref{Eq_dynhpg_zco}, and $z_T$ is the depth of
+the $T$point evaluated from the sum of the vertical scale factors at the $w$point
+($e_{3w}$). The version \np{ln\_dynhpg\_hel}=.true. has been added by Aike
+Beckmann and involves a redefinition of the relative position of $T$points relative
+to $w$points.
+
+$\bullet$ Weighted density Jacobian (WDJ) \citep{Song1998} (\np{ln\_dynhpg\_wdj}=.true.)
+
+$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{Sacha2003}
+(\np{ln\_dynhpg\_djc}=.true.)
+
+$\bullet$ Rotated axes scheme (rot) \citep{Thiem2006} (\np{ln\_dynhpg\_rot}=.true.)
+
+Note that expression \eqref{Eq_dynhpg_sco} is used when the variable volume
+formulation is activated (\key{vvl}) because in that case, even with a flat bottom,
+the coordinate surfaces are not horizontal but follow the free surface
+\citep{Levier2007}. The other pressure gradient options are not yet available.
%
% Timescheme
%
\subsection{Timescheme (\np{ln\_dynhpg\_imp}=T/F)}
+\subsection [Timescheme (\np{ln\_dynhpg\_imp}) ]
+ {Timescheme (\np{ln\_dynhpg\_imp}=.true./.false.)}
\label{DYN_hpg_imp}
The default time differencing scheme used for the horizontal pressure gradient is a leapfrog scheme and therefore the density used in all discrete expressions given above is the \textit{now} density, computed from the \textit{now} temperature and salinity. In some specific cases (usually high resolution simulations over a ocean domain including weakly stratified regions) the physical phenomena that control the timestep are internal gravity waves (IGWs). A semiimplicit scheme for doubling the stability limit associated with IGWs can be used \citep{Brown1978, Maltrud1998}. It consists in evaluating the hydrostatic pressure gradient as an average over the three time levels $t\Delta t$, $t$, and $t+\Delta t$ (i.e. \textit{before}, \textit{now} and \textit{after} timesteps), rather than at central time level $t$ only as in standard leapfrog scheme.

leapfrog scheme (\np{ln\_dynhpg\_imp}=F):
+The default time differencing scheme used for the horizontal pressure gradient is
+a leapfrog scheme and therefore the density used in all discrete expressions given
+above is the \textit{now} density, computed from the \textit{now} temperature and
+salinity. In some specific cases (usually high resolution simulations over an ocean
+domain which includes weakly stratified regions) the physical phenomenum that
+controls the timestep is internal gravity waves (IGWs). A semiimplicit scheme for
+doubling the stability limit associated with IGWs can be used \citep{Brown1978,
+Maltrud1998}. It involves the evaluation of the hydrostatic pressure gradient as an
+average over the three time levels $t\Delta t$, $t$, and $t+\Delta t$ ($i.e.$
+\textit{before}, \textit{now} and \textit{after} timesteps), rather than at central
+time level $t$ only, as in the standard leapfrog scheme.
+
+$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}=.true.):
\begin{equation} \label{Eq_dynhpg_lf}
@@ 410,5 +581,5 @@
\end{equation}
semiimplicit scheme (\np{ln\_dynhpg\_imp}=T):
+$\bullet$ semiimplicit scheme (\np{ln\_dynhpg\_imp}=.true.):
\begin{equation} \label{Eq_dynhpg_imp}
\frac{u^{t+\Delta t}u^{t\Delta t}}{2\Delta t}
@@ 417,33 +588,71 @@
\end{equation}
The semiimplicit time scheme (\ref{Eq_dynhpg_imp}) is made possible without significant additional computation as the density can be updated to time level $t+\Delta t$ before computing the horizontal hydrostatic pressure gradient. It can be easily shown that the CourantFriedrichsLewy (CFL) limit associated to the hydrostatic pressure gradient double using (\ref{Eq_dynhpg_imp}) compared to the standard leapfrog scheme (\ref{Eq_dynhpg_lf}). Note that (\ref{Eq_dynhpg_imp}) is equivalent to applying a time filter to the pressure gradient to eliminate high frequency IGWs. Obviously, when using (\ref{Eq_dynhpg_imp}), the doubling of the timestep is achievable only if no other factors control the timestep, such as the CFL limits associated with advection or diffusion.

In practice, the semiimplicit scheme is used when \np{ln\_dynhpg\_imp}=T.
 In this case, we choose to apply the time filter to temperature and salinity used in the equation of state, instead of applying it to the hydrostatic pressure or to the density, so that no additional storage array has to be defined. The density used to compute the hydrostatic pressure gradient (whatever the formulation) is evaluated as follows:
+The semiimplicit time scheme \eqref{Eq_dynhpg_imp} is made possible without
+significant additional computation since the density can be updated to time level
+$t+\Delta t$ before computing the horizontal hydrostatic pressure gradient. It can
+be easily shown that the stability limit associated with the hydrostatic pressure
+gradient doubles using \eqref{Eq_dynhpg_imp} compared to that using the
+standard leapfrog scheme \eqref{Eq_dynhpg_lf}. Note that \eqref{Eq_dynhpg_imp}
+is equivalent to applying a time filter to the pressure gradient to eliminate high
+frequency IGWs. Obviously, when using \eqref{Eq_dynhpg_imp}, the doubling of
+the timestep is achievable only if no other factors control the timestep, such as
+the stability limits associated with advection or diffusion.
+
+In practice, the semiimplicit scheme is used when \np{ln\_dynhpg\_imp}=.true..
+In this case, we choose to apply the time filter to temperature and salinity used in
+the equation of state, instead of applying it to the hydrostatic pressure or to the
+density, so that no additional storage array has to be defined. The density used to
+compute the hydrostatic pressure gradient (whatever the formulation) is evaluated
+as follows:
\begin{equation} \label{Eq_rho_flt}
\rho^t = \rho( \widetilde{T},\widetilde {S},z_T)
\quad \text{with} \quad
 \widetilde{\bullet} = \frac{ \bullet^{t+\Delta t} +2 \,\bullet^t + \bullet^{t\Delta t} } {4}
+ \widetilde{\,\cdot\,} = \frac{ \,\cdot\,^{t+\Delta t} +2 \,\,\cdot\,^t + \,\cdot\,^{t\Delta t} } {4}
\end{equation}

Note that in the semiimplicit case, it is necessary to save one extra threedimentional field in the restart file to restart the model with exact reproducibility, namely, the filtered density. This option is controlled by the namelist parameter \np{nn\_dynhpg\_rst}.
+\gmcomment{STEVEN: bullets look odd in this, could use X}
+
+Note that in the semiimplicit case, it is necessary to save the filtered density, an
+extra threedimensional field, in the restart file to restart the model with exact
+reproducibility. This option is controlled by the namelist parameter
+\np{nn\_dynhpg\_rst}=.true..
% ================================================================
% Surface Pressure Gradient
% ================================================================
\section{Surface pressure gradient (\mdl{dynspg})}
+\section [Surface pressure gradient (\textit{dynspg}) ]
+ {Surface pressure gradient (\mdl{dynspg})}
\label{DYN_hpg_spg}
%nam_dynspg
\namdisplay{nam_dynspg}
%
The surface pressure gradient term is related to the representation of the free surface (\S\ref{PE_hor_pg}). The main distinction is between the fixed volume case (linear free surface or rigid lid) and the variable volume case (nonlinear free surface, \key{vvl} is active). In the linear free surface case (\S\ref{PE_free_surface}) and rigid lid (\S\ref{PE_rigid_lid}), the vertical scale factors $e_{3}$ are fixed in time, while in the nonlinear case (\S\ref{PE_free_surface}) they are timedependent. With both linear and nonlinear free surface, external gravity waves are allowed in the equations, which imposes a very small time step when an explicit time stepping is used. Two methods are proposed to allow a longer time step for the threedimensional equations: the filtered free surface, which is a modification of the continuous equations (see \eqref{Eq_PE_flt}), and the splitexplicit free surface described below. The extra term introduced in the filtered method is calculated implicitly, so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}.
+
+The form of the surface pressure gradient term is dependent on the representation
+of the free surface (\S\ref{PE_hor_pg}). The main distinction is between the fixed
+volume case (linear free surface or rigid lid) and the variable volume case
+(nonlinear free surface, \key{vvl} is defined). In the linear free surface case
+(\S\ref{PE_free_surface}) and the rigid lid case (\S\ref{PE_rigid_lid}), the vertical
+scale factors $e_{3}$ are fixed in time, whilst in the nonlinear case
+(\S\ref{PE_free_surface}) they are timedependent. With both linear and nonlinear
+free surface, external gravity waves are allowed in the equations, which imposes
+a very small time step when an explicit time stepping is used. Two methods are
+proposed to allow a longer time step for the threedimensional equations: the
+filtered free surface method, which involves a modification of the continuous
+equations (see \eqref{Eq_PE_flt}), and the splitexplicit free surface method
+described below. The extra term introduced in the filtered method is calculated
+implicitly, so that the update of the $next$ velocities is done in module
+\mdl{dynspg\_flt} and not in \mdl{dynnxt}.
%
% Linear free surface formulation
%
\subsection{Linear free surface formulation (\textbf{key\_exp} or \textbf{\_ts} or \textbf{\_flt})}
+\subsection{Linear free surface formulation (\key{exp} or \textbf{\_ts} or \textbf{\_flt})}
\label{DYN_spg_linear}
In the linear free surface formulation, the sea surface height is assumed to be small compared to the thickness of the ocean levels, so that $(a)$ the time evolution of the sea surface height becomes a linear equation, and $(b)$ the thickness of the ocean levels is assumed to be constant with time. As mentioned in (\S\ref{PE_free_surface}) the linearization affects the conservation of tracers.
+In the linear free surface formulation, the sea surface height is assumed to be
+small compared to the thickness of the ocean levels, so that $(a)$ the time
+evolution of the sea surface height becomes a linear equation, and $(b)$ the
+thickness of the ocean levels is assumed to be constant with time.
+As mentioned in (\S\ref{PE_free_surface}) the linearization affects the
+conservation of tracers.
%
@@ 453,5 +662,7 @@
\label{DYN_spg_exp}
In the explicit free surface formulation, the model time step is chosen small enough to describe the external gravity waves (typically a few ten seconds). The sea surface height is given by :
+In the explicit free surface formulation, the model time step is chosen to be
+small enough to describe the external gravity waves (typically a few tens of
+seconds). The sea surface height is given by :
\begin{equation} \label{Eq_dynspg_ssh}
\frac{\partial \eta }{\partial t}\equiv \frac{\text{EMP}}{\rho _w }+\frac{1}{e_{1T}
@@ 459,17 +670,24 @@
\right]+\delta _j \left[ {e_{1v} e_{3v} v} \right]} \right)}
\end{equation}

where EMP is the surface freshwater budget (evaporation minus precipitation, and minus river runoffs (if the later are introduced as a surface freshwater flux, see \S\ref{SBC}) expressed in $Kg.m^{2}.s^{1}$, and $\rho _w =1,000\,Kg.m^{3}$ is the volumic mass of pure water. The seasurface height is evaluated using a leapfrog scheme in combination with an Asselin time filter, i.e. the velocity appearing in (\ref{Eq_dynspg_ssh}) is centred in time (\textit{now} velocity).

The surface pressure gradient, also evaluated using a leapfrog scheme, is then simply given by :
+where EMP is the surface freshwater budget, expressed in Kg/m$^2$/s
+(which is equal to mm/s), and $\rho _w$=1,000~Kg/m$^3$ is the volumic
+mass of pure water. If river runoff is expressed as a surface freshwater flux
+(see \S\ref{SBC}) then EMP can be written as the evaporation minus
+precipitation, minus the river runoff. The seasurface height is evaluated
+using a leapfrog scheme in combination with an Asselin time filter, $i.e.$
+the velocity appearing in \eqref{Eq_dynspg_ssh} is centred in time
+(\textit{now} velocity).
+
+The surface pressure gradient, also evaluated using a leapfrog scheme, is
+then simply given by :
\begin{equation} \label{Eq_dynspg_exp}
\left\{ \begin{aligned}
  \frac{1} {e_{1u}} \; \delta _{i+1/2} \left[ \,\eta\, \right] \\
 \\
  \frac{1} {e_{2v}} \; \delta _{j+1/2} \left[ \,\eta\, \right]
+  \frac{1}{e_{1u}} \; \delta _{i+1/2} \left[ \,\eta\, \right] \\
+  \frac{1}{e_{2v}} \; \delta _{j+1/2} \left[ \,\eta\, \right]
\end{aligned} \right.
\end{equation}
Consistent with the linearization, a $\left. \rho \right_{k=1} / \rho _o$ factor is omitted in (\ref{Eq_dynspg_exp}).
+Consistent with the linearization, a factor of $\left. \rho \right_{k=1} / \rho _o$
+is omitted in \eqref{Eq_dynspg_exp}.
%
@@ 481,5 +699,10 @@
\namdisplay{namdom}
%
The splitexplicit free surface formulation used in OPA follows the one proposed by \citet{Griffies2004}. The general idea is to solve the free surface equation with a small time step, while the three dimensional prognostic variables are solved with a longer time step that is a multiple of \np{rdtbt} (Figure III.3).
+
+The splitexplicit free surface formulation used in \NEMO follows the one
+proposed by \citet{Griffies2004}. The general idea is to solve the free surface
+equation with a small time step \np{rdtbt}, while the three dimensional
+prognostic variables are solved with a longer time step that is a multiple of
+\np{rdtbt} (Fig.\ref {Fig_DYN_dynspg_ts}).
%> > > > > > > > > > > > > > > > > > > > > > > > > > > >
@@ 487,10 +710,29 @@
\begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_DYN_dynspg_ts.pdf}
\caption{Schematic of the splitexplicit time stepping scheme for the barotropic and baroclinic modes, after \citet{Griffies2004}. Time increases to the right. Baroclinic time steps are denoted by $t\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$. The curved line represents a leapfrog time step, and the smaller barotropic time steps $N \Delta t=2\Delta t$ are denoted by the zigzag line. The vertically integrated forcing \textbf{M}(t) computed at baroclinic time step t represents the interaction between the barotropic and baroclinic motions. While keeping the total depth, tracer, and freshwater forcing fields fixed, a leapfrog integration carries the surface height and vertically integrated velocity from t to $t+2 \Delta t$ using N barotropic time steps of length $\Delta t$. Time averaging the barotropic fields over the N+1 time steps (endpoints included) centers the vertically integrated velocity at the baroclinic timestep $t+\Delta t$. A baroclinic leapfrog time step carries the surface height to $t+\Delta t$ using the convergence of the time averaged vertically integrated velocity taken from baroclinic time step t. }
+\caption{Schematic of the splitexplicit time stepping scheme for the external
+and internal modes. Time increases to the right.
+Internal mode time steps (which are also the model time steps) are denoted
+by $t\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$.
+The curved line represents a leapfrog time step, and the smaller time
+steps $N \Delta t_e=\frac{3}{2}\Delta t$ are denoted by the zigzag line. The vertically
+integrated forcing \textbf{M}(t) computed at the model time step $t$
+represents the interaction between the external and internal motions.
+While keeping \textbf{M} and freshwater forcing field fixed, a
+leapfrog integration carries the external mode variables (surface height and vertically integrated velocity) from $t$ to $t+\frac{3}{2} \Delta t$ using N external time steps of length $\Delta t_e$.
+Time averaging the external fields over the $\frac{2}{3}N+1$ time steps (endpoints
+included) centers the vertically integrated velocity and the sea surface height at the model timestep $t+\Delta t$. These averaged values are used to update \textbf{M}(t) with both the surface pressure gradient and the Coriolis force.
+A baroclinic leapfrog time step carries the surface height to The model time stepping scheme can then be achieved by
+$t+\Delta t$ using the convergence of the time averaged vertically integrated
+velocity taken from baroclinic time step t. }
+%%%
+\gmcomment{STEVEN: what does convergence mean in this context?}
+%%%
\end{center}
\end{figure}
%> > > > > > > > > > > > > > > > > > > > > > > > > > > >
The splitexplicit formulation has a damping effect on external gravity waves, which is weaker than the filtered free surface but still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave.
+The splitexplicit formulation has a damping effect on external gravity waves,
+which is weaker damping than for the filtered free surface but still significant as
+shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave.
%
@@ 500,8 +742,11 @@
\label{DYN_spg_flt}
The filtered formulation follows the \citet{Roullet2000} implementation. The extra term introduced in the equations (see {\S}I.2.2) is solved implicitly. The elliptic solvers available in the code are
documented in \S\ref{MISC}. The amplitude of the extra term is given by the namelist variable \np{rnu}. The default value is 1, as recommended by \citet{Roullet2000}

\colorbox{red}{\np{rnu}=1 to be suppressed from namelist !}
+The filtered formulation follows the \citet{Roullet2000} implementation. The extra
+term introduced in the equations (see {\S}I.2.2) is solved implicitly. The elliptic
+solvers available in the code are documented in \S\ref{MISC}. The amplitude of
+the extra term is given by the namelist variable \np{rnu}. The default value is 1,
+as recommended by \citet{Roullet2000}
+
+\gmcomment{\np{rnu}=1 to be suppressed from namelist !}
%
@@ 511,5 +756,11 @@
\label{DYN_spg_vvl}
In the nonlinear free surface formulation, the variations of volume are fully taken into account. This option is presented in a report \citep{Levier2007} available on the NEMO web site. The three timestepping methods (explicit, splitexplicit and filtered) are the same as in \S\ref{DYN_spg_linear} except that the ocean depth is now timedependent. In particular, this means that in filtered case, the matrix to be inverted has to be recomputed at each timestep.
+In the nonlinear free surface formulation, the variations of volume are fully
+taken into account. This option is presented in a report \citep{Levier2007}
+available on the \NEMO web site. The three timestepping methods (explicit,
+splitexplicit and filtered) are the same as in \S\ref{DYN_spg_linear} except
+that the ocean depth is now timedependent. In particular, this means that
+in the filtered case, the matrix to be inverted has to be recomputed at each
+timestep.
%
@@ 531,6 +782,9 @@
\end{equation}
Here ${\rm {\bf M}}= \left( M_u,M_v \right)$ represents the collected contributions of nonlinear,
viscous and hydrostatic pressure gradient terms in \eqref{Eq_PE_dyn} and the overbar indicates a vertical average over the whole water column (i.e. from $z=H$, the ocean bottom, to $z=0$, the rigidlid). The time derivative of $\psi$ is the solution of an elliptic equation:
+Here ${\rm {\bf M}}= \left( M_u,M_v \right)$ represents the collected
+contributions of nonlinear, viscous and hydrostatic pressure gradient terms in
+\eqref{Eq_PE_dyn} and the overbar indicates a vertical average over the
+whole water column (i.e. from $z=H$, the ocean bottom, to $z=0$, the rigidlid).
+The time derivative of $\psi$ is the solution of an elliptic equation:
\begin{multline} \label{Eq_bsf}
\delta_{i+1/2} \left[ \frac{e_{2v}}{H_v\;e_{1v}} \delta_{i} \left[ \partial_t \psi \right] \right]
@@ 541,12 +795,12 @@
\end{multline}
The elliptic solvers available in the code are documented in
\S\ref{MISC}). The boundary conditions must be given on all separate
landmasses (islands), which is done by integrating the vorticity equation
around each island. This requires identifying each island in the bathymetry
file, a cumbersome task. This explains why the rigid lid option is not
recommended with complex domains such as the global ocean. Parameters jpisl
(number of islands) and jpnisl (maximum number of points per island) of the
par\_oce.h90 file are related to this option.
+The elliptic solvers available in the code are documented in \S\ref{MISC}).
+The boundary conditions must be given on all separate landmasses (islands),
+which is done by integrating the vorticity equation around each island. This
+requires identifying each island in the bathymetry file, a cumbersome task.
+This explains why the rigid lid option is not recommended with complex
+domains such as the global ocean. Parameters jpisl (number of islands) and
+jpnisl (maximum number of points per island) of the \hf{par\_oce} file are
+related to this option.
@@ 554,23 +808,26 @@
% Lateral diffusion term
% ================================================================
\section{Lateral diffusion term (\mdl{dynldf})}
+\section [Lateral diffusion term (\textit{dynldf})]
+ {Lateral diffusion term (\mdl{dynldf})}
\label{DYN_ldf}
%nam_dynldf
\namdisplay{nam_dynldf}
%
The options available for lateral diffusion are laplacian (rotated or not)
or biharmonic operators. The coefficients may be constant or spatially
variable; the description of the coefficients is found in the chapter on lateral
physics (Chap.~\ref{LDF}). The lateral diffusion of momentum is evaluated using a
forward scheme, i.e. the velocity appearing in its expression is the
\textit{before} velocity in time, except for the pure vertical component that appears when
a tensor of rotation is used. This latter term is solved implicitly together
with the vertical diffusion term (see \S\ref{DOM_nxt})
+
+The options available for lateral diffusion are for the choice of laplacian
+(rotated or not) or biharmonic operators. The coefficients may be constant
+or spatially variable; the description of the coefficients is found in the chapter
+on lateralphysics (Chap.\ref{LDF}). The lateral diffusion of momentum is
+evaluated using a forward scheme, i.e. the velocity appearing in its expression
+is the \textit{before} velocity in time, except for the pure vertical component
+that appears when a tensor of rotation is used. This latter term is solved
+implicitly together with the vertical diffusion term (see \S\ref{DOM_nxt})
At the lateral boundaries either free slip, no slip or partial slip boundary
conditions are applied following user's choice (see Chap. \S\ref{LBC}).

% ================================================================
\subsection{Isolevel laplacian operator (\np{ln\_dynldf\_lap}=T)}
+conditions are applied according to the user's choice (see Chap.\ref{LBC}).
+
+% ================================================================
+\subsection [Isolevel laplacian operator (\np{ln\_dynldf\_lap}) ]
+ {Isolevel laplacian operator (\np{ln\_dynldf\_lap}=.true.)}
\label{DYN_ldf_lap}
@@ 590,22 +847,23 @@
As explained in \S\ref{PE_ldf}, this formulation (as the gradient of a divergence
and curl of the vorticity) preserves symmetry and ensures a complete
separation between the vorticity and divergence parts. Note that in pure
zcoordinate (\key{zco} defined), $e_{3u} =e_{3v} =e_{3f}$ so that they disappear
from the rotational part of \eqref{Eq_dynldf_lap}.
+separation between the vorticity and divergence parts. Note that in the full step
+$z$coordinate (\key{zco} is defined), $e_{3u} =e_{3v} =e_{3f}$ so that they
+cancel in the rotational part of \eqref{Eq_dynldf_lap}.
%
% Rotated laplacian operator
%
\subsection{Rotated laplacian operator (\np{ln\_dynldf\_iso}=T)}
+\subsection [Rotated laplacian operator (\np{ln\_dynldf\_iso}) ]
+ {Rotated laplacian operator (\np{ln\_dynldf\_iso}=.true.)}
\label{DYN_ldf_iso}
A rotation of lateral momentum diffusive operator is needed for isoneutral
diffusion in $z$coordinates (\np{ln\_dynldf\_iso}=T) and for either
isoneutral (\np{ln\_dynldf\_iso}=T) or geopotential
(\np{ln\_dynldf\_hor}=T) diffusion in $s$coordinates. In the partial step
+A rotation of the lateral momentum diffusive operator is needed in several cases:
+for isoneutral diffusion in $z$coordinate (\np{ln\_dynldf\_iso}=.true.) and for
+either isoneutral (\np{ln\_dynldf\_iso}=.true.) or geopotential
+(\np{ln\_dynldf\_hor}=.true.) diffusion in $s$coordinate. In the partial step
case, coordinates are horizontal excepted at the deepest level and no
rotation is performed when \np{ln\_dynldf\_hor}=T. The diffusive operator
+rotation is performed when \np{ln\_dynldf\_hor}=.true.. The diffusive operator
is defined simply as the divergence of down gradient momentum fluxes on each
momentum components. It must be emphasized that this formulation ignores
+momentum component. It must be emphasized that this formulation ignores
constraints on the stress tensor such as symmetry. The resulting discrete
representation is:
@@ 657,27 +915,30 @@
\end{split}
\end{equation}
where $r_1$ and $r_2$ are the slopes
between the surface along which the diffusive operator acts and the surface
of computation ($z$ or $s$surfaces). The way these slopes are evaluated is given
in lateral physics chapter (Chap.~\S\ref{LDF}).
+where $r_1$ and $r_2$ are the slopes between the surface along which the
+diffusive operator acts and the surface of computation ($z$ or $s$surfaces).
+The way these slopes are evaluated is given in the lateral physics chapter
+(Chap.\ref{LDF}).
%
% Isolevel bilaplacian operator
%
\subsection{Isolevel bilaplacian operator}
+\subsection [Isolevel bilaplacian operator (\np{ln\_dynldf\_bilap})]
+ {Isolevel bilaplacian operator (\np{ln\_dynldf\_bilap}=.true.)}
\label{DYN_ldf_bilap}
The lateral fourth order operator formulation on momentum is obtained by
applying \eqref{Eq_dynldf_lap} twice. It requires an additional assumption on boundary
conditions: the first derivative term normal to the coast depends on the
free or noslip lateral boundary conditions chosen, while the third
derivative terms normal to the coast are set to zero (see Chap.~\ref{LBC}).

\colorbox{yellow}{add a remark on the the change in the position of the coefficient}
+applying \eqref{Eq_dynldf_lap} twice. It requires an additional assumption on
+boundary conditions: the first derivative term normal to the coast depends on
+the free or noslip lateral boundary conditions chosen, while the third
+derivative terms normal to the coast are set to zero (see Chap.\ref{LBC}).
+%%%
+\gmcomment{add a remark on the the change in the position of the coefficient}
+%%%
% ================================================================
% Vertical diffusion term
% ================================================================
\section{Vertical diffusion term (\mdl{dynzdf})}
+\section [Vertical diffusion term (\mdl{dynzdf})]
+ {Vertical diffusion term (\mdl{dynzdf})}
\label{DYN_zdf}
%namzdf
@@ 685,9 +946,15 @@
%
The large vertical diffusion coefficient found in the surface mixed layer, together with high vertical resolution, implies a too restrictive constraint on the time step in a pure explicit time stepping
case. Two time stepping schemes can be used for the vertical diffusion term : $(a)$ a forward time differencing scheme (\np{ln\_zdfexp}=T) using a time splitting technique (\np{n\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}=F) (see \S\ref{DOM_nxt}). Note that namelist variables \np{ln\_zdfexp} and \np{n\_zdfexp} apply to both tracers and dynamics.
+The large vertical diffusion coefficient found in the surface mixed layer together
+with high vertical resolution implies that in the case of explicit time stepping there
+would be too restrictive a constraint on the time step. Two time stepping schemes
+can be used for the vertical diffusion term : $(a)$ a forward time differencing
+scheme (\np{ln\_zdfexp}=.true.) using a time splitting technique
+(\np{n\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme
+(\np{ln\_zdfexp}=.false.) (see \S\ref{DOM_nxt}). Note that namelist variables
+\np{ln\_zdfexp} and \np{n\_zdfexp} apply to both tracers and dynamics.
The formulation of the vertical subgrid scale physics is the same whatever
the vertical coordinate is. The vertical diffusive operators given by
+the vertical coordinate is. The vertical diffusion operators given by
\eqref{Eq_PE_zdf} take the following semidiscrete space form:
\begin{equation} \label{Eq_dynzdf}
@@ 700,6 +967,6 @@
\end{aligned} \right.
\end{equation}
where $A_{uw}^{vm} $ and$A_{vw}^{vm} $ are the vertical eddy viscosity and
diffusivity coefficients. The way these coefficients can be evaluated
+where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and
+diffusivity coefficients. The way these coefficients are evaluated
depends on the vertical physics used (see \S\ref{ZDF}).
@@ 711,14 +978,14 @@
= \frac{1}{\rho _o} \binom{\tau _u}{\tau _v }
\end{equation}
where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress vector in the
(\textbf{i},\textbf{j}) coordinate system. The high mixing coefficients in the
surface mixed layer ensure that the surface wind stress is distributed in
+where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress
+vector in the (\textbf{i},\textbf{j}) coordinate system. The high mixing coefficients
+in the surface mixed layer ensure that the surface wind stress is distributed in
the vertical over the mixed layer depth. If the vertical mixing coefficient
is small (when no mixed layer scheme is used) the surface stress enters only
the top model level, as a body force. The surface wind stress is calculated
in the surface module routines (SBC, see Chap.~\S\ref{SBC})

The turbulent flux of momentum at the bottom is specified through a bottom
friction parameterization (see \S\ref{ZDF_bfr})
+in the surface module routines (SBC, see Chap.\ref{SBC})
+
+The turbulent flux of momentum at the bottom of the ocean is specified through
+a bottom friction parameterization (see \S\ref{ZDF_bfr})
% ================================================================
@@ 732,12 +999,15 @@
enter the dynamical equations.
One is the effect of atmospheric pressure on the ocean dynamics (to be introduced later).

Another forcing term is the tidal potential, which will be introduced in the reference version soon.
+One is the effect of atmospheric pressure on the ocean dynamics (to be
+introduced later).
+
+Another forcing term is the tidal potential, which will be introduced in the
+reference version soon.
% ================================================================
% Time evolution term
% ================================================================
\section{Time evolution term (\mdl{dynnxt})}
+\section [Time evolution term (\textit{dynnxt})]
+ {Time evolution term (\mdl{dynnxt})}
\label{DYN_nxt}
@@ 746,6 +1016,7 @@
%
The general framework of dynamics time stepping is a leapfrog scheme, i.e.
a three level centred time scheme associated with a Asselin time filter (cf. \S\ref{DOM_nxt})
+The general framework for dynamics time stepping is a leapfrog scheme,
+$i.e.$ a three level centred time scheme associated with an Asselin time filter
+(cf. \S\ref{DOM_nxt})
\begin{equation} \label{Eq_dynnxt}
\begin{split}
@@ 755,11 +1026,11 @@
\end{split}
\end{equation}
where RHS is the right hand side of the momentum equation, the subscript $f$ denotes
filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is
initialized as \np{atfp} (namelist parameter). Its default value is \np{atfp}=0.1.

Note that whith the filtered free surface, the update of the next velocities
is done in the \mdl{dynsp\_flt} module, and nly the swap of arrays
and Asselin filter is done in \mdl{dynnxt.}
+where RHS is the right hand side of the momentum equation, the subscript $f$
+denotes filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is
+initialized as \np{atfp} (namelist parameter). Its default value is \np{atfp} = 0.1.
+
+Note that whith the filtered free surface, the update of the \textit{next} velocities
+is done in the \mdl{dynsp\_flt} module, and only the swap of arrays
+and Asselin filtering is done in \mdl{dynnxt.}
% ================================================================
@@ 770,18 +1041,17 @@
%
% zcoordinate with partial step
%
\subsection{horizontal divergence and relative vorticity (\mdl{divcur})}
+% Horizontal divergence and relative vorticity
+%
+\subsection [Horizontal divergence and relative vorticity (\textit{divcur})]
+ {Horizontal divergence and relative vorticity (\mdl{divcur})}
\label{DYN_divcur}
The vorticity is defined at Fpoint (i.e. corner point) as follows:

+The vorticity is defined at an $f$point ($i.e.$ corner point) as follows:
\begin{equation} \label{Eq_divcur_cur}
\zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta _{i+1/2} \left[ {e_{2v}\;v} \right]
 \delta _{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
\end{equation}

The horizontal divergence is defined at Tpoint. It is given by:

+ \delta _{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
+\end{equation}
+
+The horizontal divergence is defined at a $T$point. It is given by:
\begin{equation} \label{Eq_divcur_div}
\chi =\frac{1}{e_{1T}\,e_{2T}\,e_{3T} }
@@ 790,15 +1060,24 @@
\end{equation}
Note that in zcoordinate with full step (\key{zco} defined), $e_{3u} =e_{3v} =e_{3f}$ so that they disappear from \eqref{Eq_divcur_div}.

Note also that whereas the vorticity have the same discrete expression in $z$ and $s$coordinate, its physical meaning is not identical. $\zeta$ is a pseudo vorticity along $s$surfaces (only pseudo because $(u,v)$ are still defined along geopotential surfaces, but are no more necessary defined at the same depth).

The vorticity and divergence at the \textit{before} step are used in the computation of the horizontal diffusion of momentum. Note that because they have been calculated prior to the Asselin filtering of the \textit{before} velocities, the \textit{before} vorticity and divergence arrays must be included
in the restart file to ensure perfect restartability. The vorticity and divergence at the \textit{now} time step are used respectively for the nonlinear advection and the computation of the vertical velocity.
+Note that in the $z$coordinate with full step (\key{zco} is defined), $e_{3u} =e_{3v} =e_{3f}$ so that they cancel in \eqref{Eq_divcur_div}.
+
+Note also that whereas the vorticity have the same discrete expression in $z$
+and $s$coordinate, its physical meaning is not identical. $\zeta$ is a pseudo
+vorticity along $s$surfaces (only pseudo because $(u,v)$ are still defined along
+geopotential surfaces, but are no more necessary defined at the same depth).
+
+The vorticity and divergence at the \textit{before} step are used in the computation
+of the horizontal diffusion of momentum. Note that because they have been
+calculated prior to the Asselin filtering of the \textit{before} velocities, the
+\textit{before} vorticity and divergence arrays must be included in the restart file
+to ensure perfect restartability. The vorticity and divergence at the \textit{now}
+time step are used for the computation of the nonlinear advection and of the
+vertical velocity respectively.
%
% Vertical Velocity
%
\subsection{Vertical velocity (\mdl{wzvmod})}
+\subsection [Vertical velocity (\textit{wzvmod})]
+ {Vertical velocity (\mdl{wzvmod})}
\label{DYN_wzv}
@@ 814,18 +1093,18 @@
\end{equation}
With a free surface, the top vertical velocity is nonzero, due the
freshwater forcing and the variations of the free surface elevation. When
the free surface is linear or with a rigid lid, the upper boundary condition
applies at a fixed level $z=0$. Note that in the rigidlid case (\key{dynspg\_rl} defined), the surface
boundary condition ($\left. w \right_\text{surface} =0)$ is automatically
achieved at least at the computer accuracy, due to the discrete expression
of the surface pressure gradient (\colorbox{yellow}{Appendix C}).
+With a free surface, the top vertical velocity is nonzero, due to the
+freshwater forcing and the variations of the free surface elevation. With a
+linear free surface or with a rigid lid, the upper boundary condition
+applies at a fixed level $z=0$. Note that in the rigidlid case (\key{dynspg\_rl}
+is defined), the surface boundary condition ($\left. w \right_\text{surface}=0)$ is
+automatically achieved at least at computer accuracy, due to the the way the
+surface pressure gradient is expressed in discrete form (Appendix~\ref{Apdx_C}).
Note also that whereas the vertical velocity has the same discrete
expression in $z$ and $s$coordinate, its physical meaning is not the same: in
the second case, $w$ is the velocity normal to the $s$surfaces.
+expression in $z$ and $s$coordinate, its physical meaning is not the same:
+in the second case, $w$ is the velocity normal to the $s$surfaces.
With the variable volume option, the calculation of the vertical velocity is
modified (see \citet{Levier2007}, report available on the NEMO web site).

% ================================================================
+modified (see \citet{Levier2007}, report available on the \NEMO web site).
+
+% ================================================================
Index: trunk/DOC/TexFiles/Chapters/Chap_LBC.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_LBC.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_LBC.tex (revision 994)
@@ 17,31 +17,55 @@
%
%The lateral ocean boundary condition continuous to coastlines are Neumann conditions for heat and salt (no flux across boundaries) and Dirichlet conditions for momentum (from freeslip to "strong" noslip). They are handled automatically by the mask system (see \S\ref{DOM_msk}).

%OPA works with land and topography grid points in the computational domain due to the presence of continents or islands,and to the use of full or partial step representation of bottom topography. The computation is performed over the whole domain, i.e. we did not try to restrict the computation to ocean point only areas. This choice has two motivations. First, working on ocean only grid point overload the code and harms the code readability. Second,, and more importantly, it drastically reduce the vector portion of the computation, leading to a dramatic increase of CPU time requirement on vector computers. The process of defining which areas are to be masked is described in \S\ref{DOM_msk}, while this section describes how the masking affects the computation of the various terms of the equations with respect to the boundary condition at solid walls.

The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to arrays that include large portions where a computation is not required as the model variables remain at zero. Nevertheless, vectorial supercomputers are far more efficient when computing over a whole array, and the readability of a code is greatly improved when boundary conditions are applied in an automatic way rather than by a specific computation before or after each do loop. An efficient way to work over the whole domain while specifying the boundary conditions is to use the multiplication by mask arrays in the computation. A mask array is a matrix
which elements are $1 $in the ocean domain and $0$ elsewhere. A simple multiplication of a variable by its own mask ensures that it will remain zero over land areas. Since most of the boundary conditions consist of a zero flux across the solid boundaries, they can be simply settled by
multiplying variables by the right mask arrays, i.e. the mask array of the grid point where the flux is evaluated. For example, the heat flux in the \textbf{i}direction is evaluated at $u$points. Evaluating this quantity as,
+%The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt (no flux across boundaries) and Dirichlet conditions for momentum (ranging from freeslip to "strong" noslip). They are handled automatically by the mask system (see \S\ref{DOM_msk}).
+
+%OPA allows land and topography grid points in the computational domain due to the presence of continents or islands, and includes the use of a full or partial step representation of bottom topography. The computation is performed over the whole domain, i.e. we do not try to restrict the computation to oceanonly points. This choice has two motivations. Firstly, working on ocean only grid points overloads the code and harms the code readability. Secondly, and more importantly, it drastically reduces the vector portion of the computation, leading to a dramatic increase of CPU time requirement on vector computers. The current section describes how the masking affects the computation of the various terms of the equations with respect to the boundary condition at solid walls. The process of defining which areas are to be masked is described in \S\ref{DOM_msk}.
+
+The discrete representation of a domain with complex boundaries (coastlines and
+bottom topography) leads to arrays that include large portions where a computation
+is not required as the model variables remain at zero. Nevertheless, vectorial
+supercomputers are far more efficient when computing over a whole array, and the
+readability of a code is greatly improved when boundary conditions are applied in
+an automatic way rather than by a specific computation before or after each
+computational loop. An efficient way to work over the whole domain while specifying
+the boundary conditions, is to use multiplication by mask arrays in the computation.
+A mask array is a matrix whose elements are $1$ in the ocean domain and $0$
+elsewhere. A simple multiplication of a variable by its own mask ensures that it will
+remain zero over land areas. Since most of the boundary conditions consist of a
+zero flux across the solid boundaries, they can be simply applied by multiplying
+variables by the correct mask arrays, $i.e.$ the mask array of the grid point where
+the flux is evaluated. For example, the heat flux in the \textbf{i}direction is evaluated
+at $u$points. Evaluating this quantity as,
\begin{equation} \label{Eq_lbc_aaaa}
\frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT}
}{e_{1u} }\delta _{i+1 / 2} \left[ T \right]\;\;mask_u
+}{e_{1u} } \; \delta _{i+1 / 2} \left[ T \right]\;\;mask_u
\end{equation}
+(where mask$_{u}$ is the mask array at a $u$point) ensures that the heat flux is
+zero inside land and at the boundaries, since mask$_{u}$ is zero at solid boundaries
+which in this case are defined at $u$points (normal velocity $u$ remains zero at
+the coast) (Fig.~\ref{Fig_LBC_uv}).
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!t] \label{Fig_LBC_uv} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_LBC_uv.pdf}
\caption {Lateral boundary (thick line) at Tlevel. The velocity normal to the boundary is set to zero.}
+\caption {Lateral boundary (thick line) at Tlevel. The velocity normal to the
+ boundary is set to zero.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
where mask$_{u}$ is the mask array at $u$point, ensures that the heat flux is
zero inside land and at the boundaries as mask$_{u}$ is zero at solid
boundaries defined at $u$points in this case (normal velocity $u$ remains zero at
the coast) (Fig.~\ref{Fig_LBC_uv}).

On momentum the situation is a bit more complex as two boundary conditions must be provided along the coast (one on the normal velocity and the other on the tangential velocity). The boundary of the ocean in Cgrid is defined by the velocityfaces. For example, at a given $T$level, the lateral boundary (coastline or intersection with the bottom topography) is made of segments
joining $f$points, and normal velocity points are located between two $f$points (Fig.~\ref{Fig_LBC_uv}). The boundary condition on the normal velocity (no flux through solid boundaries) can thus be easily settled by the mask system. The boundary condition on the tangential velocity requires a more specific treatment. It influences the relative vorticity and momentum diffusive trends, and is only required to compute the vorticity at the coast. Four different type of the lateral boundary condition are available, controlled by the value of \np{shlat} namelist parameter (which is equal to the value of the mask$_{f}$ array along the coastline):
+For momentum the situation is a bit more complex as two boundary conditions
+must be provided along the coast (one each for the normal and tangential velocities).
+The boundary of the ocean in the Cgrid is defined by the velocityfaces.
+For example, at a given $T$level, the lateral boundary (a coastline or an intersection
+with the bottom topography) is made of segments joining $f$points, and normal
+velocity points are located between two $f$points (Fig.~\ref{Fig_LBC_uv}).
+The boundary condition on the normal velocity (no flux through solid boundaries)
+can thus be easily implemented using the mask system. The boundary condition
+on the tangential velocity requires a more specific treatment. This boundary
+condition influences the relative vorticity and momentum diffusive trends, and is
+required in order to compute the vorticity at the coast. Four different types of
+lateral boundary condition are available, controlled by the value of the \np{shlat}
+namelist parameter. (The value of the mask$_{f}$ array along the coastline is set
+equal to this parameter.) These are:
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 54,11 +78,22 @@
\begin{description}
\item[freeslip boundary condition (\np{shlat}=0): ] the tangential velocity at the coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}a).

\item[noslip boundary condition (\np{shlat}=2): ] the tangential velocity vanishes at the coastline. Assuming that the tangential velocity decreases linearly from the closest ocean velocity grid point to the coastline, the normal derivative is evaluated as if the closest land velocity gridpoint were of the same magnitude as the closest ocean velocity gridpoint but in the opposite direction (Fig.~\ref{Fig_LBC_shlat}b). Therefore, the vorticity along the coastlines is given by:
+\item[freeslip boundary condition (\np{shlat}=0): ] the tangential velocity at the
+coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the
+tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set
+to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}a).
+
+\item[noslip boundary condition (\np{shlat}=2): ] the tangential velocity vanishes
+at the coastline. Assuming that the tangential velocity decreases linearly from
+the closest ocean velocity grid point to the coastline, the normal derivative is
+evaluated as if the velocities at the closest land velocity gridpoint and the closest
+ocean velocity gridpoint were of the same magnitude but in the opposite direction
+(Fig.~\ref{Fig_LBC_shlat}b). Therefore, the vorticity along the coastlines is given by:
+
\begin{equation*}
\zeta \equiv 2 \left(\delta_{i+1/2} \left[e_{2v} v \right]  \delta_{j+1/2} \left[e_{1u} u \right] \right) / \left(e_{1f} e_{2f} \right) \ ,
\end{equation*}
where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along the coastline allows to provide a vorticity field computed with the noslip boundary condition simply by multiplying it by the mask$_{f}$ :
+where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along
+the coastline provides a vorticity field computed with the noslip boundary condition,
+simply by multiplying it by the mask$_{f}$ :
\begin{equation} \label{Eq_lbc_bbbb}
\zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta _{i+1/2}
@@ 67,15 +102,39 @@
\end{equation}
\item["partial" freeslip boundary condition (0$<$\np{shlat}$<$2): ] the tangential velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral friction but not strong enough to vanish the tangential velocity at the coast (Fig.~\ref{Fig_LBC_shlat}c). This can be settled by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$.

\item["strong" noslip boundary condition (2$<$\np{shlat}): ] the viscous boundary layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}d). The friction is thus larger than in the noslip case.
+\item["partial" freeslip boundary condition (0$<$\np{shlat}$<$2): ] the tangential
+velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral
+friction but not strong enough to make the tangential velocity at the coast vanish
+(Fig.~\ref{Fig_LBC_shlat}c). This can be selected by providing a value of mask$_{f}$
+strictly inbetween $0$ and $2$.
+
+\item["strong" noslip boundary condition (2$<$\np{shlat}): ] the viscous boundary
+layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}d).
+The friction is thus larger than in the noslip case.
\end{description}
Note that when the bottom topography is entirely represented by the $s$coordinates (pure $s$coordinate), the lateral boundary condition on momentum tangential velocity is of much little importance as it is only applied next to the coast where the minimum water depth can be quite shallow.

The alternative numerical implementation of the noslip boundary conditions for an arbitrary coast line of \citet{Shchepetkin1996} is also available through the activation of \key{noslip\_accurate}. It is based on a fourth order evaluation of the shear at the coast which, in turn, allows a true second order scheme in the interior of the domain ($i.e.$ the numerical boundary scheme simulates the truncation error of the numerical scheme used in the interior of the domain). \citet{Shchepetkin1996} found that such a technique considerably improves the quality of the numerical solution. In \NEMO, the improvement have not been found so spectacular in the halfdegree global ocean (ORCA05), but significant reduction of numerically induced coast upwellings were found in eddy resolving simulation of the Alboran Sea \citep{OlivierPh2001}. Nevertheless, as noslip boundary condition is not recommended in eddy permitting or resolving simulation \citep{Penduff2007}, the use of this option is not recommended.

In practice, the noslip accurate option changes the way the curl is evaluated at the coast (see \mdl{divcur} module), and requires to qualify the nature of coastline grid point (convex or concave corners, straight northsouth or eastwest coast) which is performed in \mdl{domask} module, \rou{dom\_msk\_nsa} routine.
+Note that when the bottom topography is entirely represented by the $s$coordinates
+(pure $s$coordinate), the lateral boundary condition on tangential velocity is of much
+less importance as it is only applied next to the coast where the minimum water depth
+can be quite shallow.
+
+The alternative numerical implementation of the noslip boundary conditions for an
+arbitrary coast line of \citet{Shchepetkin1996} is also available through the
+\key{noslip\_accurate} CPP key. It is based on a fourth order evaluation of the shear at the
+coast which, in turn, allows a true second order scheme in the interior of the domain
+($i.e.$ the numerical boundary scheme simulates the truncation error of the numerical
+scheme used in the interior of the domain). \citet{Shchepetkin1996} found that such a
+technique considerably improves the quality of the numerical solution. In \NEMO, such
+spectacular improvements have not been found in the halfdegree global ocean
+(ORCA05), but significant reductions of numerically induced coastal upwellings were
+found in an eddy resolving simulation of the Alboran Sea \citep{OlivierPh2001}.
+Nevertheless, since a noslip boundary condition is not recommended in an eddy
+permitting or resolving simulation \citep{Penduff2007}, the use of this option is also
+not recommended.
+
+In practice, the noslip accurate option changes the way the curl is evaluated at the
+coast (see \mdl{divcur} module), and requires the nature of each coastline grid point
+(convex or concave corners, straight northsouth or eastwest coast) to be specified.
+This is performed in routine \rou{dom\_msk\_nsa} in the \mdl{domask} module.
% ================================================================
@@ 93,25 +152,34 @@
\label{LBC_jperio012}
The choice of closed, cyclic or symmetric model domain boundary condition is made by setting \jp{jperio} to 0, 1 or 2 in \mdl{par\_oce} file. Each time such a boundary condition is needed, it is set by a call to \mdl{lbclnk} routine. The computation of momentum and tracer trends proceed from $i=2$ to $i=jpi1$ and from $j=2$ to $j=jpj1$, $i.e.$in the inner model domain. To choose a lateral model boundary condition is to specify the first and last rows and columns of the model variables.

 For closed boundary (\textit{jperio=0}), solid walls are imposed at all model boundaries:
first and last rows and columns are set to zero.

 For cyclic eastwest boundary (\textit{jperio=1}), first and last rows are set to zero
(closed) while first column is set to the value of the before last column
and last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}a). Whatever flows
out of the eastern (western) end of the basin enters the western (eastern)
end. Note that there is neither option for northsouth cyclic nor doubly
+The choice of closed, cyclic or symmetric model domain boundary condition is made
+by setting \jp{jperio} to 0, 1 or 2 in file \mdl{par\_oce}. Each time such a boundary
+condition is needed, it is set by a call to routine \mdl{lbclnk}. The computation of
+momentum and tracer trends proceeds from $i=2$ to $i=jpi1$ and from $j=2$ to
+$j=jpj1$, $i.e.$ in the model interior. To choose a lateral model boundary condition
+is to specify the first and last rows and columns of the model variables.
+
+\begin{description}
+
+\item[For closed boundary (\textit{jperio=0})], solid walls are imposed at all model
+boundaries: first and last rows and columns are set to zero.
+
+\item[For cyclic eastwest boundary (\textit{jperio=1})], first and last rows are set
+to zero (closed) whilst the first column is set to the value of the lastbutone column
+and the last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}a).
+Whatever flows out of the eastern (western) end of the basin enters the western
+(eastern) end. Note that there is no option for northsouth cyclic or for doubly
cyclic cases.
 For symmetric boundary condition across the equator (\textit{jperio=2}), last rows, and
first and last columns are set to zero (closed). The row of symmetry is
chosen to be the $u$ and $T$points equator line ($j=2$, i.e. at the southern end
of the domain). For arrays defined at $u$ or $T$points, the first row is set to
the value of the third row while for most of $v$ and $f$points arrays (v, $\zeta$,
$j\psi$, but scalar arrays such as eddy coefficients) the first row is set to
minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}b). Note that this boundary
condition is not yet available on massively parallel computer
(\textbf{key{\_}mpp} defined).
+\item[For symmetric boundary condition across the equator (\textit{jperio=2})],
+last rows, and first and last columns are set to zero (closed). The row of symmetry
+is chosen to be the $u$ and $T$points equator line ($j=2$, i.e. at the southern
+end of the domain). For arrays defined at $u$ or $T$points, the first row is set
+to the value of the third row while for most of $v$ and $f$point arrays ($v$, $\zeta$,
+$j\psi$, but \gmcomment{not sure why this is "but"} scalar arrays such as eddy coefficients)
+the first row is set to minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}b).
+Note that this boundary condition is not yet available for the case of a massively
+parallel computer (\textbf{key{\_}mpp} defined).
+
+\end{description}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 138,15 +206,57 @@
% ====================================================================
% SubDomain:Exchange with neighbouring processors
+% Exchange with neighbouring processors
% ====================================================================
\section{Exchange with neighbouring processors (\mdl{lbclnk}, \mdl{lib\_mpp})}
+\section [Exchange with neighbouring processors (\textit{lbclnk}, \textit{lib\_mpp})]
+ {Exchange with neighbouring processors (\mdl{lbclnk}, \mdl{lib\_mpp})}
\label{LBC_mpp}
For massively parallel processing (mpp), a domain decomposition method is used. The basis of the method consists in splitting the large computation domain of a numerical experiment into several smaller domains and solving the set of equations by addressing independent local problems. Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. The subdomain boundary conditions are specified through communications between processors which are explicitly organized by specific statements (message passing method).

A big advantage is that the method does not need many modifications of the initial FORTRAN code. For the modeller's point of view, each sub domain running on a processor is identical to the "monodomain" code. In addition, the programmer manages the communications between subdomains, and the code presents more scalability when the number of processors is increased. The porting of OPA code on a iPSC860 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with CETIIS and ONERA. The implementation in the operational context and the studies of performances on a T3D and T3E Cray computers have been made in collaboration with IDRIS and CNRS. The present implementation is largely inspired from Guyon's work [Guyon 1995].

 The parallelization strategy is defined by the physical characteristics of the ocean model. Second order finite difference schemes leads to local discrete operators that depend at the very most on one neighbouring point. The only nonlocal computations concerne the vertical physics (implicit diffusion, 1.5 turbulent closure scheme, ...) (delocalization over the whole water column), and the solving of the elliptic equation associated with the surface pressure gradient computation (delocalization over the whole horizontal domain). Therefore, a pencil strategy is used for the data substructuration: the 3D initial domain is laid out on local processor memories following a 2D horizontal topological splitting. Each subdomain computes its own surface and bottom boundary conditions and has a side wall overlapping interface which stocks lateral boundary conditions for computations in the inner subdomain. The overlapping area is reduced to one row. After a computation, a communication phase starts: each processor sends to its neighbouring processors the update values of the point corresponding to the overlapping area of its neighbouring subdomain. The communication is done through message passing. Usually the parallel virtual language, PVM, is used as it is a standard language available on nearly all MPP cumputers. More specific languages (i.e. computer dependant languages) can be easily used to speed up the communication, such as SHEM on T3E computer. The data exchanges between processors are required at the very place where lateral domain boundary conditions are set in the monodomain computation (\S III.10c): the lbc\_lnk routine which manages such conditions is substituted by mpplnk.F or mpplnk2.F routine when running on MPP computer (\key{mpp\_mpi} defined). It has to be noticed that when using MPP version of the model, the eastwest cyclic boundary condition is implicitly done, while the southsymmetric boundary condition option is not available.

+For massively parallel processing (mpp), a domain decomposition method is used.
+The basic idea of the method is to split the large computation domain of a numerical
+experiment into several smaller domains and solve the set of equations by addressing
+independent local problems. Each processor has its own local memory and computes
+the model equation over a subdomain of the whole model domain. The subdomain
+boundary conditions are specified through communications between processors
+which are organized by explicit statements (message passing method).
+
+A big advantage is that the method does not need many modifications of the initial
+FORTRAN code. From the modeller's point of view, each sub domain running on
+a processor is identical to the "monodomain" code. In addition, the programmer
+manages the communications between subdomains, and the code is faster when
+the number of processors is increased. The porting of OPA code on an iPSC860
+was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with
+CETIIS and ONERA. The implementation in the operational context and the studies
+of performance on a T3D and T3E Cray computers have been made in collaboration
+with IDRIS and CNRS. The present implementation is largely inspired by Guyon's
+work [Guyon 1995].
+
+The parallelization strategy is defined by the physical characteristics of the
+ocean model. Second order finite difference schemes lead to local discrete
+operators that depend at the very most on one neighbouring point. The only
+nonlocal computations concern the vertical physics (implicit diffusion, 1.5
+turbulent closure scheme, ...) (delocalization over the whole water column),
+and the solving of the elliptic equation associated with the surface pressure
+gradient computation (delocalization over the whole horizontal domain).
+Therefore, a pencil strategy is used for the data substructuration \gmcomment{no
+idea what this means!}: the 3D initial domain is laid out on local processor
+memories following a 2D horizontal topological splitting. Each subdomain
+computes its own surface and bottom boundary conditions and has a side
+wall overlapping interface which defines the lateral boundary conditions for
+computations in the inner subdomain. The overlapping area consists of the
+two rows at each edge of the subdomain. After a computation, a communication
+phase starts: each processor sends to its neighbouring processors the update
+values of the points corresponding to the interior overlapping area to its
+neighbouring subdomain (i.e. the innermost of the two overlapping rows). The communication is done through message passing. Usually the parallel virtual
+language, PVM, is used as it is a standard language available on nearly all
+MPP computers. More specific languages (i.e. computer dependant languages)
+can be easily used to speed up the communication, such as SHEM on a T3E
+computer. The data exchanges between processors are required at the very
+place where lateral domain boundary conditions are set in the monodomain
+computation (\S III.10c): the lbc\_lnk routine which manages such conditions
+is substituted by mpplnk.F or mpplnk2.F routine when running on an MPP
+computer (\key{mpp\_mpi} defined). It has to be pointed out that when using
+the MPP version of the model, the eastwest cyclic boundary condition is done
+implicitly, whilst the southsymmetric boundary condition option is not available.
+
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!t] \label{Fig_mpp} \begin{center}
@@ 156,5 +266,16 @@
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 In the standard version of the OPA model, the splitting is regular and arithmetic. the iaxis is divided by \jp{jpni} and the jaxis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ (model parameters set in \mdl{par\_oce}). Each processor is independent and without message passing or synchronous process, programs run alone and access just at its own local memory. For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that are noted \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal domain and the overlapping rows. The number of overlapping rows is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between the whole domain and a subdomain is:
+In the standard version of the OPA model, the splitting is regular and arithmetic.
+ the iaxis is divided by \jp{jpni} and the jaxis by \jp{jpnj} for a number of processors
+ \jp{jpnij} most often equal to $jpni \times jpnj$ (model parameters set in
+ \mdl{par\_oce}). Each processor is independent and without message passing
+ or synchronous process \gmcomment{how does a synchronous process relate to this?},
+ programs run alone and access just its own local memory. For this reason, the
+ main model dimensions are now the local dimensions of the subdomain (pencil)
+ that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal
+ domain and the overlapping rows. The number of rows to exchange (known as
+ the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain
+ dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between
+ the whole domain and a subdomain is:
\begin{eqnarray}
jpi & = & ( jpiglo2*jpreci + (jpni1) ) / jpni + 2*jpreci \nonumber \\
@@ 165,5 +286,9 @@
\colorbox{yellow}{Figure IV.3: example of a domain splitting with 9 processors and no eastwest cyclic boundary conditions.}
 One defines also variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) gridpoint in the global domain. An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, a global array (whole domain) by the relationship:
+One also defines variables nldi and nlei which correspond to the internal
+domain bounds, and the variables nimpp and njmpp which are the position
+of the (1,1) gridpoint in the global domain. An element of $T_{l}$, a local array
+(subdomain) corresponds to an element of $T_{g}$, a global array
+(whole domain) by the relationship:
\begin{equation} \label{Eq_lbc_nimpp}
T_{g} (i+nimpp1,j+njmpp1,k) = T_{l} (i,j,k),
@@ 171,5 +296,9 @@
with $1 \leq i \leq jpi$, $1 \leq j \leq jpj $ , and $1 \leq k \leq jpk$.
 Processors are numbered from 0 to $jpnij1$, the number is saved in the variable nproc. In the standard version, a processor has no more than four neighbouring processors named nono (for north), noea (east), noso (south) and nowe (west) and two variables, nbondi and nbondj, indicate the situation of the processor \colorbox{yellow}{(see Fig.IV.3)}:
+Processors are numbered from 0 to $jpnij1$, the number is saved in the variable
+nproc. In the standard version, a processor has no more than four neighbouring
+processors named nono (for north), noea (east), noso (south) and nowe (west)
+and two variables, nbondi and nbondj, indicate the relative position of the processor
+\colorbox{yellow}{(see Fig.IV.3)}:
\begin{itemize}
\item nbondi = 1 an east neighbour, no west processor,
@@ 185,14 +314,33 @@
 The OPA model computes equation terms with the help of mask arrays (0 onto land points and 1 onto sea points). It is easily readable and very efficient in the context of the vectorial architecture. But in the case of scalar processor, computations over the land regions becomes more expensive in term of CPU time. It is all the more so when we use a complex configuration with a realistic bathymetry like the global ocean where more than 50 \% of points are land points. For this reason, a preprocessing tool allows to search in the mpp domain decomposition strategy if a splitting can be found with a maximum number of only land points processors which could be eliminated: the mpp\_optimiz tools (available from the DRAKKAR web site). This optimisation is made with the knowledge of the specific bathymetry. The user chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj  jpnij$ land processors. When those parameters are specified in module \mdl{par\_oce}, the algorithm in the \rou{inimpp2} routine set each processor name and neighbour parameters (nbound, nono, noea,...) so that the land processors are not taken into account.
+The OPA model computes equation terms with the help of mask arrays (0 on land
+points and 1 on sea points). It is easily readable and very efficient in the context of
+a computer with vectorial architecture. However, in the case of a scalar processor,
+computations over the land regions become more expensive in terms of CPU time.
+It is worse when we use a complex configuration with a realistic bathymetry like the
+global ocean where more than 50 \% of points are land points. For this reason, a
+preprocessing tool can be used to choose the mpp domain decomposition with a
+maximum number of only land points processors, which can then be eliminated.
+(For example, the mpp\_optimiz tools, available from the DRAKKAR web site.)
+This optimisation is dependent on the specific bathymetry employed. The user
+then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with
+$jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj  jpnij$
+land processors. When those parameters are specified in module \mdl{par\_oce},
+the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound,
+nono, noea,...) so that the landonly processors are not taken into account.
\colorbox{yellow}{Note that the inimpp2 routine is general so that the original inimpp routine should be suppressed from the code.}
When land processors are eliminated, the value corresponding to these locations in the model output files is zero. Note that this is a problem for a mesh output file written by such a model configuration, because model users often divide by the scale factors ($e1t$, $e2t$, etc) and do not expect the grid size to be zero, even on land. It may be best not to eliminate land processors when running the model especially to write the mesh files as outputs (when \np{nmsh} namelist parameter differs from 0).
+\gmcomment{Steven : dont understand this, no land processor means no output file covering this part of globe; its only when files are stitched together into one that you can leave a hole}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!ht] \label{Fig_mppini2} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_mppini2.pdf}
\caption {Example of Atlantic domain defined for the CLIPPER projet. Initial grid is composed by 773 x 1236 horizontal points. (a) the domain is splitting onto 9 \time 20 subdomains (jpni=9, jpnj=20). 52 subdomains are land areas. (b) 52 subdomains are eliminated (white rectangles) and the resulting number of processors really used during the computation is jpnij=128.}
+\caption {Example of Atlantic domain defined for the CLIPPER projet. Initial grid is
+composed of 773 x 1236 horizontal points. (a) the domain is split onto 9 \time 20
+subdomains (jpni=9, jpnj=20). 52 subdomains are land areas. (b) 52 subdomains
+are eliminated (white rectangles) and the resulting number of processors really
+used during the computation is jpnij=128.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 222,14 +370,25 @@
\namdisplay{namobc}
It is often necessary to implement a model configuration limited to an oceanic region or a basin, which communicates with the rest of the global ocean through ``open boundaries''. As stated by \citet{Roed1986}, an open boundary is a computational border where the aim of the calculations is to allow the perturbations generated inside the computational domain to leave it without deterioration of the inner model solution. However, an open boundary also has to let information from the outer oceans enter the model and should support inflow and outflow conditions.

The open boundary package OBC is the first open boundary option developed in NEMO (originally in OPA8.2). It allows the user to
+It is often necessary to implement a model configuration limited to an oceanic
+region or a basin, which communicates with the rest of the global ocean through
+''open boundaries''. As stated by \citet{Roed1986}, an open boundary is a
+computational border where the aim of the calculations is to allow the perturbations
+generated inside the computational domain to leave it without deterioration of the
+inner model solution. However, an open boundary also has to let information from
+the outer ocean enter the model and should support inflow and outflow conditions.
+
+The open boundary package OBC is the first open boundary option developed in
+NEMO (originally in OPA8.2). It allows the user to
\begin{itemize}
\item tell the model that a boundary is ``open'' and not closed by a wall, for example by modifying the calculation of the divergence of velocity there, and other necessary modifications;
+\item tell the model that a boundary is ''open'' and not closed by a wall, for example by modifying the calculation of the divergence of velocity there;
\item impose values of tracers and velocities at that boundary (values which may be taken from a climatology): this is the``fixed OBC'' option.
\item calculate boundary values by a sophisticated algorithm combining radiation and relaxation (``radiative OBC'' option)
\end{itemize}
The package resides in the OBC directory. It is described here in four parts: the boundary geometry (parameters to be set in \mdl{obc\_par}), the forcing data at the boundaries (module \mdl{obcdta}), the radiation algorithm involving the namelist and module \mdl{obcrad}, and a brief presentation of boundary update and restart files.
+The package resides in the OBC directory. It is described here in four parts: the
+boundary geometry (parameters to be set in \mdl{obc\_par}), the forcing data at
+the boundaries (module \mdl{obcdta}), the radiation algorithm involving the
+namelist and module \mdl{obcrad}, and a brief presentation of boundary update
+and restart files.
%
@@ 237,7 +396,22 @@
\label{OBC_geom}
%
First one has to realize that open boundaries may not necessarily be located at the extremities of the computational domain. They may exist in the middle of the domain, for example at Gibraltar Straits if one wants to avoid including the Mediterranean in an Atlantic domain. This flexibility has been found necessary for the CLIPPER project \citep{Treguier2001}. Because of the complexity of the geometry of ocean basins, it may even be necessary to have more than one ``west'' open boundary, more than one ``north'', etc. This is not possible with the OBC option: only one open boundary of each kind, west, east, south and north is allowed; those names refer to the grid geometry (not to the direction of the geographical ``west'', ``east'', etc).

The open boundary geometry is set by a series of parameters in the module \mdl{obc\_par}. For an eastern open boundary, parameters are \jp{lp\_obc\_east} (true if an east open boundary exists), \jp{jpieob} the $i$index along which the eastern open boundary (eob) is located, \jp{jpjed} the $j$index at which it starts, and \jp{jpjef} the $j$index where it ends (note $d$ is for ``d\'{e}but'' and $f$ for ``fin'' in French). Similar parameters exist for the west, south and north cases (Table~\ref{Tab_obc_param}).
+First one has to realize that open boundaries may not necessarily be located
+at the extremities of the computational domain. They may exist in the middle
+of the domain, for example at Gibraltar Straits if one wants to avoid including
+the Mediterranean in an Atlantic domain. This flexibility has been found necessary
+for the CLIPPER project \citep{Treguier2001}. Because of the complexity of the
+geometry of ocean basins, it may even be necessary to have more than one
+''west'' open boundary, more than one ''north'', etc. This is not possible with
+the OBC option: only one open boundary of each kind, west, east, south and
+north is allowed; these names refer to the grid geometry (not to the direction
+of the geographical ''west'', ''east'', etc).
+
+The open boundary geometry is set by a series of parameters in the module
+\mdl{obc\_par}. For an eastern open boundary, parameters are \jp{lp\_obc\_east}
+(true if an east open boundary exists), \jp{jpieob} the $i$index along which
+the eastern open boundary (eob) is located, \jp{jpjed} the $j$index at which
+it starts, and \jp{jpjef} the $j$index where it ends (note $d$ is for ''d\'{e}but''
+and $f$ for ''fin'' in French). Similar parameters exist for the west, south and
+north cases (Table~\ref{Tab_obc_param}).
@@ 265,11 +439,32 @@
\end{tabular}
\end{center}
\caption{Names of different indices concerning the open boundaries. In the case of a completely open ocean domain with four ocean boundaries, the parameters take exactly the values indicated.}
+\caption{Names of different indices relating to the open boundaries. In the case
+of a completely open ocean domain with four ocean boundaries, the parameters
+take exactly the values indicated.}
\end{table}
The open boundaries must be along coordinate lines. On the Cgrid, the boundary itself is along a line of normal velocity points: $v$ points for a zonal open boundary (the south or north one), and $u$ points for a meridional open boundary (the west or east one). Another constraint is that there still must be a row of masked points all around the domain, as if the domain were a closed basin (unless periodic conditions are used together with open boundary conditions). Therefore, an open boundary cannot be located at the first/last index, namely, 1 or \jp{jpiglo}, \jp{jpjglo}. Also, the open boundary algorithm involves calculating the normal velocity points situated just on the boundary, as well as the tangential velocity and temperature, salinity just outside the boundary. This means that for a west/south boundary, normal velocities and temperature are calculated at the same index \jp{jpiwob} and \jp{jpjsob}, respectively. For an east/north boundary, the normal velocity is calculated at index \jp{jpieob} and \jp{jpjnob}, but the ``outside'' temperature is at index \jp{jpieob}+1 and \jp{jpjnob}+1. This means that \jp{jpieob}, \jp{jpjnob} cannot be bigger than \jp{jpiglo}2, \jp{jpjglo}2.


The starting and ending indices are to be thought as $T$ point indices: in many cases they indicate the first land $T$point, at the extremity of an open boundary (the coast line follows the $f$ grid points, see Fig.~\ref{Fig_obc_north} for the example for a northern open boundary. All indices are relative to the global domain. In the free surface case it is possible to have ``ocean corners'', that is, an open boundary starting and ending in the ocean.
+The open boundaries must be along coordinate lines. On the Cgrid, the boundary
+itself is along a line of normal velocity points: $v$ points for a zonal open boundary
+(the south or north one), and $u$ points for a meridional open boundary (the west
+or east one). Another constraint is that there still must be a row of masked points
+all around the domain, as if the domain were a closed basin (unless periodic conditions
+are used together with open boundary conditions). Therefore, an open boundary
+cannot be located at the first/last index, namely, 1, \jp{jpiglo} or \jp{jpjglo}. Also,
+the open boundary algorithm involves calculating the normal velocity points situated
+just on the boundary, as well as the tangential velocity and temperature and salinity
+just outside the boundary. This means that for a west/south boundary, normal
+velocities and temperature are calculated at the same index \jp{jpiwob} and
+\jp{jpjsob}, respectively. For an east/north boundary, the normal velocity is
+calculated at index \jp{jpieob} and \jp{jpjnob}, but the ``outside'' temperature is
+at index \jp{jpieob}+1 and \jp{jpjnob}+1. This means that \jp{jpieob}, \jp{jpjnob}
+cannot be bigger than \jp{jpiglo}2, \jp{jpjglo}2.
+
+
+The starting and ending indices are to be thought of as $T$ point indices: in many
+cases they indicate the first land $T$point, at the extremity of an open boundary
+(the coast line follows the $f$ grid points, see Fig.~\ref{Fig_obc_north} for an example
+of a northern open boundary). All indices are relative to the global domain. In the
+free surface case it is possible to have ``ocean corners'', that is, an open boundary
+starting and ending in the ocean.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 281,5 +476,13 @@
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Although not absolutely compulsory, it is highly recommended that the bathymetry in the vicinity of an open boundary follows the following rule: in the direction perpendicular to the open line, the water depth should be constant for 4 grid points. This is in order to ensure that the radiation condition, which involves mdoel variables next to the boundary, is calculated in a consistent way. On Fig.\ref{Fig_obc_north} we indicate by a $=$ symbol, the points which should have the same depth. It means that in the 4 points near the boundary, the bathymetry is cylindrical. The line behind the open Tline must be 0 in the bathymetry file (as shown on Fig.\ref{Fig_obc_north} for example).
+Although not compulsory, it is highly recommended that the bathymetry in the
+vicinity of an open boundary follows the following rule: in the direction perpendicular
+to the open line, the water depth should be constant for 4 grid points. This is in
+order to ensure that the radiation condition, which involves model variables next
+to the boundary, is calculated in a consistent way. On Fig.\ref{Fig_obc_north} we
+indicate by an $=$ symbol, the points which should have the same depth. It means
+that at the 4 points near the boundary, the bathymetry is cylindrical \gmcomment{not sure
+why cylindrical}. The line behind the open $T$line must be 0 in the bathymetry file
+(as shown on Fig.\ref{Fig_obc_north} for example).
%
@@ 287,13 +490,43 @@
\label{OBC_data}
It is necessary to provide information at the boundaries. The simple case happens when this information does not change in time and is equal to the initial conditions (namelist variable \np{nobc\_dta}=0). This is the case of the standard configuration EEL5 with open boundaries. When (\np{nobc\_dta}=1), open boundary information is read from netcdf files. For convenience the input files are supposed to be similar to the ''history'' NEMO output files, for dimension names and variable names.
Open boundary arrays must be dimensioned according to the parameters of table~\ref{Tab_obc_param}: for example, at the western boundary arrays have a dimension of \jp{jpwf}\jp{jpwd}+1 on the horizontal and \jp{jpk} on the vertical.

When ocean observations are used to generate the boundary data (a hydrographic section for example, as in \citet{Treguier2001}) it happens often that only the velocity normal to the boundary is known, which is the reason why the initial OBC code assumes that only $T$, $S$, and the normal velocity ($u$ or $v$) needs to be specified. As more and more global model solutions and ocean analysis products are available, it is possible to provide information about all the variables (including the tangential velocity) so that the specification of four variables at each boundaries will soon become standard. Regarding the sea surface height, one must distinguish the filtered free surface case from the timesplitting or explicit treatment of the free surface.
 In the first case, it is assumed that the user does not wish to represent high frequency motions such as tides. The boundary condition is thus one of zero normal gradient of sea surface height at the open boundaries, following \citet{Marchesiello2001}.
No information other than the total velocity needs to be provided at the open boundaries in that case. In the other two cases (time stplitting or explicit free surface), the user must provides barotropic information (sea surface height and barotropic velocities) and the use of the Flather algorithm for barotropic variables is recommanded. However, this algorithm has not yet been fully tested and bugs remain in NEMO v2.3. Users should read the code carefully before using it. Finally, in the case of the rigid lid approximation the barotropic streamfunction must be provided, as documented in \citet{Treguier2001}). This option is no longer used but remains in NEMO V2.3.

One frequently encountered case is when an open boundary domain is constructed from a global or larger scale NEMO configuration. Assuming the domain corresponds to indices $ib:ie$, $jb:je$ of the global domain, the bathymetry and forcing of the small domain can be created by using the following command on the global files: ncks F $d\;x,ib,ie$ $d\;y,jb,je$.
The open boundary files can be constructed using ncks commands, following table~\ref{Tab_obc_ind}.
+It is necessary to provide information at the boundaries. The simplest case is
+when this information does not change in time and is equal to the initial conditions
+(namelist variable \np{nobc\_dta}=0). This is the case for the standard configuration
+EEL5 with open boundaries. When (\np{nobc\_dta}=1), open boundary information
+is read from netcdf files. For convenience the input files are supposed to be similar
+to the ''history'' NEMO output files, for dimension names and variable names.
+Open boundary arrays must be dimensioned according to the parameters of table~
+\ref{Tab_obc_param}: for example, at the western boundary, arrays have a
+dimension of \jp{jpwf}\jp{jpwd}+1 in the horizontal and \jp{jpk} in the vertical.
+
+When ocean observations are used to generate the boundary data (a hydrographic
+section for example, as in \citet{Treguier2001}) it happens often that only the velocity
+normal to the boundary is known, which is the reason why the initial OBC code
+assumes that only $T$, $S$, and the normal velocity ($u$ or $v$) needs to be
+specified. As more and more global model solutions and ocean analysis products
+become available, it will be possible to provide information about all the variables
+(including the tangential velocity) so that the specification of four variables at each
+boundaries will become standard. For the sea surface height, one must distinguish
+between the filtered free surface case and the timesplitting or explicit treatment of
+the free surface.
+ In the first case, it is assumed that the user does not wish to represent high
+ frequency motions such as tides. The boundary condition is thus one of zero
+ normal gradient of sea surface height at the open boundaries, following \citet{Marchesiello2001}.
+No information other than the total velocity needs to be provided at the open
+boundaries in that case. In the other two cases (time splitting or explicit free surface),
+the user must provide barotropic information (sea surface height and barotropic
+velocities) and the use of the Flather algorithm for barotropic variables is
+recommanded. However, this algorithm has not yet been fully tested and bugs
+remain in NEMO v2.3. Users should read the code carefully before using it. Finally,
+in the case of the rigid lid approximation the barotropic streamfunction must be
+provided, as documented in \citet{Treguier2001}). This option is no longer
+recommended but remains in NEMO V2.3.
+
+One frequently encountered case is when an open boundary domain is constructed
+from a global or larger scale NEMO configuration. Assuming the domain corresponds
+to indices $ib:ie$, $jb:je$ of the global domain, the bathymetry and forcing of the
+small domain can be created by using the following netcdf utility on the global files:
+ncks F $d\;x,ib,ie$ $d\;y,jb,je$ (part of the nco series of utilities, see http://nco.sourceforge.net). The open boundary files can be constructed using ncks
+commands, following table~\ref{Tab_obc_ind}.
%TABLE
@@ 322,27 +555,52 @@
\end{tabular}
\end{center}
\caption{Indications for creating open boundary files from a global configuration, appropriate for the subdomain of indices $ib:ie$, $jb:je$. ``Index'' designates the $i$ or $j$ index along which the $u$ of $v$ boundary point is situated in the global configuration, starting and ending with the $j$ or $i$ indices indicated. For example, to generate file obcnorth\_V.nc, use the command ncks $F$ $d\;y,je2$ $d\;x,ib+1,ie1$ }
+\caption{Requirements for creating open boundary files from a global configuration,
+appropriate for the subdomain of indices $ib:ie$, $jb:je$. ``Index'' designates the
+$i$ or $j$ index along which the $u$ of $v$ boundary point is situated in the global
+configuration, starting and ending with the $j$ or $i$ indices indicated.
+For example, to generate file obcnorth\_V.nc, use the command ncks
+$F$ $d\;y,je2$ $d\;x,ib+1,ie1$ }
\end{table}
It is assumed that the open boundary files contain the variables for the period of the model integration. If the boundary files contain one time frame, the boundary data is held fixed in time. If the files contain 12 values, it is assumed that the input is a climatology for a repeated annual cycle (corresponding to the case \np{ln\_obc\_clim} = .T.). The case of an arbitrary number of time frames is not yet implemented correctly; the user is supposed to write his own code in the module \mdl{obc\_dta} to deal with this situation.
+It is assumed that the open boundary files contain the variables for the period of
+the model integration. If the boundary files contain one time frame, the boundary
+data is held fixed in time. If the files contain 12 values, it is assumed that the input
+is a climatology for a repeated annual cycle (corresponding to the case \np{ln\_obc\_clim}
+= .True.). The case of an arbitrary number of time frames is not yet implemented
+correctly; the user is required to write his own code in the module \mdl{obc\_dta}
+to deal with this situation.
\subsection{Radiation algorithm}
\label{OBC_rad}
The art of open boundary management consists in applying a constraint strong enough so that the inner domain "feels" the rest of the ocean, but not too strong
in order to allow perturbations to leave the domain with minimum false reflexions of energy. The cosntraint to the specified boundary data is set by time scales
specified separately for each boundary and for ``inflow'' and `outflow'' conditions as defined below. These time scales are set (in days) by namelist parameters such as \np{rdpein}, \np{rdpeob} for the eastern open boundary, for example. When both time scales are zero for a given boundary, for example
\jp{lp\_obc\_west}=.T., \np{rdpwob}=0, \np{rdpwin}=0, this means that the boundary in question (western boundary here) is a ``fixed '' boundary where the solution is set exactly by the boundary data. This is not recommanded, excepted in compination with increased viscosity in a ``sponge'' layer next to the boundary in order to avois spurious reflexions.


The radiation\/relaxation algorithm is applied when either relxation time (for ``inflow'' or `outflow'') is nonzero. It has been developed and tested in the SPEM model and its successor ROMS \citep{Barnier1996, Marchesiello2001}, a $s$coordinate model on an Arakawa Cgrid. Although the algorithm has been numerically successful in the CLIPPER Atlantic models, the physics do not work as expected \citep{Treguier2001}. Users are invited to consider open boundary conditions (OBC hereafter) with some skepticism \citep{Durran2001, Blayo2005}.

The first part of the algorithm consists in calculating a phase
velocity to determine whether perturbations tend to propagate toward,
or away from, the boundary.
Let us consider a model variable $\phi$.
The phase velocity ($C_{\phi x}$,$C_{\phi y}$) for the variable
$\phi$, in the directions normal and tangential to
the boundary is
+The art of open boundary management consists in applying a constraint strong
+enough that the inner domain "feels" the rest of the ocean, but weak enough
+that perturbations are allowed to leave the domain with minimum false reflections
+of energy. The constraints are specified separately at each boundary as time
+scales for ''inflow'' and ''outflow'' as defined below. The time scales are set (in days)
+by namelist parameters such as \np{rdpein}, \np{rdpeob} for the eastern open
+boundary for example. When both time scales are zero for a given boundary
+($e.g.$ for the western boundary, \jp{lp\_obc\_west}=.True., \np{rdpwob}=0 and
+\np{rdpwin}=0) this means that the boundary in question is a ''fixed '' boundary
+where the solution is set exactly by the boundary data. This is not recommended,
+except in combination with increased viscosity in a ''sponge'' layer next to the
+boundary in order to avoid spurious reflections.
+
+
+The radiation\/relaxation \gmcomment{the / doesnt seem to appear in the output}
+algorithm is applied when either relaxation time (for ''inflow'' or ''outflow'') is
+nonzero. It has been developed and tested in the SPEM model and its
+successor ROMS \citep{Barnier1996, Marchesiello2001}, which is an
+$s$coordinate model on an Arakawa Cgrid. Although the algorithm has
+been numerically successful in the CLIPPER Atlantic models, the physics
+do not work as expected \citep{Treguier2001}. Users are invited to consider
+open boundary conditions (OBC hereafter) with some scepticism
+\citep{Durran2001, Blayo2005}.
+
+The first part of the algorithm calculates a phase velocity to determine
+whether perturbations tend to propagate toward, or away from, the
+boundary. Let us consider a model variable $\phi$.
+The phase velocities ($C_{\phi x}$,$C_{\phi y}$) for the variable $\phi$,
+in the directions normal and tangential to the boundary are
\begin{equation} \label{Eq_obc_cphi}
C_{\phi x} = \frac{ \phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{x}
@@ 350,21 +608,21 @@
C_{\phi y} = \frac{ \phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{y}.
\end{equation}
Following \citet{Treguier2001} and \citet{Marchesiello2001} retain only the normal
projection of the total velocity, $C_{\phi x}$, setting
$C_{\phi y} =0$ (but unlike the original Orlanski radiation algorithm we retain $\phi_{y}$ in the expression
for $C_{\phi x}$).
+Following \citet{Treguier2001} and \citet{Marchesiello2001} we retain only
+the normal component of the velocity, $C_{\phi x}$, setting $C_{\phi y} =0$
+(but unlike the original Orlanski radiation algorithm we retain $\phi_{y}$ in
+the expression for $C_{\phi x}$).
The discrete form of (\ref{Eq_obc_cphi}), described by \citet{Barnier1998},
takes into account the two rows of grid points situated inside the domain
next to the boundary, and the three previous time steps ($n$, $n1$,
and $n2$).
The same equation can then be discretized at the boundary at
time steps $n$ and $n+1$ in order to extrapolate the new boundary
value $\phi^{n+1}$.

In the present open boundary algorithm, the new boundary values are
updated differently according to the sign of $C_{\phi x}$.
Let us take an East boundary as an example. The solution for variable $\phi$ at the boundary is given from a generalized wave equation
with phase velocity $C_{\phi}$, with the addition of a relaxation term:
+and $n2$). The same equation can then be discretized at the boundary at
+time steps $n1$, $n$ and $n+1$ \gmcomment{since the original was three timelevel}
+in order to extrapolate for the new boundary value $\phi^{n+1}$.
+
+In the open boundary algorithm as implemented in NEMO v2.3, the new boundary
+values are updated differently depending on the sign of $C_{\phi x}$. Let us take
+an eastern boundary as an example. The solution for variable $\phi$ at the
+boundary is given by a generalized wave equation with phase velocity $C_{\phi}$,
+with the addition of a relaxation term, as:
\begin{eqnarray}
\phi_{t} & = & C_{\phi x} \phi_{x} + \frac{1}{\tau_{o}} (\phi_{c}\phi)
@@ 373,38 +631,68 @@
\;\;\; \;\;\; \;\;\;\;\;\; (C_{\phi x} < 0), \label{Eq_obc_radi}
\end{eqnarray}
where $\phi_{c}$ is the estimate of $\phi$ at the boundary, provided as boundary data.
Note that in (\ref{Eq_obc_rado}), $C_{\phi x}$
is bounded by the ratio $\delta x/\delta t$ for stability reasons.
When $C_{\phi x}$ is eastward (outward propagation),
the radiation condition (\ref{Eq_obc_rado}) is used.
When $C_{\phi x}$ is westward (inward propagation), (\ref{Eq_obc_radi}) is used with
a strong relaxation to climatology (usually $\tau_{i}=\np{rdpein}=$1~day).
The time derivative in (\ref{Eq_obc_radi}) is calculated with a Euler timestepping
scheme. It results from this choice that setting
$\tau_{i}$ smaller than, or equal to the time step is in fact equivalent to a fixed boundary condition;
a time scale of one day is usually a good compromise which guarantees that the inflow conditions remain close to
climatology while ensuring numerical stability.

In the case of a west boundary located in the Eastern Atlantic, \citet{Penduff2000} have been able to implement the radiation algorithm
without any boundary data, using persistence from the previous time step instead. This solution did not work in other cases \citep{Treguier2001} so that the use of boundary data is recommended.
Even in the outflow condition (\ref{Eq_obc_rado}), we have found desireable to maintain a weak relaxation to climatology.
The time step is usually chosen so as to be larger than typical turbulent scales (of order 1000~days).

The radiation condition is applied to the different model variables: temperature, salinity, tangential and normal velocities.
For normal and tangential velocities $u$ and $v$ radiation is applied with phase velocities calculated from $u$ and $v$ respectively.
For the radiation of tracers, we use the phase velocity calculated from the tangential velocity, to avoid calculating too many independent
radiation velocities and because tangential velocities and tracers have the same position along the boundary on a C grid.
+where $\phi_{c}$ is the estimate of $\phi$ at the boundary, provided as boundary
+data. Note that in (\ref{Eq_obc_rado}), $C_{\phi x}$ is bounded by the ratio
+$\delta x/\delta t$ for stability reasons. When $C_{\phi x}$ is eastward (outward
+propagation), the radiation condition (\ref{Eq_obc_rado}) is used.
+When $C_{\phi x}$ is westward (inward propagation), (\ref{Eq_obc_radi}) is
+used with a strong relaxation to climatology (usually $\tau_{i}=\np{rdpein}=$1~day).
+Equation (\ref{Eq_obc_radi}) is solved with a Euler timestepping scheme. As a
+consequence, setting $\tau_{i}$ smaller than, or equal to the time step is equivalent
+to a fixed boundary condition. A time scale of one day is usually a good compromise
+which guarantees that the inflow conditions remain close to climatology while ensuring
+numerical stability.
+
+In the case of a western boundary located in the Eastern Atlantic, \citet{Penduff2000}
+have been able to implement the radiation algorithm without any boundary data,
+using persistence from the previous time step instead. This solution has not worked
+in other cases \citep{Treguier2001}, so that the use of boundary data is recommended.
+Even in the outflow condition (\ref{Eq_obc_rado}), we have found it desirable to
+maintain a weak relaxation to climatology. The time step is usually chosen so as to
+be larger than typical turbulent scales (of order 1000~days \gmcomment{or maybe seconds?}).
+
+The radiation condition is applied to the model variables: temperature, salinity,
+tangential and normal velocities. For normal and tangential velocities, $u$ and $v$,
+radiation is applied with phase velocities calculated from $u$ and $v$ respectively.
+For the radiation of tracers, we use the phase velocity calculated from the tangential
+velocity in order to avoid calculating too many independent radiation velocities and
+because tangential velocities and tracers have the same position along the boundary
+on a Cgrid.
\subsection{Domain decomposition (\key{mpp\_mpi})}
\label{OBC_mpp}
When \key{mpp\_mpi} is active in the code, the computational domain is divided into rectangles that are attributed each to a different processor. The open boundary code is ``mppcompatible'' up to a certain point. The radiation algorithm will not work if there is a mpp subdomain boundary parallel to the open boundary at the index of the boundary, or the grid point after (outside), or three grid points before (inside). On the other hand, there is no problem if a mpp subdomain boundary cuts the open boundary perpendicularly. Those geometry constraints must be checked by the user (there is no safeguard in the code).
The general principle for the open boundary mpp code is that loops over the open boundaries are performed on local indices (nie0, nie1, nje0, nje1 for the eastern boundary for instance) that are initialized in module \mdl{obc\_ini}. Those indices have relevant values on the processors that contain a segment of an open boundary. For processors that do not include an open boundary segment, the indices are such that the calculations within the loops are not performed.
+When \key{mpp\_mpi} is active in the code, the computational domain is divided
+into rectangles that are attributed each to a different processor. The open boundary
+code is ``mppcompatible'' up to a certain point. The radiation algorithm will not
+work if there is an mpp subdomain boundary parallel to the open boundary at the
+index of the boundary, or the grid point after (outside), or three grid points before
+(inside). On the other hand, there is no problem if an mpp subdomain boundary
+cuts the open boundary perpendicularly. These geometrical limitations must be
+checked for by the user (there is no safeguard in the code).
+The general principle for the open boundary mpp code is that loops over the open
+boundaries {not sure what this means} are performed on local indices (nie0,
+nie1, nje0, nje1 for an eastern boundary for instance) that are initialized in module
+\mdl{obc\_ini}. Those indices have relevant values on the processors that contain
+a segment of an open boundary. For processors that do not include an open
+boundary segment, the indices are such that the calculations within the loops are
+not performed.
+\gmcomment{I dont understand most of the last few sentences}
Arrays of climatological data that are read in files are seen by all processors and have the same dimensions for all (for instance, for the eastern boundary, uedta(jpjglo,jpk,2)). On the other hand, the arrays for the calculation of radiation are local to each processor (uebnd(jpj,jpk,3,3) for instance). This allowed to spare memory in the CLIPPER model, where the eastern boundary crossed 8 processors so that \jp{jpj} was must smaller than (\jp{jpjef}\jp{jpjed}+1).
+Arrays of climatological data that are read from files are seen by all processors
+and have the same dimensions for all (for instance, for the eastern boundary,
+uedta(jpjglo,jpk,2)). On the other hand, the arrays for the calculation of radiation
+are local to each processor (uebnd(jpj,jpk,3,3) for instance). This allowed the
+CLIPPER model for example, to save on memory where the eastern boundary
+crossed 8 processors so that \jp{jpj} was much smaller than (\jp{jpjef}\jp{jpjed}+1).
\subsection{Volume conservation}
\label{OBC_vol}
It is necessary to control the volume inside a domain with open boundaries. With fixed boundaries, it is enough to ensure that the total inflow/outflow has reasonable values (either zero or a value compatible with an observed volume balance). When using radiative boundary conditions it is necessary to have a volume constraint because each open boundary works independently from the others. The methodology used to control this volume is identical to the one coded in the ROMS model \citep{Marchesiello2001}.
+It is necessary to control the volume inside a domain when using open boundaries.
+With fixed boundaries, it is enough to ensure that the total inflow/outflow has
+reasonable values (either zero or a value compatible with an observed volume
+balance). When using radiative boundary conditions it is necessary to have a
+volume constraint because each open boundary works independently from the
+others. The methodology used to control this volume is identical to the one
+coded in the ROMS model \citep{Marchesiello2001}.
Index: trunk/DOC/TexFiles/Chapters/Chap_LDF.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_LDF.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_LDF.tex (revision 994)
@@ 22,5 +22,5 @@
% Lateral Mixing Coefficients
% ================================================================
\section{Lateral Mixing Coefficient (key\_ldftra\_c.d and key\_ldfdyn\_c.d)}
+\section{Lateral Mixing Coefficient (\textbf{key\_ldftra\_c.d}  \textbf{key\_ldfdyn\_c.d)} }
\label{LDF_coef}
@@ 61,7 +61,9 @@
\quad \text{comments}
\end{equation}
where $e_{max}$ is the max of $e_1$ and $e_2$ taken over the whole masked ocean domain, and $A_o^l$ is \np{ahm0} (momentum) or \np{aht0} (tracer) namelist parameters. This variation is intended to reflect the lesser need for subgrid scale eddy mixing where the grid size is smaller in the domain. It was introduced in the context of the DYNAMO modelling project \citep{Willebrand2001}. %gm not only that! stability reasons: with non uniform grid size, it is common to face a blow up of the model due to to large diffusive coefficient compare to the smallest grid size... this is especially true for bilaplacian (to be added in the text!)

Other formulations can be introduced by the user for a given configuration. For example, in the ORCA2 global ocean model (\key{orca\_r2}), the laplacian viscous operator uses \np{ahm0}~=~$4.10^4 m^2.s^{1}$ poleward of 20$^{\circ}$ north and south and decreases to \np{aht0}~=~$2.10^3 m^2.s^{1}$ at the equator \citep{Madec1996, Delecluse2000}. This specification can be found in \rou{ldf\_dyn\_c2d\_orca} routine defined in \mdl{ldfdyn\_c2d}. Similar specific horizontal variation can be found for Antarctic or Arctic subdomain of ORCA2 and ORCA05 (\key{antarctic} or \key{arctic} defined, see \hf{ldfdyn\_antarctic} and \hf{ldfdyn\_arctic}).
+where $e_{max}$ is the max of $e_1$ and $e_2$ taken over the whole masked ocean domain, and $A_o^l$ is \np{ahm0} (momentum) or \np{aht0} (tracer) namelist parameters. This variation is intended to reflect the lesser need for subgrid scale eddy mixing where the grid size is smaller in the domain. It was introduced in the context of the DYNAMO modelling project \citep{Willebrand2001}.
+%%%
+\gmcomment { not only that! stability reasons: with non uniform grid size, it is common to face a blow up of the model due to to large diffusive coefficient compare to the smallest grid size... this is especially true for bilaplacian (to be added in the text!) }
+
+Other formulations can be introduced by the user for a given configuration. For example, in the ORCA2 global ocean model (\key{orca\_r2}), the laplacian viscous operator uses \np{ahm0}~=~$4.10^4 m^2.s^{1}$ poleward of 20$^{\circ}$ north and south and decreases to \np{aht0}~=~$2.10^3 m^2.s^{1}$ at the equator \citep{Madec1996, Delecluse_Madec_Bk00}. This specification can be found in \rou{ldf\_dyn\_c2d\_orca} routine defined in \mdl{ldfdyn\_c2d}. Similar specific horizontal variation can be found for Antarctic or Arctic subdomain of ORCA2 and ORCA05 (\key{antarctic} or \key{arctic} defined, see \hf{ldfdyn\_antarctic} and \hf{ldfdyn\_arctic}).
\subsubsection{Space Varying Mixing Coefficients (\key{ldftra\_c3d} and \key{ldfdyn\_c3d})}
@@ 97,8 +99,10 @@
% Direction of lateral Mixing
% ================================================================
\section{Direction of Lateral Mixing (\mdl{ldfslp})}
+\section [Direction of Lateral Mixing (\textit{ldfslp})]
+ {Direction of Lateral Mixing (\mdl{ldfslp})}
\label{LDF_slp}
%gm% we should emphasize here that the implementation is a rather old one. Better work can be achieved by using \citet{Griffies1998, Griffies2004} isoneutral scheme.
+%%%
+\gmcomment{ we should emphasize here that the implementation is a rather old one. Better work can be achieved by using \citet{Griffies1998, Griffies2004} isoneutral scheme. }
@@ 270,7 +274,7 @@
% Eddy Induced Mixing
% ================================================================
\section{Eddy Induced Velocity (\mdl{traadv\_eiv}, \mdl{ldfeiv})}
+\section [Eddy Induced Velocity (\textit{traadv\_eiv}, \textit{ldfeiv})]
+ {Eddy Induced Velocity (\mdl{traadv\_eiv}, \mdl{ldfeiv})}
\label{LDF_eiv}

When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined), an eddy induced tracer advection term is added, the formulation of which depends on the slopes of isoneutral surfaces. Contrary to isoneutral mixing, the slopes use here are referenced to the geopotential surfaces, i.e. \eqref{Eq_ldfslp_geo} is used in $z$coordinates, and the sum \eqref{Eq_ldfslp_geo} + \eqref{Eq_ldfslp_iso} in $s$coordinates. The eddy induced velocity is given by:
Index: trunk/DOC/TexFiles/Chapters/Chap_MISC.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_MISC.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_MISC.tex (revision 994)
@@ 13,9 +13,9 @@
% In climate modeling, it is often necessary to allow water masses that are separated by land to exchange properties. This situation arises in models when the grid mesh is too coarse to resolve narrow passageways that in reality provide crucial connections between water masses. For example, coarse grid spacing typically closes off the Mediterranean from the Atlantic at the Straits of Gibraltar. In this case, it is important for climate models to include the effects of salty water entering the Atlantic from the Mediterranean. Likewise, it is important for the Mediterranean to replenish its supply of water from the Atlantic to balance the net evaporation occurring over the Mediterranean region.
% also same problem as soon as important straits are not properly resolve by the mesh. For example in ORCA 1/4\r{}, this occors in several straits of the Indonesian archipelagos (Ombai, Lombok...).
% We describe here the three methods that can be used in NEMO to handle such unproperly resolved straits.
%The communication consists of mixing tracers and mass/volume between nonadjacent water columns. Momentum is not mixed. The scheme conserves total tracer content, and total volume (the latter in $z*$ or $s*$coordinate), and maintains compatibility between the tracer and mass/volume budgets.

% Note: such changes are so specific to a given configuration that no attempt have been made to set them in a generic way. Nevertheless, example of how they can be set up is given in the ORCA2 configuration (\key{ORCA_R2}).
+% Same problem occurs as soon as important straits are not properly resolved by the mesh. For example it arises in ORCA 1/4\r{} in several straits of the Indonesian archipelago (Ombai, Lombok...).
+% We describe here the three methods that can be used in \NEMO to handle such improperly resolved straits.
+%The problem is resolved here by allowing the mixing of tracers and mass/volume between nonadjacent water columns at nominated regions within the model. Momentum is not mixed. The scheme conserves total tracer content, and total volume (the latter in $z*$ or $s*$coordinate), and maintains compatibility between the tracer and mass/volume budgets.
+
+% Note: such changes are so specific to a given configuration that no attempt has been made to set them in a generic way. Nevertheless, an example of how they can be set up is given in the ORCA2 configuration (\key{ORCA_R2}).
% 
@@ 27,5 +27,6 @@
$\bullet$ reduced scale factor, also called partially open face (Hallberg, personnal communication 2006)
%also called partially open cell or partial closed cells
$\bullet$ increase of the viscous boundary layer by local increase of the fmask value at the coast
+
+$\bullet$ increase of the viscous boundary layer thickness by local increase of the fmask value at the coast
\colorbox{yellow}{Add a short description of scale factor changes staff and fmask increase}
@@ 36,5 +37,11 @@
\includegraphics[width=0.80\textwidth]{./Figures/Fig_Gibraltar.pdf}
\includegraphics[width=0.80\textwidth]{./Figures/Fig_Gibraltar2.pdf}
\caption {Example of the Gibraltar strait defined in a 1\r{} x 1\r{} mesh. \textit{Top}: using partially open cells. The meridional scale factor at $V$point is reduced on both sides of the strait to account for the real width of the strait (about 20 km). Note that the scale factors of the strait $T$point remains unchanged. \textit{Bottom}: using viscous boundary layers. The four fmask along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" noslip case (see Fig.\ref{Fig_LBC_shlat}) creating a large viscous boundary layer that allows a reduced transport through the strait.}
+\caption {Example of the Gibraltar strait defined in a 1\r{} x 1\r{} mesh.
+\textit{Top}: using partially open cells. The meridional scale factor at $v$point
+is reduced on both sides of the strait to account for the real width of the strait
+(about 20 km). Note that the scale factors of the strait $T$point remains unchanged. \textit{Bottom}: using viscous boundary layers. The four fmask parameters
+along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" noslip
+case (see Fig.\ref{Fig_LBC_shlat}) creating a large viscous boundary layer
+that allows a reduced transport through the strait.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 65,35 +72,41 @@
\label{MISC_zoom}
The subdomain functionality, also improperly called zoom option (improperly because it is not associated with a change in model resolution) is a quite simple function that allows to
perform a simulation over a subdomain of an already defined configuration
(i.e. without defining a new set of mesh, initial state and forcings). This
option can be useful for testing the user setting of surface boundary
conditions, or the initial ocean state of a huge ocean model configuration
while having a small central memory requirement. It can also be used to
easily test specific physics in a subdomain (for example, test of the
coupling between seaice and ocean model over the Arctic or Antarctic ocean
as they are set in the global ocean version of OPA \citep{Madec1996}.
In standard, this option does not include any specific treatment for ocean
boundaries of the subdomain: they are considered as artificial vertical
walls. Nevertheless, it is quite easy to add a restoring term toward a
climatology in the vicinity of those boundaries (see \S\ref{TRA_dmp}).
+The subdomain functionality, also improperly called the zoom option
+(improperly because it is not associated with a change in model resolution)
+is a quite simple function that allows a simulation over a subdomain of an
+already defined configuration ($i.e.$ without defining a new mesh, initial
+state and forcings). This option can be useful for testing the user settings
+of surface boundary conditions, or the initial ocean state of a huge ocean
+model configuration while having a small computer memory requirement.
+It can also be used to easily test specific physics in a subdomain (for example,
+see \citep{Madec1996} for a test of the coupling used in the global ocean
+version of OPA between seaice and ocean model over the Arctic or Antarctic
+ocean, using a subdomain). In the standard model, this option does not
+include any specific treatment for the ocean boundaries of the subdomain:
+they are considered as artificial vertical walls. Nevertheless, it is quite easy
+to add a restoring term toward a climatology in the vicinity of such boundaries
+(see \S\ref{TRA_dmp}).
In order to easily define a subdomain over which the computation can be
performed, the dimension of all input arrays (ocean mesh, bathymetry,
forcing, initial state, ...) are defined as \jp{jpidta}, \jp{jpjdta} and \jp{jpkdta} (\mdl{par\_oce} module), while the
computational domain is defined through \jp{jpiglo}, \jp{jpjglo} and \jp{jpk} (\mdl{par\_oce} module). When running the model
over the whole configuration, the user set \jp{jpiglo}=\jp{jpidta} \jp{jpjglo}=\jp{jpjdta }and \jp{jpk}=\jp{jpkdta}. When running the model
over a subdomain, the user have to provide the size of the subdomain,
(\jp{jpiglo}, \jp{jpjglo}, \jp{jpkglo}), and the indices of the south western corner as \jp{jpizoom} and \jp{jpjzoom} in the \mdl{par\_oce} module (Fig.~\ref{Fig_LBC_zoom}).

Note that a third set of dimension exist, \jp{jpi}, \jp{jpj} and \jp{jpk} which is actually used to
perform the computation. It is set by default to \jp{jpi}=\jp{jpjglo} and \jp{jpj}=\jp{jpjglo}, except for massively
parallel computing where the computational domain is laid out on local
processor memories following a 2D horizontal splitting (see {\S}IV.2c)
+forcing, initial state, ...) are defined as \jp{jpidta}, \jp{jpjdta} and \jp{jpkdta}
+(\mdl{par\_oce} module), while the computational domain is defined through
+\jp{jpiglo}, \jp{jpjglo} and \jp{jpk} (\mdl{par\_oce} module). When running the
+model over the whole domain, the user sets \jp{jpiglo}=\jp{jpidta} \jp{jpjglo}=\jp{jpjdta}
+and \jp{jpk}=\jp{jpkdta}. When running the model over a subdomain, the user
+has to provide the size of the subdomain, (\jp{jpiglo}, \jp{jpjglo}, \jp{jpkglo}),
+and the indices of the south western corner as \jp{jpizoom} and \jp{jpjzoom} in
+the \mdl{par\_oce} module (Fig.~\ref{Fig_LBC_zoom}).
+
+Note that a third set of dimensions exist, \jp{jpi}, \jp{jpj} and \jp{jpk} which is
+actually used to perform the computation. It is set by default to \jp{jpi}=\jp{jpjglo}
+and \jp{jpj}=\jp{jpjglo}, except for massively parallel computing where the
+computational domain is laid out on local processor memories following a 2D
+horizontal splitting. % (see {\S}IV.2c) ref to the section to be updated
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!ht] \label{Fig_LBC_zoom} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_LBC_zoom.pdf}
\caption {position of a model domain compared to the data input domain when the zoom functionality is used.}
+\caption {Position of a model domain compared to the data input domain when the zoom functionality is used.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 106,9 +119,19 @@
\label{MISC_1D}
The 1D model is a stand alone water column based on the 3D NEMO system. It can be applied to the ocean alone or to the oceanice system and can include passive tracers or a biogeochemical model. It is set up by defining the \key{cfg\_1d} CPP key. This 1D model is a very useful tool \textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes ; \textit{(b)} to investigate suitable parameterizations of unresolved turbulence (wind steering, langmuir circulation, skin layers) ; \textit{(c)} to compare the behaviour of different mixing vertical scheme ; \textit{(d)} to perform sensitivity study to the vertical diffusion on a particular point of the ocean global domain ; \textit{(d)} to access to specific diagnostics, aside from the standard model variables, because of having small in core memory requirement.

The methodology is based on the use of the zoom functionality (see \S\ref{MISC_zoom}), and the addition of some specific routines. There is no need of defining a new set of mesh, bathymetry, initial state and forcing, as the 1D model will use those of the configuration it is a zoom of.


+The 1D model option simulates a stand alone water column within the 3D \NEMO
+system. It can be applied to the ocean alone or to the oceanice system and can
+include passive tracers or a biogeochemical model. It is set up by defining the
+\key{cfg\_1d} CPP key. This 1D model is a very useful tool \textit{(a)} to learn
+about the physics and numerical treatment of vertical mixing processes ; \textit{(b)}
+to investigate suitable parameterizations of unresolved turbulence (wind steering,
+langmuir circulation, skin layers) ; \textit{(c)} to compare the behaviour of different
+vertical mixing schemes ; \textit{(d)} to perform sensitivity studies on the vertical
+diffusion at a particular point of the ocean global domain ; \textit{(d)} to produce
+extra diagnostics, without the large memory requirement of the full 3D model.
+
+The methodology is based on the use of the zoom functionality (see
+\S\ref{MISC_zoom}), with some extra routines. There is no need to define a new
+mesh, bathymetry, initial state or forcing, since the 1D model will use those of the
+configuration it is a zoom of.
% ================================================================
@@ 121,16 +144,21 @@
%
+% Steven update just bellow... not sure it is what I vant to say
+%Searching an equilibrium state with an ocean model requires repeated very long time
+%integrations (each of a few thousand years for a global model). Due to the size of
Searching an equilibrium state with an ocean model requires very long time
integration (a few thousand years for a global model). Due to the size of
the time step required for numerical stability consideration (less than a
few hours), this is usually requires a large elapse time. In order overcome
this problem, \citet{Bryan1984} introduces a technique that allows to accelerate
the spin up to the equilibrium. It consists in using a larger time step in
+the time step required for numerical stability (less than a
+few hours), this usually requires a large elapsed time. In order to overcome
+this problem, \citet{Bryan1984} introduces a technique that is intended to accelerate
+the spin up to equilibrium. It uses a larger time step in
the thermodynamic evolution equations than in the dynamic evolution
equations. It does not affect the equilibrium solution but modifies the
trajectory to reach it.
The acceleration of convergence is used when \np{nn\_acc}=1. In that case, $\Delta t=rdt$ is
the time step of dynamics while $\widetilde{\Delta t}=rdttra$ is the tracer timestep. Both are settled from \np{rdt} and \np{rdttra} namelist parameters. The set of prognostic equations to solve becomes:
+The acceleration of convergence option is used when \np{nn\_acc}=1. In that case,
+$\Delta t=rdt$ is the time step of dynamics while $\widetilde{\Delta t}=rdttra$ is the
+tracer timestep. Their values are set from the \np{rdt} and \np{rdttra} namelist
+parameters. The set of prognostic equations to solve becomes:
\begin{equation} \label{Eq_acc}
\begin{split}
@@ 142,17 +170,18 @@
\end{equation}
\citet{Bryan1984} has analysed the consequences of this distorted physics. Free
waves have a slower phase speed, their meridional structure is slightly
+\citet{Bryan1984} has examined the consequences of this distorted physics.
+Free waves have a slower phase speed, their meridional structure is slightly
modified, and the growth rate of baroclinically unstable waves is reduced
but there is a wider range of instability. This technique is efficient for
searching an equilibrium state in coarse resolution models. However its
+but with a wider range of instability. This technique is efficient for
+searching for an equilibrium state in coarse resolution models. However its
application is not suitable for many oceanic problems: it cannot be used for
transient or time evolving problems (in particular, it is very questionable
to keep this technique when using a seasonal cycle in the forcing fields),
+to use this technique when there is a seasonal cycle in the forcing fields),
and it cannot be used in highresolution models where baroclinically
unstable processes are important. Moreover, the vertical variation of
$\Delta \tilde {t}$ implies that the heat and salt contents are no more
+$\widetilde{ \Delta t}$ implies that the heat and salt contents are no longer
conserved due to the vertical coupling of the ocean level through both
advection and diffusion.
+% first mention of depth varying tildadeltat! and namelist parameter associated to that are to be described
@@ 160,5 +189,5 @@
% Model optimisation, Control Print and Benchmark
% ================================================================
\section{Model optimisation, Control Print and Benchmark}
+\section{Model Optimisation, Control Print and Benchmark}
\label{MISC_opt}
%namdom
@@ 166,28 +195,64 @@
%
Three points to be described here:
+% \gmcomment{why not make these bullets into subsections?}
+
+Three issues to be described here:
$\bullet$ Vector and memory optimisation:
 \key{vectopt\_loop} enable the internal loop collapse, a very efficient way to increase the length of vector and thus speed up the model on vector computers.
+\key{vectopt\_loop} enables internal loop collapse, a very efficient way to increase
+the length of vector calculations and thus speed up the model on vector computers.
 Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade.
+% Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade.
 Add also one word on NEC specific optimisation (Novercheck option for example)

 \key{vectopt\_memory} has been introduced in order to reduce the memory requirement of the model. This is obviously done by incresing the CPU time requirement, as it suppress intermediate computation saved in incore memory. This possibility have not been intensively used. In fact up to now, it only concern the TKE physics, in which, when \key{vectopt\_memory} is defined, the coefficient used for horizontal smoothing of $A_v^T$ and $A_v^m$ are no more computed once for all. This reduces the memory requirement by three 2D arrays.
+% Add also one word on NEC specific optimisation (Novercheck option for example)
+
+\key{vectopt\_memory} has been introduced in order to reduce the memory
+requirement of the model. This is obviously done at the cost of increasing the
+CPU time requirement, since it suppress intermediate computations which would
+have been saved in incore memory. This feature has not been intensively used.
+In fact, currently it is only implemented for the TKE physics, in which, when
+\key{vectopt\_memory} is defined, the coefficients used for horizontal smoothing
+of $A_v^T$ and $A_v^m$ are no longer computed once and for all. This reduces
+the memory requirement by three 2D arrays.
+
$\bullet$ Control print: describe here 4 things:

1 \np{ln\_ctl} : compute and print the inner domain averaged trends in all TRA, DYN LDF and ZDF modules. Very useful to detect the origin of an undesired change in model results.

2 also \np{ln\_ctl} but using the nictl. njctl. namelist parameters to check the origin of differences between mono and multi processor

3 \key{esopa} (to be rename key\_nemo) : also a option of model management. When defined, this key force the activation of all options and CPP keys. For example, all the tracer and momentum advection scheme are called ! There is therefore no physical meaning associated with model results. In fact, this option allows both the compilator and the model run to go through all the Fortran lines of the model. This allows to check is there is obvious compilation or running bugs for CPP options, and running bugs for namelist options.

5 last digit comparison (\np{nbit\_cmp}). In MPP simulation, the computation of sum of the whole domain is performed as the sum over all processors of the sum of the inner domain of each processor. This double sum nevr give exactly the same result as a single sum over the whole domain, due to truncature differences. The "bit comparison" option has been introduced in order to be able to check that monoprocessor and multiprocessor give exactly the same results.


$\bullet$ Benchmark (\np{nbench}). This option, defines a benchmark run based on GYRE configuration in which the resolution remains the same whatever the domain size is. This allows to run very large model domain by just changing the domain size (\jp{jpiglo}, \jp{jpjglo}) without adjusting neither the timestep nor the physical parametrisations.
+$\bullet$ Control print %: describe here 4 things:
+
+1 \np{ln\_ctl} : compute and print the trends averaged over the interior domain
+in all TRA, DYN, LDF and ZDF modules. This option is very helpful when
+diagnosing the origin of an undesired change in model results.
+
+2 also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check
+the source of differences between mono and multi processor runs.
+
+3 \key{esopa} (to be rename key\_nemo) : which is another option for model
+management. When defined, this key forces the activation of all options and
+CPP keys. For example, all tracer and momentum advection schemes are called!
+There is therefore no physical meaning associated with the model results.
+However, this option forces both the compiler and the model to run through
+all the \textsc{Fortran} lines of the model. This allows the user to check for obvious
+compilation or execution errors with all CPP options, and errors in namelist options.
+
+3 \key{esopa} (to be rename key\_nemo) : which is another option for model
+management. When defined, this key forces the activation of all options and CPP keys.
+For example, all tracer and momentum advection schemes are called! There is
+therefore no physical meaning associated with the model results. However, this option
+forces both the compiler and the model to run through all the Fortran lines of the model.
+This allows the user to check for obvious compilation or execution errors with all CPP
+options, and errors in namelist options.
+
+4 last digit comparison (\np{nbit\_cmp}). In an MPP simulation, the computation of
+a sum over the whole domain is performed as the summation over all processors of
+each of their sums over their interior domains. This double sum never gives exactly
+the same result as a single sum over the whole domain, due to truncation differences.
+The "bit comparison" option has been introduced in order to be able to check that
+monoprocessor and multiprocessor runs give exactly the same results.
+
+$\bullet$ Benchmark (\np{nbench}). This option defines a benchmark run based on
+a GYRE configuration in which the resolution remains the same whatever the domain
+size. This allows a very large model domain to be used, just by changing the domain
+size (\jp{jpiglo}, \jp{jpjglo}) and without adjusting either the timestep or the physical
+parameterizations.
@@ 195,5 +260,5 @@
% Elliptic solvers (SOL)
% ================================================================
\section{Elliptic solvers (SOL)}
+\section{Elliptic solvers (SOL directory)}
\label{MISC_sol}
%namdom
@@ 202,22 +267,25 @@
The computation of the surface pressure gradient with a rigid lid assumption
requires to compute $\partial_t \psi$, the time evolution of the
barotropic streamfunction. $\partial_t \psi$ is solution of an elliptic
equation (I.2.4) for which two solvers are available, a
SuccessiveOverRelaxation (SOR) or a preconditioned conjugate gradient
(PCG) \citep{Madec1988, Madec1990}. The PCG is a very efficient
method for solving elliptic equations on vector computers. It is a fast and
rather easy to use method, which is an attractive feature for a large number
of ocean situations (variable bottom topography, complex coastal geometry,
variable grid spacing, islands, open or cyclic boundaries, etc ...). It does
not require the search of an optimal parameter as in the SOR method.
Nevertheless, the SOR has been kept because it is a linear solver, a very
useful property when using the adjoint model of OPA.

The surface pressure gradient is computed in \mdl{dynspg}. The
default option is the use of PCG or SOR
depending on \np{nsolv} (namelist parameter).
+requires the computation of $\partial_t \psi$, the time evolution of the
+barotropic streamfunction. $\partial_t \psi$ is the solution of an elliptic
+equation \eqref{Eq_PE_psi} for which three solvers are available: a
+SuccessiveOverRelaxation scheme (SOR), a preconditioned conjugate gradient
+scheme(PCG) \citep{Madec1988, Madec1990} and a Finite Elements Tearing and
+Interconnecting scheme (FETI) \citep{Guyon_al_EP99, Guyon_al_CalPar99}.
+The PCG is a very efficient method for solving elliptic equations on vector computers.
+It is a fast and rather easy method to use; which are attractive features for a large
+number of ocean situations (variable bottom topography, complex coastal geometry,
+variable grid spacing, islands, open or cyclic boundaries, etc ...). It does not require
+a search for an optimal parameter as in the SOR method. However, the SOR has
+been retained because it is a linear solver, which is a very useful property when
+using the adjoint model of \NEMO. The FETI solver is a very efficient method on
+massively parallel computers. However, it has never been used since OPA 8.0.
+The current version in \NEMO should not even successfully go through the
+compilation phase.
+
+The surface pressure gradient is computed in \mdl{dynspg}. The solver used
+(PCG or SOR) depending on the value of \np{nsolv} (namelist parameter).
At each time step the time derivative of the barotropic streamfunction is
the solution of (II.2.3). Introducing the following coefficients:
+the solution of \eqref{Eq_psi_total}. Introducing the following coefficients:
\begin{equation}
@@ 229,5 +297,5 @@
\end{equation}
the fivepoint finite difference equivalent equation (II.2.3) can be rewritten as:
+the fivepoint finite difference equation \eqref{Eq_psi_total} can be rewritten as:
\begin{multline} \label{Eq_solmat}
@@ 257,5 +325,5 @@
\textbf{A}). (VII.5.1) can be rewritten as:
\begin{multline}
+\begin{multline} \label{Eq_solmat_p}
A_{i,j}^{N} { \left( \frac{\partial \psi}{\partial t } \right) }_{i+1,j }
+\,A_{i,j}^{E} { \left( \frac{\partial \psi}{\partial t } \right) }_{i ,j+1} \\
@@ 266,11 +334,11 @@
The SOR method used is an iterative method. Its algorithm can be summarised
as follows [see \citet{Haltiner1980} for further discussion]:

initialisation (evaluate a first guess from former time step computations)
+as follows [see \citet{Haltiner1980} for a further discussion]:
+
+initialisation (evaluate a first guess from previous time step computations)
\begin{equation}
\left( \frac{\partial \psi}{\partial t } \right)_{i,j}^0 = 2{\left( \frac{\partial \psi}{\partial t } \right)_{i,j}^t}  {\left( \frac{\partial \psi}{\partial t } \right)_{i,j}^{t1}}
\end{equation}
iteration $n,$ from $n=0 $until convergence, do :
+iteration $n$, from $n=0$ until convergence, do :
\begin{multline}
R_{i,j}^n
@@ 286,34 +354,31 @@
+ \omega \;R_{i,j}^n
\end{equation}
where \textit{$\omega $ }satisfies $1\leq \omega \leq 2$. An optimal value exists for \textit{$\omega $ }which
accelerates significantly the convergence, but it has to be adjusted
empirically for each model domain, except for an uniform grid where an
analytical expression for \textit{$\omega $ }can be found \citep{Richtmyer1967}. This
parameter is defined as \textit{sor}, a \textbf{namelist} parameter. The convergence test is of the form:
+where \textit{$\omega $ }satisfies $1\leq \omega \leq 2$. An optimal value exists for
+\textit{$\omega$} which significantly accelerates the convergence, but it has to be
+adjusted empirically for each model domain (except for a uniform grid where an
+analytical expression for \textit{$\omega$} can be found \citep{Richtmyer1967}).
+The value of $\omega$ is set using \textit{sor}, a \textbf{namelist} parameter.
+The convergence test is of the form:
\begin{equation}
\delta = \frac{\sum\limits_{i,j}{R_{i,j}^n}{R_{i,j}^n}}{\sum\limits_{i,j}{ \tilde B_{i,j}^n}{\tilde B_{i,j}^n}} \leq \epsilon
\end{equation}
where $\epsilon $ is the absolute precision that is required. It is highly recommended
to use a $\epsilon $ smaller or equal to $10^{2}$ as larger values may leads
to numerically induced basin scale barotropic oscillations, and to use a two
or three order of magnitude smaller value in eddy resolving configuration.
The precision of the solver is not only a numerical parameter, but
influences the physics. Indeed, the zero change of kinetic energy due to the
work of surface pressure forces in rigidlid approximation is only achieved
at the precision demanded on the solver ({\S}~C.1e). The precision is
specified by setting \textit{eps} (\textbf{namelist parameter}). In addition, two other tests are used to stop the iterative
algorithm. They concern the number of iterations and the module of the right
hand side. If the former exceeds a specified value, \textit{nmax} (\textbf{namelist parameter}), or the latter is greater than
$10^{15}$, the whole model computation is stopped while the last
computed time step fields are saved in the standard output file. In both
cases, this usually indicates that there is something wrong in the model
configuration (error in the mesh, the initial state, the input forcing, or
the magnitude of the time step or of the mixing coefficients). A typical
value of $nmax$ is a few hundred for $\epsilon = 10^{2}$, increasing to a few
thousand for $\epsilon = 10^{12}$.

The vectorization of the SOR algorithm is not straightforward. (VII.5.4)
contains two linear recurrences on $i$ and $j$. This inhibits the vectorisation
({\S}~IV.2a). Therefore (VII.5.4a) has been rewritten as:
+where $\epsilon$ is the absolute precision that is required. It is recommended
+that a value smaller or equal to $10^{3}$ is used for $\epsilon$ since larger
+values may lead to numerically induced basin scale barotropic oscillations. In fact,
+for an eddy resolving configuration or in a filtered free surface case, a value three
+orders of magnitude smaller than this should be used. The precision is specified by
+setting \textit{eps} (\textbf{namelist parameter}). In addition, two other tests are
+used to halt the iterative algorithm. They involve the number of iterations and the
+modulus of the right hand side. If the former exceeds a specified value, \textit{nmax}
+(\textbf{namelist parameter}), or the latter is greater than $10^{15}$, the whole
+model computation is stopped and the last computed time step fields are saved
+in the standard output file. In both cases, this usually indicates that there is something
+wrong in the model configuration (an error in the mesh, the initial state, the input forcing,
+or the magnitude of the time step or of the mixing coefficients). A typical value of
+$nmax$ is a few hundred when $\epsilon = 10^{6}$, increasing to a few
+thousand when $\epsilon = 10^{12}$.
+The vectorization of the SOR algorithm is not straightforward. The scheme
+contains two linear recurrences on $i$ and $j$. This inhibits the vectorisation.
+Therefore it has been rewritten as:
\begin{multline}
@@ 334,14 +399,8 @@
\end{equation}
If the three equations in (VII.5.6) are solved inside the same doloop,
(VII.5.4a) and (VII.5.6) are strictly equivalent. In the model they are
solved successively over the whole domain. The convergence is slower but
(VII.5.6a) and (VII.5.6b) are vector loops on $i$index (the inner loop) and
(VII.5.6c) is adapted to Cray vector computers by using a routine from the
Cray library (namely the FOLR routine) to solve the firstorder linear
recurrence. The SOR method is very flexible and can be used under a wide
+The SOR method is very flexible and can be used under a wide
range of conditions, including irregular boundaries, interior boundary
points, etc. Proofs of convergence, etc. may be found in the standard
numerical methods texts for partial equations.
+numerical methods texts for partial differential equations.
% 
@@ 356,5 +415,5 @@
\textbf{A} is a definite positive symmetric matrix, thus solving the linear
system (VII.5.1) is equivalent to the minimisation of a quadratic
+system \eqref{Eq_solmat} is equivalent to the minimisation of a quadratic
functional:
\begin{equation*}
@@ 364,8 +423,9 @@
\end{equation*}
where $\langle , \rangle$ is the canonical dot product. The idea of the
conjugate gradient method is to search the solution in the following
iterative way: assuming that $\textbf{x}^n$ is obtained, $\textbf{x}^{n+1}$ is searched under the form $\textbf {x}^{n+1}={\textbf {x}}^n+\alpha^n{\textbf {d}}^n$ which satisfies:
+conjugate gradient method is to search for the solution in the following
+iterative way: assuming that $\textbf{x}^n$ has been obtained, $\textbf{x}^{n+1}$
+is found from $\textbf {x}^{n+1}={\textbf {x}}^n+\alpha^n{\textbf {d}}^n$ which satisfies:
\begin{equation*}
{\textbf{ x}}^{n+1}=\text{inf} _{{\textbf{ y}}={\textbf{ x}}^n+\alpha \,{\textbf{ d}}^n} \,\phi ({\textbf{ y}})\;\;\Leftrightarrow \;\;\frac{d\phi }{d\alpha}=0
+{\textbf{ x}}^{n+1}=\text{inf} _{{\textbf{ y}}={\textbf{ x}}^n+\alpha^n \,{\textbf{ d}}^n} \,\phi ({\textbf{ y}})\;\;\Leftrightarrow \;\;\frac{d\phi }{d\alpha}=0
\end{equation*}
and expressing $\phi (\textbf{y})$ as a function of \textit{$\alpha $}, we obtain the value that minimises the functional:
@@ 373,13 +433,16 @@
\alpha ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle / \langle {\textbf{ A d}^n, \textbf{d}^n} \rangle
\end{equation*}
where $\textbf{r}^n = \textbf{b}\textbf{A x}^n = \textbf{A} (\textbf{x}\textbf{x}^n)$ is the error at rank $n$. The choice of the descent vector $\textbf{d}^n$ depends on the error: $\textbf{d}^n = \textbf{r}^n + \beta^n \,\textbf{d}^{n1}$. $\beta ^n$ is searched such that the descent vectors form an orthogonal base for the dot product linked to \textbf{A}. Expressing the condition
+where $\textbf{r}^n = \textbf{b}\textbf{A x}^n = \textbf{A} (\textbf{x}\textbf{x}^n)$
+is the error at rank $n$. The descent vector $\textbf{d}^n$ s chosen to be dependent
+on the error: $\textbf{d}^n = \textbf{r}^n + \beta^n \,\textbf{d}^{n1}$. $\beta ^n$
+is searched such that the descent vectors form an orthogonal basis for the dot
+product linked to \textbf{A}. Expressing the condition
$\langle \textbf{A d}^n, \textbf{d}^{n1} \rangle = 0$ the value of $\beta ^n$ is found:
 $\beta ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle / \langle {\textbf{r}^{n1}, \textbf{r}^{n1}} \rangle$. As a result, the errors $ \textbf{r}^n$ form an orthogonal base
for the canonic dot product while the descent vectors $\textbf{d}^n$ form
+ $\beta ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle / \langle {\textbf{r}^{n1}, \textbf{r}^{n1}} \rangle$. As a result, the errors $ \textbf{r}^n$ form an orthogonal
+base for the canonic dot product while the descent vectors $\textbf{d}^n$ form
an orthogonal base for the dot product linked to \textbf{A}. The resulting
algorithm is thus the following one:
initialisation :

\begin{equation*}
@@ 415,27 +478,28 @@
\end{equation}
where $\epsilon $ is the absolute precision that is required. As for the SOR algorithm,
both the PCG algorithm and the whole model computation are stopped when the
number of iteration, $nmax$, or the module of the right hand side exceeds a
specified value (see {\S}~VII.5a for further discussion). The precision and
the maximum number of iteration are specified by setting $eps$ and $nmax$ (\textbf{namelist parameters}).

It can be demonstrated that the algorithm is optimal, provides the exact
+the whole model computation is stopped when the number of iterations, $nmax$, or
+the modulus of the right hand side of the convergence equation exceeds a
+specified value (see \S\ref{MISC_solsor} for a further discussion). The required
+precision and the maximum number of iterations allowed are specified by setting
+$eps$ and $nmax$ (\textbf{namelist parameters}).
+
+It can be demonstrated that the above algorithm is optimal, provides the exact
solution in a number of iterations equal to the size of the matrix, and that
the convergence rate is all the more fast as the matrix is closed to
identity (i.e. the eigen values are closed to 1). Therefore, it is more
efficient to solve a better conditioned system which has the same solution.
For that purpose, we introduce a preconditioning matrix \textbf{Q
}which is an approximation of \textbf{A} but much easier to invert
than \textbf{A} and solve the system:
\begin{equation}
+the convergence rate is faster as the matrix is closer to the identity matrix,
+$i.e.$ its eigenvalues are closer to 1. Therefore, it is more efficient to solve a
+better conditioned system which has the same solution. For that purpose, we
+introduce a preconditioning matrix \textbf{Q} which is an approximation of
+\textbf{A} but much easier to invert than \textbf{A}, and solve the system:
+\begin{equation} \label{Eq_pmat}
\textbf{Q}^{1} \textbf{A x} = \textbf{Q}^{1} \textbf{b}
\end{equation}
The same algorithm can be used to solve (VII.5.7) if instead of the
canonical dot product the following one is used: ${\langle{ \textbf{a} , \textbf{b}} \rangle}_Q = \langle{ \textbf{a} , \textbf{Q b}} \rangle$, and if $\textbf{\~{b}} = \textbf{Q}^{1}\;\textbf{b}$ and $\textbf{\~{A}} = \textbf{Q}^{1}\;\textbf{A}$ are substituted to \textbf{b} and \textbf{A} \citep{Madec1988}. In OPA, \textbf{Q} is chosen as the diagonal
of\textbf{ A}, i.e. the simplest form for \textbf{Q} so that it can be
easily inverted. In this case, the discrete formulation of (VII.5.8) is in
fact given by (VII.5.2) and thus the matrix and right hand side are computed
independently from the solver used.
+The same algorithm can be used to solve \eqref{Eq_pmat} if instead of the
+canonical dot product the following one is used:
+${\langle{ \textbf{a} , \textbf{b}} \rangle}_Q = \langle{ \textbf{a} , \textbf{Q b}} \rangle$,
+and if $\textbf{\~{b}} = \textbf{Q}^{1}\;\textbf{b}$ and $\textbf{\~{A}} = \textbf{Q}^{1}\;\textbf{A}$ are substituted to \textbf{b} and \textbf{A} \citep{Madec1988}.
+In \NEMO, \textbf{Q} is chosen as the diagonal of \textbf{ A}, i.e. the simplest form for \textbf{Q} so that it can be easily inverted. In this case, the discrete formulation of
+\eqref{Eq_pmat} is in fact given by \eqref{Eq_solmat_p} and thus the matrix and
+right hand side are computed independently from the solver used.
% 
@@ 445,44 +509,53 @@
\label{MISC_solfeti}
FETI is a powerfull solver that was developed by Marc Guyon (ref !!!). It as been just converted from Fortan 77 to 90, but never successfully tested after that. Since then, nobody has found enough time to further investigate the implmenntationof FETI and debug it.

Its main advantaged is to save a lot of CPU time compared to SOR or PCG algorithm. Nevertheless, its main drawbacks is that the solution is depends on the domain decomposition chosen. Using a different number of processors, the solution is the same at the precision required, but not the same at the computer precision. This make it hard to debug.
+FETI is a powerful solver that was developed by Marc Guyon \citep{Guyon_al_EP99,
+Guyon_al_CalPar99}. It has been converted from Fortan 77 to 90, but never
+successfully tested after that.
+
+Its main advantage is to save a lot of CPU time when compared to the SOR or PCG
+algorithms. However, its main drawback is that the solution is dependent on the
+domain decomposition chosen. Using a different number of processors, the solution
+is the same at the precision required, but not the same at the computer precision.
+This make it hard to debug.
% 
% Boundary Conditions  Islands
% 
\subsection{Boundary Conditions  Islands (key{\_}islands defined)}
+\subsection{Boundary Conditions  Islands (\key{islands})}
\label{MISC_solisl}
The boundary condition used for both solvers is that the time derivative of
the barotropic streamfunction is zero along all the coastlines. When islands
are present in the model domain, additional computations must be done to
determine the barotropic streamfunction with the correct boundary
+The boundary condition used for both recommended solvers is that the time
+derivative of the barotropic streamfunction is zero along all the coastlines.
+When islands are present in the model domain, additional computations must
+be performed to determine the barotropic streamfunction with the correct boundary
conditions. This is detailed below.
The model does not recognise itself the islands which must be defined using
bathymetry information, i.e. $mbathy$ array, equals $1$ over the first island, $2$ over
the second, ... , $N$ over the $N^{th}$ island (see {\S}~VII.2b). The model
determines the position of island gridpoints and defines a closed contour
around each island which will be used to compute the circulation around each
island. The closed contour is formed of the ocean gridpoints which are the
closest to the island.

First, the island barotropic streamfunctions $\psi_n$ are computed
using the PCG (they are solutions of (VII.5.1) with the righthand side
equals to zero and with $\psi_n = 1$ along the island $n$ and $\psi_n = 0$ along the other coastlines) (Note that specifying $1$ as boundary
condition on an island for $\psi$ is equivalent to define a
specific right hand side for (VII.5.1)~). The precision of this computation
can be very high since it is done once. The absolute precision, $epsisl$, and the
maximum number of iteration, $nmisl$, are the \textbf{namelist parameters} used for that
computation. Their typical values are $epsisl = 10^{10}$ and $nmisl = 4000$. Then the island matrix A is computed from (I.2.8) and reversed. At
each time step, $\psi_0$, the solution of (I.2.4) with $\psi_0 = 0$ along all coastlines, is computed using either SOR or PCG. It has to
be noted that the first guess of this computation is defined as in (VII.5.3)
except that $\partial_t \psi_0$ is used, not $\partial_t \psi$. Indeed we are
computing $\partial_t \psi_0$ which is usually far different from $\partial_t \psi$. Then, it is easy to find the time evolution of the barotropic
streamfunction on each island and to deduce $\partial_t \psi$ using (I.2.9)
in order to compute the surface pressure gradient. Note that the value of
the barotropic streamfunction itself is also computed as the time
integration of $\partial_t \psi$ for further diagnostics.
+The model does not have specialised code for islands. They must instead be
+identified to the solvers by the user via bathymetry information, i.e. the $mbathy$
+array should equal $1$ over the first island, $2$ over the second, ... , $N$ over
+the $N^{th}$ island. The model determines the position of island gridpoints and
+defines a closed contour around each island which is used to compute the circulation
+around each one. The closed contour is formed from the ocean gridpoints which
+are the closest to the island.
+
+First, the island barotropic streamfunctions $\psi_n$ are computed using the SOR
+or PCG scheme (they are solutions of \eqref{Eq_solmat} with the righthand side
+equal to zero and with $\psi_n = 1$ along the island $n$ and $\psi_n = 0$ along
+the other coastlines) (Note that specifying $1$ as boundary condition on an island
+for $\psi$ is equivalent to defining a specific right hand side for \eqref{Eq_solmat}).
+The requested precision of this computation can be very high since it is only
+performed once. The absolute precision, $epsisl$, and the maximum number of
+iterations allowed, $nmisl$, are the \textbf{namelist parameters} used for this
+computation. Their typical values are $epsisl = 10^{10}$ and $nmisl = 4000$.
+Then the island matrix A is computed from \eqref{Eq_PE_psi_isl_matrix} and
+inverted. At each time step, $\psi_0$, the solution of \eqref{Eq_solmat} with $\psi = 0$
+along all coastlines, is computed using either SOR or PCG. (It should
+be noted that the first guess of this computation remains as usual except that
+$\partial_t \psi_0$ is used, instead of $\partial_t \psi$. Indeed we are
+computing $\partial_t \psi_0$ which is usually very different from $\partial_t \psi$.)
+Then, it is easy to find the time evolution of the barotropic streamfunction on each
+island and to deduce $\partial_t \psi$, and to use it to compute the surface pressure
+gradient. Note that the value of the barotropic streamfunction itself is also computed
+as the time integration of $\partial_t \psi$ for further diagnostics.
% ================================================================
@@ 503,30 +576,32 @@
and the output file(s). The restart file is used internally by the code when
the user wants to start the model with initial conditions defined by a
previous simulation. It contains all the information that is necessary not
to introduce changes in the model results (even at the computer precision)
between a run performed with several restarts and the same run performed in
one time. It has to be noticed that this requires that the restart file
contains two consecutive time steps for all the prognostic variables, and
that it is save in the same binary format as the one used by the computer to
calculate (in particular, 32 bits binary IEEE format for this file must not
be used). The output listing and file(s) are defined but should be checked
+previous simulation. It contains all the information that is necessary in
+order for there to be no changes in the model results (even at the computer
+precision) between a run performed with several restarts and the same run
+performed in one step. It should be noted that this requires that the restart file
+contain two consecutive time steps for all the prognostic variables, and
+that it is saved in the same binary format as the one used by the computer
+that is to read it (in particular, 32 bits binary IEEE format must not be used for
+this file). The output listing and file(s) are predefined but should be checked
and eventually adapted to the user's needs. The output listing is stored in
the $ocean.output$ file. The information are printed all the way through the code on the
logical unit $numout$. To locate these prints, use the UNIX command "$grep i numout^*$" in the source code directory.
+the $ocean.output$ file. The information is printed from within the code on the
+logical unit $numout$. To locate these prints, use the UNIX command
+"$grep i numout^*$" in the source code directory.
In the standard configuration, the user will find the model results in two
output files for every timestep where output is demanded: a \textbf{VO}
file containing all the three dimensional fields in logical unit $numwvo$, and a
\textbf{SO} file containing all the two dimensional (horizontal) fields in
logical unit $numwso$. These outputs are defined in the $diawri.F$ routine. The standard and available online diagnostics are described in {\S}III12c.

The default output is 32 bits binary IEEE format, compatible with the
Vairmer software (see the Climate Modelling and global Change team WEB
server at CERFACS: http://www.cerfacs.fr). The model's reference directory
also contains a visualisation tool based on \textbf{NCAR Graphics
}(http://ngwww.ucar.edu). If a user has access to the NCAR software, he or
she can copy the \textbf{LODMODEL/UTILS/OPADRA} directory from the reference
and, following the \textbf{README}, create the graphic outputs from the
model's results.
+output files containing values for every timestep where output is demanded:
+a \textbf{VO} file containing all the three dimensional fields in logical unit
+$numwvo$, and a \textbf{SO} file containing all the two dimensional (horizontal)
+fields in logical unit $numwso$. These outputs are defined in the $diawri.F$
+routine. The default and userselectable diagnostics are described in {\S}III12c.
+
+The default output (for all output files apart from the restart file) is 32 bits binary
+IEEE format, compatible with the Vairmer software (see the Climate Modelling
+and global Change team WEB server at CERFACS: http://www.cerfacs.fr).
+The model's reference directory also contains a visualisation tool based on
+\textbf{NCAR Graphics} (http://ngwww.ucar.edu). If a user has access to the
+NCAR software, he or she can copy the \textbf{LODMODEL/UTILS/OPADRA}
+directory from the reference and, following the \textbf{README}, create
+graphical outputs from the model's results.
}
@@ 534,21 +609,20 @@
% Tracer/Dynamics Trends
% 
\subsection{Tracer/Dynamics Trends (\key{trdlmd}, \key{diatrdtra})}
+\subsection{Tracer/Dynamics Trends (\key{trdlmd}, \key{diatrdtra}, \key{diatrddyn})}
\label{MISC_tratrd}
%to be udated this corresponds to OPA8
When \key{diatrddyn} and/or \key{diatrddyn} cpp
variables are defined, each trends of the dynamics and/or temperature and
salinity time evolution equations are stored in threedimensional arrays
just after their computation (i.e. at the end of each $dyn\cdots .F$
and/or $tra\cdots .F$ routines). These trends are then used in diagnostic
routines $diadyn.F$ and $diatra.F$ respectively. In standard, these routines check the basin averaged properties of the momentum and tracer equations every \textit{ntrd } timesteps (\textbf{namelist parameter}). These routines
are given as an example; they must be adapted by the user to his/her
desiderata.

These two options imply the definition of several arrays in the in core
memory, increasing quite sensitively the code memory requirements (search
for \key{diatrddyn} or
\key{diatrdtra}in \textit{common.h} file)
+When \key{diatrddyn} and/or \key{diatrddyn} cpp variables are defined, each
+trend of the dynamics and/or temperature and salinity time evolution equations
+is stored in threedimensional arrays just after their computation ($i.e.$ at the end
+of each $dyn\cdots .F90$ and/or $tra\cdots .F90$ routine). These trends are then
+used in diagnostic routines $diadyn.F90$ and $diatra.F90$ respectively.
+In the standard model, these routines check the basin averaged properties of
+the momentum and tracer equations every \textit{ntrd } timesteps (\textbf{namelist
+parameter}). These routines are supplied as an example; they must be adapted by
+the user to his/her requirements.
+
+These two options imply the creation of several extra arrays in the incore
+memory, increasing quite seriously the code memory requirements.
% 
@@ 561,5 +635,8 @@
%
\colorbox{yellow}{a description is to be added here}
+The online computation of floats adevected either by the three dimensional velocity
+field or constraint to remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. The algorithm used is based on
+the work of \cite{Blanke_Raynaud_JPO97}. (see also the web site describing the offline
+use of this marvellous diagnostic tool (http://stockage.univbrest.fr/~grima/Ariane/).
% 
@@ 569,10 +646,9 @@
\label{MISC_diag_others}
%To be updated this corresponds to OPA 8

Aside from the standard model variables, some other diagnostics are computed
online or can be added in the model. The available readytoadd diagnostics
can be found in DIA. Among the available diagnostics one can
quote:
+%To be updated this mainly corresponds to OPA 8
+
+Aside from the standard model variables, other diagnostics can be computed
+online or can be added to the model. The available readytoadd diagnostics
+routines can be found in directory DIA. Among the available diagnostics are:
 the mixed layer depth (based on a density criterion) (\mdl{diamxl})
Index: trunk/DOC/TexFiles/Chapters/Chap_Model_Basics.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_Model_Basics.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_Model_Basics.tex (revision 994)
@@ 22,5 +22,5 @@
The ocean is a fluid that can be described to a good approximation by the primitive equations, i.e. the NavierStokes equations along with a nonlinear equation of state which couples the two active tracers (temperature and salinity) to the fluid velocity, plus the following additional assumptions made from scale considerations:
+The ocean is a fluid that can be described to a good approximation by the primitive equations, $i.e.$ the NavierStokes equations along with a nonlinear equation of state which couples the two active tracers (temperature and salinity) to the fluid velocity, plus the following additional assumptions made from scale considerations:
\textit{(1) spherical earth approximation: }the geopotential surfaces are assumed to be spheres so that gravity (local vertical) is parallel to the earth's radius
@@ 32,10 +32,10 @@
\textit{(4) Boussinesq hypothesis:} density variations are neglected except in their contribution to the buoyancy force
\textit{(5) Hydrostatic hypothesis: }the vertical momentum equation is reduced to a balance between the vertical pressure gradient and buoyancy force (this removes convective processes from
the initial NavierStokes equations: they must be parameterized)
+\textit{(5) Hydrostatic hypothesis: }the vertical momentum equation is reduced to a balance between the vertical pressure gradient and the buoyancy force (this removes convective processes from
+the initial NavierStokes equations and so convective processes must be parameterized instead)
\textit{(6) Incompressibility hypothesis: }the three dimensional divergence of the velocity vector is assumed to be zero.
Because the gravitational force is so dominant in the equations of largescale motions, it is quite useful to choose an orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to \textbf{k}, i.e. tangent to the geopotential surfaces. Let us define the following variables: \textbf{U} the vector velocity, $\textbf{U}=\textbf{U}_h + w\, \textbf{k}$ (the subscript $h$ denotes the local horizontal vector, i.e. over the (\textbf{i},\textbf{j}) plan), $T$ the potential temperature, $S$ the salinity, \textit{$\rho $} the \textit{in situ} density. The vector invariant form of the primitive equations in the (\textbf{i},\textbf{j},\textbf{k}) vector system provides the following six equations (namely the momentum balance, the hydrostatic equilibrium, the incompressibility, the heat and salt conservation and an equation of state):
+Because the gravitational force is so dominant in the equations of largescale motions, it is useful to choose an orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to \textbf{k}, $i.e.$ tangent to the geopotential surfaces. Let us define the following variables: \textbf{U} the vector velocity, $\textbf{U}=\textbf{U}_h + w\, \textbf{k}$ (the subscript $h$ denotes the local horizontal vector, $i.e.$ over the (\textbf{i},\textbf{j}) plane), $T$ the potential temperature, $S$ the salinity, \textit{$\rho $} the \textit{in situ} density. The vector invariant form of the primitive equations in the (\textbf{i},\textbf{j},\textbf{k}) vector system provides the following six equations (namely the momentum balance, the hydrostatic equilibrium, the incompressibility equation, the heat and salt conservation equations and an equation of state):
\begin{subequations} \label{Eq_PE}
\begin{equation} \label{Eq_PE_dyn}
@@ 44,5 +44,5 @@
+\frac{1}{2}\nabla \left( {{\rm {\bf U}}^2} \right)} \right]_h
f\;{\rm {\bf k}}\times {\rm {\bf U}}_h
\frac{1}{\rho _o }\nabla _h p + {\rm {\bf D}}^{\rm {\bf U}}
+\frac{1}{\rho _o }\nabla _h p + {\rm {\bf D}}^{\rm {\bf U}} + {\rm {\bf F}}^{\rm {\bf U}}
\end{equation}
\begin{equation} \label{Eq_PE_hydrostatic}
@@ 53,8 +53,8 @@
\end{equation}
\begin{equation} \label{Eq_PE_tra_T}
\frac{\partial T}{\partial t} =  \nabla \cdot \left( T \ \rm{\bf U} \right) + D^T
+\frac{\partial T}{\partial t} =  \nabla \cdot \left( T \ \rm{\bf U} \right) + D^T + F^T
\end{equation}
\begin{equation} \label{Eq_PE_tra_S}
\frac{\partial S}{\partial t} =  \nabla \cdot \left( S \ \rm{\bf U} \right) + D^S
+\frac{\partial S}{\partial t} =  \nabla \cdot \left( S \ \rm{\bf U} \right) + D^S + F^S
\end{equation}
\begin{equation} \label{Eq_PE_eos}
@@ 62,5 +62,6 @@
\end{equation}
\end{subequations}
where $\nabla$ is the generalised derivative vector operator in $(\bf i,\bf j, \bf k)$ directions, $t$ the time, $z$ the vertical coordinate, $\rho $ the \textit{in situ} density given by the equation of state (\ref{Eq_PE_eos}), $\rho_o$ a reference density, $p$ the pressure, $f=2 \bf \Omega \cdot \bf k$ the Coriolis acceleration (where $\bf \Omega$ is the Earth angular velocity vector), and $g$ the gravitational acceleration. ${\rm {\bf D}}^{\rm {\bf U}}$, $D^T$ and $D^S$ are the parameterizations of smallscale physics for momentum, temperature and salinity, including surface forcing terms. Their nature and formulation are discussed in \S\ref{PE_zdf_ldf}, page~\pageref{PE_zdf_ldf}.
+where $\nabla$ is the generalised derivative vector operator in $(\bf i,\bf j, \bf k)$ directions, $t$ is the time, $z$ is the vertical coordinate, $\rho $ is the \textit{in situ} density given by the equation of state (\ref{Eq_PE_eos}), $\rho_o$ is a reference density, $p$ the pressure, $f=2 \bf \Omega \cdot \bf k$ is the Coriolis acceleration (where $\bf \Omega$ is the Earth's angular velocity vector), and $g$ is the gravitational acceleration.
+${\rm {\bf D}}^{\rm {\bf U}}$, $D^T$ and $D^S$ are the parameterizations of smallscale physics for momentum, temperature and salinity, and ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$ and $F^S$ surface forcing terms. Their nature and formulation are discussed in \S\ref{PE_zdf_ldf} and page \S\ref{PE_boundary_condition}.
.
@@ 72,5 +73,5 @@
\label{PE_boundary_condition}
An ocean is bounded by complex coastlines and bottom topography at its base and by an airsea or icesea interface at its top. These boundaries can be defined by two surfaces, $z=H(i,j)$ and $z=\eta(i,j,k,t)$, where $H$ is the depth of the ocean bottom and $\eta$ the height of the sea surface. Both $H$ and $\eta$ are usually referenced to a given surface, $z=0$, chosen as a mean sea surface (Fig.~\ref{Fig_ocean_bc}). Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with the solid earth, the continental surfaces, the sea ice and the atmosphere. However, some of these fluxes are so weak that even on climatic time scales of thousands of years they can be neglected. In the following, we briefly review the fluxes exchanged at the interfaces between the ocean and the other components of the earth system.
+An ocean is bounded by complex coastlines, bottom topography at its base and an airsea or icesea interface at its top. These boundaries can be defined by two surfaces, $z=H(i,j)$ and $z=\eta(i,j,k,t)$, where $H$ is the depth of the ocean bottom and $\eta$ is the height of the sea surface. Both $H$ and $\eta$ are usually referenced to a given surface, $z=0$, chosen as a mean sea surface (Fig.~\ref{Fig_ocean_bc}). Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with the solid earth, the continental margins, the sea ice and the atmosphere. However, some of these fluxes are so weak that even on climatic time scales of thousands of years they can be neglected. In the following, we briefly review the fluxes exchanged at the interfaces between the ocean and the other components of the earth system.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 81,11 +82,12 @@
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
\begin{description}
\item[Land  ocean interface:] the major flux between continental surfaces and the ocean is a mass exchange of fresh water through river runoff. Such an exchange modifies locally the sea surface salinity especially in the vicinity of major river mouths. It can be neglected for short range integrations but has to be taken into account for long term integrations as it influences the characteristics of water masses formed (especially at high latitudes). It is required to close the water cycle of the climatic system. It is usually specified as a fresh water flux at the airsea interface in the vicinity of river mouths.
\item[Solid earth  ocean interface:] heat and salt fluxes across the sea floor are negligibly small, except in special areas of little extent. They are always neglected in the model. The boundary condition is thus set to no flux of heat and salt across solid boundaries. For momentum, the situation is different. There is no flow across solid boundaries, i.e. the velocity normal to the ocean bottom and coastlines is zero (in other words, the bottom velocity is parallel to solid boundaries). This kinematic boundary condition can be expressed as:
+\item[Land  ocean interface:] the major flux between continental margins and the ocean is a mass exchange of fresh water through river runoff. Such an exchange modifies the sea surface salinity especially in the vicinity of major river mouths. It can be neglected for short range integrations but has to be taken into account for long term integrations as it influences the characteristics of water masses formed (especially at high latitudes). It is required in order to close the water cycle of the climate system. It is usually specified as a fresh water flux at the airsea interface in the vicinity of river mouths.
+\item[Solid earth  ocean interface:] heat and salt fluxes through the sea floor are small, except in special areas of little extent. They are usually neglected in the model \footnote{In fact, it has been shown that the heat flux associated with the solid Earth cooling ($i.e.$the geothermal heating) is not negligible for the thermohaline circulation of the world ocean (see \ref{TRA_bbc}).}. The boundary condition is thus set to no flux of heat and salt across solid boundaries. For momentum, the situation is different. There is no flow across solid boundaries, $i.e.$ the velocity normal to the ocean bottom and coastlines is zero (in other words, the bottom velocity is parallel to solid boundaries). This kinematic boundary condition can be expressed as:
\begin{equation} \label{Eq_PE_w_bbc}
w = {\rm {\bf U}}_h \cdot \nabla _h \left( H \right)
\end{equation}
In addition, the ocean exchanges momentum with the earth through friction processes. Such momentum transfer occurs at small scales in a boundary layer. It must be parameterized in terms of turbulent fluxes through bottom and/or lateral boundary conditions. Its specification depends on the nature of the physical parameterization used for ${\rm {\bf D}}^{\rm {\bf U}}$ in \eqref{Eq_PE_dyn}. They are discussed in in \S\ref{PE_zdf}, page~\pageref{PE_zdf}.% and Chap. III.6 to 9.
+In addition, the ocean exchanges momentum with the earth through frictional processes. Such momentum transfer occurs at small scales in a boundary layer. It must be parameterized in terms of turbulent fluxes using bottom and/or lateral boundary conditions. Its specification depends on the nature of the physical parameterization used for ${\rm {\bf D}}^{\rm {\bf U}}$ in \eqref{Eq_PE_dyn}. It is discussed in \S\ref{PE_zdf}, page~\pageref{PE_zdf}.% and Chap. III.6 to 9.
\item[Atmosphere  ocean interface:] the kinematic surface condition plus the mass flux of fresh water PE (the precipitation minus evaporation budget) leads to:
\begin{equation} \label{Eq_PE_w_sbc}
@@ 95,5 +97,5 @@
\end{equation}
The dynamic boundary condition, neglecting the surface tension (which removes capillary waves from the system) leads to the continuity of pressure across the interface $z=\eta$. The atmosphere and ocean also exchange horizontal momentum (wind stress), and heat.
\item[Sea ice  ocean interface:] the two media exchange heat, salt, fresh water and momentum. The sea surface temperature is constrained to be at the freezing point at the interface. Sea ice salinity is very low ($\sim5 \,psu$) compared to those of the ocean ($\sim34 \,psu$). The cycle of freezing/melting is associated with fresh water and salt fluxes that cannot be neglected.
+\item[Sea ice  ocean interface:] the ocean and sea ice exchange heat, salt, fresh water and momentum. The sea surface temperature is constrained to be at the freezing point at the interface. Sea ice salinity is very low ($\sim46 \,psu$) compared to those of the ocean ($\sim34 \,psu$). The cycle of freezing/melting is associated with fresh water and salt fluxes that cannot be neglected.
\end{description}
@@ 111,10 +113,10 @@
\label{PE_p_formulation}
The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at a reference geopotential surface ($z=0$) and an hydrostatic pressure $p_h$ such that: $p(i,j,k,t)=p_s(i,j,t)+p_h(i,j,k,t)$. The latter is computed by integrating (\ref{Eq_PE_hydrostatic}), assuming that pressure in decibars can be approximated by depth in meters in (\ref{Eq_PE_eos}). The hydrostatic pressure is then given by:
+The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at a reference geopotential surface ($z=0$) and a hydrostatic pressure $p_h$ such that: $p(i,j,k,t)=p_s(i,j,t)+p_h(i,j,k,t)$. The latter is computed by integrating (\ref{Eq_PE_hydrostatic}), assuming that pressure in decibars can be approximated by depth in meters in (\ref{Eq_PE_eos}). The hydrostatic pressure is then given by:
\begin{equation} \label{Eq_PE_pressure}
p_h \left( {i,j,z,t} \right)
= \int_{\varsigma =z}^{\varsigma =0} {g\;\rho \left( {T,S,z} \right)\;d\varsigma }
\end{equation}
The surface pressure requires a more specific treatment. Two strategies can be considered: $(a)$ the introduction of a new variable $\eta$, the freesurface elevation, for which a prognostic equation can be established and solved; $(b)$ the assumption that the ocean surface is a rigid lid, on which the pressure (or its horizontal gradient) can be diagnosed. When the former strategy is used, a solution of the freesurface elevation consists in the excitation of external gravity waves. The flow is barotropic and the surface moves up and down with gravity as the restoring force. The phase speed of such waves is high (some hundreds of metres per second) so that the time step would have to be very short if they were present in the model. The latter strategy filters these waves as the rigid lid approximation implies $\eta=0$, i.e. the sea surface is the surface $z=0$. This well known approximation increases the surface wave speed to infinity and modifies certain other longwave dynamics (e.g. barotropic Rossby or planetary waves). In the present release of OPA, both strategies are still available. They are further described in the next two subsections.
+ Two strategies can be considered for the surface pressure term: $(a)$ introduce of a new variable $\eta$, the freesurface elevation, for which a prognostic equation can be established and solved; $(b)$ assume that the ocean surface is a rigid lid, on which the pressure (or its horizontal gradient) can be diagnosed. When the former strategy is used, one solution of the freesurface elevation consists of the excitation of external gravity waves. The flow is barotropic and the surface moves up and down with gravity as the restoring force. The phase speed of such waves is high (some hundreds of metres per second) so that the time step would have to be very short if they were present in the model. The latter strategy filters out these waves since the rigid lid approximation implies $\eta=0$, $i.e.$ the sea surface is the surface $z=0$. This well known approximation increases the surface wave speed to infinity and modifies certain other longwave dynamics ($e.g.$ barotropic Rossby or planetary waves). In the present release of \NEMO, both strategies are still available. They are further described in the next two subsections.
% 
@@ 124,5 +126,5 @@
\label{PE_free_surface}
In the free surface formulation, a variable $\eta$, the seasurface height, is introduced which describes the shape of the airsea interface. This variable is solution of a prognostic equation which is established by forming the vertical average of the kinematics surface condition (\ref{Eq_PE_w_bbc}):
+In the free surface formulation, a variable $\eta$, the seasurface height, is introduced which describes the shape of the airsea interface. This variable is solution of a prognostic equation which is established by forming the vertical average of the kinematic surface condition (\ref{Eq_PE_w_bbc}):
\begin{equation} \label{Eq_PE_ssh}
\frac{\partial \eta }{\partial t}=D+PE
@@ 138,5 +140,5 @@
$\bullet$ If one is interested in EGWs, in particular the tides and their interaction
with the baroclinic structure of the ocean (internal waves) possibly in
shallow seas, then a non linear free surface is the most adequate: this
+shallow seas, then a non linear free surface is the most appropriate. This
means that no approximation is made in (\ref{Eq_PE_ssh}) and that the variation of the
ocean volume is fully taken into account. Note that in order to study the
@@ 147,15 +149,16 @@
$\bullet$ If one is not interested in EGW but rather sees them as high frequency
noise, it is possible to apply a filter to slow down the fastest waves while
not altering the slow barotropic Rossby waves. In that case it is also
generally sufficient to solve a linearized version of (\ref{Eq_PE_ssh}), which allows
+noise, it is possible to apply an explicit filter to slow down the fastest waves while
+not altering the slow barotropic Rossby waves. If further, an approximative conservation
+of heat and salt contents is sufficient for the problem solved, then it is
+sufficient to solve a linearized version of (\ref{Eq_PE_ssh}), which still allows
to take into account freshwater fluxes applied at the ocean surface \citep{Roullet2000}.
$\bullet$ For process studies not involving external waves nor surface freshwater
fluxes, it is possible to use the rigid lid approximation see (next
section). The ocean surface is considered as a fixed surface, so that all
+section). The ocean surface is then considered as a fixed surface, so that all
external waves are removed from the system.
The filtering of EGWs in models with a free surface is usually a matter of discretisation of the temporal derivatives, using the time splitting method \citep{Killworth1991, Zhang1992} or the implicit scheme \citep{Dukowicz1994}. In OPA, we use a slightly different approach developed by \citet{Roullet2000}: the damping of EGWs is ensured by introducing an additional force in the momentum equation. \eqref{Eq_PE_dyn} becomes:
+The filtering of EGWs in models with a free surface is usually a matter of discretisation of the temporal derivatives, using the time splitting method \citep{Killworth1991, Zhang1992} or the implicit scheme \citep{Dukowicz1994}. In \NEMO, we use a slightly different approach developed by \citet{Roullet2000}: the damping of EGWs is ensured by introducing an additional force in the momentum equation. \eqref{Eq_PE_dyn} becomes:
\begin{equation} \label{Eq_PE_flt}
\frac{\partial {\rm {\bf U}}_h }{\partial t}= {\rm {\bf M}}
@@ 163,14 +166,14 @@
 g \ T_c \nabla \left( \widetilde{\rho} \ \partial_t \eta \right)
\end{equation}
where $T_c$, is a parameter homogeneous to a time which characterizes the force, $\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, and represents the collected contributions of the Coriolis, hydrostatic pressure gradient, nonlinear and viscous terms in \eqref{Eq_PE_dyn}.

The new force can be interpreted as a diffusion of vertically integrated volume flux divergence. The time evolution of $D$ is thus governed by a balance of two terms, $g$ \textbf{A} $\eta$ and $g \, T_c \,$ \textbf{A} $D$, associated with a propagative regime and a diffusive regime in the temporal spectrum, respectively. In the diffusive regime, the EGWs no longer propagates, $i.e.$ they are stationary and damped. The diffusion regime applies to the modes shorter than $T_c$. For longer ones, the diffusion term vanishes. Hence, the temporally unresolved EGWs can be damped by choosing $T_c > \Delta t$. \citet{Roullet2000} demonstrate that (\ref{Eq_PE_flt}) can be integrated with a leap frog scheme except the additional term which has to be computed implicitly. This is not surprising since the use of a large time step has a necessarily numerical cost. Two gains arise in comparison with the previous formulations. Firstly, the damping of EGWs can be quantified through the magnitude of the additional term. Secondly, the numerical scheme does not need any tuning. Numerical stability is ensured as soon as $T_c > \Delta t$.

When the variations of free surface elevation are small compared to the thickness of the model layers, the free surface equation (\ref{Eq_PE_ssh}) can be linearized. As emphasized by \citet{Roullet2000} the linearization of (\ref{Eq_PE_ssh}) has consequences on the conservation of salt in the model. With the nonlinear free surface equation, the time evolution of the total salt content is
+where $T_c$, is a parameter with dimensions of time which characterizes the force, $\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, and $\rm {\bf M}$ represents the collected contributions of the Coriolis, hydrostatic pressure gradient, nonlinear and viscous terms in \eqref{Eq_PE_dyn}.
+
+The new force can be interpreted as a diffusion of vertically integrated volume flux divergence. The time evolution of $D$ is thus governed by a balance of two terms, $g$ \textbf{A} $\eta$ and $g \, T_c \,$ \textbf{A} $D$, associated with a propagative regime and a diffusive regime in the temporal spectrum, respectively. In the diffusive regime, the EGWs no longer propagate, $i.e.$ they are stationary and damped. The diffusion regime applies to the modes shorter than $T_c$. For longer ones, the diffusion term vanishes. Hence, the temporally unresolved EGWs can be damped by choosing $T_c > \Delta t$. \citet{Roullet2000} demonstrate that (\ref{Eq_PE_flt}) can be integrated with a leap frog scheme except the additional term which has to be computed implicitly. This is not surprising since the use of a large time step has a necessarily numerical cost. Two gains arise in comparison with the previous formulations. Firstly, the damping of EGWs can be quantified through the magnitude of the additional term. Secondly, the numerical scheme does not need any tuning. Numerical stability is ensured as soon as $T_c > \Delta t$.
+
+When the variations of free surface elevation are small compared to the thickness of the first model layer, the free surface equation (\ref{Eq_PE_ssh}) can be linearized. As emphasized by \citet{Roullet2000} the linearization of (\ref{Eq_PE_ssh}) has consequences on the conservation of salt in the model. With the nonlinear free surface equation, the time evolution of the total salt content is
\begin{equation} \label{Eq_PE_salt_content}
\frac{\partial }{\partial t}\int\limits_{D\eta } {S\;dv} =\int\limits_S
{S\;(\frac{\partial \eta }{\partial t}D+PE)\;ds}
\end{equation}
where $S$ is the salinity, and the total salt is integrated in the whole ocean volume $D_\eta$ bounded by the timedependent free surface. The right hand side (which is an integral over the free surface) vanishes when the nonlinear equation (\ref{Eq_PE_ssh}) is satisfied, so that the salt is perfectly conserved. When the free surface equation is linearized, \citet{Roullet2000} show that the total salt content integrated in the fixed volume $D$ (bounded by the surface $z=0$) is no longer conserved:
+where $S$ is the salinity, and the total salt is integrated over the whole ocean volume $D_\eta$ bounded by the timedependent free surface. The right hand side (which is an integral over the free surface) vanishes when the nonlinear equation (\ref{Eq_PE_ssh}) is satisfied, so that the salt is perfectly conserved. When the free surface equation is linearized, \citet{Roullet2000} show that the total salt content integrated in the fixed volume $D$ (bounded by the surface $z=0$) is no longer conserved:
\begin{equation} \label{Eq_PE_salt_content_linear}
\frac{\partial }{\partial t}\int\limits_D {S\;dv} =\int\limits_S
@@ 186,5 +189,5 @@
Although the total salt content is not exactly conserved with the linearized free surface, its variations are driven by correlations of the time variation of surface salinity with the sea surface height, which is a negligible term. This situation contrasts with
the case of the rigid lid approximation (following section) in which case freshwater forcing is represented by a virtual salt flux, leading to spurious sources or sinks of salt \citep{Roullet2000}.
+the case of the rigid lid approximation (following section) in which case freshwater forcing is represented by a virtual salt flux, leading to a spurious source of salt at the ocean surface \citep{Roullet2000}.
% 
@@ 194,5 +197,5 @@
\label{PE_rigid_lid}
With the rigid lid approximation, we assume that the ocean surface ($z=0$) is a rigid lid on which a pressure $p_s$ is exerted. This implies that the vertical velocity at the surface is equal to zero. From the continuity equation (\ref{Eq_PE_continuity}) and the kinematic condition at the bottom (\ref{Eq_PE_w_bbc}) (no flux across the bottom), it can be shown that the vertically integrated flow $H{\rm {\bf \bar {U}}}_h$ is nondivergent (where the overbar indicates a vertical average over the whole water column, i.e. from $z=H$ , the ocean bottom, to $z=0$ , the rigidlid). Thus, can be derived from a volume transport streamfunction $\psi$:
+With the rigid lid approximation, we assume that the ocean surface ($z=0$) is a rigid lid on which a pressure $p_s$ is exerted. This implies that the vertical velocity at the surface is equal to zero. From the continuity equation \eqref{Eq_PE_continuity} and the kinematic condition at the bottom \eqref{Eq_PE_w_bbc} (no flux across the bottom), it can be shown that the vertically integrated flow $H{\rm {\bf \bar {U}}}_h$ is nondivergent (where the overbar indicates a vertical average over the whole water column, i.e. from $z=H$, the ocean bottom, to $z=0$ , the rigidlid). Thus, $\rm {\bf \bar {U}}_h$ can be derived from a volume transport streamfunction $\psi$:
\begin{equation} \label{Eq_PE_u_psi}
\overline{\vect{U}}_h =\frac{1}{H}\left( \vect{k} \times \nabla \psi \right)
@@ 215,8 +218,7 @@
\end{equation}
Using the proper boundary conditions, (\ref{Eq_PE_psi}) can be solved to find $\partial_t \psi$ and thus using (\ref{Eq_PE_u_barotrope}) the horizontal surface pressure gradient. It should be noted that $p_s$ can be computed by taking the divergence of (\ref{Eq_PE_u_barotrope}) and solving the resulting elliptic equation. Thus the surface pressure is a diagnostic quantity that can be recovered for analysis purposes.

A difficulty lies in the determination of the boundary condition on $\partial_t \psi$. The boundary condition on velocity is that there is no flow normal to a solid wall, i.e. the coastlines are streamlines. Therefore (I.2.7 is solved with the following Dirichlet boundary condition: $\partial_t \psi$ is constant along each coastline of the same continent or of the same island. When all the coastlines are connected (there are no islands), the constant value of $\partial_t \psi$ along the coast can be arbitrarily chosen to be zero. When islands are present in the domain, the value of the barotropic streamfunction will generally be different for each island and for the continent, and will vary with respect to time. So the boundary condition is: $\psi=0$ along the continent and $\psi=\mu_n$ along island $n$ ($1 \leq n \leq Q$), where $Q$ is the number of islands present in the domain and $\mu_n$ is a time dependent variable. A time evolution equation of the unknown $\mu_n$ can be found by evaluating the circulation of the time derivative of the vertical average (barotropic) velocity field along a closed contour around each island. Since the circulation of a
gradient field along a closed contour is zero, from (\ref{Eq_PE_u_barotrope}) we have:
+Using the proper boundary conditions, \eqref{Eq_PE_psi} can be solved to find $\partial_t \psi$ and thus using \eqref{Eq_PE_u_barotrope} the horizontal surface pressure gradient. It should be noted that $p_s$ can be computed by taking the divergence of \eqref{Eq_PE_u_barotrope} and solving the resulting elliptic equation. Thus the surface pressure is a diagnostic quantity that can be recovered for analysis purposes.
+
+A difficulty lies in the determination of the boundary condition on $\partial_t \psi$. The boundary condition on velocity is that there is no flow normal to a solid wall, $i.e.$ the coastlines are streamlines. Therefore \eqref{Eq_PE_psi} is solved with the following Dirichlet boundary condition: $\partial_t \psi$ is constant along each coastline of the same continent or of the same island. When all the coastlines are connected (there are no islands), the constant value of $\partial_t \psi$ along the coast can be arbitrarily chosen to be zero. When islands are present in the domain, the value of the barotropic streamfunction will generally be different for each island and for the continent, and will vary with respect to time. So the boundary condition is: $\psi=0$ along the continent and $\psi=\mu_n$ along island $n$ ($1 \leq n \leq Q$), where $Q$ is the number of islands present in the domain and $\mu_n$ is a time dependent variable. A time evolution equation of the unknown $\mu_n$ can be found by evaluating the circulation of the time derivative of the vertical average (barotropic) velocity field along a closed contour around each island. Since the circulation of a gradient field along a closed contour is zero, from \eqref{Eq_PE_u_barotrope} we have:
\begin{equation} \label{Eq_PE_isl_circulation}
\oint_n {\frac{1}{H}\left[ {{\rm {\bf k}}\times \nabla \left(
@@ 226,12 +228,17 @@
\end{equation}
Since (\ref{Eq_PE_psi}) is linear, its solution \textit{$\psi $} can be decomposed as follows:
+Since (\ref{Eq_PE_psi}) is linear, its solution \textit{$\psi $} can be decomposed
+as follows:
\begin{equation} \label{Eq_PE_psi_isl}
\psi =\psi _o +\sum\limits_{n=1}^{n=Q} {\mu _n \psi _n }
\end{equation}
where $\psi _o$ is the solution of (\ref{Eq_PE_psi}) with $\psi _o=0$ long all the coastlines, and where $\psi _n$ is the solution of (\ref{Eq_PE_psi}) with the righthand side equal to $0$, and with $\psi _n =1$ long the island $n$, $\psi _n =0$ along the other boundaries. The function $\psi _n$ is thus independent of time. Introducing (\ref{Eq_PE_psi_isl}) into (\ref{Eq_PE_isl_circulation}) yields:
+where $\psi _o$ is the solution of \eqref{Eq_PE_psi} with $\psi _o=0$ long all
+the coastlines, and where $\psi _n$ is the solution of \eqref{Eq_PE_psi} with
+the righthand side equal to $0$, and with $\psi _n =1$ long the island $n$,
+$\psi _n =0$ along the other boundaries. The function $\psi _n$ is thus
+independent of time. Introducing \eqref{Eq_PE_psi_isl} into
+\eqref{Eq_PE_isl_circulation} yields:
\begin{multline} \label{Eq_PE_psi_isl_circulation}
\left[ {\oint_n {\frac{1}{H}\left[ {{\rm {\bf k}}\times \nabla \psi _m }
\right]\cdot {\rm {\bf d}}\ell } } \right]_{1\leq m\leqslant Q \atop 1\leq n\leqslant Q }
+\left[ {\oint_n {\frac{1}{H} \left[ {{\rm {\bf k}}\times \nabla \psi _m } \right]\cdot {\rm {\bf d}}\ell } } \right]_{1\leq m\leqslant Q \atop 1\leq n\leqslant Q }
\left( {\frac{\partial \mu _n }{\partial t}}
\right)_{1\leqslant n\leqslant Q} \\
@@ 246,5 +253,5 @@
\right)_{1\leqslant n\leqslant Q} ={\rm {\bf B}}
\end{equation}
where \textbf{A} is a $Q \times Q$ matrix and \textbf{B} is a time dependent vector. As \textbf{A} is independent of time, it can be calculated and inverted once. The time derivative of the streamfunction when islands are present is thus given by:
+where \textbf{A} is a $Q \times Q$ matrix and \textbf{B} is a time dependent vector. As \textbf{A} is independent of time, it can be calculated and inverted once. The time derivative of the streamfunction when islands are present is thus given by:
\begin{equation} \label{Eq_PE_psi_isl_dt}
\frac{\partial \psi }{\partial t}=\frac{\partial \psi _o }{\partial
@@ 261,5 +268,4 @@

% 
% Tensorial Formalism
@@ 268,8 +274,7 @@
\label{PE_tensorial}
In many ocean circulation problems, the flow field has regions of enhanced dynamics (i.e. surface layers, western boundary currents, equatorial currents, or ocean fronts). The representation of such dynamical processes can be improved by specifically increasing the model resolution in these regions. As well, it may be convenient to use a lateral boundaryfollowing coordinate system to better represent coastal dynamics. Moreover, the common geographical coordinate system has a singular point at the North Pole that cannot be easily treated in a global model without filtering. A solution consists in introducing an appropriate coordinate transformation that shifts the singular point on land \citep{MadecImb1996, Murray1996}. As a conclusion, it is important to solve the primitive equations in various curvilinear coordinate systems. An efficient way of introducing an appropriate coordinate transform can be found when using a tensorial formalism. This formalism is suited to any multidimensional curvilinear coordinate system. Ocean modellers mainly use threedimensional orthogonal grids on the sphere, with conservation of the local vertical. Here we give the simplified equations for this particular case. The general case is detailed by \citet{Eiseman1980} in their survey of the conservation laws of fluid dynamics.

Let (\textbf{i},\textbf{j},\textbf{k}) be a set of orthogonal curvilinear coordinates on the sphere associated with the positively oriented orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to \textbf{k}, i.e. along geopotential surfaces (\ref{Fig_referential}). Let $(\lambda,\varphi,z)$ be the geographical coordinates system in which a position is defined by the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and the distance from the centre of the
earth $a+z(k)$ where $a$ is the earth's radius and $z$ the altitude above a reference sea level (\ref{Fig_referential}). The local deformation of the curvilinear coordinate system is given by $e_1$, $e_2$ and $e_3$, the three scale factors:
+In many ocean circulation problems, the flow field has regions of enhanced dynamics ($i.e.$ surface layers, western boundary currents, equatorial currents, or ocean fronts). The representation of such dynamical processes can be improved by specifically increasing the model resolution in these regions. As well, it may be convenient to use a lateral boundaryfollowing coordinate system to better represent coastal dynamics. Moreover, the common geographical coordinate system has a singular point at the North Pole that cannot be easily treated in a global model without filtering. A solution consists of introducing an appropriate coordinate transformation that shifts the singular point onto land \citep{MadecImb1996, Murray1996}. As a consequence, it is important to solve the primitive equations in various curvilinear coordinate systems. An efficient way of introducing an appropriate coordinate transform can be found when using a tensorial formalism. This formalism is suited to any multidimensional curvilinear coordinate system. Ocean modellers mainly use threedimensional orthogonal grids on the sphere (spherical earth approximation), with preservation of the local vertical. Here we give the simplified equations for this particular case. The general case is detailed by \citet{Eiseman1980} in their survey of the conservation laws of fluid dynamics.
+
+Let (\textbf{i},\textbf{j},\textbf{k}) be a set of orthogonal curvilinear coordinates on the sphere associated with the positively oriented orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to \textbf{k}, $i.e.$ along geopotential surfaces (Fig.\ref{Fig_referential}). Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined by the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and the distance from the centre of the earth $a+z(k)$ where $a$ is the earth's radius and $z$ the altitude above a reference sea level (Fig.\ref{Fig_referential}). The local deformation of the curvilinear coordinate system is given by $e_1$, $e_2$ and $e_3$, the three scale factors:
\begin{equation} \label{Eq_scale_factors}
\begin{aligned}
@@ 325,6 +330,5 @@
\end{equation}
\end{subequations}
where $q$ is a scalar quantity and ${\rm {\bf A}}=(a_1,a_2,a_3)$ a vector in
the $(i,j,k)$ coordinate system.
+where $q$ is a scalar quantity and ${\rm {\bf A}}=(a_1,a_2,a_3)$ a vector in the $(i,j,k)$ coordinate system.
% 
@@ 334,5 +338,5 @@
\label{PE_zco_Eq}
In order to express the primitive equations in tensorial formalism, it is necessary to compute the horizontal component of the nonlinear and viscous terms of the equation using \eqref{Eq_PE_grad}) to \eqref{Eq_PE_lap_vector}. Let us set $\vect U=(u,v,w)={\vect{U}}_h +w\;\vect{k}$, the velocity in the $(i,j,k)$ coordinate system and define the relative vorticity $\zeta$ and the divergence of the horizontal velocity field $\chi$, by:
+In order to express the Primitive Equations in tensorial formalism, it is necessary to compute the horizontal component of the nonlinear and viscous terms of the equation using \eqref{Eq_PE_grad}) to \eqref{Eq_PE_lap_vector}. Let us set $\vect U=(u,v,w)={\vect{U}}_h +w\;\vect{k}$, the velocity in the $(i,j,k)$ coordinate system and define the relative vorticity $\zeta$ and the divergence of the horizontal velocity field $\chi$, by:
\begin{equation} \label{Eq_PE_curl_Uh}
\zeta =\frac{1}{e_1 e_2 }\left[ {\frac{\partial \left( {e_2 \,v}
@@ 346,5 +350,5 @@
\end{equation}
Using the fact that horizontal scale factors $e_1$ and $e_2$ are independent of $k$ and that $e_3$ is a function of the single variable $k$, the nonlinear term of \eqref{Eq_PE_dyn} can be transformed as follows:
+Using the fact that the horizontal scale factors $e_1$ and $e_2$ are independent of $k$ and that $e_3$ is a function of the single variable $k$, the nonlinear term of \eqref{Eq_PE_dyn} can be transformed as follows:
\begin{flalign*}
&\left[ {\left( { \nabla \times {\rm {\bf U}} } \right) \times {\rm {\bf U}}
@@ 352,5 +356,5 @@
\end{flalign*}
\begin{flalign*}
&=\left( {{\begin{array}{*{20}c}
+&\qquad=\left( {{\begin{array}{*{20}c}
{\left[ { \frac{1}{e_3} \frac{\partial u }{\partial k}
\frac{1}{e_1} \frac{\partial w }{\partial i} } \right] w  \zeta \; v } \\
@@ 364,5 +368,5 @@
\end{flalign*}
\begin{flalign*}
&=\left( {{ \begin{array}{*{20}c}
+& \qquad =\left( {{ \begin{array}{*{20}c}
{\zeta \; v} \hfill \\
{ \zeta \; u} \hfill \\
@@ 394,15 +398,15 @@
\end{equation}
This is the socalled \textit{vector invariant form} of the momentum advection. For some purposes, it can be advantageous to write this term in the socalled flux form, i.e. to write it as the divergence of fluxes. For example, the first component of (\ref{Eq_PE_vector_form}) (the $i$component) is transformed as follows:
+This is the socalled \textit{vector invariant form} of the momentum advection term. For some purposes, it can be advantageous to write this term in the socalled flux form, $i.e.$ to write it as the divergence of fluxes. For example, the first component of \eqref{Eq_PE_vector_form} (the $i$component) is transformed as follows:
\begin{flalign*}
&{ \begin{array}{*{20}l}
\left[ {\left( {\nabla \times \vect{U}} \right)\times \vect{U}
 +\frac{1}{2}\nabla \left( {\vect{U}}^2 \right)} \right]_i \\
\\
+ +\frac{1}{2}\nabla \left( {\vect{U}}^2 \right)} \right]_i % \\
+%\\
=  \zeta \;v
+ \frac{1}{2\;e_1 } \frac{\partial \left( {u^2+v^2} \right)}{\partial i}
+ \frac{1}{e_3}w \ \frac{\partial u}{\partial k} \\
\\
=\frac{1}{e_1 \; e_2} \left( v\frac{\partial \left( {e_2 \,v} \right)}{\partial i}
+\qquad =\frac{1}{e_1 \; e_2} \left( v\frac{\partial \left( {e_2 \,v} \right)}{\partial i}
+v\frac{\partial \left( {e_1 \,u} \right)}{\partial j} \right)
+\frac{1}{e_1 e_2 }\left( +e_2 \; u\frac{\partial u}{\partial i}
@@ 413,5 +417,5 @@
\begin{flalign*}
&{ \begin{array}{*{20}l}
=\frac{1}{e_1 \; e_2} \left\{
+\qquad =\frac{1}{e_1 \; e_2} \left\{
\left( v^2 \frac{\partial e_2 }{\partial i}
+e_2 \,v \frac{\partial v }{\partial i} \right)
@@ 424,5 +428,5 @@
\right\}
+\frac{1}{e_3} \left(
 \frac{\partial \left( {w\,v} \right) }{\partial k}
+ \frac{\partial \left( {w\,u} \right) }{\partial k}
u \frac{\partial w }{\partial k} \right) \\
\end{array} } &
@@ 430,8 +434,8 @@
\begin{flalign*}
&{ \begin{array}{*{20}l}
=\frac{1}{e_1 \; e_2} \left(
+\qquad =\frac{1}{e_1 \; e_2} \left(
\frac{\partial \left( {e_2 \,u\,u} \right)}{\partial i}
+ \frac{\partial \left( {e_1 \,u\,v} \right)}{\partial j} \right)
+\frac{1}{e_3 } \frac{\partial \left( {w\,v } \right)}{\partial k}
++\frac{1}{e_3 } \frac{\partial \left( {w\,u } \right)}{\partial k}
\\ \qquad \qquad \quad
+\frac{1}{e_1 e_2 } \left(
@@ 446,6 +450,6 @@
\begin{flalign*}
&{ \begin{array}{*{20}l}
= \nabla \cdot \left( {{\rm {\bf U}}\,u} \right)
 \nabla \cdot {\rm {\bf U}} \ u
+\qquad = \nabla \cdot \left( {{\rm {\bf U}}\,u} \right)
+ \left( \nabla \cdot {\rm {\bf U}} \right) \ u
+\frac{1}{e_1 e_2 }\left(
v^2 \frac{\partial e_2 }{\partial i}
@@ 456,5 +460,5 @@
\begin{flalign*}
&{ \begin{array}{*{20}l}
= \nabla \cdot \left( {{\rm {\bf U}}\,u} \right)
+\qquad = \nabla \cdot \left( {{\rm {\bf U}}\,u} \right)
+ \frac{1}{e_1 e_2 } \left( v \; \frac{\partial e_2}{\partial i}
u \; \frac{\partial e_1}{\partial j} \right) \left( v \right)
@@ 462,5 +466,5 @@
\end{flalign*}
The flux form of the momentum advection is therefore given by:
+The flux form of the momentum advection term is therefore given by:
\begin{multline} \label{Eq_PE_flux_form}
\left[
@@ 468,9 +472,9 @@
+\frac{1}{2} \nabla \left( {{\rm {\bf U}}^2} \right)
\right]_h
= \nabla \cdot \left( {{\begin{array}{*{20}c} {\rm {\bf U}} \, u \hfill \\
+\\
+= \nabla \cdot \left( {{\begin{array}{*{20}c} {\rm {\bf U}} \, u \hfill \\
{\rm {\bf U}} \, v \hfill \\
\end{array} }}
\right)
\\
+\frac{1}{e_1 e_2 } \left(
v\frac{\partial e_2}{\partial i}
@@ 479,5 +483,5 @@
\end{multline}
The flux form has two terms, the first one is expressed as the divergence of momentum fluxes (so the flux form name given to this formulation) and the second one is due to the curvilinear nature of the coordinate system used. The latter is called the \emph{metric} term and can be viewed as a modification of the Coriolis parameter:
+The flux form has two terms, the first one is expressed as the divergence of momentum fluxes (hence the flux form name given to this formulation) and the second one is due to the curvilinear nature of the coordinate system used. The latter is called the \emph{metric} term and can be viewed as a modification of the Coriolis parameter:
\begin{equation} \label{Eq_PE_cor+metric}
f \to f + \frac{1}{e_1 \; e_2} \left( v \frac{\partial e_2}{\partial i}
@@ 485,27 +489,58 @@
\end{equation}
Note that in the case of geographical coordinate, i.e. when $(i,j) \to (\lambda ,\varphi )$ and $(e_1 ,e_2) \to (a \,\cos \varphi ,a)$, we recover the commonly used modification of the Coriolis parameter $f \to f+(u/a) \tan \varphi$.

The equations solved by the ocean model can be written in the following tensorial formalism:

$\bullet$ vector invariant form of the momentum equations :
+Note that in the case of geographical coordinate, $i.e.$ when $(i,j) \to (\lambda ,\varphi )$ and $(e_1 ,e_2) \to (a \,\cos \varphi ,a)$, we recover the commonly used modification of the Coriolis parameter $f \to f+(u/a) \tan \varphi$.
+
+To sum up, the equations solved by the ocean model can be written in the following tensorial formalism:
+
+\vspace{+10pt}
+$\bullet$ \textit{momentum equations} :
+
+vector invariant form :
\begin{subequations} \label{Eq_PE_dyn_vect}
\begin{equation} \label{Eq_PE_dyn_vect_u}
+\begin{multline} \label{Eq_PE_dyn_vect_u}
\frac{\partial u}{\partial t}=
+ \left( {\zeta +f} \right)\,v  \frac{1}{e_3 }w\frac{\partial u}{\partial k}
 \frac{1}{e_1 }\frac{\partial}{\partial i}\left(
 {\frac{1}{2}\left( {u^2+v^2} \right)+\frac{p_h+p_s }{\rho _o }} \right)
+ D_u^{\vect{U}}
\end{equation}
\begin{equation} \label{Eq_PE_dyn_vect_v}
+ + \left( {\zeta +f} \right)\,v
+  \frac{1}{2\,e_1} \frac{\partial}{\partial i} \left( u^2+v^2 \right)
+  \frac{1}{e_3} w \frac{\partial u}{\partial k} \\
+  \frac{1}{e_1} \frac{\partial}{\partial i} \left( \frac{p_s+p_h }{\rho _o} \right)
++ D_u^{\vect{U}} + F_u^{\vect{U}}
+\end{multline}
+\begin{multline} \label{Eq_PE_dyn_vect_v}
\frac{\partial v}{\partial t}=
 \left( {\zeta +f} \right)\,u  \frac{1}{e_3 }w\frac{\partial v}{\partial k}
 \frac{1}{e_2 }\frac{\partial }{\partial j}\left(
 {\frac{1}{2}\left( {u^2+v^2} \right)+\frac{p_h+p_s }{\rho _o }} \right)
+ D_v^{\vect{U}}
\end{equation}
+  \left( {\zeta +f} \right)\,u
+  \frac{1}{2\,e_2 }\frac{\partial }{\partial j}\left( u^2+v^2 \right)  \frac{1}{e_3 }w\frac{\partial v}{\partial k} \\
+  \frac{1}{e_2 }\frac{\partial }{\partial j}\left( \frac{p_s+p_h }{\rho _o} \right)
++ D_v^{\vect{U}} + F_v^{\vect{U}}
+\end{multline}
\end{subequations}
where $\zeta$ is given by (\ref{Eq_PE_curl_Uh}) and the surface pressure gradient is given by:
+flux form:
+\begin{subequations} \label{Eq_PE_dyn_flux}
+\begin{multline} \label{Eq_PE_dyn_flux_u}
+\frac{\partial u}{\partial t}=
++ \left( { f + \frac{1}{e_1 \; e_2}
+ \left( v \frac{\partial e_2}{\partial i}
+ u \frac{\partial e_1}{\partial j} \right)} \right) \, v \\
+ \frac{1}{e_1 \; e_2} \left(
+ \frac{\partial \left( {e_2 \,u\,u} \right)}{\partial i}
+ + \frac{\partial \left( {e_1 \,v\,u} \right)}{\partial j} \right)
+  \frac{1}{e_3 }\frac{\partial \left( { w\,u} \right)}{\partial k} \\
+ \frac{1}{e_1 }\frac{\partial}{\partial i}\left( \frac{p_s+p_h }{\rho _o} \right)
++ D_u^{\vect{U}} + F_u^{\vect{U}}
+\end{multline}
+\begin{multline} \label{Eq_PE_dyn_flux_v}
+\frac{\partial v}{\partial t}=
+ \left( { f + \frac{1}{e_1 \; e_2}
+ \left( v \frac{\partial e_2}{\partial i}
+ u \frac{\partial e_1}{\partial j} \right)} \right) \, u \\
+ \frac{1}{e_1 \; e_2} \left(
+ \frac{\partial \left( {e_2 \,u\,v} \right)}{\partial i}
+ + \frac{\partial \left( {e_1 \,v\,v} \right)}{\partial j} \right)
+  \frac{1}{e_3 } \frac{\partial \left( { w\,v} \right)}{\partial k} \\
+ \frac{1}{e_2 }\frac{\partial }{\partial j}\left( \frac{p_s+p_h }{\rho _o} \right)
++ D_v^{\vect{U}} + F_v^{\vect{U}}
+\end{multline}
+\end{subequations}
+where $\zeta$ is given by \eqref{Eq_PE_curl_Uh} and the surface pressure gradient formulation depends on the one of the free surface:
$*$ free surface formulation
@@ 528,5 +563,5 @@
\end{equation}
where ${\vect{M}}= \left( M_u,M_v \right)$ represents the collected contributions of nonlinear,
viscous and hydrostatic pressure gradient terms in \eqref{Eq_PE_dyn_vect} and the overbar indicates a vertical average over the whole water column ($i.e.$ from $z=H$, the ocean bottom, to $z=0$, the rigidlid), and where the time derivative of $\psi$ is the solution of an elliptic equation:
+viscosity and hydrostatic pressure gradient terms in \eqref{Eq_PE_dyn_vect} and the overbar indicates a vertical average over the whole water column ($i.e.$ from $z=H$, the ocean bottom, to $z=0$, the rigidlid), and where the time derivative of $\psi$ is the solution of an elliptic equation:
\begin{multline} \label{Eq_psi_total}
\frac{\partial }{\partial i}\left[ {\frac{e_2 }{H\,e_1}\frac{\partial}{\partial i}
@@ 547,18 +582,19 @@
\end{equation}
where the divergence of the horizontal velocity, $\chi$ is given by (I.3.8).

$\bullet$ tracer equations:
+where the divergence of the horizontal velocity, $\chi$ is given by \eqref{Eq_PE_div_Uh}.
+
+\vspace{+10pt}
+$\bullet$ \textit{tracer equations} :
\begin{equation} \label{Eq_S}
\frac{\partial T}{\partial t}=\frac{1}{e_1 e_2 }\left[ {\frac{\partial
\left( {e_2 T\,u} \right)}{\partial i}+\frac{\partial \left( {e_1 T\,v}
\right)}{\partial j}} \right]\frac{1}{e_3 }\frac{\partial \left( {T\,w}
\right)}{\partial k}+D^T
+\frac{\partial T}{\partial t} =
+\frac{1}{e_1 e_2 }\left[ { \frac{\partial \left( {e_2 T\,u} \right)}{\partial i}
+ +\frac{\partial \left( {e_1 T\,v} \right)}{\partial j}} \right]
+\frac{1}{e_3 }\frac{\partial \left( {T\,w} \right)}{\partial k} + D^T + F^T
\end{equation}
\begin{equation} \label{Eq_T}
\frac{\partial S}{\partial t}=\frac{1}{e_1 e_2 }\left[ {\frac{\partial
\left( {e_2 S\,u} \right)}{\partial i}+\frac{\partial \left( {e_1 S\,v}
\right)}{\partial j}} \right]\frac{1}{e_3 }\frac{\partial \left( {S\,w}
\right)}{\partial k}+D^S
+\frac{\partial S}{\partial t} =
+\frac{1}{e_1 e_2 }\left[ {\frac{\partial \left( {e_2 S\,u} \right)}{\partial i}
+ +\frac{\partial \left( {e_1 S\,v} \right)}{\partial j}} \right]
+\frac{1}{e_3 }\frac{\partial \left( {S\,w} \right)}{\partial k} + D^S + F^S
\end{equation}
\begin{equation} \label{Eq_rho}
@@ 566,6 +602,48 @@
\end{equation}
The expression of \textbf{D}$^{U}$, $D^{S}$ and$ D^{T}$ depends on the subgrid
scale parameterization used. It will be defined in \S\ref{PE_zdf}.
+The expression of \textbf{D}$^{U}$, $D^{S}$ and $D^{T}$ depends on the subgrid
+scale parameterization used. It will be defined in \S\ref{PE_zdf}. The nature and formulation of ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$ and $F^S$, the surface forcing terms, are discussed in Chapter~\ref{SBC}.
+
+\newpage
+% ================================================================
+% Curvilinear z*coordinate System
+% ================================================================
+\section{Curvilinear \textit{z*}coordinate System}
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!b] \label{Fig_z_zstar} \begin{center}
+\includegraphics[width=1.0\textwidth]{./Figures/Fig_z_zstar.pdf}
+\caption{(a) $z$coordinate in linear freesurface case ; (b) $z$coordinate in nonlinear free surface case (c) rescaled height coordinate (become popular as the \textit{z*}coordinate \citep{Adcroft_Campin_OM04} ).}
+\end{center} \end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+
+In that case, the free surface equation is nonlinear, and the variations of volume are fully taken into account. These coordinates systems is presented in a report
+\citep{Levier2007} available on the \NEMO web site.
+
+\gmcomment{
+The \textit{z*} coordinate approach is an unapproximated, nonlinear free surface implementation which allows one to deal with large amplitude freesurface
+variations relative to the vertical resolution \citep{Adcroft_Campin_OM04}. In
+the \textit{z*} formulation, the variation of the column thickness due to seasurface
+undulations is not concentrated in the surface level, as in the $z$coordinate formulation,
+but is equally distributed over the full water column. Thus vertical
+levels naturally follow seasurface variations, with a linear attenuation with
+depth, as illustrated by figure fig.1c . Note that with a flat bottom, such as in
+fig.1c, the bottomfollowing $z$ coordinate and \textit{z*} are equivalent.
+The definition and modified oceanic equations for the rescaled vertical coordinate
+ \textit{z*}, including the treatment of freshwater flux at the surface, are
+detailed in Adcroft and Campin (2004). The major points are summarized
+here. The position ( \textit{z*}) and vertical discretization (\textit{z*}) are expressed as:
+
+$H + \textit{z*} = (H + z) / r$ and $\delta \textit{z*} = \delta z / r$ with $r = \frac{H+\eta} {H}$
+
+Since the vertical displacement of the free surface is incorporated in the vertical
+coordinate \textit{z*}, the upper and lower boundaries are at fixed \textit{z*} position, $\textit{z*} = 0$ and $\textit{z*} = ?H$ respectively. Also the divergence of the flow field is no longer zero as shown by the continuity equation:
+
+$\frac{\partial r}{\partial t} = \nabla_{\textit{z*}} \cdot \left( r \; \rm{\bf U}_h \right)
+ \left( r \; w\textit{*} \right) = 0 $
+
+}
+
\newpage
@@ 581,8 +659,7 @@
\subsection{Introduction}
Several important aspects of the ocean circulation are influenced by bottom topography. Of course, the most important is that bottom topography determines deep ocean subbasins, barriers, sills and channels that strongly constrain the path of water masses, but more subtle effects exist. For
example, the topographic $\beta$effect is usually larger than the planetary one along continental slopes. Topographic Rossby waves can be excited and can interact with the mean current. In the $z$coordinate system presented in the previous section (\S\ref{PE_zco}), $z$surfaces are geopotential surfaces. The bottom topography is discretised by steps. This often leads to a misrepresentation of a gradually sloping bottom and to large localized depth gradients associated with large localized vertical velocities. The response to such a velocity field often leads to numerical dispersion effects.

A terrainfollowing coordinate system (hereafter $s$coordinates) avoids the discretisation error in the depth field since the layers of computation are gradually adjusted with depth to the ocean bottom. Relatively shallow topographic features in the deep ocean, which would be ignored in typical $z$model applications with the largest grid spacing at greatest depths, can easily be represented (with relatively low vertical resolution) as can gentle, largescale slopes of the sea floor. A terrainfollowing model (hereafter $s$model) also facilitates the modelling of the boundary layer flows over a large depth range, which in the framework of the $z$model would require high vertical resolution over the whole depth range. Moreover, with $s$coordinates it is possible, at least in principle, to have the bottom and the sea surface as the only boundaries of the domain. Nevertheless, $s$coordinates also have its drawbacks. Perfectly adapted to a homogeneous ocean, it has strong limitations as soon as stratification is introduced. The main two problems come from the truncation error in the horizontal pressure gradient and a possibly increased diapycnal diffusion. The horizontal pressure force in $s$coordinates consists of two terms (see \colorbox{yellow}{Appendix A}),
+Several important aspects of the ocean circulation are influenced by bottom topography. Of course, the most important is that bottom topography determines deep ocean subbasins, barriers, sills and channels that strongly constrain the path of water masses, but more subtle effects exist. For example, the topographic $\beta$effect is usually larger than the planetary one along continental slopes. Topographic Rossby waves can be excited and can interact with the mean current. In the $z$coordinate system presented in the previous section (\S\ref{PE_zco}), $z$surfaces are geopotential surfaces. The bottom topography is discretised by steps. This often leads to a misrepresentation of a gradually sloping bottom and to large localized depth gradients associated with large localized vertical velocities. The response to such a velocity field often leads to numerical dispersion effects. One solution to strongly reduce this error is to use a partial step representation of bottom topography instead of a full step one \cite{Pacanowski_Gnanadesikan_MWR98}. Another solution is to introduce a terrainfollowing coordinate system (hereafter $s$coordinate)
+
+The $s$coordinate avoids the discretisation error in the depth field since the layers of computation are gradually adjusted with depth to the ocean bottom. Relatively small topographic features as well as gentle, largescale slopes of the sea floor in the deep ocean, which would be ignored in typical $z$model applications with the largest grid spacing at greatest depths, can easily be represented (with relatively low vertical resolution). A terrainfollowing model (hereafter $s$model) also facilitates the modelling of the boundary layer flows over a large depth range, which in the framework of the $z$model would require high vertical resolution over the whole depth range. Moreover, with a $s$coordinate it is possible, at least in principle, to have the bottom and the sea surface as the only boundaries of the domain (nomore lateral boundary condition to specify). Nevertheless, a $s$coordinate also has its drawbacks. Perfectly adapted to a homogeneous ocean, it has strong limitations as soon as stratification is introduced. The main two problems come from the truncation error in the horizontal pressure gradient and a possibly increased diapycnal diffusion. The horizontal pressure force in $s$coordinate consists of two terms (see Appendix~\ref{Apdx_A}),
\begin{equation} \label{Eq_PE_p_sco}
@@ 591,25 +668,11 @@
\end{equation}
The second term in (\ref{Eq_PE_p_sco}) depends on the tilt of the coordinate surface and
introduces a truncation error that is not present in a $z$model. In the special case of $\sigma$coordinate (i.e. a depthnormalised coordinate system $\sigma = z/H$), \cite{Haney1991} and \citet{Beckmann1993} have given estimates of the magnitude of this truncation error. It depends on topographic slope, stratification, horizontal and vertical resolution, and the finite difference scheme. This error limits the possible topographic slopes that a model can handle at a given horizontal and vertical resolution. This is a severe restriction for largescale applications using realistic bottom topography. The largescale slopes require high horizontal resolution, and the computational cost becomes prohibitive. This problem can be, at least partially, overcome by mixing $s$coordinates and steplike representation of bottom topography \citep{Madec1996}. However, another problem is then raised in the definition of the model domain.

\colorbox{yellow}{Aike Beckmann's solution}

A minimum of diffusion along the coordinate surfaces of any finite difference model is always required for numerical reasons. It causes spurious diapycnal mixing when coordinate surfaces do not coincide with isoneutral surfaces. This is the case for a $z$model as well as for a $s$model.
However, density varies more strongly on $s$surfaces than on horizontal surfaces in regions of large topographic slopes, implying larger diapycnal diffusion in a $s$model than in a $z$model. Whereas such a diapycnal diffusion in a $z$model tends to weaken horizontal density (pressure) gradients and thus the horizontal circulation, it usually reinforces these gradients in a $s$model, creating spurious circulation. For example, imagine an isolated bump of topography in an ocean at rest with a horizontally uniform stratification. Spurious diffusion along $s$surfaces will induce a bump of isoneutral surfaces over the topography, and thus will generate there a baroclinic eddy. In contrast, the ocean will stay at rest in a $z$model. As for the truncation error, the problem can be reduced by introducing the terrainfollowing coordinate below the strongly stratified portion of the
water column (i.e. the main thermocline) \citep{Madec1996}. An alternate solution consists in rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces (see \S\ref{PE_zdf} and \colorbox{yellow}{Appendix B}.

%AMT
\amtcomment{
The $s$coordinates introduced here \citep{Lott1990,Madec1996}
\colorbox{yellow}{ to be update $==>$}
differ mainly in two aspects from
similar models. It combines the properties which make OPA suitable for
climate applications with a good representation of bottom topography
allowing mixed steplike/terrain following topography. It also offers a
completely general transformation, $s=s(i,j,z)$, for the vertical coordinate which goes beyond those of previous hybrid models except the GFDL version developed by \citep{Gerdes1993a,Gerdes1993b}
which has similar properties as the OPA release presented here.
\colorbox{yellow}{ <== end update}
}
+The second term in \eqref{Eq_PE_p_sco} depends on the tilt of the coordinate surface and introduces a truncation error that is not present in a $z$model. In the special case of a $\sigma$coordinate (i.e. a depthnormalised coordinate system $\sigma = z/H$), \citet{Haney1991} and \citet{Beckmann1993} have given estimates of the magnitude of this truncation error. It depends on topographic slope, stratification, horizontal and vertical resolution, the equation of state, and the finite difference scheme. This error limits the possible topographic slopes that a model can handle at a given horizontal and vertical resolution. This is a severe restriction for largescale applications using realistic bottom topography. The largescale slopes require high horizontal resolution, and the computational cost becomes prohibitive. This problem can be at least partially overcome by mixing $s$coordinate and steplike representation of bottom topography \citep{Gerdes1993a,Gerdes1993b,Madec1996}. However, the definition of the model domain vertical coordinate becomes then a nontrivial thing for a realistic bottom topography: a envelope topography is defined in $s$coordinate on which a full or partial step bottom topography is then applied in order to adjust the model depth to the observed one (see \S\ref{DOM_zgr}.
+
+For numerical reasons a minimum of diffusion is required along the coordinate surfaces of any finite difference model. It causes spurious diapycnal mixing when coordinate surfaces do not coincide with isoneutral surfaces. This is the case for a $z$model as well as for a $s$model.
+However, density varies more strongly on $s$surfaces than on horizontal surfaces in regions of large topographic slopes, implying larger diapycnal diffusion in a $s$model than in a $z$model. Whereas such a diapycnal diffusion in a $z$model tends to weaken horizontal density (pressure) gradients and thus the horizontal circulation, it usually reinforces these gradients in a $s$model, creating spurious circulation. For example, imagine an isolated bump of topography in an ocean at rest with a horizontally uniform stratification. Spurious diffusion along $s$surfaces will induce a bump of isoneutral surfaces over the topography, and thus will generate there a baroclinic eddy. In contrast, the ocean will stay at rest in a $z$model. As for the truncation error, the problem can be reduced by introducing the terrainfollowing coordinate below the strongly stratified portion of the water column (i.e. the main thermocline) \citep{Madec1996}. An alternate solution consists of rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces (see \S\ref{PE_ldf}. Unfortunately, the slope of isoneutral surfaces relative to the $s$surfaces can very large, strongly exceeding the stability limit of such a operator when it is discretized (see Chapter~\ref{LDF}).
+
+The $s$coordinates introduced here \citep{Lott1990,Madec1996} differ mainly in two aspects from similar models: it allows a representation of bottom topography with mixed full or partial steplike/terrain following topography ; It also offers a completely general transformation, $s=s(i,j,z)$ for the vertical coordinate.
+
% 
% The scoordinate Formulation
@@ 617,5 +680,5 @@
\subsection{The \textit{s}coordinate Formulation}
Starting from the set of equations established in \S\ref{PE_zco} for the special case $k=z$ and thus $e_3=1$, we introduce an arbitrary vertical coordinate $s=s(i,j,k)$, which includes $z$ and $\sigma$coordinates as special cases ($s=z$ and $s=\sigma=z/H$, resp.). A formal derivation of the transformed equations is given in \colorbox{yellow}{Appendix A}. Let us define the vertical scale factor by $e_3=\partial_s z$ ($e_3$ is now a function of $(i,j,k)$ ), and the slopes in the (\textbf{i},\textbf{j}) directions between $s$ and $z$surfaces by :
+Starting from the set of equations established in \S\ref{PE_zco} for the special case $k=z$ and thus $e_3=1$, we introduce an arbitrary vertical coordinate $s=s(i,j,k,t)$, which includes $z$, \textit{z*} and $\sigma$coordinates as special cases ($s=z$, $s=\textit{z*}$, and $s=\sigma=z/H$ or $=z/\left(H+\eta \right)$, resp.). A formal derivation of the transformed equations is given in Appendix~\ref{Apdx_A}. Let us define the vertical scale factor by $e_3=\partial_s z$ ($e_3$ is now a function of $(i,j,k,t)$ ), and the slopes in the (\textbf{i},\textbf{j}) directions between $s$ and $z$surfaces by :
\begin{equation} \label{Eq_PE_sco_slope}
\sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right_s
@@ 623,29 +686,36 @@
\sigma _2 =\frac{1}{e_2 }\;\left. {\frac{\partial z}{\partial j}} \right_s
\end{equation}

We also introduce a "vertical" velocity $\omega$ defined as the velocity normal to $s$surfaces:
+We also introduce $\omega $, a diasurface velocity component, defined as the velocity relative to the moving $s$surfaces and normal to them:
\begin{equation} \label{Eq_PE_sco_w}
\omega = w  \sigma_1 \; u  \sigma_2 \; v
\end{equation}
The equations solved by the ocean model \eqref{Eq_PE} in $s$coordinates can be written as follows:

+\omega = w  e_3 \, \frac{\partial s}{\partial t}  \sigma _1 \,u  \sigma _2 \,v \\
+\end{equation}
+
+The equations solved by the ocean model \eqref{Eq_PE} in $s$coordinate can be written as follows:
+
+ \vspace{0.5cm}
* momentum equation:
\begin{multline} \label{Eq_PE_sco_u}
\frac{\partial u}{\partial t}=+\left( {\zeta +f} \right)\,v\frac{1}{e_3
}\omega \frac{\partial u}{\partial k}\frac{1}{e_1 }\frac{\partial
}{\partial i}\left( {\frac{1}{2}\left( {u^2+v^2} \right)+\frac{p_h }{\rho _o}} \right) \\
+g\frac{\rho }{\rho _o }\sigma _1 \frac{1}{\rho _o e_1
}\frac{\partial p_s }{\partial i}+D_u^{\rm {\bf U}}
+\frac{1}{e_3} \frac{\partial \left( e_3\,u \right) }{\partial t}=
+ + \left( {\zeta +f} \right)\,v
+  \frac{1}{2\,e_1} \frac{\partial}{\partial i} \left( u^2+v^2 \right)
+  \frac{1}{e_3} \omega \frac{\partial u}{\partial k} \\
+  \frac{1}{e_1} \frac{\partial}{\partial i} \left( \frac{p_s + p_h}{\rho _o} \right)
+ + g\frac{\rho }{\rho _o}\sigma _1
+ + D_u^{\vect{U}} + F_u^{\vect{U}} \quad
\end{multline}
\begin{multline} \label{Eq_PE_sco_v}
\frac{\partial v}{\partial t}=\left( {\zeta +f} \right)\,u\frac{1}{e_3
}\omega \frac{\partial v}{\partial k}\frac{1}{e_2 }\frac{\partial
}{\partial j}\left( {\frac{1}{2}\left( {u^2+v^2} \right)+\frac{p_h }{\rho _o}} \right) \\
+g\frac{\rho }{\rho _o }\sigma _2 \frac{1}{\rho _o e_2
}\frac{\partial p_s }{\partial j}+D_v^{\rm {\bf U}}
\end{multline}
where the relative vorticity, \textit{$\zeta $}, the surface pressure gradient, and the hydrostatic pressure have the same expressions as in $z$coordinates although they do not represent exactly the same quantities. $\omega $ is provided by the same equation as w, i.e. (\ref{Eq_w_diag}), with $\chi$, the divergence of the horizontal velocity field given by:

\begin{equation} \label{Eq_PE_sco_div}
+\frac{1}{e_3} \frac{\partial \left( e_3\,v \right) }{\partial t}=
+  \left( {\zeta +f} \right)\,u
+  \frac{1}{2\,e_2 }\frac{\partial }{\partial j}\left( u^2+v^2 \right)
+  \frac{1}{e_3 } \omega \frac{\partial v}{\partial k} \\
+  \frac{1}{e_2 }\frac{\partial }{\partial j}\left( \frac{p_s+p_h }{\rho _o} \right)
+ + g\frac{\rho }{\rho _o }\sigma _2
+ + D_v^{\vect{U}} + F_v^{\vect{U}} \quad
+\end{multline}
+where the relative vorticity, \textit{$\zeta $}, the surface pressure gradient, and the hydrostatic pressure have the same expressions as in $z$coordinates although they do not represent exactly the same quantities. $\omega$ is provided by the continuity equation (see Appendix~\ref{Apdx_A}):
+
+\begin{equation} \label{Eq_PE_sco_continuity}
+\frac{\partial e_3}{\partial t} + e_3 \; \chi + \frac{\partial \omega }{\partial s} = 0
+\qquad \text{with }\;\;
\chi =\frac{1}{e_1 e_2 e_3 }\left[ {\frac{\partial \left( {e_2 e_3 \,u}
\right)}{\partial i}+\frac{\partial \left( {e_1 e_3 \,v} \right)}{\partial
@@ 653,45 +723,26 @@
\end{equation}
+ \vspace{0.5cm}
* tracer equations:

\begin{equation} \label{Eq_PE_sco_t}
\frac{\partial T}{\partial t}=\frac{1}{e_1 e_2 e_3 }\left[ {\frac{\partial
\left( {e_2 e_3 T\,u} \right)}{\partial i}+\frac{\partial \left( {e_1 e_3
T\,v} \right)}{\partial j}} \right]\frac{1}{e_3 }\frac{\partial \left(
{T\,\omega } \right)}{\partial k}+D^T
\end{equation}

\begin{equation} \label{Eq_PE_sco_s}
\frac{\partial S}{\partial t}=\frac{1}{e_1 e_2 e_3 }\left[ {\frac{\partial
\left( {e_2 e_3 S\,u} \right)}{\partial i}+\frac{\partial \left( {e_1 e_3
S\,v} \right)}{\partial j}} \right]\frac{1}{e_3 }\frac{\partial \left(
{S\,\omega } \right)}{\partial k}+D^S
\end{equation}

The equation of state has the same expression as in $z$coordinates. The expression of \textbf{D}$^{U}$, $D^{S}$ and$ D^{T}$ depends on the subgrid scale parameterization used. It will be defined in \S\ref{PE_zdf_ldf}.

+\begin{multline} \label{Eq_PE_sco_t}
+\frac{1}{e_3} \frac{\partial \left( e_3\,T \right) }{\partial t}=
+\frac{1}{e_1 e_2 e_3 }\left[ {\frac{\partial \left( {e_2 e_3\,u\,T} \right)}{\partial i}
+ +\frac{\partial \left( {e_1 e_3\,v\,T} \right)}{\partial j}} \right] \\
+\frac{1}{e_3 }\frac{\partial \left( {T\,\omega } \right)}{\partial k} + D^T + F^S \qquad
+\end{multline}
+
+\begin{multline} \label{Eq_PE_sco_s}
+\frac{1}{e_3} \frac{\partial \left( e_3\,S \right) }{\partial t}=
+\frac{1}{e_1 e_2 e_3 }\left[ {\frac{\partial \left( {e_2 e_3\,u\,S} \right)}{\partial i}
+ +\frac{\partial \left( {e_1 e_3\,v\,S} \right)}{\partial j}} \right] \\
+\frac{1}{e_3 }\frac{\partial \left( {S\,\omega } \right)}{\partial k} + D^S + F^S \qquad
+\end{multline}
+
+The equation of state has the same expression as in $z$coordinate, and similar expressions are used for mixing and forcing terms.
+
+\gmcomment{
\colorbox{yellow}{ to be updated $= = >$}
The whole set of the continuous equations solved by the model in the $s$coordinate system is summarised in Table~I.2.

Add a few works on z and zps and s and underlies the differences between all of them
\colorbox{yellow}{ $< = =$ end update}

\newpage
% ================================================================
% Curvilinear z* s*coordinate System
% ================================================================
\section{Curvilinear \textit{z*} or \textit{s*} coordinate System}

% 
% ????
% 

\colorbox{yellow}{ to be updated $= = >$}

In that case, the free surface equation is nonlinear, and the variations of
volume are fully taken into account. These coordinates systems is presented in a report
\citep{Levier2007} available on the \NEMO web site.

\colorbox{yellow}{ $< = =$ end update}
+\colorbox{yellow}{ $< = =$ end update} }
\newpage
@@ 705,9 +756,9 @@
space and time scales larger than a few kilometres in the horizontal, a few
meters in the vertical and a few minutes. They are usually solved at larger
scales, the specified grid spacing and time step of the numerical model. The
+scales: the specified grid spacing and time step of the numerical model. The
effects of smaller scale motions (coming from the advective terms in the
NavierStokes equations) must be represented entirely in terms of
largescale patterns to close the equations. These effects appear in the
equations as the divergence of turbulent fluxes (i.e. fluxes associated with
+equations as the divergence of turbulent fluxes ($i.e.$ fluxes associated with
the mean correlation of small scale perturbations). Assuming a turbulent
closure hypothesis is equivalent to choose a formulation for these fluxes.
@@ 718,5 +769,5 @@
The control exerted by gravity on the flow induces a strong anisotropy
between the lateral and vertical motions. Therefore subgridscale physics \textbf{D}$^{\vect{U}}$, $D^{S}$ and $D^{T}$ in \eqref{Eq_PE_dyn}, \eqref{Eq_PE_tra_T} and \eqref{Eq_PE_tra_S} are divided into a lateral part \textbf{D}$^{l \vect{U}}$, $D^{lS}$ and $D^{lT}$ and a vertical part \textbf{D}$^{vU}$, $D^{vS}$ and $D^{vT}$ . The formulation of these terms and their underlying physics are briefly discussed in the next two subsections.
+between the lateral and vertical motions. Therefore subgridscale physics \textbf{D}$^{\vect{U}}$, $D^{S}$ and $D^{T}$ in \eqref{Eq_PE_dyn}, \eqref{Eq_PE_tra_T} and \eqref{Eq_PE_tra_S} are divided into a lateral part \textbf{D}$^{l \vect{U}}$, $D^{lS}$ and $D^{lT}$ and a vertical part \textbf{D}$^{vU}$, $D^{vS}$ and $D^{vT}$. The formulation of these terms and their underlying physics are briefly discussed in the next two subsections.
% 
@@ 727,5 +778,5 @@
The model resolution is always larger than the scale at which the major
sources of vertical turbulence occurs (shear instability, internal wave
+sources of vertical turbulence occur (shear instability, internal wave
breaking...). Turbulent motions are thus never explicitly solved, even
partially, but always parameterized. The vertical turbulent fluxes are
@@ 746,6 +797,5 @@
\end{split}
\end{equation}
where $A^{vm}$ and $A^{vT}$ are the vertical eddy viscosity and diffusivity coefficients, respectively. At the sea surface and at the bottom, turbulent fluxes of momentum, heat and salt must
be specified (see Chap.~\ref{SBC}). All the vertical physics is embedded in the specification of the eddy coefficients. They can be assumed to be either constant, or function of the local fluid properties (as Richardson number, BruntVais\"{a}l\"{a} frequency...), or computed from a turbulent closure model. The choices available in OPA are discussed in \S\ref{ZDF}).
+where $A^{vm}$ and $A^{vT}$ are the vertical eddy viscosity and diffusivity coefficients, respectively. At the sea surface and at the bottom, turbulent fluxes of momentum, heat and salt must be specified (see Chap.~\ref{SBC} and \ref{ZDF} and \S\ref{TRA_bbl}). All the vertical physics is embedded in the specification of the eddy coefficients. They can be assumed to be either constant, or function of the local fluid properties ($e.g.$ Richardson number, BruntVais\"{a}l\"{a} frequency...), or computed from a turbulent closure model. The choices available in \NEMO are discussed in \S\ref{ZDF}).
% 
@@ 756,28 +806,27 @@
Lateral turbulence can be roughly divided into a mesoscale turbulence
associated to eddies which can be solved explicitly if the resolution is
sufficient as their underlying physics are included in the primitive
equations, and a sub mesoscale turbulence which is never explicitly solved
+associated with eddies (which can be solved explicitly if the resolution is
+sufficient since their underlying physics are included in the primitive
+equations), and a sub mesoscale turbulence which is never explicitly solved
even partially, but always parameterized. The formulation of lateral eddy
fluxes depends on whether the mesoscale is below or above the gridspacing
(i.e. the model is eddyresolving or not).

In noneddy resolving configurations, the closure is similar to that used
+($i.e.$ the model is eddyresolving or not).
+
+In noneddyresolving configurations, the closure is similar to that used
for the vertical physics. The lateral turbulent fluxes are assumed to depend
linearly on the lateral gradients of largescale quantities. The resulting
lateral diffusive and dissipative operators are of second order.
Observations show that lateral mixing induced by mesoscale turbulence tends
to be along isoneutral surfaces (or more precisely neutral surfaces, i.e.
isoneutral surfaces referenced at the local depth) rather than across them.
As the slope of isoneutral surfaces is small in the ocean, a common
+to be along isopycnal surfaces (or more precisely neutral surfaces \cite{McDougall1987}) rather than across them.
+As the slope of neutral surfaces is small in the ocean, a common
approximation is to assume that the `lateral' direction is the horizontal,
i.e. the lateral mixing is performed along geopotential surfaces. This leads
+$i.e.$ the lateral mixing is performed along geopotential surfaces. This leads
to a geopotential second order operator for lateral subgrid scale physics.
This assumption can be relaxed: the eddyinduced turbulent fluxes can be
better approached by assuming that they depend linearly on the gradients of
largescale quantities computed along isoneutral surfaces. In such a case,
+largescale quantities computed along neutral surfaces. In such a case,
the diffusive operator is an isoneutral second order operator and it has
components in the three space directions. However, both horizontal and
isoneutral operators have no effect on mean (i.e. large scale) potential
+isoneutral operators have no effect on mean ($i.e.$ large scale) potential
energy whereas potential energy is a main source of turbulence (through
baroclinic instabilities). \citet{Gent1990} have proposed a
@@ 788,5 +837,5 @@
operator and an eddy induced advective part. In all these lateral diffusive
formulations, the specification of the lateral eddy coefficients remains the
problematic point as there is no satisfactory formulation of these
+problematic point as there is no really satisfactory formulation of these
coefficients as a function of largescale features.
@@ 796,14 +845,18 @@
eddies. The role devoted to the subgridscale physics is to dissipate the
energy that cascades toward the grid scale and thus ensures the stability of
the model while not interfering with the solved mesoscale activity.
+the model while not interfering with the solved mesoscale activity. Another approach
+is becoming more and more popular: instead of specifying explicitly a subgrid scale
+term in the momentum and tracer time evolution equations, one uses a advective scheme which is diffusive enough to maintain the model stability. It must be emphasised
+that then, all the subgrid scale physics is in this case include in the formulation of the
+advection scheme.
All these parameterizations of subgrid scale physics present advantages and
disadvantages. There are not all available in OPA. In the $z$coordinate
formulation, four options are offered for active tracers (temperature and
+drawbacks. There are not all available in \NEMO. In the $z$coordinate
+formulation, five options are offered for active tracers (temperature and
salinity): second order geopotential operator, second order isoneutral
operator, \citet{Gent1990} parameterization and fourth order
geopotential operator. The same options are available for momentum, except
\citet{Gent1990} parameterization which only involves tracers. In
$s$coordinate formulation, an additional option is offered for tracers: second
+operator, \citet{Gent1990} parameterization, fourth order
+geopotential operator, and various slightly diffusive advection schemes. The same options are available for momentum, except
+\citet{Gent1990} parameterization which only involves tracers. In the
+$s$coordinate formulation, additional options are offered for tracers: second
order operator acting along $s$surfaces, and for momentum: fourth order
operator acting along $s$surfaces (see \S\ref{LDF}).
@@ 811,5 +864,5 @@
\subsubsection{lateral second order tracer diffusive operator}
The lateral second order tracer diffusive operator is defined by (see \colorbox{yellow}{Appendix B}):
+The lateral second order tracer diffusive operator is defined by (see Appendix~\ref{Apdx_B}):
\begin{equation} \label{Eq_PE_iso_tensor}
D^{lT}=\nabla {\rm {\bf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
@@ 821,19 +874,14 @@
\end{equation}
where $r_1 \;\mbox{and}\;r_2 $ are the slopes between the surface along
which the diffusive operator acts and the surface of computation ($z$ or
$s$surfaces), and $r_1$ and $r_2$ is the differential operator defined
in \S\ref{PE_zco} or \S\ref{PE_sco} depending on the vertical coordinate used. Note that the formulation of $r_1$ and $r_2 $ is exact for the
slopes between geopotential and $s$surfaces, while it is only an approximation
for the slopes between isoneutral and $z$ or $s$surfaces. Indeed, in the latter
case, two assumptions are made to simplify $r_1$ and $r_2$ \citep{Cox1987}: the ratio between lateral and vertical diffusive coefficients is
known to be several orders of magnitude smaller than unity, and the slopes
are, generally less than $10^{2}$ in the ocean (see \colorbox{yellow}{Appendix B}). This leads to
the linear tensor (\ref{Eq_PE_iso_tensor}) where the two isoneutral directions of diffusion
are independent and where the diapycnal diffusivity contribution is solely along the vertical.
+which the diffusive operator acts and the model level ($e. g.$ $z$ or
+$s$surfaces). Note that the formulation \eqref{Eq_PE_iso_tensor} is exact for the
+rotation between geopotential and $s$surfaces, while it is only an approximation
+for the rotation between isoneutral and $z$ or $s$surfaces. Indeed, in the latter
+case, two assumptions are made to simplify \eqref{Eq_PE_iso_tensor} \citep{Cox1987}. First, the horizontal contribution of the dianeutral mixing is neglected since the ratio between iso and dianeutral diffusive coefficients is known to be several orders of magnitude smaller than unity. Second, the two isoneutral directions of diffusion are assumed to be independent since the slopes are generally less than $10^{2}$ in the ocean (see Appendix~\ref{Apdx_B}).
For \textit{geopotential} diffusion, $r_1$ and $r_2 $ are the slopes between the
geopotential and computational surfaces: in $z$coordinates they are zero ($r_1$ and $r_2)$ while in $s$coordinate they are equal to $\sigma _1$ and $\sigma _2$, respectively (see \eqref{Eq_PE_sco_slope} ).

For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral and computational surfaces. Therefore, they have a same expression in $z$and $s$coordinates:
+geopotential and computational surfaces: in $z$coordinates they are zero ($r_1 = r_2 = 0$) while in $s$coordinate (including $\textit{z*}$ case) they are equal to $\sigma _1$ and $\sigma _2$, respectively (see \eqref{Eq_PE_sco_slope} ).
+
+For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral and computational surfaces. Therefore, they have a same expression in $z$ and $s$coordinates:
\begin{equation} \label{Eq_PE_iso_slopes}
r_1 =\frac{e_3 }{e_1 } \left( {\frac{\partial \rho }{\partial i}} \right)
@@ 861,11 +909,11 @@
\begin{align} \label{Eq_PE_slopes_eiv}
\tilde{r}_n = \begin{cases}
 r_n & \text{in $z$coordinate} \\
 r_n + \sigma_n & \text{in $s$coordinate}
+ r_n & \text{in $z$coordinate} \\
+ r_n + \sigma_n & \text{in \textit{z*} and $s$coordinates}
\end{cases}
\quad \text{where } n=1,2
\end{align}
The normal component of the eddy induced velocity is zero at all the boundaries. this can be achieved by tapering either the eddy coefficient or the slopes to zero in the vicinity of the boundaries.
+The normal component of the eddy induced velocity is zero at all the boundaries. this can be achieved in a model by tapering either the eddy coefficient or the slopes to zero in the vicinity of the boundaries. The latter strategy is used in \NEMO (cf. Chap.~\ref{LDF}).
\subsubsection{lateral fourth order tracer diffusive operator}
@@ 877,11 +925,11 @@
\end{equation}
It is the second order operator given by (\ref{Eq_PE_iso_tensor}) applied twice with the eddy
diffusion coefficient correctly placed.
+It is the second order operator given by \eqref{Eq_PE_iso_tensor} applied twice with the eddy diffusion coefficient correctly placed.
+
\subsubsection{lateral second order momentum diffusive operator}
The second order momentum diffusive operator along $z$ or $s$surfaces is found by
applying \eqref{Eq_PE_curl} to the horizontal velocity vector (see Appendix B):
+The second order momentum diffusive operator along $z$ or $s$surfaces is found by
+applying \eqref{Eq_PE_lap_vector} to the horizontal velocity vector (see Appendix~\ref{Apdx_B}):
\begin{equation} \label{Eq_PE_lapU}
\begin{split}
@@ 899,8 +947,7 @@
Such a formulation ensures a complete separation between the vorticity and
horizontal divergence fields ({\S}~II.4c). Unfortunately, it is not
+horizontal divergence fields (see Appendix~\ref{Apdx_C}). Unfortunately, it is not
available for geopotential diffusion in $s$coordinates and for isoneutral
diffusion. In these two cases, the $u$ and $v$fields are considered as independent
scalar fields, so that the diffusive operator is given by:
+diffusion in both $z$ and $s$coordinates ($i.e.$ when a rotation is required). In these two cases, the $u$ and $v$fields are considered as independent scalar fields, so that the diffusive operator is given by:
\begin{equation} \label{Eq_PE_lapU_iso}
\begin{split}
@@ 909,12 +956,11 @@
\end{split}
\end{equation}
where $\Re$ is given by (I.5.2). It is the same expression as those used
for diffusive operator on tracers.
+where $\Re$ is given by \eqref{Eq_PE_iso_tensor}. It is the same expression as those used for diffusive operator on tracers. It must be emphasised that such a formulation is only exact in a Cartesian coordinate system, $i.e.$ on a $f$ or $\beta$plane, not on the sphere. It is also a very good approximation in vicinity of the Equator in a geographical coordinate system \citep{Lengaigne_al_JGR03}.
\subsubsection{lateral fourth order momentum diffusive operator}
As for tracers, the fourth order momentum diffusive operator along $z$ or $s$surfaces is a reentering second order operator \eqref{Eq_PE_lapU} or \eqref{Eq_PE_lapU} with the eddy viscosity coefficient correctly placed:

geopotential diffusion in $z$coordinates:
+As for tracers, the fourth order momentum diffusive operator along $z$ or $s$surfaces is a reentering second order operator \eqref{Eq_PE_lapU} or \eqref{Eq_PE_lapU} with the eddy viscosity coefficient correctly placed:
+
+geopotential diffusion in $z$coordinate:
\begin{equation} \label{Eq_PE_bilapU}
\begin{split}
@@ 928,5 +974,7 @@
\end{equation}
geopotential diffusion in $s$coordinates:
+\gmcomment{ change the position of the coefficient, both here and in the code}
+
+geopotential diffusion in $s$coordinate:
\begin{equation} \label{Eq_bilapU_iso}
\left\{ \begin{aligned}
Index: trunk/DOC/TexFiles/Chapters/Chap_SBC.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_SBC.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_SBC.tex (revision 994)
@@ 6,48 +6,39 @@
\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 icecovered area (using observed icecover
or a seaice model), the addition of river runoffs as surface freshwater
fluxes, and the addition of a freshwater flux adjustment on order to avoid a
mean sealevel drift.

In this chapter we first discuss where the surface boundary condition
+\newpage
+$\ $\newline % force a new ligne
+%namsbc
+\namdisplay{namsbc}
+%
+$\ $\newline % force a new ligne
+
+The ocean needs six fields as surface boundary condition:
+\begin{itemize}
+\item the two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$
+\item the incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$
+\item the surface freshwater budget $\left( {\text{EMP},\;\text{EMP}_S } \right)$
+\end{itemize}
+
+Four different ways to provide those six fields to the ocean are available which
+are controlled by namelist variables: an analytical formulation (\np{ln\_ana}=true),
+a flux formulation (\np{ln\_flx}=true), a bulk formulae formulation (CORE
+(\np{ln\_core}=true) or CLIO (\np{ln\_clio}=true) bulk formulae) and a coupled
+formulation (exchanges with a atmospheric model via the OASIS coupler)
+(\np{ln\_cpl}=true). The frequency at which the six fields have to be updated is
+the \np{nf\_sbc} namelist parameter.
+In addition, the resulting fields can be further modified using
+several namelist options. These options control the addition of a surface restoring
+term to observed SST and/or SSS (\np{ln\_ssr}=true), the modification of fluxes
+below icecovered areas (using observed icecover or a seaice model)
+(\np{nn\_ice}=0,1, 2 or 3), the addition of river runoffs as surface freshwater
+fluxes (\np{ln\_rnf}=true), the addition of a freshwater flux adjustment in
+order to avoid a mean sealevel drift (\np{nn\_fwb}= 0, 1 or 2), and the
+transformation of the solar radiation (if provided as daily mean) into a diurnal
+cycle (\np{ln\_dm2dc}=true).
+
+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.









+the surface boundary condition. Finally, the different options that further modify
+the fluxes applied to the ocean are discussed.
@@ 60,9 +51,8 @@
The surface ocean stress is the stress exerted by the wind and the seaice
on the ocean. Their two components are assumed to be interpolated on the
ocean mesh, i.e. provided at U and Vpoints 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) :
+on the ocean. The two components of stress are assumed to be interpolated
+onto the ocean mesh, $i.e.$ resolved onto the model (\textbf{i},\textbf{j}) direction
+at $u$ and $v$points They are applied as a surface boundary condition of the
+computation of the momentum vertical mixing trend (\mdl{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}
@@ 72,16 +62,15 @@
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).
+The surface heat flux is decomposed into two parts, a non solar and a solar heat
+flux, $Q_{ns}$ and $Q_{sr}$, respectively. The former is the non penetrative part
+of the heat flux ($i.e.$ the sum of sensible, latent and 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.
+$Q_{sr}$ 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}=True.
\begin{equation} \label{Eq_sbc_traqsr}
@@ 89,16 +78,15 @@
\,e_{3T} }\delta _k \left[ {I_w } \right]
\end{equation}

where $I_w$ is an adimensional function that describes the way the light
+where $I_w$ is a nondimensional 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 nonnecessary
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.
+exponentials (see \S\ref{TRA_qsr}).
+
+The surface freshwater budget is provided by fields: EMP and EMP$_S$ which
+may or may not be identical. Indeed, a surface freshwater flux has two effects:
+it changes the volume of the ocean and it changes the surface concentration of
+salt (and other tracers). Therefore it appears in the sea surface height as a volume
+flux, EMP (\textit{dynspg\_xxx} modules), and in the salinity time evolution equations
+as a concentration/dilution effect,
+EMP$_{S}$ (\mdl{trasbc} module).
\begin{equation} \label{Eq_trasbc_emp}
\begin{aligned}
@@ 109,113 +97,101 @@
\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.
+In the real ocean, EMP$=$EMP$_S$ and the ocean salt content is conserved,
+but it exist several numerical reasons why this equality should be broken.
For example:
When rigidlid assumption is made, the ocean volume becomes constant and
thus, EMP=0, not EMP$_{S }$.

When a seaice 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,
+thus, EMP$=$0, not EMP$_{S }$.
+
+When the ocean is coupled to a seaice model, the water exchanged between ice and
+ocean is slightly salty (mean seaice 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
+freezing/melting and the salt flux between ice and ocean, while EMP is
only the volume flux. In addition, in the current version of \NEMO, the
seaice 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 seaice 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 ocean volume (not impact on EMP) but it modifies the SSS.
+%gm \colorbox{yellow}{(see {\S} on LIM seaice model)}.
+
+Note that SST can also be modified by a freshwater flux. Precipitation (in
+particular solid precipitation) 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
+precipitation, 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
+be emphasised that this absence does not mean that there is no heat flux
+associated with precipitation! Precipitation can change the ocean volume and thus the
+ocean heat content. It is therefore associated with a heat flux (not yet
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 seaice

\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
timestep:
+%\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 seaice
+%
+%\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 surface currents, temperature and salinity
+averaged over \np{nf\_sbc} timestep (\ref{Tab_ssm}).The computation of the
+mean is done in \mdl{sbcmod} module.
%TABLE
\begin{table}[htbp] \label{Tab_ssm}
+\begin{table}[tb] \label{Tab_ssm}
\begin{center}
\begin{tabular}{llll}
\hline
Variable desciption & Computer name & Units & point \\ \hline
icomponent of the surface current & ssu\_u & $m.s^{1}$ & U \\ \hline
+Variable description & Model variable & Units & point \\ \hline
+icomponent of the surface current & ssu\_m & $m.s^{1}$ & U \\ \hline
jcomponent 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}
+\caption{Ocean variables provided by the ocean to the surface module (SBC).
+The variable are averaged over nf{\_}sbc time step, $i.e.$ the frequency of
+computation of surface fluxes.}
\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 ` ``iceif'' sea ice, i.e. read observed icecover and modified sbc
bellow those area.

= `lim' LIM seaice 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}
+
+
+%\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
+
% ================================================================
% Analytical formulation (sbcana module)
% ================================================================
\section{Analytical formulation (\textit{sbcana} module) }
+\section [Analytical formulation (\textit{sbcana}) ]
+ {Analytical formulation (\mdl{sbcana} module) }
\label{SBC_ana}
%namtau  namflx
\namdisplay{namtau}
\namdisplay{namflx}
+%namsbc_ana
+\namdisplay{namsbc_ana}
%
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
+The analytical formulation of the surface boundary condition is the default scheme.
+In this case, all the six fluxes needed by the ocean are assumed to
+be uniform in space. They take constant values given in the namelist
+namsbc{\_}ana by the variables \np{rn\_utau0}, \np{rn\_vtau0}, \np{rn\_qns0},
+\np{rn\_qsr0}, and \np{rn\_emp0} (EMP$=$EMP$_S$). The runoff is set to zero.
+In addition, the wind is allowed to reach its nominal value within a given number
+of time steps (\np{nn\_tau000}).
+
+If a user wants to apply a different analytical forcing, the \mdl{sbcana}
+module can be modified to use another scheme. As an example,
+the \mdl{sbc\_ana\_gyre} routine provides the analytical forcing for the
GYRE configuration (see GYRE configuration manual, in preparation).
@@ 224,36 +200,34 @@
% Flux formulation
% ================================================================
\section{Flux formulation (\mdl{sbcflx} module, \key{sbcflx}) }
+\section [Flux formulation (\textit{sbcflx}) ]
+ {Flux formulation (\mdl{sbcflx} module) }
\label{SBC_flx}

In the flux formulation (\key{sbcflx} defined), the surface boundary
+%namsbc_flx
+\namdisplay{namsbc_flx}
+%
+
+In the flux formulation (\np{ln\_flx}=true), 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
+read in the file, the time frequency at which it is given (in hours), and a logical
+setting whether a time interpolation to the model time step is required
for this field). (fld\_i namelist structure).
\colorbox{yellow}{ Describe the information given? }

\colorbox{yellow}{ Add an info about online 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
+values. These 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
+records 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
+having the same name but a suffix {\_}prev{\_}year ({\_}next{\_}year) being
+added (e.g. "{\_}1989"). These files must only contain a single record. If they don't exist,
+the model assumes that the last record of the previous year is equal to the first
+record of the current 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.
+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
+restoring term to observed SST and/or SSS. See \S\ref{SBC_ssr} for its
specification.
@@ 262,5 +236,6 @@
% Bulk formulation
% ================================================================
\section{Bulk formulation (\mdl{sbcblk\_core} or\mdl{sbcblk\_clio} module) }
+\section [Bulk formulation (\textit{sbcblk\_core} or \textit{sbcblk\_clio}) ]
+ {Bulk formulation \small{(\mdl{sbcblk\_core} or \mdl{sbcblk\_clio} module)} }
\label{SBC_blk}
@@ 268,18 +243,30 @@
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 seaice 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 atmospheric fields used depend on the bulk formulae used. Two bulk formulations
+are available : the CORE and CLIO bulk formulea. The choice is made by setting to true
+one of the following namelist variable : \np{ln\_core} and \np{ln\_clio}.
+
+Note : in forced mode, when a seaice model is used, a bulk formulation have to be used.
+Therefore the two bulk formulea provided include the computation of the fluxes over both
+an ocean and an ice surface.
+
+% 
+% CORE Bulk formulea
+% 
+\subsection [CORE Bulk formulea (\np{ln\_core}=true)]
+ {CORE Bulk formulea (\np{ln\_core}=true, \mdl{sbcblk\_core})}
+\label{SBC_blk_core}
+%namsbc_core
+\namdisplay{namsbc_core}
+%
+
+The CORE bulk formulae have been developed by \citet{LargeYeager2004}.
+They have been designed 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 metre wind speed, air temperature and specific humidity.
+
+Note that substituting ERA40 to NCEP reanalysis fields
+does not require changes in the bulk formulea themself.
The required 8 input fields are:
@@ 290,7 +277,7 @@
\begin{tabular}{llll}
\hline
Variable desciption & Computer name & Units & point \\ \hline
icomponent of the 10m air velocity & utau & $m.s^{1}$ & T or U \\ \hline
jcomponent of the 10m air velocity & vtau & $m.s^{1}$ & T or V \\ \hline
+Variable desciption & Model variable & Units & point \\ \hline
+icomponent of the 10m air velocity & utau & $m.s^{1}$ & T \\ \hline
+jcomponent of the 10m air velocity & vtau & $m.s^{1}$ & T \\ \hline
10m air temperature & tair & \r{}$K$ & T \\ \hline
Specific humidity & humi & \% & T \\ \hline
@@ 304,21 +291,21 @@
%
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 UV, high resolution better}

\colorbox{yellow}{at Tpoint{\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
Louvainlaneuve coupled iceocean 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.
+Note that the air velocity is provided at a tracer ocean point, not at a velocity ocean point ($u$ and $v$points). It is simpler and faster (less fields to be read), but it is not the recommended method when the ocean grid
+size is the same or larger than the one of the input atmospheric fields.
+
+% 
+% CLIO Bulk formulea
+% 
+\subsection [CLIO Bulk formulea (\np{ln\_clio}=true)]
+ {CLIO Bulk formulea (\np{ln\_clio}=true, \mdl{sbcblk\_clio})}
+\label{SBC_blk_clio}
+%namsbc_clio
+\namdisplay{namsbc_clio}
+%
+
+The CLIO bulk formulae were developed several years ago for the
+Louvainlaneuve coupled iceocean model (CLIO, \cite{Goosse_al_JGR99}).
+They are simpler bulk formulae. They assume the stress to be known and
+compute the radiative fluxes from a climatological cloud cover.
The required 7 input fields are:
@@ 329,10 +316,10 @@
\begin{tabular}{llll}
\hline
Variable desciption & Computer name & Units & point \\ \hline
+Variable desciption & Model variable & Units & point \\ \hline
icomponent of the ocean stress & utau & $N.m^{2}$ & U \\ \hline
jcomponent 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
+Specific humidity & humi & \% & T \\ \hline
Cloud cover & & \% & T \\ \hline
Total precipitation (liquid + solid) & precip & $Kg.m^{2}.s^{1}$ & T \\ \hline
@@ 343,15 +330,18 @@
%
As for the flux formulation, the input data information required by the
+As for the flux formulation, information about the input data 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.

+namelist (via the structure fld\_i). The first and last record assumption is also made
+(see \S\ref{SBC_flx})
% ================================================================
% Coupled formulation
% ================================================================
\section{Coupled formulation (\mdl{sbccpl} module)}
+\section [Coupled formulation (\textit{sbccpl}) ]
+ {Coupled formulation (\mdl{sbccpl} module)}
\label{SBC_cpl}
+%namsbc_cpl
+\namdisplay{namsbc_cpl}
+%
In the coupled formulation of the surface boundary condition, the fluxes are
@@ 360,9 +350,13 @@
the atmospheric component.
+The generalised coupled interface is under development. It should be available
+in summer 2008. It will include the ocean interface for most of the European
+atmospheric GCM (ARPEGE, ECHAM, ECMWF, HadAM, LMDz).
+
% ================================================================
% Miscellanea options
% ================================================================
\section{Miscellanea options}
+\section{Miscellaneous options}
\label{SBC_misc}
@@ 370,9 +364,13 @@
% Surface restoring to observed SST and/or SSS
% 
\subsection{Surface restoring to observed SST and/or SSS (\mdl{sbcssr})}
+\subsection [Surface restoring to observed SST and/or SSS (\textit{sbcssr})]
+ {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$:
+%namsbc_ssr
+\namdisplay{namsbc_ssr}
+%
+
+In forced mode using a flux formulation (default option or \key{flx} defined), a
+feedback term \emph{must} be added to the 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)
@@ 380,24 +378,26 @@
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$ mixedlayer 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:
+coefficient usually taken equal to $40~W/m^2/K$. For a $50~m$
+mixedlayer depth, this value corresponds to a relaxation time scale of two months.
+This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is
+equal to $Q_o$.
+
+In the fresh water budget, a feedback term can also be added. Converted into an
+equivalent freshwater flux, it takes the following expression :
\begin{equation} \label{Eq_sbc_dmp_emp}
EMP = EMP_o +\gamma_s^{1} \left(SSSS_{Obs}\right)\leftS\right.
+EMP = EMP_o + \gamma_s^{1} e_{3t} \frac{ \left(\left.S\right_{k=1}SSS_{Obs}\right)}
+ {\left.S\right_{k=1}}
\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.
+where EMP$_{o }$ is a net surface fresh water flux (observed, climatological or an
+atmospheric model product), \textit{SSS}$_{Obs}$ is a sea surface salinity (usually a time
+interpolation of the monthly mean Polar Hydrographic Climatology \citep{Steele2001}),
+$\left.S\right_{k=1}$ 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 \ref{Eq_sbc_dmp_emp} as the atmosphere
+does not care about ocean surface salinity \citep{Madec1997}. The SSS restoring
+term should be viewed as a flux correction on freshwater fluxes to reduce the
+uncertainties we have on the observed freshwater budget.
% 
@@ 406,23 +406,27 @@
\subsection{Handling of icecovered area}
\label{SBC_icecover}
The presence of seaice 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 seaice model is used
or not.

Without sea ice model, the information of icecover / open ocean is read in
a file (either the directly the icecover or the observed SST from which
icecover is deduced using a criteria on freezing point temperature).
+
+The presence at the sea surface of an ice covered area modifies all the fluxes
+transmitted to the ocean. There are several way to handle seaice in the system depending on the value of the \np{nn{\_}ice} namelist parameter.
+\begin{description}
+\item[nn{\_}ice = 0] there will never be seaice in the computational domain. This is a typical namelist value used for tropical ocean domain. The surface fluxes are simply specified for an icefree ocean. No specific things are done for seaice.
+\item[nn{\_}ice = 1] seaice can exist in the computational domain, but no seaice model is used. An observed ice covered area is read in a file. Below this area, the SST is restored to the freezing point and the heat fluxes are set to $4~W/m^2$ ($2~W/m^2$) in the northern (southern) hemisphere. The associated modification of the freshwater fluxes are done in such a way that the change in buoyancy fluxes remains zero. This prevents deep convection to occur when trying to reach the freezing point (and so ice covered area condition) while the SSS is too large. This manner of managing seaice area, just by using si IF case, is usually referred as the \textit{iceif} model. It can be found in the \mdl{sbcice{\_}if} module.
+\item[nn{\_}ice = 2 or more] A full sea ice model is used. This model computes the iceocean fluxes, that are combined with the airsea fluxes using the ice fraction of each model cell to provide the surface ocean fluxes. Note that the activation of a seaice model is is done by defining a CPP key (\key{lim2} or \key{lim3}). The activation automatically ovewrite the read value of nn{\_}ice to its appropriate value ($i.e.$ $2$ for LIM2 and $3$ for LIM3).
+\end{description}
+
+% {Description of Iceocean interface to be added here or in LIM 2 and 3 doc ?}
% 
% Addition of river runoffs
% 
\subsection{Addition of river runoffs (\mdl{sbcrnf})}
+\subsection [Addition of river runoffs (\textit{sbcrnf})]
+ {Addition of river runoffs (\mdl{sbcrnf})}
\label{SBC_rnf}
+%namsbc_rnf
+\namdisplay{namsbc_rnf}
+%
It is convenient to introduce the river runoff in the model as a surface
fresh water fluxes. \colorbox{yellow}{{\ldots} blah blah{\ldots}.}
+fresh water flux.
\colorbox{yellow}{Nevertheless, Pb of vertical resolution and increase of Kz in vicinity of }
@@ 433,15 +437,15 @@
% 
% Addition of river runoffs
% 
\subsection{Freshwater budget control (\mdl{sbcfwb})}
+% Freshwater budget control
+% 
+\subsection [Freshwater budget control (\textit{sbcfwb})]
+ {Freshwater budget control (\mdl{sbcfwb})}
\label{SBC_fwb}
%namfwb
\namdisplay{namfwb}
%

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




+
+To be written later...
+
+\gmcomment{The descrition of the technique used to control the freshwater budget has to be added here}
+
+
+
+
Index: trunk/DOC/TexFiles/Chapters/Chap_TRA.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_TRA.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_TRA.tex (revision 994)
@@ 12,9 +12,11 @@
% ==> addfigure on bbl

+%STEVEN : is the use of the word "positive" to describe a scheme enough, or should it be "positive definite"? I added a comment to this effect on some instances of this below
+
+\newpage
$\ $\newline % force a new ligne
Using the representation described in Chap.~\ref{DOM}, several semidiscrete space
forms of the tracer equations are available depending on the vertical
+Using the representation described in Chap.~\ref{DOM}, several semidiscrete
+space forms of the tracer equations are available depending on the vertical
coordinate used and on the physics used. In all the equations presented
here, the masking has been omitted for simplicity. One must be aware that
@@ 22,5 +24,6 @@
operator is used, the resulting field is multiplied by a mask.
The two active tracers are potential temperature and salinity. Their prognostic equation can be summarized as follows:
+The two active tracers are potential temperature and salinity. Their prognostic
+equations can be summarized as follows:
\begin{equation*}
\text{NXT} = \text{ADV}+\text{LDF}+\text{ZDF}+\text{SBC}
@@ 28,16 +31,40 @@
\end{equation*}
NXT stands for next, referring to the timestepping. From left to right, the terms on the rhs of the tracer equations are the advection (ADV), the lateral diffusion (LDF), the vertical diffusion (ZDF), the contributions from the external forcings (SBC: Surface Boundary Condition, QSR: Solar Radiation penetration, and BBC: Bottom Boundary Condition), the contribution from the bottom boundary Layer (BBL) parametrisation, and an internal damping (DMP) term. The last four have been put inside brackets as they are optional. The external forcings and parameterizations require complex inputs and calculations (bulk formulae, estimation of mixing coefficients) that are carried out in modules of the SBC, LDF and ZDF categories and described in chapters \S\ref{SBC}, \S\ref{LDF} and \S\ref{ZDF}, respectively. Note that \mdl{tranpc}, the nonpenetrative convection module, although (temporarily) located in the NEMO/OPA//TRA directory, is described with the model vertical physics (ZDF).

In the present chapter we also describe the diagnostic equations used to compute the seawater properties (density, BruntVais\"{a}l\"{a} frequency, specific heat and freezing point) although the associated modules ($i.e.$ \mdl{eosbn2}, \mdl{ocfzpt} and \mdl{phycst}) are (temporarily) located in the NEMO/OPA directory.

The different options available to the user are managed by namelist logical or CPP keys. For each equation term ttt, the namelist logicals are \textit{ln\_trattt\_xxx}, where \textit{xxx} is a 3 or 4 letter acronym accounting for each optional scheme. The CPP key (when it exists) is \textbf{key\_trattt}. The corresponding code can be found in the \textit{trattt} or \textit{trattt\_xxx} module, in the NEMO/OPA/TRA directory.

The user has the option of extracting each tendency term on the rhs of the tracer equation (\key {trdtra} defined), as described in Chap.~\ref{MISC}.
+NXT stands for next, referring to the timestepping. From left to right, the terms
+on the rhs of the tracer equations are the advection (ADV), the lateral diffusion
+(LDF), the vertical diffusion (ZDF), the contributions from the external forcings
+(SBC: Surface Boundary Condition, QSR: penetrative Solar Radiation, and BBC:
+Bottom Boundary Condition), the contribution from the bottom boundary Layer
+(BBL) parametrisation, and an internal damping (DMP) term. The terms QSR,
+BBC, BBL and DMP are optional. The external forcings and parameterizations
+require complex inputs and complex calculations (e.g. bulk formulae, estimation
+of mixing coefficients) that are carried out in the SBC, LDF and ZDF modules and
+described in chapters \S\ref{SBC}, \S\ref{LDF} and \S\ref{ZDF}, respectively.
+Note that \mdl{tranpc}, the nonpenetrative convection module, although
+(temporarily) located in the NEMO/OPA/TRA directory, is described with the
+model vertical physics (ZDF).
+%%%
+\gmcomment{change the position of eosbn2 in the reference code}
+%%%
+
+In the present chapter we also describe the diagnostic equations used to compute
+the seawater properties (density, BruntVais\"{a}l\"{a} frequency, specific heat and
+freezing point) although the associated modules ($i.e.$ \mdl{eosbn2}, \mdl{ocfzpt}
+and \mdl{phycst}) are (temporarily) located in the NEMO/OPA directory.
+
+The different options available to the user are managed by namelist logical or
+CPP keys. For each equation term ttt, the namelist logicals are \textit{ln\_trattt\_xxx},
+where \textit{xxx} is a 3 or 4 letter acronym accounting for each optional scheme.
+The CPP key (when it exists) is \textbf{key\_trattt}. The corresponding code can be
+found in the \textit{trattt} or \textit{trattt\_xxx} module, in the NEMO/OPA/TRA directory.
+
+The user has the option of extracting each tendency term on the rhs of the tracer
+equation for output (\key{trdtra} is defined), as described in Chap.~\ref{MISC}.
% ================================================================
% Tracer Advection
% ================================================================
\section{Tracer Advection (\mdl{traadv})}
+\section [Tracer Advection (\textit{traadv})]
+ {Tracer Advection (\mdl{traadv})}
\label{TRA_adv}
%nam_traadv
@@ 45,5 +72,5 @@
%
The advection tendency in flux form is the divergence of the advective
+The advection tendency of a tracer in flux form is the divergence of the advective
fluxes. Its discrete expression is given by :
\begin{equation} \label{Eq_tra_adv}
@@ 54,5 +81,6 @@
{w\;\tau _w } \right]
\end{equation}
which, in pure zcoordinate (\key{zco} defined), reduces to :
+where $\tau$ is either T or S. In pure $z$coordinate (\key{zco} is defined),
+it reduces to :
\begin{equation} \label{Eq_tra_adv_zco}
ADV_\tau =\frac{1}{e_{1T} {\kern 1pt}e_{2T} {\kern 1pt}}\left( {\;\delta _i
@@ 61,89 +89,123 @@
e\nolimits_{3T} }\delta _k \left[ {w\;\tau _w } \right]
\end{equation}
as the vertical scale factors are function of $k$ only, and thus $e_{3u}
+since the vertical scale factors are functions of $k$ only, and thus $e_{3u}
=e_{3v} =e_{3T} $.
The flux form requires implicitly the use of the continuity equation:
+The flux form in \eqref{Eq_tra_adv} requires implicitly the use of the continuity equation:
$\nabla \cdot \left( \vect{U}\,T \right)=\vect{U} \cdot \nabla T$
using $\nabla \cdot \vect{U}=0)$ or $\partial _t e_3 +\nabla \cdot \vect{U}=0$ in variable volume case ($i.e.$ \key{vvl} defined). Therefore it is of
+(using $\nabla \cdot \vect{U}=0)$ or $\partial _t e_3 + e_3\;\nabla \cdot \vect{U}=0$
+ in variable volume case ($i.e.$ \key{vvl} defined). Therefore it is of
paramount importance to design the discrete analogue of the advection
tendency so that it is consistent with the continuity equation in order to
enforce conservation properties of the continuous equations. In other words,
by substituting $\tau$ by 1 in (\ref{Eq_tra_adv}) we recover discrete form of the
continuity equation which is used to calculate the vertical velocity.
+enforce the conservation properties of the continuous equations. In other words,
+by substituting $\tau$ by 1 in (\ref{Eq_tra_adv}) we recover the discrete form of
+the continuity equation which is used to calculate the vertical velocity.
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!t] \label{Fig_adv_scheme} \begin{center}
\includegraphics[width=0.9\textwidth]{./Figures/Fig_adv_scheme.pdf}
\caption{Schematic representation of some ways used to evaluate the tracer value at $u$point and the amount of tracer exchanged between two neighbouring grid points. Upsteam biased scheme (ups): the upstream value is used and the black area is exchanged. Piecewise parabolic method (ppm): a parabolic interpolation is used and black + dark grey areas is exchanged. Monotonic upstream scheme for conservative laws (muscl): a parabolic interpolation is used and black + dark grey + grey areas are exchanged. Second order scheme (cen2): the mean value is used and black + dark grey + grey + light grey areas are exchanged. Note that this illustration does not include the flux limiter used in ppm and muscl schemes.}
+\caption{Schematic representation of some ways used to evaluate the tracer value
+at $u$point and the amount of tracer exchanged between two neighbouring grid
+points. Upsteam biased scheme (ups): the upstream value is used and the black
+area is exchanged. Piecewise parabolic method (ppm): a parabolic interpolation
+is used and the black and dark grey areas are exchanged. Monotonic upstream
+scheme for conservative laws (muscl): a parabolic interpolation is used and black,
+dark grey and grey areas are exchanged. Second order scheme (cen2): the mean
+value is used and black, dark grey, grey and light grey areas are exchanged. Note
+that this illustration does not include the flux limiter used in ppm and muscl schemes.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The advection schemes used in OPA differ by the choice made in space and
time interpolation to define the value of the tracer at the velocity points (\ref{Fig_adv_scheme}).
+
+The key difference between the advection schemes used in \NEMO is the choice
+made in space and time interpolation to define the value of the tracer at the
+velocity points (Fig.~\ref{Fig_adv_scheme}).
+
Along solid lateral and bottom boundaries a zero tracer flux is naturally
specified, since the normal velocity is zero there. At the sea surface the
boundary condition depends on the type of sea surface chosen: (1) in
rigidlid formulation, $w=0$ at the surface, so the advective fluxes through the
surface is zero ; (2) in nonlinear free surface (variable volume case,
\key{vvl} defined), convergence/divergence in the first ocean level moves
up/down the free surface: there is no tracer advection through it so that
the advective fluxes through the surface is also zero ; (3) in the linear
free surface, the first level thickness is constant in time. The vertical
boundary condition is applied at the fixed surface $z=0$ rather than on the
moving surface $z=\eta$. There is a nonzero advective flux which is set for all
advection schemes as the product of surface velocity (at $z=0$) by the first level
tracer value: $\left. {\tau _w } \right_{k=1 \mathord{\left/ {\vphantom {1
2}} \right. \kern\nulldelimiterspace} 2} =T_{k=1} $. This boundary
condition retains local conservation of tracer. Strict global conservation
is not possible in linear free surface but is achieved to a good
approximation since the nonconservative term is the product of the time
derivative of the tracer and the free surface height, two quantities that are not correlated (see \S\ref{PE_free_surface}, and also \citet{Roullet2000,Griffies2001,Campin2004}).

The velocity field that appears in (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_zco}) is the centred (\textit{now}) \textit{eulerian} ocean velocity (see \S\ref{DYN}). Nevertheless, when advective bottom boundary layer (\textit{bbl}) and/or eddy induced velocity (\textit{eiv}) parameterisations are used it is the \textit{now} \textit{effective} velocity (i.e. the sum of the eulerian, the bbl and/or the eiv velocities) which is used.
+boundary condition depends on the type of sea surface chosen:
+\begin{description}
+\item [rigidlid formulation:] $w=0$ at the surface, so the advective
+fluxes through the surface are zero.
+\item [linear free surface:] the first level thickness is constant in time:
+the vertical boundary condition is applied at the fixed surface $z=0$
+rather than on the moving surface $z=\eta$. There is a nonzero advective
+flux which is set for all advection schemes as the product of surface
+velocity (at $z=0$) by the first level tracer value:
+$\left. {\tau _w } \right_{k=1/2} =T_{k=1} $.
+\item [nonlinear free surface:] (\key{vvl} is defined)
+convergence/divergence in the first ocean level moves the free surface
+up/down. There is no tracer advection through it so that the advective
+fluxes through the surface are also zero
+\end{description}
+In all cases, this boundary condition retains local conservation of tracer.
+Global conservation is obtained in both rigidlid and nonlinear free surface
+cases, but not in the linear free surface case. Nevertheless, in the latter
+case, it is achieved to a good approximation since the nonconservative
+term is the product of the time derivative of the tracer and the free surface
+height, two quantities that are not correlated (see \S\ref{PE_free_surface},
+and also \citet{Roullet2000,Griffies2001,Campin2004}).
+
+The velocity field that appears in (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_zco})
+is the centred (\textit{now}) \textit{eulerian} ocean velocity (see Chap.~\ref{DYN}).
+When advective bottom boundary layer (\textit{bbl}) and/or eddy induced velocity
+(\textit{eiv}) parameterisations are used it is the \textit{now} \textit{effective}
+velocity ($i.e.$ the sum of the eulerian, the bbl and/or the eiv velocities) which is used.
The choice of an advection scheme is made in the \np{nam\_traadv} namelist, by
setting to \textit{true} one and only one of the logicals \textit{ln\_traadv\_xxx}. The
corresponding code can be found in \textit{traadv\_xxx.F90} module, where
\textit{xxx} is a 3 or 4 letter acronym accounting for each scheme. Details
+corresponding code can be found in the \textit{traadv\_xxx.F90} module, where
+\textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme. Details
of the advection schemes are given below. The choice of an advection scheme
is a complex matter which depends on the model physics, model resolution,
type of tracer, as well as the issue of numerical cost.
Note that (1) cen2, cen4 and TVD schemes require an explicit diffusion
+Note that
+(1) cen2, cen4 and TVD schemes require an explicit diffusion
operator while the other schemes are diffusive enough so that they do not
require additional diffusion ; (2) cen2, cen4, MUSCL2, and UBS are not
\textit{positive} schemes, meaning false extrema are permitted. It is not recommended to use
them on passive tracers ; (3) It is highly recommended to use the same
advectiondiffusion scheme on both active and passive tracers. In
particular, if a source or sink of a passive tracer depends on a active one,
the difference of treatment of active and passive tracers can create very
nicelooking frontal structures that are pure numerical artefacts.

+require additional diffusion ;
+(2) cen2, cen4, MUSCL2, and UBS are not \textit{positive} schemes
+\footnote{negative values can appear in an initially strictly positive tracer field
+which is advected}
+, implying that false extrema are permitted. Their use is not recommended on passive tracers ;
+(3) It is highly recommended that the same advectiondiffusion scheme is
+used on both active and passive tracers. Indeed, if a source or sink of a
+passive tracer depends on an active one, the difference of treatment of
+active and passive tracers can create very nicelooking frontal structures
+that are pure numerical artefacts.
% 
% 2nd order centred scheme
% 
\subsection{$2^{nd}$ order centred scheme (cen2) (\np{ln\_traadv\_cen2}=T)}
+\subsection [$2^{nd}$ order centred scheme (cen2) (\np{ln\_traadv\_cen2})]
+ {$2^{nd}$ order centred scheme (cen2) (\np{ln\_traadv\_cen2}=.true.)}
\label{TRA_adv_cen2}
In the centred second order formulation, the tracer at velocity points is
evaluated as the mean of the two neighbouring $T$points. For example, in the
$i$direction :
+evaluated as the mean of the two neighbouring $T$point values.
+For example, in the $i$direction :
\begin{equation} \label{Eq_tra_adv_cen2}
\tau _u^{cen2} =\overline T ^{i+1/2}
\end{equation}
The scheme is non diffusive ($i.e.$ it conserves the tracer variance, $\tau^2)$ but dispersive ($i.e.$ it may create false extrema). It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to produce a sensible solution. The associated timestepping is performed using a leapfrog scheme in conjunction with an Asselin timefilter, so $T$ in (\ref{Eq_tra_adv_cen2}) is the \textit{now} tracer value.

Note that using cen2 scheme, the overall tracer advection is of second order accuracy since both (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_cen2}) have this order of accuracy.
+The scheme is non diffusive ($i.e.$ it conserves the tracer variance, $\tau^2)$
+but dispersive ($i.e.$ it may create false extrema). It is therefore notoriously
+noisy and must be used in conjunction with an explicit diffusion operator to
+produce a sensible solution. The associated timestepping is performed using
+a leapfrog scheme in conjunction with an Asselin timefilter, so $T$ in
+(\ref{Eq_tra_adv_cen2}) is the \textit{now} tracer value.
+
+Note that using the cen2 scheme, the overall tracer advection is of second
+order accuracy since both (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_cen2})
+have this order of accuracy.
% 
% 4nd order centred scheme
% 
\subsection{$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4}=T)}
+\subsection [$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4})]
+ {$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4}=.true.)}
\label{TRA_adv_cen4}
In the $4^{th}$ order formulation (to be implemented), tracer is evaluated
at velocity points as the $4^{th}$ order interpolation of $T$, and thus use the
four neighbouring $T$points. For example, in the $i$direction:
+In the $4^{th}$ order formulation (to be implemented), tracer values are
+evaluated at velocity points as a $4^{th}$ order interpolation, and thus uses
+the four neighbouring $T$points. For example, in the $i$direction:
\begin{equation} \label{Eq_tra_adv_cen4}
\tau _u^{cen4}
@@ 152,34 +214,35 @@
Strictly speaking, the cen4 scheme is not a $4^{th}$ order advection scheme
but a $4^{th}$ order evaluation of advective fluxes since the divergence of
advective fluxes, (\ref{Eq_tra_adv}), is kept at $2^{nd}$ order. The ``$4^{th}$ order
scheme'' denomination used in oceanographic literature is usually associated
+but a $4^{th}$ order evaluation of advective fluxes, since the divergence of
+advective fluxes \eqref{Eq_tra_adv} is kept at $2^{nd}$ order. The phrase ``$4^{th}$
+order scheme'' used in oceanographic literature is usually associated
with the scheme presented here. Introducing a \textit{true} $4^{th}$ order advection
scheme is feasible but, for consistency reasons, it requires changes in the
discretisation of the tracer advection together with changes in both the
continuity equation and the momentum advection.
+continuity equation and the momentum advection terms.
A direct consequence of the pseudofourth order nature of the scheme is that
it is not nondiffusive, i.e. the global variance of a tracer is not
preserved through \textit{cen4}. Furthermore, it must be used in conjunction with an
+preserved using \textit{cen4}. Furthermore, it must be used in conjunction with an
explicit diffusion operator to produce a sensible solution. The
timestepping is also performed using a leapfrog scheme in conjunction with
an Asselin timefilter, so $T$ in (\ref{Eq_tra_adv_cen4}) is the \textit{now} tracer.
At $T$grid cell abutted to a boundary (coastline, bottom and surface), an
+At a $T$grid cell adjacent to a boundary (coastline, bottom and surface), an
additional hypothesis must be made to evaluate $\tau _u^{cen4}$. This
hypothesis usually reduces the order of the scheme. Here we choose to set
the gradient of $T$ across the boundary to zero. Alternative conditions can be
specified such as the reduction to a second order scheme for near boundary
grid point.
+specified, such as a reduction to a second order scheme for these near boundary
+grid points.
% 
% TVD scheme
% 
\subsection{Total Variance Dissipation scheme (TVD) (\np{ln\_traadv\_tvd}=T)}
+\subsection [Total Variance Dissipation scheme (TVD) (\np{ln\_traadv\_tvd})]
+ {Total Variance Dissipation scheme (TVD) (\np{ln\_traadv\_tvd}=.true.)}
\label{TRA_adv_tvd}
In the Total Variance Dissipation (TVD) formulation, the tracer at velocity
points is evaluated as a combination of upstream and centred scheme. For
+points is evaluated using a combination of an upstream and a centred scheme. For
example, in the $i$direction :
\begin{equation} \label{Eq_tra_adv_tvd}
@@ 194,27 +257,29 @@
\end{equation}
where $c_u$ is a flux limiter function taking values between 0 and 1. There
exists many ways to define $c_u$., each correcponding to a different total
variance decreasing scheme. The one chosen in OPA is described in \citet{Zalesak1979}. $c_u$ only departs from $1$ when the advective term produces a local
extremum in the tracer field. The resulting scheme is quite expensive but
\emph{positive}. It can be used on both active and passive tracers. This scheme is tested
and compared with MUSCL and the MPDATA scheme in \citet{Levy2001}; note that
in this paper it is referred to as "FCT" (Flux corrected transport)
rather than TVD.

For stability reasons in (\ref{Eq_tra_adv_tvd}) $\tau _u^{cen2}$ is evaluated using the
\textit{now} velocity (leapfrog environment: centred in time) while $\tau _u^{ups}$ is
evaluated using the \textit{before} velocity (diffusive part: forward in time).
+exist many ways to define $c_u$, each correcponding to a different total
+variance decreasing scheme. The one chosen in \NEMO is described in \citet{Zalesak1979}. $c_u$ only departs from $1$ when the advective term
+produces a local extremum in the tracer field. The resulting scheme is quite
+expensive but \emph{positive}. It can be used on both active and passive tracers.
+This scheme is tested and compared with MUSCL and the MPDATA scheme in
+\citet{Levy2001}; note that in this paper it is referred to as "FCT" (Flux corrected
+transport) rather than TVD.
+
+For stability reasons (see \S\ref{DOM_nxt}), in (\ref{Eq_tra_adv_tvd})
+$\tau _u^{cen2}$ is evaluated using the \textit{now} tracer while $\tau _u^{ups}$
+is evaluated using the \textit{before} tracer. In other words, the advective part of
+the scheme is time stepped with a leapfrog scheme while a forward scheme is
+used for the diffusive part.
% 
% MUSCL scheme
% 
\subsection[MUSCL scheme (\np{ln\_traadv\_muscl}=T)]
+\subsection[MUSCL scheme (\np{ln\_traadv\_muscl})]
{Monotone Upstream Scheme for Conservative Laws (MUSCL) (\np{ln\_traadv\_muscl}=T)}
\label{TRA_adv_muscl}
The Monotone Upstream Scheme for Conservative Laws (MUSCL) has been
implemented by \citet{Levy2001}. In its formulation, the tracer at
velocity points is evaluated assuming a linear tracer variation between two
$T$points (Fig.\ref{Fig_adv_scheme}). For example, in the $i$direction :
+implemented by \citet{Levy2001}. In its formulation, the tracer at velocity points
+is evaluated assuming a linear tracer variation between two $T$points
+(Fig.\ref{Fig_adv_scheme}). For example, in the $i$direction :
\begin{equation} \label{Eq_tra_adv_muscl}
\tau _u^{mus} = \left\{ \begin{aligned}
@@ 225,25 +290,26 @@
\end{aligned} \right.
\end{equation}
where $\widetilde{\partial _i \tau}$ is the slope of the tracer
on which a limitation is imposed to ensure the \textit{positive} character of the scheme.

The time stepping is performed using a forward scheme, that is the \textit{before} tracer
field is used to evaluate $\tau _u^{mus}$.

For an ocean grid point abutted to land and where the ocean velocity is
toward land, two choices are available: use of an upstream flux
(\np{ln\_traadv\_muscl}=T) or use of second order flux
(\np{ln\_traadv\_muscl2}=T). Note that the latter choice does not insure the
\textit{positive} character of the scheme. Only the former can be used on both active and
passive tracers.
+where $\widetilde{\partial _i \tau}$ is the slope of the tracer on which a limitation
+is imposed to ensure the \textit{positive} character of the scheme.
+
+The time stepping is performed using a forward scheme, that is the \textit{before}
+tracer field is used to evaluate $\tau _u^{mus}$.
+
+For an ocean grid point adjacent to land and where the ocean velocity is
+directed toward land, two choices are available: an upstream flux
+(\np{ln\_traadv\_muscl}=.true.) or a second order flux
+(\np{ln\_traadv\_muscl2}=.true.). Note that the latter choice does not ensure
+the \textit{positive} character of the scheme. Only the former can be used
+on both active and passive tracers.
% 
% UBS scheme
% 
\subsection{Upstream Biased Scheme (UBS) (\np{ln\_traadv\_ubs}=T)}
+\subsection [UpstreamBiased Scheme (UBS) (\np{ln\_traadv\_ubs})]
+ {UpstreamBiased Scheme (UBS) (\np{ln\_traadv\_ubs}=.true.)}
\label{TRA_adv_ubs}
The UBS advection scheme is an upstream biased third order scheme based on
an upstreambiased parabolic interpolation. It is also known as Cell
+The UBS advection scheme is an upstreambiased third order scheme based on
+an upstreambiased parabolic interpolation. It is also known as the Cell
Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective
Kinematics). For example, in the $i$direction :
@@ 261,40 +327,50 @@
advection scheme is similar to that reported in \cite{Farrow1995}.
It is a relatively good compromise between accuracy and smoothness. It is
not a \emph{positive} scheme meaning false extrema are permitted but the
+not a \emph{positive} scheme, meaning that false extrema are permitted, but the
amplitude of such are significantly reduced over the centred second order
method. Nevertheless it is not recommended to apply it to a passive tracer
that requires positivity.
+method. Nevertheless it is not recommended that it should be applied to a passive
+tracer that requires positivity.
The intrinsic diffusion of UBS makes its use risky in the vertical direction
where the control of artificial diapycnal fluxes is of paramount importance.
It has therefore been preferred to evaluate the vertical flux using the TVD
scheme when \np{ln\_traadv\_ubs}=T.

For stability reasons, in \eqref{Eq_tra_adv_ubs}, the first term which corresponds to a
second order centred scheme is evaluated using the \textit{now} velocity (centred in
time) while the second term which is the diffusive part of the scheme, is
evaluated using the \textit{before} velocity (forward in time. This is discussed by \citet{Webb1998} in the context of the Quick advection scheme. UBS and QUICK
schemes only differ by one coefficient. Substituting 1/6 with 1/8 in
(\ref{Eq_tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}. This
option is not available through a namelist parameter, since the 1/6
coefficient is hard coded. Nevertheless it is quite easy to make the
substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme

NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can
+Therefore the vertical flux is evaluated using the TVD
+scheme when \np{ln\_traadv\_ubs}=.true..
+
+For stability reasons (see \S\ref{DOM_nxt}), in \eqref{Eq_tra_adv_ubs},
+the first term (which corresponds to a second order centred scheme)
+is evaluated using the \textit{now} tracer (centred in time) while the
+second term (which is the diffusive part of the scheme), is
+evaluated using the \textit{before} tracer (forward in time).
+This is discussed by \citet{Webb1998} in the context of the Quick
+advection scheme. UBS and QUICK
+schemes only differ by one coefficient. Replacing 1/6 with 1/8 in
+\eqref{Eq_tra_adv_ubs} leads to the QUICK advection scheme
+\citep{Webb1998}. This option is not available through a namelist
+parameter, since the 1/6 coefficient is hard coded. Nevertheless
+it is quite easy to make the substitution in the \mdl{traadv\_ubs} module
+and obtain a QUICK scheme.
+
+Note that :
+
+(1): When a high vertical resolution $O(1m)$ is used, the model stability can
be controlled by vertical advection (not vertical diffusion which is usually
solved using an implicit scheme). Computer time can be saved by using a
timesplitting technique on vertical advection. This possibility have been
implemented and validated in ORCA05L301. It is not currently offered in the
+timesplitting technique on vertical advection. This case has been
+implemented and validated in ORCA05 with 301 levels. It is not available in the
current reference version.
NB 2 : In a forthcoming release four options will be proposed for the
vertical component used in the UBS scheme. $\tau _w^{ubs}$ will be
evaluated using either \textit{(a)} a centred $2^{nd}$ order scheme , or \textit{(b)} a TVD
scheme, or \textit{(c)} an interpolation based on conservative parabolic splines
following \citet{Sacha2005} implementation of UBS in ROMS,
or \textit{(d)} an UBS. The $3^{rd}$ case has dispersion properties similar to an
+(2) : In a forthcoming release four options will be available for the vertical
+component used in the UBS scheme. $\tau _w^{ubs}$ will be evaluated
+using either \textit{(a)} a centred $2^{nd}$ order scheme , or \textit{(b)}
+a TVD scheme, or \textit{(c)} an interpolation based on conservative
+parabolic splines following the \citet{Sacha2005} implementation of UBS
+in ROMS, or \textit{(d)} a UBS. The $3^{rd}$ case has dispersion properties
+similar to an eighthorder accurate conventional scheme.
+
+following \citet{Sacha2005} implementation of UBS in ROMS, or \textit{(d)}
+an UBS. The $3^{rd}$ case has dispersion properties similar to an
eightorder accurate conventional scheme.
NB 3 : It is straight forward to rewrite \eqref{Eq_tra_adv_ubs} as follows:
+(3) : It is straightforward to rewrite \eqref{Eq_tra_adv_ubs} as follows:
\begin{equation} \label{Eq_tra_adv_ubs2}
\tau _u^{ubs} = \left\{ \begin{aligned}
@@ 309,37 +385,55 @@
 \frac{1}{2} u_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i]
\end{equation}
\eqref{Eq_tra_adv_ubs2} has several advantages. First it clearly evidence that the UBS scheme is based on the fourth order scheme to which is added an upstream biased diffusive term. Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step, not only the $2^{th}$ order part as stated above using \eqref{Eq_tra_adv_ubs} and also as it is coded in NEMO v2.3. Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient with is simply proportional to the velocity: $A_u^{lm}=  \frac{1}{12}\,{e_{1u}}^3\,u$. Note that the current version of NEMO uses \eqref{Eq_tra_adv_ubs}, not \eqref{Eq_tra_adv_ubs2}.

+\eqref{Eq_tra_adv_ubs2} has several advantages. Firstly, it clearly reveals
+that the UBS scheme is based on the fourth order scheme to which an
+upstreambiased diffusion term is added. Secondly, this emphasises that the
+$4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has
+to be evaluated at the \emph{now} time step using \eqref{Eq_tra_adv_ubs}.
+Thirdly, the diffusion term is in fact a biharmonic operator with an eddy
+coefficient which is simply proportional to the velocity:
+ $A_u^{lm}=  \frac{1}{12}\,{e_{1u}}^3\,u$. Note that NEMO v2.3 still uses
+ \eqref{Eq_tra_adv_ubs}, not \eqref{Eq_tra_adv_ubs2}. This should be
+ changed in forthcoming release.
+ %%%
+ \gmcomment{the change in UBS scheme has to be done}
+ %%%
% 
% QCK scheme
% 
\subsection{QUICKEST scheme (QCK) (\np{ln\_traadv\_qck}=T)}
+\subsection [QUICKEST scheme (QCK) (\np{ln\_traadv\_qck})]
+ {QUICKEST scheme (QCK) (\np{ln\_traadv\_qck}=.true.)}
\label{TRA_adv_qck}
The Quadratic Upstream Interpolation for Convective Kinematics with
Estimated Streaming Terms (QUICKEST) scheme proposed by \citet{Leonard1979} is
the third order Godunov scheme. It is associated with ULTIMATE QUICKEST
+Estimated Streaming Terms (QUICKEST) scheme proposed by \citet{Leonard1979}
+is the third order Godunov scheme. It is associated with the ULTIMATE QUICKEST
limiter \citep{Leonard1991}. It has been implemented in NEMO by G. Reffray
(MERCATORocean).

The resulting scheme is quite expensive but \emph{positive}. It can be used on both active
and passive tracers.
+(MERCATORocean).
+The resulting scheme is quite expensive but \emph{positive}. It can be used on both active and passive tracers. Nevertheless, the intrinsic diffusion of QCK makes its use
+risky in the vertical direction where the control of artificial diapycnal fluxes is of
+paramount importance. Therefore the vertical flux is evaluated using the CEN2
+scheme. This no more ensure the positivity of the scheme. The use of TVD in the
+vertical direction as for the UBS case should be implemented to maintain the property.
+
% 
% PPM scheme
% 
\subsection{Piecewise Parabolic Method (PPM) (\np{ln\_traadv\_ppm}=T)}
+\subsection [Piecewise Parabolic Method (PPM) (\np{ln\_traadv\_ppm})]
+ {Piecewise Parabolic Method (PPM) (\np{ln\_traadv\_ppm}=.true.)}
\label{TRA_adv_ppm}
The Piecewise Parabolic Method (PPM) proposed by Colella and Woodward (1984)
is based on a quadradic piecewise rebuilding. As QCK scheme, it is associated with
ULTIMATE QUICKEST limiter \citep{Leonard1991}. It has been implemented in \NEMO by G. Reffray (MERCATORocean) but is not yet offered in the current reference
version.
+is based on a quadradic piecewise rebuilding. Like the QCK scheme, it is associated
+with the ULTIMATE QUICKEST limiter \citep{Leonard1991}. It has been implemented
+in \NEMO by G. Reffray (MERCATORocean) but is not yet offered in the reference
+version 2.3.
% ================================================================
% Tracer Lateral Diffusion
% ================================================================
\section{Tracer Lateral Diffusion (\mdl{traldf})}
+\section [Tracer Lateral Diffusion (\textit{traldf})]
+ {Tracer Lateral Diffusion (\mdl{traldf})}
\label{TRA_ldf}
%nam_traldf
@@ 347,22 +441,24 @@
%
The options available for lateral diffusion are laplacian (rotated or not)
or biharmonic operators, that latter being more scaleselective (more
+The options available for lateral diffusion are a laplacian (rotated or not)
+or a biharmonic operator, the latter being more scaleselective (more
diffusive at small scales). The specification of eddy diffusivity
coefficients (either constant, variable in space and time) as well as the
computation of the slope along which the operators act are performed in
+coefficients (either constant or variable in space and time) as well as the
+computation of the slope along which the operators act, are performed in the
\mdl{ldftra} and \mdl{ldfslp} modules, respectively. This is described in Chap.~\ref{LDF}. The lateral diffusion of tracers is evaluated using a forward scheme,
i.e. the tracers appearing in its expression are the \textit{before} tracers in time,
except for the pure vertical component that appears when a tensor of
rotation is used. This latter term is solved implicitly together with the
vertical diffusion term (see \S\ref{DOM_nxt})
+$i.e.$ the tracers appearing in its expression are the \textit{before} tracers in time,
+except for the pure vertical component that appears when a rotation tensor
+is used. This latter term is solved implicitly together with the
+vertical diffusion term (see \S\ref{DOM_nxt}).
% 
% Isolevel laplacian operator
% 
\subsection{Isolevel laplacian operator (\mdl{traldf\_lap}, \np{ln\_traldf\_lap}) }
+\subsection [Isolevel laplacian operator (\textit{traldf\_lap}  \np{ln\_traldf\_lap})]
+ {Isolevel laplacian operator (\mdl{traldf\_lap}  \np{ln\_traldf\_lap}=.true.) }
\label{TRA_ldf_lap}
A laplacian diffusive operator (i.e. a harmonic operator) acting along the model surfaces is given by:
+A laplacian diffusion operator (i.e. a harmonic operator) acting along the model
+surfaces is given by:
\begin{equation} \label{Eq_tra_ldf_lap}
\begin{split}
@@ 377,19 +473,31 @@
\end{equation}
This lateral operator is a \emph{horizontal} one (i.e. acting along geopotential surfaces) in
$z$coordinate with or without partial step, but it is simply an isolevel operator in $s$coordinate.
It is thus used when, in addition to \np{ln\_traldf\_lap}=T, we have \np{ln\_traldf\_level}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=F. In both cases, it significantly contributes to diapycnal mixing. It is therefore not recommended to use it.

\textit{Notes} : In pure zcoordinate (\key{zco} defined), $e_{3u}=e_{3v}=e_{3T}$, so that the vertical scale factors disappear from (\ref{Eq_tra_ldf_lap}).

\textit{Notes} : In partial step $z$coordinate (\np{ln\_zps}=T), tracers in horizontally adjacent cells are located at different depths in vicinity of the bottom. In this case, horizontal derivatives in (\ref{Eq_tra_ldf_lap}) at the bottom level require a specific treatment. They are calculated in module zpshde, described in \S\ref{TRA_zpshde}.
+This lateral operator is a \emph{horizontal} one ($i.e.$ acting along
+geopotential surfaces) in the $z$coordinate with or without partial step,
+but is simply an isolevel operator in the $s$coordinate.
+It is thus used when, in addition to \np{ln\_traldf\_lap}=.true., we have
+\np{ln\_traldf\_level}=.true., or both \np{ln\_traldf\_hor}=.true. and
+\np{ln\_zco}=.false.. In both cases, it significantly contributes to
+diapycnal mixing. It is therefore not recommended.
+
+Note that
+(1) In pure $z$coordinate (\key{zco} is defined), $e_{3u}=e_{3v}=e_{3T}$, so
+that the vertical scale factors disappear from (\ref{Eq_tra_ldf_lap}).
+(2) In partial step $z$coordinate (\np{ln\_zps}=.true.), tracers in horizontally
+adjacent cells are located at different depths in the vicinity of the bottom.
+In this case, horizontal derivatives in (\ref{Eq_tra_ldf_lap}) at the bottom level
+require a specific treatment. They are calculated in the \mdl{zpshde} module,
+described in \S\ref{TRA_zpshde}.
% 
% Rotated laplacian operator
% 
\subsection{Rotated laplacian operator (\mdl{traldf\_iso}, \np{ln\_traldf\_lap})}
+\subsection [Rotated laplacian operator (\textit{traldf\_iso}  \np{ln\_traldf\_lap})]
+ {Rotated laplacian operator (\mdl{traldf\_iso}  \np{ln\_traldf\_lap}=.true.)}
\label{TRA_ldf_iso}
The general form of the second order lateral tracer subgrid scale physics (\ref{Eq_PE_zdf}) takes the following semidiscrete space form in $z$ and $s$coordinates:
+The general form of the second order lateral tracer subgrid scale physics
+(\ref{Eq_PE_zdf}) takes the following semidiscrete space form in $z$ and
+$s$coordinates:
\begin{equation} \label{Eq_tra_ldf_iso}
@@ 422,27 +530,53 @@
\end{split}
\end{equation}
where $r_1$ and $r_2$ are the slopes between the surface of computation ($z$ or $s$surfaces) and the surface along which the diffusive operator acts ($i.e.$ horizontal or isoneutral surfaces).
 It is thus used when, in addition to \np{ln\_traldf\_lap}=T, we have \np{ln\_traldf\_iso}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=T. The way these slopes are evaluated is given in \S\ref{LDF_slp}. At the surface, bottom and lateral boundaries, the turbulent fluxes of heat and salt are set to zero using the mask technique (see \S\ref{LBC_coast}).

The operator in \eqref{Eq_tra_ldf_iso} involves both lateral and vertical derivatives. For numerical stability, the vertical second derivative must be solved using the same implicit time scheme as those used in the vertical physics (see \S\ref{TRA_zdf}). For computer efficiency reasons, this term is not computed in \mdl{traldf} module, but in \mdl{trazdf} module where, if isoneutral mixing is used, the vertical mixing coefficient is simply increased by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$.

This formulation conserves the tracer but does not ensure the decrease of the tracer variance. Nevertheless the treatment performed on the slopes (see \S\ref{LDF}) allows to run safely without any additional background horizontal diffusion \citep{Guily2001}. An alternate scheme \citep{Griffies1998} which preserves both tracer and its variance is currently been tested in \NEMO.

Note that in partial step $z$coordinate (\np{ln\_zps}=T), the horizontal derivatives in \eqref{Eq_tra_ldf_iso} at the bottom level require a specific treatment. They are calculated in module zpshde, described in \S\ref{TRA_zpshde}.
+where $r_1$ and $r_2$ are the slopes between the surface of computation
+($z$ or $s$surfaces) and the surface along which the diffusion operator
+acts ($i.e.$ horizontal or isoneutral surfaces). It is thus used when,
+in addition to \np{ln\_traldf\_lap}=.true., we have \np{ln\_traldf\_iso}=.true.,
+or both \np{ln\_traldf\_hor}=.true. and \np{ln\_zco}=.true.. The way these
+slopes are evaluated is given in \S\ref{LDF_slp}. At the surface, bottom
+and lateral boundaries, the turbulent fluxes of heat and salt are set to zero
+using the mask technique (see \S\ref{LBC_coast}).
+
+The operator in \eqref{Eq_tra_ldf_iso} involves both lateral and vertical
+derivatives. For numerical stability, the vertical second derivative must
+be solved using the same implicit time scheme as that used in the vertical
+physics (see \S\ref{TRA_zdf}). For computer efficiency reasons, this term
+is not computed in the \mdl{traldf} module, but in the \mdl{trazdf} module
+where, if isoneutral mixing is used, the vertical mixing coefficient is simply
+increased by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$.
+
+This formulation conserves the tracer but does not ensure the decrease
+of the tracer variance. Nevertheless the treatment performed on the slopes
+(see \S\ref{LDF}) allows the model to run safely without any additional
+background horizontal diffusion \citep{Guily2001}. An alternative scheme
+\citep{Griffies1998} which preserves both tracer and its variance is currently
+been tested in \NEMO.
+
+Note that in the partial step $z$coordinate (\np{ln\_zps}=.true.), the horizontal
+derivatives at the bottom level in \eqref{Eq_tra_ldf_iso} require a specific
+treatment. They are calculated in module zpshde, described in \S\ref{TRA_zpshde}.
% 
% Isolevel bilaplacian operator
% 
\subsection{Isolevel bilaplacian operator (\mdl{traldf\_bilap}, \np{ln\_traldf\_bilap})}
+\subsection [Isolevel bilaplacian operator (\textit{traldf\_bilap}  \np{ln\_traldf\_bilap})]
+ {Isolevel bilaplacian operator (\mdl{traldf\_bilap}  \np{ln\_traldf\_bilap}=.true.)}
\label{TRA_ldf_bilap}
The lateral fourth order operator formulation on tracers is obtained by applying (\ref{Eq_tra_ldf_lap}) twice. It requires an additional assumption on boundary conditions: first and third derivative terms normal to the coast are set to zero.

It is used when, in addition to \np{ln\_traldf\_bilap}=T, we have \np{ln\_traldf\_level}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=F. In both cases, it can contributes to diapycnal mixing even if it should be less than in the laplacian case. It is therefore not recommended to use it.

\textit{Notes:} In the code, the bilaplacian routine does not call twice the laplacian
routine but is rather a specific routine. This is due to the fact that we
+The lateral fourth order bilaplacian operator on tracers is obtained by
+applying (\ref{Eq_tra_ldf_lap}) twice. It requires an additional assumption
+on boundary conditions: the first and third derivative terms normal to the
+coast are set to zero.
+
+It is used when, in addition to \np{ln\_traldf\_bilap}=.true., we have
+\np{ln\_traldf\_level}=.true., or both \np{ln\_traldf\_hor}=.true. and
+\np{ln\_zco}=.false.. In both cases, it can contribute diapycnal mixing,
+although less than in the laplacian case. It is therefore not recommended.
+
+Note that in the code, the bilaplacian routine does not call the laplacian
+routine twice but is rather a separate routine. This is due to the fact that we
introduce the eddy diffusivity coefficient, A, in the operator as: $\nabla
\cdot \nabla \left( {A\nabla \cdot \nabla T} \right)$ and instead of
+\cdot \nabla \left( {A\nabla \cdot \nabla T} \right)$, instead of
$\nabla \cdot a\nabla \left( {\nabla \cdot a\nabla T} \right)$ where
$a=\sqrt{A}$ and $A<0$. This was a mistake: both formulations
@@ 453,16 +587,26 @@
% Rotated bilaplacian operator
% 
\subsection{Rotated bilaplacian operator (\mdl{traldf\_bilapg}, \np{ln\_traldf\_bilap})}
+\subsection [Rotated bilaplacian operator (\textit{traldf\_bilapg}  \np{ln\_traldf\_bilap})]
+ {Rotated bilaplacian operator (\mdl{traldf\_bilapg}  \np{ln\_traldf\_bilap}=.true.)}
\label{TRA_ldf_bilapg}
The lateral fourth order operator formulation on tracers is obtained by applying (\ref{Eq_tra_ldf_iso}) twice. It requires an additional assumption on boundary conditions: first and third derivative terms normal to the coast, the bottom and the surface are set to zero.

 It is used when, in addition to \np{ln\_traldf\_bilap}=T, we have \np{ln\_traldf\_iso}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=T. Nevertheless, this rotated bilaplacian operator has never been seriously tested. No warranties that it is neither free of bugs or correctly formulated.
Moreover, the stability range of such an operator will be probably quite narrow, requiring a significantly smaller timestep than the one used on unrotated operator.
+The lateral fourth order operator formulation on tracers is obtained by
+applying (\ref{Eq_tra_ldf_iso}) twice. It requires an additional assumption
+on boundary conditions: first and third derivative terms normal to the
+coast, the bottom and the surface are set to zero.
+
+It is used when, in addition to \np{ln\_traldf\_bilap}=T, we have
+\np{ln\_traldf\_iso}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=T.
+Nevertheless, this rotated bilaplacian operator has never been seriously
+tested. No warranties that it is neither free of bugs or correctly formulated.
+Moreover, the stability range of such an operator will be probably quite
+narrow, requiring a significantly smaller timestep than the one used on
+unrotated operator.
% ================================================================
% Tracer Vertical Diffusion
% ================================================================
\section{Tracer Vertical Diffusion (\mdl{trazdf})}
+\section [Tracer Vertical Diffusion (\textit{trazdf})]
+ {Tracer Vertical Diffusion (\mdl{trazdf})}
\label{TRA_zdf}
%namzdf
@@ 470,5 +614,9 @@
%
The formulation of the vertical subgrid scale tracer physics is the same for all the vertical coordinates, based on a laplacian operator. The vertical diffusive operator given by (\ref{Eq_PE_zdf}) takes the following semidiscrete space form:
+The formulation of the vertical subgrid scale tracer physics is the same
+for all the vertical coordinates, and is based on a laplacian operator.
+The vertical diffusion operator given by (\ref{Eq_PE_zdf}) takes the
+following semidiscrete space form:
+(\ref{Eq_PE_zdf}) takes the following semidiscrete space form:
\begin{equation} \label{Eq_tra_zdf}
\begin{split}
@@ 482,13 +630,28 @@
where $A_w^{vT}$ and $A_w^{vS}$ are the vertical eddy diffusivity
coefficients on Temperature and Salinity, respectively. Generally, $A_w^{vT}=A_w^{vS}$ ecept when double diffusion mixing is parameterised (\key{zdfddm} defined). The way these coefficients can be evaluated is given in \S\ref{ZDF} (ZDF). Furthermore, when isoneutral mixing is used, the both mixing coefficient are increased by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$ to account for the vertical second derivative of \eqref{Eq_tra_ldf_iso}.

At the surface and bottom boundaries, the turbulent fluxes of momentum, heat and salt must be specified. At the surface they are prescribed from the surface forcing (see \S\ref{TRA_sbc}), while at the bottom they are set to zero for heat and salt, unless a geothermal flux forcing is prescribed as a bottom boundary condition (\S\ref{TRA_bbc}).
+coefficients on Temperature and Salinity, respectively. Generally,
+$A_w^{vT}=A_w^{vS}$ except when double diffusive mixing is
+parameterised (\key{zdfddm} is defined). The way these coefficients
+are evaluated is given in \S\ref{ZDF} (ZDF). Furthermore, when
+isoneutral mixing is used, both mixing coefficients are increased
+by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$
+to account for the vertical second derivative of \eqref{Eq_tra_ldf_iso}.
+
+At the surface and bottom boundaries, the turbulent fluxes of
+momentum, heat and salt must be specified. At the surface they
+are prescribed from the surface forcing (see \S\ref{TRA_sbc}),
+whilst at the bottom they are set to zero for heat and salt unless
+a geothermal flux forcing is prescribed as a bottom boundary
+condition (\S\ref{TRA_bbc}).
The large eddy coefficient found in the mixed layer together with high
vertical resolution implies a too restrictive constraint on the time step in
explicit time stepping case (\np{ln\_zdfexp}=True). Therefore, the default implicit time stepping is generally preferred for the vertical diffusion as it overcomes the stability
constraint. A forward time differencing scheme (\np{ln\_zdfexp}=T) using a time splitting technique (\np{n\_zdfexp} $> 1$) is provided as an alternative. Namelist variables
\np{ln\_zdfexp} and \np{n\_zdfexp} apply to both tracers and dynamics.
+vertical resolution implies that in the case of explicit time stepping
+(\np{ln\_zdfexp}=.true.) there would be too restrictive a constraint on
+the time step. Therefore, the default implicit time stepping is preferred
+for the vertical diffusion since it overcomes the stability constraint.
+A forward time differencing scheme (\np{ln\_zdfexp}=.true.) using a time
+splitting technique (\np{n\_zdfexp} $> 1$) is provided as an alternative.
+Namelist variables \np{ln\_zdfexp} and \np{n\_zdfexp} apply to both
+tracers and dynamics.
% ================================================================
@@ 501,5 +664,6 @@
% surface boundary condition
% 
\subsection{surface boundary condition (\mdl{trasbc})}
+\subsection [Surface boundary condition (\textit{trasbc})]
+ {Surface boundary condition (\mdl{trasbc})}
\label{TRA_sbc}
@@ 510,29 +674,33 @@
equivalent; the forcing terms in trasbc are the surface fluxes divided by
the thickness of the top model layer. Following \citet{Roullet2000} the
forcing on an ocean tracer, $c$, can be split into two parts: $F_{ext}^C $, the
+forcing on an ocean tracer, $c$, can be split into two parts: $F_{ext}$, the
flux of tracer crossing the sea surface and not linked with the water
exchange d at the surface with the atmosphere, and $F_{wf}^C$ the forcing
on the concentration associated with the water flux. The latter forcing has
also two components: a direct effect of change in concentration associated
with the tracer carried by the water flux, and an indirect concentration/dilution effect :
+exchange with the atmosphere, $F_{wf}^d$, and $F_{wf}^i$ the forcing
+on the tracer concentration associated with this water exchange.
+The latter forcing has two components: a direct effect of change
+in concentration associated with the tracer carried by the water flux,
+and an indirect concentration/dilution effect :
\begin{equation*}
\begin{split}
F^C &= F_{ext} + F_{wf}^d +F_{wf}^i \\
\\
&= F_{ext}  \left( c_E \, E  c_p \,P  c_R \,R \right) +c\left( EPR \right)
\end{split}
\end{equation*}
Two cases must be distinguished, the nonlinear free surface case (\key{vvl} defined) and the linear free surface case. The first case is simpler, because the indirect concentration/dilution effect is naturally taken into
account by letting the vertical scale factors vary in time. The salinity of
water exchanged at the surface is assumed to be zero, so there is no salt
flux at the free surface, excepted in the presence of sea ice. The heat flux
at the free surface is the sum of $F_{ext}$, the direct heating/cooling
(by the total nonpenetrative heat flux) and $F_{wf}^e$ the heat carried by
the water exchanged through the surface (evaporation, precipitation,
runoff). The temperature of precipitations is not well known. In the model
we assume that this water has the same temperature as the sea surface
temperature, The resulting forcing terms for temperature T and salinity S
are:
+\gmcomment{add here a description of the variable names used in the above equation}
+
+Two cases must be distinguished, the nonlinear free surface case
+(\key{vvl} is defined) and the linear free surface case. The first case
+is simpler, because the indirect concentration/dilution effect is naturally
+taken into account by letting the vertical scale factors vary in time.
+The salinity of water exchanged at the surface is assumed to be zero,
+so there is no salt flux at the free surface, except in the presence of sea ice.
+The heat flux at the free surface is the sum of $F_{ext}$, the direct
+heating/cooling (by the total nonpenetrative heat flux) and $F_{wf}^e$
+the heat carried by the water exchanged through the surface (evaporation,
+precipitation, runoff). The temperature of precipitation is not well known.
+In the model we assume that this water has the same temperature as
+the sea surface temperature. The resulting forcing terms for temperature
+T and salinity S are:
\begin{equation} \label{Eq_tra_forcing}
\begin{aligned}
@@ 544,9 +712,20 @@
\end{equation}
where EMP is the freshwater budget (evaporation minus precipitation minus river runoff) which forces the ocean volume, $Q_{ns}$ is the nonpenetrative part of the net surface heat flux (difference between the total surface heat flux and the fraction of the short wave flux that penetrates in the water column), the product EMP$_S\;.\left. S \right_{k=1}$ is the iceocean salt flux, and $\left. S\right_{k=1}$ is the sea surface salinity (\textit{SSS}). The total salt content is conserved in this formulation (excepted for the effect of the Asselin filter).
%AMT note: the iceocean flux had been forgotten in the first release of the key_vvl option,
%AMT has this been corrected in the code?

In the second case (linear free surface), the vertical scale factors are fixed in time so that the concentration/dilution effect must be added in trasbc. Because of the hypothesis made for the temperature of precipitation and runoffs, for temperature $F_{wf}^e +F_{wf}^i =0$. The resulting forcing term for temperature is:
+where EMP is the freshwater budget (evaporation minus precipitation
+minus river runoff) which forces the ocean volume, $Q_{ns}$ is the
+nonpenetrative part of the net surface heat flux (difference between
+the total surface heat flux and the fraction of the short wave flux that
+penetrates into the water column), the product EMP$_S\;.\left. S \right_{k=1}$
+is the iceocean salt flux, and $\left. S\right_{k=1}$ is the sea surface
+salinity (\textit{SSS}). The total salt content is conserved in this formulation
+(except for the effect of the Asselin filter).
+
+%AMT note: the iceocean flux had been forgotten in the first release of the key_vvl option, has this been corrected in the code?
+
+In the second case (linear free surface), the vertical scale factors are
+fixed in time so that the concentration/dilution effect must be added in
+the \mdl{trasbc} module. Because of the hypothesis made for the
+temperature of precipitation and runoffs, $F_{wf}^e +F_{wf}^i =0$
+for temperature. The resulting forcing term for temperature is:
\begin{equation} \label{Eq_tra_forcing_q}
@@ 554,32 +733,42 @@
\end{equation}
The salinity forcing is still given by \eqref{Eq_tra_forcing} but the definition of EMP$_S$ is
different: it is the total surface freshwater budget (evaporation minus
precipitation minus river runoff plus the rate of change of the sea ice
thickness). The total salt content is not exactly conserved (\citet{Roullet2000}, see also
\S\ref{PE_free_surface}).
+The salinity forcing is still given by \eqref{Eq_tra_forcing} but the
+definition of EMP$_S$ is different: it is the total surface freshwater
+budget (evaporation minus precipitation minus river runoff plus
+the rate of change of the sea ice thickness). The total salt content
+is not exactly conserved (\citet{Roullet2000}.
+See also \S\ref{PE_free_surface}).
In the case of the rigid lid approximation, the surface salinity forcing $F^s$
is also expressed by \eqref{Eq_tra_forcing} but now the global integral of the product
EMP*S is not compensated by the advection of fluid through the top level: in
the rigid lid case (contrary to the linear free surface), because \textit{w(k=1) = 0}. As a
result, even if the budget of \textit{EMP} is zero in average over the whole ocean
domain, the associated salt flux is not, as seasurface salinity and \textit{EMP} are
intrinsically correlated (high \textit{SSS} are found where evaporation is strong while
low \textit{SSS} is usually associated with high precipitation or river runoff input).

The $Q_{ns} $ and \textit{EMP} fields are defined and updated in \mdl{sbcmod} module (see
\S\ref{SBC}).
+is also expressed by \eqref{Eq_tra_forcing}, but now the global integral of
+the product of EMP and S, is not compensated by the advection of fluid
+through the top level: this is because in the rigid lid case \textit{w(k=1) = 0}
+(in contrast to the linear free surface case). As a result, even if the budget
+of \textit{EMP} is zero on average over the whole ocean domain, the
+associated salt flux is not, since seasurface salinity and \textit{EMP} are
+intrinsically correlated (high \textit{SSS} are found where evaporation is
+strong whilst low \textit{SSS} is usually associated with high precipitation
+or river runoff).
+
+The $Q_{ns} $ and \textit{EMP} fields are defined and updated in the
+\mdl{sbcmod} module (see \S\ref{SBC}).
% 
% Solar Radiation Penetration
% 
\subsection{Solar Radiation Penetration (\mdl{traqsr})}
+\subsection [Solar Radiation Penetration (\textit{traqsr})]
+ {Solar Radiation Penetration (\mdl{traqsr})}
\label{TRA_qsr}
%namqsr
+%namqsr
\namdisplay{namqsr}
%
When the penetrative solar radiation option is used (\np{ln\_flxqsr}=T, the solar radiation penetrates the top few meters of the ocean, otherwise all the heat flux is absorbed in the first ocean level (\np{ln\_flxqsr}=F). A term is thus added to the time evolution equation of temperature \eqref{Eq_PE_tra_T} while the surface boundary condition is modified to take into account only the nonpenetrative part of the surface heat flux:
+When the penetrative solar radiation option is used (\np{ln\_flxqsr}=.true.),
+the solar radiation penetrates the top few meters of the ocean, otherwise
+all the heat flux is absorbed in the first ocean level (\np{ln\_flxqsr}=.false.).
+Thus, in the former case a term is added to the time evolution equation of
+temperature \eqref{Eq_PE_tra_T} whilst the surface boundary condition is
+modified to take into account only the nonpenetrative part of the surface
+heat flux:
\begin{equation} \label{Eq_PE_qsr}
\begin{split}
@@ 594,23 +783,50 @@
\end{equation}
A formulation including extinction coefficients is assumed for the downward irradiance $I$
\citep{Paulson1977}:
+A formulation involving two extinction coefficients is assumed for the
+downward irradiance $I$ \citep{Paulson1977}:
\begin{equation} \label{Eq_traqsr_iradiance}
I(z) = Q_{sr} \left[Re^{z / \xi_1} + \left( 1R\right) e^{z / \xi_2} \right]
\end{equation}
where $Q_{sr}$ is the penetrative part of the surface heat flux,
$\xi_1$ and $\xi_2$ are two extinction length scales and $R$ determines the relative
contribution of the two terms. The default values used correspond to a Type
I water in Jerlov's [1968] classification: $\xi_1 = 0.35m$, $\xi_2 = 0.23m$ and
$R = 0.58$ ((corresponding to \np{xsi1}, \np{xsi2} and \np{rabs} namelist parameters, respectively). $I$ is masked (no flux through the ocean bottom), so all the solar radiation that reaches the last ocean level is absorbed in that level. The trend in \eqref{Eq_tra_qsr} associated with the penetration of the solar radiation is added to the temperature trend and the surface heat flux modified in routine \mdl{traqsr}. Note that in $z$coordinates, the depth of $T$levels depends on the single variable $k$. A one dimensional array of the coefficients $gdsr(k) = Re^{z_w (k)/\xi_1} + (1R)e^{z_w (k)/\xi_2}$ can then be computed once and saved in central memory. Moreover \textit{nksr}, the level at which $gdrs$ becomes negligible (less than the computer precision) is computed once and the trend associated with the penetration of the solar radiation is only added until that level. At last, note that when the ocean is shallow (< 200~m), the part of the solar radiation can reach the ocean floor. In this case, we have chosen that all the radiation is absorbed at the last ocean level ($i.e.$ $I_w$ is masked).

When coupling with a biology model (PISCES or LOBSTER), it is possible to calculate the light attenuation using information from the biology model. At the time of this writing, reading the light attenuation from a file is not implemented yet in the reference version.

\colorbox{yellow}{case 4 bands and biocoupling to add !!!}
+$\xi_1$ and $\xi_2$ are two extinction length scales and $R$
+determines the relative contribution of the two terms.
+The default values used correspond to a Type I water in Jerlov's [1968]
+%
+\gmcomment : Jerlov reference to be added
+%
+classification: $\xi_1 = 0.35m$, $\xi_2 = 0.23m$ and $R = 0.58$
+(corresponding to \np{xsi1}, \np{xsi2} and \np{rabs} namelist parameters,
+respectively). $I$ is masked (no flux through the ocean bottom),
+so all the solar radiation that reaches the last ocean level is absorbed
+in that level. The trend in \eqref{Eq_tra_qsr} associated with the
+penetration of the solar radiation is added to the temperature trend,
+and the surface heat flux is modified in routine \mdl{traqsr}.
+Note that in the $z$coordinate, the depth of $T$levels depends
+on the single variable $k$. A one dimensional array of the coefficients
+$gdsr(k) = Re^{z_w (k)/\xi_1} + (1R)e^{z_w (k)/\xi_2}$ can then
+be computed once and saved in memory. Moreover \textit{nksr},
+the level at which $gdrs$ becomes negligible (less than the
+computer precision) is computed once, and the trend associated
+with the penetration of the solar radiation is only added until that level.
+Finally, note that when the ocean is shallow (< 200~m), part of the
+solar radiation can reach the ocean floor. In this case, we have
+chosen that all remaining radiation is absorbed in the last ocean
+level ($i.e.$ $I_w$ is masked).
+
+When coupling with a biological model (for example PISCES or LOBSTER),
+it is possible to calculate the light attenuation using information from
+the biology model. Without biological model, it is still possible to introduce
+a horizontal variation of the light attenuation by using the observed ocean
+surface color. At the time of writing, the latter has not been implemented
+ in the reference version.
+%
+\gmcomment{ {yellow}{case 4 bands and biocoupling to add !!!} }
+%
% 
% Bottom Boundary Condition
% 
\subsection{Bottom Boundary Condition (\mdl{trabbc} + \key{bbc})}
+\subsection [Bottom Boundary Condition (\textit{trabbc}  \key{bbc})]
+ {Bottom Boundary Condition (\mdl{trabbc}  \key{bbc})}
\label{TRA_bbc}
%nambbc
@@ 620,31 +836,33 @@
\begin{figure}[!t] \label{Fig_geothermal} \begin{center}
\includegraphics[width=1.0\textwidth]{./Figures/Fig_TRA_geoth.pdf}
\caption{Geothermal Heat flux (in $mW.m^{2}$) as inferred from the age of the sea floor and the formulae of \citet{Stein1992}.}
+\caption{Geothermal Heat flux (in $mW.m^{2}$) as inferred from the age
+of the sea floor and the formulae of \citet{Stein1992}.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Usually it is considered that there is no exchange of heat nor salt through
the ocean bottom, i.e. a no flux boundary condition is applied on active
tracers at the bottom. This is the default option in NEMO, and it is
implemented using the masking technique. Nevertheless, there exists a
nonzero heat flux across the seafloor that is associated with the solid
earth cooling. This flux is weak compared with surface fluxes  a mean
global value of $\sim0.1\;W/m^2$ \citep{Stein1992}  but it is
systematically positive and it acts only on the densest water masses. Taking
this flux into account in a global ocean model increases by a few Sverdrups
+Usually it is assumed that there is no exchange of heat or salt through
+the ocean bottom, $i.e.$ a no flux boundary condition is applied on active
+tracers at the bottom. This is the default option in \NEMO, and it is
+implemented using the masking technique. Hoever, there is a
+nonzero heat flux across the seafloor that is associated with solid
+earth cooling. This flux is weak compared to surface fluxes (a mean
+global value of $\sim0.1\;W/m^2$ \citep{Stein1992}), but it is
+systematically positive and acts on the densest water masses. Taking
+this flux into account in a global ocean model increases
the deepest overturning cell (i.e. the one associated with the Antarctic
Bottom Water).

The presence or not of a geothermal heating is controlled by the namelist
parameter \np{ngeo\_flux}. Set to 1, a constant geothermal heatingis
introducted which value is given by the \np{ngeo\_flux\_const}, also a
namelist parameter. Set to 2, a spatially varying geothermal heat flux is
introducted which is provided in the geothermal\_heating.nc NetCDF
file (Fig.\ref{Fig_geothermal}).
+Bottom Water) by a few Sverdrups.
+
+The presence or not of geothermal heating is controlled by the namelist
+parameter \np{ngeo\_flux}. If this parameter is set to 1, a constant
+geothermal heating is introduced whose value is given by the
+\np{ngeo\_flux\_const}, which is also a namelist parameter. If it is set to 2,
+a spatially varying geothermal heat flux is introduced which is provided
+in the geothermal\_heating.nc NetCDF file (Fig.\ref{Fig_geothermal}).
% ================================================================
% Bottom Boundary Layer
% ================================================================
\section{Bottom Boundary Layer (\mdl{trabbl} + \key{bbl\_diff} or \key{bbl\_adv})}
+\section [Bottom Boundary Layer (\textit{trabbl}, \textit{trabbl\_adv} )]
+ {Bottom Boundary Layer (\mdl{trabbl}, \mdl{trabbl\_adv})}
\label{TRA_bbl}
%nambbl
@@ 652,62 +870,100 @@
%
In zcoordinate configuration, the bottom topography is represented as a
+In a $z$coordinate configuration, the bottom topography is represented by a
series of discrete steps. This is not adequate to represent gravity driven
downslope flows. Such flows arise downstream of sills such as the Strait of
Gibraltar, Bab El Mandeb, or Denmark Strait, where dense water formed in
marginal seas flows into a basin filled with less dense water. The amount of
entrainment that occurs in those gravity plumes is critical to determine the
density and volume flux of the densest waters of the ocean, such as the
Antarctic Bottom water, or the North Atlantic Deep Water. $z$coordinate
models tend to overestimate the entrainment because the gravity flow is
+entrainment that occurs in these gravity plumes is critical in determining the
+density and volume flux of the densest waters of the ocean, such as
+Antarctic Bottom Water, or North Atlantic Deep Water. $z$coordinate
+models tend to overestimate the entrainment, because the gravity flow is
mixed down vertically by convection as it goes ``downstairs'' following the
step topography, sometimes over a thickness much larger than the thickness
of the observed gravity plume. A similar problem occurs in $s$coordinate when
+of the observed gravity plume. A similar problem occurs in the $s$coordinate when
the thickness of the bottom level varies in large proportions downstream of
a sill \citep{Willebrand2001}, and the thickness of the plume is not
resolved.

The idea of the bottom boundary layer parameterization first introduced by
+a sill \citep{Willebrand2001}, and the thickness of the plume is not resolved.
+
+The idea of the bottom boundary layer (BBL) parameterization first introduced by
\citet{BeckDos1998} is to allow a direct communication between
two adjacent bottom cells at varying level, whenever the densest water is
located above the less dense water. The communication can be by diffusive
fluxes (diffusive BBL), advective fluxes (advective BBL) or both. Only
tracers are modified, not the velocities. Implementing a BBL
parameterization for momentum is a more complex problem because of the
pressure gradient errors.
+two adjacent bottom cells at different levels, whenever the densest water is
+located above the less dense water. The communication can be by a diffusive
+(diffusive BBL), advective fluxes (advective BBL), or both. In the current
+implementation of the BBL, only the tracers are modified, not the velocities.
+Furthermore, it only connects ocean bottom cells, and therefore does not include
+the improvment proposed by \citet{Campin_Goosse_Tel99}.
% 
% Diffusive BBL
% 
\subsection{Diffusive Bottom Boundary layer (\mdl{trabbl})}
+\subsection{Diffusive Bottom Boundary layer (\key{bbl\_diff})}
\label{TRA_bbl_diff}
The lateral diffusivity $A_l^\sigma $ in the BBL can be prescribed with a
spatial dependence, e.g., in the conditional form
\begin{equation} \label{Eq_tra_bbl}
+When applying sigmadiffusion (\key{trabbl} is defined), the diffusive flux between
+two adjacent cells living at the ocean bottom is given by
+\begin{equation} \label{Eq_tra_bbl_diff}
+{\rm {\bf F}}_\sigma=A_l^\sigma \; \nabla_\sigma T
+\end{equation}
+with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells,
+and $A_l^\sigma $ the lateral diffusivity in the BBL. Following \citet{BeckDos1998},
+the latter is prescribed with a spatial dependence, $e.g.$ in the conditional form
+\begin{equation} \label{Eq_tra_bbl_coef}
A_l^\sigma (i,j,t)=\left\{ {\begin{array}{l}
 \mbox{large}\quad if\;\nabla \rho \cdot \nabla H<0 \\
+ A_{bbl} \quad \quad \mbox{if} \quad \nabla_\sigma \rho \cdot \nabla H<0 \\
\\
0\quad \quad \;\,\mbox{otherwise} \\
\end{array}} \right.
\end{equation}

The large value of the coefficient when the diffusive BBL is active is given
by the namelist parameter \np{atrbbl.}
+where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist
+parameter \np{atrbbl}. $A_{bbl}$ is usually set to a value much larger
+than the one used on lateral mixing in open ocean.
+Note that in practice, \eqref{Eq_tra_bbl_coef} constraint is applied
+separately in the two horizontal directions, and the density gradient in
+\eqref{Eq_tra_bbl_coef} is evaluated at $\overline{H}^i$ ($\overline{H}^j$)
+using the along bottom mean temperature and salinity.
% 
% Advective BBL
% 
\subsection{Advective Bottom Boundary Layer (\mdl{trabb\_adv})}
+\subsection {Advective Bottom Boundary Layer (\key{bbl\_adv})}
\label{TRA_bbl_adv}
Implemented in NEMO v2.

\colorbox{yellow} {Documentation to be added here }
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!t] \label{Fig_bbl} \begin{center}
+\includegraphics[width=1.0\textwidth]{./Figures/Fig_BBL_adv.pdf}
+\caption{Advective Bottom Boundary Layer.}
+\end{center} \end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+%%%gmcomment : this section has to be really written
+
+The advective BBL is in fact not only an advective one but include a diffusive
+component as we chose an upstream scheme to perform the advection within
+the BBL. The associated diffusion only act in the stream direction and is
+proportional to the velocity.
+
+When applying sigmaadvection (\key{trabbl\_adv} defined), the advective
+flux between two adjacent cells living at the ocean bottom is given by
+\begin{equation} \label{Eq_tra_bbl_fadv}
+{\rm {\bf F}}_\sigma={\rm {\bf U}}_h^\sigma \; \overline{T}^\sigma
+\end{equation}
+with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells,
+and $A_l^\sigma$ the lateral diffusivity in the BBL. Following \citet{BeckDos1998},
+the latter is prescribed with a spatial dependence, $e.g.$ in the conditional form
+\begin{equation} \label{Eq_tra_bbl_Aadv}
+A_l^\sigma (i,j,t)=\left\{ {\begin{array}{l}
+ A_{bbl} \quad \quad \mbox{if} \quad \nabla_\sigma \rho \cdot \nabla H<0
+ \quad \quad \mbox{and} \quad {\rm {\bf U}}_h \cdot \nabla H<0 \\
+ \\
+ 0\quad \quad \;\,\mbox{otherwise} \\
+ \end{array}} \right.
+\end{equation}
% ================================================================
% Tracer damping
% ================================================================
\section{Tracer damping (\mdl{tradmp})}
+\section [Tracer damping (\textit{tradmp})]
+ {Tracer damping (\mdl{tradmp})}
\label{TRA_dmp}
%namdmp
@@ 715,6 +971,6 @@
%
In some applications it can be useful to add a Newtonian damping term in the
temperature and salinity equations:
+In some applications it can be useful to add a Newtonian damping term
+into the temperature and salinity equations:
\begin{equation} \label{Eq_tra_dmp}
\begin{split}
@@ 724,37 +980,55 @@
\end{split}
\end{equation}
where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$ are given temperature and salinity fields (usually a climatology). The restoring term is added when \key{tradmp} is defined. It also requires that both \key{temdta} and \key{saldta} are defined ($i.e.$ that $T_o$ and $S_o$ are read). The restoring coefficient $S_o$ is a threedimensional array initialized by the user in
\rou{dtacof} routine also located in \mdl{tradmp}.

The two main cases in which \eqref{Eq_tra_dmp} is used are \textit{(a)} the specification of
the boundary conditions along artificial walls of a limited domain basin and
\textit{(b)} the computation of the velocity field associated with a given $T$$S$ field
(for example to build the initial state of a prognostic simulation, or to
use the resulting velocity field for a passive tracer study). The first case
applies to regional models that have artificial walls instead of open
boundaries. In the vicinity of these walls, $S_o$ takes large values
(equivalent to a few day time scale) whereas it is zero in the interior of
the model domain. The second case corresponds to the use of the robust
diagnostic method \citep{Sarmiento1982}. It allows to find the velocity
field consistent with the model dynamics while having a $T$$S$ field close to a
given climatology field ($T_o S_o$). The time scale associated with
$S_o$ is generally not a constant but spatially varying in order to respect
some considerations. For example, it is usually set to zero in the mixed
layer (defined either on a density or $S_o$ criterion) \citep{Madec1996} and in the equatorial region \citep{Reverdin1991, Fujio1991, MartiTh1992} as those two regions have a small time scale of adjustment,
while smaller $S_o$ are used in the deep ocean where the typical time scale
is long \citep{Sarmiento1982}. In addition it is reduced (and even
zero) along the western boundary to allow the model to reconstruct its own
western boundary structure in equilibrium with its physics. The choice of a
Newtonian damping acting in the mixed layer or not is controlled by \np{nmldmp}
(\textbf{namelist} \np{nmldmp}parameter).

The robust diagnostic method is very efficient to prevent the temperature drift in intermediate waters but it produces artificial sources of heat and salt within the ocean. It has also undesirable effects on the ocean convection. It tends to prevent deep convection and subsequent deepwater formation by stabilising too much the water columns.

An example of computation of $S_o$ for robust diagnostic experiments with the ORCA2 model is provided in the \mdl{tradmp} module (subroutines \rou{dtacof} and \rou{cofdis} which compute coefficient and the distance to the bathymetry, respectively). Those routines are provided as examples and can be customised by the user.
+where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$
+are given temperature and salinity fields (usually a climatology).
+The restoring term is added when \key{tradmp} is defined.
+It also requires that both \key{temdta} and \key{saldta} are defined
+($i.e.$ that $T_o$ and $S_o$ are read). The restoring coefficient
+$S_o$ is a threedimensional array initialized by the user in routine
+\rou{dtacof} also located in module \mdl{tradmp}.
+
+The two main cases in which \eqref{Eq_tra_dmp} is used are \textit{(a)}
+the specification of the boundary conditions along artificial walls of a
+limited domain basin and \textit{(b)} the computation of the velocity
+field associated with a given $T$$S$ field (for example to build the
+initial state of a prognostic simulation, or to use the resulting velocity
+field for a passive tracer study). The first case applies to regional
+models that have artificial walls instead of open boundaries.
+In the vicinity of these walls, $S_o$ takes large values (equivalent to
+a time scale of a few days) whereas it is zero in the interior of the
+model domain. The second case corresponds to the use of the robust
+diagnostic method \citep{Sarmiento1982}. It allows us to find the velocity
+field consistent with the model dynamics whilst having a $T$$S$ field
+close to a given climatological field ($T_o S_o$). The time scale
+associated with $S_o$ is generally not a constant but spatially varying
+in order to respect other properties. For example, it is usually set to zero
+in the mixed layer (defined either on a density or $S_o$ criterion)
+\citep{Madec1996} and in the equatorial region
+\citep{Reverdin1991, Fujio1991, MartiTh1992} since these two regions
+have a short time scale of adjustment; while smaller $S_o$ are used
+in the deep ocean where the typical time scale is long \citep{Sarmiento1982}.
+In addition the time scale is reduced (even to zero) along the western
+boundary to allow the model to reconstruct its own western boundary
+structure in equilibrium with its physics. The choice of a
+Newtonian damping acting in the mixed layer or not is controlled by
+namelist parameter \np{nmldmp}.
+
+The robust diagnostic method is very efficient in preventing temperature
+drift in intermediate waters but it produces artificial sources of heat and salt
+within the ocean. It also has undesirable effects on the ocean convection.
+It tends to prevent deep convection and subsequent deepwater formation,
+by stabilising the water column too much.
+
+An example of the computation of $S_o$ for robust diagnostic experiments
+with the ORCA2 model is provided in the \mdl{tradmp} module
+(subroutines \rou{dtacof} and \rou{cofdis} which compute the coefficient
+and the distance to the bathymetry, respectively). These routines are
+provided as examples and can be customised by the user.
% ================================================================
% Tracer time evolution
% ================================================================
\section{Tracer time evolution (\mdl{tranxt})}
+\section [Tracer time evolution (\textit{tranxt})]
+ {Tracer time evolution (\mdl{tranxt})}
\label{TRA_nxt}
%namdom
@@ 762,5 +1036,7 @@
%
The general framework of dynamics time stepping is a leapfrog scheme, $i.e.$ a three level centred time scheme associated with a Asselin time filter (cf. \S\ref{DOM_nxt}):
+The general framework for tracer time stepping is a leapfrog scheme,
+$i.e.$ a three level centred time scheme associated with a Asselin time
+filter (cf. \S\ref{DOM_nxt}):
\begin{equation} \label{Eq_tra_nxt}
\begin{split}
@@ 771,17 +1047,21 @@
\end{equation}
where $\text{RHS}_T$ is the right hand side of the temperature equation, the subscript $f$ denotes
filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is initialized as \np{atfp} (\textbf{namelist} parameter). Its default value is \np{atfp=0.1}.

When the vertical mixing is solved implicitly, the update of the next tracer
fields is done in module \mdl{trazdf}. In that case only the swap of arrays
and the Asselin filtering is done in \mdl{tranxt} module.

In order to prepare the computation of the next time step, a swap of tracer arrays is performed: $T^{t\Delta t} = T^t$ and $T^t = T_f$.
+where $\text{RHS}_T$ is the right hand side of the temperature equation,
+the subscript $f$ denotes filtered values and $\gamma$ is the Asselin
+coefficient. $\gamma$ is initialized as \np{atfp} (\textbf{namelist} parameter).
+Its default value is \np{atfp=0.1}.
+
+When the vertical mixing is solved implicitly, the update of the \textit{next} tracer
+fields is done in module \mdl{trazdf}. In this case only the swapping of arrays
+and the Asselin filtering is done in the \mdl{tranxt} module.
+
+In order to prepare for the computation of the \textit{next} time step,
+a swap of tracer arrays is performed: $T^{t\Delta t} = T^t$ and $T^t = T_f$.
% ================================================================
% Equation of State (eosbn2)
% ================================================================
\section{Equation of State (\mdl{eosbn2}) }
+\section [Equation of State (\textit{eosbn2}) ]
+ {Equation of State (\mdl{eosbn2}) }
\label{TRA_eosbn2}
%nameos
@@ 795,10 +1075,39 @@
\label{TRA_eos}
It is necessary to know the equation of state for the ocean very accurately to determine stability properties (especially the BruntVais\"{a}l\"{a} frequency), particularly in the deep ocean. The ocean density is a non linear empirical function of \textit{in situ }temperature, salinity and pressure. The reference is the equation of state defined by the Joint Panel on Oceanographic Tables
and Standards \citep{UNESCO1983}. It was the standard equation of state used in early releases of OPA. Even though this computation is fully vectorised, it is quite time consuming ($15$ to $20${\%} of the total CPU time) as it requires the prior computation of the \textit{in situ} temperature from the model \textit{potential} temperature using the \citep{Bryden1973} polynomial for adiabatic lapse rate and a $4^th$ order RungeKutta integration scheme. Since OPA6, we have chosen the \citet{JackMcD1995} equation of state for seawater. It allows the computation of the \textit{in situ} ocean density directly as a function of \textit{potential} temperature relative to the sea surface (an OPA variable), the practical salinity (another OPA variable) and the pressure (assuming no pressure variation along geopotential surfaces, i.e. the pressure in decibars is
approximated by the depth in meters). Both the \citet{UNESCO1983} and \citet{JackMcD1995} equations of state have the same expression except that the values of the various coefficients have been adjusted by \citet{JackMcD1995} in order to use directly the \textit{potential} temperature instead of the \textit{in situ} one. This reduces the CPU time of the in situ density computation to about $3${\%} of the total CPU time, while maintaining a quite accurate equation of state.

In the computer code, a \textit{true} density, $d$, is computed, i.e. the ratio of seawater volumic mass over $\rho_o$, a reference volumic mass (\textit{rau0} defined in \mdl{phycst}, usually $rau0= 1,020~Kg/m^3$). The default option (\np{neos}=0) is the \citet{JackMcD1995} equation of state. It is highly recommended to use it. Nevertheless, for process studies, it is often convenient to use a linear approximation of the density$^{\ast}$\footnote{$^{\ast }$ With the linear equation of state there is no longer
a distinction between \textit{in situ} and \textit{potential} density. Cabling and thermobaric effects are also removed.}. Two linear formulations are available: a function of $T$ only (\np{neos}=1) and a function of both $T$ and $S$ (\np{neos}=2):
+It is necessary to know the equation of state for the ocean very accurately
+to determine stability properties (especially the BruntVais\"{a}l\"{a} frequency),
+particularly in the deep ocean. The ocean density is a non linear empirical
+function of \textit{in situ }temperature, salinity and pressure. The reference
+equation of state is that defined by the Joint Panel on Oceanographic Tables
+and Standards \citep{UNESCO1983}. It was the standard equation of state
+used in early releases of OPA. However, even though this computation is
+fully vectorised, it is quite time consuming ($15$ to $20${\%} of the total
+CPU time) since it requires the prior computation of the \textit{in situ}
+temperature from the model \textit{potential} temperature using the
+\citep{Bryden1973} polynomial for adiabatic lapse rate and a $4^th$ order
+RungeKutta integration scheme. Since OPA6, we have used the
+\citet{JackMcD1995} equation of state for seawater instead. It allows the
+computation of the \textit{in situ} ocean density directly as a function of
+\textit{potential} temperature relative to the surface (an \NEMO variable),
+the practical salinity (another \NEMO variable) and the pressure (assuming no
+pressure variation along geopotential surfaces, i.e. the pressure in decibars is
+approximated by the depth in meters). Both the \citet{UNESCO1983} and \citet{JackMcD1995} equations of state have exactly the same except that
+the values of the various coefficients have been adjusted by \citet{JackMcD1995}
+in order to directly use the \textit{potential} temperature instead of the
+\textit{in situ} one. This reduces the CPU time of the in situ density computation
+to about $3${\%} of the total CPU time, while maintaining a quite accurate
+equation of state.
+
+In the computer code, a \textit{true} density $d$ is computed, $i.e.$ the ratio
+of seawater volumic mass to $\rho_o$, a reference volumic mass (\textit{rau0}
+defined in \mdl{phycst}, usually $rau0= 1,020~Kg/m^3$). The default option
+(namelist prameter \np{neos}=0) is the \citet{JackMcD1995} equation of state.
+Its use is highly recommended. However, for process studies, it is often
+convenient to use a linear approximation of the density$^{\ast}$
+\footnote{$^{\ast }$ With the linear equation of state there is no longer
+a distinction between \textit{in situ} and \textit{potential} density. Cabling
+and thermobaric effects are also removed.}.
+Two linear formulations are available: a function of $T$ only (\np{neos}=1)
+and a function of both $T$ and $S$ (\np{neos}=2):
\begin{equation} \label{Eq_tra_eos_linear}
\begin{aligned}
@@ 807,6 +1116,10 @@
\end{aligned}
\end{equation}
where $\alpha $ and $\beta $ are the thermal and haline expansion coefficients, and $\rho_o$, the reference volumic mass, $rau0$. $\alpha $ and $\beta$ can be modified through \np{ralpha} and \np{rbeta} namelist parameters). Note that when $d$ is a function of $T$ only (\np{neos}=1), the salinity is a passive tracer and can be used as such.

+where $\alpha$ and $\beta$ are the thermal and haline expansion
+coefficients, and $\rho_o$, the reference volumic mass, $rau0$.
+($\alpha$ and $\beta$ can be modified through the \np{ralpha} and
+\np{rbeta} namelist parameters). Note that when $d$ is a function
+of $T$ only (\np{neos}=1), the salinity is a passive tracer and can be
+used as such.
% 
@@ 816,36 +1129,63 @@
\label{TRA_bn2}
An accurate computation of the ocean stability (i.e. of $N$, the bruntVais\"{a}l\"{a} frequency) is of paramount importance as it is used in several ocean parameterisations (namely TKE, KPP, Richardson number dependent vertical diffusion, enhanced vertical diffusion, nonpenetrative convection, isoneutral diffusion). In particular, one must be aware that $N^2$ has to be computed with an \textit{in situ} reference. The expression of $N^2$ depends on the type of equation of state used (\np{neos} namelist parameter).
+An accurate computation of the ocean stability (i.e. of $N$, the bruntVais\"{a}l\"{a}
+ frequency) is of paramount importance as it is used in several ocean
+ parameterisations (namely TKE, KPP, Richardson number dependent
+ vertical diffusion, enhanced vertical diffusion, nonpenetrative convection,
+ isoneutral diffusion). In particular, one must be aware that $N^2$ has to
+ be computed with an \textit{in situ} reference. The expression for $N^2$
+ depends on the type of equation of state used (\np{neos} namelist parameter).
For \np{neos}=0 (\citet{JackMcD1995} equation of state), the \citet{McDougall1987}
polynomial expression is used with the pressure in decibar approximated by
the depth in meters:
\begin{multline} \label{Eq_tra_bn2}
N^2 = \frac{g}{e_{3w}} \; \beta ( \overline{T}^{\,k+1/2},\widetilde{S},z_w ) \\
 \left\{ \alpha / \beta ( \overline{T}^{\,k+1/2},\widetilde{S},z_w )
 \ \delta_{k+1/2}[T]  \delta_{k+1/2}[S]
 \right\}
\end{multline}
where $T$ is the \textit{potential} temperature, $\widetilde{S}=\overline{S}^{\,k+1/2}  35.$ a salinity anomaly, and $\alpha$ ($\beta\,$) the thermal (haline) expansion coefficient. Both $\alpha$ and $\beta$ depend on \textit{potential} temperature, salinity which are averaged at $w$points prior to the computation.

When a linear equation of state is used (\np{neos}=1 or 2, \eqref{Eq_tra_bn2} reduces to:
+polynomial expression is used (with the pressure in decibar approximated by
+the depth in meters):
+\begin{equation} \label{Eq_tra_bn2}
+N^2 = \frac{g}{e_{3w}} \; \beta \
+ \left( \alpha / \beta \ \delta_{k+1/2}[T]  \delta_{k+1/2}[S] \right)
+\end{equation}
+where $\alpha$ ($\beta$) is the thermal (haline) expansion coefficient.
+They are a function of
+$\overline{T}^{\,k+1/2},\widetilde{S}=\overline{S}^{\,k+1/2}  35.$,
+and $z_w$, with $T$ the \textit{potential} temperature and
+$\widetilde{S}$ a salinity anomaly.
+Note that both $\alpha$ and $\beta$ depend on \textit{potential}
+temperature and salinity which are averaged at $w$points prior
+to the computation instead of being computed at $T$points and
+then averaged to $w$points.
+
+When a linear equation of state is used (\np{neos}=1 or 2,
+\eqref{Eq_tra_bn2} reduces to:
\begin{equation} \label{Eq_tra_bn2_linear}
N^2 = \frac{g}{e_{3w}} \left( \beta \;\delta_{k+1/2}[S]  \alpha \;\delta_{k+1/2}[T] \right)
\end{equation}
where $\alpha$ and $\beta $ are the constant coefficients used to defined the linear
equation of state \eqref{Eq_tra_eos_linear}.
+where $\alpha$ and $\beta $ are the constant coefficients used to
+defined the linear equation of state \eqref{Eq_tra_eos_linear}.
% 
% Specific Heat
% 
\subsection{Specific Heat (\textit{rcp}, \mdl{phycst})}
+\subsection [Specific Heat (\textit{phycst})]
+ {Specific Heat (\mdl{phycst})}
\label{TRA_adv_ldf}
The specific heat of sea water, $C_p$, is a function of temperature, salinity and pressure \citep{UNESCO1983}. It is only used in the model to convert surface heat fluxes into surface temperature increase, thus the pressure dependence is neglected. The dependence on $T$ and $S$ is weak. For example, with $S=35~psu$, $C_p$ increases from $3989$ to $4002$ when $T$ varies from 2~\degres C to 31~\degres C. Therefore, $C_p$ has been chosen as a constant: $C_p=4.10^3~J\,Kg^{1}\,\degres K^{1}$. Its computer name is \textit{rcp} and its value is set in \mdl{phycst} module.
+The specific heat of sea water, $C_p$, is a function of temperature, salinity
+and pressure \citep{UNESCO1983}. It is only used in the model to convert
+surface heat fluxes into surface temperature increase and so the pressure
+dependence is neglected. The dependence on $T$ and $S$ is weak.
+For example, with $S=35~psu$, $C_p$ increases from $3989$ to $4002$
+when $T$ varies from 2~\degres C to 31~\degres C. Therefore, $C_p$ has
+been chosen as a constant: $C_p=4.10^3~J\,Kg^{1}\,\degres K^{1}$.
+Its value is set in \mdl{phycst} module.
+
+%%%
+\gmcomment{ STEVEN: consistency, no other computer variable names are
+supplied, so why this one}
+%%%
% 
% Freezing Point of Seawater
% 
\subsection{Freezing Point of Seawater (\mdl{ocfzpt})}
+\subsection [Freezing Point of Seawater (\textit{ocfzpt})]
+ {Freezing Point of Seawater (\mdl{ocfzpt})}
\label{TRA_fzp}
@@ 859,18 +1199,41 @@
\end{equation}
\eqref{Eq_tra_eos_fzp} is only used to compute the potential freezing point of sea water
($i.e.$ referenced to the surface $p=0$), thus the pressure dependent terms in \eqref{Eq_tra_eos_fzp} (last term) has been dropped. The \textit{before} and \textit{now} surface freezing point is introduced in the code as $fzptb$ and $fzptn$ 2D arrays together with a \textit{now} mask (\textit{freezn}) which takes 0 or 1 whether the ocean temperature is above or at the freezing point. Caution: do not confuse \textit{freezn} with the fraction of lead (\textit{frld}) defined in LIM.
+\eqref{Eq_tra_eos_fzp} is only used to compute the potential freezing point of
+sea water ($i.e.$ referenced to the surface $p=0$), thus the pressure dependent
+terms in \eqref{Eq_tra_eos_fzp} (last term) have been dropped. The \textit{before}
+and \textit{now} surface freezing point is introduced in the code as $fzptb$ and
+$fzptn$ 2D arrays together with a \textit{now} mask (\textit{freezn}) which takes
+the value 0 or 1 depending on whether the ocean temperature is above or at the
+freezing point. Caution: do not confuse \textit{freezn} with the fraction of lead
+(\textit{frld}) defined in LIM.
+
+%%%
+\gmcomment{STEVEN: consistency, not many computer variable names are supplied, so why these ===> gm I agree this should evolve both here and in the code itself}
+%%%
% ================================================================
% Horizontal Derivative in zpscoordinate
% ================================================================
\section{Horizontal Derivative in \textit{zps}coordinate (\mdl{zpshde})}
+\section [Horizontal Derivative in \textit{zps}coordinate (\textit{zpshde})]
+ {Horizontal Derivative in \textit{zps}coordinate (\mdl{zpshde})}
\label{TRA_zpshde}
With partial bottom cells (\np{ln\_zps}=T), tracers in horizontally adjacent cells generally live at different depths. Horizontal gradients of tracers are needed for horizontal diffusion (\mdl{traldf} module) and for the hydrostatic pressure gradient (\mdl{dynhpg} module). Before taking horizontal gradients between the tracers next to the bottom, a linear interpolation is used to approximate the deeper tracer as if it actually lived at the depth of the shallower tracer point (Fig.~\ref{Fig_Partial_step_scheme}). For example on temperature in the idirection, the needed interpolated temperature, $\widetilde{T}$, is:
+\gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators, I've changed "derivative" to "difference" and "mean" to "average"}
+
+With partial bottom cells (\np{ln\_zps}=.true.), in general, tracers in horizontally
+adjacent cells live at different depths. Horizontal gradients of tracers are needed
+for horizontal diffusion (\mdl{traldf} module) and for the hydrostatic pressure
+gradient (\mdl{dynhpg} module) to be active.
+\gmcomment{STEVEN from gm : question: not sure of what to be active means}
+Before taking horizontal gradients between the tracers next to the bottom, a linear
+interpolation in the vertical is used to approximate the deeper tracer as if it actually
+lived at the depth of the shallower tracer point (Fig.~\ref{Fig_Partial_step_scheme}).
+For example, for temperature in the $i$direction the needed interpolated
+temperature, $\widetilde{T}$, is:
+
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!p] \label{Fig_Partial_step_scheme} \begin{center}
\includegraphics[width=0.9\textwidth]{./Figures/Partial_step_scheme.pdf}
\caption{ Discretisation of horizontal derivative and mean of tracers in zpartial step coordinate (\np{ln\_zps}=T) in the case $( e3w_k^{i+1}  e3w_k^i )>0$. A linear interpolation is used to estimate $\widetilde{T}_k^{i+1}$, the tracer value at the depth of the shallower tracer point of the two adjacent bottom $T$points. The horizontal derivative is then given by: $\delta _{i+1/2} T_k= \widetilde{T}_k^{\,i+1} T_k^{\,i}$ and the mean by: $\overline{T}_k^{\,i+1/2}= ( \widetilde{T}_k^{\,i+1/2}  T_k^{\,i} ) / 2$. }
+\caption{ Discretisation of the horizontal difference and average of tracers in the $z$partial step coordinate (\np{ln\_zps}=.true.) in the case $( e3w_k^{i+1}  e3w_k^i )>0$. A linear interpolation is used to estimate $\widetilde{T}_k^{i+1}$, the tracer value at the depth of the shallower tracer point of the two adjacent bottom $T$points. The horizontal difference is then given by: $\delta _{i+1/2} T_k= \widetilde{T}_k^{\,i+1} T_k^{\,i}$ and the average by: $\overline{T}_k^{\,i+1/2}= ( \widetilde{T}_k^{\,i+1/2}  T_k^{\,i} ) / 2$. }
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ 884,5 +1247,6 @@
\end{aligned} \right.
\end{equation*}
and the resulting formulation of horizontal derivative and horizontal mean value of $T$ at $U$point are:
+and the resulting forms for the horizontal difference and the horizontal average
+value of $T$ at a $U$point are:
\begin{equation} \label{Eq_zps_hde}
\begin{aligned}
@@ 901,5 +1265,12 @@
\end{equation}
The computation of horizontal derivative of tracers as well as of density is performed once for all at each time step in \mdl{zpshde} module and stored in shared arrays to be used when needed. It has to be emphasized that the computation of the interpolated density, $\widetilde{\rho}$, is not identical to the one of $T$ and $S$. Instead of forming a linear approximation of density, we compute $\widetilde{\rho }$ from the interpolated value of $T$ and $S$, and the pressure of at $u$point (in the equation of state pressure is approximated by depth, see \S\ref{TRA_eos} ) :
+The computation of horizontal derivative of tracers as well as of density is
+performed once for all at each time step in \mdl{zpshde} module and stored
+in shared arrays to be used when needed. It has to be emphasized that the
+procedure used to compute the interpolated density, $\widetilde{\rho}$, is not
+the same as that used for $T$ and $S$. Instead of forming a linear approximation
+of density, we compute $\widetilde{\rho }$ from the interpolated values of $T$
+and $S$, and the pressure at a $u$point (in the equation of state pressure is
+approximated by depth, see \S\ref{TRA_eos} ) :
\begin{equation} \label{Eq_zps_hde_rho}
\widetilde{\rho } = \rho ( {\widetilde{T},\widetilde {S},z_u })
@@ 907,6 +1278,19 @@
\end{equation}
This is a much better approximation as the variation of $\rho$ with depth (and thus pressure) is highly nonlinear with a true equation of state and thus is badly approximated with a linear interpolation. This approximation is used to compute both the horizontal pressure gradient (\S\ref{DYN_hpg}) and the slopes of neutral surfaces (\S\ref{LDF_slp})

\textit{Notes}: in almost all the advection schemes presented in this Chapter, both mean and derivative operators appear. Yet, it has been chosen not to use \eqref{Eq_zps_hde} in those schemes.: contrary to diffusion and pressure gradient computation, no correction for partial steps is applied for advection.The main motivation was to preserve the domain averaged mean variance of the field advected when using $2^{nd}$ order centred scheme. Sensitivity of the advection schemes to the way horizontal means are performed in the vicinity of partial cells should be further investigated in a near future.

+This is a much better approximation as the variation of $\rho$ with depth (and
+thus pressure) is highly nonlinear with a true equation of state and thus is badly
+approximated with a linear interpolation. This approximation is used to compute
+both the horizontal pressure gradient (\S\ref{DYN_hpg}) and the slopes of neutral
+surfaces (\S\ref{LDF_slp})
+
+Note that in almost all the advection schemes presented in this Chapter, both
+averaging and differencing operators appear. Yet \eqref{Eq_zps_hde} has not
+been used in these schemes: in contrast to diffusion and pressure gradient
+computations, no correction for partial steps is applied for advection. The main
+motivation is to preserve the domain averaged mean variance of the advected
+field when using the $2^{nd}$ order centred scheme. Sensitivity of the advection
+schemes to the way horizontal averages are performed in the vicinity of partial
+cells should be further investigated in the near future.
+%%%
+\gmcomment{gm : this last remark has to be done}
+%%%
Index: trunk/DOC/TexFiles/Chapters/Chap_ZDF.tex
===================================================================
 trunk/DOC/BETA/Chapters/Chap_ZDF.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Chap_ZDF.tex (revision 994)
@@ 7,4 +7,8 @@
%gm% Add here a small introduction to ZDF and naming of the different physics (similar to what have been written for TRA and DYN.
+\gmcomment{Steven remark : problem here with turbulent vs turbulence. I've changed "turbulent closure" to "turbulence closure", "turbulent mixing length" to "turbulence mixing length", but I've left "turbulent kinetic energy" alone  though I think it is an historical abberation!
+Gurvan : I kept "turbulent closure"...}
+\gmcomment{Steven bis : parameterization is the american spelling, parameterisation is the british}
+
% ================================================================
@@ 14,10 +18,28 @@
\label{ZDF_zdf}
The discrete form of the ocean subgrid scale physics has been presented in \S\ref{TRA_zdf} and \S\ref{DYN_zdf}. At the surface and bottom boundaries, the turbulent fluxes of momentum, heat and salt have to be defined. At the surface they are prescribed from the surface forcing (see Chap.~\ref{SBC}), while at the bottom they are set to zero for heat and salt, unless a geothermal flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl} defined, see \S\ref{TRA_bbc}), and specified through a bottom friction parameterization for momentum (see \S\ref{ZDF_bfr}).
+The discrete form of the ocean subgrid scale physics has been presented in
+\S\ref{TRA_zdf} and \S\ref{DYN_zdf}. At the surface and bottom boundaries,
+the turbulent fluxes of momentum, heat and salt have to be defined. At the
+surface they are prescribed from the surface forcing (see Chap.~\ref{SBC}),
+while at the bottom they are set to zero for heat and salt, unless a geothermal
+flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl}
+defined, see \S\ref{TRA_bbc}), and specified through a bottom friction
+parameterization for momentum (see \S\ref{ZDF_bfr}).
In this section we briefly discuss the various choices offered to compute
the vertical eddy viscosity and diffusivity coefficients, $A_u^{vm}$ , $A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$, $vw$ and $w$points, respectively (see \S\ref{TRA_zdf} and \S\ref{DYN_zdf}). These coefficients can be assumed to be either constant, or a function of the local Richardson number, or computed from a turbulent closure model (either TKE or KPP formulation). The computation of these coefficients is initialized in \mdl{zdfini} module and performed in \mdl{zdfric}, \mdl{zdftke} or \mdl{zdfkpp} modules. The trends due to the vertical momentum and tracer diffusion, including the surface forcing,
are computed and added to the general trend in \mdl{dynzdf} and \mdl{trazdf} modules, respectively. These trends can be computed using either a forward time scheme (cpp variable
\np{np\_zdfexp} or a backward time scheme (default option) depending on the magnitude of the mixing coefficients used, and thus of the formulation used (see \S\ref{DOM_nxt}).
+the vertical eddy viscosity and diffusivity coefficients, $A_u^{vm}$ ,
+$A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$, $vw$ and $w$
+points, respectively (see \S\ref{TRA_zdf} and \S\ref{DYN_zdf}). These
+coefficients can be assumed to be either constant, or a function of the local
+Richardson number, or computed from a turbulent closure model (either
+TKE or KPP formulation). The computation of these coefficients is initialized
+in the \mdl{zdfini} module and performed in the \mdl{zdfric}, \mdl{zdftke} or
+\mdl{zdfkpp} modules. The trends due to the vertical momentum and tracer
+diffusion, including the surface forcing, are computed and added to the
+general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively.
+These trends can be computed using either a forward time stepping scheme
+(namelist parameter \np{np\_zdfexp}=true) or a backward time stepping
+scheme (\np{np\_zdfexp}=false) depending on the magnitude of the mixing
+coefficients, and thus of the formulation used (see \S\ref{DOM_nxt}).
% 
@@ 30,9 +52,8 @@
%
When the \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to
constant values over the whole ocean. This is the crudest way to define the
vertical ocean physics. It is recommended to use this option only in process
studies, not in basin scale simulation. Typical values used in this case
are:
+When \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients
+are set to constant values over the whole ocean. This is the crudest way to define
+the vertical ocean physics. It is recommended that this option is only used in
+process studies, not in basin scale simulations. Typical values used in this case are:
\begin{align*}
A_u^{vm} = A_v^{vm} &= 1.2\ 10^{4}~m^2.s^{1} \\
@@ 41,6 +62,8 @@
\end{align*}
These values are set through \np{avm0} and \np{avt0} namelist parameters. In any case, do not use
values smaller that those associated to the molecular viscosity and diffusivity, that is $\sim10^{6}~m^2.s^{1}$ for momentum, $\sim10^{7}~m^2.s^{1}$ for temperature and $\sim10^{9}~m^2.s^{1}$ for salinity.
+These values are set through the \np{avm0} and \np{avt0} namelist parameters.
+In all cases, do not use values smaller that those associated with the molecular
+viscosity and diffusivity, that is $\sim10^{6}~m^2.s^{1}$ for momentum,
+$\sim10^{7}~m^2.s^{1}$ for temperature and $\sim10^{9}~m^2.s^{1}$ for salinity.
@@ 55,5 +78,13 @@
%
When \key{zdfric} is defined, a local Richardson number dependent formulation of the vertical momentum and tracer eddy coefficients is set. The vertical mixing coefficients are diagnosed from the large scale variables computed by the model (order 0.5 closure scheme). \textit{In situ} measurements allow to link vertical turbulent activity to large scale ocean structures. The hypothesis of a mixing mainly maintained by the growth of KelvinHelmholtz like instabilities leads to a dependency between the vertical turbulent eddy coefficients and the local Richardson number ($i.e.$ ratio of stratification over vertical shear). Following \citet{PacPhil1981}, the following formulation has been implemented:
+When \key{zdfric} is defined, a local Richardson number dependent formulation
+for the vertical momentum and tracer eddy coefficients is set. The vertical mixing
+coefficients are diagnosed from the large scale variables computed by the model.
+\textit{In situ} measurements have been used to link vertical turbulent activity to
+large scale ocean structures. The hypothesis of a mixing mainly maintained by the
+growth of KelvinHelmholtz like instabilities leads to a dependency between the
+vertical turbulence eddy coefficients and the local Richardson number ($i.e.$ the
+ratio of stratification to vertical shear). Following \citet{PacPhil1981}, the following
+formulation has been implemented:
\begin{equation} \label{Eq_zdfric}
\left\{ \begin{aligned}
@@ 63,5 +94,11 @@
\end{aligned} \right.
\end{equation}
where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson number, $N$ is the local bruntVais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}), $A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in constant case (see \S\ref{ZDF_cst}), and $A_{ric}^{vT} = 10^{4}~m^2.s^{1} $ is the maximum value that can be reached by the coefficient when $Ri\leq 0$, $a=5$ and $n=2$. The last three coefficients can be modified by setting \np{avmri}, \np{alp} and \np{nric} namelist parameter, respectively.
+where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson
+number, $N$ is the local BruntVais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),
+$A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in the
+constant case (see \S\ref{ZDF_cst}), and $A_{ric}^{vT} = 10^{4}~m^2.s^{1}$
+is the maximum value that can be reached by the coefficient when $Ri\leq 0$,
+$a=5$ and $n=2$. The last three values can be modified by setting the
+\np{avmri}, \np{alp} and \np{nric} namelist parameters, respectively.
% 
@@ 75,5 +112,15 @@
%
The vertical eddy viscosity and diffusivity coefficients are computed from a TKE turbulent closure model based on a prognostic equation for $\bar {e}$, the turbulent kinetic energy, and a closure assumption for the turbulent length scales. This turbulent closure model has been developed by \citet{Bougeault1989} in atmospheric cases, adapted by \citet{Gaspar1990} for oceanic cases, and embedded in OPA by \citet{Blanke1993} for equatorial Atlantic simulations. Since then, significant modifications have been introduced by \citet{Madec1998} in both the implementation and the formulation of the mixing length scale. The time evolution of $\bar{e}$ is the result of the production of $\bar{e}$ through vertical shear, its destruction through stratification, its vertical diffusion and its dissipation of \citet{Kolmogorov1942} type:
+The vertical eddy viscosity and diffusivity coefficients are computed from a TKE
+turbulent closure model based on a prognostic equation for $\bar {e}$, the turbulent
+kinetic energy, and a closure assumption for the turbulence length scales. This
+turbulent closure model has been developed by \citet{Bougeault1989} in the
+atmospheric case, adapted by \citet{Gaspar1990} for the oceanic case, and
+embedded in OPA by \citet{Blanke1993} for equatorial Atlantic simulations. Since
+then, significant modifications have been introduced by \citet{Madec1998} in both
+the implementation and the formulation of the mixing length scale. The time
+evolution of $\bar{e}$ is the result of the production of $\bar{e}$ through vertical
+shear, its destruction through stratification, its vertical diffusion, and its dissipation
+of \citet{Kolmogorov1942} type:
\begin{equation} \label{Eq_zdftke_e}
\frac{\partial \bar{e}}{\partial t} =
@@ 87,15 +134,15 @@
\begin{equation} \label{Eq_zdftke_kz}
\begin{split}
 A^{vm} &= C_k\ l_k\ \sqrt {\bar{e}}
 \\
+ A^{vm} &= C_k\ l_k\ \sqrt {\bar{e}} \\
A^{vT} &= A^{vm} / P_{rt}
\end{split}
\end{equation}
where $N$ designates the local BruntVais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),
$l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing turbulent
length scales, $P_{rt} $ is the Prandtl number. The constants $C_k = \sqrt {2} /2$ and
$C_\epsilon = 0.1$ are designed to deal with vertical mixing at any depth \citep{Gaspar1990}. They are set through namelist parameter \np{ediff} and \np{ediss}. $P_{rt} $ can be
set to unity or, following \citet{Blanke1993}, be a function of the
local Richardson number, $R_i $:
+where $N$ is the local BruntVais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),
+$l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing length scales,
+$P_{rt} $ is the Prandtl number. The constants $C_k = \sqrt {2} /2$ and
+$C_\epsilon = 0.1$ are designed to deal with vertical mixing at any depth
+\citep{Gaspar1990}. They are set through namelist parameters \np{ediff}
+and \np{ediss}. $P_{rt} $ can be set to unity or, following \citet{Blanke1993},
+be a function of the local Richardson number, $R_i $:
\begin{align*} \label{Eq_prt}
P_{rt} = \begin{cases}
@@ 105,20 +152,40 @@
\end{cases}
\end{align*}
Note that a horizontal Shapiro filter can be optionally applied to $R_i$. Nevertheless it is an obsolescent option that is notrecommanded. The choice of $P_{rt} $ is controlled by \np{npdl} namelist parameter.

For computational efficiency, the original formulation of the turbulent length scales proposed by \citet{Gaspar1990} has been simplified. Four formulations are proposed, the choice of which is controlled by \np{nmxl} namelist parameter. The first two are based on the following first order approximation \citep{Blanke1993}:
+Note that a horizontal Shapiro filter can optionally be applied to $R_i$.
+However it is an obsolescent option that is not recommended.
+The choice of $P_{rt} $ is controlled by the \np{npdl} namelist parameter.
+
+For computational efficiency, the original formulation of the turbulence length
+scales proposed by \citet{Gaspar1990} has been simplified. Four formulations
+are proposed, the choice of which is controlled by the \np{nmxl} namelist
+parameter. The first two are based on the following first order approximation
+\citep{Blanke1993}:
\begin{equation} \label{Eq_tke_mxl0_1}
l_k = l_\epsilon = \sqrt {2 \bar e} / N
\end{equation}
which is obtained in a stable stratified region with constant values of the bruntVais\"{a}l\"{a} frequency. The resulting turbulent length scale is bounded by the distance to the surface or to the bottom (\np{nmxl}=0) or by the local vertical scale factor (\np{nmxl}=1). \citet{Blanke1993} notice that this simplification has two major drawbacks: it has no sense for local unstable
stratification and the computation no longer uses the whole information contained in the vertical density profile. To overcome this drawbacks, \citet{Madec1998} introduces the \np{nmxl}=2 or 3 cases, which add of an hypothesis on the vertical gradient of the computed length scale. So, the length scales are first evaluated as in \eqref{Eq_tke_mxl0_1} and then bounded such that:
+which is valid in a stable stratified region with constant values of the brunt
+Vais\"{a}l\"{a} frequency. The resulting length scale is bounded by the distance
+to the surface or to the bottom (\np{nmxl}=0) or by the local vertical scale factor (\np{nmxl}=1). \citet{Blanke1993} notice that this simplification has two major
+drawbacks: it makes no sense for locally unstable stratification and the
+computation no longer uses all the information contained in the vertical density
+profile. To overcome these drawbacks, \citet{Madec1998} introduces the
+\np{nmxl}=2 or 3 cases, which add an extra assumption concerning the vertical
+gradient of the computed length scale. So, the length scales are first evaluated
+as in \eqref{Eq_tke_mxl0_1} and then bounded such that:
\begin{equation} \label{Eq_tke_mxl_constraint}
\frac{1}{e_3 }\left {\frac{\partial l}{\partial k}} \right \leq 1
\qquad \text{with }\ l = l_k = l_\epsilon
\end{equation}

\eqref{Eq_tke_mxl_constraint} means that the vertical variations of the length scale cannot be
larger than the variations of depth. It provides a better approximation of the \citet{Gaspar1990} formulation while being much less time consuming. In particular, it allows the length scale to be limited not only by the distance to the surface or to the ocean bottom but also by the distance to a
strongly stratified portion of the water column such as the thermocline (Fig.~\ref{Fig_mixing_length}). In order to imposed \eqref{Eq_tke_mxl_constraint} constraint, we introduce two additonnal length scal: $l_{up}$ and $l_{dwn}$, the upward and downward length scale, and evaluate the dissipation and mixing turbulent length scales as (caution here we use the numerical indexation):
+\eqref{Eq_tke_mxl_constraint} means that the vertical variations of the length
+scale cannot be larger than the variations of depth. It provides a better
+approximation of the \citet{Gaspar1990} formulation while being much less
+time consuming. In particular, it allows the length scale to be limited not only
+by the distance to the surface or to the ocean bottom but also by the distance
+to a strongly stratified portion of the water column such as the thermocline
+(Fig.~\ref{Fig_mixing_length}). In order to impose the \eqref{Eq_tke_mxl_constraint}
+constraint, we introduce two additional length scales: $l_{up}$ and $l_{dwn}$,
+the upward and downward length scales, and evaluate the dissipation and
+mixing turbulence length scales as (and note that here we use numerical
+indexing):
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!t] \label{Fig_mixing_length} \begin{center}
@@ 130,5 +197,5 @@
\begin{equation} \label{Eq_tke_mxl2}
\begin{aligned}
 l_{up }^{(k)} &= \min \left( l^{(k)} \ , \ l_{up}^{(k+1)} + e_{3T}^{(k)} \right)
+ l_{up\ \ }^{(k)} &= \min \left( l^{(k)} \ , \ l_{up}^{(k+1)} + e_{3T}^{(k)}\ \ \ \; \right)
\quad &\text{ from $k=1$ to $jpk$ }\ \\
l_{dwn}^{(k)} &= \min \left( l^{(k)} \ , \ l_{dwn}^{(k1)} + e_{3T}^{(k1)} \right)
@@ 136,7 +203,11 @@
\end{aligned}
\end{equation}
where $l^{(k)}$ is compute using \eqref{Eq_tke_mxl0_1}, $i.e.$ $l^{(k)} = \sqrt {2 \bar e^{(k)} / N^{(k)} }$.

In the \np{nmxl}=2 case, the dissipation and mixing turbulent length scales take a same value: $ l_k= l_\epsilon = \min \left(\ l_{up} \;,\; l_{dwn}\ \right)$, while in the \np{nmxl}=2 case, the dissipation and mixing turbulent length scales are give as in \citet{Gaspar1990}:
+where $l^{(k)}$ is computed using \eqref{Eq_tke_mxl0_1},
+$i.e.$ $l^{(k)} = \sqrt {2 \bar e^{(k)} / N^{(k)} }$.
+
+In the \np{nmxl}=2 case, the dissipation and mixing length scales take the same
+value: $ l_k= l_\epsilon = \min \left(\ l_{up} \;,\; l_{dwn}\ \right)$, while in the
+\np{nmxl}=2 case, the dissipation and mixing turbulence length scales are give
+as in \citet{Gaspar1990}:
\begin{equation} \label{Eq_tke_mxl_gaspar}
\begin{aligned}
@@ 149,12 +220,13 @@
stress field: $\bar{e}=ebb\;\left \tau \right$ ($ebb=60$ by default)
with a minimal threshold of $emin0=10^{4}~m^2.s^{2}$ (namelist
parameters). Its bottom value is assumed to be equal to the value of the level just above. The time
integration of the $\bar{e}$ equation may formally lead to negative values
because the numerical scheme does not ensure the positivity. To overcome
this problem, a cutoff in the minimum value of $\bar{e}$ is used. Following
\citet{Gaspar1990}, the cutoff value is set to $\sqrt{2}/2~10^{6}~m^2.s^{2}$. This allows the subsequent formulations to match
\citet{Gargett1984} one for the diffusion in the thermocline and deep ocean
$(A^{vT} = 10^{3} / N)$. In addition, a
cutoff is applied on $A^{vm}$ and $A^{vT}$ to avoid numerical
+parameters). Its value at the bottom of the ocean is assumed to be
+equal to the value of the level just above. The time integration of the
+$\bar{e}$ equation may formally lead to negative values because the
+numerical scheme does not ensure its positivity. To overcome this
+problem, a cutoff in the minimum value of $\bar{e}$ is used. Following
+\citet{Gaspar1990}, the cutoff value is set to $\sqrt{2}/2~10^{6}~m^2.s^{2}$.
+This allows the subsequent formulations to match that of\citet{Gargett1984}
+for the diffusion in the thermocline and deep ocean : $(A^{vT} = 10^{3} / N)$.
+In addition, a cutoff is applied on $A^{vm}$ and $A^{vT}$ to avoid numerical
instabilities associated with too weak vertical diffusion. They must be
specified at least larger than the molecular values, and are set through
@@ 172,4 +244,5 @@
The KKP scheme has been implemented by J. Chanut ...
+
\colorbox{yellow}{Add a description of KPP here.}
@@ 188,14 +261,15 @@
occur at particular ocean grid points. In nature, convective processes
quickly reestablish the static stability of the water column. These
processes have been removed from the model via the hydrostatic assumption:
they must be parameterized. Three parameterisations are available to deal
with convective processes: either a nonpenetrative convective adjustment or
an enhanced vertical diffusion, or/and the use of a turbulent closure
scheme.
+processes have been removed from the model via the hydrostatic
+assumption so they must be parameterized. Three parameterizations
+are available to deal with convective processes: a nonpenetrative
+convective adjustment or an enhanced vertical diffusion, or/and the
+use of a turbulent closure scheme.
% 
% NonPenetrative Convective Adjustment
% 
\subsection{NonPenetrative Convective Adjustment (\np{ln\_tranpc}=T) }
+\subsection [NonPenetrative Convective Adjustment (\np{ln\_tranpc}) ]
+ {NonPenetrative Convective Adjustment (\np{ln\_tranpc}=.true.) }
\label{ZDF_npc}
@@ 206,53 +280,72 @@
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{figure}[!ht] \label{Fig_npc} \begin{center}
+\begin{figure}[!htb] \label{Fig_npc} \begin{center}
\includegraphics[width=0.90\textwidth]{./Figures/Fig_npc.pdf}
\caption {Example of an unstable density profile treated by the non penetrative convective adjustment algorithm. $1^{st}$ step: the initial profile is checked from the surface to the bottom. It is found to be unstable between levels 3 and 4. They are mixed. The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5 are mixed. The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are mixed. The $1^{st}$ step ends since the density profile is then stable below the level 3. $2^{nd}$ step: the new $\rho$ profile is checked following the same procedure as in $1^{st}$ step: levels 2 to 5 are mixed. The new density profile is checked. It is found stable: end of algorithm.}
+\caption {Example of an unstable density profile treated by the non penetrative
+convective adjustment algorithm. $1^{st}$ step: the initial profile is checked from
+the surface to the bottom. It is found to be unstable between levels 3 and 4.
+They are mixed. The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5
+are mixed. The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are
+mixed. The $1^{st}$ step ends since the density profile is then stable below
+the level 3. $2^{nd}$ step: the new $\rho$ profile is checked following the same
+procedure as in $1^{st}$ step: levels 2 to 5 are mixed. The new density profile
+is checked. It is found stable: end of algorithm.}
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The nonpenetrative convective adjustment algorithm is used when \np{ln\_zdfnpc}=T. It is applied at each \np{nnpc1} time step and mixes downwards instantaneously the statically unstable portion of the water column, but only until the density structure becomes neutrally stable ($i.e.$ until the mixed portion of the water column has \textit{exactly} the density of the water just below) \citep{Madec1991a}. This algorithm is an iterative process used in the following way
(Fig. \ref{Fig_npc}): going from the top of the ocean towards the bottom, the first
instability is searched. Assume in the following that the instability is
located between levels $k$ and $k+1$. The two levels are vertically mixed, for
potential temperature and salinity, conserving the heat and salt contents of
the water column. The new density is then computed by a linear
approximation. If the new density profile is still unstable between levels
$k+1$ and $k+2$, levels $k$, $k+1$ and $k+2$ are then mixed. This process is repeated until
stability is established below the level $k$ (the mixing process can go down to
the ocean bottom). The algorithm is repeated to check if the density profile
+The nonpenetrative convective adjustment is used when \np{ln\_zdfnpc}=true.
+It is applied at each \np{nnpc1} time step and mixes downwards instantaneously
+the statically unstable portion of the water column, but only until the density
+structure becomes neutrally stable ($i.e.$ until the mixed portion of the water
+column has \textit{exactly} the density of the water just below) \citep{Madec1991a}.
+The associated algorithm is an iterative process used in the following way
+(Fig. \ref{Fig_npc}): starting from the top of the ocean, the first instability is
+found. Assume in the following that the instability is located between levels
+$k$ and $k+1$. The potential temperature and salinity in the two levels are
+vertically mixed, conserving the heat and salt contents of the water column.
+The new density is then computed by a linear approximation. If the new
+density profile is still unstable between levels $k+1$ and $k+2$, levels $k$,
+$k+1$ and $k+2$ are then mixed. This process is repeated until stability is
+established below the level $k$ (the mixing process can go down to the
+ocean bottom). The algorithm is repeated to check if the density profile
between level $k1$ and $k$ is unstable and/or if there is no deeper instability.
This algorithm is significantly different from mixing two by two statically unstable levels. The latter procedure cannot converge with a finite number
of iterations for some vertical profiles while the algorithm used in OPA
converges for any profile in a number of iterations less than the number of
vertical levels. This property is of paramount importance as pointed out by
\citet{Killworth1989}: it avoids the existence of permanent and unrealistic
static instabilities at the sea surface. This nonpenetrative convective
algorithm has been proved successful in studying the deep water formation in
the northwestern Mediterranean Sea \citep{Madec1991a, Madec1991b, Madec1991c}.

Note that in this algorithm the potential density referenced to the sea
surface is used to check whether the density profile is stable or not.
Moreover, the mixing in potential density is assumed to be linear. This
assures the convergence of the algorithm even when the equation of state is
nonlinear. Small static instabilities can thus persist due to cabbeling:
they will be treated at the next time step. Moreover, temperature and
salinity, and thus density, are mixed, but the corresponding velocity fields
remain unchanged. When using a Richardson dependent eddy viscosity, the
mixing of momentum is done through the vertical diffusion: after a static
adjustment, the Richardson number is zero and thus the eddy viscosity
coefficient is at a maximum. When this algorithm is used with constant
vertical eddy viscosity, spurious solution can occur as the vertical
momentum diffusion remains small even after a static adjustment. In that
latter case, we recommend to add momentum mixing in a manner that mimics the
mixing in temperature and salinity \citep{Speich1992, Speich1996}.

%AMT This presentation fails to mention the big drawback of this scheme: many water masses of the world ocean, especially AABW, are unstable when represented in surfacereferenced potential density sigma_0. The scheme erroneously mixes them up.
+This algorithm is significantly different from mixing statically unstable levels
+two by two. The latter procedure cannot converge with a finite number
+of iterations for some vertical profiles while the algorithm used in \NEMO
+converges for any profile in a number of iterations which is less than the
+number of vertical levels. This property is of paramount importance as
+pointed out by \citet{Killworth1989}: it avoids the existence of permanent
+and unrealistic static instabilities at the sea surface. This nonpenetrative
+convective algorithm has been proved successful in studies of the deep
+water formation in the northwestern Mediterranean Sea
+\citep{Madec1991a, Madec1991b, Madec1991c}.
+
+Note that in the current implementation of this algorithm presents several
+limitations. First, potential density referenced to the sea surface is used to
+check whether the density profile is stable or not. This is a strong
+simplification which leads to large errors for realistic ocean simulations.
+Indeed, many water masses of the world ocean, especially Antarctic Bottom
+Water, are unstable when represented in surfacereferenced potential density.
+The scheme will erroneously mix them up. Second, the mixing of potential
+density is assumed to be linear. This assures the convergence of the algorithm
+even when the equation of state is nonlinear. Small static instabilities can thus
+persist due to cabbeling: they will be treated at the next time step.
+Third, temperature and salinity, and thus density, are mixed, but the
+corresponding velocity fields remain unchanged. When using a Richardson
+Number dependent eddy viscosity, the mixing of momentum is done through
+the vertical diffusion: after a static adjustment, the Richardson Number is zero
+and thus the eddy viscosity coefficient is at a maximum. When this convective
+adjustment algorithm is used with constant vertical eddy viscosity, spurious
+solutions can occur since the vertical momentum diffusion remains small even
+after a static adjustment. In that case, we recommend the addition of momentum
+mixing in a manner that mimics the mixing in temperature and salinity
+\citep{Speich1992, Speich1996}.
% 
% Enhanced Vertical Diffusion
% 
\subsection{Enhanced Vertical Diffusion (\np{ln\_zdfevd}=T)}
+\subsection [Enhanced Vertical Diffusion (\np{ln\_zdfevd})]
+ {Enhanced Vertical Diffusion (\np{ln\_zdfevd}=.true.)}
\label{ZDF_evd}
@@ 261,10 +354,19 @@
%
The enhanced vertical diffusion parameterization is used when \np{ln\_zdfevd} is
defined. In this case, the vertical eddy mixing coefficients are assigned to be very large (a typical value is $1\;m^2s^{1})$ in regions where the stratification is unstable (i.e. when the BruntVais\"{a}l\"{a} frequency is negative) \citep{Lazar1997, Lazar1999}. This is done either on tracers only (\np{n\_evdm}=0) or on both momentum and
tracers (\np{n\_evdm}=1) mixing coefficients.

In practice, when $N^2\leq 10^{12}$, $A_T^{vT}$ and $A_T^{vS}$ are set to a large value,
\np{avevd}, and if \np{n\_evdm}=1, the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm} $ . Typical value for $avevd$ is inbetween 1 and $100~m^2.s^{1}$. This parameterisation of convective processes is less time consuming than the convective adjustment algorithm presented above when mixing both tracers and momentum in case of static instabilities. It requires the use of an implicit time stepping on vertical diffusion terms (i.e. \np{ln\_zdfexp}=F).
+The enhanced vertical diffusion parameterization is used when \np{ln\_zdfevd}=true.
+In this case, the vertical eddy mixing coefficients are assigned very large values
+(a typical value is $10\;m^2s^{1})$ in regions where the stratification is unstable
+($i.e.$ when the BruntVais\"{a}l\"{a} frequency is negative) \citep{Lazar1997, Lazar1999}.
+This is done either on tracers only (\np{n\_evdm}=0) or on both momentum and
+tracers (\np{n\_evdm}=1).
+
+In practice, where $N^2\leq 10^{12}$, $A_T^{vT}$ and $A_T^{vS}$, and
+if \np{n\_evdm}=1, the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm}$
+values also, are set equal to the namelist parameter \np{avevd}. A typical value
+for $avevd$ is between 1 and $100~m^2.s^{1}$. This parameterization of
+convective processes is less time consuming than the convective adjustment
+algorithm presented above when mixing both tracers and momentum in the
+case of static instabilities. It requires the use of an implicit time stepping on
+vertical diffusion terms (i.e. \np{ln\_zdfexp}=false).
% 
@@ 274,27 +376,30 @@
\label{ZDF_tcs}
The turbulent closure scheme presented in \S\ref{ZDF_tke} and used when the
\key{zdftke} is defined allows, in theory, to deal with
statically unstable density profiles. In such a
case, the term of destruction of turbulent kinetic energy through
stratification in \eqref{Eq_zdftke_e} becomes a source term as $N^2$ is negative. It
results large values of both $A_T^{vT}$ and the four neighbouring$A_u^{vm}
{and}\;A_v^{vm} $ (up to $1\;m^2s^{1})$ that are able to restore the
static stability of the water column in a way similar to that of the
enhanced vertical diffusion parameterization (\S\ref{ZDF_evd}). Nevertheless, the
eddy coefficients computed by the turbulent scheme do usually not exceed
$10^{2}m.s^{1}$ in the vicinity of the sea surface (first ocean layer) due to
the bound of the turbulent length scale by the distance to the sea surface
(see {\S}VI.7c). It can thus be useful to combine the enhanced vertical
diffusion with the turbulent closure, i.e. defining \np{np\_zdfevd} and
\key{zdftke} CPP variables all together.

The KPP scheme includes enhanced vertical diffusion in the case of convection, as governed by the variables $bvsqcon$ and $difcon$ found in \mdl{zdfkpp}, therefore \np{np\_zdfevd} should not be used with the KPP scheme. %gm% + one word on non local flux with KPP scheme

+The TKE turbulent closure scheme presented in \S\ref{ZDF_tke} and used
+when the \key{zdftke} is defined, in theory solves the problem of statically
+unstable density profiles. In such a case, the term corresponding to the
+destruction of turbulent kinetic energy through stratification in \eqref{Eq_zdftke_e}
+becomes a source term, since $N^2$ is negative. It results in large values of
+$A_T^{vT}$ and $A_T^{vT}$, and also the four neighbouring
+$A_u^{vm} {and}\;A_v^{vm}$ (up to $1\;m^2s^{1})$. These large values
+restore the static stability of the water column in a way similar to that of the
+enhanced vertical diffusion parameterization (\S\ref{ZDF_evd}). However,
+in the vicinity of the sea surface (first ocean layer), the eddy coefficients
+computed by the turbulence scheme do not usually exceed $10^{2}m.s^{1}$,
+because the mixing length scale is bounded by the distance to the sea surface
+(see \S\ref{ZDF_tke}). It can thus be useful to combine the enhanced vertical
+diffusion with the turbulent closure scheme, $i.e.$ setting the \np{ln\_zdfnpc}
+namelist parameter to true and defining the \key{zdftke} CPP key all together.
+
+The KPP turbulent closure scheme already includes enhanced vertical diffusion
+in the case of convection, as governed by the variables $bvsqcon$ and $difcon$
+found in \mdl{zdfkpp}, therefore \np{np\_zdfevd} should not be used with the KPP
+scheme. %gm% + one word on non local flux with KPP scheme trakpp.F90 module...
% ================================================================
% Double Diffusion Mixing
% ================================================================
\section{Double Diffusion Mixing (\key{zdfddm})}
+\section [Double Diffusion Mixing (\textit{zdfddm}  \key{zdfddm})]
+ {Double Diffusion Mixing (\mdl{zdfddm} module  \key{zdfddm})}
\label{ZDF_ddm}
@@ 303,5 +408,11 @@
%
Double diffusion occurs when relatively warm, salty water overlies cooler, fresher water, or vice versa. The former condition leads to salt fingering and the latter to diffusive convection. Doublediffusive phenomena contribute to diapycnal mixing in extensive regions of the oceans. \citet{Merryfield1999} include a parameterization of such phenomena in a global ocean model and show that it leads to relatively minor changes in circulation but exerts significant regional influences on temperature and salinity.
+Double diffusion occurs when relatively warm, salty water overlies cooler, fresher
+water, or vice versa. The former condition leads to salt fingering and the latter
+to diffusive convection. Doublediffusive phenomena contribute to diapycnal
+mixing in extensive regions of the ocean. \citet{Merryfield1999} include a
+parameterization of such phenomena in a global ocean model and show that
+it leads to relatively minor changes in circulation but exerts significant regional
+influences on temperature and salinity.
Diapycnal mixing of S and T are described by diapycnal diffusion coefficients
@@ 310,7 +421,9 @@
&A^{vS} = A_o^{vS}+A_f^{vS}+A_d^{vS}
\end{align*}
where subscript $f$ represents mixing by salt fingering,
$d$ by diffusive convection, and $o$ by processes other than
double diffusion. The rates of doublediffusive mixing depend on buoyancy ratio $R_\rho = \alpha \partial_z T / \partial_z S$, where $\alpha$ and $\beta$ are coefficients of thermal expansion and saline contraction (see \S\ref{TRA_eos}. To represent mixing of $S$ and $T$ by salt fingering, we adopt the diapycnal diffusivities suggested by Schmitt (1981):
+where subscript $f$ represents mixing by salt fingering, $d$ by diffusive convection,
+and $o$ by processes other than double diffusion. The rates of doublediffusive mixing depend on the buoyancy ratio $R_\rho = \alpha \partial_z T / \beta \partial_z S$,
+where $\alpha$ and $\beta$ are coefficients of thermal expansion and saline
+contraction (see \S\ref{TRA_eos}). To represent mixing of $S$ and $T$ by salt
+fingering, we adopt the diapycnal diffusivities suggested by Schmitt (1981):
\begin{align} \label{Eq_zdfddm_f}
A_f^{vS} &= \begin{cases}
@@ 318,5 +431,5 @@
0 &\text{otherwise}
\end{cases}
\\
+\\ \label{Eq_zdfddm_f_T}
A_f^{vT} &= 0.7 \ A_f^{vS} / R_\rho
\end{align}
@@ 325,12 +438,21 @@
\begin{figure}[!t] \label{Fig_zdfddm} \begin{center}
\includegraphics[width=0.99\textwidth]{./Figures/Fig_zdfddm.pdf}
\caption {From \citet{Merryfield1999} : (a) Diapycnal diffusivities $A_f^{vT}$ and $A_f^{vS}$ for temperature and salt in regions of salt fingering. Heavy curves denote $A^{\ast v} = 10^{3}~m^2.s^{1}$ and thin curves $A^{\ast v} = 10^{4}~m^2.s^{1}$ ; (b) diapycnal diffusivities $A_d^{vT}$ and $A_d^{vT}$ for temperature and salt in regions of diffusive convection. Heavy curves denote the Federov parameterization and thin curves the Kelley parameterization. The latter is not implemented in \NEMO }
+\caption {From \citet{Merryfield1999} : (a) Diapycnal diffusivities $A_f^{vT}$
+and $A_f^{vS}$ for temperature and salt in regions of salt fingering. Heavy
+curves denote $A^{\ast v} = 10^{3}~m^2.s^{1}$ and thin curves
+$A^{\ast v} = 10^{4}~m^2.s^{1}$ ; (b) diapycnal diffusivities $A_d^{vT}$ and
+$A_d^{vS}$ for temperature and salt in regions of diffusive convection. Heavy
+curves denote the Federov parameterization and thin curves the Kelley
+parameterization. The latter is not implemented in \NEMO. }
\end{center} \end{figure}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The factor 0.7 in \eqref{Eq_zdfddm_f} reflects the measured ratio $\alpha F_T /\beta F_S \approx 0.7$ of buoyancy fluxes due to transport of heat and salt (e.g., McDougall and Taylor 1984). Following \citet{Merryfield1999}, we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{4}~m^2.s^{1}$.
+The factor 0.7 in \eqref{Eq_zdfddm_f_T} reflects the measured ratio
+$\alpha F_T /\beta F_S \approx 0.7$ of buoyancy flux of heat to buoyancy
+flux of salt ($e.g.$, \citet{McDougall_Taylor_JMR84}). Following \citet{Merryfield1999},
+we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{4}~m^2.s^{1}$.
To represent mixing of S and T by diffusive layering, the diapycnal diffusivities suggested by Federov (1988) is used:
\begin{align} \label{Eq_zdfddm_d}
+\begin{align} \label{Eq_zdfddm_d}
A_d^{vT} &= \begin{cases}
1.3635 \, \exp{\left( 4.6\, \exp{ \left[ 0.54\,( R_{\rho}^{1}  1 ) \right] } \right)}
@@ 338,5 +460,5 @@
0 &\text{otherwise}
\end{cases}
\\
+\\ \label{Eq_zdfddm_d_S}
A_d^{vS} &= \begin{cases}
A_d^{vT}\ \left( 1.85\,R_{\rho}  0.85 \right)
@@ 348,12 +470,15 @@
\end{align}
The dependences of \eqref{Eq_zdfddm_f} to \eqref{Eq_zdfddm_d} on $R_\rho$ are illustrated in Fig.~\ref{Fig_zdfddm}. Implementing this requires computing $R_\rho$ at each
grid point and time step. This is done in \mdl{eosbn2} at the same time as $N^2$ is computed. This avoids duplication in the computation of $\alpha$ and $\beta$ (which is usually quite expensive).

+The dependencies of \eqref{Eq_zdfddm_f} to \eqref{Eq_zdfddm_d_S} on $R_\rho$
+are illustrated in Fig.~\ref{Fig_zdfddm}. Implementing this requires computing
+$R_\rho$ at each grid point on every time step. This is done in \mdl{eosbn2} at the
+same time as $N^2$ is computed. This avoids duplication in the computation of
+$\alpha$ and $\beta$ (which is usually quite expensive).
% ================================================================
% Bottom Friction
% ================================================================
\section{Bottom Friction}
+\section [Bottom Friction (\textit{zdfbfr})]
+ {Bottom Friction (\mdl{zdfbfr} module)}
\label{ZDF_bfr}
@@ 362,6 +487,6 @@
%
Both surface momentum flux (wind stress) and the bottom momentum flux
(bottom friction) enter the equations as a condition on the vertical
+Both the surface momentum flux (wind stress) and the bottom momentum
+flux (bottom friction) enter the equations as a condition on the vertical
diffusive flux. For the bottom boundary layer, one has:
\begin{equation} \label{Eq_zdfbfr_flux}
@@ 372,80 +497,77 @@
1~m in the ocean). How $\textbf{F}_h$ influences the interior depends on the
vertical resolution of the model near the bottom relative to the Ekman layer
depth. For example, in order to obtain an Ekman layer depth $d = \sqrt{2\;A^{vm}} / f = 50$~m, one needs a vertical diffusion coefficient $A^{vm} = 0.125$~m$^2$s$^{1}$ (for a Coriolis
frequency $f = 10^{4}$~m$^2$s$^{1}$). With a background diffusion coefficient
$A^{vm} = 10^{4}$~m$^2$s$^{1}$, the Ekman layer depth is only 1.4~m. When the vertical mixing coefficient is this small, using a flux condition is equivalent to entering the
viscous forces (either wind stress or bottom friction) as a body force over
the depth of the top or bottom model layer. To illustrate this, consider the
equation for $u$ at $k$, the last ocean level:
+depth. For example, in order to obtain an Ekman layer depth
+$d = \sqrt{2\;A^{vm}} / f = 50$~m, one needs a vertical diffusion coefficient
+$A^{vm} = 0.125$~m$^2$s$^{1}$ (for a Coriolis frequency
+$f = 10^{4}$~m$^2$s$^{1}$). With a background diffusion coefficient
+$A^{vm} = 10^{4}$~m$^2$s$^{1}$, the Ekman layer depth is only 1.4~m.
+When the vertical mixing coefficient is this small, using a flux condition is
+equivalent to entering the viscous forces (either wind stress or bottom friction)
+as a body force over the depth of the top or bottom model layer. To illustrate
+this, consider the equation for $u$ at $k$, the last ocean level:
\begin{equation} \label{Eq_zdfbfr_flux2}
\frac{\partial u \; (k)}{\partial t} = \frac{1}{e_{3u}} \left[ A^{vm} \; (k) \frac{U \; (k1)  U \; (k)}{e_{3uw} \; (k1)}  F_u \right] \approx  \frac{F_u}{e_{3u}}
\end{equation}
For example, if the bottom layer thickness is 200~m, the Ekman transport will be
distributed over that depth. On the other hand, if the vertical resolution
+For example, if the bottom layer thickness is 200~m, the Ekman transport will
+be distributed over that depth. On the other hand, if the vertical resolution
is high (1~m or less) and a turbulent closure model is used, the turbulent
Ekman layer will be represented explicitly by the model. However, the
logarithmic layer is never represented in current primitive equation model
applications: it is \emph{necessary} to parameterize the flux $\textbf{F}_h $. Two
choices are available in OPA: a linear and a quadratic bottom friction. Note
that in both cases, the rotation between the interior velocity and the
bottom friction is neglected in the present release of OPA.
+applications: it is \emph{necessary} to parameterize the flux $\textbf{F}_h $.
+Two choices are available in \NEMO: a linear and a quadratic bottom friction.
+Note that in both cases, the rotation between the interior velocity and the
+bottom friction is neglected in the present release of \NEMO.
% 
% Linear Bottom Friction
% 
\subsection{Linear Bottom Friction}
+\subsection{Linear Bottom Friction (\np{nbotfr} = 1) }
\label{ZDF_bfr_linear}
%nambfr
\begin{flushright}
(\textbf{namelist} !nbotfr :\textit{ nbotfr = 0, = 1 or = 3})
\end{flushright}

The linear bottom friction parameterization assumes that the bottom friction is proportional to the interior velocity (i.e. the velocity of the last model level):
+The linear bottom friction parameterization assumes that the bottom friction
+is proportional to the interior velocity (i.e. the velocity of the last model level):
\begin{equation} \label{Eq_zdfbfr_linear}
\textbf{F}_h = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \textbf{U}_h^b
\end{equation}
where $\textbf{U}_h^b$ is the horizontal velocity vector of the bottom
ocean layer and $r$ a friction coefficient expressed in m.s$^{1}$. This
coefficient is generally estimated by setting a typical decay time $\tau $ in the
deep ocean, $r = H / \tau$. Commonly accepted values of $\tau$ are of the
order of 100 to 200 days \citep{Weatherly1984}. A value $\tau^{1} = 10^{7}$~s$^{1}$
corresponding to 115 days is usually used in quasigeostrophic models. One may
consider the linear friction as an approximation of quadratic friction,
$r \approx 2\;C_D\;U_{av}$ (\citet{Gill1982}, Eq. 9.6.6). With a drag coefficient $C_D = 0.002$, a typical value of tidal currents $U_{av} =0.1$~m.s$^{1}$,
and assuming an ocean depth $H = 4000$~m, the resulting friction
coefficient is $r = 4\;10^{4}$~m.s$^{1}$. This is the default value used in
OPA. It corresponds to a decay time scale of 115~days. It can be changed by
specifying \np{bfric1} (namelist parameter).

In the code, the bottom friction is specified by updating the value of the
vertical eddy coefficient at the bottom level. Indeed, the discrete
formulation of (\ref{Eq_zdfbfr_linear}) at the last ocean $T$level, using the fact that
$\textbf {U}_h =0$ inside the bottom, leads to
+\textbf{F}_h = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \; \textbf{U}_h^b
+\end{equation}
+where $\textbf{U}_h^b$ is the horizontal velocity vector of the bottom ocean
+layer and $r$ is a friction coefficient expressed in m.s$^{1}$. This coefficient
+is generally estimated by setting a typical decay time $\tau$ in the deep ocean,
+and setting $r = H / \tau$, where $H$ is the ocean depth. Commonly accepted
+values of $\tau$ are of the order of 100 to 200 days \citep{Weatherly1984}.
+A value $\tau^{1} = 10^{7}$~s$^{1}$ equivalent to 115 days, is usually used
+in quasigeostrophic models. One may consider the linear friction as an
+approximation of quadratic friction, $r \approx 2\;C_D\;U_{av}$ (\citet{Gill1982},
+Eq. 9.6.6). For example, with a drag coefficient $C_D = 0.002$, a typical speed
+of tidal currents of $U_{av} =0.1$~m.s$^{1}$, and assuming an ocean depth
+$H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{4}$~m.s$^{1}$.
+This is the default value used in \NEMO. It corresponds to a decay time scale
+of 115~days. It can be changed by specifying \np{bfric1} (namelist parameter).
+
+In the code, the bottom friction is imposed by updating the value of the
+vertical eddy coefficient at the bottom level. Indeed, the discrete formulation
+of (\ref{Eq_zdfbfr_linear}) at the last ocean $T$level, using the fact that
+$\textbf {U}_h =0$ below the ocean floor, leads to
\begin{equation} \label{Eq_zdfbfr_linKz}
\begin{split}
A_u^{vm} &= r\;e_{3uw}\\
A_v^{vm} &= r\;e_{3uw}\\
+A_v^{vm} &= r\;e_{3vw}\\
\end{split}
\end{equation}
Such an update is done in \mdl{zdfbfr} when \np{nbotfr}=1 and the value of $r$ used is
\np{bfric1}. Setting \np{nbotfr}=3 is equivalent to set $r=0$ and leads to a freeslip bottom boundary condition,
while setting \np{nbotfr}=0 imposes $r=2\;A_{vb}^{\rm {\bf U}} $, where $A_{vb}^{\rm {\bf U}} $ is the
background vertical eddy coefficient: a noslip boundary condition is used.
+This update is done in \mdl{zdfbfr} when \np{nbotfr}=1. The value of $r$
+used is \np{bfric1}. Setting \np{nbotfr}=3 is equivalent to setting $r=0$ and
+leads to a freeslip bottom boundary condition. Setting \np{nbotfr}=0 sets
+$r=2\;A_{vb}^{\rm {\bf U}} $, where $A_{vb}^{\rm {\bf U}} $ is the background
+vertical eddy coefficient, and a noslip boundary condition is imposed.
Note that this latter choice generally leads to an underestimation of the
bottom friction: for a deepest level thickness of $200~m$ and $A_{vb}^{\rm {\bf U}}
=10^{4}$m$^2$.s$^{1}$, the friction coefficient is only $r=10^{6}$m.s$^{1}$.

+bottom friction: for example with a deepest level thickness of $200~m$
+and $A_{vb}^{\rm {\bf U}} =10^{4}$m$^2$.s$^{1}$, the friction coefficient
+is only $r=10^{6}$m.s$^{1}$.
% 
% NonLinear Bottom Friction
% 
\subsection{NonLinear Bottom Friction}
+\subsection{NonLinear Bottom Friction (\np{nbotfr} = 2)}
\label{ZDF_bfr_nonlinear}

\begin{center}
(\textbf{namelist} !nbotfr : \textit{nbotfr = 2})
\end{center}
The nonlinear bottom friction parameterization assumes that the bottom
@@ 456,21 +578,26 @@
\end{equation}
with $\textbf{U}_h^b = (u_b\;,\;v_b)$ the horizontal interior velocity (i.e. the horizontal velocity of the bottom ocean layer), $C_D$ a drag coefficient, and $e_b $ a bottom turbulent kinetic energy due to tides, internal waves breaking and other short time scale currents. A typical value of the drag coefficient is $C_D = 10^{3} $. As an example, the CME experiment \citep{Treguier1992} uses $C_D = 10^{3}$ and $e_b = 2.5\;10^{3}$m$^2$.s$^{2}$, while the FRAM experiment \citep{Killworth1992} uses $e_b =0$
and $e_b =2.5\;\;10^{3}$m$^2$.s$^{2}$. The FRAM choices have been set as
default value (\np{bfric2} and \np{bfeb2} namelist parameters).

As for the linear case, the bottom friction is specified in the code by
+with $\textbf{U}_h^b = (u_b\;,\;v_b)$ the horizontal interior velocity ($i.e.$
+the horizontal velocity of the bottom ocean layer), $C_D$ a drag coefficient,
+and $e_b $ a bottom turbulent kinetic energy due to tides, internal waves
+breaking and other short time scale currents. A typical value of the drag
+coefficient is $C_D = 10^{3} $. As an example, the CME experiment
+\citep{Treguier1992} uses $C_D = 10^{3}$ and $e_b = 2.5\;10^{3}$m$^2$.s$^{2}$,
+while the FRAM experiment \citep{Killworth1992} uses $e_b =0$
+and $e_b =2.5\;\;10^{3}$m$^2$.s$^{2}$. The FRAM choices have been
+set as default values (\np{bfric2} and \np{bfeb2} namelist parameters).
+
+As for the linear case, the bottom friction is imposed in the code by
updating the value of the vertical eddy coefficient at the bottom level:

\begin{equation} \label{Eq_zdfbfr_nonlinKz}
\begin{split}
A_u^{vm} &=C_D\; e_{3uw} \left[ u^2 + \left(\bar{\bar{v}}^{i+1,j}\right)^2 + e_b \right]^
{1/2}\\
A_v^{vm} &=C_D\; e_{3uw} \left[ \left(\bar{\bar{u}}^{i+1,j}\right)^2 + v^2 + e_b \right]^{1/2}\\
+A_v^{vm} &=C_D\; e_{3uw} \left[ \left(\bar{\bar{u}}^{i,j+1}\right)^2 + v^2 + e_b \right]^{1/2}\\
\end{split}
\end{equation}
This update is done in \mdl{zdfbfr}. The coefficients that control the strength of the
nonlinear bottom friction are initialized as namelist parameters: ($C_D$= \np{bfri2}, and $e_b$ =\np{bfeb2}).

% ================================================================
+nonlinear bottom friction are initialized as namelist parameters: $C_D$= \np{bfri2}, and $e_b$ =\np{bfeb2}.
+
+% ================================================================
Index: trunk/DOC/TexFiles/Chapters/Introduction.tex
===================================================================
 trunk/DOC/BETA/Chapters/Introduction.tex (revision 781)
+++ trunk/DOC/TexFiles/Chapters/Introduction.tex (revision 994)
@@ 6,24 +6,93 @@
\chapter{Introduction}
The Nucleus for European Modelling of the Ocean (\NEMO) is a framework of ocean related engines, namely OPA for the Ocean dynamics and thermodynamics, LIM for the seaice dynamics and thermodynamics, TOP for the biogeochemistry (both transport (TRP) and sources minus sinks (LOBSTER, PISCES). It is intended to be a flexible tool for studying the ocean and its interactions with the others components of the earth climate system (atmosphere, seaice, biogeochemical tracers, ...) over a wide range of space and time scales. This documentation provides information about the physics represented by the OPA ocean model and the rationale for the choice of numerical schemes and the model design. More specific information about running the model on different computers, or how to set up a configuration, are found on the \NEMO web site (www.loceanipsl.upmc.fr/NEMO).
+The Nucleus for European Modelling of the Ocean (\NEMO) is a framework of ocean
+related engines, namely OPA\footnote{OPA = Oc\'{e}an PArall\'{e}lis\'{e}} for the
+ocean dynamics and thermodynamics, LIM\footnote{LIM= Louvain)laneuve Ice
+Model} for the seaice dynamics and thermodynamics, TOP\footnote{TOP = Tracer
+in the Ocean Paradigm} for the biogeochemistry (both transport (TRP) and sources
+minus sinks (LOBSTER, PISCES)\footnote{Both LOBSTER and PISCES are not
+acronyms just name}. It is intended to be a flexible tool for studying the ocean and
+its interactions with the other components of the earth climate system (atmosphere,
+seaice, biogeochemical tracers, ...) over a wide range of space and time scales.
+This documentation provides information about the physics represented by the ocean component of \NEMO and the rationale for the choice of numerical schemes and
+the model design. More specific information about running the model on different
+computers, or how to set up a configuration, are found on the \NEMO web site
+(www.loceanipsl.upmc.fr/NEMO).
The ocean component of \NEMO has been developed from the OPA8.2 model described in \citet{Madec1998}. This model has been used for a wide range of applications, either regional or global, as a forced ocean model or coupled with the atmosphere. A complete list of references is found on the \NEMO web site.
+The ocean component of \NEMO has been developed from the OPA model, release 8.2, described in \citet{Madec1998}. This model has been used for a wide range of applications, both regional or global, as a forced ocean model and as a model coupled with the atmosphere. A complete list of references is found on the \NEMO web site.
This manual is organised in as follows. Chapter~\ref{PE} presents the model basics, $i.e.$ the equations and their assumptions, the vertical coordinates used, and the subgrid scale physics. This part deals with the continuous equations of the model (primitive equations, with potential temperature, salinity and an equation of state). The equations are written in a curvilinear coordinate system, with a choice of vertical coordinates (z, s, and variable volumes). Momentum equations are formulated in the vector invariant form. The model equations are written in dimensional units in the meter, kilogram, second (MKS) international system.
+This manual is organised in as follows. Chapter~\ref{PE} presents the model basics,
+$i.e.$ the equations and their assumptions, the vertical coordinates used, and the
+subgrid scale physics. This part deals with the continuous equations of the model
+(primitive equations, with potential temperature, salinity and an equation of state). The
+equations are written in a curvilinear coordinate system, with a choice of vertical
+coordinates ($z$ or $s$, with the rescaled height coordinate formulation \textit{z*}, or
+\textit{s*}). Momentum equations are formulated in the vector invariant form or in the
+flux form. Dimensional units in the meter, kilogram, second (MKS) international system
+are used throughout.
The following chapters deal with the discrete equations. Chapter~\ref{DOM} presents the space and time domain. The model is discretised on a staggered grid (Arakawa C grid) with masking of land areas. Vertical discretisation uses $z$coordinates (including partial step), $s$ (terrainfollowing) coordinate (fixed volume thickness and linear free surface), or $s*$coordinate (variable volume thickness and nonlinear free surface). The following chapters describe the discretisation of the prognostic equations (momentum and tracers). Explicit, splitexplicit or implicit free surface formulations are implemented as well as aridlid approximation. A number of numerical schemes are available for momentum advection, for the computation of the pressure gradients, as well as for the advection of tracers (second or higher order advection schemes, including positive ones).
+The following chapters deal with the discrete equations. Chapter~\ref{DOM} presents the
+space and time domain. The model is discretised on a staggered grid (Arakawa C grid)
+with masking of land areas and uses a Leapfrog environment for timestepping. Vertical
+discretisation used depends on both how the bottom topography is represented and
+whether the free surface is linear or not. Full step or partial step $z$coordinate or
+$s$ (terrainfollowing) coordinate is used with linear free surface (level position are then
+fixed in time). In nonlinear free surface, the corresponding rescaled height coordinate
+formulation (\textit{z*} or \textit{s*}) is used (the level position then vary in time as a
+function of the sea surface heigh). The following two chapters (\ref{TRA} and \ref{DYN})
+describe the discretisation of the prognostic equations for the active tracers and the
+momentum. Explicit, splitexplicit and implicit free surface formulations are implemented
+as well as rigidlid case. A number of numerical schemes are available for momentum
+advection, for the computation of the pressure gradients, as well as for the advection of
+tracers (second or higher order advection schemes, including positive ones).
Other model characteristics are the lateral boundary conditions (chapter~\ref{LBC}). Global configurations of the model make use of the ORCA tripolar grid, with special north fold boundary condition. Freeslip or noslip boundary conditions are allowed at land boundaries. Closed basin geometries as well as periodic domains and open boundary conditions are possible.
+Surface boundary conditions (chapter~\ref{SBC}) can be implemented as prescribed
+fluxes, or bulk formulations for the surface fluxes (wind stress, heat, freshwater). The
+model allows penetration of solar radiation There is an optional geothermal heating at
+the ocean bottom. Within the \NEMO system the ocean model is interactively coupled
+with a sea ice model (LIM) and with biogeochemistry models (PISCES, LOBSTER).
+Interactive coupling to Atmospheric models is possible via the OASIS coupler
+\citep{OASIS2006}.
Surface boundary conditions (chapter~\ref{SBC}) can be implemented as prescribed fluxes, or bulk formulations for the surface fluxes (wind stress, heat, freshwater). The model allows penetration of solar radiation There is an optional geothermal heating at the ocean bottom. Within the \NEMO system the ocean model is interactively coupled with a sea ice model (LIM) and with biogeochemistry models (PISCES, LOBSTER). Interactive coupling to Atmospheric models is possible via the OASIS coupler \citep{OASIS2006}.
+Other model characteristics are the lateral boundary conditions (chapter~\ref{LBC}).
+Global configurations of the model make use of the ORCA tripolar grid, with special north
+fold boundary condition. Freeslip or noslip boundary conditions are allowed at land
+boundaries. Closed basin geometries as well as periodic domains and open boundary
+conditions are possible.
Physical parameterisations are described in chapters~\ref{LDF} and \ref{ZDF}. The model includes an implicit treatment of vertical viscosity and diffusivity. The lateral Laplacian and biharmonic viscosity and diffusion can be rotated following a geopotential or neutral direction. There is an optional eddy induced velocity \citep{Gent1990} with a space and time variable coefficient \citet{Treguier1997}. The model has vertical harmonic viscosity and diffusion with a space and time variable coefficient, with options to compute the coefficients with \citet{Blanke1993}, \citet{Large1994}, or \citet{PacPhil1981} mixing schemes.
+Physical parameterisations are described in chapters~\ref{LDF} and \ref{ZDF}. The
+model includes an implicit treatment of vertical viscosity and diffusivity. The lateral
+Laplacian and biharmonic viscosity and diffusion can be rotated following a geopotential
+or neutral direction. There is an optional eddy induced velocity \citep{Gent1990} with a
+space and time variable coefficient \citet{Treguier1997}. The model has vertical harmonic
+viscosity and diffusion with a space and time variable coefficient, with options to compute
+the coefficients with \citet{Blanke1993}, \citet{Large1994}, or \citet{PacPhil1981} mixing
+schemes.
Specific online diagnostics (not documented yet) are available in the model: output of all the tendencies of the momentum and tracers equations, output of tracers tendencies averaged over the time evolving mixed layer.
+Specific online diagnostics (not documented yet) are available in the model: output of all
+the tendencies of the momentum and tracers equations, output of tracers tendencies
+averaged over the time evolving mixed layer.
The model is implemented in \textsc{Fortran 90}, with preprocessing (Cpreprocessor). It runs under UNIX. It is optimized for vector computers and parallelised by domain decomposition with MPI. All input and output is done in NetCDF (Network Common Data Format) with a optional direct access format for output. To ensure the clarity and readability of the code it is necessary to follow coding rules. The coding rules for OPA include conventions for naming variables, with different starting letters for different types of variables (real, integer, parameter\ldots) Those rules are presented in a document available on the \NEMO web site..
+The model is implemented in \textsc{Fortran 90}, with preprocessing (Cpreprocessor).
+It runs under UNIX. It is optimized for vector computers and parallelised by domain
+decomposition with MPI. All input and output is done in NetCDF (Network Common Data
+Format) with a optional direct access format for output. To ensure the clarity and
+readability of the code it is necessary to follow coding rules. The coding rules for OPA
+include conventions for naming variables, with different starting letters for different types
+of variables (real, integer, parameter\ldots). Those rules are presented in a document
+available on the \NEMO web site.
The model is organized with a high internal modularity based on physics. In particular, each trend (e.g., a term in the rhs of the prognostic equation) for momentum and tracers is computed in a dedicated module. To make it easier for the user to find his way around the code, the module names follow the threeletter rule. Each module name is made of threeletter sequences. For example, \mdl{tradmp} is a module related to the TRAcers equation, computing the DaMPing. The complete list of module names is presented in annex. Furthermore, modules are organized in a few directories that correspond to their category, as indicated by the first three letters of their name.
The manual follows this organization. After the presentation of the continuous equations (Chapter \ref{PE}), the following chapters refer to specific terms of the equations each associated with a group of modules .
+The model is organized with a high internal modularity based on physics. For example,
+each trend ($i.e.$, a term in the RHS of the prognostic equation) for momentum and
+tracers is computed in a dedicated module. To make it easier for the user to find his way
+around the code, the module names follow a threeletter rule. For example, \mdl{tradmp}
+is a module related to the TRAcers equation, computing the DaMPing. The complete list
+of module names is presented in \colorbox{yellow}{annex}. Furthermore, modules are
+organized in a few directories that correspond to their category, as indicated by the first
+three letters of their name.
+
+The manual mirrors the organization of the model. After the presentation of the
+continuous equations (Chapter \ref{PE}), the following chapters refer to specific terms of
+the equations each associated with a group of modules .
@@ 31,5 +100,5 @@
%\begin{center} \begin{tabular}{p{143pt}ll} \hline
\begin{center} \begin{tabular}{lll} \hline
Chapter \ref{DOM} & DOM & Model DOMain \\ \hline
+Chapter \ref{DOM} & DOM & model DOMain \\ \hline
Chapter \ref{TRA} & TRA & TRAcer equations (potential temperature and salinity) \\ \hline
Chapter \ref{DYN} & DYN & DYNamic equations (momentum) \\ \hline
@@ 42,19 +111,23 @@
\end{table}
In the current release (v2.3), LBC directory (see Chap.~\ref{LBC}) does not yet exist. When created LBC will gather OBC directory (Open Boundary Condition), \mdl{lbclnk}, \mdl{mppini} and \mdl{lib\_mpp} modules.
+In the current release (v2.3), LBC directory (see Chap.~\ref{LBC}) does not yet exist.
+When created LBC will contain the OBC directory (Open Boundary Condition), and the
+\mdl{lbclnk}, \mdl{mppini} and \mdl{lib\_mpp} modules.
\vspace{1cm} Nota Bene : \vspace{0.25cm}
OPA, like all research tools, is in perpetual evolution. The present document describes the OPA model include in the release 2.3 of NEMO. This release differs significantly from version 8, documented in \citet{Madec1998}. The major modifications are :\\
(1) transition to full native \textsc{Fortran} 90, deep code restructuring and drastic reduction of CPP keys, \\
(2) introduction of partial step representation of bottom topography \\
(3) partial reactivation of a terrainfollowing vertical coordinate ($s$ and hybrid $s$$z$) with the addition of several options for pressure gradient computation \footnote{Partial support of $s$coordinate: there is presently no support for neutral physics in $s$coordinate and for the new options for horizontal pressure gradient computation with true equation of state.}, \\
(4) more choices for the treatment of the free surface: full explicit, splitexplicit , filtered and rigidlid \\
(5) non linear free surface option (variable level thickness distributed on the whole water column) \\
(6) additional schemes for vector and flux forms of the momentum advection \\
(7) addition of several advection schemes on tracers \\
 (8) implementation of the AGRIF package (Adaptative Grid Refinement in \textsc{Fortran} ) \\
(9) online diagnostics : tracers trend in the mixed layer and vorticity balance \\
(10) rewriting of the I/O management \\
+OPA, like all research tools, is in perpetual evolution. The present document describes
+the OPA version include in the release 2.3 of NEMO. This release differs significantly
+from version 8, documented in \citet{Madec1998}. The main modifications are :\\
+(1) transition to full native \textsc{Fortran} 90, deep code restructuring and drastic reduction of CPP keys; \\
+(2) introduction of partial step representation of bottom topography \citep{Barnier_al_OD06}; \\
+(3) partial reactivation of a terrainfollowing vertical coordinate ($s$ and hybrid $s$$z$) with the addition of several options for pressure gradient computation \footnote{Partial support of $s$coordinate: there is presently no support for neutral physics in $s$coordinate and for the new options for horizontal pressure gradient computation with a nonlinear equation of state.}; \\
+(4) more choices for the treatment of the free surface: full explicit, splitexplicit , filtered and rigidlid; \\
+(5) non linear free surface option (associated with the rescaled height coordinate \textit{z*} or \textit{s*}); \\
+(6) additional schemes for vector and flux forms of the momentum advection; \\
+(7) additional advection schemes for tracers; \\
+(8) implementation of the AGRIF package (Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008}; \\
+(9) online diagnostics : tracers trend in the mixed layer and vorticity balance; \\
+(10) rewriting of the I/O management; \\
(11) OASIS 3 and 4 couplers interfacing with atmospheric global circulation models.
@@ 63,5 +136,5 @@
At the time of this writing, the current release is NEMO 2.3. The new surface module described in this document is not yet part of the current distribution.

+\vspace{1cm}
\colorbox{red}{Red color}: not in the current reference version (v2.3) but expected soon.
Index: trunk/DOC/TexFiles/NEMO_book.tex
===================================================================
 trunk/DOC/BETA/NEMO_book.tex (revision 781)
+++ trunk/DOC/TexFiles/NEMO_book.tex (revision 994)
@@ 6,4 +6,7 @@
\documentclass[a4paper,12pt]{book}
+% makeindex NEMO_book <== to regenerate the index
+% bibtex NEMO_book <== to generate the bibliography
+
% ================================================================
% HEADERS DEFINITION
@@ 15,4 +18,7 @@
\usepackage{alltt} %% alltt for namelist
\usepackage{verbatim} %% alltt for namelist
+
+%hyperref ===>>> don't work.....
+%\usepackage[a4paper=true,ps2pdf=true,pagebackref=true,breaklinks=true]{hyperref}
%\usepackage{amssymb}
@@ 124,6 +130,7 @@
\newcommand{\pp} [1] {\textit{#1}\index{Model parameters!#1}}%namelist parameter (pp)
\newcommand{\key} [1] {\textbf{key\_#1}\index{CPP keys!key\_#1}} %key_cpp (key)
\newcommand{\NEMO} {\textit{NEMO}} %NEMO (nemo)
\newcommand{\amtcomment}[1]{} % command to allow "commented out" portions of
+\newcommand{\NEMO} {\textit{NEMO }} %NEMO (nemo)
+\newcommand{\amtcomment}[1]{#1} % command to allow "commented out" portions of
+\newcommand{\gmcomment}[1]{} % command to allow "commented out" portions of
% % text that span line breaks
@@ 134,5 +141,5 @@
\newcommand{\namdisplay} [1] {
\begin{alltt} {{\tiny \verbatiminput{./Namelist/#1}}} \end{alltt}
 \vspace{15pt} }
+ \vspace{10pt} }
%
@@ 159,20 +166,42 @@
% FRONT PAGE
% ================================================================
\title{ \includegraphics[width=0.4\textwidth]{./Figures/NEMO_logo.pdf} \\
+
+\title{
+\includegraphics[width=0.2\textwidth]{./Figures/logo_CNRS.pdf}
+\quad
+\includegraphics[width=0.2\textwidth]{./Figures/logo_MERCATOR.pdf}
+\quad
+\includegraphics[width=0.1\textwidth]{./Figures/logo_UKMO.pdf}
+\quad
+\includegraphics[width=0.2\textwidth]{./Figures/logo_NERC.pdf} \\
+\vspace{3.0cm}
+\includegraphics[width=0.3\textwidth]{./Figures/NEMO_logo_Black.pdf} \\
+\vspace{1.0cm}
\rule{345pt}{1.5pt} \\
\vspace{0.45cm}
{\Huge NEMO ocean engine}
\rule{345pt}{1.5pt} \\
{\small NEMO v2.3} \\
{  Draft } }
\date{\today}
+%{\small NEMO v2.3} \\
+{\small  version 3.0 } }
+%{  Draft } }
+%\date{\today}
+\date{
+May 2008 \\
+\textit{\small Note du P\^ole de mod\'{e}lisation de l'Institut PierreSimon Laplace No 27 }\\
+\vspace{0.45cm}
+{ ISSN No 12881619.}
+}
+
+
+%%\includegraphics[width=0.2\textwidth]{./Figures/logo_NERC.pdf} \\
%% \hbox{\mbox{%
%% \hspace{4pt}%
%% \fbox{\includegraphics[width=3em]{./NEMO_logo.pdf}}%
+%% \hspace{4pt}%
+%% \fbox{\includegraphics[width=3em]{./Figures/logo_CNRS.pdf}}%
%% \hspace{4pt}
%% } }%
\author{Gurvan Madec  \texttt{{\small gurvan.madec@loceanipsl.umpc.fr}} \\
+\author{ \Large Gurvan Madec \\
+ \texttt{\small gurvan.madec@loceanipsl.umpc.fr} \\
{\small Laboratoire d'Oc\'{e}anographie et du Climat: Exp\'{e}rimentation et Approches Num\'{e}riques}
}
@@ 186,5 +215,6 @@
% ================================================================
%\includeonly{./Chapters/Annex_E,./Chapters/Annex_C}
+%\includeonly{./Chapters/Chap_MISC}
+%\includeonly{./Chapters/Annex_E}
%\includeonly{./Chapters/Chap_LBC,./Chapters/Chap_MISC}
%\includeonly{./Chapters/Chap_Model_Basics_zstar}
@@ 223,5 +253,5 @@
\include{./Chapters/Chap_Model_Basics}
%\include{./Chapters/Chap_Model_Basics_zstar} % attent to describe z*s*
+%\include{./Chapters/Chap_Model_Basics_zstar} % attent to describe z*s*
\include{./Chapters/Chap_DOM}
@@ 245,10 +275,10 @@
% ================================================================
%\appendix
+\appendix
%\include{./Chapters/Chap_Conservation}
%\include{./Chapters/Annex_A}
%\include{./Chapters/Annex_B}
%\include{./Chapters/Annex_C}
+\include{./Chapters/Annex_A}
+\include{./Chapters/Annex_B}
+\include{./Chapters/Annex_C}
%\include{./Chapters/Annex_D}
%\include{./Chapters/Annex_E}
@@ 268,5 +298,5 @@
%%\bibliographystyle{plainnat}
\bibliographystyle{./ametsoc} % AMS biblio style (JPO)
\bibliography{./Biblio/biblio}
+\bibliography{./Biblio/Biblio}
% ================================================================
Index: trunk/DOC/TexFiles/Namelist/namsbc
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc (revision 994)
@@ 0,0 +1,23 @@
+!
+&namsbc Surface Boundary Condition (surface module)
+!
+ nn_fsbc = 5 ! frequency of surface boundary condition computation
+ ! (also the frequency of seaice model call)
+ ln_ana = .false. ! analytical formulation (fill namsbc_ana )
+ ln_flx = .false. ! flux formulation (fill namsbc_flx )
+ ln_blk_clio = .true. ! CLIO bulk formulation (fill namsbc_core)
+ ln_blk_core = .false. ! CORE bulk formulation (fill namsbc_clio)
+ ln_cpl = .false. ! coupled formulation (fill namsbc_cpl )
+ nn_ice = 2 ! ice areas : =0 no ice in the domain
+ ! =1 specify observed icecover
+ ! =2 use an icemodel ("key_lim3" or "key_lim2)
+ nn_ico_cpl = 0 ! iceocean stress : =0 LIM3 old case
+ ! =1 stresses computed using now ocean velocity
+ ! =2 combination of 0 and 1 cases
+ ln_dm2dc = .false. ! Daily mean converted into Diurnal Cycle for short wave (qsr)
+ ln_rnf = .false. ! river runoffs (fill namsbc_rnf)
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget : =0 no control
+ ! =1 annual global mean set to zero
+ ! =2 global mean instantaneously set to zero
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_alb
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_alb (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_alb (revision 994)
@@ 0,0 +1,9 @@
+!
+&namalb albedo parameters
+!
+ cgren = 0.06 ! correction of the snow or ice albedo to take into account
+ albice = 0.5 ! albedo of melting ice in the arctic and antarctic
+ alphd = 0.80 ! coefficients for linear interpolation used to compute
+ alphc = 0.65 ! the albedo between two extremes values (Pyane, 1972)
+ alphdi = 0.72 !
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_ana
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_ana (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_ana (revision 994)
@@ 0,0 +1,10 @@
+!
+&namsbc_ana analytical surface boundary condition
+!
+ nn_tau000 = 0 ! gently increase the stress over the first ntau_rst timesteps
+ rn_utau0 = 0.5 ! uniform value for the istress
+ rn_vtau0 = 0.e0 ! uniform value for the jstress
+ rn_q0 = 0.e0 ! uniform value for the total heat flux
+ rn_qsr0 = 0.e0 ! uniform value for the solar radiation
+ rn_emp0 = 0.e0 ! uniform value for the freswater budget (EP)
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_clio
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_clio (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_clio (revision 994)
@@ 0,0 +1,16 @@
+!
+&namsbc_clio CLIO bulk formulea
+!
+ cn_dir = './' ! directory in which the model is executed
+!
+! THE ORDER OF THE FILES MATTER:
+! ! file name ! frequency (hours) ! variable ! time interpolation ! clim ! starting !
+! ! ! (if <0 months) ! name ! (logical) ! (0/1) ! record !
+ sn_utau = 'taux_1m' , 12. , 'sozotaux' , .false. , 1 , 0
+ sn_vtau = 'tauy_1m' , 12. , 'sometauy' , .false. , 1 , 0
+ sn_wndm = 'flx' , 12. , 'socliowi' , .false. , 1 , 0
+ sn_tair = 'flx' , 12. , 'socliot1' , .false. , 1 , 0
+ sn_humi = 'flx' , 12. , 'socliohu' , .false. , 1 , 0
+ sn_ccov = 'flx' , 12. , 'socliocl' , .false. , 1 , 0
+ sn_prec = 'flx' , 12. , 'socliopl' , .false. , 1 , 0
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_core
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_core (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_core (revision 994)
@@ 0,0 +1,19 @@
+!
+&namsbc_core CORE bulk formulea
+!
+ cn_dir = './' ! directory in which the model is executed
+ ln_2m = .false. ! logical flag to use air temp. and hum referenced at 2m instead 10m
+ alpha_precip = 1. ! multiplication factor for precipitation (total & snow)
+!
+! THE ORDER OF THE FILES MATTER:
+! ! file name ! frequency (hours) ! variable ! time interpolation ! clim ! starting !
+! ! ! (if <0 months) ! name ! (logical) ! (0/1) ! record !
+ sn_wndi = 'u10' , 24. , 'U_10_MOD' , .false. , 1 , 0
+ sn_wndj = 'v10' , 24. , 'V_10_MOD' , .false. , 1 , 0
+ sn_qsr = 'rad' , 24. , 'SWDN_MOD' , .false. , 1 , 0
+ sn_qlw = 'rad' , 24. , 'LWDN_MOD' , .false. , 1 , 0
+ sn_tair = 't10' , 24. , 'T_10_MOD' , .false. , 1 , 0
+ sn_humi = 'q10' , 24. , 'Q_10_MOD' , .false. , 1 , 0
+ sn_prec = 'precip' , 12. , 'RAIN' , .false. , 1 , 0
+ sn_snow = 'precip' , 12. , 'SNOW' , .false. , 1 , 0
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_cpl
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_cpl (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_cpl (revision 994)
@@ 0,0 +1,4 @@
+!
+&namsbc_cpl coupled ocean/atmosphere model
+!
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_flx
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_flx (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_flx (revision 994)
@@ 0,0 +1,14 @@
+!
+&namsbc_flx surface boundary condition : flux formulation
+!
+ cn_dir = './' ! directory in which the model is executed
+!
+! THE ORDER OF THE FILES MATTER:
+! ! file name ! frequency (hours) ! variable ! time interpolation ! clim ! starting !
+! ! ! (if <0 months) ! name ! (logical) ! (0/1) ! record !
+ sn_utau = 'utau.nc' , 24. , 'utau' , .false. , 0 , 0
+ sn_vtau = 'vtau.nc' , 24. , 'vtau' , .false. , 0 , 0
+ sn_qtot = 'qtot.nc' , 24. , 'qtot' , .false. , 0 , 0
+ sn_qsr = 'qsr.nc' , 24. , 'qsr' , .false. , 0 , 0
+ sn_emp = 'emp.nc' , 24. , 'emp' , .false. , 0 , 0
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_qsr
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_qsr (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_qsr (revision 994)
@@ 0,0 +1,8 @@
+!
+&namqsr penetrative solar radiation
+!
+ ln_traqsr = .true. ! penetrative solar radiation (T) or not (F)
+ rabs = 0.58 ! fraction of qsr associated with xsi1
+ xsi1 = 0.35 ! first depth of extinction
+ xsi2 = 23.0 ! second depth of extinction
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_rnf
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_rnf (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_rnf (revision 994)
@@ 0,0 +1,14 @@
+!
+&namsbc_rnf runoffs namelist surface boundary condition
+!
+ cn_dir = './' ! directory in which the model is executed
+ nn_runoff = 2 ! =0 no runoffs, 1 runoffs, 2 runoffs+river mouth ups adv
+ rn_hrnf = 0.e0 ! runoffs, depth over which enhanced vertical mixing is used
+ rn_avt_rnf = 1.e3 ! runoffs, value of the additional vertical mixing coef. [m2/s]
+!
+! THE ORDER OF THE FILES MATTER:
+! ! file name ! frequency (hours) ! variable ! time interpolation ! clim ! starting !
+! ! ! (if <0 months) ! name ! (logical) ! (0/1) ! record !
+ sn_rnf = 'runoff_1m_nomask.nc' , 12. , 'sorunoff', .true. , 1 , 0
+ sn_cnf = 'runoff_1m_nomask.nc' , 0. , 'socoefr' , .false. , 1 , 0
+/
Index: trunk/DOC/TexFiles/Namelist/namsbc_ssr
===================================================================
 trunk/DOC/TexFiles/Namelist/namsbc_ssr (revision 994)
+++ trunk/DOC/TexFiles/Namelist/namsbc_ssr (revision 994)
@@ 0,0 +1,17 @@
+!
+&namsbc_ssr surface boundary condition : sea surface restoring
+!
+ cn_dir = './' ! directory in which the model is executed
+ nn_sstr = 0 ! =0/1 add a retroaction term in the surface heat flux
+ nn_sssr = 0 ! =O/1/2 add a damping term in the surface freshwater flux
+ ! (=1, salt flux, concentration/dillution emps only)
+ ! (=2, volume flux, both emp and emps are updated)
+ dqdt = 40. ! magnitude of the retroaction on temperature [W/m2/K]
+ deds = 27.7 ! magnitude of the damping on salinity [mm/day]
+!
+! THE ORDER OF THE FILES MATTER:
+! ! file name ! frequency (hours) ! variable ! time interpolation ! clim ! starting !
+! ! ! (if <0 months) ! name ! (logical) ! (0/1) ! record !
+ sn_sst = 'sst_data.nc' , 24. , 'sst' , .false. , 0 , 0
+ sn_sss = 'sss_data.nc' , 12. , 'sss' , .true. , 0 , 0
+/