Index: /NEMO/trunk/cfgs/SHARED/axis_def_nemo.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/axis_def_nemo.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/axis_def_nemo.xml	(revision 14072)
@@ -1,31 +1,31 @@
 <!--
-============================================================================================================
-= Axis definition = = DO NOT CHANGE =
-============================================================================================================
-    -->
+    ============================================================================================================
+    = Axis definition = = DO NOT CHANGE =
+    ============================================================================================================
+-->
 
-    <axis_definition>
-      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
-      <!--   Vertical zoom for a 31-levels ORCA2 grid for eORCA1 300m corresponds to n=35 -->
-      <axis id="deptht300" axis_ref="deptht" >
-         <zoom_axis begin="0" n="19" />
-      </axis>
-      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" />
-      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" />
-      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" />
-      <axis id="depthf"  long_name="Vertical F levels" unit="m" positive="down" />
-      <axis id="nfloat"  long_name="Float number"      unit="-"                 />
-      <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
-      <axis id="ncatice" long_name="Ice category"       unit="1"               />
-      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
-      <axis id="iax_26C" long_name="26 degC isotherm"   unit="degC"            />
-      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
-      <axis id="basin"   long_name="Sub-basin mask (1=Global 2=Atlantic 3=Indo-Pacific 4=Indian, 5=Pacific)"  unit="1" />
-      <axis id="nstrait" long_name="Number of straits" unit="1" />
-      <!-- ABL vertical axis definition -->
-      <axis id="ght_abl" long_name="ABL Vertical T levels" unit="m" positive="up"   />
-      <axis id="ghw_abl" long_name="ABL Vertical W levels" unit="m" positive="up"   />
-      <axis id="section"     n_glo="16" />
-      <axis id="section_ice" n_glo="4" />
-      <axis id="gau" />
-    </axis_definition>
+<axis_definition>
+  <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+  <!--   Vertical zoom for a 31-levels ORCA2 grid for eORCA1 300m corresponds to n=35 -->
+  <axis id="deptht300" axis_ref="deptht" >
+    <zoom_axis begin="0" n="19" />
+  </axis>
+  <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" />
+  <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" />
+  <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" />
+  <axis id="depthf"  long_name="Vertical F levels" unit="m" positive="down" />
+  <axis id="nfloat"  long_name="Float number"      unit="-"                 />
+  <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+  <axis id="ncatice" long_name="Ice category"       unit="1"               />
+  <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+  <axis id="iax_26C" long_name="26 degC isotherm"   unit="degC"            />
+  <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+  <axis id="basin"   long_name="Sub-basin mask (1=Global 2=Atlantic 3=Indo-Pacific 4=Indian, 5=Pacific)"  unit="1" />
+  <axis id="nstrait" long_name="Number of straits" unit="1" />
+  <!-- ABL vertical axis definition -->
+  <axis id="ght_abl" long_name="ABL Vertical T levels" unit="m" positive="up"   />
+  <axis id="ghw_abl" long_name="ABL Vertical W levels" unit="m" positive="up"   />
+  <axis id="section"     n_glo="16" />
+  <axis id="section_ice" n_glo="4" />
+  <axis id="gau" />
+</axis_definition>
Index: /NEMO/trunk/cfgs/SHARED/domain_def_nemo.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/domain_def_nemo.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/domain_def_nemo.xml	(revision 14072)
@@ -1,200 +1,199 @@
 
-   <domain_definition>
+<domain_definition>
 
-     <!--   T grid   -->
-     <domain id="grid_T" long_name="grid T"/>
-     
-     <!--   My zoom: example of hand defined zoom   -->
-     <domain id="myzoomT" domain_ref="grid_T" >
-       <zoom_domain ibegin="1" jbegin="1" ni="2" nj="3"/>
-     </domain>
+  <!--   T grid   -->
+  <domain id="grid_T" long_name="grid T"/>
 
-      <domain id="1point" domain_ref="grid_T" >
-         <zoom_domain ibegin="139" jbegin="119" ni="1" nj="1"/>
-      </domain>
+  <!--   My zoom: example of hand defined zoom   -->
+  <domain id="myzoomT" domain_ref="grid_T" >
+    <zoom_domain ibegin="1" jbegin="1" ni="2" nj="3"/>
+  </domain>
+
+  <domain id="1point" domain_ref="grid_T" >
+    <zoom_domain ibegin="139" jbegin="119" ni="1" nj="1"/>
+  </domain>
 
 
-     <!--   Eq section -->
-     <domain id="EqT" domain_ref="grid_T" > <zoom_domain id="EqT"/> </domain>
-     <!--   TAO : see example above   -->
-     <!--   137e   -->
-     <domain id="2n137eT" domain_ref="grid_T" > <zoom_domain id="2n137eT"/> </domain>
-     <domain id="5n137eT" domain_ref="grid_T" > <zoom_domain id="5n137eT"/> </domain>
-     <domain id="8n137eT" domain_ref="grid_T" > <zoom_domain id="8n137eT"/> </domain>
-     <!-- <\!--   147e   -\-> -->
-     <domain id="0n147eT" domain_ref="grid_T" > <zoom_domain id="0n147eT"/> </domain>
-     <domain id="2n147eT" domain_ref="grid_T" > <zoom_domain id="2n147eT"/> </domain>
-     <domain id="5n147eT" domain_ref="grid_T" > <zoom_domain id="5n147eT"/> </domain>
-     <!-- <\!--   156e   -\-> -->
-     <domain id="5s156eT" domain_ref="grid_T" > <zoom_domain id="5s156eT"/> </domain>
-     <domain id="2s156eT" domain_ref="grid_T" > <zoom_domain id="2s156eT"/> </domain>
-     <domain id="0n156eT" domain_ref="grid_T" > <zoom_domain id="0n156eT"/> </domain>
-     <domain id="2n156eT" domain_ref="grid_T" > <zoom_domain id="2n156eT"/> </domain>
-     <domain id="5n156eT" domain_ref="grid_T" > <zoom_domain id="5n156eT"/> </domain>
-     <domain id="8n156eT" domain_ref="grid_T" > <zoom_domain id="8n156eT"/> </domain>
-     <!-- <\!--   165e   -\-> -->
-     <domain id="8s165eT" domain_ref="grid_T" > <zoom_domain id="8s165eT"/> </domain>
-     <domain id="5s165eT" domain_ref="grid_T" > <zoom_domain id="5s165eT"/> </domain>
-     <domain id="2s165eT" domain_ref="grid_T" > <zoom_domain id="2s165eT"/> </domain>
-     <domain id="0n165eT" domain_ref="grid_T" > <zoom_domain id="0n165eT"/> </domain>
-     <domain id="2n165eT" domain_ref="grid_T" > <zoom_domain id="2n165eT"/> </domain>
-     <domain id="5n165eT" domain_ref="grid_T" > <zoom_domain id="5n165eT"/> </domain>
-     <domain id="8n165eT" domain_ref="grid_T" > <zoom_domain id="8n165eT"/> </domain>
-     <!-- <\!--   180w   -\-> -->
-     <domain id="8s180wT" domain_ref="grid_T" > <zoom_domain id="8s180wT"/> </domain>
-     <domain id="5s180wT" domain_ref="grid_T" > <zoom_domain id="5s180wT"/> </domain>
-     <domain id="2s180wT" domain_ref="grid_T" > <zoom_domain id="2s180wT"/> </domain>
-     <domain id="0n180wT" domain_ref="grid_T" > <zoom_domain id="0n180wT"/> </domain>
-     <domain id="2n180wT" domain_ref="grid_T" > <zoom_domain id="2n180wT"/> </domain>
-     <domain id="5n180wT" domain_ref="grid_T" > <zoom_domain id="5n180wT"/> </domain>
-     <domain id="8n180wT" domain_ref="grid_T" > <zoom_domain id="8n180wT"/> </domain>
-     <!-- <\!--   170w   -\-> -->
-     <domain id="8s170wT" domain_ref="grid_T" > <zoom_domain id="8s170wT"/> </domain>
-     <domain id="5s170wT" domain_ref="grid_T" > <zoom_domain id="5s170wT"/> </domain>
-     <domain id="2s170wT" domain_ref="grid_T" > <zoom_domain id="2s170wT"/> </domain>
-     <domain id="0n170wT" domain_ref="grid_T" > <zoom_domain id="0n170wT"/> </domain>
-     <domain id="2n170wT" domain_ref="grid_T" > <zoom_domain id="2n170wT"/> </domain>
-     <domain id="5n170wT" domain_ref="grid_T" > <zoom_domain id="5n170wT"/> </domain>
-     <domain id="8n170wT" domain_ref="grid_T" > <zoom_domain id="8n170wT"/> </domain>
-     <!-- <\!--   155w   -\-> -->
-     <domain id="8s155wT" domain_ref="grid_T" > <zoom_domain id="8s155wT"/> </domain>
-     <domain id="5s155wT" domain_ref="grid_T" > <zoom_domain id="5s155wT"/> </domain>
-     <domain id="2s155wT" domain_ref="grid_T" > <zoom_domain id="2s155wT"/> </domain>
-     <domain id="0n155wT" domain_ref="grid_T" > <zoom_domain id="0n155wT"/> </domain>
-     <domain id="2n155wT" domain_ref="grid_T" > <zoom_domain id="2n155wT"/> </domain>
-     <domain id="5n155wT" domain_ref="grid_T" > <zoom_domain id="5n155wT"/> </domain>
-     <domain id="8n155wT" domain_ref="grid_T" > <zoom_domain id="8n155wT"/> </domain>
-     <!-- <\!--   140w   -\-> -->
-     <domain id="8s140wT" domain_ref="grid_T" > <zoom_domain id="8s140wT"/> </domain>
-     <domain id="5s140wT" domain_ref="grid_T" > <zoom_domain id="5s140wT"/> </domain>
-     <domain id="2s140wT" domain_ref="grid_T" > <zoom_domain id="2s140wT"/> </domain>
-     <domain id="0n140wT" domain_ref="grid_T" > <zoom_domain id="0n140wT"/> </domain>
-     <domain id="2n140wT" domain_ref="grid_T" > <zoom_domain id="2n140wT"/> </domain>
-     <domain id="5n140wT" domain_ref="grid_T" > <zoom_domain id="5n140wT"/> </domain>
-     <domain id="8n140wT" domain_ref="grid_T" > <zoom_domain id="8n140wT"/> </domain>
-     <!-- <\!--   125w   -\-> -->
-     <domain id="8s125wT" domain_ref="grid_T" > <zoom_domain id="8s125wT"/> </domain>
-     <domain id="5s125wT" domain_ref="grid_T" > <zoom_domain id="5s125wT"/> </domain>
-     <domain id="2s125wT" domain_ref="grid_T" > <zoom_domain id="2s125wT"/> </domain>
-     <domain id="0n125wT" domain_ref="grid_T" > <zoom_domain id="0n125wT"/> </domain>
-     <domain id="2n125wT" domain_ref="grid_T" > <zoom_domain id="2n125wT"/> </domain>
-     <domain id="5n125wT" domain_ref="grid_T" > <zoom_domain id="5n125wT"/> </domain>
-     <domain id="8n125wT" domain_ref="grid_T" > <zoom_domain id="8n125wT"/> </domain>
-     <!-- <\!--   110w   -\-> -->
-     <domain id="8s110wT" domain_ref="grid_T" > <zoom_domain id="8s110wT"/> </domain>
-     <domain id="5s110wT" domain_ref="grid_T" > <zoom_domain id="5s110wT"/> </domain>
-     <domain id="2s110wT" domain_ref="grid_T" > <zoom_domain id="2s110wT"/> </domain>
-     <domain id="0n110wT" domain_ref="grid_T" > <zoom_domain id="0n110wT"/> </domain>
-     <domain id="2n110wT" domain_ref="grid_T" > <zoom_domain id="2n110wT"/> </domain>
-     <domain id="5n110wT" domain_ref="grid_T" > <zoom_domain id="5n110wT"/> </domain>
-     <domain id="8n110wT" domain_ref="grid_T" > <zoom_domain id="8n110wT"/> </domain>
-     <!-- <\!--   95w   -\-> -->
-     <domain id="8s95wT" domain_ref="grid_T" > <zoom_domain id="8s95wT"/> </domain>
-     <domain id="5s95wT" domain_ref="grid_T" > <zoom_domain id="5s95wT"/> </domain>
-     <domain id="2s95wT" domain_ref="grid_T" > <zoom_domain id="2s95wT"/> </domain>
-     <domain id="0n95wT" domain_ref="grid_T" > <zoom_domain id="0n95wT"/> </domain>
-     <domain id="2n95wT" domain_ref="grid_T" > <zoom_domain id="2n95wT"/> </domain>
-     <domain id="5n95wT" domain_ref="grid_T" > <zoom_domain id="5n95wT"/> </domain>
-     <domain id="8n95wT" domain_ref="grid_T" > <zoom_domain id="8n95wT"/> </domain>
-     <!-- <\!--   RAMA   -\-> -->
-     <!-- <\!--   55e   -\-> -->
-     <domain id="16s55eT"    domain_ref="grid_T" > <zoom_domain id="16s55eT"   /> </domain>
-     <domain id="12s55eT"    domain_ref="grid_T" > <zoom_domain id="12s55eT"   /> </domain>
-     <domain id="8s55eT"     domain_ref="grid_T" > <zoom_domain id="8s55eT"    /> </domain>
-     <domain id="4s55eT"     domain_ref="grid_T" > <zoom_domain id="4s55eT"    /> </domain>
-     <domain id="1.5s55eT"   domain_ref="grid_T" > <zoom_domain id="1.5s55eT"  /> </domain>
-     <domain id="0n55eT"     domain_ref="grid_T" > <zoom_domain id="0n55eT"    /> </domain>
-     <domain id="1.5n55eT"   domain_ref="grid_T" > <zoom_domain id="1.5n55eT"  /> </domain>
-     <domain id="4n55eT"     domain_ref="grid_T" > <zoom_domain id="4n55eT"    /> </domain>
-     <!--    <\!--   65e   -\-> -->
-     <domain id="15n65eT"    domain_ref="grid_T" > <zoom_domain id="15n65eT"   /> </domain>
-     <!--    <\!--   67e   -\-> -->
-     <domain id="16s67eT"    domain_ref="grid_T" > <zoom_domain id="16s67eT"   /> </domain>
-     <domain id="12s67eT"    domain_ref="grid_T" > <zoom_domain id="12s67eT"   /> </domain>
-     <domain id="8s67eT"     domain_ref="grid_T" > <zoom_domain id="8s67eT"    /> </domain>
-     <domain id="4s67eT"     domain_ref="grid_T" > <zoom_domain id="4s67eT"    /> </domain>
-     <domain id="1.5s67eT"   domain_ref="grid_T" > <zoom_domain id="1.5s67eT"  /> </domain>
-     <domain id="0n67eT"     domain_ref="grid_T" > <zoom_domain id="0n67eT"    /> </domain>
-     <domain id="1.5n67eT"   domain_ref="grid_T" > <zoom_domain id="1.5n67eT"  /> </domain>
-     <domain id="4n67eT"     domain_ref="grid_T" > <zoom_domain id="4n67eT"    /> </domain>
-     <domain id="8n67eT"     domain_ref="grid_T" > <zoom_domain id="8n67eT"    /> </domain>
-     <!-- <\!--   80.5e   -\-> -->
-     <domain id="16s80.5eT"  domain_ref="grid_T" > <zoom_domain id="16s80.5eT" /> </domain>
-     <domain id="12s80.5eT"  domain_ref="grid_T" > <zoom_domain id="12s80.5eT" /> </domain>
-     <domain id="8s80.5eT"   domain_ref="grid_T" > <zoom_domain id="8s80.5eT"  /> </domain>
-     <domain id="4s80.5eT"   domain_ref="grid_T" > <zoom_domain id="4s80.5eT"  /> </domain>
-     <domain id="1.5s80.5eT" domain_ref="grid_T" > <zoom_domain id="1.5s80.5eT"/> </domain>
-     <domain id="0n80.5eT"   domain_ref="grid_T" > <zoom_domain id="0n80.5eT"  /> </domain>
-     <domain id="1.5n80.5eT" domain_ref="grid_T" > <zoom_domain id="1.5n80.5eT"/> </domain>
-     <domain id="4n80.5eT"   domain_ref="grid_T" > <zoom_domain id="4n80.5eT"  /> </domain>
-     <!-- <\!--   90e   -\-> -->
-     <domain id="1.5s90eT"   domain_ref="grid_T" > <zoom_domain id="1.5s90eT"  /> </domain>
-     <domain id="0n90eT"     domain_ref="grid_T" > <zoom_domain id="0n90eT"    /> </domain>
-     <domain id="1.5n90eT"   domain_ref="grid_T" > <zoom_domain id="1.5n90eT"  /> </domain>
-     <domain id="4n90eT"     domain_ref="grid_T" > <zoom_domain id="4n90eT"    /> </domain>
-     <domain id="8n90eT"     domain_ref="grid_T" > <zoom_domain id="8n90eT"    /> </domain>
-     <domain id="12n90eT"    domain_ref="grid_T" > <zoom_domain id="12n90eT"   /> </domain>
-     <domain id="15n90eT"    domain_ref="grid_T" > <zoom_domain id="15n90eT"   /> </domain>
-     <!-- <\!--   95e   -\-> -->
-     <domain id="16s95eT"    domain_ref="grid_T" > <zoom_domain id="16s95eT"   /> </domain>
-     <domain id="12s95eT"    domain_ref="grid_T" > <zoom_domain id="12s95eT"   /> </domain>
-     <domain id="8s95eT"     domain_ref="grid_T" > <zoom_domain id="8s95eT"    /> </domain>
-     <domain id="5s95eT"     domain_ref="grid_T" > <zoom_domain id="5s95eT"    /> </domain>
-     <!-- <\!--   PIRATA   -\-> -->
-     <!-- <\!--   38w-30w   -\-> -->
-     <domain id="19s34wT" domain_ref="grid_T" > <zoom_domain id="19s34wT"/> </domain>
-     <domain id="14s32wT" domain_ref="grid_T" > <zoom_domain id="14s32wT"/> </domain>
-     <domain id="8s30wT"  domain_ref="grid_T" > <zoom_domain id="8s30wT" /> </domain>
-     <domain id="0n35wT"  domain_ref="grid_T" > <zoom_domain id="0n35wT" /> </domain>
-     <domain id="4n38wT"  domain_ref="grid_T" > <zoom_domain id="4n38wT" /> </domain>
-     <domain id="8n38wT"  domain_ref="grid_T" > <zoom_domain id="8n38wT" /> </domain>
-     <domain id="12n38wT" domain_ref="grid_T" > <zoom_domain id="12n38wT"/> </domain>
-     <domain id="15n38wT" domain_ref="grid_T" > <zoom_domain id="15n38wT"/> </domain>
-     <domain id="20n38wT" domain_ref="grid_T" > <zoom_domain id="20n38wT"/> </domain>
-     <!-- <\!--   23w   -\-> -->
-     <domain id="0n23wT"  domain_ref="grid_T" > <zoom_domain id="0n23wT" /> </domain>
-     <domain id="4n23wT"  domain_ref="grid_T" > <zoom_domain id="4n23wT" /> </domain>
-     <domain id="12n23wT" domain_ref="grid_T" > <zoom_domain id="12n23wT"/> </domain>
-     <domain id="21n23wT" domain_ref="grid_T" > <zoom_domain id="21n23wT"/> </domain>
-     <!-- <\!--   10w   -\-> -->
-     <domain id="10s10wT" domain_ref="grid_T" > <zoom_domain id="10s10wT"/> </domain>
-     <domain id="6s10wT"  domain_ref="grid_T" > <zoom_domain id="6s10wT" /> </domain>
-     <domain id="0n10wT"  domain_ref="grid_T" > <zoom_domain id="0n10wT" /> </domain>
-     <!-- <\!--   0e   -\-> -->
-     <domain id="0n0eT"   domain_ref="grid_T" > <zoom_domain id="0n0eT"  /> </domain>
+  <!--   Eq section -->
+  <domain id="EqT" domain_ref="grid_T" > <zoom_domain id="EqT"/> </domain>
+  <!--   TAO : see example above   -->
+  <!--   137e   -->
+  <domain id="2n137eT" domain_ref="grid_T" > <zoom_domain id="2n137eT"/> </domain>
+  <domain id="5n137eT" domain_ref="grid_T" > <zoom_domain id="5n137eT"/> </domain>
+  <domain id="8n137eT" domain_ref="grid_T" > <zoom_domain id="8n137eT"/> </domain>
+  <!-- <\!--   147e   -\-> -->
+  <domain id="0n147eT" domain_ref="grid_T" > <zoom_domain id="0n147eT"/> </domain>
+  <domain id="2n147eT" domain_ref="grid_T" > <zoom_domain id="2n147eT"/> </domain>
+  <domain id="5n147eT" domain_ref="grid_T" > <zoom_domain id="5n147eT"/> </domain>
+  <!-- <\!--   156e   -\-> -->
+  <domain id="5s156eT" domain_ref="grid_T" > <zoom_domain id="5s156eT"/> </domain>
+  <domain id="2s156eT" domain_ref="grid_T" > <zoom_domain id="2s156eT"/> </domain>
+  <domain id="0n156eT" domain_ref="grid_T" > <zoom_domain id="0n156eT"/> </domain>
+  <domain id="2n156eT" domain_ref="grid_T" > <zoom_domain id="2n156eT"/> </domain>
+  <domain id="5n156eT" domain_ref="grid_T" > <zoom_domain id="5n156eT"/> </domain>
+  <domain id="8n156eT" domain_ref="grid_T" > <zoom_domain id="8n156eT"/> </domain>
+  <!-- <\!--   165e   -\-> -->
+  <domain id="8s165eT" domain_ref="grid_T" > <zoom_domain id="8s165eT"/> </domain>
+  <domain id="5s165eT" domain_ref="grid_T" > <zoom_domain id="5s165eT"/> </domain>
+  <domain id="2s165eT" domain_ref="grid_T" > <zoom_domain id="2s165eT"/> </domain>
+  <domain id="0n165eT" domain_ref="grid_T" > <zoom_domain id="0n165eT"/> </domain>
+  <domain id="2n165eT" domain_ref="grid_T" > <zoom_domain id="2n165eT"/> </domain>
+  <domain id="5n165eT" domain_ref="grid_T" > <zoom_domain id="5n165eT"/> </domain>
+  <domain id="8n165eT" domain_ref="grid_T" > <zoom_domain id="8n165eT"/> </domain>
+  <!-- <\!--   180w   -\-> -->
+  <domain id="8s180wT" domain_ref="grid_T" > <zoom_domain id="8s180wT"/> </domain>
+  <domain id="5s180wT" domain_ref="grid_T" > <zoom_domain id="5s180wT"/> </domain>
+  <domain id="2s180wT" domain_ref="grid_T" > <zoom_domain id="2s180wT"/> </domain>
+  <domain id="0n180wT" domain_ref="grid_T" > <zoom_domain id="0n180wT"/> </domain>
+  <domain id="2n180wT" domain_ref="grid_T" > <zoom_domain id="2n180wT"/> </domain>
+  <domain id="5n180wT" domain_ref="grid_T" > <zoom_domain id="5n180wT"/> </domain>
+  <domain id="8n180wT" domain_ref="grid_T" > <zoom_domain id="8n180wT"/> </domain>
+  <!-- <\!--   170w   -\-> -->
+  <domain id="8s170wT" domain_ref="grid_T" > <zoom_domain id="8s170wT"/> </domain>
+  <domain id="5s170wT" domain_ref="grid_T" > <zoom_domain id="5s170wT"/> </domain>
+  <domain id="2s170wT" domain_ref="grid_T" > <zoom_domain id="2s170wT"/> </domain>
+  <domain id="0n170wT" domain_ref="grid_T" > <zoom_domain id="0n170wT"/> </domain>
+  <domain id="2n170wT" domain_ref="grid_T" > <zoom_domain id="2n170wT"/> </domain>
+  <domain id="5n170wT" domain_ref="grid_T" > <zoom_domain id="5n170wT"/> </domain>
+  <domain id="8n170wT" domain_ref="grid_T" > <zoom_domain id="8n170wT"/> </domain>
+  <!-- <\!--   155w   -\-> -->
+  <domain id="8s155wT" domain_ref="grid_T" > <zoom_domain id="8s155wT"/> </domain>
+  <domain id="5s155wT" domain_ref="grid_T" > <zoom_domain id="5s155wT"/> </domain>
+  <domain id="2s155wT" domain_ref="grid_T" > <zoom_domain id="2s155wT"/> </domain>
+  <domain id="0n155wT" domain_ref="grid_T" > <zoom_domain id="0n155wT"/> </domain>
+  <domain id="2n155wT" domain_ref="grid_T" > <zoom_domain id="2n155wT"/> </domain>
+  <domain id="5n155wT" domain_ref="grid_T" > <zoom_domain id="5n155wT"/> </domain>
+  <domain id="8n155wT" domain_ref="grid_T" > <zoom_domain id="8n155wT"/> </domain>
+  <!-- <\!--   140w   -\-> -->
+  <domain id="8s140wT" domain_ref="grid_T" > <zoom_domain id="8s140wT"/> </domain>
+  <domain id="5s140wT" domain_ref="grid_T" > <zoom_domain id="5s140wT"/> </domain>
+  <domain id="2s140wT" domain_ref="grid_T" > <zoom_domain id="2s140wT"/> </domain>
+  <domain id="0n140wT" domain_ref="grid_T" > <zoom_domain id="0n140wT"/> </domain>
+  <domain id="2n140wT" domain_ref="grid_T" > <zoom_domain id="2n140wT"/> </domain>
+  <domain id="5n140wT" domain_ref="grid_T" > <zoom_domain id="5n140wT"/> </domain>
+  <domain id="8n140wT" domain_ref="grid_T" > <zoom_domain id="8n140wT"/> </domain>
+  <!-- <\!--   125w   -\-> -->
+  <domain id="8s125wT" domain_ref="grid_T" > <zoom_domain id="8s125wT"/> </domain>
+  <domain id="5s125wT" domain_ref="grid_T" > <zoom_domain id="5s125wT"/> </domain>
+  <domain id="2s125wT" domain_ref="grid_T" > <zoom_domain id="2s125wT"/> </domain>
+  <domain id="0n125wT" domain_ref="grid_T" > <zoom_domain id="0n125wT"/> </domain>
+  <domain id="2n125wT" domain_ref="grid_T" > <zoom_domain id="2n125wT"/> </domain>
+  <domain id="5n125wT" domain_ref="grid_T" > <zoom_domain id="5n125wT"/> </domain>
+  <domain id="8n125wT" domain_ref="grid_T" > <zoom_domain id="8n125wT"/> </domain>
+  <!-- <\!--   110w   -\-> -->
+  <domain id="8s110wT" domain_ref="grid_T" > <zoom_domain id="8s110wT"/> </domain>
+  <domain id="5s110wT" domain_ref="grid_T" > <zoom_domain id="5s110wT"/> </domain>
+  <domain id="2s110wT" domain_ref="grid_T" > <zoom_domain id="2s110wT"/> </domain>
+  <domain id="0n110wT" domain_ref="grid_T" > <zoom_domain id="0n110wT"/> </domain>
+  <domain id="2n110wT" domain_ref="grid_T" > <zoom_domain id="2n110wT"/> </domain>
+  <domain id="5n110wT" domain_ref="grid_T" > <zoom_domain id="5n110wT"/> </domain>
+  <domain id="8n110wT" domain_ref="grid_T" > <zoom_domain id="8n110wT"/> </domain>
+  <!-- <\!--   95w   -\-> -->
+  <domain id="8s95wT" domain_ref="grid_T" > <zoom_domain id="8s95wT"/> </domain>
+  <domain id="5s95wT" domain_ref="grid_T" > <zoom_domain id="5s95wT"/> </domain>
+  <domain id="2s95wT" domain_ref="grid_T" > <zoom_domain id="2s95wT"/> </domain>
+  <domain id="0n95wT" domain_ref="grid_T" > <zoom_domain id="0n95wT"/> </domain>
+  <domain id="2n95wT" domain_ref="grid_T" > <zoom_domain id="2n95wT"/> </domain>
+  <domain id="5n95wT" domain_ref="grid_T" > <zoom_domain id="5n95wT"/> </domain>
+  <domain id="8n95wT" domain_ref="grid_T" > <zoom_domain id="8n95wT"/> </domain>
+  <!-- <\!--   RAMA   -\-> -->
+  <!-- <\!--   55e   -\-> -->
+  <domain id="16s55eT"    domain_ref="grid_T" > <zoom_domain id="16s55eT"   /> </domain>
+  <domain id="12s55eT"    domain_ref="grid_T" > <zoom_domain id="12s55eT"   /> </domain>
+  <domain id="8s55eT"     domain_ref="grid_T" > <zoom_domain id="8s55eT"    /> </domain>
+  <domain id="4s55eT"     domain_ref="grid_T" > <zoom_domain id="4s55eT"    /> </domain>
+  <domain id="1.5s55eT"   domain_ref="grid_T" > <zoom_domain id="1.5s55eT"  /> </domain>
+  <domain id="0n55eT"     domain_ref="grid_T" > <zoom_domain id="0n55eT"    /> </domain>
+  <domain id="1.5n55eT"   domain_ref="grid_T" > <zoom_domain id="1.5n55eT"  /> </domain>
+  <domain id="4n55eT"     domain_ref="grid_T" > <zoom_domain id="4n55eT"    /> </domain>
+  <!--    <\!--   65e   -\-> -->
+  <domain id="15n65eT"    domain_ref="grid_T" > <zoom_domain id="15n65eT"   /> </domain>
+  <!--    <\!--   67e   -\-> -->
+  <domain id="16s67eT"    domain_ref="grid_T" > <zoom_domain id="16s67eT"   /> </domain>
+  <domain id="12s67eT"    domain_ref="grid_T" > <zoom_domain id="12s67eT"   /> </domain>
+  <domain id="8s67eT"     domain_ref="grid_T" > <zoom_domain id="8s67eT"    /> </domain>
+  <domain id="4s67eT"     domain_ref="grid_T" > <zoom_domain id="4s67eT"    /> </domain>
+  <domain id="1.5s67eT"   domain_ref="grid_T" > <zoom_domain id="1.5s67eT"  /> </domain>
+  <domain id="0n67eT"     domain_ref="grid_T" > <zoom_domain id="0n67eT"    /> </domain>
+  <domain id="1.5n67eT"   domain_ref="grid_T" > <zoom_domain id="1.5n67eT"  /> </domain>
+  <domain id="4n67eT"     domain_ref="grid_T" > <zoom_domain id="4n67eT"    /> </domain>
+  <domain id="8n67eT"     domain_ref="grid_T" > <zoom_domain id="8n67eT"    /> </domain>
+  <!-- <\!--   80.5e   -\-> -->
+  <domain id="16s80.5eT"  domain_ref="grid_T" > <zoom_domain id="16s80.5eT" /> </domain>
+  <domain id="12s80.5eT"  domain_ref="grid_T" > <zoom_domain id="12s80.5eT" /> </domain>
+  <domain id="8s80.5eT"   domain_ref="grid_T" > <zoom_domain id="8s80.5eT"  /> </domain>
+  <domain id="4s80.5eT"   domain_ref="grid_T" > <zoom_domain id="4s80.5eT"  /> </domain>
+  <domain id="1.5s80.5eT" domain_ref="grid_T" > <zoom_domain id="1.5s80.5eT"/> </domain>
+  <domain id="0n80.5eT"   domain_ref="grid_T" > <zoom_domain id="0n80.5eT"  /> </domain>
+  <domain id="1.5n80.5eT" domain_ref="grid_T" > <zoom_domain id="1.5n80.5eT"/> </domain>
+  <domain id="4n80.5eT"   domain_ref="grid_T" > <zoom_domain id="4n80.5eT"  /> </domain>
+  <!-- <\!--   90e   -\-> -->
+  <domain id="1.5s90eT"   domain_ref="grid_T" > <zoom_domain id="1.5s90eT"  /> </domain>
+  <domain id="0n90eT"     domain_ref="grid_T" > <zoom_domain id="0n90eT"    /> </domain>
+  <domain id="1.5n90eT"   domain_ref="grid_T" > <zoom_domain id="1.5n90eT"  /> </domain>
+  <domain id="4n90eT"     domain_ref="grid_T" > <zoom_domain id="4n90eT"    /> </domain>
+  <domain id="8n90eT"     domain_ref="grid_T" > <zoom_domain id="8n90eT"    /> </domain>
+  <domain id="12n90eT"    domain_ref="grid_T" > <zoom_domain id="12n90eT"   /> </domain>
+  <domain id="15n90eT"    domain_ref="grid_T" > <zoom_domain id="15n90eT"   /> </domain>
+  <!-- <\!--   95e   -\-> -->
+  <domain id="16s95eT"    domain_ref="grid_T" > <zoom_domain id="16s95eT"   /> </domain>
+  <domain id="12s95eT"    domain_ref="grid_T" > <zoom_domain id="12s95eT"   /> </domain>
+  <domain id="8s95eT"     domain_ref="grid_T" > <zoom_domain id="8s95eT"    /> </domain>
+  <domain id="5s95eT"     domain_ref="grid_T" > <zoom_domain id="5s95eT"    /> </domain>
+  <!-- <\!--   PIRATA   -\-> -->
+  <!-- <\!--   38w-30w   -\-> -->
+  <domain id="19s34wT" domain_ref="grid_T" > <zoom_domain id="19s34wT"/> </domain>
+  <domain id="14s32wT" domain_ref="grid_T" > <zoom_domain id="14s32wT"/> </domain>
+  <domain id="8s30wT"  domain_ref="grid_T" > <zoom_domain id="8s30wT" /> </domain>
+  <domain id="0n35wT"  domain_ref="grid_T" > <zoom_domain id="0n35wT" /> </domain>
+  <domain id="4n38wT"  domain_ref="grid_T" > <zoom_domain id="4n38wT" /> </domain>
+  <domain id="8n38wT"  domain_ref="grid_T" > <zoom_domain id="8n38wT" /> </domain>
+  <domain id="12n38wT" domain_ref="grid_T" > <zoom_domain id="12n38wT"/> </domain>
+  <domain id="15n38wT" domain_ref="grid_T" > <zoom_domain id="15n38wT"/> </domain>
+  <domain id="20n38wT" domain_ref="grid_T" > <zoom_domain id="20n38wT"/> </domain>
+  <!-- <\!--   23w   -\-> -->
+  <domain id="0n23wT"  domain_ref="grid_T" > <zoom_domain id="0n23wT" /> </domain>
+  <domain id="4n23wT"  domain_ref="grid_T" > <zoom_domain id="4n23wT" /> </domain>
+  <domain id="12n23wT" domain_ref="grid_T" > <zoom_domain id="12n23wT"/> </domain>
+  <domain id="21n23wT" domain_ref="grid_T" > <zoom_domain id="21n23wT"/> </domain>
+  <!-- <\!--   10w   -\-> -->
+  <domain id="10s10wT" domain_ref="grid_T" > <zoom_domain id="10s10wT"/> </domain>
+  <domain id="6s10wT"  domain_ref="grid_T" > <zoom_domain id="6s10wT" /> </domain>
+  <domain id="0n10wT"  domain_ref="grid_T" > <zoom_domain id="0n10wT" /> </domain>
+  <!-- <\!--   0e   -\-> -->
+  <domain id="0n0eT"   domain_ref="grid_T" > <zoom_domain id="0n0eT"  /> </domain>
 
-     
-     <!--   U grid   -->
-     <domain id="grid_U" long_name="grid U"/>
-     <!--   Eq section   -->
-     <domain id="EqU" domain_ref="grid_U" > <zoom_domain id="EqU"/> </domain>
 
-      
-     <!--   V grid   -->
-     <domain id="grid_V" long_name="grid V"/>
-     <!--   Eq section : no V point on the Equator...   -->
+  <!--   U grid   -->
+  <domain id="grid_U" long_name="grid U"/>
+  <!--   Eq section   -->
+  <domain id="EqU" domain_ref="grid_U" > <zoom_domain id="EqU"/> </domain>
 
-     
-     <!--   W grid   -->
-     <domain id="grid_W" long_name="grid W"/>
-     <!--   Eq section   -->
-     <domain id="EqW" domain_ref="grid_W" > <zoom_domain id="EqW"/> </domain>
 
-     <!--   F grid   -->
-     <domain id="grid_F" long_name="grid F"/>
-     
-	           <!--   zonal mean grid   -->
-     <domain_group id="gznl">
-        <domain id="gznl" long_name="gznl"/>
-        <domain id="ptr" domain_ref="gznl" > 
-            <zoom_domain id="ptr" ibegin="0000" jbegin="0" ni="1" nj="0000" /> 
-        </domain>
-      </domain_group>
+  <!--   V grid   -->
+  <domain id="grid_V" long_name="grid V"/>
+  <!--   Eq section : no V point on the Equator...   -->
 
-     
-     <!--   other grids   -->
-     <domain id="scalarpoint" long_name="scalar"/>
-      
 
-   </domain_definition>    
- 
+  <!--   W grid   -->
+  <domain id="grid_W" long_name="grid W"/>
+  <!--   Eq section   -->
+  <domain id="EqW" domain_ref="grid_W" > <zoom_domain id="EqW"/> </domain>
+
+  <!--   F grid   -->
+  <domain id="grid_F" long_name="grid F"/>
+
+  <!--   zonal mean grid   -->
+  <domain_group id="gznl">
+    <domain id="gznl" long_name="gznl"/>
+    <domain id="ptr" domain_ref="gznl" >
+      <zoom_domain id="ptr" ibegin="0000" jbegin="0" ni="1" nj="0000" />
+    </domain>
+  </domain_group>
+
+
+  <!--   other grids   -->
+  <domain id="scalarpoint" long_name="scalar"/>
+
+
+</domain_definition>
Index: /NEMO/trunk/cfgs/SHARED/field_def_nemo-ice.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/field_def_nemo-ice.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/field_def_nemo-ice.xml	(revision 14072)
@@ -1,637 +1,644 @@
-<?xml version="1.0"?> 
-    <!-- $id$ -->
-    
-    <!-- 
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+<!--
 ============================================================================================================
 =                              definition of all existing sea ice variables                                =
 =                                            DO NOT CHANGE                                                 =
 ============================================================================================================
+-->
+<field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+
+  <!--
+      ============================================================================================================
+      Physical sea ice model variables
+      ============================================================================================================
+  -->
+
+  <field_group id="SBC" > <!-- time step automaticaly defined based on nn_fsbc -->
+
+    <!-- 2D variables -->
+    <field_group id="SBC_2D" grid_ref="grid_T_2D" >
+
+      <!-- =================== -->
+      <!-- standard ice fields -->
+      <!-- =================== -->
+      <!-- ice presence masks -->
+      <field id="icemask"      long_name="Fraction of time steps with sea ice"                     standard_name="sea_ice_mask"                              unit="" />
+      <field id="icemask05"    long_name="Ice mask (0 if ice conc. lower than  5%, 1 otherwise)"   standard_name="sea_ice_mask05"                            unit="" />
+      <field id="icemask15"    long_name="Ice mask (0 if ice conc. lower than 15%, 1 otherwise)"   standard_name="sea_ice_mask15"                            unit="" />
+      <field id="icepres"      long_name="Fraction of time steps with sea ice"                     standard_name="sea_ice_time_fraction"                     unit="" />
+      <field id="fasticepres"  long_name="Fraction of time steps with landfast ice"                standard_name="fast_ice_time_fraction"                    unit="" />
+
+      <!-- general fields -->
+      <field id="icemass"      long_name="Sea-ice mass per gridcell area"                          standard_name="sea_ice_amount"                            unit="kg/m2"/>
+      <field id="snwmass"      long_name="Snow mass per area"                                      standard_name="liquid_water_content_of_surface_snow"      unit="kg/m2"/>
+      <field id="iceconc"      long_name="Sea-ice area fraction"                                   standard_name="sea_ice_area_fraction"                     unit=""     />
+      <field id="icevolu"      long_name="Sea-ice volume per area"                                 standard_name="sea_ice_thickness"                         unit="m"    />
+      <field id="icethic"      long_name="Sea-ice thickness"                                       standard_name="sea_ice_thickness"                         unit="m"    />
+      <field id="snwthic"      long_name="Snow thickness"                                          standard_name="snow_thickness"                            unit="m"    />
+      <field id="icebrv"       long_name="brine volume"                                                                                                      unit="%"    />
+      <field id="iceage"       long_name="ice age"                                                                                                           unit="days" detect_missing_value="true"/>
+      <field id="icehnew"      long_name="frazil ice collection thickness"                                                                                   unit="m"    />
+      <field id="snwvolu"      long_name="snow volume"                                                                                                       unit="m"    />
+      <field id="icefrb"       long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                         unit="m"    />
+      <field id="icealb"       long_name="Sea-ice or snow albedo"                                  standard_name="sea_ice_albedo"                            unit=""    detect_missing_value="true" />
+
+      <!-- melt ponds -->
+      <field id="iceapnd"      long_name="melt pond concentration"                                 standard_name="sea_ice_meltpond_concentration"            unit=""  />
+      <field id="icehpnd"      long_name="melt pond depth"                                         standard_name="sea_ice_meltpond_depth"                    unit="m" />
+      <field id="icevpnd"      long_name="melt pond volume"                                        standard_name="sea_ice_meltpond_volume"                   unit="m" />
+      <field id="icehlid"      long_name="melt pond lid depth"                                     standard_name="sea_ice_meltpondlid_depth"                 unit="m" />
+      <field id="icevlid"      long_name="melt pond lid volume"                                    standard_name="sea_ice_meltpondlid_volume"                unit="m" />
+      <field id="dvpn_mlt"     long_name="pond volume tendency due to surface melt"                standard_name="sea_ice_pondvolume_tendency_melt"          unit="kg/m2/s" />
+      <field id="dvpn_lid"     long_name="pond volume tendency due to exchanges with lid"          standard_name="sea_ice_pondvolume_tendency_lids"          unit="kg/m2/s" />
+      <field id="dvpn_rnf"     long_name="pond volume tendency due to runoff"                      standard_name="sea_ice_pondvolume_tendency_runoff"        unit="kg/m2/s" />
+      <field id="dvpn_drn"     long_name="pond volume tendency due to drainage"                    standard_name="sea_ice_pondvolume_tendency_drainage"      unit="kg/m2/s" />
+
+      <!-- heat -->
+      <field id="icetemp"      long_name="Mean ice temperature"                                                                                              unit="degC" detect_missing_value="true" />
+      <field id="snwtemp"      long_name="Mean snow temperature"                                                                                             unit="degC" detect_missing_value="true" />
+      <field id="icettop"      long_name="temperature at the ice surface"                                                                                    unit="degC" detect_missing_value="true" />
+      <field id="icetbot"      long_name="temperature at the ice bottom"                                                                                     unit="degC" detect_missing_value="true" />
+      <field id="icetsni"      long_name="temperature at the snow-ice interface"                                                                             unit="degC" detect_missing_value="true" />
+      <field id="icehc"        long_name="ice heat content"                                                                                                  unit="J/m2" />
+      <field id="snwhc"        long_name="snow heat content"                                                                                                 unit="J/m2" />
+
+      <!-- salt -->
+      <field id="icesalt"      long_name="Sea ice salinity"                                                                                                  unit="g/kg"  detect_missing_value="true" />
+      <field id="icesalm"      long_name="Mass of salt in sea ice per area"                        standard_name="sea_ice_salt_mass"                         unit="kg/m2" />
+
+      <!-- momentum (rheology) -->
+      <field id="uice"         long_name="X-component of sea ice velocity"                         standard_name="sea_ice_x_velocity"                        unit="m/s"  />
+      <field id="vice"         long_name="Y-component of sea ice velocity"                         standard_name="sea_ice_y_velocity"                        unit="m/s"  />
+      <field id="icevel"       long_name="Sea-ice speed"                                           standard_name="sea_ice_speed"                             unit="m/s"  />
+      <field id="utau_ai"      long_name="X-component of atmospheric stress on sea ice"            standard_name="surface_downward_x_stress"                 unit="N/m2" />
+      <field id="vtau_ai"      long_name="Y-component of atmospheric stress on sea ice"            standard_name="surface_downward_y_stress"                 unit="N/m2" />
+      <field id="utau_oi"      long_name="X-component of ocean stress on sea ice"                  standard_name="sea_ice_base_upward_x_stress"              unit="N/m2" />
+      <field id="vtau_oi"      long_name="Y-component of ocean stress on sea ice"                  standard_name="sea_ice_base_upward_y_stress"              unit="N/m2" />
+      <field id="utau_bi"      long_name="X-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_x_stress"              unit="N/m2" />
+      <field id="vtau_bi"      long_name="Y-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_y_stress"              unit="N/m2" />
+      <field id="taum_ice"     long_name="Module of atmospheric stress on sea ice (T-points)"      standard_name="mod_surface_downward_stress"               unit="N/m2" />
+      <field id="utau_ice"     long_name="X-component of ocean stress on sea ice (T-points)"       standard_name="sea_ice_base_upward_x_stress_Tpoints"      unit="N/m2" />
+      <field id="vtau_ice"     long_name="Y-component of ocean stress on sea ice (T-points)"       standard_name="sea_ice_base_upward_y_stress_Tpoints"      unit="N/m2" />
+      <field id="sig1_pnorm"   long_name="P-normalized 1st principal stress component"                                                                       unit=""     />
+      <field id="sig2_pnorm"   long_name="P-normalized 2nd principal stress component"                                                                       unit=""     />
+      <field id="icedlt"       long_name="delta"                                                   standard_name="delta"                                     unit=""     />
+      <field id="normstr"      long_name="Average normal stress in sea ice"                        standard_name="average_normal_stress"                     unit="N/m"  />
+      <field id="sheastr"      long_name="Maximum shear stress in sea ice"                         standard_name="maximum_shear_stress"                      unit="N/m"  />
+      <field id="icestr"       long_name="Compressive sea ice strength"                            standard_name="compressive_strength_of_sea_ice"           unit="N/m"  />
+      <field id="icediv"       long_name="Divergence of the sea-ice velocity field"                standard_name="divergence_of_sea_ice_velocity"            unit="s-1"  />
+      <field id="iceshe"       long_name="Maximum shear of sea-ice velocity field"                 standard_name="maximum_shear_of_sea_ice_velocity"         unit="s-1"  />
+      <field id="aniso"        long_name="anisotropy of sea ice floe orientation (0.5 - 1)"        standard_name="anisotropy"                                unit=""     />
+      <field id="yield11"      long_name="yield surface tensor component 11"                       standard_name="yield11"                                   unit="N/m"  />
+      <field id="yield22"      long_name="yield surface tensor component 22"                       standard_name="yield22"                                   unit="N/m"  />
+      <field id="yield12"      long_name="yield surface tensor component 12"                       standard_name="yield12"                                   unit="N/m"  />
+      <field id="beta_evp"     long_name="Relaxation parameter of ice rheology (beta)"             standard_name="relaxation_parameter_of_ice_rheology"      unit=""  />
+
+      <!-- surface heat fluxes -->
+      <field id="qt_ice"       long_name="total heat flux at ice surface"                          standard_name="surface_downward_heat_flux_in_air"         unit="W/m2" />
+      <field id="qsr_ice"      long_name="solar heat flux at ice surface"                          standard_name="surface_downwelling_shortwave_flux_in_air" unit="W/m2" />
+      <field id="qlw_ice"      long_name="longwave (IR) heat flux at ice surface"                  standard_name="surface_downwelling_longwave_flux_in_air"  unit="W/m2" />
+      <field id="qns_ice"      long_name="non-solar heat flux at ice surface (including E-P)"                                                                unit="W/m2" />
+      <field id="qla_ice"      long_name="latent (sublimation) heat flux at ice surface"                                                                     unit="W/m2" />
+      <field id="qsb_ice"      long_name="sensible heat flux at ice surface"                                                                                 unit="W/m2" />
+      <field id="qtr_ice_bot"  long_name="solar heat flux transmitted through the ice (to the ocean)"                                                        unit="W/m2" />
+      <field id="qtr_ice_top"  long_name="solar heat flux transmitted through the ice surface"                                                               unit="W/m2" />
+      <field id="qt_oce_ai"    long_name="total heat flux at the ocean   surface: interface oce-(ice+atm)"                                                   unit="W/m2" />
+      <field id="qt_atm_oi"    long_name="total heat flux at the oce-ice surface: interface atm-(ice+oce)"                                                   unit="W/m2" />
+      <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                              unit="W/m2" />
+      <field id="albedo"       long_name="Mean albedo over sea ice and ocean"                                                                                unit=""     />
+      <field id="Cd_ice"       long_name="Drag coefficient over sea-ice"                            standard_name="drag_coefficient_ice"                     unit=""     />
+      <field id="Ce_ice"       long_name="Sublimation coefficient over sea-ice"                     standard_name="evap_coefficient_ice"                     unit=""     />
+      <field id="Ch_ice"       long_name="Sensible heat coefficient over sea-ice"                   standard_name="sensible_heat_coefficient_ice"            unit=""     />
+
+      <!-- trends -->
+      <field id="afxthd"       long_name="sea-ice area fraction change from thermodynamics" standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics" unit="s-1" />
+      <field id="afxdyn"       long_name="sea-ice area fraction change from dynamics"       standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics" unit="s-1" />
+      <field id="afxtot"       long_name="area tendency (total)"                                                                                              unit="s-1" />
+
+      <!-- momentum (advection) -->
+      <field id="icemtrp"      long_name="ice  mass transport"                                          unit="kg/m2/s" />
+      <field id="snwmtrp"      long_name="snw  mass transport"                                          unit="kg/m2/s" />
+      <field id="salmtrp"      long_name="salt mass transport"                                          unit="kg/m2/s" />
+      <field id="dihctrp"      long_name="ice heat content transport"                                   unit="W/m2"    />
+      <field id="dshctrp"      long_name="snw heat content transport"                                   unit="W/m2"    />
+
+      <!-- salt fluxes -->
+      <field id="sfxice"       long_name="ice-ocean salt flux from ice growth/melt (neg = growth)"      unit="kg/m2/s" />
+      <field id="sfxbog"       long_name="ice-ocean salt flux from ice bottom growth"                   unit="kg/m2/s" />
+      <field id="sfxbom"       long_name="ice-ocean salt flux from ice bottom melt"                     unit="kg/m2/s" />
+      <field id="sfxsum"       long_name="ice-ocean salt flux from ice surface melt"                    unit="kg/m2/s" />
+      <field id="sfxlam"       long_name="ice-ocean salt flux from ice lateral melt"                    unit="kg/m2/s" />
+      <field id="sfxsni"       long_name="ice-ocean salt flux from snow-ice formation"                  unit="kg/m2/s" />
+      <field id="sfxopw"       long_name="ice-ocean salt flux from ice formation in open water"         unit="kg/m2/s" />
+      <field id="sfxdyn"       long_name="ice-ocean salt flux from ice dynamics (ridging)"              unit="kg/m2/s" />
+      <field id="sfxbri"       long_name="ice-ocean salt flux from brines"                              unit="kg/m2/s" />
+      <field id="sfxres"       long_name="ice-ocean salt flux from undiagnosed processes"               unit="kg/m2/s" />
+      <field id="sfxsub"       long_name="ice-ocean salt flux from ice sublimation"                     unit="kg/m2/s" />
+
+      <!-- mass fluxes -->
+      <field id="vfxice"       long_name="ice-ocean mass flux from ice melt/growth (neg = growth)"      unit="kg/m2/s" />
+      <field id="vfxbog"       long_name="ice-ocean mass flux from ice bottom growth"                   unit="kg/m2/s" />
+      <field id="vfxbom"       long_name="ice-ocean mass flux from ice bottom melt"                     unit="kg/m2/s" />
+      <field id="vfxsum"       long_name="ice-ocean mass flux from ice surface melt"                    unit="kg/m2/s" />
+      <field id="vfxlam"       long_name="ice-ocean mass flux from ice lateral melt"                    unit="kg/m2/s" />
+      <field id="vfxsni"       long_name="ice-ocean mass flux from snow-ice formation"                  unit="kg/m2/s" />
+      <field id="vfxopw"       long_name="ice-ocean mass flux from ice growth in open water"            unit="kg/m2/s" />
+      <field id="vfxdyn"       long_name="ice-ocean mass flux from ice dynamics (ridging)"              unit="kg/m2/s" />
+      <field id="vfxres"       long_name="ice-ocean mass flux from undiagnosed processes"               unit="kg/m2/s" />
+      <field id="vfxpnd"       long_name="ice-ocean mass flux from ice melt ponds"                      unit="kg/m2/s" />
+      <field id="vfxsub"       long_name="ice-atm.  mass flux from ice sublimation"                     unit="kg/m2/s" />
+      <field id="vfxsub_err"   long_name="ice-ocean mass flux from unbalance in sublimation (incl. in qt_oce_ai)" unit="kg/m2/s" />
+      <field id="vfxthin"      long_name="ice-ocean mass flux from ice growth in open water + thin ice(20cm)"     unit="kg/m2/s" />
+
+      <field id="vfxsnw"       long_name="ice-ocean mass flux from snw melt/growth (neg = growth)"      unit="kg/m2/s" />
+      <field id="vfxsnw_sum"   long_name="ice-ocean mass flux from snw surface melt"                    unit="kg/m2/s" />
+      <field id="vfxsnw_sni"   long_name="ice-ocean mass flux from snow-ice formation"                  unit="kg/m2/s" />
+      <field id="vfxsnw_dyn"   long_name="ice-ocean mass flux from dynamics (ridging)"                  unit="kg/m2/s" />
+      <field id="vfxsnw_sub"   long_name="ice-atm.  mass flux from snw sublimation"                     unit="kg/m2/s" />
+      <field id="vfxsnw_pre"   long_name="snw precipitation on ice"                                     unit="kg/m2/s" />
+
+      <!-- heat fluxes -->
+      <field id="hfxbog"       long_name="heat flux used for bottom ice growth (neg.)"                  unit="W/m2" />
+      <field id="hfxbom"       long_name="heat flux used for bottom ice melt (pos.)"                    unit="W/m2" />
+      <field id="hfxsum"       long_name="heat flux used for surface ice melt"                          unit="W/m2" />
+      <field id="hfxopw"       long_name="heat flux used for open water ice formation"                  unit="W/m2" />
+      <field id="hfxdif"       long_name="heat flux used for ice temperature change"                    unit="W/m2" />
+      <field id="hfxsnw"       long_name="heat flux used for snow melt"                                 unit="W/m2" />
+      <field id="hfxerr"       long_name="heat flux error after heat diffusion"                         unit="W/m2" />
+      <!-- heat fluxes associated with mass exchange -->
+      <field id="hfxthd"       long_name="heat fluxes from ice-ocean mass exchange during thermo"       unit="W/m2" />
+      <field id="hfxdyn"       long_name="heat fluxes from ice-ocean mass exchange during dynamic"      unit="W/m2" />
+      <field id="hfxres"       long_name="heat fluxes from undiagnosed processes"                       unit="W/m2" />
+      <field id="hfxsub"       long_name="heat fluxes from ice-atm. mass exchange during sublimation"   unit="W/m2" />
+      <field id="hfxspr"       long_name="heat fluxes from ice-atm. mass exchange during snow precip"   unit="W/m2" />
+
+      <field id="hfxsensib"    long_name="Net sensible heat flux under sea ice (neg = ice cooling)"         standard_name="ice_ocean_heat_flux"                        unit="W/m2" />
+      <field id="hfxcndtop"    long_name="Net conductive heat flux at the ice surface (neg = ice cooling)"  standard_name="conductive_heat_flux_at_sea_ice_surface"    unit="W/m2" />
+      <field id="hfxcndbot"    long_name="Net conductive heat flux at the ice bottom (neg = ice cooling)"   standard_name="conductive_heat_flux_at_sea_ice_bottom"     unit="W/m2" />
+
+      <!-- diags -->
+      <field id="hfxdhc"        long_name="Heat content variation in snow and ice (neg = ice cooling)"   unit="W/m2" />
+      <!-- available if ln_icediachk=T -->
+      <field id="icedrift_mass" long_name="Ice mass drift (conservation check)"   unit="kg/m2/s" />
+      <field id="icedrift_salt" long_name="Ice salt drift (conservation check)"   unit="kg/m2/s" />
+      <field id="icedrift_heat" long_name="Ice heat drift (conservation check)"   unit="W/m2"    />
+
+      <!-- sbcssm variables -->
+      <field id="sst_m"    unit="degC" />
+      <field id="sss_m"    unit="psu"  />
+      <field id="ssu_m"    unit="m/s"  />
+      <field id="ssv_m"    unit="m/s"  />
+      <field id="ssh_m"    unit="m"    />
+      <field id="e3t_m"    unit="m"    />
+      <field id="frq_m"    unit="-"    />
+
+      <!-- rheology convergence tests -->
+      <field id="uice_cvg"   long_name="sea ice velocity convergence"      standard_name="sea_ice_velocity_convergence"      unit="m/s" />
+
+      <!-- ================= -->
+      <!-- Add-ons for SIMIP -->
+      <!-- ================= -->
+      <field id="icemass_cmip" long_name="Sea-ice mass per area"                                   standard_name="sea_ice_amount"                          detect_missing_value="true" unit="kg/m2"  > icemass * icemask   + $missval * (1.-icemask  ) </field>
+      <field id="icethic_cmip" long_name="Sea-ice thickness"                                       standard_name="sea_ice_thickness"                       detect_missing_value="true" unit="m"      > icethic * icemask05 + $missval * (1.-icemask05) </field>
+      <field id="snwmass_cmip" long_name="Snow mass per area"                                      standard_name="liquid_water_content_of_surface_snow"    detect_missing_value="true" unit="kg/m2"  > snwmass * icemask   + $missval * (1.-icemask  ) </field>
+      <field id="snwthic_cmip" long_name="Snow thickness"                                          standard_name="surface_snow_thickness"                  detect_missing_value="true" unit="m"      > snwthic * icemask05 + $missval * (1.-icemask05) </field>
+      <field id="iceconc_pct"  long_name="Sea-ice area fraction in percent"                        standard_name="sea_ice_area_fraction_in_percent"                                    unit="%"      > iceconc * 100.                                  </field>
+      <field id="iceage_cmip"  long_name="Age of sea ice"                                          standard_name="age_of_sea_ice"                          detect_missing_value="true" unit="days"   > iceage  * icemask15 + $missval * (1.-icemask15) </field>
+      <field id="icesalt_cmip" long_name="Sea ice salinity"                                        standard_name="sea_ice_salinity"                        detect_missing_value="true" unit="g/kg"   > icesalt * icemask   + $missval * (1.-icemask  ) </field>
+      <field id="icefrb_cmip"  long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                       detect_missing_value="true" unit="m"      > icefrb  * icemask   + $missval * (1.-icemask  ) </field>
+
+      <!-- heat -->
+      <field id="icettop_cmip" long_name="Surface temperature of sea ice"                          standard_name="sea_ice_surface_temperature"             detect_missing_value="true" unit="K"  > (icettop+273.15) * icemask + $missval * (1.-icemask) </field>
+      <field id="icetsni_cmip" long_name="Temperature at snow-ice interface"                       standard_name="sea_ice_snow_interface_temperature"      detect_missing_value="true" unit="K"  > (icetsni+273.15) * icemask + $missval * (1.-icemask) </field>
+      <field id="icetbot_cmip" long_name="Temperature at ice-ocean interface"                      standard_name="sea_ice_bottom_temperature"              detect_missing_value="true" unit="K"  > (icetbot+273.15) * icemask + $missval * (1.-icemask) </field>
+      <field id="icehc_cmip"   long_name="Sea-ice heat content per unit area"                      standard_name="integral_of_sea_ice_temperature_wrt_depth_expressed_as_heat_content" detect_missing_value="true" unit="J/m2" > icehc * icemask + $missval * (1.-icemask) </field>
+      <field id="snwhc_cmip"   long_name="Snow-heat content per unit area"                         standard_name="thermal_energy_content_of_surface_snow"                              detect_missing_value="true" unit="J/m2" > snwhc * icemask + $missval * (1.-icemask) </field>
+
+      <!-- fluxes (mass, heat, salt) -->
+      <field id="vfxsum_cmip"    long_name="Freshwater flux from sea-ice surface"                  standard_name="freshwater_flux_from_ice_surface"        detect_missing_value="true" unit="kg/m2/s"  > vfxsum    * icemask + $missval * (1.-icemask) </field>
+      <field id="vfxice_cmip"    long_name="Freshwater flux from sea ice"                          standard_name="freshwater_flux_from_ice"                detect_missing_value="true" unit="kg/m2/s"  > vfxice    * icemask + $missval * (1.-icemask) </field>
+      <field id="hfxsensib_cmip" long_name="Net sensible heat flux under sea ice"                  standard_name="ice_ocean_heat_flux"                     detect_missing_value="true" unit="W/m2"     > hfxsensib * icemask + $missval * (1.-icemask) </field>
+      <field id="hfxcndtop_cmip" long_name="Net conductive heat flux at the ice surface"           standard_name="conductive_heat_flux_at_sea_ice_surface" detect_missing_value="true" unit="W/m2"     > hfxcndtop * icemask + $missval * (1.-icemask) </field>
+      <field id="hfxcndbot_cmip" long_name="Net conductive heat flux at the ice bottom"            standard_name="conductive_heat_flux_at_sea_ice_bottom"  detect_missing_value="true" unit="W/m2"     > hfxcndbot * icemask + $missval * (1.-icemask) </field>
+      <field id="sfxice_cmip"    long_name="Salt flux from sea ice"                                standard_name="salt_flux_from_ice"                      detect_missing_value="true" unit="kg/m2/s"  > sfxice    * icemask + $missval * (1.-icemask) </field>
+
+      <!-- trends -->
+      <field id="dmithd"       long_name="sea-ice mass change from thermodynamics"                 standard_name="tendency_of_sea_ice_amount_due_to_thermodynamics"                        unit="kg/m2/s" />
+      <field id="dmidyn"       long_name="sea-ice mass change from dynamics"                       standard_name="tendency_of_sea_ice_amount_due_to_dynamics"                              unit="kg/m2/s" />
+      <field id="dmiopw"       long_name="sea-ice mass change through growth in supercooled open water (frazil)" standard_name="tendency_of_sea_ice_amount_due_to_freezing_in_open_water"  unit="kg/m2/s" />
+      <field id="dmibog"       long_name="sea-ice mass change through basal growth"                standard_name="tendency_of_sea_ice_amount_due_to_congelation_ice_accumulation"          unit="kg/m2/s" />
+      <field id="dmisni"       long_name="sea-ice mass change through snow-to-ice conversion"      standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                       unit="kg/m2/s" />
+      <field id="dmtsub"       long_name="snow and sea ice mass change through sublimation"        standard_name="tendency_of_snow_and_ice_amount_due_to_sublimation"                      unit="kg/m2/s" />
+      <field id="dmssub"       long_name="sea-ice mass change through evaporation and sublimation" standard_name="water_evaporation_flux"                                                  unit="kg/m2/s" />
+      <field id="dmisub"       long_name="snow mass change through evaporation or sublimation"     standard_name="surface_snow_sublimation_flux"                                           unit="kg/m2/s" />
+      <field id="dmisum"       long_name="sea-ice mass change through surface melting"             standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                       unit="kg/m2/s" />
+      <field id="dmibom"       long_name="sea-ice mass change through bottom melting"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                         unit="kg/m2/s" />
+      <field id="dmilam"       long_name="sea-ice mass change through lateral melting"             standard_name="tendency_of_sea_ice_amount_due_to_lateral_melting"                       unit="kg/m2/s" />
+      <field id="dmsspr"       long_name="snow mass change through snow fall"                      standard_name="snowfall_flux"                                                           unit="kg/m2/s" />
+      <field id="dmsmel"       long_name="snow mass change through melt"                           standard_name="surface_snow_melt_flux"                                                  unit="kg/m2/s" />
+      <field id="dmsdyn"       long_name="snow mass change through advection by sea-ice dynamics"  standard_name="tendency_of_snow_mass_due_to_sea_ice_dynamics"                           unit="kg/m2/s" />
+      <field id="dmsssi"       long_name="snow mass change through snow-to-ice conversion"         standard_name="tendency_of_snow_mass_due_to_snow_to_ice_conversion"                     unit="kg/m2/s" />
+
+      <!-- momentum (rheology) -->
+      <field id="uice_cmip"    long_name="X-component of sea ice velocity"                         standard_name="sea_ice_x_velocity"                    detect_missing_value="true" unit="m/s"   > uice    * icemask + $missval * (1.-icemask) </field>
+      <field id="vice_cmip"    long_name="Y-component of sea ice velocity"                         standard_name="sea_ice_y_velocity"                    detect_missing_value="true" unit="m/s"   > vice    * icemask + $missval * (1.-icemask) </field>
+      <field id="icevel_cmip"  long_name="Sea-ice speed"                                           standard_name="sea_ice_speed"                         detect_missing_value="true" unit="m/s"   > icevel  * icemask + $missval * (1.-icemask) </field>
+      <field id="utau_ai_cmip" long_name="X-component of atmospheric stress on sea ice"            standard_name="surface_downward_x_stress"             detect_missing_value="true" unit="N/m2"  > utau_ai * icemask + $missval * (1.-icemask) </field>
+      <field id="vtau_ai_cmip" long_name="Y-component of atmospheric stress on sea ice"            standard_name="surface_downward_y_stress"             detect_missing_value="true" unit="N/m2"  > vtau_ai * icemask + $missval * (1.-icemask) </field>
+      <field id="dssh_dx"      long_name="Sea-surface tilt term in force balance (x-component)"    standard_name="sea_surface_tilt_force_on_sea_ice_x"                               unit="N/m2" />
+      <field id="dssh_dy"      long_name="Sea-surface tilt term in force balance (y-component)"    standard_name="sea_surface_tilt_force_on_sea_ice_y"                               unit="N/m2" />
+      <field id="corstrx"      long_name="Coriolis force term in force balance (x-component)"      standard_name="coriolis_force_on_sea_ice_x"                                       unit="N/m2" />
+      <field id="corstry"      long_name="Coriolis force term in force balance (y-component)"      standard_name="coriolis_force_on_sea_ice_y"                                       unit="N/m2" />
+      <field id="intstrx"      long_name="Internal stress term in force balance (x-component)"     standard_name="internal_stress_in_sea_ice_x"                                      unit="N/m2" />
+      <field id="intstry"      long_name="Internal stress term in force balance (y-component)"     standard_name="internal_stress_in_sea_ice_y"                                      unit="N/m2" />
+
+      <!-- momentum (advection) -->
+      <field id="xmtrpice"     long_name="X-component of ice mass transport"                       standard_name="ice_x_transport"          grid_ref="grid_U_2D"              unit="kg/s" />
+      <field id="ymtrpice"     long_name="Y-component of ice mass transport"                       standard_name="ice_y_transport"          grid_ref="grid_V_2D"              unit="kg/s" />
+      <field id="xmtrpsnw"     long_name="X-component of snw mass transport"                       standard_name="snw_x_transport"          grid_ref="grid_U_2D"              unit="kg/s" />
+      <field id="ymtrpsnw"     long_name="Y-component of snw mass transport"                       standard_name="snw_y_transport"          grid_ref="grid_V_2D"              unit="kg/s" />
+      <field id="xatrp"        long_name="X-component of ice area transport"                       standard_name="area_x_transport"         grid_ref="grid_U_2D"              unit="m2/s" />
+      <field id="yatrp"        long_name="Y-component of ice area transport"                       standard_name="area_y_transport"         grid_ref="grid_V_2D"              unit="m2/s" />
+      <field id="xmtrptot"     long_name="X-component of sea-ice mass transport"                   standard_name="sea_ice_x_transport"      grid_ref="grid_U_2D"              unit="kg/s" > xmtrpice + xmtrpsnw </field>
+      <field id="ymtrptot"     long_name="Y-component of sea-ice mass transport"                   standard_name="sea_ice_y_transport"      grid_ref="grid_V_2D"              unit="kg/s" > ymtrpice + ymtrpsnw </field>
+
+      <!-- Ice transport through straits" -->
+      <field id="xmtrpice_ave"     long_name="Monthly average of x-ice mass transport"   field_ref="xmtrpice"          grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xmtrpice </field>
+      <field id="xmtrpice_section"                                                                                     grid_ref="grid_U_scalar"  > xmtrpice_ave </field>
+      <field id="xmtrpice_strait"                                                        field_ref="xmtrpice_section"  grid_ref="grid_U_4strait_ice"  />
+      <field id="xstrait_mifl"                                                           field_ref="xmtrpice_strait"   grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
+
+      <field id="ymtrpice_ave"     long_name="Monthly average of y-ice mass transport"   field_ref="ymtrpice"          grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @ymtrpice </field>
+      <field id="ymtrpice_section"                                                                                     grid_ref="grid_V_scalar"  > ymtrpice_ave </field>
+      <field id="ymtrpice_strait"                                                        field_ref="ymtrpice_section"  grid_ref="grid_V_4strait_ice"  />
+      <field id="ystrait_mifl"                                                           field_ref="ymtrpice_strait"   grid_ref="grid_V_4strait_ice_hsum" unit="kg/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
+
+      <field id="xmtrpsnw_ave"     long_name="Monthly average of x-snow mass transport"  field_ref="xmtrpsnw"          grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xmtrpsnw </field>
+      <field id="xmtrpsnw_section"                                                                                     grid_ref="grid_U_scalar"  > xmtrpsnw_ave </field>
+      <field id="xmtrpsnw_strait"                                                        field_ref="xmtrpsnw_section"  grid_ref="grid_U_4strait_ice"  />
+      <field id="xstrait_msfl"                                                           field_ref="xmtrpsnw_strait"   grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
+
+      <field id="ymtrpsnw_ave"     long_name="Monthly average of y-snow mass transport"  field_ref="ymtrpsnw"          grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @ymtrpsnw </field>
+      <field id="ymtrpsnw_section"                                                                                     grid_ref="grid_V_scalar"  > ymtrpsnw_ave </field>
+      <field id="ymtrpsnw_strait"                                                        field_ref="ymtrpsnw_section"  grid_ref="grid_V_4strait_ice"  />
+      <field id="ystrait_msfl"                                                           field_ref="ymtrpsnw_strait"   grid_ref="grid_V_4strait_ice_hsum" unit="kg/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
+
+      <field id="xatrp_ave"        long_name="Monthly average of x-ice area transport"   field_ref="xatrp"             grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xatrp </field>
+      <field id="xatrp_section"                                                                                        grid_ref="grid_U_scalar"  > xatrp_ave </field>
+      <field id="xatrp_strait"                                                           field_ref="xatrp_section"     grid_ref="grid_U_4strait_ice"  />
+      <field id="xstrait_arfl"                                                           field_ref="xatrp_strait"      grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
+
+      <field id="yatrp_ave"        long_name="Monthly average of y-ice area transport"   field_ref="yatrp"             grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @yatrp </field>
+      <field id="yatrp_section"                                                                                        grid_ref="grid_V_scalar"  > yatrp_ave </field>
+      <field id="yatrp_strait"                                                           field_ref="yatrp_section"     grid_ref="grid_V_4strait_ice"  />
+      <field id="ystrait_arfl"                                                           field_ref="yatrp_strait"      grid_ref="grid_V_4strait_ice_hsum" unit="m2/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
+
+      <field id="strait_mifl"      long_name="Sea ice mass flux through straits"      standard_name="sea_ice_mass_transport_across_line"   unit="kg/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_mifl + ystrait_mifl </field>
+      <field id="strait_msfl"      long_name="Snow mass flux through straits"         standard_name="snow_mass_transport_across_line"      unit="kg/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_msfl + ystrait_msfl </field>
+      <field id="strait_arfl"      long_name="Sea ice area flux through straits"      standard_name="sea_area_mass_transport_across_line"  unit="m2/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_arfl + ystrait_arfl </field>
+
+    </field_group> <!-- SBC_2D -->
+
+    <!-- categories -->
+    <field_group id="SBC_3D" grid_ref="grid_T_ncatice" >
+
+      <!-- standard ice fields -->
+      <field id="iceconc_cat"  long_name="Sea-ice concentration per category"                unit=""        />
+      <field id="icethic_cat"  long_name="Sea-ice thickness per category"                    unit="m"       detect_missing_value="true" />
+      <field id="snwthic_cat"  long_name="Snow thickness per category"                       unit="m"       detect_missing_value="true" />
+      <field id="icesalt_cat"  long_name="Sea-Ice Bulk salinity per category"                unit="g/kg"    detect_missing_value="true" />
+      <field id="icetemp_cat"  long_name="Ice temperature per category"                      unit="degC"    detect_missing_value="true" />
+      <field id="snwtemp_cat"  long_name="Snow temperature per category"                     unit="degC"    detect_missing_value="true" />
+      <field id="icettop_cat"  long_name="Ice/snow surface temperature per category"         unit="degC"    detect_missing_value="true" />
+      <field id="iceapnd_cat"  long_name="Ice melt pond grid fraction per category"          unit=""        />
+      <field id="icevpnd_cat"  long_name="Ice melt pond volume per grid area per category"   unit="m"       />
+      <field id="icehpnd_cat"  long_name="Ice melt pond thickness per category"              unit="m"       detect_missing_value="true" />
+      <field id="icehlid_cat"  long_name="Ice melt pond lid thickness per category"          unit="m"       detect_missing_value="true" />
+      <field id="iceafpnd_cat" long_name="Ice melt pond ice fraction per category"           unit=""        />
+      <field id="iceaepnd_cat" long_name="Ice melt pond effective fraction per category"     unit=""        />
+      <field id="icemask_cat"  long_name="Fraction of time step with sea ice (per category)" unit=""        />
+      <field id="iceage_cat"   long_name="Ice age per category"                              unit="days"    detect_missing_value="true" />
+      <field id="icebrv_cat"   long_name="Brine volume per category"                         unit="%"       detect_missing_value="true" />
+      <field id="icealb_cat"   long_name="Sea-ice or snow albedo"                            unit=""        detect_missing_value="true" />
+
+      <!-- Add-ons for SIMIP -->
+      <field id="iceconc_cat_cmip"     long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit=""   > iceconc_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
+      <field id="icethic_cat_cmip"     long_name="Sea-ice thickness in thickness categories"       standard_name="sea_ice_thickness_over_categories"     detect_missing_value="true" unit="m"  > icethic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
+      <field id="snwthic_cat_cmip"     long_name="Snow thickness in thickness categories"          standard_name="snow_thickness_over_categories"        detect_missing_value="true" unit="m"  > snwthic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
+      <field id="iceconc_cat_pct_cmip" long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit="%"  > iceconc_cat*100. * icemask_cat + $missval * (1.-icemask_cat) </field>
+
+      <!-- heat diffusion convergence tests -->
+      <field id="tice_cvgerr" long_name="sea ice temperature convergence error"      standard_name="sea_ice_temperature_convergence_err" unit="K" />
+      <field id="tice_cvgstp" long_name="sea ice temperature convergence iterations" standard_name="sea_ice_temperature_convergence_stp" unit=""  />
+
+    </field_group> <!-- SBC_3D -->
+
+    <!-- scalar variables -->
+    <field_group id="SBC_scalar"  grid_ref="grid_scalar" >
+      <field id="NH_iceextt"      long_name="Sea ice extent North"                   standard_name="sea_ice_extent_n"                   unit="1e6_km2"  />
+      <field id="SH_iceextt"      long_name="Sea ice extent South"                   standard_name="sea_ice_extent_s"                   unit="1e6_km2"  />
+      <field id="NH_icevolu"      long_name="Sea ice volume North"                   standard_name="sea_ice_volume_n"                   unit="1e3_km3"  />
+      <field id="SH_icevolu"      long_name="Sea ice volume South"                   standard_name="sea_ice_volume_s"                   unit="1e3_km3"  />
+      <field id="NH_icearea"      long_name="Sea ice area North"                     standard_name="sea_ice_area_n"                     unit="1e6_km2"  />
+      <field id="SH_icearea"      long_name="Sea ice area South"                     standard_name="sea_ice_area_s"                     unit="1e6_km2"  />
+
+      <!-- available with ln_icediaout -->
+      <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"      />
+      <field id="ibgfrcvolbot"    long_name="global mean ice/snow forcing at interface ice/snow-ocean (volume equivalent ocean volume)" unit="km3"      />
+      <field id="ibgfrctemtop"    long_name="global mean heat on top of ice/snw/ocean-atm "                                             unit="1e20J"    />
+      <field id="ibgfrctembot"    long_name="global mean heat below ice (on top of ocean) "                                             unit="1e20J"    />
+      <field id="ibgfrcsal"       long_name="global mean ice/snow forcing (salt equivalent ocean volume)"                               unit="pss*km3"  />
+      <field id="ibgfrchfxtop"    long_name="global mean heat flux on top of ice/snw/ocean-atm "                                        unit="W/m2"     />
+      <field id="ibgfrchfxbot"    long_name="global mean heat flux below ice (on top of ocean) "                                        unit="W/m2"     />
+
+      <field id="ibgvolume"       long_name="drift in ice/snow volume (equivalent ocean volume)"                                        unit="km3"      />
+      <field id="ibgsaltco"       long_name="drift in ice salt content (equivalent ocean volume)"                                       unit="pss*km3"  />
+      <field id="ibgheatco"       long_name="drift in ice/snow heat content"                                                            unit="1e20J"    />
+      <field id="ibgheatfx"       long_name="drift in ice/snow heat flux"                                                               unit="W/m2"     />
+
+      <field id="ibgvol_tot"      long_name="global mean ice volume"                                                                    unit="km3"      />
+      <field id="sbgvol_tot"      long_name="global mean snow volume"                                                                   unit="km3"      />
+      <field id="ibgarea_tot"     long_name="global mean ice area"                                                                      unit="km2"      />
+      <field id="ibgsalt_tot"     long_name="global mean ice salt content"                                                              unit="1e-3*km3" />
+      <field id="ibgheat_tot"     long_name="global mean ice heat content"                                                              unit="1e20J"    />
+      <field id="sbgheat_tot"     long_name="global mean snow heat content"                                                             unit="1e20J"    />
+
+    </field_group>
+
+    <!--
+        ============================================================================================================
     -->
-    <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
-
-    <!-- 
-============================================================================================================
-                                  Physical sea ice model variables
-============================================================================================================
-    -->
-
-      <field_group id="SBC" > <!-- time step automaticaly defined based on nn_fsbc -->
-
-	<!-- 2D variables -->
-        <field_group id="SBC_2D" grid_ref="grid_T_2D" >
-
-          <!-- =================== -->
-          <!-- standard ice fields -->  
-          <!-- =================== -->
-	  <!-- ice presence masks -->
-          <field id="icemask"      long_name="Fraction of time steps with sea ice"                     standard_name="sea_ice_mask"                              unit="" />
-          <field id="icemask05"    long_name="Ice mask (0 if ice conc. lower than  5%, 1 otherwise)"   standard_name="sea_ice_mask05"                            unit="" />
-          <field id="icemask15"    long_name="Ice mask (0 if ice conc. lower than 15%, 1 otherwise)"   standard_name="sea_ice_mask15"                            unit="" />
-	  <field id="icepres"      long_name="Fraction of time steps with sea ice"                     standard_name="sea_ice_time_fraction"                     unit="" />
-          <field id="fasticepres"  long_name="Fraction of time steps with landfast ice"                standard_name="fast_ice_time_fraction"                    unit="" />
- 
-	  <!-- general fields -->
-          <field id="icemass"      long_name="Sea-ice mass per gridcell area"                          standard_name="sea_ice_amount"                            unit="kg/m2"/>
-          <field id="snwmass"      long_name="Snow mass per area"                                      standard_name="liquid_water_content_of_surface_snow"      unit="kg/m2"/>
-          <field id="iceconc"      long_name="Sea-ice area fraction"                                   standard_name="sea_ice_area_fraction"                     unit=""     />
-          <field id="icevolu"      long_name="Sea-ice volume per area"                                 standard_name="sea_ice_thickness"                         unit="m"    />
-          <field id="icethic"      long_name="Sea-ice thickness"                                       standard_name="sea_ice_thickness"                         unit="m"    />
-          <field id="snwthic"      long_name="Snow thickness"                                          standard_name="snow_thickness"                            unit="m"    />
-          <field id="icebrv"       long_name="brine volume"                                                                                                      unit="%"    />
-          <field id="iceage"       long_name="ice age"                                                                                                           unit="days" detect_missing_value="true"/>
-          <field id="icehnew"      long_name="frazil ice collection thickness"                                                                                   unit="m"    />
-          <field id="snwvolu"      long_name="snow volume"                                                                                                       unit="m"    />
-          <field id="icefrb"       long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                         unit="m"    />
-          <field id="icealb"       long_name="Sea-ice or snow albedo"                                  standard_name="sea_ice_albedo"                            unit=""    detect_missing_value="true" />
-	  
-	  <!-- melt ponds -->
-	  <field id="iceapnd"      long_name="melt pond concentration"                                 standard_name="sea_ice_meltpond_concentration"            unit=""  /> 
-          <field id="icehpnd"      long_name="melt pond depth"                                         standard_name="sea_ice_meltpond_depth"                    unit="m" /> 
-          <field id="icevpnd"      long_name="melt pond volume"                                        standard_name="sea_ice_meltpond_volume"                   unit="m" /> 
-          <field id="icehlid"      long_name="melt pond lid depth"                                     standard_name="sea_ice_meltpondlid_depth"                 unit="m" /> 
-          <field id="icevlid"      long_name="melt pond lid volume"                                    standard_name="sea_ice_meltpondlid_volume"                unit="m" /> 
-          <field id="dvpn_mlt"     long_name="pond volume tendency due to surface melt"                standard_name="sea_ice_pondvolume_tendency_melt"          unit="kg/m2/s" />
-          <field id="dvpn_lid"     long_name="pond volume tendency due to exchanges with lid"          standard_name="sea_ice_pondvolume_tendency_lids"          unit="kg/m2/s" />
-          <field id="dvpn_rnf"     long_name="pond volume tendency due to runoff"                      standard_name="sea_ice_pondvolume_tendency_runoff"        unit="kg/m2/s" />
-          <field id="dvpn_drn"     long_name="pond volume tendency due to drainage"                    standard_name="sea_ice_pondvolume_tendency_drainage"      unit="kg/m2/s" />  
-	  
-	  <!-- heat -->
-          <field id="icetemp"      long_name="Mean ice temperature"                                                                                              unit="degC" detect_missing_value="true" />
-          <field id="snwtemp"      long_name="Mean snow temperature"                                                                                             unit="degC" detect_missing_value="true" />
-          <field id="icettop"      long_name="temperature at the ice surface"                                                                                    unit="degC" detect_missing_value="true" />
-          <field id="icetbot"      long_name="temperature at the ice bottom"                                                                                     unit="degC" detect_missing_value="true" />
-          <field id="icetsni"      long_name="temperature at the snow-ice interface"                                                                             unit="degC" detect_missing_value="true" />
-          <field id="icehc"        long_name="ice heat content"                                                                                                  unit="J/m2" /> 
-          <field id="snwhc"        long_name="snow heat content"                                                                                                 unit="J/m2" />
-	  
-	  <!-- salt -->
-          <field id="icesalt"      long_name="Sea ice salinity"                                                                                                  unit="g/kg"  detect_missing_value="true" />
-          <field id="icesalm"      long_name="Mass of salt in sea ice per area"                        standard_name="sea_ice_salt_mass"                         unit="kg/m2" />
-	  
-	  <!-- momentum (rheology) -->
-          <field id="uice"         long_name="X-component of sea ice velocity"                         standard_name="sea_ice_x_velocity"                        unit="m/s"  /> 
-          <field id="vice"         long_name="Y-component of sea ice velocity"                         standard_name="sea_ice_y_velocity"                        unit="m/s"  />      
-          <field id="icevel"       long_name="Sea-ice speed"                                           standard_name="sea_ice_speed"                             unit="m/s"  />
-          <field id="utau_ai"      long_name="X-component of atmospheric stress on sea ice"            standard_name="surface_downward_x_stress"                 unit="N/m2" />
-          <field id="vtau_ai"      long_name="Y-component of atmospheric stress on sea ice"            standard_name="surface_downward_y_stress"                 unit="N/m2" />
-          <field id="utau_oi"      long_name="X-component of ocean stress on sea ice"                  standard_name="sea_ice_base_upward_x_stress"              unit="N/m2" />
-          <field id="vtau_oi"      long_name="Y-component of ocean stress on sea ice"                  standard_name="sea_ice_base_upward_y_stress"              unit="N/m2" />
-          <field id="utau_bi"      long_name="X-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_x_stress"              unit="N/m2" />
-          <field id="vtau_bi"      long_name="Y-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_y_stress"              unit="N/m2" />
-          <field id="sig1_pnorm"   long_name="P-normalized 1st principal stress component"                                                                       unit=""     />
-          <field id="sig2_pnorm"   long_name="P-normalized 2nd principal stress component"                                                                       unit=""     />
-          <field id="icedlt"       long_name="delta"                                                   standard_name="delta"                                     unit=""     />
-          <field id="normstr"      long_name="Average normal stress in sea ice"                        standard_name="average_normal_stress"                     unit="N/m"  />
-          <field id="sheastr"      long_name="Maximum shear stress in sea ice"                         standard_name="maximum_shear_stress"                      unit="N/m"  />
-          <field id="icestr"       long_name="Compressive sea ice strength"                            standard_name="compressive_strength_of_sea_ice"           unit="N/m"  />
-          <field id="icediv"       long_name="Divergence of the sea-ice velocity field"                standard_name="divergence_of_sea_ice_velocity"            unit="s-1"  />
-          <field id="iceshe"       long_name="Maximum shear of sea-ice velocity field"                 standard_name="maximum_shear_of_sea_ice_velocity"         unit="s-1"  />
-          <field id="aniso"        long_name="anisotropy of sea ice floe orientation (0.5 - 1)"        standard_name="anisotropy"                                unit=""     />
-          <field id="yield11"      long_name="yield surface tensor component 11"                       standard_name="yield11"                                   unit="N/m"  />
-          <field id="yield22"      long_name="yield surface tensor component 22"                       standard_name="yield22"                                   unit="N/m"  />
-          <field id="yield12"      long_name="yield surface tensor component 12"                       standard_name="yield12"                                   unit="N/m"  />
-          <field id="beta_evp"     long_name="Relaxation parameter of ice rheology (beta)"             standard_name="relaxation_parameter_of_ice_rheology"      unit=""  />	 
- 
-	  <!-- surface heat fluxes -->
-          <field id="qt_ice"       long_name="total heat flux at ice surface"                          standard_name="surface_downward_heat_flux_in_air"         unit="W/m2" />
-          <field id="qsr_ice"      long_name="solar heat flux at ice surface"                          standard_name="surface_downwelling_shortwave_flux_in_air" unit="W/m2" />
-          <field id="qns_ice"      long_name="non-solar heat flux at ice surface (including E-P)"                                                                unit="W/m2" />
-          <field id="qtr_ice_bot"  long_name="solar heat flux transmitted through the ice (to the ocean)"                                                        unit="W/m2" />
-          <field id="qtr_ice_top"  long_name="solar heat flux transmitted through the ice surface"                                                               unit="W/m2" />
-          <field id="qt_oce_ai"    long_name="total heat flux at the ocean   surface: interface oce-(ice+atm)"                                                   unit="W/m2" />
-          <field id="qt_atm_oi"    long_name="total heat flux at the oce-ice surface: interface atm-(ice+oce)"                                                   unit="W/m2" />
-          <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                              unit="W/m2" />
-          <field id="albedo"       long_name="Mean albedo over sea ice and ocean"                                                                                unit=""     />
-          <field id="Cd_ice"       long_name="Momentum turbulent exchange coefficient"                                                                           unit=""     />
-          <field id="Ch_ice"       long_name="Heat turbulent exchange coefficient"                                                                               unit=""     />
-	  
-	  <!-- trends -->
-          <field id="afxthd"       long_name="sea-ice area fraction change from thermodynamics" standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics" unit="s-1" />
-          <field id="afxdyn"       long_name="sea-ice area fraction change from dynamics"       standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics" unit="s-1" />
-	  <field id="afxtot"       long_name="area tendency (total)"                                                                                              unit="s-1" />
-	  
-	  <!-- momentum (advection) -->
-          <field id="icemtrp"      long_name="ice  mass transport"                                          unit="kg/m2/s" />
-          <field id="snwmtrp"      long_name="snw  mass transport"                                          unit="kg/m2/s" />
-          <field id="salmtrp"      long_name="salt mass transport"                                          unit="kg/m2/s" />
-          <field id="dihctrp"      long_name="ice heat content transport"                                   unit="W/m2"    />
-          <field id="dshctrp"      long_name="snw heat content transport"                                   unit="W/m2"    />
-	  
-	  <!-- salt fluxes -->
-          <field id="sfxice"       long_name="ice-ocean salt flux from ice growth/melt (neg = growth)"      unit="kg/m2/s" />
-          <field id="sfxbog"       long_name="ice-ocean salt flux from ice bottom growth"                   unit="kg/m2/s" />
-          <field id="sfxbom"       long_name="ice-ocean salt flux from ice bottom melt"                     unit="kg/m2/s" />
-          <field id="sfxsum"       long_name="ice-ocean salt flux from ice surface melt"                    unit="kg/m2/s" />
-          <field id="sfxlam"       long_name="ice-ocean salt flux from ice lateral melt"                    unit="kg/m2/s" />
-          <field id="sfxsni"       long_name="ice-ocean salt flux from snow-ice formation"                  unit="kg/m2/s" />
-          <field id="sfxopw"       long_name="ice-ocean salt flux from ice formation in open water"         unit="kg/m2/s" />
-          <field id="sfxdyn"       long_name="ice-ocean salt flux from ice dynamics (ridging)"              unit="kg/m2/s" />
-          <field id="sfxbri"       long_name="ice-ocean salt flux from brines"                              unit="kg/m2/s" />
-          <field id="sfxres"       long_name="ice-ocean salt flux from undiagnosed processes"               unit="kg/m2/s" />
-          <field id="sfxsub"       long_name="ice-ocean salt flux from ice sublimation"                     unit="kg/m2/s" />
-
-	  <!-- mass fluxes -->
-          <field id="vfxice"       long_name="ice-ocean mass flux from ice melt/growth (neg = growth)"      unit="kg/m2/s" />
-          <field id="vfxbog"       long_name="ice-ocean mass flux from ice bottom growth"                   unit="kg/m2/s" />
-          <field id="vfxbom"       long_name="ice-ocean mass flux from ice bottom melt"                     unit="kg/m2/s" />
-          <field id="vfxsum"       long_name="ice-ocean mass flux from ice surface melt"                    unit="kg/m2/s" />
-          <field id="vfxlam"       long_name="ice-ocean mass flux from ice lateral melt"                    unit="kg/m2/s" />
-          <field id="vfxsni"       long_name="ice-ocean mass flux from snow-ice formation"                  unit="kg/m2/s" />
-          <field id="vfxopw"       long_name="ice-ocean mass flux from ice growth in open water"            unit="kg/m2/s" />
-          <field id="vfxdyn"       long_name="ice-ocean mass flux from ice dynamics (ridging)"              unit="kg/m2/s" />
-          <field id="vfxres"       long_name="ice-ocean mass flux from undiagnosed processes"               unit="kg/m2/s" />
-          <field id="vfxpnd"       long_name="ice-ocean mass flux from ice melt ponds"                      unit="kg/m2/s" />
-          <field id="vfxsub"       long_name="ice-atm.  mass flux from ice sublimation"                     unit="kg/m2/s" />
-          <field id="vfxsub_err"   long_name="ice-ocean mass flux from unbalance in sublimation (incl. in qt_oce_ai)" unit="kg/m2/s" />
-          <field id="vfxthin"      long_name="ice-ocean mass flux from ice growth in open water + thin ice(20cm)"     unit="kg/m2/s" />
-
-          <field id="vfxsnw"       long_name="ice-ocean mass flux from snw melt/growth (neg = growth)"      unit="kg/m2/s" />
-          <field id="vfxsnw_sum"   long_name="ice-ocean mass flux from snw surface melt"                    unit="kg/m2/s" />
-          <field id="vfxsnw_sni"   long_name="ice-ocean mass flux from snow-ice formation"                  unit="kg/m2/s" />
-          <field id="vfxsnw_dyn"   long_name="ice-ocean mass flux from dynamics (ridging)"                  unit="kg/m2/s" />
-          <field id="vfxsnw_sub"   long_name="ice-atm.  mass flux from snw sublimation"                     unit="kg/m2/s" />
-          <field id="vfxsnw_pre"   long_name="snw precipitation on ice"                                     unit="kg/m2/s" />
-
-	  <!-- heat fluxes -->
-          <field id="hfxbog"       long_name="heat flux used for bottom ice growth (neg.)"                  unit="W/m2" />
-          <field id="hfxbom"       long_name="heat flux used for bottom ice melt (pos.)"                    unit="W/m2" />
-          <field id="hfxsum"       long_name="heat flux used for surface ice melt"                          unit="W/m2" />
-          <field id="hfxopw"       long_name="heat flux used for open water ice formation"                  unit="W/m2" />
-          <field id="hfxdif"       long_name="heat flux used for ice temperature change"                    unit="W/m2" />
-          <field id="hfxsnw"       long_name="heat flux used for snow melt"                                 unit="W/m2" />
-          <field id="hfxerr"       long_name="heat flux error after heat diffusion"                         unit="W/m2" />
-          <!-- heat fluxes associated with mass exchange -->
-          <field id="hfxthd"       long_name="heat fluxes from ice-ocean mass exchange during thermo"       unit="W/m2" />
-          <field id="hfxdyn"       long_name="heat fluxes from ice-ocean mass exchange during dynamic"      unit="W/m2" />
-          <field id="hfxres"       long_name="heat fluxes from undiagnosed processes"                       unit="W/m2" />
-          <field id="hfxsub"       long_name="heat fluxes from ice-atm. mass exchange during sublimation"   unit="W/m2" />
-          <field id="hfxspr"       long_name="heat fluxes from ice-atm. mass exchange during snow precip"   unit="W/m2" />
-
-          <field id="hfxsensib"    long_name="Net sensible heat flux under sea ice (neg = ice cooling)"         standard_name="ice_ocean_heat_flux"                        unit="W/m2" />
-          <field id="hfxcndtop"    long_name="Net conductive heat flux at the ice surface (neg = ice cooling)"  standard_name="conductive_heat_flux_at_sea_ice_surface"    unit="W/m2" /> 
-          <field id="hfxcndbot"    long_name="Net conductive heat flux at the ice bottom (neg = ice cooling)"   standard_name="conductive_heat_flux_at_sea_ice_bottom"     unit="W/m2" />
-
-          <!-- diags -->
-          <field id="hfxdhc"        long_name="Heat content variation in snow and ice (neg = ice cooling)"   unit="W/m2" />
-          <!-- available if ln_icediachk=T -->
-          <field id="icedrift_mass" long_name="Ice mass drift (conservation check)"   unit="kg/m2/s" />
-          <field id="icedrift_salt" long_name="Ice salt drift (conservation check)"   unit="kg/m2/s" />
-          <field id="icedrift_heat" long_name="Ice heat drift (conservation check)"   unit="W/m2"    />
-
-	  <!-- sbcssm variables -->
-          <field id="sst_m"    unit="degC" />
-          <field id="sss_m"    unit="psu"  />
-          <field id="ssu_m"    unit="m/s"  />
-          <field id="ssv_m"    unit="m/s"  />
-          <field id="ssh_m"    unit="m"    />
-          <field id="e3t_m"    unit="m"    />
-          <field id="frq_m"    unit="-"    />
-
-          <!-- rheology convergence tests -->
-          <field id="uice_cvg"   long_name="sea ice velocity convergence"      standard_name="sea_ice_velocity_convergence"      unit="m/s" />
-
-	  <!-- ================= -->
-          <!-- Add-ons for SIMIP -->
-          <!-- ================= -->
-          <field id="icemass_cmip" long_name="Sea-ice mass per area"                                   standard_name="sea_ice_amount"                          detect_missing_value="true" unit="kg/m2"  > icemass * icemask   + $missval * (1.-icemask  ) </field>
-          <field id="icethic_cmip" long_name="Sea-ice thickness"                                       standard_name="sea_ice_thickness"                       detect_missing_value="true" unit="m"      > icethic * icemask05 + $missval * (1.-icemask05) </field>
-          <field id="snwmass_cmip" long_name="Snow mass per area"                                      standard_name="liquid_water_content_of_surface_snow"    detect_missing_value="true" unit="kg/m2"  > snwmass * icemask   + $missval * (1.-icemask  ) </field>
-          <field id="snwthic_cmip" long_name="Snow thickness"                                          standard_name="surface_snow_thickness"                  detect_missing_value="true" unit="m"      > snwthic * icemask05 + $missval * (1.-icemask05) </field>
-          <field id="iceconc_pct"  long_name="Sea-ice area fraction in percent"                        standard_name="sea_ice_area_fraction_in_percent"                                    unit="%"      > iceconc * 100.                                  </field>
-          <field id="iceage_cmip"  long_name="Age of sea ice"                                          standard_name="age_of_sea_ice"                          detect_missing_value="true" unit="days"   > iceage  * icemask15 + $missval * (1.-icemask15) </field>
-          <field id="icesalt_cmip" long_name="Sea ice salinity"                                        standard_name="sea_ice_salinity"                        detect_missing_value="true" unit="g/kg"   > icesalt * icemask   + $missval * (1.-icemask  ) </field>
-          <field id="icefrb_cmip"  long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                       detect_missing_value="true" unit="m"      > icefrb  * icemask   + $missval * (1.-icemask  ) </field>
-
-	  <!-- heat -->
-          <field id="icettop_cmip" long_name="Surface temperature of sea ice"                          standard_name="sea_ice_surface_temperature"             detect_missing_value="true" unit="K"  > (icettop+273.15) * icemask + $missval * (1.-icemask) </field>
-          <field id="icetsni_cmip" long_name="Temperature at snow-ice interface"                       standard_name="sea_ice_snow_interface_temperature"      detect_missing_value="true" unit="K"  > (icetsni+273.15) * icemask + $missval * (1.-icemask) </field>
-          <field id="icetbot_cmip" long_name="Temperature at ice-ocean interface"                      standard_name="sea_ice_bottom_temperature"              detect_missing_value="true" unit="K"  > (icetbot+273.15) * icemask + $missval * (1.-icemask) </field>
-          <field id="icehc_cmip"   long_name="Sea-ice heat content per unit area"                      standard_name="integral_of_sea_ice_temperature_wrt_depth_expressed_as_heat_content" detect_missing_value="true" unit="J/m2" > icehc * icemask + $missval * (1.-icemask) </field>
-          <field id="snwhc_cmip"   long_name="Snow-heat content per unit area"                         standard_name="thermal_energy_content_of_surface_snow"                              detect_missing_value="true" unit="J/m2" > snwhc * icemask + $missval * (1.-icemask) </field>
-
-	  <!-- fluxes (mass, heat, salt) -->
-          <field id="vfxsum_cmip"    long_name="Freshwater flux from sea-ice surface"                  standard_name="freshwater_flux_from_ice_surface"        detect_missing_value="true" unit="kg/m2/s"  > vfxsum    * icemask + $missval * (1.-icemask) </field>
-          <field id="vfxice_cmip"    long_name="Freshwater flux from sea ice"                          standard_name="freshwater_flux_from_ice"                detect_missing_value="true" unit="kg/m2/s"  > vfxice    * icemask + $missval * (1.-icemask) </field>
-          <field id="hfxsensib_cmip" long_name="Net sensible heat flux under sea ice"                  standard_name="ice_ocean_heat_flux"                     detect_missing_value="true" unit="W/m2"     > hfxsensib * icemask + $missval * (1.-icemask) </field> 
-          <field id="hfxcndtop_cmip" long_name="Net conductive heat flux at the ice surface"           standard_name="conductive_heat_flux_at_sea_ice_surface" detect_missing_value="true" unit="W/m2"     > hfxcndtop * icemask + $missval * (1.-icemask) </field> 
-          <field id="hfxcndbot_cmip" long_name="Net conductive heat flux at the ice bottom"            standard_name="conductive_heat_flux_at_sea_ice_bottom"  detect_missing_value="true" unit="W/m2"     > hfxcndbot * icemask + $missval * (1.-icemask) </field>
-          <field id="sfxice_cmip"    long_name="Salt flux from sea ice"                                standard_name="salt_flux_from_ice"                      detect_missing_value="true" unit="kg/m2/s"  > sfxice    * icemask + $missval * (1.-icemask) </field>
-
-	  <!-- trends -->
-          <field id="dmithd"       long_name="sea-ice mass change from thermodynamics"                 standard_name="tendency_of_sea_ice_amount_due_to_thermodynamics"                        unit="kg/m2/s" />
-          <field id="dmidyn"       long_name="sea-ice mass change from dynamics"                       standard_name="tendency_of_sea_ice_amount_due_to_dynamics"                              unit="kg/m2/s" />
-          <field id="dmiopw"       long_name="sea-ice mass change through growth in supercooled open water (frazil)" standard_name="tendency_of_sea_ice_amount_due_to_freezing_in_open_water"  unit="kg/m2/s" />
-          <field id="dmibog"       long_name="sea-ice mass change through basal growth"                standard_name="tendency_of_sea_ice_amount_due_to_congelation_ice_accumulation"          unit="kg/m2/s" />
-          <field id="dmisni"       long_name="sea-ice mass change through snow-to-ice conversion"      standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                       unit="kg/m2/s" />
-          <field id="dmtsub"       long_name="snow and sea ice mass change through sublimation"        standard_name="tendency_of_snow_and_ice_amount_due_to_sublimation"                      unit="kg/m2/s" />
-          <field id="dmssub"       long_name="sea-ice mass change through evaporation and sublimation" standard_name="water_evaporation_flux"                                                  unit="kg/m2/s" />
-          <field id="dmisub"       long_name="snow mass change through evaporation or sublimation"     standard_name="surface_snow_sublimation_flux"                                           unit="kg/m2/s" />
-          <field id="dmisum"       long_name="sea-ice mass change through surface melting"             standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                       unit="kg/m2/s" />
-          <field id="dmibom"       long_name="sea-ice mass change through bottom melting"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                         unit="kg/m2/s" />
-          <field id="dmilam"       long_name="sea-ice mass change through lateral melting"             standard_name="tendency_of_sea_ice_amount_due_to_lateral_melting"                       unit="kg/m2/s" />
-          <field id="dmsspr"       long_name="snow mass change through snow fall"                      standard_name="snowfall_flux"                                                           unit="kg/m2/s" />
-          <field id="dmsmel"       long_name="snow mass change through melt"                           standard_name="surface_snow_melt_flux"                                                  unit="kg/m2/s" />
-          <field id="dmsdyn"       long_name="snow mass change through advection by sea-ice dynamics"  standard_name="tendency_of_snow_mass_due_to_sea_ice_dynamics"                           unit="kg/m2/s" />
-          <field id="dmsssi"       long_name="snow mass change through snow-to-ice conversion"         standard_name="tendency_of_snow_mass_due_to_snow_to_ice_conversion"                     unit="kg/m2/s" />
-
-	  <!-- momentum (rheology) -->
-          <field id="uice_cmip"    long_name="X-component of sea ice velocity"                         standard_name="sea_ice_x_velocity"                    detect_missing_value="true" unit="m/s"   > uice    * icemask + $missval * (1.-icemask) </field>
-          <field id="vice_cmip"    long_name="Y-component of sea ice velocity"                         standard_name="sea_ice_y_velocity"                    detect_missing_value="true" unit="m/s"   > vice    * icemask + $missval * (1.-icemask) </field>     
-          <field id="icevel_cmip"  long_name="Sea-ice speed"                                           standard_name="sea_ice_speed"                         detect_missing_value="true" unit="m/s"   > icevel  * icemask + $missval * (1.-icemask) </field> 
-          <field id="utau_ai_cmip" long_name="X-component of atmospheric stress on sea ice"            standard_name="surface_downward_x_stress"             detect_missing_value="true" unit="N/m2"  > utau_ai * icemask + $missval * (1.-icemask) </field>
-          <field id="vtau_ai_cmip" long_name="Y-component of atmospheric stress on sea ice"            standard_name="surface_downward_y_stress"             detect_missing_value="true" unit="N/m2"  > vtau_ai * icemask + $missval * (1.-icemask) </field>
-          <field id="dssh_dx"      long_name="Sea-surface tilt term in force balance (x-component)"    standard_name="sea_surface_tilt_force_on_sea_ice_x"                               unit="N/m2" />
-          <field id="dssh_dy"      long_name="Sea-surface tilt term in force balance (y-component)"    standard_name="sea_surface_tilt_force_on_sea_ice_y"                               unit="N/m2" />
-          <field id="corstrx"      long_name="Coriolis force term in force balance (x-component)"      standard_name="coriolis_force_on_sea_ice_x"                                       unit="N/m2" />
-          <field id="corstry"      long_name="Coriolis force term in force balance (y-component)"      standard_name="coriolis_force_on_sea_ice_y"                                       unit="N/m2" />
-          <field id="intstrx"      long_name="Internal stress term in force balance (x-component)"     standard_name="internal_stress_in_sea_ice_x"                                      unit="N/m2" />
-          <field id="intstry"      long_name="Internal stress term in force balance (y-component)"     standard_name="internal_stress_in_sea_ice_y"                                      unit="N/m2" />
-
-	  <!-- momentum (advection) -->
-    	  <field id="xmtrpice"     long_name="X-component of ice mass transport"                       standard_name="ice_x_transport"          grid_ref="grid_U_2D"              unit="kg/s" />
-          <field id="ymtrpice"     long_name="Y-component of ice mass transport"                       standard_name="ice_y_transport"          grid_ref="grid_V_2D"              unit="kg/s" />
-          <field id="xmtrpsnw"     long_name="X-component of snw mass transport"                       standard_name="snw_x_transport"          grid_ref="grid_U_2D"              unit="kg/s" />
-          <field id="ymtrpsnw"     long_name="Y-component of snw mass transport"                       standard_name="snw_y_transport"          grid_ref="grid_V_2D"              unit="kg/s" />
-          <field id="xatrp"        long_name="X-component of ice area transport"                       standard_name="area_x_transport"         grid_ref="grid_U_2D"              unit="m2/s" />
-          <field id="yatrp"        long_name="Y-component of ice area transport"                       standard_name="area_y_transport"         grid_ref="grid_V_2D"              unit="m2/s" />
-          <field id="xmtrptot"     long_name="X-component of sea-ice mass transport"                   standard_name="sea_ice_x_transport"      grid_ref="grid_U_2D"              unit="kg/s" > xmtrpice + xmtrpsnw </field>
-    	  <field id="ymtrptot"     long_name="Y-component of sea-ice mass transport"                   standard_name="sea_ice_y_transport"      grid_ref="grid_V_2D"              unit="kg/s" > ymtrpice + ymtrpsnw </field>
-
-	  <!-- Ice transport through straits" -->
-         <field id="xmtrpice_ave"     long_name="Monthly average of x-ice mass transport"   field_ref="xmtrpice"          grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xmtrpice </field>
-         <field id="xmtrpice_section"                                                                                     grid_ref="grid_U_scalar"  > xmtrpice_ave </field>
-         <field id="xmtrpice_strait"                                                        field_ref="xmtrpice_section"  grid_ref="grid_U_4strait_ice"  />
-         <field id="xstrait_mifl"                                                           field_ref="xmtrpice_strait"   grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
-
-         <field id="ymtrpice_ave"     long_name="Monthly average of y-ice mass transport"   field_ref="ymtrpice"          grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @ymtrpice </field>
-         <field id="ymtrpice_section"                                                                                     grid_ref="grid_V_scalar"  > ymtrpice_ave </field>
-         <field id="ymtrpice_strait"                                                        field_ref="ymtrpice_section"  grid_ref="grid_V_4strait_ice"  />
-	 <field id="ystrait_mifl"                                                           field_ref="ymtrpice_strait"   grid_ref="grid_V_4strait_ice_hsum" unit="kg/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
-
-         <field id="xmtrpsnw_ave"     long_name="Monthly average of x-snow mass transport"  field_ref="xmtrpsnw"          grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xmtrpsnw </field>
-         <field id="xmtrpsnw_section"                                                                                     grid_ref="grid_U_scalar"  > xmtrpsnw_ave </field>
-         <field id="xmtrpsnw_strait"                                                        field_ref="xmtrpsnw_section"  grid_ref="grid_U_4strait_ice"  />
-         <field id="xstrait_msfl"                                                           field_ref="xmtrpsnw_strait"   grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
-
-         <field id="ymtrpsnw_ave"     long_name="Monthly average of y-snow mass transport"  field_ref="ymtrpsnw"          grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @ymtrpsnw </field>
-         <field id="ymtrpsnw_section"                                                                                     grid_ref="grid_V_scalar"  > ymtrpsnw_ave </field>
-         <field id="ymtrpsnw_strait"                                                        field_ref="ymtrpsnw_section"  grid_ref="grid_V_4strait_ice"  />
-	 <field id="ystrait_msfl"                                                           field_ref="ymtrpsnw_strait"   grid_ref="grid_V_4strait_ice_hsum" unit="kg/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
-
-         <field id="xatrp_ave"        long_name="Monthly average of x-ice area transport"   field_ref="xatrp"             grid_ref="grid_U_2D"        freq_op="1mo" freq_offset="_reset_"  > @xatrp </field>
-         <field id="xatrp_section"                                                                                        grid_ref="grid_U_scalar"  > xatrp_ave </field>
-         <field id="xatrp_strait"                                                           field_ref="xatrp_section"     grid_ref="grid_U_4strait_ice"  />
-         <field id="xstrait_arfl"                                                           field_ref="xatrp_strait"      grid_ref="grid_U_4strait_ice_hsum" unit="kg/s" detect_missing_value="true" > this * maskMFO_u_ice </field>
-
-         <field id="yatrp_ave"        long_name="Monthly average of y-ice area transport"   field_ref="yatrp"             grid_ref="grid_V_2D"        freq_op="1mo" freq_offset="_reset_"  > @yatrp </field>
-         <field id="yatrp_section"                                                                                        grid_ref="grid_V_scalar"  > yatrp_ave </field>
-         <field id="yatrp_strait"                                                           field_ref="yatrp_section"     grid_ref="grid_V_4strait_ice"  />
-	 <field id="ystrait_arfl"                                                           field_ref="yatrp_strait"      grid_ref="grid_V_4strait_ice_hsum" unit="m2/s" detect_missing_value="true"  > this * maskMFO_v_ice </field>
-
-         <field id="strait_mifl"      long_name="Sea ice mass flux through straits"      standard_name="sea_ice_mass_transport_across_line"   unit="kg/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_mifl + ystrait_mifl </field>
-         <field id="strait_msfl"      long_name="Snow mass flux through straits"         standard_name="snow_mass_transport_across_line"      unit="kg/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_msfl + ystrait_msfl </field>
-	 <field id="strait_arfl"      long_name="Sea ice area flux through straits"      standard_name="sea_area_mass_transport_across_line"  unit="m2/s"  freq_op="1mo"  grid_ref="grid_4strait_ice" > xstrait_arfl + ystrait_arfl </field>
-
-	</field_group> <!-- SBC_2D -->
-
-	<!-- categories -->
-        <field_group id="SBC_3D" grid_ref="grid_T_ncatice" >
-
-          <!-- standard ice fields -->  
-	  <field id="iceconc_cat"  long_name="Sea-ice concentration per category"                unit=""        />
-          <field id="icethic_cat"  long_name="Sea-ice thickness per category"                    unit="m"       detect_missing_value="true" />
-          <field id="snwthic_cat"  long_name="Snow thickness per category"                       unit="m"       detect_missing_value="true" />
-          <field id="icesalt_cat"  long_name="Sea-Ice Bulk salinity per category"                unit="g/kg"    detect_missing_value="true" />
-          <field id="icetemp_cat"  long_name="Ice temperature per category"                      unit="degC"    detect_missing_value="true" />
-          <field id="snwtemp_cat"  long_name="Snow temperature per category"                     unit="degC"    detect_missing_value="true" />
-          <field id="icettop_cat"  long_name="Ice/snow surface temperature per category"         unit="degC"    detect_missing_value="true" />
-          <field id="iceapnd_cat"  long_name="Ice melt pond grid fraction per category"          unit=""        /> 
-          <field id="icevpnd_cat"  long_name="Ice melt pond volume per grid area per category"   unit="m"       />  
-          <field id="icehpnd_cat"  long_name="Ice melt pond thickness per category"              unit="m"       detect_missing_value="true" /> 
-          <field id="icehlid_cat"  long_name="Ice melt pond lid thickness per category"          unit="m"       detect_missing_value="true" /> 
-          <field id="iceafpnd_cat" long_name="Ice melt pond ice fraction per category"           unit=""        /> 
-          <field id="iceaepnd_cat" long_name="Ice melt pond effective fraction per category"     unit=""        /> 
-          <field id="icemask_cat"  long_name="Fraction of time step with sea ice (per category)" unit=""        />
-          <field id="iceage_cat"   long_name="Ice age per category"                              unit="days"    detect_missing_value="true" />
-          <field id="icebrv_cat"   long_name="Brine volume per category"                         unit="%"       detect_missing_value="true" />
-          <field id="icealb_cat"   long_name="Sea-ice or snow albedo"                            unit=""        detect_missing_value="true" />
-
-          <!-- Add-ons for SIMIP -->
-          <field id="iceconc_cat_cmip"     long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit=""   > iceconc_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
-          <field id="icethic_cat_cmip"     long_name="Sea-ice thickness in thickness categories"       standard_name="sea_ice_thickness_over_categories"     detect_missing_value="true" unit="m"  > icethic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
-          <field id="snwthic_cat_cmip"     long_name="Snow thickness in thickness categories"          standard_name="snow_thickness_over_categories"        detect_missing_value="true" unit="m"  > snwthic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field>
-          <field id="iceconc_cat_pct_cmip" long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit="%"  > iceconc_cat*100. * icemask_cat + $missval * (1.-icemask_cat) </field>
-
-          <!-- heat diffusion convergence tests -->
-          <field id="tice_cvgerr" long_name="sea ice temperature convergence error"      standard_name="sea_ice_temperature_convergence_err" unit="K" />
-          <field id="tice_cvgstp" long_name="sea ice temperature convergence iterations" standard_name="sea_ice_temperature_convergence_stp" unit=""  />
-
-	</field_group> <!-- SBC_3D -->
-	
-	<!-- scalar variables -->
-	<field_group id="SBC_scalar"  grid_ref="grid_scalar" >
-          <field id="NH_iceextt"      long_name="Sea ice extent North"                   standard_name="sea_ice_extent_n"                   unit="1e6_km2"  />
-          <field id="SH_iceextt"      long_name="Sea ice extent South"                   standard_name="sea_ice_extent_s"                   unit="1e6_km2"  />
-          <field id="NH_icevolu"      long_name="Sea ice volume North"                   standard_name="sea_ice_volume_n"                   unit="1e3_km3"  />
-          <field id="SH_icevolu"      long_name="Sea ice volume South"                   standard_name="sea_ice_volume_s"                   unit="1e3_km3"  />
-          <field id="NH_icearea"      long_name="Sea ice area North"                     standard_name="sea_ice_area_n"                     unit="1e6_km2"  />
-          <field id="SH_icearea"      long_name="Sea ice area South"                     standard_name="sea_ice_area_s"                     unit="1e6_km2"  />
-
-          <!-- available with ln_icediaout -->
-          <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"      />
-          <field id="ibgfrcvolbot"    long_name="global mean ice/snow forcing at interface ice/snow-ocean (volume equivalent ocean volume)" unit="km3"      />
-          <field id="ibgfrctemtop"    long_name="global mean heat on top of ice/snw/ocean-atm "                                             unit="1e20J"    />
-          <field id="ibgfrctembot"    long_name="global mean heat below ice (on top of ocean) "                                             unit="1e20J"    />
-          <field id="ibgfrcsal"       long_name="global mean ice/snow forcing (salt equivalent ocean volume)"                               unit="pss*km3"  />
-          <field id="ibgfrchfxtop"    long_name="global mean heat flux on top of ice/snw/ocean-atm "                                        unit="W/m2"     />
-          <field id="ibgfrchfxbot"    long_name="global mean heat flux below ice (on top of ocean) "                                        unit="W/m2"     />
-	  
-          <field id="ibgvolume"       long_name="drift in ice/snow volume (equivalent ocean volume)"                                        unit="km3"      />
-          <field id="ibgsaltco"       long_name="drift in ice salt content (equivalent ocean volume)"                                       unit="pss*km3"  />
-          <field id="ibgheatco"       long_name="drift in ice/snow heat content"                                                            unit="1e20J"    />
-          <field id="ibgheatfx"       long_name="drift in ice/snow heat flux"                                                               unit="W/m2"     />
-
-          <field id="ibgvol_tot"      long_name="global mean ice volume"                                                                    unit="km3"      />
-          <field id="sbgvol_tot"      long_name="global mean snow volume"                                                                   unit="km3"      />
-          <field id="ibgarea_tot"     long_name="global mean ice area"                                                                      unit="km2"      />
-          <field id="ibgsalt_tot"     long_name="global mean ice salt content"                                                              unit="1e-3*km3" />
-          <field id="ibgheat_tot"     long_name="global mean ice heat content"                                                              unit="1e20J"    />
-          <field id="sbgheat_tot"     long_name="global mean snow heat content"                                                             unit="1e20J"    />
-
-	</field_group>
-  
-	<!-- 
-============================================================================================================
-	-->
-	<!-- output variables for my configuration (example) --> 
-      
-	<field_group id="myvarICE"        grid_ref="grid_T_2D" >
-	  <!-- ice mask -->
-	  <field field_ref="icemask"          name="simsk"   />
-	  <field field_ref="icemask05"        name="simsk05" />
-	  <field field_ref="icemask15"        name="simsk15" />
-	  
-	  <!-- general -->
-	  <field field_ref="snwvolu"          name="snvolu" />
-	  <field field_ref="snwthic"          name="snthic" />
-	  <field field_ref="icethic"          name="sithic" />
-<!--
-	  <field field_ref="icethic"          name="sithic_max" operation="maximum" />
-	  <field field_ref="icethic"          name="sithic_min" operation="minimum" />
--->
-	  <field field_ref="fasticepres"      name="fasticepres" />
-	  <field field_ref="icevolu"          name="sivolu" />
-	  <field field_ref="iceconc"          name="siconc" />
-	  <field field_ref="icesalt"          name="sisali" />
-	  <field field_ref="iceapnd"          name="siapnd" />
-	  <field field_ref="icehpnd"          name="sihpnd" />
-	  <field field_ref="icevpnd"          name="sivpnd" />
-          <field field_ref="iceage"           name="siage"  />
-	  <field field_ref="sst_m"            name="sst_m"  />
-	  <field field_ref="sss_m"            name="sss_m"  />
-	  
-	  <!-- heat -->
-	  <field field_ref="icetemp"          name="sitemp" />
-	  <field field_ref="snwtemp"          name="sntemp" />
-	  <field field_ref="icettop"          name="sittop" />
-	  <field field_ref="icetbot"          name="sitbot" />
-	  <field field_ref="icetsni"          name="sitsni" />
-	  
-	  <!-- momentum -->
-	  <field field_ref="uice"             name="sivelu"  />
-	  <field field_ref="vice"             name="sivelv"  />
-	  <field field_ref="icevel"           name="sivelo"  />
-	  <field field_ref="utau_ai"          name="utau_ai" />
-	  <field field_ref="vtau_ai"          name="vtau_ai" />
-	  <field field_ref="utau_oi"          name="utau_oi" />
-	  <field field_ref="vtau_oi"          name="vtau_oi" />
-	  
-	  <!-- rheology -->
-	  <field field_ref="icediv"           name="sidive"  />
-	  <field field_ref="iceshe"           name="sishea"  />
-	  <field field_ref="icestr"           name="sistre"  />
-	  <field field_ref="normstr"          name="normstr" />
-	  <field field_ref="sheastr"          name="sheastr" />
-	  <field field_ref="sig1_pnorm"       name="sig1_pnorm"/>
-	  <field field_ref="sig2_pnorm"       name="sig2_pnorm"/>
-	  <field field_ref="icedlt"           name="sidelta" />
-	  
-	  <!-- heat fluxes -->
-	  <field field_ref="qt_oce_ai"        name="qt_oce_ai"  />
-	  <field field_ref="qt_atm_oi"        name="qt_atm_oi"  />
-	  <field field_ref="qtr_ice_top"      name="qtr_ice_top"/>
-	  <field field_ref="qtr_ice_bot"      name="qtr_ice_bot"/>
-	  <field field_ref="qt_ice"           name="qt_ice"     />
-	  <field field_ref="qsr_ice"          name="qsr_ice"    />
-	  <field field_ref="qns_ice"          name="qns_ice"    />
-	  <field field_ref="qemp_ice"         name="qemp_ice"   />
-	  <field field_ref="albedo"           name="albedo"     />
-          <field field_ref="icealb"           name="icealb"     />
-	  
-	  <field field_ref="hfxcndtop"        name="hfxcndtop"  />
-	  <field field_ref="hfxcndbot"        name="hfxcndbot"  />
-	  <field field_ref="hfxsensib"        name="hfxsensib"  />
-
-	  <field field_ref="icehc"         name="icehc"  />
-	  <field field_ref="snwhc"         name="snwhc"  />
-	  <field field_ref="hfxbog"        name="hfxbog"  />
-	  <field field_ref="hfxbom"        name="hfxbom"  />
-	  <field field_ref="hfxsum"        name="hfxsum"  />
-	  <field field_ref="hfxopw"        name="hfxopw"  />
-	  <field field_ref="hfxdif"        name="hfxdif"  />
-	  <field field_ref="hfxsnw"        name="hfxsnw"  />
-	  <field field_ref="hfxerr"        name="hfxerr"  />
-	  <field field_ref="hfxthd"        name="hfxthd"  />
-	  <field field_ref="hfxdyn"        name="hfxdyn"  />
-	  <field field_ref="hfxres"        name="hfxres"  />
-	  <field field_ref="hfxsub"        name="hfxsub"  />
-	  <field field_ref="hfxspr"        name="hfxspr"  />
-
-<!--
-	  <field field_ref="hfxdhc"        name="hfxbudget"  operation="average" freq_op="1d" > @qt_atm_oi - @qt_oce_ai -@hfxdhc </field>
--->
-	  
-	  <!-- salt fluxes -->
-	  <field field_ref="sfxice"           name="sfxice" />
-	  
-	  <!-- mass fluxes -->
-	  <field field_ref="vfxice"           name="vfxice" />
-	  <field field_ref="vfxsnw"           name="vfxsnw" />
-
-	  <field field_ref="vfxbom"           name="vfxbom" />
-	  <field field_ref="vfxbog"           name="vfxbog" />
-	  <field field_ref="vfxsum"           name="vfxsum" />
-	  <field field_ref="vfxopw"           name="vfxopw" />
-	  <field field_ref="vfxlam"           name="vfxlam" />
-	  <field field_ref="vfxsni"           name="vfxsni" />
-	  <field field_ref="vfxdyn"           name="vfxdyn" />
-	  <field field_ref="vfxres"           name="vfxres" />
-	  <field field_ref="vfxpnd"           name="vfxpnd" />
-	  <field field_ref="vfxsub"           name="vfxsub" />
-	  <field field_ref="vfxsub_err"       name="vfxsub_err" />
-          <field field_ref="vfxthin"          name="vfxthin" />
-	
-        </field_group>
-
-
-        <field_group id="myvarICE_cat"        grid_ref="grid_T_ncatice" >
-
-	  <!-- categories -->
-	  <field field_ref="icemask_cat"      name="simskcat"/>
-	  <field field_ref="snwthic_cat"      name="snthicat"/>
-	  <field field_ref="iceconc_cat"      name="siconcat"/>
-	  <field field_ref="icethic_cat"      name="sithicat"/>
-	  <field field_ref="icesalt_cat"      name="sisalcat"/>
-	  <field field_ref="icetemp_cat"      name="sitemcat"/>
-	  <field field_ref="snwtemp_cat"      name="sntemcat"/>
-	  <field field_ref="icettop_cat"      name="sitopcat"/>
-
-	</field_group>    
-
-	<field_group id="ICE_globalbudget"  grid_ref="grid_scalar" >
-	  <!-- global contents -->
-    	  <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
-	  <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
-    	  <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
-    	  <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
-    	  <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
-    	  <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
-
-	  <!-- global drifts (conservation checks) -->
-	  <field field_ref="ibgvolume"        name="ibgvolume"    />
-    	  <field field_ref="ibgsaltco"        name="ibgsaltco"    />
-    	  <field field_ref="ibgheatco"        name="ibgheatco"    />
-          <field field_ref="ibgheatfx"        name="ibgheatfx"    />
-
-	  <!-- global forcings  -->
-    	  <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
-    	  <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
-    	  <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
-    	  <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
-    	  <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
-          <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
-          <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
-	</field_group>
-
-
-	<!--============================-->
-	<!-- SIMIP sea ice field groups -->
-	<!--     Notz et al 2016        -->
-	<!--============================-->
-
-	<!-- SIMIP monthly scalar variables -->
-	<field_group id="SImon_scalars"   grid_ref="grid_scalar" >
-          <!-- Integrated quantities -->
-          <field field_ref="NH_iceextt"       name="siextentn"    />
-          <field field_ref="SH_iceextt"       name="siextents"    />
-          <field field_ref="NH_icevolu"       name="sivoln"       />
-          <field field_ref="SH_icevolu"       name="sivols"       />
-          <field field_ref="NH_icearea"       name="siarean"      />
-          <field field_ref="SH_icearea"       name="siareas"      />
-	</field_group>
-
-	<!-- SIMIP daily fields -->
-	<field_group id="SIday_fields"    grid_ref="grid_T_2D" > 
-          <field field_ref="icepres"          name="sitimefrac"   /> 
-          <field field_ref="iceconc_pct"      name="siconc"       /> 
-          <field field_ref="icethic_cmip"     name="sithick"      /> 
-          <field field_ref="snwthic_cmip"     name="sisnthick"    />
-          <field field_ref="icettop_cmip"     name="sitemptop"    />
-          <field field_ref="uice_cmip"        name="siu"          />
-          <field field_ref="vice_cmip"        name="siv"          />
-          <field field_ref="icevel_cmip"      name="sispeed"      />
-	</field_group>
-
-	<!-- SIMIP monthly fields -->
-	<field_group id="SImon_fields"    grid_ref="grid_T_2D"  >
-          <!-- Sea-ice state variables -->
-          <field field_ref="icepres"          name="sitimefrac"   />
-          <field field_ref="iceconc_pct"      name="siconc"       />
-          <field field_ref="icemass_cmip"     name="simass"       />
-          <field field_ref="icethic_cmip"     name="sithick"      />
-          <field field_ref="icevolu"          name="sivol"        />
-          <field field_ref="snwmass_cmip"     name="sisnmass"     /> 
-          <field field_ref="snwthic_cmip"     name="sisnthick"    />
-	  
-          <!-- additional state variables-->
-          <field field_ref="icettop_cmip"     name="sitemptop"    />
-          <field field_ref="icetsni_cmip"     name="sitempsnic"   />
-          <field field_ref="icetbot_cmip"     name="sitempbot"    />
-          <field field_ref="iceage_cmip"      name="siage"        />
-          <field field_ref="icesalm"          name="sisaltmass"   />
-          <field field_ref="icesalt_cmip"     name="sisali"       />
-          <field field_ref="icefrb_cmip"      name="sifb"         />
-          <field field_ref="icehc_cmip"       name="sihc"         />
-          <field field_ref="snwhc_cmip"       name="sisnhc"       />
-
-          <!-- freshwater fluxes -->
-          <field field_ref="vfxice_cmip"      name="siflfwbot"    />
-          <field field_ref="vfxsum_cmip"      name="siflfwdrain"  />
-
-          <!-- area balance -->
-          <field field_ref="afxthd"           name="sidconcth"    />
-          <field field_ref="afxdyn"           name="sidconcdyn"   />
-
-          <!-- mass balance -->
-          <field field_ref="dmithd"           name="sidmassth"        />
-          <field field_ref="dmidyn"           name="sidmassdyn"       />
-          <field field_ref="dmiopw"           name="sidmassgrowthwat" />
-          <field field_ref="dmibog"           name="sidmassgrowthbot" />
-          <field field_ref="dmisni"           name="sidmasssi"        />
-          <field field_ref="dmisub"           name="sidmassevapsubl"  />
-          <field field_ref="dmisum"           name="sidmassmelttop"   />
-          <field field_ref="dmibom"           name="sidmassmeltbot"   />
-          <field field_ref="dmilam"           name="sidmassmeltlat"   />
-          <field field_ref="dmsspr"           name="sndmasssnf"       />
-          <field field_ref="dmsmel"           name="sndmassmelt"      />
-          <field field_ref="dmssub"           name="sndmasssubl"      />
-          <field field_ref="dmsdyn"           name="sndmassdyn"       />
-          <field field_ref="dmsssi"           name="sndmasssi"        />
-
-          <!-- heat balance -->
-          <field field_ref="hfxsensib"        name="siflsensupbot"    />
-          <field field_ref="hfxcndtop"        name="siflcondtop"      />
-          <field field_ref="hfxcndbot"        name="siflcondbot"      />
-
-          <!-- salt balance -->
-          <field field_ref="sfxice_cmip"      name="siflsaltbot"      />
-
-          <!-- sea-ice dynamics -->
-          <field field_ref="uice_cmip"        name="siu"              />
-          <field field_ref="vice_cmip"        name="siv"              />
-          <field field_ref="icevel_cmip"      name="sispeed"          />
-          <field field_ref="utau_ai_cmip"     name="sistrxdtop"       />
-          <field field_ref="vtau_ai_cmip"     name="sistrydtop"       />
-          <field field_ref="utau_oi"          name="sistrxubot"       />
-          <field field_ref="vtau_oi"          name="sistryubot"       />
-          <field field_ref="icestr"           name="sicompstren"      />
-          <field field_ref="dssh_dx"          name="siforcetiltx"     />
-          <field field_ref="dssh_dy"          name="siforcetilty"     />
-          <field field_ref="corstrx"          name="siforcecoriolx"   />
-          <field field_ref="corstry"          name="siforcecorioly"   />
-          <field field_ref="intstrx"          name="siforceintstrx"   />
-          <field field_ref="intstry"          name="siforceintstry"   />
-          <field field_ref="xmtrptot"         name="sidmasstranx"     />
-          <field field_ref="ymtrptot"         name="sidmasstrany"     />
-          <field field_ref="normstr"          name="sistresave"       operation="instant" />
-          <field field_ref="sheastr"          name="sistremax"        operation="instant" />
-          <field field_ref="icediv"           name="sidivvel"         operation="instant" />
-          <field field_ref="iceshe"           name="sishevel"         operation="instant" />
-
-          <!-- sea ice fluxes across straits: 2D arrays to be post-processed  -->
-          <field field_ref="xmtrpice"         name="simassacrossline_x" />
-          <field field_ref="ymtrpice"         name="simassacrossline_y" />
-          <field field_ref="xmtrpsnw"         name="snmassacrossline_x" />
-          <field field_ref="ymtrpsnw"         name="snmassacrossline_y" />
-          <field field_ref="xatrp"            name="siareaacrossline_x" />
-          <field field_ref="yatrp"            name="siareaacrossline_y" />
-
-          <!-- category-dependent fields -->
-          <field field_ref="iceconc_cat_pct_cmip" name="siitdconc"    />
-          <field field_ref="icethic_cat_cmip"     name="siitdthick"   />
-          <field field_ref="snwthic_cat_cmip"     name="siitdsnthick" />
-	</field_group>
-
-      </field_group> <!-- SBC -->
-      
-    </field_definition>
+    <!-- output variables for my configuration (example) -->
+
+    <field_group id="myvarICE"        grid_ref="grid_T_2D" >
+      <!-- ice mask -->
+      <field field_ref="icemask"          name="simsk"   />
+      <field field_ref="icemask05"        name="simsk05" />
+      <field field_ref="icemask15"        name="simsk15" />
+
+      <!-- general -->
+      <field field_ref="snwvolu"          name="snvolu" />
+      <field field_ref="snwthic"          name="snthic" />
+      <field field_ref="icethic"          name="sithic" />
+      <!--
+          <field field_ref="icethic"          name="sithic_max" operation="maximum" />
+          <field field_ref="icethic"          name="sithic_min" operation="minimum" />
+      -->
+      <field field_ref="fasticepres"      name="fasticepres" />
+      <field field_ref="icevolu"          name="sivolu" />
+      <field field_ref="iceconc"          name="siconc" />
+      <field field_ref="icesalt"          name="sisali" />
+      <field field_ref="iceapnd"          name="siapnd" />
+      <field field_ref="icehpnd"          name="sihpnd" />
+      <field field_ref="icevpnd"          name="sivpnd" />
+      <field field_ref="iceage"           name="siage"  />
+      <field field_ref="sst_m"            name="sst_m"  />
+      <field field_ref="sss_m"            name="sss_m"  />
+
+      <!-- heat -->
+      <field field_ref="icetemp"          name="sitemp" />
+      <field field_ref="snwtemp"          name="sntemp" />
+      <field field_ref="icettop"          name="sittop" />
+      <field field_ref="icetbot"          name="sitbot" />
+      <field field_ref="icetsni"          name="sitsni" />
+
+      <!-- momentum -->
+      <field field_ref="uice"             name="sivelu"  />
+      <field field_ref="vice"             name="sivelv"  />
+      <field field_ref="icevel"           name="sivelo"  />
+      <field field_ref="utau_ai"          name="utau_ai" />
+      <field field_ref="vtau_ai"          name="vtau_ai" />
+      <field field_ref="utau_oi"          name="utau_oi" />
+      <field field_ref="vtau_oi"          name="vtau_oi" />
+
+      <!-- rheology -->
+      <field field_ref="icediv"           name="sidive"  />
+      <field field_ref="iceshe"           name="sishea"  />
+      <field field_ref="icestr"           name="sistre"  />
+      <field field_ref="normstr"          name="normstr" />
+      <field field_ref="sheastr"          name="sheastr" />
+      <field field_ref="sig1_pnorm"       name="sig1_pnorm"/>
+      <field field_ref="sig2_pnorm"       name="sig2_pnorm"/>
+      <field field_ref="icedlt"           name="sidelta" />
+
+      <!-- heat fluxes -->
+      <field field_ref="qt_oce_ai"        name="qt_oce_ai"  />
+      <field field_ref="qt_atm_oi"        name="qt_atm_oi"  />
+      <field field_ref="qtr_ice_top"      name="qtr_ice_top"/>
+      <field field_ref="qtr_ice_bot"      name="qtr_ice_bot"/>
+      <field field_ref="qt_ice"           name="qt_ice"     />
+      <field field_ref="qsr_ice"          name="qsr_ice"    />
+      <field field_ref="qns_ice"          name="qns_ice"    />
+      <field field_ref="qemp_ice"         name="qemp_ice"   />
+      <field field_ref="albedo"           name="albedo"     />
+      <field field_ref="icealb"           name="icealb"     />
+
+      <field field_ref="hfxcndtop"        name="hfxcndtop"  />
+      <field field_ref="hfxcndbot"        name="hfxcndbot"  />
+      <field field_ref="hfxsensib"        name="hfxsensib"  />
+
+      <field field_ref="icehc"         name="icehc"  />
+      <field field_ref="snwhc"         name="snwhc"  />
+      <field field_ref="hfxbog"        name="hfxbog"  />
+      <field field_ref="hfxbom"        name="hfxbom"  />
+      <field field_ref="hfxsum"        name="hfxsum"  />
+      <field field_ref="hfxopw"        name="hfxopw"  />
+      <field field_ref="hfxdif"        name="hfxdif"  />
+      <field field_ref="hfxsnw"        name="hfxsnw"  />
+      <field field_ref="hfxerr"        name="hfxerr"  />
+      <field field_ref="hfxthd"        name="hfxthd"  />
+      <field field_ref="hfxdyn"        name="hfxdyn"  />
+      <field field_ref="hfxres"        name="hfxres"  />
+      <field field_ref="hfxsub"        name="hfxsub"  />
+      <field field_ref="hfxspr"        name="hfxspr"  />
+
+      <!--
+          <field field_ref="hfxdhc"        name="hfxbudget"  operation="average" freq_op="1d" > @qt_atm_oi - @qt_oce_ai -@hfxdhc </field>
+      -->
+
+      <!-- salt fluxes -->
+      <field field_ref="sfxice"           name="sfxice" />
+
+      <!-- mass fluxes -->
+      <field field_ref="vfxice"           name="vfxice" />
+      <field field_ref="vfxsnw"           name="vfxsnw" />
+
+      <field field_ref="vfxbom"           name="vfxbom" />
+      <field field_ref="vfxbog"           name="vfxbog" />
+      <field field_ref="vfxsum"           name="vfxsum" />
+      <field field_ref="vfxopw"           name="vfxopw" />
+      <field field_ref="vfxlam"           name="vfxlam" />
+      <field field_ref="vfxsni"           name="vfxsni" />
+      <field field_ref="vfxdyn"           name="vfxdyn" />
+      <field field_ref="vfxres"           name="vfxres" />
+      <field field_ref="vfxpnd"           name="vfxpnd" />
+      <field field_ref="vfxsub"           name="vfxsub" />
+      <field field_ref="vfxsub_err"       name="vfxsub_err" />
+      <field field_ref="vfxthin"          name="vfxthin" />
+
+    </field_group>
+
+
+    <field_group id="myvarICE_cat"        grid_ref="grid_T_ncatice" >
+
+      <!-- categories -->
+      <field field_ref="icemask_cat"      name="simskcat"/>
+      <field field_ref="snwthic_cat"      name="snthicat"/>
+      <field field_ref="iceconc_cat"      name="siconcat"/>
+      <field field_ref="icethic_cat"      name="sithicat"/>
+      <field field_ref="icesalt_cat"      name="sisalcat"/>
+      <field field_ref="icetemp_cat"      name="sitemcat"/>
+      <field field_ref="snwtemp_cat"      name="sntemcat"/>
+      <field field_ref="icettop_cat"      name="sitopcat"/>
+
+    </field_group>
+
+    <field_group id="ICE_globalbudget"  grid_ref="grid_scalar" >
+      <!-- global contents -->
+      <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
+      <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
+      <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
+      <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
+      <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
+      <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
+
+      <!-- global drifts (conservation checks) -->
+      <field field_ref="ibgvolume"        name="ibgvolume"    />
+      <field field_ref="ibgsaltco"        name="ibgsaltco"    />
+      <field field_ref="ibgheatco"        name="ibgheatco"    />
+      <field field_ref="ibgheatfx"        name="ibgheatfx"    />
+
+      <!-- global forcings  -->
+      <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
+      <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
+      <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
+      <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
+      <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
+      <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
+      <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
+    </field_group>
+
+
+    <!--============================-->
+    <!-- SIMIP sea ice field groups -->
+    <!--     Notz et al 2016        -->
+    <!--============================-->
+
+    <!-- SIMIP monthly scalar variables -->
+    <field_group id="SImon_scalars"   grid_ref="grid_scalar" >
+      <!-- Integrated quantities -->
+      <field field_ref="NH_iceextt"       name="siextentn"    />
+      <field field_ref="SH_iceextt"       name="siextents"    />
+      <field field_ref="NH_icevolu"       name="sivoln"       />
+      <field field_ref="SH_icevolu"       name="sivols"       />
+      <field field_ref="NH_icearea"       name="siarean"      />
+      <field field_ref="SH_icearea"       name="siareas"      />
+    </field_group>
+
+    <!-- SIMIP daily fields -->
+    <field_group id="SIday_fields"    grid_ref="grid_T_2D" >
+      <field field_ref="icepres"          name="sitimefrac"   />
+      <field field_ref="iceconc_pct"      name="siconc"       />
+      <field field_ref="icethic_cmip"     name="sithick"      />
+      <field field_ref="snwthic_cmip"     name="sisnthick"    />
+      <field field_ref="icettop_cmip"     name="sitemptop"    />
+      <field field_ref="uice_cmip"        name="siu"          />
+      <field field_ref="vice_cmip"        name="siv"          />
+      <field field_ref="icevel_cmip"      name="sispeed"      />
+    </field_group>
+
+    <!-- SIMIP monthly fields -->
+    <field_group id="SImon_fields"    grid_ref="grid_T_2D"  >
+      <!-- Sea-ice state variables -->
+      <field field_ref="icepres"          name="sitimefrac"   />
+      <field field_ref="iceconc_pct"      name="siconc"       />
+      <field field_ref="icemass_cmip"     name="simass"       />
+      <field field_ref="icethic_cmip"     name="sithick"      />
+      <field field_ref="icevolu"          name="sivol"        />
+      <field field_ref="snwmass_cmip"     name="sisnmass"     />
+      <field field_ref="snwthic_cmip"     name="sisnthick"    />
+
+      <!-- additional state variables-->
+      <field field_ref="icettop_cmip"     name="sitemptop"    />
+      <field field_ref="icetsni_cmip"     name="sitempsnic"   />
+      <field field_ref="icetbot_cmip"     name="sitempbot"    />
+      <field field_ref="iceage_cmip"      name="siage"        />
+      <field field_ref="icesalm"          name="sisaltmass"   />
+      <field field_ref="icesalt_cmip"     name="sisali"       />
+      <field field_ref="icefrb_cmip"      name="sifb"         />
+      <field field_ref="icehc_cmip"       name="sihc"         />
+      <field field_ref="snwhc_cmip"       name="sisnhc"       />
+
+      <!-- freshwater fluxes -->
+      <field field_ref="vfxice_cmip"      name="siflfwbot"    />
+      <field field_ref="vfxsum_cmip"      name="siflfwdrain"  />
+
+      <!-- area balance -->
+      <field field_ref="afxthd"           name="sidconcth"    />
+      <field field_ref="afxdyn"           name="sidconcdyn"   />
+
+      <!-- mass balance -->
+      <field field_ref="dmithd"           name="sidmassth"        />
+      <field field_ref="dmidyn"           name="sidmassdyn"       />
+      <field field_ref="dmiopw"           name="sidmassgrowthwat" />
+      <field field_ref="dmibog"           name="sidmassgrowthbot" />
+      <field field_ref="dmisni"           name="sidmasssi"        />
+      <field field_ref="dmisub"           name="sidmassevapsubl"  />
+      <field field_ref="dmisum"           name="sidmassmelttop"   />
+      <field field_ref="dmibom"           name="sidmassmeltbot"   />
+      <field field_ref="dmilam"           name="sidmassmeltlat"   />
+      <field field_ref="dmsspr"           name="sndmasssnf"       />
+      <field field_ref="dmsmel"           name="sndmassmelt"      />
+      <field field_ref="dmssub"           name="sndmasssubl"      />
+      <field field_ref="dmsdyn"           name="sndmassdyn"       />
+      <field field_ref="dmsssi"           name="sndmasssi"        />
+
+      <!-- heat balance -->
+      <field field_ref="hfxsensib"        name="siflsensupbot"    />
+      <field field_ref="hfxcndtop"        name="siflcondtop"      />
+      <field field_ref="hfxcndbot"        name="siflcondbot"      />
+
+      <!-- salt balance -->
+      <field field_ref="sfxice_cmip"      name="siflsaltbot"      />
+
+      <!-- sea-ice dynamics -->
+      <field field_ref="uice_cmip"        name="siu"              />
+      <field field_ref="vice_cmip"        name="siv"              />
+      <field field_ref="icevel_cmip"      name="sispeed"          />
+      <field field_ref="utau_ai_cmip"     name="sistrxdtop"       />
+      <field field_ref="vtau_ai_cmip"     name="sistrydtop"       />
+      <field field_ref="utau_oi"          name="sistrxubot"       />
+      <field field_ref="vtau_oi"          name="sistryubot"       />
+      <field field_ref="icestr"           name="sicompstren"      />
+      <field field_ref="dssh_dx"          name="siforcetiltx"     />
+      <field field_ref="dssh_dy"          name="siforcetilty"     />
+      <field field_ref="corstrx"          name="siforcecoriolx"   />
+      <field field_ref="corstry"          name="siforcecorioly"   />
+      <field field_ref="intstrx"          name="siforceintstrx"   />
+      <field field_ref="intstry"          name="siforceintstry"   />
+      <field field_ref="xmtrptot"         name="sidmasstranx"     />
+      <field field_ref="ymtrptot"         name="sidmasstrany"     />
+      <field field_ref="normstr"          name="sistresave"       operation="instant" />
+      <field field_ref="sheastr"          name="sistremax"        operation="instant" />
+      <field field_ref="icediv"           name="sidivvel"         operation="instant" />
+      <field field_ref="iceshe"           name="sishevel"         operation="instant" />
+
+      <!-- sea ice fluxes across straits: 2D arrays to be post-processed  -->
+      <field field_ref="xmtrpice"         name="simassacrossline_x" />
+      <field field_ref="ymtrpice"         name="simassacrossline_y" />
+      <field field_ref="xmtrpsnw"         name="snmassacrossline_x" />
+      <field field_ref="ymtrpsnw"         name="snmassacrossline_y" />
+      <field field_ref="xatrp"            name="siareaacrossline_x" />
+      <field field_ref="yatrp"            name="siareaacrossline_y" />
+
+      <!-- category-dependent fields -->
+      <field field_ref="iceconc_cat_pct_cmip" name="siitdconc"    />
+      <field field_ref="icethic_cat_cmip"     name="siitdthick"   />
+      <field field_ref="snwthic_cat_cmip"     name="siitdsnthick" />
+    </field_group>
+
+  </field_group> <!-- SBC -->
+
+</field_definition>
Index: /NEMO/trunk/cfgs/SHARED/field_def_nemo-innerttrc.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/field_def_nemo-innerttrc.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/field_def_nemo-innerttrc.xml	(revision 14072)
@@ -1,59 +1,59 @@
-<?xml version="1.0"?> 
-    <!-- $id$ -->
-    
-    <!-- 
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+<!--
 ============================================================================================================
 =                                  definition of all existing variables                                    =
 =                                            DO NOT CHANGE                                                 =
 ============================================================================================================
-    -->
-   <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+-->
+<field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
 
-    <!-- 
-============================================================================================================
-                                     Inert tracers variables
-============================================================================================================
-    -->
+  <!--
+      ============================================================================================================
+      Inert tracers variables
+      ============================================================================================================
+  -->
 
 
-     <field_group id="inerttrc" grid_ref="grid_T_2D">
+  <field_group id="inerttrc" grid_ref="grid_T_2D">
 
-       <!-- CFC11 : variables available with ln_cfc11 -->
-       <field id="CFC11"        long_name="Chlorofluoro carbon11 Concentration"      unit="umol/m3"   grid_ref="grid_T_3D" />
-       <field id="CFC11_e3t"    long_name="CFC11 * e3t"                              unit="umol/m2"   grid_ref="grid_T_3D"  > CFC11 * e3t </field >
-       <field id="qtr_CFC11"    long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
-       <field id="qint_CFC11"   long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
+    <!-- CFC11 : variables available with ln_cfc11 -->
+    <field id="CFC11"        long_name="Chlorofluoro carbon11 Concentration"      unit="umol/m3"   grid_ref="grid_T_3D" />
+    <field id="CFC11_e3t"    long_name="CFC11 * e3t"                              unit="umol/m2"   grid_ref="grid_T_3D"  > CFC11 * e3t </field >
+    <field id="qtr_CFC11"    long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
+    <field id="qint_CFC11"   long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
 
-       <!-- CFC12 : variables available with ln_cfc12 -->
-       <field id="CFC12"        long_name="Chlorofluoro carbon12 Concentration"      unit="umol/m3"   grid_ref="grid_T_3D" />
-       <field id="CFC12_e3t"    long_name="CFC12 * e3t"                              unit="umol/m2"   grid_ref="grid_T_3D"  > CFC12 * e3t </field >
-       <field id="qtr_CFC12"    long_name="Air-sea flux of CFC12"                    unit="mol/m2/s"   />
-       <field id="qint_CFC12"   long_name="Cumulative air-sea flux of CFC12"         unit="mol/m2"     />
+    <!-- CFC12 : variables available with ln_cfc12 -->
+    <field id="CFC12"        long_name="Chlorofluoro carbon12 Concentration"      unit="umol/m3"   grid_ref="grid_T_3D" />
+    <field id="CFC12_e3t"    long_name="CFC12 * e3t"                              unit="umol/m2"   grid_ref="grid_T_3D"  > CFC12 * e3t </field >
+    <field id="qtr_CFC12"    long_name="Air-sea flux of CFC12"                    unit="mol/m2/s"   />
+    <field id="qint_CFC12"   long_name="Cumulative air-sea flux of CFC12"         unit="mol/m2"     />
 
-       <!-- SF6 : variables available with ln_sf6 -->
-       <field id="SF6"          long_name="Sulfur hexafluoride Concentration"        unit="umol/m3"   grid_ref="grid_T_3D" />
-       <field id="SF6_e3t"      long_name="SF6 * e3t"                                unit="umol/m2"   grid_ref="grid_T_3D"  > SF6 * e3t </field >
-       <field id="qtr_SF6"      long_name="Air-sea flux of SF6"                      unit="mol/m2/s"   />
-       <field id="qint_SF6"     long_name="Cumulative air-sea flux of SF6"           unit="mol/m2"     />
+    <!-- SF6 : variables available with ln_sf6 -->
+    <field id="SF6"          long_name="Sulfur hexafluoride Concentration"        unit="umol/m3"   grid_ref="grid_T_3D" />
+    <field id="SF6_e3t"      long_name="SF6 * e3t"                                unit="umol/m2"   grid_ref="grid_T_3D"  > SF6 * e3t </field >
+    <field id="qtr_SF6"      long_name="Air-sea flux of SF6"                      unit="mol/m2/s"   />
+    <field id="qint_SF6"     long_name="Cumulative air-sea flux of SF6"           unit="mol/m2"     />
 
-       <!-- C14 : variables available with ln_c14 -->
-       <field id="RC14"         long_name="Radiocarbon ratio"                        unit="-"         grid_ref="grid_T_3D"  />
-       <field id="RC14_e3t"     long_name="RC14 * e3t"                               unit="m"         grid_ref="grid_T_3D"   > RC14 * e3t </field >
-       <field id="DeltaC14"     long_name="Delta C14"                                unit="permil"    grid_ref="grid_T_3D"  />
-       <field id="C14Age"       long_name="Radiocarbon age"                          unit="yr"        grid_ref="grid_T_3D"  />
-       <field id="RAge"         long_name="Reservoir Age"                            unit="yr"       />
-       <field id="qtr_C14"      long_name="Air-sea flux of C14"                      unit="1/m2/s"   />
-       <field id="qint_C14"     long_name="Cumulative air-sea flux of C14"           unit="1/m2"     />
-       <field id="AtmCO2"       long_name="Global atmospheric CO2"                   unit="ppm"      />
-       <field id="AtmC14"       long_name="Global atmospheric DeltaC14"              unit="permil"   />
-       <field id="K_C14"        long_name="Global 14C/C exchange velocity"           unit="m/yr"     />
-       <field id="K_CO2"        long_name="Global CO2 piston velocity"               unit="cm/h"     />
-       <field id="C14Inv"       long_name="global Radiocarbon ocean inventory"       unit="10^26 atoms"   />
+    <!-- C14 : variables available with ln_c14 -->
+    <field id="RC14"         long_name="Radiocarbon ratio"                        unit="-"         grid_ref="grid_T_3D"  />
+    <field id="RC14_e3t"     long_name="RC14 * e3t"                               unit="m"         grid_ref="grid_T_3D"   > RC14 * e3t </field >
+    <field id="DeltaC14"     long_name="Delta C14"                                unit="permil"    grid_ref="grid_T_3D"  />
+    <field id="C14Age"       long_name="Radiocarbon age"                          unit="yr"        grid_ref="grid_T_3D"  />
+    <field id="RAge"         long_name="Reservoir Age"                            unit="yr"       />
+    <field id="qtr_C14"      long_name="Air-sea flux of C14"                      unit="1/m2/s"   />
+    <field id="qint_C14"     long_name="Cumulative air-sea flux of C14"           unit="1/m2"     />
+    <field id="AtmCO2"       long_name="Global atmospheric CO2"                   unit="ppm"      />
+    <field id="AtmC14"       long_name="Global atmospheric DeltaC14"              unit="permil"   />
+    <field id="K_C14"        long_name="Global 14C/C exchange velocity"           unit="m/yr"     />
+    <field id="K_CO2"        long_name="Global CO2 piston velocity"               unit="cm/h"     />
+    <field id="C14Inv"       long_name="global Radiocarbon ocean inventory"       unit="10^26 atoms"   />
 
-       <!-- AGE : variables available with ln_age -->
-       <field id="Age"          long_name="Sea water age since surface contact"      unit="yr"        grid_ref="grid_T_3D"  />
-       <field id="Age_e3t"      long_name="Age * e3t"                                unit="yr * m"   grid_ref="grid_T_3D"    > Age * e3t </field >
+    <!-- AGE : variables available with ln_age -->
+    <field id="Age"          long_name="Sea water age since surface contact"      unit="yr"        grid_ref="grid_T_3D"  />
+    <field id="Age_e3t"      long_name="Age * e3t"                                unit="yr * m"   grid_ref="grid_T_3D"    > Age * e3t </field >
 
-     </field_group>
+  </field_group>
 
-   </field_definition>
+</field_definition>
Index: /NEMO/trunk/cfgs/SHARED/field_def_nemo-oce.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/field_def_nemo-oce.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/field_def_nemo-oce.xml	(revision 14072)
@@ -1,1252 +1,1254 @@
 <?xml version="1.0"?>
-    <!-- $id$ -->
-
-    <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+<!-- $id$ -->
+
+<field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+
+  <!--
+      =====================================================================================================
+      =                                   Configurable diagnostics                                        =
+      =====================================================================================================
+  -->
+
+  <field_group id="diamlr_fields">
 
     <!--
-       =====================================================================================================
-       =                                   Configurable diagnostics                                        =
-       =====================================================================================================
-      -->
-
-    <field_group id="diamlr_fields">
+        =====================================================================================================
+        Configuration of multiple-linear-regression analysis (diamlr)
+        =====================================================================================================
+
+This field group configures diamlr for tidal harmonic analysis of field
+ssh: in addition to a regressor for fitting the mean value (diamlr_r101),
+it includes the regressors for the analysis of the tidal constituents
+that are available in the tidal-forcing implementation (see
+./src/OCE/SBC/tide.h90).
+
+    -->
+
+    <!-- Time -->
+    <field id="diamlr_time" grid_ref="diamlr_grid_T_2D" prec="8" />
+
+    <!-- Regressors for tidal harmonic analysis -->
+    <field id="diamlr_r001"  field_ref="diamlr_time" expr="sin( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M2"   />
+    <field id="diamlr_r002"  field_ref="diamlr_time" expr="cos( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M2"   />
+    <field id="diamlr_r003"  field_ref="diamlr_time" expr="sin( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:N2"   />
+    <field id="diamlr_r004"  field_ref="diamlr_time" expr="cos( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:N2"   />
+    <field id="diamlr_r005"  field_ref="diamlr_time" expr="sin( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:2N2"  />
+    <field id="diamlr_r006"  field_ref="diamlr_time" expr="cos( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:2N2"  />
+    <field id="diamlr_r007"  field_ref="diamlr_time" expr="sin( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S2"   />
+    <field id="diamlr_r008"  field_ref="diamlr_time" expr="cos( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S2"   />
+    <field id="diamlr_r009"  field_ref="diamlr_time" expr="sin( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K2"   />
+    <field id="diamlr_r010"  field_ref="diamlr_time" expr="cos( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K2"   />
+    <field id="diamlr_r011"  field_ref="diamlr_time" expr="sin( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K1"   />
+    <field id="diamlr_r012"  field_ref="diamlr_time" expr="cos( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K1"   />
+    <field id="diamlr_r013"  field_ref="diamlr_time" expr="sin( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:O1"   />
+    <field id="diamlr_r014"  field_ref="diamlr_time" expr="cos( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:O1"   />
+    <field id="diamlr_r015"  field_ref="diamlr_time" expr="sin( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Q1"   />
+    <field id="diamlr_r016"  field_ref="diamlr_time" expr="cos( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Q1"   />
+    <field id="diamlr_r017"  field_ref="diamlr_time" expr="sin( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:P1"   />
+    <field id="diamlr_r018"  field_ref="diamlr_time" expr="cos( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:P1"   />
+    <field id="diamlr_r019"  field_ref="diamlr_time" expr="sin( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M4"   />
+    <field id="diamlr_r020"  field_ref="diamlr_time" expr="cos( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M4"   />
+    <field id="diamlr_r021"  field_ref="diamlr_time" expr="sin( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mf"   />
+    <field id="diamlr_r022"  field_ref="diamlr_time" expr="cos( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mf"   />
+    <field id="diamlr_r023"  field_ref="diamlr_time" expr="sin( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mm"   />
+    <field id="diamlr_r024"  field_ref="diamlr_time" expr="cos( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mm"   />
+    <field id="diamlr_r025"  field_ref="diamlr_time" expr="sin( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Msqm" />
+    <field id="diamlr_r026"  field_ref="diamlr_time" expr="cos( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Msqm" />
+    <field id="diamlr_r027"  field_ref="diamlr_time" expr="sin( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mtm"  />
+    <field id="diamlr_r028"  field_ref="diamlr_time" expr="cos( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mtm"  />
+    <field id="diamlr_r029"  field_ref="diamlr_time" expr="sin( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S1"   />
+    <field id="diamlr_r030"  field_ref="diamlr_time" expr="cos( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S1"   />
+    <field id="diamlr_r031"  field_ref="diamlr_time" expr="sin( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:MU2"  />
+    <field id="diamlr_r032"  field_ref="diamlr_time" expr="cos( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:MU2"  />
+    <field id="diamlr_r033"  field_ref="diamlr_time" expr="sin( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:NU2"  />
+    <field id="diamlr_r034"  field_ref="diamlr_time" expr="cos( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:NU2"  />
+    <field id="diamlr_r035"  field_ref="diamlr_time" expr="sin( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:L2"   />
+    <field id="diamlr_r036"  field_ref="diamlr_time" expr="cos( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:L2"   />
+    <field id="diamlr_r037"  field_ref="diamlr_time" expr="sin( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:T2"   />
+    <field id="diamlr_r038"  field_ref="diamlr_time" expr="cos( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:T2"   />
+    <field id="diamlr_r101"  field_ref="diamlr_time" expr="diamlr_time^0.0"                         enabled=".TRUE."  comment="mean"              />
+
+    <!-- Fields selected for regression analysis -->
+    <field id="diamlr_f001" field_ref="ssh" enabled=".TRUE." />
+
+  </field_group>
+
+  <!--
+      ============================================================================================================
+      =                                  definition of all existing variables                                    =
+      =                                            DO NOT CHANGE                                                 =
+      ============================================================================================================
+  -->
+
+  <field_group id="diadetide_fields">
 
     <!--
-       =====================================================================================================
-                         Configuration of multiple-linear-regression analysis (diamlr)
-       =====================================================================================================
-
-       This field group configures diamlr for tidal harmonic analysis of field
-       ssh: in addition to a regressor for fitting the mean value (diamlr_r101),
-       it includes the regressors for the analysis of the tidal constituents
-       that are available in the tidal-forcing implementation (see
-       ./src/OCE/SBC/tide.h90).
-
-      -->
-
-      <!-- Time -->
-      <field id="diamlr_time" grid_ref="diamlr_grid_T_2D" prec="8" />
-
-      <!-- Regressors for tidal harmonic analysis -->
-      <field id="diamlr_r001"  field_ref="diamlr_time" expr="sin( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M2"   />
-      <field id="diamlr_r002"  field_ref="diamlr_time" expr="cos( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M2"   />
-      <field id="diamlr_r003"  field_ref="diamlr_time" expr="sin( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:N2"   />
-      <field id="diamlr_r004"  field_ref="diamlr_time" expr="cos( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:N2"   />
-      <field id="diamlr_r005"  field_ref="diamlr_time" expr="sin( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:2N2"  />
-      <field id="diamlr_r006"  field_ref="diamlr_time" expr="cos( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:2N2"  />
-      <field id="diamlr_r007"  field_ref="diamlr_time" expr="sin( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S2"   />
-      <field id="diamlr_r008"  field_ref="diamlr_time" expr="cos( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S2"   />
-      <field id="diamlr_r009"  field_ref="diamlr_time" expr="sin( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K2"   />
-      <field id="diamlr_r010"  field_ref="diamlr_time" expr="cos( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K2"   />
-      <field id="diamlr_r011"  field_ref="diamlr_time" expr="sin( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K1"   />
-      <field id="diamlr_r012"  field_ref="diamlr_time" expr="cos( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K1"   />
-      <field id="diamlr_r013"  field_ref="diamlr_time" expr="sin( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:O1"   />
-      <field id="diamlr_r014"  field_ref="diamlr_time" expr="cos( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:O1"   />
-      <field id="diamlr_r015"  field_ref="diamlr_time" expr="sin( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Q1"   />
-      <field id="diamlr_r016"  field_ref="diamlr_time" expr="cos( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Q1"   />
-      <field id="diamlr_r017"  field_ref="diamlr_time" expr="sin( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:P1"   />
-      <field id="diamlr_r018"  field_ref="diamlr_time" expr="cos( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:P1"   />
-      <field id="diamlr_r019"  field_ref="diamlr_time" expr="sin( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M4"   />
-      <field id="diamlr_r020"  field_ref="diamlr_time" expr="cos( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M4"   />
-      <field id="diamlr_r021"  field_ref="diamlr_time" expr="sin( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mf"   />
-      <field id="diamlr_r022"  field_ref="diamlr_time" expr="cos( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mf"   />
-      <field id="diamlr_r023"  field_ref="diamlr_time" expr="sin( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mm"   />
-      <field id="diamlr_r024"  field_ref="diamlr_time" expr="cos( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mm"   />
-      <field id="diamlr_r025"  field_ref="diamlr_time" expr="sin( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Msqm" />
-      <field id="diamlr_r026"  field_ref="diamlr_time" expr="cos( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Msqm" />
-      <field id="diamlr_r027"  field_ref="diamlr_time" expr="sin( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mtm"  />
-      <field id="diamlr_r028"  field_ref="diamlr_time" expr="cos( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mtm"  />
-      <field id="diamlr_r029"  field_ref="diamlr_time" expr="sin( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S1"   />
-      <field id="diamlr_r030"  field_ref="diamlr_time" expr="cos( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S1"   />
-      <field id="diamlr_r031"  field_ref="diamlr_time" expr="sin( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:MU2"  />
-      <field id="diamlr_r032"  field_ref="diamlr_time" expr="cos( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:MU2"  />
-      <field id="diamlr_r033"  field_ref="diamlr_time" expr="sin( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:NU2"  />
-      <field id="diamlr_r034"  field_ref="diamlr_time" expr="cos( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:NU2"  />
-      <field id="diamlr_r035"  field_ref="diamlr_time" expr="sin( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:L2"   />
-      <field id="diamlr_r036"  field_ref="diamlr_time" expr="cos( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:L2"   />
-      <field id="diamlr_r037"  field_ref="diamlr_time" expr="sin( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:T2"   />
-      <field id="diamlr_r038"  field_ref="diamlr_time" expr="cos( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:T2"   />
-      <field id="diamlr_r101"  field_ref="diamlr_time" expr="diamlr_time^0.0"                         enabled=".TRUE."  comment="mean"              />
-
-      <!-- Fields selected for regression analysis -->
-      <field id="diamlr_f001" field_ref="ssh" enabled=".TRUE." />
+        =====================================================================================================
+        Weight fields for the computation of daily detided model diagnostics (diadetide)
+        =====================================================================================================
+
+    -->
+
+    <field id="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." />
+    <field id="diadetide_weight_grid_T_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_U_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_U_2D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_V_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_V_2D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_T_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_T_3D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_U_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_U_3D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_V_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_V_3D" enabled=".TRUE." > this </field>
+    <field id="diadetide_weight_grid_W_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_W_3D" enabled=".TRUE." > this </field>
+
+  </field_group>
+
+  <!--
+      ============================================================================================================
+      Physical ocean model variables
+      ============================================================================================================
+  -->
+
+  <!-- T grid -->
+
+  <field_group id="grid_T" grid_ref="grid_T_2D" >
+    <field id="e3t"          long_name="T-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_3D" />
+    <field id="e3ts"         long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_SFC"/>
+    <field id="e3t_0"        long_name="Initial T-cell thickness"            standard_name="ref_cell_thickness"    unit="m"   grid_ref="grid_T_3D" />
+    <field id="e3tb"         long_name="bottom T-cell thickness"             standard_name="bottom_cell_thickness" unit="m"   grid_ref="grid_T_2D"/>
+    <field id="e3t_300"      field_ref="e3t"                grid_ref="grid_T_zoom_300"       detect_missing_value="true" />
+    <field id="e3t_vsum300"  field_ref="e3t_300"            grid_ref="grid_T_vsum"   detect_missing_value="true" />
+    <field id="masscello"    long_name="Sea Water Mass per unit area"   standard_name="sea_water_mass_per_unit_area"   unit="kg/m2"   grid_ref="grid_T_3D"/>
+    <field id="volcello"     long_name="Ocean Volume"                   standard_name="ocean_volume"   unit="m3"       grid_ref="grid_T_3D"/>
+    <field id="toce"         long_name="temperature"                         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
+    <field id="toce_e3t"     long_name="temperature (thickness weighted)"                                                      unit="degC"     grid_ref="grid_T_3D" > toce * e3t </field >
+    <field id="soce"         long_name="salinity"                            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/>
+    <field id="soce_e3t"     long_name="salinity    (thickness weighted)"                                                      unit="1e-3"     grid_ref="grid_T_3D" > soce * e3t </field >
+
+    <field id="toce_e3t_300"      field_ref="toce_e3t"          unit="degree_C"     grid_ref="grid_T_zoom_300"      detect_missing_value="true" />
+    <field id="toce_e3t_vsum300"  field_ref="toce_e3t_300"      unit="degress_C*m"  grid_ref="grid_T_vsum"  detect_missing_value="true" />
+    <field id="toce_vmean300"     field_ref="toce_e3t_vsum300"  unit="degree_C"     grid_ref="grid_T_vsum"  detect_missing_value="true" > toce_e3t_vsum300/e3t_vsum300 </field>
+
+    <!-- AGRIF sponge -->
+    <field id="agrif_spt"         long_name=" AGRIF t-sponge coefficient"   unit=" " />
+
+    <!-- additions to diawri.F90 -->
+    <field id="socegrad"    long_name="module of salinity gradient"              unit="psu/m"   grid_ref="grid_T_3D"/>
+    <field id="socegrad2"   long_name="square of module of salinity gradient"    unit="psu2/m2" grid_ref="grid_T_3D"/>
+    <field id="ke"          long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" />
+    <field id="ke_int"      long_name="vertical integration of kinetic energy"   unit="m3/s2"   />
+    <field id="relvor"      long_name="relative vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/>
+    <field id="absvor"      long_name="absolute vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/>
+    <field id="potvor"      long_name="potential vorticity"                      unit="s-1"    grid_ref="grid_T_3D"/>
+    <field id="salt2c"      long_name="Salt content vertically integrated"       unit="1e-3*kg/m2" />
+
+    <!-- t-eddy viscosity coefficients (ldfdyn) -->
+    <field id="ahmt_2d"      long_name=" surface t-eddy viscosity coefficient"   unit="m2/s or m4/s"                      />
+    <field id="ahmt_3d"      long_name=" 3D      t-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/>
+
+    <field id="sst"          long_name="Bulk sea surface temperature"                       standard_name="bulk_sea_surface_temperature"        unit="degC"     />
+    <field id="t_skin"       long_name="Skin temperature aka SSST"                          standard_name="skin_temperature"                    unit="degC"     />
+    <field id="sst2"         long_name="square of sea surface temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field >
+    <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                                 />
+    <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                                 />
+    <field id="sstgrad"      long_name="module of sst gradient"                                                                                 unit="degC/m"   />
+    <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" />
+    <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     />
+    <field id="tosmint"      long_name="vertical integral of temperature times density"     standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" />
+    <field id="sst_wl"       long_name="Delta SST of warm layer"                                                                                unit="degC"     />
+    <field id="sst_cs"       long_name="Delta SST of cool skin"                                                                                 unit="degC"     />
+    <field id="temp_3m"      long_name="temperature at 3m"                                                                                      unit="degC"     />
+
+    <field id="sss"          long_name="sea surface salinity"                               standard_name="sea_surface_salinity"                unit="1e-3"     />
+    <field id="sss2"         long_name="square of sea surface salinity"                                                                         unit="1e-6"      > sss * sss </field >
+    <field id="sssmax"       long_name="max of sea surface salinity"      field_ref="sss"   operation="maximum"                                                 />
+    <field id="sssmin"       long_name="min of sea surface salinity"      field_ref="sss"   operation="minimum"                                                 />
+    <field id="sbs"          long_name="sea bottom salinity"                                                                                    unit="0.001"    />
+    <field id="somint"       long_name="vertical integral of salinity times density"        standard_name="integral_wrt_depth_of_product_of_density_and_salinity"  unit="(kg m2) x (1e-3)" />
+
+    <field id="taubot"       long_name="bottom stress module"                                                                                   unit="N/m2"     />
+
+    <!-- Case EOS = TEOS-10 : output potential temperature -->
+    <field id="toce_pot"     long_name="Sea Water Potential Temperature"              standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
+    <field id="sst_pot"      long_name="potential sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     />
+    <field id="tosmint_pot"  long_name="vertical integral of potential temperature times density"   standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" />
+
+    <field id="ht"           long_name="water column height at T point"                     standard_name="water_column_height_T"                      unit="m" />
+    <field id="ssh"          long_name="sea surface height"                                 standard_name="sea_surface_height_above_geoid"             unit="m" />
+    <field id="ssh2"         long_name="square of sea surface height"                       standard_name="square_of_sea_surface_height_above_geoid"   unit="m2" > ssh * ssh </field >
+    <field id="wetdep"       long_name="wet depth"                                          standard_name="wet_depth"                                  unit="m" />
+    <field id="sshmax"       long_name="max of sea surface height"        field_ref="ssh"   operation="maximum"                                                 />
+
+    <field id="mldkz5"       long_name="Turbocline depth (Kz = 5e-4)"                       standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"                unit="m"          />
+    <field id="mldr10_1"     long_name="Mixed Layer Depth (dsigma = 0.01 wrt 10m)"          standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"          />
+    <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          />
+    <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          />
+    <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       />
+    <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" />
+
+    <!-- EOS -->
+    <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" />
+    <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" />
+    <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" />
+
+    <!-- Energy - horizontal divergence -->
+    <field id="sKE"          long_name="surface kinetic energy"  standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_2D" />
+    <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" />
+
+    <!-- variables available with MLE -->
+    <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" />
+
+    <!-- next variables available with ln_zad_Aimp=.true. -->
+    <field id="Courant"      long_name="Courant number"                                                                 unit="#"   grid_ref="grid_T_3D" />
+    <field id="wimp"         long_name="Implicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" />
+    <field id="wexp"         long_name="Explicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" />
+    <field id="wi_cff"       long_name="Fraction of implicit vertical velocity"                                         unit="#"   grid_ref="grid_T_3D" />
+
+    <!-- next variables available with key_diahth -->
+    <field id="mlddzt"       long_name="Thermocline Depth (depth of max dT/dz)"         standard_name="depth_at_maximum_upward_derivative_of_sea_water_potential_temperature"             unit="m"                         />
+    <field id="mldr10_3"     long_name="Mixed Layer Depth (dsigma = 0.03 wrt 10m)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+    <field id="mldr0_1"      long_name="Mixed Layer Depth (dsigma = 0.01 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+    <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+    <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
+    <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
+    <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+    <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"   > topthdep - pycndep </field>
+    <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      />
+    <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         />
+    <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_20C" />
+    <field id="26d"          long_name="Depth of 26C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_26C"   />
+    <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_28C" />
+    <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
+    <field id="hc700"        long_name="Heat content 0-700m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
+    <field id="hc2000"       long_name="Heat content 0-2000m"                           standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
+
+    <!-- variables available with diaar5 -->
+    <field id="botpres"      long_name="Sea Water Pressure at Sea Floor"          standard_name="sea_water_pressure_at_sea_floor"                    unit="dbar" />
+    <field id="sshdyn"       long_name="dynamic sea surface height"               standard_name="dynamic_sea_surface_height_above_geoid"             unit="m"    />
+    <field id="sshdyn2"      long_name="square of dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid_squared"     unit="m2"    > sshdyn * sshdyn </field>
+    <field id="tnpeo"      long_name="Tendency of ocean potential energy content"                                                                    unit="W/m2" />
+
+    <!-- variables available ln_linssh=.FALSE. -->
+    <field id="tpt_dep"      long_name="T-point depth"                  standard_name="depth_below_geoid"   unit="m"   grid_ref="grid_T_3D" />
+    <field id="e3tdef"       long_name="T-cell thickness deformation"                                       unit="%"   grid_ref="grid_T_3D" />
+
+    <!-- variables available with ln_diacfl=.true. -->
+    <field id="cfl_cu"       long_name="u-courant number"   unit="#" />
+    <field id="cfl_cv"       long_name="v-courant number"   unit="#" />
+    <field id="cfl_cw"       long_name="w-courant number"   unit="#" />
+
+    <!-- variables available with ln_zdfmfc=.true. -->
+    <field id="mf_Tp"       long_name="plume_temperature"      standard_name="plume_temperature"     unit="degC"   grid_ref="grid_T_3D" />
+    <field id="mf_Sp"       long_name="plume_salinity"         standard_name="plume_salinity"        unit="1e-3"   grid_ref="grid_T_3D" />
+    <field id="mf_mf"       long_name="mass flux"              standard_name="mf_mass_flux"          unit="m"      grid_ref="grid_T_3D" />
+
+  </field_group> <!-- grid_T -->
+
+  <!-- Tides -->
+
+  <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" >
+    <!-- Tidal potential -->
+    <field id="tide_pot"      long_name="Total tidal potential" unit="m" />
+    <field id="tide_pot_M2"   long_name="M2 tidal potential"    unit="m" />
+    <field id="tide_pot_N2"   long_name="N2 tidal potential"    unit="m" />
+    <field id="tide_pot_2N2"  long_name="2N2 tidal potential"   unit="m" />
+    <field id="tide_pot_S2"   long_name="S2 tidal potential"    unit="m" />
+    <field id="tide_pot_K2"   long_name="K2 tidal potential"    unit="m" />
+    <field id="tide_pot_K1"   long_name="K1 tidal potential"    unit="m" />
+    <field id="tide_pot_O1"   long_name="O1 tidal potential"    unit="m" />
+    <field id="tide_pot_Q1"   long_name="Q1 tidal potential"    unit="m" />
+    <field id="tide_pot_P1"   long_name="P1 tidal potential"    unit="m" />
+    <field id="tide_pot_M4"   long_name="M4 tidal potential"    unit="m" />
+    <field id="tide_pot_Mf"   long_name="Mf tidal potential"    unit="m" />
+    <field id="tide_pot_Mm"   long_name="Mm tidal potential"    unit="m" />
+    <field id="tide_pot_Msqm" long_name="Msqm tidal potential"  unit="m" />
+    <field id="tide_pot_Mtm"  long_name="Mtm tidal potential"   unit="m" />
+    <field id="tide_pot_S1"   long_name="S1 tidal potential"    unit="m" />
+    <field id="tide_pot_MU2"  long_name="MU2 tidal potential"   unit="m" />
+    <field id="tide_pot_NU2"  long_name="NU2 tidal potential"   unit="m" />
+    <field id="tide_pot_L2"   long_name="L2 tidal potential"    unit="m" />
+    <field id="tide_pot_T2"   long_name="T2 tidal potential"    unit="m" />
+  </field_group>
+
+  <!-- OSMOSIS variables (available with ln_zdfosm=.true.) -->
+
+  <field_group id="OSMOSIS_T" grid_ref="grid_T_2D">
+    <field id="hml"                 long_name="mixed layr depth"                         unit="m"       />
+    <field id="hbl"                 long_name="boundary layer depth"                     unit="m"       />
+    <field id="dh"                  long_name="Pycnocline thickness"                     unit=" m"      />
+    <field id="ibld"                long_name="index of boundary layer depth"            unit="#"       />
+    <field id="imld"                long_name="index of mixed layer depth"            unit="#"       />
+    <field id="zhbl"                long_name="boundary layer depth -grid"                     unit="m"       />
+    <field id="zhml"                long_name="mixed layer depth - grid"                        unit="m"       />
+    <field id="zdh"                 long_name="Pycnocline  depth - grid"                 unit=" m"      />
+    <field id="zustke"              long_name="magnitude of stokes drift  at T-points"   unit="m/s"     />
+    <field id="us_x"        long_name="i component of active Stokes drift"                      unit="m/s"     />
+    <field id="us_y"        long_name="j component of active Stokes drift"                      unit="m/s"     />
+    <field id="dstokes"             long_name="stokes drift  depth scale"                unit="m"       />
+    <field id="zwth0"               long_name="surface non-local temperature flux"       unit="deg m/s" />
+    <field id="zws0"                long_name="surface non-local salinity flux"          unit="psu m/s" />
+    <field id="zwstrc"              long_name="convective velocity scale"                unit="m/s"     />
+    <field id="zustar"              long_name="friction velocity"                        unit="m/s"     />
+    <field id="zwstrl"              long_name="langmuir velocity scale"                  unit="m/s"     />
+    <field id="zvstr"               long_name="mixed velocity scale"                     unit="m/s"     />
+    <field id="zla"                 long_name="langmuir number"                          unit="m/s"     />
+    <field id="wind_wave_abs_power" long_name="\rho |U_s| x u*^2"                        unit="mW"      />
+    <field id="wind_wave_power"     long_name="U_s \dot  tau"                            unit="mW"      />
+    <field id="wind_power"          long_name="\rho  u*^3"                               unit="mW"      />
+
+    <!-- interior BL OSMOSIS diagnostics -->
+    <field id="zwthav"              long_name="av turb flux of T in ml"                  unit="deg m/s" />
+    <field id="zt_ml"               long_name="av T in ml"                               unit="deg"     />
+    <field id="zhol"                long_name="Hoenekker number"                         unit="#"       />
+    <field id="zws_ent"            long_name="entrainment turb flux of S"                unit="10^-3 m/s" />
+    <field id="zwth_ent"            long_name="entrainment turb flux of T"               unit="deg m/s" />
+    <field id="zwb_ent"            long_name="entrainment turb flux of buoyancy"         unit="m^2/s^-3" />
+
+    <field id="zdt_bl"             long_name="temperature jump at base of BL"                 unit="deg"      />
+    <field id="zds_bl"             long_name="salinity jump at base of BL"                 unit="10^-3"      />
+    <field id="zdb_bl"             long_name="buoyancy jump at base of BL"                 unit="m/s^2"      />
+    <field id="zdu_bl"             long_name="u jump at base of BL"                       unit="m/s"      />
+    <field id="zdv_bl"             long_name="v jump at base of BL"                       unit="m/s"      />
+
+    <!-- extra OSMOSIS diagnostics for debugging -->
+    <field id="zsc_uw_1_0"       long_name="zsc u-momentum flux on T after Stokes"                       unit="m^2/s^2" />
+    <field id="zsc_uw_1_f"       long_name="zsc u-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
+    <field id="zsc_vw_1_f"       long_name="zsc v-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
+    <field id="zsc_uw_2_f"       long_name="2nd zsc u-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
+    <field id="zsc_vw_2_f"       long_name="2nd zsc v-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
+    <field id="zuw_bse"       long_name="base u-flux T-points"                          unit="m^2/s^2" />
+    <field id="zvw_bse"       long_name="base v-flux T-points"                          unit="m^2/s^2" />
+
+    <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
+    <field id="hmle"          long_name="OBL FK-layer thickness"                                     unit="m"        />
+    <field id="mld_prof"              long_name="FK-layer depth index"                  unit="#" />
+    <field id="zmld"          long_name="target FK-layer thickness"                                     unit="m"        />
+    <field id="zwb_fk"          long_name="FK b-flux"                                     unit="m^2 s^-3"        />
+    <field id="zwb_fk_b"          long_name="layer averaged FK b-flux"                 unit="m^2 s^-3"       />
+    <field id="zdiff_mle"          long_name="max FK diffusivity in MLE"       unit=" 10^-4 m^2 s^-1"       />
+    <field id="zvel_mle"          long_name="FK velocity scale in MLE"       unit=" m s^-1"       />
+  </field_group>
+
+  <field_group id="OSMOSIS_W" grid_ref="grid_W_3D" >
+    <field id="zviscos"       long_name="BL viscosity"   unit="m^2/s" />
+    <field id="ghamt"       long_name="non-local temperature flux"                       unit="deg m/s" />
+    <field id="ghams"       long_name="non-local salinity flux"                          unit="psu m/s" />
+    <field id="zdtdz_pyc"   long_name="Pycnocline temperature gradient"                  unit=" deg/m"  />
+    <field id="zdsdz_pyc"   long_name="Pycnocline salinity gradient"                  unit=" 10^-3/m"  />
+    <field id="zdbdz_pyc"   long_name="Pycnocline buoyancy gradient"                  unit=" s^-2"  />
+    <field id="zdudz_pyc"   long_name="Pycnocline u gradient"                  unit=" s^-2"  />
+    <field id="zdvdz_pyc"   long_name="Pycnocline v gradient"                  unit=" s^-2"  />
+
+    <!-- extra OSMOSIS diagnostics for debugging -->
+    <field id="ghamu_00"       long_name="initial non-local u-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamv_00"       long_name="initial non-local v-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamu_0"       long_name="after dstokes non-local u-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamu_f"       long_name="after Coriolis non-local u-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamv_f"       long_name="after Coriolis  non-local v-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamu_b"       long_name="after buoyancy added non-local u-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamv_b"       long_name="after buoyancy added  non-local v-momentum flux"  unit="m^2/s^2" />
+    <field id="ghamu_1"       long_name="after entrainment non-local u-momentum flux"   unit="m^2/s^2" />
+    <field id="ghamv_1"       long_name="after entrainment  non-local v-momentum flux"  unit="m^2/s^2" />
+  </field_group>
+
+  <field_group id="OSMOSIS_U" grid_ref="grid_U_2D" >
+    <field id="ghamu"       long_name="non-local u-momentum flux"   grid_ref="grid_U_3D" unit="m^2/s^2" />
+    <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
+    <field id="zdtdx"          long_name="FK  T x-gradient"                                     unit=" deg C m^-1"        />
+    <field id="zdsdx"          long_name="FK  S x-gradient"                                     unit=" 10^-3 m^-1"        />
+    <field id="dbdx_mle"          long_name="FK  B x-gradient"                                     unit=" s^-2"        />
+  </field_group>
+
+  <field_group id="OSMOSIS_V" grid_ref="grid_V_2D" >
+    <field id="ghamv"       long_name="non-local v-momentum flux"   grid_ref="grid_V_3D" unit="m^2/s^2" />
+    <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
+    <field id="zdtdy"          long_name="FK T y-gradient"                                     unit=" deg C m^-1"        />
+    <field id="zdsdy"          long_name="FK S y-gradient"                                     unit=" 10^-3 m^-1"        />
+    <field id="dbdy_mle"          long_name="FK B y-gradient"                                     unit=" s^-2"        />
+  </field_group>
+
+  <!-- SBC -->
+  <field_group id="SBC" > <!-- time step automaticaly defined based on nn_fsbc -->
+
+    <field_group id="SBC_2D" grid_ref="grid_T_2D" >
+
+      <field id="empmr"        long_name="Net Upward Water Flux"                standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
+      <field id="empbmr"       long_name="Net Upward Water Flux at pre. tstep"  standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
+      <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   />
+      <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   />
+      <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" />
+      <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   />
+      <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   />
+      <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   />
+      <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   />
+      <field id="wclosea"      long_name="closed sea empmr correction"          standard_name="closea_empmr"                                                         unit="kg/m2/s"   />
+
+      <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           />
+      <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           />
+      <field id="qsr"          long_name="Shortwave Radiation"                   standard_name="net_downward_shortwave_flux_at_sea_water_surface"                     unit="W/m2"                           />
+      <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" />
+      <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           />
+      <field id="qclosea"      long_name="closed sea heat content flux"          standard_name="closea_heat_content_downward_flux"                                    unit="W/m2"     />
+      <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        />
+      <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           />
+      <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            />
+
+      <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn -->
+      <field id="ssh_ib"       long_name="Inverse barometer sea surface height"  standard_name="sea_surface_height_correction_due_to_air_pressure_at_low_frequency"   unit="m"        />
+
+      <!-- * variable related to ice shelf forcing * -->
+      <field id="isftfrz_cav"     long_name="freezing point temperature at ocean/isf interface"                unit="degC"     />
+      <field id="isftfrz_par"     long_name="freezing point temperature in the parametrization boundary layer" unit="degC"     />
+      <field id="fwfisf_cav"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
+      <field id="fwfisf_par"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
+      <field id="qoceisf_cav"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
+      <field id="qoceisf_par"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
+      <field id="qlatisf_cav"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
+      <field id="qlatisf_par"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
+      <field id="qhcisf_cav"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
+      <field id="qhcisf_par"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
+      <field id="fwfisf3d_cav"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
+      <field id="fwfisf3d_par"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
+      <field id="qoceisf3d_cav"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="qoceisf3d_par"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="qlatisf3d_cav"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="qlatisf3d_par"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="qhcisf3d_cav"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
+      <field id="ttbl_cav"        long_name="temperature in Losch tbl"                      unit="degC"     />
+      <field id="ttbl_par"        long_name="temperature in the parametrisation boundary layer" unit="degC" />
+      <field id="isfthermald_cav" long_name="thermal driving of ice shelf melting"          unit="degC"     />
+      <field id="isfthermald_par" long_name="thermal driving of ice shelf melting"          unit="degC"     />
+      <field id="isfgammat"       long_name="Ice shelf heat-transfert velocity"             unit="m/s"      />
+      <field id="isfgammas"       long_name="Ice shelf salt-transfert velocity"             unit="m/s"      />
+      <field id="stbl"            long_name="salinity in the Losh tbl"                      unit="1e-3"     />
+      <field id="utbl"            long_name="zonal current in the Losh tbl at T point"      unit="m/s"      />
+      <field id="vtbl"            long_name="merid current in the Losh tbl at T point"      unit="m/s"      />
+      <field id="isfustar"        long_name="ustar at T point used in ice shelf melting"    unit="m/s"      />
+      <field id="qconisf"         long_name="Conductive heat flux through the ice shelf"    unit="W/m2"     />
+
+      <!-- *_oce variables available with ln_blk_clio or ln_blk_core -->
+      <field id="rho_air"      long_name="Air density at 10m above sea surface"         standard_name="rho_air_10m"                                        unit="kg/m3" />
+      <field id="dt_skin"      long_name="SSST-SST temperature difference"              standard_name="SSST-SST"                                             unit="K"   />
+      <field id="qlw_oce"      long_name="Longwave Downward Heat Flux over open ocean"  standard_name="surface_net_downward_longwave_flux"                 unit="W/m2"  />
+      <field id="qsb_oce"      long_name="Sensible Downward Heat Flux over open ocean"  standard_name="surface_downward_sensible_heat_flux"                unit="W/m2"  />
+      <field id="qla_oce"      long_name="Latent Downward Heat Flux over open ocean"    standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"  />
+      <field id="evap_oce"     long_name="Evaporation over open ocean"                  standard_name="evaporation"                                        unit="kg/m2/s" />
+      <field id="qt_oce"       long_name="total flux at ocean surface"                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"  />
+      <field id="qsr_oce"      long_name="solar heat flux at ocean surface"             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"  />
+      <field id="qns_oce"      long_name="non-solar heat flux at ocean surface (including E-P)"                                                            unit="W/m2"  />
+      <field id="qemp_oce"     long_name="Downward Heat Flux from E-P over open ocean"                                                                     unit="W/m2"  />
+      <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress"               unit="N/m2"  />
+      <field id="utau_oce"     long_name="Wind Stress along i-axis over open ocean (T-points)"  standard_name="surf_down_x_stress_open_oce_Tpoints"        unit="N/m2"   />
+      <field id="vtau_oce"     long_name="Wind Stress along j-axis over open ocean (T-points)"  standard_name="surf_down_y_stress_open_oce_Tpoints"        unit="N/m2"    />
+
+      <!-- variables computed by the bulk parameterization algorithms (ln_blk) -->
+      <field id="Cd_oce"      long_name="Drag coefficient over open ocean"              standard_name="drag_coefficient_water"                unit=""  />
+      <field id="Ce_oce"      long_name="Evaporaion coefficient over open ocean"        standard_name="evap_coefficient_water"                unit=""  />
+      <field id="Ch_oce"      long_name="Sensible heat coefficient over open ocean"     standard_name="sensible_heat_coefficient_water"       unit=""  />
+      <field id="theta_zt"    long_name="Potential air temperature at z=zt"             standard_name="potential_air_temperature_at_zt"       unit="degC" />
+      <field id="q_zt"        long_name="Specific air humidity at z=zt"                 standard_name="specific_air_humidity_at_zt"           unit="kg/kg" />
+      <field id="theta_zu"    long_name="Potential air temperature at z=zu"             standard_name="potential_air_temperature_at_zu"       unit="degC" />
+      <field id="q_zu"        long_name="Specific air humidity at z=zu"                 standard_name="specific_air_humidity_at_zu"           unit="kg/kg" />
+      <field id="ssq"         long_name="Saturation specific humidity of air at z=0"    standard_name="surface_air_saturation_spec_humidity"  unit="kg/kg" />
+      <field id="wspd_blk"    long_name="Bulk wind speed at z=zu"                       standard_name="bulk_wind_speed_at_zu"                 unit="m/s"   />
+      <!-- ln_blk + key_si3 -->
+      <field id="Cd_ice"      long_name="Drag coefficient over ice"                     standard_name="drag_coefficient_ice"                 unit=""  />
+      <field id="Ce_ice"      long_name="Evaporaion coefficient over ice"               standard_name="evap_coefficient_ice"                 unit=""  />
+      <field id="Ch_ice"      long_name="Sensible heat coefficient over ice"            standard_name="sensible_heat_coefficient_ice"        unit=""  />
+
+      <!-- available key_oasis3 -->
+      <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  />
+      <field id="snow_ai_cea"  long_name="Snow over sea-ice (cell average)"          standard_name="snowfall_flux"                             unit="kg/m2/s"  />
+      <field id="subl_ai_cea"  long_name="Sublimation over sea-ice (cell average)"   standard_name="surface_snow_and_ice_sublimation_flux"     unit="kg/m2/s"  />
+      <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        />
+      <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  />
+      <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  />
+      <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  />
+
+
+      <!-- available if key_oasis3 + conservative method -->
+      <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  />
+      <field id="rain_ao_cea"   long_name="Liquid precipitation over ice-free ocean (cell average)"  standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  />
+      <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  />
+      <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
+      <field id="fsal_virt_cea" long_name="Virtual salt flux due to ice formation (cell average)"    standard_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics"                unit="kg/m2/s"  />
+      <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  />
+      <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     />
+      <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     />
+      <field id="hflx_prec_cea" long_name="heat flux due to all precip"                              standard_name="temperature_flux_due_to_all_precip_expressed_as_heat_flux_into_sea_water"      unit="W/m2"     />
+      <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     />
+      <field id="hflx_snow_ai_cea" long_name="heat flux due to snow falling over ice"                standard_name="heat_flux_onto_ice_due_to_snow_thermodynamics"                                 unit="W/m2"     />
+      <field id="hflx_snow_ao_cea" long_name="heat flux due to snow falling over ice-free ocean"     standard_name="heat_flux_onto_sea_water_due_to_snow_thermodynamics"                           unit="W/m2"     />
+      <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     />
+      <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     />
+      <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_calving"                                       unit="W/m2"     />
+      <field id="hflx_icb_cea"  long_name="heat flux due to iceberg"                                 standard_name="heat_flux_into_sea_water_due_to_icebergs"                                      unit="W/m2"     />
+      <field id="hflx_isf_cea"  long_name="heat flux due to iceshelf"                                standard_name="heat_flux_into_sea_water_due_to_iceshelf"                                      unit="W/m2"     />
+      <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  />
+      <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  />
+      <field id="snowmel_cea"   long_name="Snow Melt Rate (cell average)"                            standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
+      <field id="sntoice_cea"   long_name="Snow-Ice Formation Rate (cell average)"                   standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                             unit="kg/m2/s"  />
+      <field id="ticemel_cea"   long_name="Rate of Melt at Upper Surface of Sea Ice (cell average)"  standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                             unit="kg/m2/s"  />
+
+      <!-- ice field (nn_ice=1)  -->
+      <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            />
+
+      <!-- dilution -->
+      <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" />
+      <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />
+      <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" />
+      <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" />
+
+      <!-- sbcssm variables -->
+      <field id="sst_m"    unit="degC" />
+      <field id="sss_m"    unit="psu"  />
+      <field id="ssu_m"    unit="m/s"  />
+      <field id="ssv_m"    unit="m/s"  />
+      <field id="ssh_m"    unit="m"    />
+      <field id="e3t_m"    unit="m"    />
+      <field id="frq_m"    unit="-"    />
 
     </field_group>
 
-    <!--
-============================================================================================================
-=                                  definition of all existing variables                                    =
-=                                            DO NOT CHANGE                                                 =
-============================================================================================================
-    -->
-
-    <field_group id="diadetide_fields">
-
-    <!--
-       =====================================================================================================
-                 Weight fields for the computation of daily detided model diagnostics (diadetide)
-       =====================================================================================================
-
-       -->
-
-      <field id="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." />
-      <field id="diadetide_weight_grid_T_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_U_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_U_2D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_V_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_V_2D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_T_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_T_3D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_U_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_U_3D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_V_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_V_3D" enabled=".TRUE." > this </field>
-      <field id="diadetide_weight_grid_W_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_W_3D" enabled=".TRUE." > this </field>
-
+
+  </field_group> <!-- SBC -->
+
+  <!-- ABL -->
+  <field_group id="ABL" > <!-- time step automaticaly defined based on nn_fsbc -->
+
+    <!-- variables available with ABL on atmospheric T grid-->
+    <field_group id="grid_ABL3D" grid_ref="grid_TA_3D" >
+      <field id="u_abl"      long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      />
+      <field id="v_abl"      long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      />
+      <field id="t_abl"      long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        />
+      <field id="q_abl"      long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    />
+      <!-- debug (to be removed) -->
+      <field id="u_dta"      long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      />
+      <field id="v_dta"      long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      />
+      <field id="t_dta"      long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        />
+      <field id="q_dta"      long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    />
+      <field id="u_geo"      long_name="GEO i-horizontal velocity"     standard_name="geo_x_velocity" unit="m/s"      />
+      <field id="v_geo"      long_name="GEO j-horizontal velocity"     standard_name="geo_y_velocity" unit="m/s"      />
+      <field id="tke_abl"    long_name="ABL turbulent kinetic energy"  standard_name="abl_tke"        unit="m2/s2"    />
+      <field id="avm_abl"    long_name="ABL turbulent viscosity"       standard_name="abl_avm"        unit="m2/s"     />
+      <field id="avt_abl"    long_name="ABL turbulent diffusivity"     standard_name="abl_avt"        unit="m2/s"     />
+      <field id="mxlm_abl"   long_name="ABL master mixing length"      standard_name="abl_mxlm"       unit="m"        />
+      <field id="mxld_abl"   long_name="ABL dissipative mixing length" standard_name="abl_mxld"       unit="m"        />
     </field_group>
 
-    <!--
-============================================================================================================
-                                  Physical ocean model variables
-============================================================================================================
-    -->
-
-      <!-- T grid -->
-
-      <field_group id="grid_T" grid_ref="grid_T_2D" >
-        <field id="e3t"          long_name="T-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_3D" />
-        <field id="e3ts"         long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_SFC"/>
-        <field id="e3t_0"        long_name="Initial T-cell thickness"            standard_name="ref_cell_thickness"    unit="m"   grid_ref="grid_T_3D" />
-        <field id="e3tb"         long_name="bottom T-cell thickness"             standard_name="bottom_cell_thickness" unit="m"   grid_ref="grid_T_2D"/>
-        <field id="e3t_300"      field_ref="e3t"                grid_ref="grid_T_zoom_300"       detect_missing_value="true" />
-        <field id="e3t_vsum300"  field_ref="e3t_300"            grid_ref="grid_T_vsum"   detect_missing_value="true" />
-	<field id="masscello"    long_name="Sea Water Mass per unit area"   standard_name="sea_water_mass_per_unit_area"   unit="kg/m2"   grid_ref="grid_T_3D"/>
-        <field id="volcello"     long_name="Ocean Volume"                   standard_name="ocean_volume"   unit="m3"       grid_ref="grid_T_3D"/>
-        <field id="toce"         long_name="temperature"                         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
-        <field id="toce_e3t"     long_name="temperature (thickness weighted)"                                                      unit="degC"     grid_ref="grid_T_3D" > toce * e3t </field >
-        <field id="soce"         long_name="salinity"                            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/>
-        <field id="soce_e3t"     long_name="salinity    (thickness weighted)"                                                      unit="1e-3"     grid_ref="grid_T_3D" > soce * e3t </field >
-
-        <field id="toce_e3t_300"      field_ref="toce_e3t"          unit="degree_C"     grid_ref="grid_T_zoom_300"      detect_missing_value="true" />
-        <field id="toce_e3t_vsum300"  field_ref="toce_e3t_300"      unit="degress_C*m"  grid_ref="grid_T_vsum"  detect_missing_value="true" />
-        <field id="toce_vmean300"     field_ref="toce_e3t_vsum300"  unit="degree_C"     grid_ref="grid_T_vsum"  detect_missing_value="true" > toce_e3t_vsum300/e3t_vsum300 </field>
-
-        <!-- AGRIF sponge -->
-        <field id="agrif_spt"         long_name=" AGRIF t-sponge coefficient"   unit=" " />
-	
-	<!-- additions to diawri.F90 -->
-        <field id="socegrad"    long_name="module of salinity gradient"              unit="psu/m"   grid_ref="grid_T_3D"/>
-        <field id="socegrad2"   long_name="square of module of salinity gradient"    unit="psu2/m2" grid_ref="grid_T_3D"/>
-        <field id="ke"          long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" />
-        <field id="ke_int"      long_name="vertical integration of kinetic energy"   unit="m3/s2"   />
-        <field id="relvor"      long_name="relative vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/>
-        <field id="absvor"      long_name="absolute vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/>
-        <field id="potvor"      long_name="potential vorticity"                      unit="s-1"    grid_ref="grid_T_3D"/>
-        <field id="salt2c"      long_name="Salt content vertically integrated"       unit="1e-3*kg/m2" />
-
-        <!-- t-eddy viscosity coefficients (ldfdyn) -->
-	<field id="ahmt_2d"      long_name=" surface t-eddy viscosity coefficient"   unit="m2/s or m4/s"                      />
-	<field id="ahmt_3d"      long_name=" 3D      t-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/>
-
-        <field id="sst"          long_name="Bulk sea surface temperature"                       standard_name="bulk_sea_surface_temperature"        unit="degC"     />
-        <field id="t_skin"       long_name="Skin temperature aka SSST"                          standard_name="skin_temperature"                    unit="degC"     />
-        <field id="sst2"         long_name="square of sea surface temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field >
-        <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                                 />
-        <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                                 />
-        <field id="sstgrad"      long_name="module of sst gradient"                                                                                 unit="degC/m"   />
-        <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" />
-        <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     />
-        <field id="tosmint"      long_name="vertical integral of temperature times density"     standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" />
-        <field id="sst_wl"       long_name="Delta SST of warm layer"                                                                                unit="degC"     />
-        <field id="sst_cs"       long_name="Delta SST of cool skin"                                                                                 unit="degC"     />
-	<field id="temp_3m"      long_name="temperature at 3m"                                                                                      unit="degC"     />
-
-        <field id="sss"          long_name="sea surface salinity"                               standard_name="sea_surface_salinity"                unit="1e-3"     />
-        <field id="sss2"         long_name="square of sea surface salinity"                                                                         unit="1e-6"      > sss * sss </field >
-        <field id="sssmax"       long_name="max of sea surface salinity"      field_ref="sss"   operation="maximum"                                                 />
-        <field id="sssmin"       long_name="min of sea surface salinity"      field_ref="sss"   operation="minimum"                                                 />
-        <field id="sbs"          long_name="sea bottom salinity"                                                                                    unit="0.001"    />
-        <field id="somint"       long_name="vertical integral of salinity times density"        standard_name="integral_wrt_depth_of_product_of_density_and_salinity"  unit="(kg m2) x (1e-3)" />
-
-        <field id="taubot"       long_name="bottom stress module"                                                                                   unit="N/m2"     />
-
-         <!-- Case EOS = TEOS-10 : output potential temperature -->
-	<field id="toce_pot"     long_name="Sea Water Potential Temperature"              standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
-        <field id="sst_pot"      long_name="potential sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     />
-        <field id="tosmint_pot"  long_name="vertical integral of potential temperature times density"   standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" />
-
-        <field id="ht"           long_name="water column height at T point"                     standard_name="water_column_height_T"                      unit="m" />
-        <field id="ssh"          long_name="sea surface height"                                 standard_name="sea_surface_height_above_geoid"             unit="m" />
-        <field id="ssh2"         long_name="square of sea surface height"                       standard_name="square_of_sea_surface_height_above_geoid"   unit="m2" > ssh * ssh </field >
-        <field id="wetdep"       long_name="wet depth"                                          standard_name="wet_depth"                                  unit="m" />
-        <field id="sshmax"       long_name="max of sea surface height"        field_ref="ssh"   operation="maximum"                                                 />
-
-        <field id="mldkz5"       long_name="Turbocline depth (Kz = 5e-4)"                       standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"                unit="m"          />
-        <field id="mldr10_1"     long_name="Mixed Layer Depth (dsigma = 0.01 wrt 10m)"          standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"          />
-        <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          />
-        <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          />
-        <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       />
-        <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" />
-
-        <!-- EOS -->
-        <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" />
-        <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" />
-        <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" />
-
-        <!-- Energy - horizontal divergence -->
-        <field id="sKE"          long_name="surface kinetic energy"  standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_2D" />
-        <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" />
-
-        <!-- variables available with MLE -->
-        <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" />
-
-        <!-- next variables available with ln_zad_Aimp=.true. -->
-        <field id="Courant"      long_name="Courant number"                                                                 unit="#"   grid_ref="grid_T_3D" />
-        <field id="wimp"         long_name="Implicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" />
-        <field id="wexp"         long_name="Explicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" />
-        <field id="wi_cff"       long_name="Fraction of implicit vertical velocity"                                         unit="#"   grid_ref="grid_T_3D" />
-
-        <!-- next variables available with key_diahth -->
-        <field id="mlddzt"       long_name="Thermocline Depth (depth of max dT/dz)"         standard_name="depth_at_maximum_upward_derivative_of_sea_water_potential_temperature"             unit="m"                         />
-        <field id="mldr10_3"     long_name="Mixed Layer Depth (dsigma = 0.03 wrt 10m)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
-        <field id="mldr0_1"      long_name="Mixed Layer Depth (dsigma = 0.01 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
-        <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
-        <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
-        <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
-        <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
-        <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"   > topthdep - pycndep </field>
-        <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      />
-        <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         />
-	<field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_20C" />
-        <field id="26d"          long_name="Depth of 26C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_26C"   />
-        <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_28C" />
-        <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
-        <field id="hc700"        long_name="Heat content 0-700m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
-        <field id="hc2000"       long_name="Heat content 0-2000m"                           standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
-
-        <!-- variables available with diaar5 -->
-        <field id="botpres"      long_name="Sea Water Pressure at Sea Floor"          standard_name="sea_water_pressure_at_sea_floor"                    unit="dbar" />
-        <field id="sshdyn"       long_name="dynamic sea surface height"               standard_name="dynamic_sea_surface_height_above_geoid"             unit="m"    />
-        <field id="sshdyn2"      long_name="square of dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid_squared"     unit="m2"    > sshdyn * sshdyn </field>
-        <field id="tnpeo"      long_name="Tendency of ocean potential energy content"                                                                    unit="W/m2" />
-
-        <!-- variables available ln_linssh=.FALSE. -->
-        <field id="tpt_dep"      long_name="T-point depth"                  standard_name="depth_below_geoid"   unit="m"   grid_ref="grid_T_3D" />
-        <field id="e3tdef"       long_name="T-cell thickness deformation"                                       unit="%"   grid_ref="grid_T_3D" />
-
-        <!-- variables available with ln_diacfl=.true. -->
-        <field id="cfl_cu"       long_name="u-courant number"   unit="#" />
-        <field id="cfl_cv"       long_name="v-courant number"   unit="#" />
-        <field id="cfl_cw"       long_name="w-courant number"   unit="#" />
-
-        <!-- variables available with ln_zdfmfc=.true. -->
-         <field id="mf_Tp"       long_name="plume_temperature"      standard_name="plume_temperature"     unit="degC"   grid_ref="grid_T_3D" />
-         <field id="mf_Sp"       long_name="plume_salinity"         standard_name="plume_salinity"        unit="1e-3"   grid_ref="grid_T_3D" />
-         <field id="mf_mf"       long_name="mass flux"              standard_name="mf_mass_flux"          unit="m"      grid_ref="grid_T_3D" />
-
-      </field_group> <!-- grid_T -->
-
-      <!-- Tides -->
-
-      <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" >
-        <!-- Tidal potential -->
-        <field id="tide_pot"      long_name="Total tidal potential" unit="m" />
-        <field id="tide_pot_M2"   long_name="M2 tidal potential"    unit="m" />
-        <field id="tide_pot_N2"   long_name="N2 tidal potential"    unit="m" />
-        <field id="tide_pot_2N2"  long_name="2N2 tidal potential"   unit="m" />
-        <field id="tide_pot_S2"   long_name="S2 tidal potential"    unit="m" />
-        <field id="tide_pot_K2"   long_name="K2 tidal potential"    unit="m" />
-        <field id="tide_pot_K1"   long_name="K1 tidal potential"    unit="m" />
-        <field id="tide_pot_O1"   long_name="O1 tidal potential"    unit="m" />
-        <field id="tide_pot_Q1"   long_name="Q1 tidal potential"    unit="m" />
-        <field id="tide_pot_P1"   long_name="P1 tidal potential"    unit="m" />
-        <field id="tide_pot_M4"   long_name="M4 tidal potential"    unit="m" />
-        <field id="tide_pot_Mf"   long_name="Mf tidal potential"    unit="m" />
-        <field id="tide_pot_Mm"   long_name="Mm tidal potential"    unit="m" />
-        <field id="tide_pot_Msqm" long_name="Msqm tidal potential"  unit="m" />
-        <field id="tide_pot_Mtm"  long_name="Mtm tidal potential"   unit="m" />
-        <field id="tide_pot_S1"   long_name="S1 tidal potential"    unit="m" />
-        <field id="tide_pot_MU2"  long_name="MU2 tidal potential"   unit="m" />
-        <field id="tide_pot_NU2"  long_name="NU2 tidal potential"   unit="m" />
-        <field id="tide_pot_L2"   long_name="L2 tidal potential"    unit="m" />
-        <field id="tide_pot_T2"   long_name="T2 tidal potential"    unit="m" />
-      </field_group>
-
-      <!-- OSMOSIS variables (available with ln_zdfosm=.true.) -->
-
-      <field_group id="OSMOSIS_T" grid_ref="grid_T_2D">
-        <field id="hml"                 long_name="mixed layr depth"                         unit="m"       />
-        <field id="hbl"                 long_name="boundary layer depth"                     unit="m"       />
-        <field id="dh"                  long_name="Pycnocline thickness"                     unit=" m"      />
-        <field id="ibld"                long_name="index of boundary layer depth"            unit="#"       />
-        <field id="imld"                long_name="index of mixed layer depth"            unit="#"       />
-        <field id="zhbl"                long_name="boundary layer depth -grid"                     unit="m"       />
-        <field id="zhml"                long_name="mixed layer depth - grid"                        unit="m"       />
-        <field id="zdh"                 long_name="Pycnocline  depth - grid"                 unit=" m"      />
-        <field id="zustke"              long_name="magnitude of stokes drift  at T-points"   unit="m/s"     />
-        <field id="us_x"        long_name="i component of active Stokes drift"                      unit="m/s"     />
-        <field id="us_y"        long_name="j component of active Stokes drift"                      unit="m/s"     />
-        <field id="dstokes"             long_name="stokes drift  depth scale"                unit="m"       />
-        <field id="zwth0"               long_name="surface non-local temperature flux"       unit="deg m/s" />
-        <field id="zws0"                long_name="surface non-local salinity flux"          unit="psu m/s" />
-        <field id="zwstrc"              long_name="convective velocity scale"                unit="m/s"     />
-        <field id="zustar"              long_name="friction velocity"                        unit="m/s"     />
-        <field id="zwstrl"              long_name="langmuir velocity scale"                  unit="m/s"     />
-        <field id="zvstr"               long_name="mixed velocity scale"                     unit="m/s"     />
-        <field id="zla"                 long_name="langmuir number"                          unit="m/s"     />
-        <field id="wind_wave_abs_power" long_name="\rho |U_s| x u*^2"                        unit="mW"      />
-        <field id="wind_wave_power"     long_name="U_s \dot  tau"                            unit="mW"      />
-        <field id="wind_power"          long_name="\rho  u*^3"                               unit="mW"      />
-
-       <!-- interior BL OSMOSIS diagnostics -->
-        <field id="zwthav"              long_name="av turb flux of T in ml"                  unit="deg m/s" />
-        <field id="zt_ml"               long_name="av T in ml"                               unit="deg"     />
-        <field id="zhol"                long_name="Hoenekker number"                         unit="#"       />
-        <field id="zws_ent"            long_name="entrainment turb flux of S"                unit="10^-3 m/s" />
-        <field id="zwth_ent"            long_name="entrainment turb flux of T"               unit="deg m/s" />
-        <field id="zwb_ent"            long_name="entrainment turb flux of buoyancy"         unit="m^2/s^-3" />
- 
-        <field id="zdt_bl"             long_name="temperature jump at base of BL"                 unit="deg"      />
-        <field id="zds_bl"             long_name="salinity jump at base of BL"                 unit="10^-3"      />
-        <field id="zdb_bl"             long_name="buoyancy jump at base of BL"                 unit="m/s^2"      />
-        <field id="zdu_bl"             long_name="u jump at base of BL"                       unit="m/s"      />
-        <field id="zdv_bl"             long_name="v jump at base of BL"                       unit="m/s"      />
-
-        <!-- extra OSMOSIS diagnostics for debugging -->
-       <field id="zsc_uw_1_0"       long_name="zsc u-momentum flux on T after Stokes"                       unit="m^2/s^2" />
-        <field id="zsc_uw_1_f"       long_name="zsc u-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
-        <field id="zsc_vw_1_f"       long_name="zsc v-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
-        <field id="zsc_uw_2_f"       long_name="2nd zsc u-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
-        <field id="zsc_vw_2_f"       long_name="2nd zsc v-momentum flux on T after Coriolis"                       unit="m^2/s^2" />
-        <field id="zuw_bse"       long_name="base u-flux T-points"                          unit="m^2/s^2" />
-        <field id="zvw_bse"       long_name="base v-flux T-points"                          unit="m^2/s^2" />
-
-       <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
-         <field id="hmle"          long_name="OBL FK-layer thickness"                                     unit="m"        />
-        <field id="mld_prof"              long_name="FK-layer depth index"                  unit="#" />
-        <field id="zmld"          long_name="target FK-layer thickness"                                     unit="m"        />
-        <field id="zwb_fk"          long_name="FK b-flux"                                     unit="m^2 s^-3"        />
-        <field id="zwb_fk_b"          long_name="layer averaged FK b-flux"                 unit="m^2 s^-3"       />
-        <field id="zdiff_mle"          long_name="max FK diffusivity in MLE"       unit=" 10^-4 m^2 s^-1"       />
-        <field id="zvel_mle"          long_name="FK velocity scale in MLE"       unit=" m s^-1"       />
+    <field_group id="grid_ABL2D" grid_ref="grid_TA_2D" >
+      <field id="pblh"       long_name="ABL height"                    standard_name="abl_height"     unit="m"        />
+      <field id="uz1_abl"    long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      />
+      <field id="vz1_abl"    long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      />
+      <field id="uvz1_abl"   long_name="ABL wind speed module"         standard_name="abl_wind_speed" unit="m/s"       > sqrt( uz1_abl^2 + vz1_abl^2 ) </field>
+      <field id="tz1_abl"    long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        />
+      <field id="qz1_abl"    long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    />
+      <field id="uz1_dta"    long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      />
+      <field id="vz1_dta"    long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      />
+      <field id="uvz1_dta"   long_name="DTA wind speed module"         standard_name="dta_wind_speed" unit="m/s"       > sqrt( uz1_dta^2 + vz1_dta^2 ) </field>
+      <field id="tz1_dta"    long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        />
+      <field id="qz1_dta"    long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    />
+      <!-- debug (to be removed) -->
+      <field id="uz1_geo"    long_name="GEO i-horizontal velocity"     standard_name="geo_x_velocity" unit="m/s"      />
+      <field id="vz1_geo"    long_name="GEO j-horizontal velocity"     standard_name="geo_y_velocity" unit="m/s"      />
+      <field id="uvz1_geo"   long_name="GEO wind speed module"         standard_name="geo_wind_speed" unit="m/s"       > sqrt( uz1_geo^2 + vz1_geo^2 ) </field>
     </field_group>
 
-      <field_group id="OSMOSIS_W" grid_ref="grid_W_3D" >
-        <field id="zviscos"       long_name="BL viscosity"   unit="m^2/s" />
-        <field id="ghamt"       long_name="non-local temperature flux"                       unit="deg m/s" />
-        <field id="ghams"       long_name="non-local salinity flux"                          unit="psu m/s" />
-        <field id="zdtdz_pyc"   long_name="Pycnocline temperature gradient"                  unit=" deg/m"  />
-        <field id="zdsdz_pyc"   long_name="Pycnocline salinity gradient"                  unit=" 10^-3/m"  />
-        <field id="zdbdz_pyc"   long_name="Pycnocline buoyancy gradient"                  unit=" s^-2"  />
-        <field id="zdudz_pyc"   long_name="Pycnocline u gradient"                  unit=" s^-2"  />
-        <field id="zdvdz_pyc"   long_name="Pycnocline v gradient"                  unit=" s^-2"  />
-
-        <!-- extra OSMOSIS diagnostics for debugging -->
-         <field id="ghamu_00"       long_name="initial non-local u-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamv_00"       long_name="initial non-local v-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamu_0"       long_name="after dstokes non-local u-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamu_f"       long_name="after Coriolis non-local u-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamv_f"       long_name="after Coriolis  non-local v-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamu_b"       long_name="after buoyancy added non-local u-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamv_b"       long_name="after buoyancy added  non-local v-momentum flux"  unit="m^2/s^2" />
-        <field id="ghamu_1"       long_name="after entrainment non-local u-momentum flux"   unit="m^2/s^2" />
-        <field id="ghamv_1"       long_name="after entrainment  non-local v-momentum flux"  unit="m^2/s^2" />
-     </field_group>
-
-      <field_group id="OSMOSIS_U" grid_ref="grid_U_2D" >
-        <field id="ghamu"       long_name="non-local u-momentum flux"   grid_ref="grid_U_3D" unit="m^2/s^2" />
-       <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
-       <field id="zdtdx"          long_name="FK  T x-gradient"                                     unit=" deg C m^-1"        />
-        <field id="zdsdx"          long_name="FK  S x-gradient"                                     unit=" 10^-3 m^-1"        />
-        <field id="dbdx_mle"          long_name="FK  B x-gradient"                                     unit=" s^-2"        />
-     </field_group>
-
-      <field_group id="OSMOSIS_V" grid_ref="grid_V_2D" >
-        <field id="ghamv"       long_name="non-local v-momentum flux"   grid_ref="grid_V_3D" unit="m^2/s^2" />
-        <!-- FK_OSM OSMOSIS diagnostics (require also ln_osm_mle=.true.-->
-        <field id="zdtdy"          long_name="FK T y-gradient"                                     unit=" deg C m^-1"        />
-        <field id="zdsdy"          long_name="FK S y-gradient"                                     unit=" 10^-3 m^-1"        />
-        <field id="dbdy_mle"          long_name="FK B y-gradient"                                     unit=" s^-2"        />
-      </field_group>
-
-      <!-- SBC -->
-      <field_group id="SBC" > <!-- time step automaticaly defined based on nn_fsbc -->
-
-        <field_group id="SBC_2D" grid_ref="grid_T_2D" >
-
-          <field id="empmr"        long_name="Net Upward Water Flux"                standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
-          <field id="empbmr"       long_name="Net Upward Water Flux at pre. tstep"  standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
-          <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   />
-          <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   />
-          <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" />
-          <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   />
-          <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   />
-          <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   />
-          <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   />
-          <field id="wclosea"      long_name="closed sea empmr correction"          standard_name="closea_empmr"                                                         unit="kg/m2/s"   />
-
-          <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           />
-          <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           />
-          <field id="qsr"          long_name="Shortwave Radiation"                   standard_name="net_downward_shortwave_flux_at_sea_water_surface"                     unit="W/m2"                           />
-          <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" />
-          <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           />
-          <field id="qclosea"      long_name="closed sea heat content flux"          standard_name="closea_heat_content_downward_flux"                                    unit="W/m2"     />
-          <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        />
-          <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           />
-          <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            />
-
-          <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn -->
-          <field id="ssh_ib"       long_name="Inverse barometer sea surface height"  standard_name="sea_surface_height_correction_due_to_air_pressure_at_low_frequency"   unit="m"        />
-
-          <!-- * variable related to ice shelf forcing * -->
-          <field id="isftfrz_cav"     long_name="freezing point temperature at ocean/isf interface"                unit="degC"     />
-          <field id="isftfrz_par"     long_name="freezing point temperature in the parametrization boundary layer" unit="degC"     />
-          <field id="fwfisf_cav"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
-          <field id="fwfisf_par"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
-          <field id="qoceisf_cav"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
-          <field id="qoceisf_par"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
-          <field id="qlatisf_cav"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
-          <field id="qlatisf_par"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
-          <field id="qhcisf_cav"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
-          <field id="qhcisf_par"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
-          <field id="fwfisf3d_cav"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
-          <field id="fwfisf3d_par"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
-          <field id="qoceisf3d_cav"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="qoceisf3d_par"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="qlatisf3d_cav"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="qlatisf3d_par"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="qhcisf3d_cav"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
-          <field id="ttbl_cav"        long_name="temperature in Losch tbl"                      unit="degC"     />
-          <field id="ttbl_par"        long_name="temperature in the parametrisation boundary layer" unit="degC" />
-          <field id="isfthermald_cav" long_name="thermal driving of ice shelf melting"          unit="degC"     />
-          <field id="isfthermald_par" long_name="thermal driving of ice shelf melting"          unit="degC"     />
-          <field id="isfgammat"       long_name="Ice shelf heat-transfert velocity"             unit="m/s"      />
-          <field id="isfgammas"       long_name="Ice shelf salt-transfert velocity"             unit="m/s"      />
-          <field id="stbl"            long_name="salinity in the Losh tbl"                      unit="1e-3"     />
-          <field id="utbl"            long_name="zonal current in the Losh tbl at T point"      unit="m/s"      />
-          <field id="vtbl"            long_name="merid current in the Losh tbl at T point"      unit="m/s"      />
-          <field id="isfustar"        long_name="ustar at T point used in ice shelf melting"    unit="m/s"      />
-          <field id="qconisf"         long_name="Conductive heat flux through the ice shelf"    unit="W/m2"     />
-
-          <!-- *_oce variables available with ln_blk_clio or ln_blk_core -->
-          <field id="rho_air"      long_name="Air density at 10m above sea surface"         standard_name="rho_air_10m"                                        unit="kg/m3" />
-          <field id="dt_skin"      long_name="SSST-SST temperature difference"              standard_name="SSST-SST"                                             unit="K"   />
-          <field id="qlw_oce"      long_name="Longwave Downward Heat Flux over open ocean"  standard_name="surface_net_downward_longwave_flux"                 unit="W/m2"  />
-          <field id="qsb_oce"      long_name="Sensible Downward Heat Flux over open ocean"  standard_name="surface_downward_sensible_heat_flux"                unit="W/m2"  />
-          <field id="qla_oce"      long_name="Latent Downward Heat Flux over open ocean"    standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"  />
-          <field id="evap_oce"     long_name="Evaporation over open ocean"                  standard_name="evaporation"                                        unit="kg/m2/s" />
-          <field id="qt_oce"       long_name="total flux at ocean surface"                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"  />
-          <field id="qsr_oce"      long_name="solar heat flux at ocean surface"             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"  />
-          <field id="qns_oce"      long_name="non-solar heat flux at ocean surface (including E-P)"                                                            unit="W/m2"  />
-          <field id="qemp_oce"     long_name="Downward Heat Flux from E-P over open ocean"                                                                     unit="W/m2"  />
-          <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress"               unit="N/m2"  />
-
-          <!-- variables computed by the bulk parameterization algorithms (ln_blk) -->
-          <field id="Cd_oce"      long_name="Drag coefficient over open ocean"              standard_name="drag_coefficient_water"                unit=""  />
-          <field id="Ce_oce"      long_name="Evaporaion coefficient over open ocean"        standard_name="evap_coefficient_water"                unit=""  />
-          <field id="Ch_oce"      long_name="Sensible heat coefficient over open ocean"     standard_name="sensible_heat_coefficient_water"       unit=""  />
-          <field id="theta_zt"    long_name="Potential air temperature at z=zt"             standard_name="potential_air_temperature_at_zt"       unit="degC" />
-          <field id="q_zt"        long_name="Specific air humidity at z=zt"                 standard_name="specific_air_humidity_at_zt"           unit="kg/kg" />
-          <field id="theta_zu"    long_name="Potential air temperature at z=zu"             standard_name="potential_air_temperature_at_zu"       unit="degC" />
-          <field id="q_zu"        long_name="Specific air humidity at z=zu"                 standard_name="specific_air_humidity_at_zu"           unit="kg/kg" />
-          <field id="ssq"         long_name="Saturation specific humidity of air at z=0"    standard_name="surface_air_saturation_spec_humidity"  unit="kg/kg" />
-          <field id="wspd_blk"    long_name="Bulk wind speed at z=zu"                       standard_name="bulk_wind_speed_at_zu"                 unit="m/s"   />
-          <!-- ln_blk + key_si3 -->
-          <field id="Cd_ice"      long_name="Drag coefficient over ice"                     standard_name="drag_coefficient_ice"                 unit=""  />
-          <field id="Ce_ice"      long_name="Evaporaion coefficient over ice"               standard_name="evap_coefficient_ice"                 unit=""  />
-          <field id="Ch_ice"      long_name="Sensible heat coefficient over ice"            standard_name="sensible_heat_coefficient_ice"        unit=""  />
-
-          <!-- available key_oasis3 -->
-          <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  />
-          <field id="snow_ai_cea"  long_name="Snow over sea-ice (cell average)"          standard_name="snowfall_flux"                             unit="kg/m2/s"  />
-          <field id="subl_ai_cea"  long_name="Sublimation over sea-ice (cell average)"   standard_name="surface_snow_and_ice_sublimation_flux"     unit="kg/m2/s"  />
-          <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        />
-          <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  />
-          <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  />
-          <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  />
-
-
-          <!-- available if key_oasis3 + conservative method -->
-	  <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  />
-          <field id="rain_ao_cea"   long_name="Liquid precipitation over ice-free ocean (cell average)"  standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  />
-          <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  />
-          <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
-          <field id="fsal_virt_cea" long_name="Virtual salt flux due to ice formation (cell average)"    standard_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics"                unit="kg/m2/s"  />
-          <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  />
-          <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     />
-          <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     />
-          <field id="hflx_prec_cea" long_name="heat flux due to all precip"                              standard_name="temperature_flux_due_to_all_precip_expressed_as_heat_flux_into_sea_water"      unit="W/m2"     />
-          <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     />
-          <field id="hflx_snow_ai_cea" long_name="heat flux due to snow falling over ice"                standard_name="heat_flux_onto_ice_due_to_snow_thermodynamics"                                 unit="W/m2"     />
-          <field id="hflx_snow_ao_cea" long_name="heat flux due to snow falling over ice-free ocean"     standard_name="heat_flux_onto_sea_water_due_to_snow_thermodynamics"                           unit="W/m2"     />
-          <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     />
-          <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     />
-          <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_calving"                                       unit="W/m2"     />
-          <field id="hflx_icb_cea"  long_name="heat flux due to iceberg"                                 standard_name="heat_flux_into_sea_water_due_to_icebergs"                                      unit="W/m2"     />
-          <field id="hflx_isf_cea"  long_name="heat flux due to iceshelf"                                standard_name="heat_flux_into_sea_water_due_to_iceshelf"                                      unit="W/m2"     />
-          <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  />
-          <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  />
-          <field id="snowmel_cea"   long_name="Snow Melt Rate (cell average)"                            standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
-          <field id="sntoice_cea"   long_name="Snow-Ice Formation Rate (cell average)"                   standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                             unit="kg/m2/s"  />
-          <field id="ticemel_cea"   long_name="Rate of Melt at Upper Surface of Sea Ice (cell average)"  standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                             unit="kg/m2/s"  />
-
-          <!-- ice field (nn_ice=1)  -->
-          <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            />
-
-          <!-- dilution -->
-          <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" />
-          <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />
-          <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" />
-          <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" />
-
-	  <!-- sbcssm variables -->
-          <field id="sst_m"    unit="degC" />
-          <field id="sss_m"    unit="psu"  />
-          <field id="ssu_m"    unit="m/s"  />
-          <field id="ssv_m"    unit="m/s"  />
-          <field id="ssh_m"    unit="m"    />
-          <field id="e3t_m"    unit="m"    />
-          <field id="frq_m"    unit="-"    />
-
-	</field_group>
-
-
-      </field_group> <!-- SBC -->
-
-      <!-- ABL -->
-      <field_group id="ABL" > <!-- time step automaticaly defined based on nn_fsbc -->
-
-	<!-- variables available with ABL on atmospheric T grid-->
-	<field_group id="grid_ABL3D" grid_ref="grid_TA_3D" >
-          <field id="u_abl"      long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      />
-          <field id="v_abl"      long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      />
-          <field id="t_abl"      long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        />
-          <field id="q_abl"      long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    />
-          <!-- debug (to be removed) -->
-          <field id="u_dta"      long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      />
-          <field id="v_dta"      long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      />
-          <field id="t_dta"      long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        />
-          <field id="q_dta"      long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    />
-          <field id="u_geo"      long_name="GEO i-horizontal velocity"     standard_name="geo_x_velocity" unit="m/s"      />
-          <field id="v_geo"      long_name="GEO j-horizontal velocity"     standard_name="geo_y_velocity" unit="m/s"      />
-          <field id="tke_abl"    long_name="ABL turbulent kinetic energy"  standard_name="abl_tke"        unit="m2/s2"    />
-          <field id="avm_abl"    long_name="ABL turbulent viscosity"       standard_name="abl_avm"        unit="m2/s"     />
-          <field id="avt_abl"    long_name="ABL turbulent diffusivity"     standard_name="abl_avt"        unit="m2/s"     />
-          <field id="mxlm_abl"   long_name="ABL master mixing length"      standard_name="abl_mxlm"       unit="m"        />
-          <field id="mxld_abl"   long_name="ABL dissipative mixing length" standard_name="abl_mxld"       unit="m"        />
-	</field_group>
-
-	<field_group id="grid_ABL2D" grid_ref="grid_TA_2D" >
-          <field id="pblh"       long_name="ABL height"                    standard_name="abl_height"     unit="m"        />
-          <field id="uz1_abl"    long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      />
-          <field id="vz1_abl"    long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      />
-          <field id="uvz1_abl"   long_name="ABL wind speed module"         standard_name="abl_wind_speed" unit="m/s"       > sqrt( uz1_abl^2 + vz1_abl^2 ) </field>
-          <field id="tz1_abl"    long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        />
-          <field id="qz1_abl"    long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    />
-          <field id="uz1_dta"    long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      />
-          <field id="vz1_dta"    long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      />
-          <field id="uvz1_dta"   long_name="DTA wind speed module"         standard_name="dta_wind_speed" unit="m/s"       > sqrt( uz1_dta^2 + vz1_dta^2 ) </field>
-          <field id="tz1_dta"    long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        />
-          <field id="qz1_dta"    long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    />
-          <!-- debug (to be removed) -->
-          <field id="uz1_geo"    long_name="GEO i-horizontal velocity"     standard_name="geo_x_velocity" unit="m/s"      />
-          <field id="vz1_geo"    long_name="GEO j-horizontal velocity"     standard_name="geo_y_velocity" unit="m/s"      />
-          <field id="uvz1_geo"   long_name="GEO wind speed module"         standard_name="geo_wind_speed" unit="m/s"       > sqrt( uz1_geo^2 + vz1_geo^2 ) </field>
-	</field_group>
-
-      </field_group> <!-- ABL -->
-
-
-      <!-- U grid -->
-
-      <field_group id="grid_U"   grid_ref="grid_U_2D">
-        <field id="hu"            long_name="water column height at U point"                         standard_name="water_column_height_U"       unit="m" />
-        <field id="e2u"           long_name="U-cell width in meridional direction"                   standard_name="cell_width"                  unit="m"                               />
-        <field id="e3u"           long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" />
-        <field id="e3u_0"         long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/>
-        <field id="utau"          long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            />
-        <field id="uoce"          long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" />
-    	<field id="uoce_e3u"      long_name="ocean current along i-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_U_3D"  > uoce * e3u </field>
-    	<field id="uoce_e3u_vsum" long_name="ocean current along i-axis * e3u summed on the vertical"  field_ref="uoce_e3u"    unit="m3/s"       grid_ref="grid_U_vsum"/>
-        <field id="uocetr_vsum"   long_name="ocean transport along i-axis  summed on the vertical"         field_ref="e2u"       unit="m3/s"> this * uoce_e3u_vsum  </field>
-
-        <field id="uocetr_vsum_op"    long_name="ocean current along i-axis * e3u * e2u summed on the vertical"  read_access="true"  freq_op="1mo"    field_ref="e2u"       unit="m3/s"> @uocetr_vsum </field>
-        <field id="uocetr_vsum_cumul" long_name="ocean current along i-axis * e3u * e2u cumulated from southwest point" freq_offset="_reset_" operation="instant" freq_op="1mo"  unit="m3/s" />
-        <field id="msftbarot"         long_name="ocean_barotropic_mass_streamfunction"   unit="kg s-1" > uocetr_vsum_cumul * $rho0 </field>
-
-
-        <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             />
-        <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                             />
-        <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             />
-        <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" />
-        <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" />
-        <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" />
-        <field id="ssuww"        long_name="ocean surface wind work along i-axis"                   standard_name="surface_x_wind_work"         unit="N/m*s"                            > utau * ssu </field>
-        <!-- AGRIF sponge -->
-        <field id="agrif_spu"    long_name=" AGRIF u-sponge coefficient"   unit=" " />
-        <!-- u-eddy diffusivity coefficients (available if ln_traldf_OFF=F) -->
-        <field id="ahtu_2d"      long_name=" surface u-eddy diffusivity coefficient"   unit="m2/s or m4/s" />
-        <field id="ahtu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s or m4/s"      grid_ref="grid_U_3D"/>
-        <!-- u-eiv diffusivity coefficients (available if ln_ldfeiv=F) -->
-        <field id="aeiu_2d"      long_name=" surface u-EIV coefficient"                unit="m2/s" />
-        <field id="aeiu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s"              grid_ref="grid_U_3D"/>
-
-        <!-- variables available with MLE (ln_mle=T) -->
-        <field id="psiu_mle"     long_name="MLE streamfunction along i-axis"   unit="m3/s"   grid_ref="grid_U_3D" />
-
-        <!-- uoce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T) -->
-    	<field id="uoce_eiv"      long_name="EIV ocean current along i-axis"                                  standard_name="bolus_sea_water_x_velocity"                     unit="m/s"   grid_ref="grid_U_3D" />
-        <field id="ueiv_masstr"   long_name="EIV Ocean Mass X Transport"                                      standard_name="bolus_ocean_mass_x_transport"                   unit="kg/s"  grid_ref="grid_U_3D" />
-        <field id="ueiv_heattr"   long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"                         />
-        <field id="ueiv_salttr"   long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="Kg"                        />
-        <field id="ueiv_heattr3d" long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"     grid_ref="grid_U_3D" />
-        <field id="ueiv_salttr3d" long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="kg"    grid_ref="grid_U_3D" />
-
-        <!-- uoce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 -->
-        <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  />
-        <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 -->
-        <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" />
-
-        <!-- variables available with WAVE (ln_wave=T) -->
-        <field id="ustokes"      long_name="Stokes Drift Velocity i-axis"      standard_name="StokesDrift_x_velocity"      unit="m/s"        grid_ref="grid_U_3D" />
-        <field id="ustokes_e3u"  long_name="Stokes Drift Velocity i-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_U_3D"  > ustokes * e3u </field>
-
-        <!-- variable for ice shelves -->
-        <field id="utbl"         long_name="zonal current in the Losh tbl"     unit="m/s" />
-
-        <!-- variables available with diaar5 -->
-        <field id="u_masstr"      long_name="Ocean Mass X Transport"                                          standard_name="ocean_mass_x_transport"                         unit="kg/s"  grid_ref="grid_U_3D" />
-        <field id="u_masstr_vint" long_name="vertical integral of ocean eulerian mass transport along i-axis" standard_name="vertical_integral_of_ocean_mass_x_transport"    unit="kg/s"                      />
-        <field id="u_heattr"      long_name="ocean eulerian heat transport along i-axis"                      standard_name="ocean_heat_x_transport"                         unit="W"                         />
-        <field id="u_salttr"      long_name="ocean eulerian salt transport along i-axis"                      standard_name="ocean_salt_x_transport"                         unit="1e-3*kg/s"                 />
-        <field id="uadv_heattr"   long_name="ocean advective heat transport along i-axis"                     standard_name="advectice_ocean_heat_x_transport"               unit="W"                         />
-        <field id="uadv_salttr"   long_name="ocean advective salt transport along i-axis"                     standard_name="advectice_ocean_salt_x_transport"               unit="1e-3*kg/s"                 />
-        <field id="udiff_heattr"  long_name="ocean diffusion heat transport along i-axis"                     standard_name="ocean_heat_x_transport_due_to_diffusion"        unit="W"                         />
-        <field id="udiff_salttr"  long_name="ocean diffusion salt transport along i-axis"                     standard_name="ocean_salt_x_transport_due_to_diffusion"        unit="1e-3*kg/s"                 />
-      </field_group>
-
-      <!-- V grid -->
-
-      <field_group id="grid_V"   grid_ref="grid_V_2D">
-        <field id="e1v"          long_name="V-cell width in longitudinal direction"                 standard_name="cell_width"                  unit="m"                              />
-        <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" />
-        <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D" />
-        <field id="hv"            long_name="water column height at V point"                        standard_name="water_column_height_V"       unit="m" />
-        <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            />
-        <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" />
-        <field id="voce_e3v"     long_name="ocean current along j-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_V_3D"  > voce * e3v </field>
-        <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             />
-        <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                             />
-        <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             />
-        <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" />
-        <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" />
-        <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" />
-        <field id="ssvww"        long_name="ocean surface wind work along j-axis"                   standard_name="surface_y_wind_work"         unit="N/m*s"                            > vtau * ssv </field>
-        <!-- AGRIF sponge -->
-        <field id="agrif_spv"    long_name=" AGRIF v-sponge coefficient"   unit=" " />
-        <!-- v-eddy diffusivity coefficients (available if ln_traldf_OFF=F) -->
-        <field id="ahtv_2d"      long_name=" surface v-eddy diffusivity coefficient"     unit="m2/s or (m4/s)^1/2" />
-        <field id="ahtv_3d"      long_name=" 3D v-eddy diffusivity coefficient"          unit="m2/s or (m4/s)^1/2"           grid_ref="grid_V_3D"/>
-        <!-- v-eiv diffusivity coefficients (available if ln_ldfeiv=F) -->
-        <field id="aeiv_2d"      long_name=" surface v-EIV coefficient"                  unit="m2/s" />
-        <field id="aeiv_3d"      long_name=" 3D v-EIV coefficient"                       unit="m2/s"                         grid_ref="grid_V_3D" />
-
-        <!-- variables available with MLE (ln_mle=T) -->
-        <field id="psiv_mle"     long_name="MLE streamfunction along j-axis"   unit="m3/s"   grid_ref="grid_V_3D" />
-
-        <!-- voce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T)  -->
-	<field id="voce_eiv"     long_name="EIV ocean current along j-axis"  standard_name="bolus_sea_water_y_velocity"     unit="m/s"   grid_ref="grid_V_3D" />
-        <field id="veiv_masstr"  long_name="EIV Ocean Mass Y Transport"      standard_name="bolus_ocean_mass_y_transport"   unit="kg/s"  grid_ref="grid_V_3D" />
-        <field id="veiv_heattr"   long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                         />
-        <field id="veiv_salttr"   long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="Kg"                        />
-        <field id="veiv_heattr3d" long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_V_3D" />
-        <field id="veiv_salttr3d" long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_V_3D" />
-
-
-        <!-- voce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 -->
-        <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  />
-        <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 -->
-        <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" />
-
-        <!-- variables available with WAVE (ln_wave=T) -->
-        <field id="vstokes"      long_name="Stokes Drift Velocity j-axis"      standard_name="StokesDrift_y_velocity"      unit="m/s"        grid_ref="grid_V_3D" />
-        <field id="vstokes_e3v"  long_name="Stokes Drift Velocity j-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_V_3D"  > vstokes * e3v </field>
-
-        <!-- variable for ice shelves -->
-        <field id="vtbl"         long_name="meridional current in the Losh tbl"   unit="m/s" />
-
-        <!-- variables available with diaar5 -->
-        <field id="v_masstr"      long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s" grid_ref="grid_V_3D" />
-        <field id="v_heattr"      long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                         />
-        <field id="v_salttr"      long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                 />
-        <field id="vadv_heattr"   long_name="ocean advective heat transport along j-axis"   standard_name="advectice_ocean_heat_y_transport"                unit="W"                         />
-        <field id="vadv_salttr"   long_name="ocean advective salt transport along j-axis"   standard_name="advectice_ocean_salt_y_transport"                unit="1e-3*kg/s"                 />
-        <field id="vdiff_heattr"  long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                         />
-        <field id="vdiff_salttr"  long_name="ocean diffusion salt transport along j-axis"   standard_name="ocean_salt_y_transport_due_to_diffusion"         unit="1e-3*kg/s"                 />
-      </field_group>
-
-      <!-- W grid -->
-
-      <field_group id="grid_W" grid_ref="grid_W_3D">
-        <field id="e3w"          long_name="W-cell thickness"                              standard_name="cell_thickness"                         unit="m"    />
-	<field id="woce"         long_name="ocean vertical velocity"                       standard_name="upward_sea_water_velocity"              unit="m/s"  />
-	<field id="woce_e3w"     long_name="ocean vertical velocity * e3w"                                                                        unit="m2/s"  > woce * e3w </field>
-        <field id="wocetr_eff"   long_name="effective ocean vertical transport"                                                                   unit="m3/s" />
-
-        <!-- woce_eiv: available with EIV  (ln_ldfeiv=T and ln_ldfeiv_dia=T)  -->
-        <field id="woce_eiv"     long_name="EIV ocean vertical velocity"                    standard_name="bolus_upward_sea_water_velocity"       unit="m/s"  />
-        <field id="weiv_masstr"  long_name="EIV Upward Ocean Mass Transport"  standard_name="bolus_upward_ocean_mass_transport"             unit="kg/s"   />
-        <field id="weiv_heattr3d" long_name="ocean bolus heat transport"    standard_name="ocean_heat_z_transport_due_to_bolus_advection"   unit="W"    />
-        <field id="weiv_salttr3d" long_name="ocean bolus salt transport"    standard_name="ocean_salt_z_transport_due_to_bolus_advection"   unit="kg"   />
-
-	<field id="avt"          long_name="vertical eddy diffusivity"                      standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
-        <field id="avt_e3w"      long_name="vertical heat diffusivity * e3w"                unit="m3/s" > avt * e3w </field>
-        <field id="logavt"       long_name="logarithm of vertical eddy diffusivity"         standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
-        <field id="avm"          long_name="vertical eddy viscosity"                        standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" />
-        <field id="avm_e3w"      long_name="vertical eddy viscosity * e3w"   unit="m3/s" > avm * e3w </field>
-
-        <!-- avs: /= avt with ln_zdfddm=T -->
-        <field id="avs"          long_name="salt vertical eddy diffusivity"                 standard_name="ocean_vertical_salt_diffusivity"       unit="m2/s" />
-        <field id="avs_e3w"      long_name="vertical salt diffusivity * e3w"   unit="m3/s" > avs * e3w </field>
-	<field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"    standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
-
-        <!-- avt_evd and avm_evd: available with ln_zdfevd -->
-        <field id="avt_evd"      long_name="convective enhancement of vertical diffusivity" standard_name="ocean_vertical_tracer_diffusivity_due_to_convection"     unit="m2/s" />
-        <field id="avt_evd_e3w"  long_name="convective enhancement to vertical diffusivity * e3w "    unit="m3/s" > avt_evd * e3w </field>
-	<field id="avm_evd"      long_name="convective enhancement of vertical viscosity"   standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" />
-
-        <!-- mf_app and mf_wp: available with ln_zdfmfc -->
-         <field id="mf_app"      long_name="convective area"        standard_name="mf_convective_area"    unit="%"      grid_ref="grid_W_3D" />
-         <field id="mf_wp"       long_name="convective velocity"    standard_name="mf_convective_velo"    unit="m/s"    grid_ref="grid_W_3D" />
-
-
-        <!-- avt_tide: available with ln_zdfiwm=T -->
-        <field id="av_ratio"     long_name="S over T diffusivity ratio"                     standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    />
-        <field id="av_wave"      long_name="internal wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" />
-        <field id="bflx_iwm"     long_name="internal wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" />
-        <field id="pcmap_iwm"    long_name="power consumed by wave-driven mixing"           standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" />
-        <field id="emix_iwm"     long_name="power density available for mixing"             standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" />
-
-        <!-- variables available with WAVE (ln_wave=T) -->
-        <field id="wstokes"      long_name="Stokes Drift vertical velocity"                 standard_name="upward_StokesDrift_velocity"   unit="m/s" />
-
-        <!-- variables available with diaar5 -->
-        <field id="w_masstr"     long_name="vertical mass transport"                        standard_name="upward_ocean_mass_transport"             unit="kg/s"   />
-        <field id="w_masstr2"    long_name="square of vertical mass transport"              standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" />
-
-        <!-- EOS -->
-        <field id="bn2"          long_name="squared Brunt-Vaisala frequency"                unit="s-2" />
-
-      </field_group>
-
-      <!-- F grid -->
-      <field_group id="grid_F" grid_ref="grid_F_2D">
-	<field id="e3f"          long_name="F-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_F_3D" />
-	<field id="e3f_0"        long_name="F-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_F_3D" />
-        <field id="hf"           long_name="water column height at F point"    standard_name="water_column_height_F"  unit="m"                     />
-        <field id="sKEf"         long_name="surface kinetic energy at F point" standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2" />
-        <field id="relvor"       long_name="relative vorticity"                standard_name="relative_vorticity"     unit="1/s"                   />
-        <field id="plavor"       long_name="planetary vorticity"               standard_name="planetary_vorticity"    unit="1/s"                   />
-        <field id="relpotvor"    long_name="relative potential vorticity"      standard_name="relpot_vorticity"       unit="1/m.s"                 />
-        <field id="abspotvor"    long_name="absolute potential vorticity"      standard_name="abspot_vorticity"       unit="1/m.s"                 />
-        <field id="Ens"          long_name="enstrophy"                         standard_name="enstrophy"              unit="1/m2.s2"               />
-      </field_group> 
- 
-      <!-- AGRIF sponge -->
-      <field id="agrif_spf"    long_name=" AGRIF f-sponge coefficient"   unit=" " />
-      <!-- f-eddy viscosity coefficients (ldfdyn) -->
-      <field id="ahmf_2d"      long_name=" surface f-eddy viscosity coefficient"   unit="m2/s or m4/s" />
-      <field id="ahmf_3d"      long_name=" 3D      f-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/>
-
-      <field_group id="scalar"  grid_ref="grid_scalar"  >
-      	<!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly -->
-        <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   />
-        <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    />
-        <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    />
-        <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    />
-        <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   />
-        <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" />
-	<field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" />
-        <field id="ssttot"     long_name="global mean sea surface temperature"          standard_name="sea_water_conservative_temperature"             unit="degC" />
-         <!-- EOS = TEOS-10 -->
-        <field id="temptot_pot" long_name="global mean potential temperature"            standard_name="sea_water_potential_temperature"               unit="degC" />
-
-      	<!-- available with ln_diahsb -->
-        <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     />
-        <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     />
-        <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   />
-        <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     />
-        <field id="bgsaltco"     long_name="drift in global mean salt content wrt timestep 1"                                                                                      unit="1e-3*km3" />
-        <field id="bgvolssh"     long_name="drift in global mean ssh volume wrt timestep 1"                                                                                        unit="km3"      />
-        <field id="bgvole3t"     long_name="drift in global mean volume variation (e3t) wrt timestep 1"                                                                            unit="km3"      />
-        <field id="bgfrcvol"     long_name="global mean volume from forcing"                                                                                                       unit="km3"      />
-        <field id="bgfrctem"     long_name="global mean heat content from forcing"                                                                                                 unit="1.e20J"   />
-        <field id="bgfrchfx"     long_name="global mean heat flux from forcing"                                                                                                    unit="W/m2"     />
-        <field id="bgfrcsal"     long_name="global mean salt content from forcing"                                                                                                 unit="1e-3*km3" />
-        <field id="bgmistem"     long_name="global mean temperature error due to free surface (linssh true)"                                                                       unit="degC"     />
-        <field id="bgmissal"     long_name="global mean salinity error due to free surface (linssh true)"                                                                          unit="1e-3"     />
-      </field_group>
-
-
-      <!-- transects -->
-      <field_group id="oce_straits">
-         <field id="uoce_e3u_ave"         long_name="Monthly average of u*e3u"                        field_ref="uoce_e3u"                    freq_op="1mo"   freq_offset="_reset_" > @uoce_e3u </field>
-         <field id="uoce_e3u_ave_vsum"    long_name="Vertical sum of u*e3u"                           field_ref="uoce_e3u_ave"         grid_ref="grid_U_vsum"     />
-         <field id="uocetr_vsum_section"  long_name="Total 2D transport in i-direction"               field_ref="uoce_e3u_ave_vsum"    grid_ref="grid_U_scalar"  detect_missing_value="true"> this * e2u </field>
-         <field id="uocetr_strait"        long_name="Total transport across lines in i-direction"     field_ref="uocetr_vsum_section"  grid_ref="grid_U_4strait" />
-         <field id="u_masstr_strait"      long_name="Sea water transport across line in i-direction"  field_ref="uocetr_strait"        grid_ref="grid_U_4strait_hsum" unit="kg/s"> this * maskMFO_u * $rho0 </field>
-
-         <field id="voce_e3v_ave"         long_name="Monthly average of v*e3v"                        field_ref="voce_e3v"                    freq_op="1mo"   freq_offset="_reset_" > @voce_e3v </field>
-         <field id="voce_e3v_ave_vsum"    long_name="Vertical sum of v*e3v"                           field_ref="voce_e3v_ave"         grid_ref="grid_V_vsum"      />
-         <field id="vocetr_vsum_section"  long_name="Total 2D transport of in j-direction"            field_ref="voce_e3v_ave_vsum"    grid_ref="grid_V_scalar"  detect_missing_value="true"> this * e1v </field>
-         <field id="vocetr_strait"        long_name="Total transport across lines in j-direction"     field_ref="vocetr_vsum_section"  grid_ref="grid_V_4strait"  />
-         <field id="v_masstr_strait"      long_name="Sea water transport across line in j-direction"  field_ref="vocetr_strait"        grid_ref="grid_V_4strait_hsum" unit="kg/s"> this * maskMFO_v * $rho0 </field>
-
-         <field id="masstr_strait"        long_name="Sea water transport across line"                                                  grid_ref="grid_4strait"  > u_masstr_strait + v_masstr_strait </field>
-      </field_group>
-
-      <!-- variables available with ln_floats -->
-
-      <field_group id="floatvar" grid_ref="grid_T_nfloat"  operation="instant" >
-        <field id="traj_lon"      long_name="floats longitude"                                                           unit="degrees_east"  />
-        <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" />
-        <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             />
-        <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          />
-        <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          />
-        <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         />
-        <field id="traj_group"    long_name="floats group"                                                               unit="1"             />
-      </field_group>
-
-      <!-- variables available with iceberg trajectories -->
-
-      <field_group id="icbvar" domain_ref="grid_T"  >
-        <field id="berg_melt"          long_name="icb melt rate of icebergs"                       unit="kg/m2/s"                    />
-        <field id="berg_melt_hcflx"    long_name="icb heat flux to ocean due to melting heat content"   unit="J/m2/s"                />
-        <field id="berg_melt_qlat"     long_name="icb heat flux to ocean due to melting latent heat"    unit="J/m2/s"                />
-        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"     unit="kg/m2/s"                    />
-        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"      unit="kg/m2/s"                    />
-        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate"   unit="kg/m2/s"                    />
-        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"                unit="m2"                         />
-        <field id="bits_src"           long_name="icb mass source of bergy bits"                   unit="kg/m2/s"                    />
-        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                     unit="kg/m2/s"                    />
-        <field id="bits_mass"          long_name="icb bergy bit density field"                     unit="kg/m2"                      />
-        <field id="berg_mass"          long_name="icb iceberg density field"                       unit="kg/m2"                      />
-        <field id="calving"            long_name="icb calving mass input"                          unit="kg/s"                       />
-        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"                unit="kg/m2/s"                    />
-        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                  unit="kg/s"     axis_ref="icbcla" />
-        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"               unit="kg"       axis_ref="icbcla" />
-      </field_group>
-
-      <!-- Poleward transport : ptr -->
-      <field_group id="diaptr" >
-        <field id="zomsf"         long_name="Overturning Stream-Function : All basins"                     unit="Sv"         grid_ref="grid_znl_W_3D" />
-        <field id="zotem"         long_name="Zonal Mean Temperature : All basins"                          unit="degree_C"   grid_ref="grid_znl_T_3D" />
-        <field id="zosal"         long_name="Zonal Mean Salinity : All basins"                             unit="0.001"      grid_ref="grid_znl_T_3D" />
-        <field id="zosrf"         long_name="Zonal Mean Surface : All basins"                              unit="m2"         grid_ref="grid_znl_T_3D" />
-        <field id="sophtove"      long_name="Overturning Heat Transport: All basins"                       unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopstove"      long_name="Overturning Salt Transport: All basins"                       unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophtbtr"      long_name="Barotropic Heat Transport: All basins"                        unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopstbtr"      long_name="Barotropic Salt Transport: All basins"                        unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophtadv"      long_name="Advective Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopstadv"      long_name="Advective Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophtldf"      long_name="Diffusive Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopstldf"      long_name="Diffusive Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophtvtr"      long_name="Heat Transport : All basins"                                  unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopstvtr"      long_name="Salt Transport : All basins"                                  unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophteiv"      long_name="Heat Transport from mesoscale eddy advection: All basins"     unit="PW"         grid_ref="grid_znl_T_2D" />
-        <field id="sopsteiv"      long_name="Salt Transport from mesoscale eddy advection : All basins"    unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-	<field id="sopstadv"      long_name="Advective Salt Transport"                                     unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
-        <field id="sophtgyre"     long_name="Overturning heat transport due to gyre" field_ref="sophtove"  unit="W"          grid_ref="grid_znl_T_2D" > sophtvtr - sophtove  </field>
-	<field id="sopstgyre"     long_name="Overturning salt transport due to gyre" field_ref="sopstove"  unit="kg/s"       grid_ref="grid_znl_T_2D" > sophtvtr - sopstove  </field>
-       </field_group>
-
-       <field_group id="constant_fields"  grid_ref="grid_T_2D"  operation="once" >
-         <field id="bathy"       long_name="Sea floor depth below geoid"               standard_name="sea_floor_depth_below_geoid"               unit="m"/>
-         <field id="areacello"   long_name="Horizontal area of ocean grid cells"       standard_name="cell_area"                                 unit="m2" />
-         <field id="hfgeou"      long_name="Upward geothermal heat flux at sea floor"  standard_name="upward_geothermal_heat_flux_at_sea_floor"  unit="W/m2"/>
-         <field id="basins"      long_name="ocean tracer region masks"                 standard_name="ocean_tracer_region_masks"   unit="none" grid_ref="grid_basin"  />
-       </field_group>
-
-
-    <!--
-============================================================================================================
-                  Physical ocean model trend diagnostics : temperature, KE, PE, momentum
-============================================================================================================
-    -->
-
-   <!-- variables available with ln_tra_trd -->
-   <!-- Asselin trends  calculated on odd time steps-->
-   <field_group id="trendT_odd"  grid_ref="grid_T_3D">
-     <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" />
-     <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" />
-     <!-- Thickness weighted versions: -->
-     <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field>
-     <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field>
-     <!-- OMIP  layer-integrated trends -->
-     <field id="ttrd_atf_li"      long_name="layer integrated heat-trend: asselin time filter "       unit="W/m^2" > ttrd_atf_e3t * 1026.0 * 3991.86795711963  </field>
-     <field id="strd_atf_li"      long_name="layer integrated salt   -trend: asselin time filter "       unit="kg/(m^2 s)" > strd_atf_e3t * 1026.0 * 0.001 </field>
-   </field_group>
-
-   <!-- Other trends  calculated on even time steps-->
-   <field_group id="trendT_even" grid_ref="grid_T_3D">
-     <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        />
-     <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        />
-     <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        />
-     <field id="strd_yad"      long_name="salinity   -trend: j-advection"                                                                                          unit="1e-3/s"                        />
-     <field id="ttrd_zad"      long_name="temperature-trend: k-advection"                                                                                          unit="degC/s"                        />
-     <field id="strd_zad"      long_name="salinity   -trend: k-advection"                                                                                          unit="1e-3/s"                        />
-     <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field>
-     <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field>
-     <field id="ttrd_totad"    long_name="temperature-trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="degC/s"                        />
-     <field id="strd_totad"    long_name="salinity   -trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                        />
-     <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (linssh true)"                                                                           unit="degC/s"   grid_ref="grid_T_2D" />
-     <field id="strd_sad"      long_name="salinity   -trend: surface adv. (linssh true)"                                                                           unit="1e-3/s"   grid_ref="grid_T_2D" />
-     <field id="ttrd_ldf"      long_name="temperature-trend: lateral  diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_horizontal_mixing"   unit="degC/s"                        />
-     <field id="strd_ldf"      long_name="salinity   -trend: lateral  diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_horizontal_mixing"      unit="1e-3/s"                        />
-     <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        />
-     <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        />
-     <field id="ttrd_evd"      long_name="temperature-trend: EVD convection"                                                                                       unit="degC/s"                        />
-     <field id="strd_evd"      long_name="salinity   -trend: EVD convection"                                                                                       unit="1e-3/s"                        />
-
-     <!-- ln_traldf_iso=T only (iso-neutral diffusion) -->
-     <field id="ttrd_iso"      long_name="temperature-trend: isopycnal diffusion"                             unit="degC/s" > ttrd_ldf + ttrd_zdf - ttrd_zdfp </field>
-     <field id="strd_iso"      long_name="salinity   -trend: isopycnal diffusion"                             unit="1e-3/s" > strd_ldf + strd_zdf - strd_zdfp </field>
-     <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" />
-     <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" />
-
-     <!-- ln_zdfosm=T only (OSMOSIS-OBL) -->
-     <field id="ttrd_osm"      long_name="temperature-trend: OSM-OSBL non-local forcing"                             unit="degC/s" />
-     <field id="strd_osm"      long_name="salinity   -trend: OSM-OSBL non-local forcing"                             unit="1e-3/s" />
+  </field_group> <!-- ABL -->
+
+
+  <!-- U grid -->
+
+  <field_group id="grid_U"   grid_ref="grid_U_2D">
+    <field id="hu"            long_name="water column height at U point"                         standard_name="water_column_height_U"       unit="m" />
+    <field id="e2u"           long_name="U-cell width in meridional direction"                   standard_name="cell_width"                  unit="m"                               />
+    <field id="e3u"           long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" />
+    <field id="e3u_0"         long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/>
+    <field id="utau"          long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            />
+    <field id="uoce"          long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" />
+    <field id="uoce_e3u"      long_name="ocean current along i-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_U_3D"  > uoce * e3u </field>
+    <field id="uoce_e3u_vsum" long_name="ocean current along i-axis * e3u summed on the vertical"  field_ref="uoce_e3u"    unit="m3/s"       grid_ref="grid_U_vsum"/>
+    <field id="uocetr_vsum"   long_name="ocean transport along i-axis  summed on the vertical"         field_ref="e2u"       unit="m3/s"> this * uoce_e3u_vsum  </field>
+
+    <field id="uocetr_vsum_op"    long_name="ocean current along i-axis * e3u * e2u summed on the vertical"  read_access="true"  freq_op="1mo"    field_ref="e2u"       unit="m3/s"> @uocetr_vsum </field>
+    <field id="uocetr_vsum_cumul" long_name="ocean current along i-axis * e3u * e2u cumulated from southwest point" freq_offset="_reset_" operation="instant" freq_op="1mo"  unit="m3/s" />
+    <field id="msftbarot"         long_name="ocean_barotropic_mass_streamfunction"   unit="kg s-1" > uocetr_vsum_cumul * $rho0 </field>
+
+
+    <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             />
+    <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                             />
+    <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             />
+    <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" />
+    <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" />
+    <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" />
+    <field id="ssuww"        long_name="ocean surface wind work along i-axis"                   standard_name="surface_x_wind_work"         unit="N/m*s"                            > utau * ssu </field>
+    <!-- AGRIF sponge -->
+    <field id="agrif_spu"    long_name=" AGRIF u-sponge coefficient"   unit=" " />
+    <!-- u-eddy diffusivity coefficients (available if ln_traldf_OFF=F) -->
+    <field id="ahtu_2d"      long_name=" surface u-eddy diffusivity coefficient"   unit="m2/s or m4/s" />
+    <field id="ahtu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s or m4/s"      grid_ref="grid_U_3D"/>
+    <!-- u-eiv diffusivity coefficients (available if ln_ldfeiv=F) -->
+    <field id="aeiu_2d"      long_name=" surface u-EIV coefficient"                unit="m2/s" />
+    <field id="aeiu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s"              grid_ref="grid_U_3D"/>
+
+    <!-- variables available with MLE (ln_mle=T) -->
+    <field id="psiu_mle"     long_name="MLE streamfunction along i-axis"   unit="m3/s"   grid_ref="grid_U_3D" />
+
+    <!-- uoce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T) -->
+    <field id="uoce_eiv"      long_name="EIV ocean current along i-axis"                                  standard_name="bolus_sea_water_x_velocity"                     unit="m/s"   grid_ref="grid_U_3D" />
+    <field id="ueiv_masstr"   long_name="EIV Ocean Mass X Transport"                                      standard_name="bolus_ocean_mass_x_transport"                   unit="kg/s"  grid_ref="grid_U_3D" />
+    <field id="ueiv_heattr"   long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"                         />
+    <field id="ueiv_salttr"   long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="Kg"                        />
+    <field id="ueiv_heattr3d" long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"     grid_ref="grid_U_3D" />
+    <field id="ueiv_salttr3d" long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="kg"    grid_ref="grid_U_3D" />
+
+    <!-- uoce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 -->
+    <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  />
+    <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 -->
+    <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" />
+
+    <!-- variables available with WAVE (ln_wave=T) -->
+    <field id="ustokes"      long_name="Stokes Drift Velocity i-axis"      standard_name="StokesDrift_x_velocity"      unit="m/s"        grid_ref="grid_U_3D" />
+    <field id="ustokes_e3u"  long_name="Stokes Drift Velocity i-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_U_3D"  > ustokes * e3u </field>
+
+    <!-- variable for ice shelves -->
+    <field id="utbl"         long_name="zonal current in the Losh tbl"     unit="m/s" />
+
+    <!-- variables available with diaar5 -->
+    <field id="u_masstr"      long_name="Ocean Mass X Transport"                                          standard_name="ocean_mass_x_transport"                         unit="kg/s"  grid_ref="grid_U_3D" />
+    <field id="u_masstr_vint" long_name="vertical integral of ocean eulerian mass transport along i-axis" standard_name="vertical_integral_of_ocean_mass_x_transport"    unit="kg/s"                      />
+    <field id="u_heattr"      long_name="ocean eulerian heat transport along i-axis"                      standard_name="ocean_heat_x_transport"                         unit="W"                         />
+    <field id="u_salttr"      long_name="ocean eulerian salt transport along i-axis"                      standard_name="ocean_salt_x_transport"                         unit="1e-3*kg/s"                 />
+    <field id="uadv_heattr"   long_name="ocean advective heat transport along i-axis"                     standard_name="advectice_ocean_heat_x_transport"               unit="W"                         />
+    <field id="uadv_salttr"   long_name="ocean advective salt transport along i-axis"                     standard_name="advectice_ocean_salt_x_transport"               unit="1e-3*kg/s"                 />
+    <field id="udiff_heattr"  long_name="ocean diffusion heat transport along i-axis"                     standard_name="ocean_heat_x_transport_due_to_diffusion"        unit="W"                         />
+    <field id="udiff_salttr"  long_name="ocean diffusion salt transport along i-axis"                     standard_name="ocean_salt_x_transport_due_to_diffusion"        unit="1e-3*kg/s"                 />
+  </field_group>
+
+  <!-- V grid -->
+
+  <field_group id="grid_V"   grid_ref="grid_V_2D">
+    <field id="e1v"          long_name="V-cell width in longitudinal direction"                 standard_name="cell_width"                  unit="m"                              />
+    <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" />
+    <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D" />
+    <field id="hv"            long_name="water column height at V point"                        standard_name="water_column_height_V"       unit="m" />
+    <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            />
+    <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" />
+    <field id="voce_e3v"     long_name="ocean current along j-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_V_3D"  > voce * e3v </field>
+    <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             />
+    <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                             />
+    <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             />
+    <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" />
+    <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" />
+    <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" />
+    <field id="ssvww"        long_name="ocean surface wind work along j-axis"                   standard_name="surface_y_wind_work"         unit="N/m*s"                            > vtau * ssv </field>
+    <!-- AGRIF sponge -->
+    <field id="agrif_spv"    long_name=" AGRIF v-sponge coefficient"   unit=" " />
+    <!-- v-eddy diffusivity coefficients (available if ln_traldf_OFF=F) -->
+    <field id="ahtv_2d"      long_name=" surface v-eddy diffusivity coefficient"     unit="m2/s or (m4/s)^1/2" />
+    <field id="ahtv_3d"      long_name=" 3D v-eddy diffusivity coefficient"          unit="m2/s or (m4/s)^1/2"           grid_ref="grid_V_3D"/>
+    <!-- v-eiv diffusivity coefficients (available if ln_ldfeiv=F) -->
+    <field id="aeiv_2d"      long_name=" surface v-EIV coefficient"                  unit="m2/s" />
+    <field id="aeiv_3d"      long_name=" 3D v-EIV coefficient"                       unit="m2/s"                         grid_ref="grid_V_3D" />
+
+    <!-- variables available with MLE (ln_mle=T) -->
+    <field id="psiv_mle"     long_name="MLE streamfunction along j-axis"   unit="m3/s"   grid_ref="grid_V_3D" />
+
+    <!-- voce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T)  -->
+    <field id="voce_eiv"     long_name="EIV ocean current along j-axis"  standard_name="bolus_sea_water_y_velocity"     unit="m/s"   grid_ref="grid_V_3D" />
+    <field id="veiv_masstr"  long_name="EIV Ocean Mass Y Transport"      standard_name="bolus_ocean_mass_y_transport"   unit="kg/s"  grid_ref="grid_V_3D" />
+    <field id="veiv_heattr"   long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                         />
+    <field id="veiv_salttr"   long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="Kg"                        />
+    <field id="veiv_heattr3d" long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_V_3D" />
+    <field id="veiv_salttr3d" long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_V_3D" />
+
+
+    <!-- voce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 -->
+    <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  />
+    <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 -->
+    <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" />
+
+    <!-- variables available with WAVE (ln_wave=T) -->
+    <field id="vstokes"      long_name="Stokes Drift Velocity j-axis"      standard_name="StokesDrift_y_velocity"      unit="m/s"        grid_ref="grid_V_3D" />
+    <field id="vstokes_e3v"  long_name="Stokes Drift Velocity j-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_V_3D"  > vstokes * e3v </field>
+
+    <!-- variable for ice shelves -->
+    <field id="vtbl"         long_name="meridional current in the Losh tbl"   unit="m/s" />
+
+    <!-- variables available with diaar5 -->
+    <field id="v_masstr"      long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s" grid_ref="grid_V_3D" />
+    <field id="v_heattr"      long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                         />
+    <field id="v_salttr"      long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                 />
+    <field id="vadv_heattr"   long_name="ocean advective heat transport along j-axis"   standard_name="advectice_ocean_heat_y_transport"                unit="W"                         />
+    <field id="vadv_salttr"   long_name="ocean advective salt transport along j-axis"   standard_name="advectice_ocean_salt_y_transport"                unit="1e-3*kg/s"                 />
+    <field id="vdiff_heattr"  long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                         />
+    <field id="vdiff_salttr"  long_name="ocean diffusion salt transport along j-axis"   standard_name="ocean_salt_y_transport_due_to_diffusion"         unit="1e-3*kg/s"                 />
+  </field_group>
+
+  <!-- W grid -->
+
+  <field_group id="grid_W" grid_ref="grid_W_3D">
+    <field id="e3w"          long_name="W-cell thickness"                              standard_name="cell_thickness"                         unit="m"    />
+    <field id="woce"         long_name="ocean vertical velocity"                       standard_name="upward_sea_water_velocity"              unit="m/s"  />
+    <field id="woce_e3w"     long_name="ocean vertical velocity * e3w"                                                                        unit="m2/s"  > woce * e3w </field>
+    <field id="wocetr_eff"   long_name="effective ocean vertical transport"                                                                   unit="m3/s" />
+
+    <!-- woce_eiv: available with EIV  (ln_ldfeiv=T and ln_ldfeiv_dia=T)  -->
+    <field id="woce_eiv"     long_name="EIV ocean vertical velocity"                    standard_name="bolus_upward_sea_water_velocity"       unit="m/s"  />
+    <field id="weiv_masstr"  long_name="EIV Upward Ocean Mass Transport"  standard_name="bolus_upward_ocean_mass_transport"             unit="kg/s"   />
+    <field id="weiv_heattr3d" long_name="ocean bolus heat transport"    standard_name="ocean_heat_z_transport_due_to_bolus_advection"   unit="W"    />
+    <field id="weiv_salttr3d" long_name="ocean bolus salt transport"    standard_name="ocean_salt_z_transport_due_to_bolus_advection"   unit="kg"   />
+
+    <field id="avt"          long_name="vertical eddy diffusivity"                      standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+    <field id="avt_e3w"      long_name="vertical heat diffusivity * e3w"                unit="m3/s" > avt * e3w </field>
+    <field id="logavt"       long_name="logarithm of vertical eddy diffusivity"         standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+    <field id="avm"          long_name="vertical eddy viscosity"                        standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" />
+    <field id="avm_e3w"      long_name="vertical eddy viscosity * e3w"   unit="m3/s" > avm * e3w </field>
+
+    <!-- avs: /= avt with ln_zdfddm=T -->
+    <field id="avs"          long_name="salt vertical eddy diffusivity"                 standard_name="ocean_vertical_salt_diffusivity"       unit="m2/s" />
+    <field id="avs_e3w"      long_name="vertical salt diffusivity * e3w"   unit="m3/s" > avs * e3w </field>
+    <field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"    standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+
+    <!-- avt_evd and avm_evd: available with ln_zdfevd -->
+    <field id="avt_evd"      long_name="convective enhancement of vertical diffusivity" standard_name="ocean_vertical_tracer_diffusivity_due_to_convection"     unit="m2/s" />
+    <field id="avt_evd_e3w"  long_name="convective enhancement to vertical diffusivity * e3w "    unit="m3/s" > avt_evd * e3w </field>
+    <field id="avm_evd"      long_name="convective enhancement of vertical viscosity"   standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" />
+
+    <!-- mf_app and mf_wp: available with ln_zdfmfc -->
+    <field id="mf_app"      long_name="convective area"        standard_name="mf_convective_area"    unit="%"      grid_ref="grid_W_3D" />
+    <field id="mf_wp"       long_name="convective velocity"    standard_name="mf_convective_velo"    unit="m/s"    grid_ref="grid_W_3D" />
+
+
+    <!-- avt_tide: available with ln_zdfiwm=T -->
+    <field id="av_ratio"     long_name="S over T diffusivity ratio"                     standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    />
+    <field id="av_wave"      long_name="internal wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" />
+    <field id="bflx_iwm"     long_name="internal wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" />
+    <field id="pcmap_iwm"    long_name="power consumed by wave-driven mixing"           standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" />
+    <field id="emix_iwm"     long_name="power density available for mixing"             standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" />
+
+    <!-- variables available with WAVE (ln_wave=T) -->
+    <field id="wstokes"      long_name="Stokes Drift vertical velocity"                 standard_name="upward_StokesDrift_velocity"   unit="m/s" />
+
+    <!-- variables available with diaar5 -->
+    <field id="w_masstr"     long_name="vertical mass transport"                        standard_name="upward_ocean_mass_transport"             unit="kg/s"   />
+    <field id="w_masstr2"    long_name="square of vertical mass transport"              standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" />
+
+    <!-- EOS -->
+    <field id="bn2"          long_name="squared Brunt-Vaisala frequency"                unit="s-2" />
+
+  </field_group>
+
+  <!-- F grid -->
+  <field_group id="grid_F" grid_ref="grid_F_2D">
+    <field id="e3f"          long_name="F-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_F_3D" />
+    <field id="e3f_0"        long_name="F-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_F_3D" />
+    <field id="hf"           long_name="water column height at F point"    standard_name="water_column_height_F"  unit="m"                     />
+    <field id="sKEf"         long_name="surface kinetic energy at F point" standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2" />
+    <field id="relvor"       long_name="relative vorticity"                standard_name="relative_vorticity"     unit="1/s"                   />
+    <field id="plavor"       long_name="planetary vorticity"               standard_name="planetary_vorticity"    unit="1/s"                   />
+    <field id="relpotvor"    long_name="relative potential vorticity"      standard_name="relpot_vorticity"       unit="1/m.s"                 />
+    <field id="abspotvor"    long_name="absolute potential vorticity"      standard_name="abspot_vorticity"       unit="1/m.s"                 />
+    <field id="Ens"          long_name="enstrophy"                         standard_name="enstrophy"              unit="1/m2.s2"               />
+  </field_group>
+
+  <!-- AGRIF sponge -->
+  <field id="agrif_spf"    long_name=" AGRIF f-sponge coefficient"   unit=" " />
+  <!-- f-eddy viscosity coefficients (ldfdyn) -->
+  <field id="ahmf_2d"      long_name=" surface f-eddy viscosity coefficient"   unit="m2/s or m4/s" />
+  <field id="ahmf_3d"      long_name=" 3D      f-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/>
+
+  <field_group id="scalar"  grid_ref="grid_scalar"  >
+    <!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly -->
+    <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   />
+    <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    />
+    <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    />
+    <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    />
+    <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   />
+    <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" />
+    <field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" />
+    <field id="ssttot"     long_name="global mean sea surface temperature"          standard_name="sea_water_conservative_temperature"             unit="degC" />
+    <!-- EOS = TEOS-10 -->
+    <field id="temptot_pot" long_name="global mean potential temperature"            standard_name="sea_water_potential_temperature"               unit="degC" />
+
+    <!-- available with ln_diahsb -->
+    <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     />
+    <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     />
+    <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   />
+    <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     />
+    <field id="bgsaltco"     long_name="drift in global mean salt content wrt timestep 1"                                                                                      unit="1e-3*km3" />
+    <field id="bgvolssh"     long_name="drift in global mean ssh volume wrt timestep 1"                                                                                        unit="km3"      />
+    <field id="bgvole3t"     long_name="drift in global mean volume variation (e3t) wrt timestep 1"                                                                            unit="km3"      />
+    <field id="bgfrcvol"     long_name="global mean volume from forcing"                                                                                                       unit="km3"      />
+    <field id="bgfrctem"     long_name="global mean heat content from forcing"                                                                                                 unit="1.e20J"   />
+    <field id="bgfrchfx"     long_name="global mean heat flux from forcing"                                                                                                    unit="W/m2"     />
+    <field id="bgfrcsal"     long_name="global mean salt content from forcing"                                                                                                 unit="1e-3*km3" />
+    <field id="bgmistem"     long_name="global mean temperature error due to free surface (linssh true)"                                                                       unit="degC"     />
+    <field id="bgmissal"     long_name="global mean salinity error due to free surface (linssh true)"                                                                          unit="1e-3"     />
+  </field_group>
+
+
+  <!-- transects -->
+  <field_group id="oce_straits">
+    <field id="uoce_e3u_ave"         long_name="Monthly average of u*e3u"                        field_ref="uoce_e3u"                    freq_op="1mo"   freq_offset="_reset_" > @uoce_e3u </field>
+    <field id="uoce_e3u_ave_vsum"    long_name="Vertical sum of u*e3u"                           field_ref="uoce_e3u_ave"         grid_ref="grid_U_vsum"     />
+    <field id="uocetr_vsum_section"  long_name="Total 2D transport in i-direction"               field_ref="uoce_e3u_ave_vsum"    grid_ref="grid_U_scalar"  detect_missing_value="true"> this * e2u </field>
+    <field id="uocetr_strait"        long_name="Total transport across lines in i-direction"     field_ref="uocetr_vsum_section"  grid_ref="grid_U_4strait" />
+    <field id="u_masstr_strait"      long_name="Sea water transport across line in i-direction"  field_ref="uocetr_strait"        grid_ref="grid_U_4strait_hsum" unit="kg/s"> this * maskMFO_u * $rho0 </field>
+
+    <field id="voce_e3v_ave"         long_name="Monthly average of v*e3v"                        field_ref="voce_e3v"                    freq_op="1mo"   freq_offset="_reset_" > @voce_e3v </field>
+    <field id="voce_e3v_ave_vsum"    long_name="Vertical sum of v*e3v"                           field_ref="voce_e3v_ave"         grid_ref="grid_V_vsum"      />
+    <field id="vocetr_vsum_section"  long_name="Total 2D transport of in j-direction"            field_ref="voce_e3v_ave_vsum"    grid_ref="grid_V_scalar"  detect_missing_value="true"> this * e1v </field>
+    <field id="vocetr_strait"        long_name="Total transport across lines in j-direction"     field_ref="vocetr_vsum_section"  grid_ref="grid_V_4strait"  />
+    <field id="v_masstr_strait"      long_name="Sea water transport across line in j-direction"  field_ref="vocetr_strait"        grid_ref="grid_V_4strait_hsum" unit="kg/s"> this * maskMFO_v * $rho0 </field>
+
+    <field id="masstr_strait"        long_name="Sea water transport across line"                                                  grid_ref="grid_4strait"  > u_masstr_strait + v_masstr_strait </field>
+  </field_group>
+
+  <!-- variables available with ln_floats -->
+
+  <field_group id="floatvar" grid_ref="grid_T_nfloat"  operation="instant" >
+    <field id="traj_lon"      long_name="floats longitude"                                                           unit="degrees_east"  />
+    <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" />
+    <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             />
+    <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          />
+    <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          />
+    <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         />
+    <field id="traj_group"    long_name="floats group"                                                               unit="1"             />
+  </field_group>
+
+  <!-- variables available with iceberg trajectories -->
+
+  <field_group id="icbvar" domain_ref="grid_T"  >
+    <field id="berg_melt"          long_name="icb melt rate of icebergs"                       unit="kg/m2/s"                    />
+    <field id="berg_melt_hcflx"    long_name="icb heat flux to ocean due to melting heat content"   unit="J/m2/s"                />
+    <field id="berg_melt_qlat"     long_name="icb heat flux to ocean due to melting latent heat"    unit="J/m2/s"                />
+    <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"     unit="kg/m2/s"                    />
+    <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"      unit="kg/m2/s"                    />
+    <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate"   unit="kg/m2/s"                    />
+    <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"                unit="m2"                         />
+    <field id="bits_src"           long_name="icb mass source of bergy bits"                   unit="kg/m2/s"                    />
+    <field id="bits_melt"          long_name="icb melt rate of bergy bits"                     unit="kg/m2/s"                    />
+    <field id="bits_mass"          long_name="icb bergy bit density field"                     unit="kg/m2"                      />
+    <field id="berg_mass"          long_name="icb iceberg density field"                       unit="kg/m2"                      />
+    <field id="calving"            long_name="icb calving mass input"                          unit="kg/s"                       />
+    <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"                unit="kg/m2/s"                    />
+    <field id="berg_real_calving"  long_name="icb calving into iceberg class"                  unit="kg/s"     axis_ref="icbcla" />
+    <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"               unit="kg"       axis_ref="icbcla" />
+  </field_group>
+
+  <!-- Poleward transport : ptr -->
+  <field_group id="diaptr" >
+    <field id="zomsf"         long_name="Overturning Stream-Function : All basins"                     unit="Sv"         grid_ref="grid_znl_W_3D" />
+    <field id="zotem"         long_name="Zonal Mean Temperature : All basins"                          unit="degree_C"   grid_ref="grid_znl_T_3D" />
+    <field id="zosal"         long_name="Zonal Mean Salinity : All basins"                             unit="0.001"      grid_ref="grid_znl_T_3D" />
+    <field id="zosrf"         long_name="Zonal Mean Surface : All basins"                              unit="m2"         grid_ref="grid_znl_T_3D" />
+    <field id="sophtove"      long_name="Overturning Heat Transport: All basins"                       unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopstove"      long_name="Overturning Salt Transport: All basins"                       unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophtbtr"      long_name="Barotropic Heat Transport: All basins"                        unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopstbtr"      long_name="Barotropic Salt Transport: All basins"                        unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophtadv"      long_name="Advective Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopstadv"      long_name="Advective Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophtldf"      long_name="Diffusive Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopstldf"      long_name="Diffusive Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophtvtr"      long_name="Heat Transport : All basins"                                  unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopstvtr"      long_name="Salt Transport : All basins"                                  unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophteiv"      long_name="Heat Transport from mesoscale eddy advection: All basins"     unit="PW"         grid_ref="grid_znl_T_2D" />
+    <field id="sopsteiv"      long_name="Salt Transport from mesoscale eddy advection : All basins"    unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sopstadv"      long_name="Advective Salt Transport"                                     unit="Giga g/s"   grid_ref="grid_znl_T_2D" />
+    <field id="sophtgyre"     long_name="Overturning heat transport due to gyre" field_ref="sophtove"  unit="W"          grid_ref="grid_znl_T_2D" > sophtvtr - sophtove  </field>
+    <field id="sopstgyre"     long_name="Overturning salt transport due to gyre" field_ref="sopstove"  unit="kg/s"       grid_ref="grid_znl_T_2D" > sophtvtr - sopstove  </field>
+  </field_group>
+
+  <field_group id="constant_fields"  grid_ref="grid_T_2D"  operation="once" >
+    <field id="bathy"       long_name="Sea floor depth below geoid"               standard_name="sea_floor_depth_below_geoid"               unit="m"/>
+    <field id="areacello"   long_name="Horizontal area of ocean grid cells"       standard_name="cell_area"                                 unit="m2" />
+    <field id="hfgeou"      long_name="Upward geothermal heat flux at sea floor"  standard_name="upward_geothermal_heat_flux_at_sea_floor"  unit="W/m2"/>
+    <field id="basins"      long_name="ocean tracer region masks"                 standard_name="ocean_tracer_region_masks"   unit="none" grid_ref="grid_basin"  />
+  </field_group>
+
+
+  <!--
+      ============================================================================================================
+      Physical ocean model trend diagnostics : temperature, KE, PE, momentum
+      ============================================================================================================
+  -->
+
+  <!-- variables available with ln_tra_trd -->
+  <!-- Asselin trends  calculated on odd time steps-->
+  <field_group id="trendT_odd"  grid_ref="grid_T_3D">
+    <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" />
+    <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" />
+    <!-- Thickness weighted versions: -->
+    <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field>
+    <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field>
+    <!-- OMIP  layer-integrated trends -->
+    <field id="ttrd_atf_li"      long_name="layer integrated heat-trend: asselin time filter "       unit="W/m^2" > ttrd_atf_e3t * 1026.0 * 3991.86795711963  </field>
+    <field id="strd_atf_li"      long_name="layer integrated salt   -trend: asselin time filter "       unit="kg/(m^2 s)" > strd_atf_e3t * 1026.0 * 0.001 </field>
+  </field_group>
+
+  <!-- Other trends  calculated on even time steps-->
+  <field_group id="trendT_even" grid_ref="grid_T_3D">
+    <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        />
+    <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        />
+    <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        />
+    <field id="strd_yad"      long_name="salinity   -trend: j-advection"                                                                                          unit="1e-3/s"                        />
+    <field id="ttrd_zad"      long_name="temperature-trend: k-advection"                                                                                          unit="degC/s"                        />
+    <field id="strd_zad"      long_name="salinity   -trend: k-advection"                                                                                          unit="1e-3/s"                        />
+    <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field>
+    <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field>
+    <field id="ttrd_totad"    long_name="temperature-trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="degC/s"                        />
+    <field id="strd_totad"    long_name="salinity   -trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                        />
+    <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (linssh true)"                                                                           unit="degC/s"   grid_ref="grid_T_2D" />
+    <field id="strd_sad"      long_name="salinity   -trend: surface adv. (linssh true)"                                                                           unit="1e-3/s"   grid_ref="grid_T_2D" />
+    <field id="ttrd_ldf"      long_name="temperature-trend: lateral  diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_horizontal_mixing"   unit="degC/s"                        />
+    <field id="strd_ldf"      long_name="salinity   -trend: lateral  diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_horizontal_mixing"      unit="1e-3/s"                        />
+    <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        />
+    <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        />
+    <field id="ttrd_evd"      long_name="temperature-trend: EVD convection"                                                                                       unit="degC/s"                        />
+    <field id="strd_evd"      long_name="salinity   -trend: EVD convection"                                                                                       unit="1e-3/s"                        />
+
+    <!-- ln_traldf_iso=T only (iso-neutral diffusion) -->
+    <field id="ttrd_iso"      long_name="temperature-trend: isopycnal diffusion"                             unit="degC/s" > ttrd_ldf + ttrd_zdf - ttrd_zdfp </field>
+    <field id="strd_iso"      long_name="salinity   -trend: isopycnal diffusion"                             unit="1e-3/s" > strd_ldf + strd_zdf - strd_zdfp </field>
+    <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" />
+    <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" />
+
+    <!-- ln_zdfosm=T only (OSMOSIS-OBL) -->
+    <field id="ttrd_osm"      long_name="temperature-trend: OSM-OSBL non-local forcing"                             unit="degC/s" />
+    <field id="strd_osm"      long_name="salinity   -trend: OSM-OSBL non-local forcing"                             unit="1e-3/s" />
 
 
     <!-- -->
-     <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" />
-     <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" />
-     <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" />
-     <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" />
-     <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" />
-     <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" />
-     <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D" />
-     <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D" />
-     <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" />
-     <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" />
-
-     <!-- Thickness weighted versions: -->
-     <field id="ttrd_xad_e3t"      unit="degC/s * m" >  ttrd_xad * e3t </field>
-     <field id="strd_xad_e3t"      unit="1e-3/s * m" >  strd_xad * e3t </field>
-     <field id="ttrd_yad_e3t"      unit="degC/s * m" >  ttrd_yad * e3t </field>
-     <field id="strd_yad_e3t"      unit="1e-3/s * m" >  strd_yad * e3t </field>
-     <field id="ttrd_zad_e3t"      unit="degC/s * m" >  ttrd_zad * e3t </field>
-     <field id="strd_zad_e3t"      unit="1e-3/s * m" >  strd_zad * e3t </field>
-     <field id="ttrd_ad_e3t"       unit="degC/s * m" >  ttrd_ad  * e3t </field>
-     <field id="strd_ad_e3t"       unit="1e-3/s * m" >  strd_ad  * e3t </field>
-     <field id="ttrd_totad_e3t"    unit="degC/s * m" >  ttrd_totad  * e3t </field>
-     <field id="strd_totad_e3t"    unit="1e-3/s * m" >  strd_totad  * e3t </field>
-     <field id="ttrd_ldf_e3t"      unit="degC/s * m" >  ttrd_ldf * e3t </field>
-     <field id="strd_ldf_e3t"      unit="1e-3/s * m" >  strd_ldf * e3t </field>
-     <field id="ttrd_zdf_e3t"      unit="degC/s * m" >  ttrd_zdf * e3t </field>
-     <field id="strd_zdf_e3t"      unit="1e-3/s * m" >  strd_zdf * e3t </field>
-     <field id="ttrd_evd_e3t"      unit="degC/s * m" >  ttrd_evd * e3t </field>
-     <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field>
-
-     <!-- ln_traldf_iso=T only (iso-neutral diffusion) -->
-     <field id="ttrd_iso_e3t"      unit="degC/s * m"  >  ttrd_iso * e3t </field>
-     <field id="strd_iso_e3t"      unit="1e-3/s * m"  >  strd_iso * e3t </field>
-     <field id="ttrd_zdfp_e3t"     unit="degC/s * m"  >  ttrd_zdfp * e3t </field>
-     <field id="strd_zdfp_e3t"     unit="1e-3/s * m"  >  strd_zdfp * e3t </field>
-
-          <!-- ln_zdfosm=T only (OSMOSIS-OBL) -->
-     <field id="ttrd_osm_e3t"      long_name="temperature-trend: OSM-OSBL non-local forcing"                             unit="degC/s * m" >  ttrd_osm * e3t </field>
-     <field id="strd_osm_e3t"      long_name="salinity   -trend: OSM-OSBL non-local forcing"                             unit="1e-3/s * m" >  strd_osm * e3t </field>
-     
-     <!-- -->
-     <field id="ttrd_dmp_e3t"      unit="degC/s * m"  >  ttrd_dmp * e3t </field>
-     <field id="strd_dmp_e3t"      unit="1e-3/s * m"  >  strd_dmp * e3t </field>
-     <field id="ttrd_bbl_e3t"      unit="degC/s * m"  >  ttrd_bbl * e3t </field>
-     <field id="strd_bbl_e3t"      unit="1e-3/s * m"  >  strd_bbl * e3t </field>
-     <field id="ttrd_npc_e3t"      unit="degC/s * m"  >  ttrd_npc * e3t </field>
-     <field id="strd_npc_e3t"      unit="1e-3/s * m"  >  strd_npc * e3t </field>
-     <field id="ttrd_qns_e3t"      unit="degC/s * m"  >  ttrd_qns * e3ts </field>
-     <field id="strd_cdt_e3t"      unit="degC/s * m"  >  strd_cdt * e3ts </field>
-     <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field>
-     <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field>
-
-     <!-- OMIP  layer-integrated trends -->
-     <field id="ttrd_totad_li"    long_name="layer integrated heat-trend: total advection"         unit="W/m^2"     > ttrd_totad_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_totad_li"    long_name="layer integrated salt-trend: total advection"         unit="kg/(m^2 s)"    > strd_totad_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_osm_li"    long_name="layer integrated heat-trend: non-local OSM"         unit="W/m^2"     > ttrd_osm_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_osm_li"    long_name="layer integrated salt-trend: non-local OSM"         unit="kg/(m^2 s)"    > strd_osm_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: EVD convection"          unit="W/m^2"    > ttrd_evd_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_evd_li"      long_name="layer integrated salt-trend: EVD convection"          unit="kg/(m^2 s)"  > strd_evd_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_iso_li"      long_name="layer integrated heat-trend: isopycnal diffusion"     unit="W/m^2" > ttrd_iso_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_iso_li"      long_name="layer integrated salt-trend: isopycnal diffusion"     unit="kg/(m^2 s)" > strd_iso_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_zdfp_li"     long_name="layer integrated heat-trend: pure vert. diffusion"    unit="W/m^2" > ttrd_zdfp_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_zdfp_li"     long_name="layer integrated salt-trend: pure vert. diffusion"    unit="kg/(m^2 s)" > strd_zdfp_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_qns_li"      long_name="layer integrated heat-trend: non-solar flux + runoff" unit="W/m^2" grid_ref="grid_T_2D"> ttrd_qns_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="ttrd_qsr_li"      long_name="layer integrated heat-trend: solar flux"              unit="W/m^2"  grid_ref="grid_T_3D"> ttrd_qsr_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="ttrd_bbl_li"      long_name="layer integrated heat-trend: bottom boundary layer "  unit="W/m^2" > ttrd_bbl_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_bbl_li"      long_name="layer integrated salt-trend: bottom boundary layer "  unit="kg/(m^2 s)" > strd_bbl_e3t * 1026.0 * 0.001  </field>
-     <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: evd convection "         unit="W/m^2" >ttrd_evd_e3t * 1026.0 * 3991.86795711963  </field>
-     <field id="strd_evd_li"      long_name="layer integrated salt-trend: evd convection "         unit="kg/(m^2 s)" > strd_evd_e3t * 1026.0 * 0.001  </field>
-
-   </field_group>
-
-   <!--  Total trends calculated every time step-->
-   <field_group id="trendT" grid_ref="grid_T_3D">
-     <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" />
-     <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" />
-     <!-- Thickness weighted versions: -->
-     <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field>
-     <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field>
-     <!-- OMIP  layer-integrated total trends -->
-     <field id="ttrd_tot_li"      long_name="layer integrated heat-trend: total model trend :"         unit="W/m^2" > ttrd_tot_e3t * 1026.0 * 3991.86795711963 </field>
-     <field id="strd_tot_li"      long_name="layer integrated salt-trend: total model trend :"         unit="kg/(m^2 s)" > strd_tot_e3t * 1026.0 * 0.001  </field>
-
-     <!-- **** these trends have not been apportioned to all/even/odd ts yet **** -->
-     <!-- variables available with ln_KE_trd -->
-     <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        />
-     <field id="ketrd_spg"     long_name="ke-trend: surface     pressure gradient"          unit="W/s^3"                        />
-     <field id="ketrd_spgexp"  long_name="ke-trend: surface pressure gradient (explicit)"   unit="W/s^3"                        />
-     <field id="ketrd_spgflt"  long_name="ke-trend: surface pressure gradient (filter)"     unit="W/s^3"                        />
-     <field id="ssh_flt"       long_name="filtered contribution to ssh (dynspg_flt)"        unit="m"       grid_ref="grid_T_2D" />
-     <field id="w0"            long_name="surface vertical velocity"                        unit="m/s"     grid_ref="grid_T_2D" />
-     <field id="pw0_exp"       long_name="surface pressure flux due to ssh"                 unit="W/s^2"   grid_ref="grid_T_2D" />
-     <field id="pw0_flt"       long_name="surface pressure flux due to filtered ssh"        unit="W/s^2"   grid_ref="grid_T_2D" />
-     <field id="ketrd_keg"     long_name="ke-trend: KE gradient         or hor. adv."       unit="W/s^3"                        />
-     <field id="ketrd_rvo"     long_name="ke-trend: relative  vorticity or metric term"     unit="W/s^3"                        />
-     <field id="ketrd_pvo"     long_name="ke-trend: planetary vorticity"                    unit="W/s^3"                        />
-     <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        />
-     <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        />
-     <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        />
-     <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        />
-     <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" />
-     <field id="ketrd_bfr"     long_name="ke-trend: bottom friction (explicit)"             unit="W/s^3"                        />
-     <field id="ketrd_bfri"    long_name="ke-trend: bottom friction (implicit)"             unit="W/s^3"                        />
-     <field id="ketrd_atf"     long_name="ke-trend: asselin time filter trend"              unit="W/s^3"                        />
-     <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        />
-     <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />
-
-     <!-- variables available when explicit lateral mixing is used (ln_dynldf_OFF=F) -->
-     <field id="dispkexyfo"    long_name="KE-trend: lateral  mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction"                   unit="W/m^2" grid_ref="grid_T_2D" />
-     <field id="dispkevfo"     long_name="KE-trend: vertical mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction"             unit="W/m^2" grid_ref="grid_T_2D" />
-     <!-- variables available with ln_traadv_eiv=T and ln_diaeiv=T -->
-     <field id="eketrd_eiv"    long_name="EKE-trend due to parameterized eddy advection"   standard_name="tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection"   unit="W/m^2" grid_ref="grid_T_2D" />
-
-     <!-- variables available with ln_PE_trd -->
-     <field id="petrd_xad"     long_name="pe-trend: i-advection"                unit="W/m^3"                        />
-     <field id="petrd_yad"     long_name="pe-trend: j-advection"                unit="W/m^3"                        />
-     <field id="petrd_zad"     long_name="pe-trend: k-advection"                unit="W/m^3"                        />
-     <field id="petrd_sad"     long_name="pe-trend: surface adv. (linssh true)" unit="W/m^3"   grid_ref="grid_T_2D" />
-     <field id="petrd_ldf"     long_name="pe-trend: lateral  diffusion"         unit="W/m^3"                        />
-     <field id="petrd_zdf"     long_name="pe-trend: vertical diffusion"         unit="W/m^3"                        />
-     <field id="petrd_zdfp"    long_name="pe-trend: pure vert. diffusion"       unit="W/m^3"                        />
-     <field id="petrd_dmp"     long_name="pe-trend: interior restoring"         unit="W/m^3"                        />
-     <field id="petrd_bbl"     long_name="pe-trend: bottom boundary layer"      unit="W/m^3"                        />
-     <field id="petrd_npc"     long_name="pe-trend: non-penetrative conv."      unit="W/m^3"                        />
-     <field id="petrd_nsr"     long_name="pe-trend: surface forcing + runoff"   unit="W/m^3"                        />
-     <field id="petrd_qsr"     long_name="pe-trend: solar penetr. heating"      unit="W/m^3"                        />
-     <field id="petrd_bbc"     long_name="pe-trend: geothermal heating"         unit="W/m^3"                        />
-     <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        />
-     <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />
-     <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />
-     <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />
-   </field_group>
-
-   <field_group id="trendU" grid_ref="grid_U_3D">
-     <!-- variables available with ln_dyn_trd -->
-     <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
-     <field id="utrd_spg"       long_name="i-trend: surface     pressure gradient"          unit="m/s^2"                        />
-     <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
-     <field id="utrd_spgflt"    long_name="i-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
-     <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
-     <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
-     <field id="utrd_pvo"       long_name="i-trend: planetary vorticity"                    unit="m/s^2"                        />
-     <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        />
-     <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        />
-     <field id="utrd_ldf"       long_name="i-trend: lateral   diffusion"                    unit="m/s^2"                        />
-     <field id="utrd_zdf"       long_name="i-trend: vertical  diffusion"                    unit="m/s^2"                        />
-     <field id="utrd_tau"       long_name="i-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_U_2D" />
-     <field id="utrd_bfr"       long_name="i-trend: bottom friction (explicit)"             unit="m/s^2"                        />
-     <field id="utrd_bfri"      long_name="i-trend: bottom friction (implicit)"             unit="m/s^2"                        />
-     <field id="utrd_tot"       long_name="i-trend: total momentum trend before atf"        unit="m/s^2"                        />
-     <field id="utrd_atf"       long_name="i-trend: asselin time filter trend"              unit="m/s^2"                        />
-   </field_group>
-
-   <field_group id="trendV" grid_ref="grid_V_3D">
-     <!-- variables available with ln_dyn_trd -->
-     <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
-     <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        />
-     <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
-     <field id="vtrd_spgflt"    long_name="j-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
-     <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
-     <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
-     <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity"                    unit="m/s^2"                        />
-     <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        />
-     <field id="vtrd_vdy"       long_name="i-trend: V.dx[V]"                                unit="m/s^2"                        />
-     <field id="vtrd_ldf"       long_name="j-trend: lateral   diffusion"                    unit="m/s^2"                        />
-     <field id="vtrd_zdf"       long_name="j-trend: vertical  diffusion"                    unit="m/s^2"                        />
-     <field id="vtrd_tau"       long_name="j-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_V_2D" />
-     <field id="vtrd_bfr"       long_name="j-trend: bottom friction (explicit)"             unit="m/s^2"                        />
-     <field id="vtrd_bfri"      long_name="j-trend: bottom friction (implicit)"             unit="m/s^2"                        />
-     <field id="vtrd_tot"       long_name="j-trend: total momentum trend before atf"        unit="m/s^2"                        />
-     <field id="vtrd_atf"       long_name="j-trend: asselin time filter trend"              unit="m/s^2"                        />
-   </field_group>
-
-
-    <!--
-============================================================================================================
-                                        Definitions for iodef_demo.xml
-============================================================================================================
-    -->
-
-    <field_group id="TRD" >
-      <field field_ref="ttrd_totad_li"   name="opottempadvect"  />
-      <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  />
-      <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  />
-      <field field_ref="ttrd_evd_li"     name="opottempevd" />
-      <field field_ref="strd_evd_li"     name="osaltevd" />
-      <field field_ref="ttrd_qns_li"     name="opottempqns"  />
-      <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" />
-      <field field_ref="strd_totad_li"   name="osaltadvect" />
-      <field field_ref="strd_iso_li"     name="osaltpmdiff"  />
-      <field field_ref="strd_zdfp_li"    name="osaltdiff" />
-    </field_group>
-
-    <field_group id="mooring" >
-      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      />
-      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                   />
-      <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity"                 />
-      <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity"                 />
-      <field field_ref="woce"         name="wo"       long_name="sea_water_z_velocity"                 />
-      <field field_ref="avt"          name="difvho"   long_name="ocean_vertical_heat_diffusivity"      />
-      <field field_ref="avm"          name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"  />
-
-      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
-      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
-      <field field_ref="sstgrad"      name="tosgrad"  long_name="module_of_sea_surface_temperature_gradient"    />
-      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
-      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
-      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
-      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
-      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
-      <field field_ref="taum"                                                                                   />
-      <field field_ref="20d"                                                                                    />
-      <field field_ref="mldkz5"                                                                                 />
-      <field field_ref="mldr10_1"                                                                               />
-      <field field_ref="mldr10_3"                                                                               />
-      <field field_ref="mldr0_1"                                                                                />
-      <field field_ref="mldr0_3"                                                                                />
-      <field field_ref="mld_dt02"                                                                               />
-      <field field_ref="topthdep"                                                                               />
-      <field field_ref="pycndep"                                                                                />
-      <field field_ref="tinv"                                                                                   />
-      <field field_ref="depti"                                                                                  />
-      <field field_ref="BLT"          name="blt"      long_name="barrier_layer_thickness"                       />
-      <field field_ref="utau"         name="tauuo"    long_name="surface_downward_x_stress"                     />
-      <field field_ref="vtau"         name="tauvo"    long_name="surface_downward_y_stress"                     />
-    </field_group>
-
-    <field_group id="groupT" >
-      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               />
-      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            />
-      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
-      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
-      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
-      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
-      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
-      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
-      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
-      <field field_ref="taum"                                                                                   />
-      <field field_ref="20d"                                                                                    />
-      <field field_ref="mldkz5"                                                                                 />
-      <field field_ref="mldr10_1"                                                                               />
-      <field field_ref="mldr10_3"                                                                               />
-      <field field_ref="mld_dt02"                                                                               />
-      <field field_ref="topthdep"                                                                               />
-      <field field_ref="pycndep"                                                                                />
-      <field field_ref="tinv"                                                                                   />
-      <field field_ref="depti"                                                                                  />
-      <field field_ref="BLT"          name="blt"      long_name="Barrier Layer Thickness"                       />
-    </field_group>
-
-    <field_group id="groupU" >
-      <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      />
-      <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" />
-    </field_group>
-
-    <field_group id="groupV" >
-      <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      />
-      <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" />
-    </field_group>
-
-    <field_group id="groupW" >
-      <field field_ref="woce"         name="wo"       long_name="ocean vertical velocity"  />
-    </field_group>
-
-    <!-- TMB diagnostic output -->
-    <field_group  id="1h_grid_T_tmb" grid_ref="grid_T_2D" operation="instant">
-      <field id="top_temp"           name="votemper_top"  unit="degC"  />
-      <field id="mid_temp"           name="votemper_mid"  unit="degC"  />
-      <field id="bot_temp"           name="votemper_bot"  unit="degC"  />
-      <field id="top_sal"            name="vosaline_top"  unit="psu"   />
-      <field id="mid_sal"            name="vosaline_mid"  unit="psu"   />
-      <field id="bot_sal"            name="vosaline_bot"  unit="psu"   />
-      <field id="sshnmasked"         name="sossheig"      unit="m"     /> 
-    </field_group>
-
-    <field_group  id="1h_grid_U_tmb" grid_ref="grid_U_2D" operation="instant">
-      <field id="top_u"           name="vozocrtx_top"  unit="m/s"  />
-      <field id="mid_u"           name="vozocrtx_mid"  unit="m/s"  />
-      <field id="bot_u"           name="vozocrtx_bot"  unit="m/s"  />
-      <field id="baro_u"          name="vobtcrtx"      unit="m/s"  />
-    </field_group>
-
-    <field_group  id="1h_grid_V_tmb" grid_ref="grid_V_2D" operation="instant">
-      <field id="top_v"           name="vomecrty_top"  unit="m/s"  />
-      <field id="mid_v"           name="vomecrty_mid"  unit="m/s"  />
-      <field id="bot_v"           name="vomecrty_bot"  unit="m/s"  />
-      <field id="baro_v"          name="vobtcrty"      unit="m/s"  />
-    </field_group>
-
-    <!-- 25h diagnostic output -->
-    <field_group id="25h_grid_T" grid_ref="grid_T_3D" operation="instant">
-      <field id="temper25h"         name="potential temperature 25h mean"    unit="degC" />
-      <field id="tempis25h"         name="insitu temperature 25h mean"    unit="degC" />
-      <field id="salin25h"          name="salinity 25h mean"                 unit="psu"  />
-      <field id="ssh25h"            name="sea surface height 25h mean"  grid_ref="grid_T_2D"      unit="m"    />
-    </field_group>
-
-    <field_group id="25h_grid_U" grid_ref="grid_U_3D" operation="instant" >
-      <field id="vozocrtx25h"         name="i current 25h mean"    unit="m/s"   />
-    </field_group>
-
-    <field_group id="25h_grid_V" grid_ref="grid_V_3D" operation="instant">
-      <field id="vomecrty25h"         name="j current 25h mean"    unit="m/s"    />
-    </field_group>
-
-    <field_group id="25h_grid_W" grid_ref="grid_W_3D" operation="instant">
-      <field id="vovecrtz25h"         name="k current 25h mean"                 unit="m/s"      />
-      <field id="avt25h"              name="vertical diffusivity25h mean"       unit="m2/s" />
-      <field id="avm25h"              name="vertical viscosity 25h mean"        unit="m2/s" />
-      <field id="tke25h"              name="turbulent kinetic energy 25h mean" />
-      <field id="mxln25h"             name="mixing length 25h mean"             unit="m" />
-    </field_group>
-
-    <!--
-============================================================================================================
-    -->
-    <!-- output variables for my configuration (example) -->
-
-    <field_group id="myvarOCE" >
-      <!-- grid T -->
-      <field field_ref="e3t"          name="e3t"      long_name="vertical scale factor"           />
-      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"         />
-      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"            />
-      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"  />
-
-      <!-- grid U -->
-      <field field_ref="e3u"          name="e3u"     long_name="vertical scale factor"            />
-      <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"           />
-
-      <!-- grid V -->
-      <field field_ref="e3v"          name="e3v"     long_name="vertical scale factor"            />
-      <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"           />
-    </field_group>
-
-   </field_definition>
+    <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" />
+    <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" />
+    <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" />
+    <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" />
+    <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" />
+    <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" />
+    <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D" />
+    <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D" />
+    <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" />
+    <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" />
+
+    <!-- Thickness weighted versions: -->
+    <field id="ttrd_xad_e3t"      unit="degC/s * m" >  ttrd_xad * e3t </field>
+    <field id="strd_xad_e3t"      unit="1e-3/s * m" >  strd_xad * e3t </field>
+    <field id="ttrd_yad_e3t"      unit="degC/s * m" >  ttrd_yad * e3t </field>
+    <field id="strd_yad_e3t"      unit="1e-3/s * m" >  strd_yad * e3t </field>
+    <field id="ttrd_zad_e3t"      unit="degC/s * m" >  ttrd_zad * e3t </field>
+    <field id="strd_zad_e3t"      unit="1e-3/s * m" >  strd_zad * e3t </field>
+    <field id="ttrd_ad_e3t"       unit="degC/s * m" >  ttrd_ad  * e3t </field>
+    <field id="strd_ad_e3t"       unit="1e-3/s * m" >  strd_ad  * e3t </field>
+    <field id="ttrd_totad_e3t"    unit="degC/s * m" >  ttrd_totad  * e3t </field>
+    <field id="strd_totad_e3t"    unit="1e-3/s * m" >  strd_totad  * e3t </field>
+    <field id="ttrd_ldf_e3t"      unit="degC/s * m" >  ttrd_ldf * e3t </field>
+    <field id="strd_ldf_e3t"      unit="1e-3/s * m" >  strd_ldf * e3t </field>
+    <field id="ttrd_zdf_e3t"      unit="degC/s * m" >  ttrd_zdf * e3t </field>
+    <field id="strd_zdf_e3t"      unit="1e-3/s * m" >  strd_zdf * e3t </field>
+    <field id="ttrd_evd_e3t"      unit="degC/s * m" >  ttrd_evd * e3t </field>
+    <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field>
+
+    <!-- ln_traldf_iso=T only (iso-neutral diffusion) -->
+    <field id="ttrd_iso_e3t"      unit="degC/s * m"  >  ttrd_iso * e3t </field>
+    <field id="strd_iso_e3t"      unit="1e-3/s * m"  >  strd_iso * e3t </field>
+    <field id="ttrd_zdfp_e3t"     unit="degC/s * m"  >  ttrd_zdfp * e3t </field>
+    <field id="strd_zdfp_e3t"     unit="1e-3/s * m"  >  strd_zdfp * e3t </field>
+
+    <!-- ln_zdfosm=T only (OSMOSIS-OBL) -->
+    <field id="ttrd_osm_e3t"      long_name="temperature-trend: OSM-OSBL non-local forcing"                             unit="degC/s * m" >  ttrd_osm * e3t </field>
+    <field id="strd_osm_e3t"      long_name="salinity   -trend: OSM-OSBL non-local forcing"                             unit="1e-3/s * m" >  strd_osm * e3t </field>
+
+    <!-- -->
+    <field id="ttrd_dmp_e3t"      unit="degC/s * m"  >  ttrd_dmp * e3t </field>
+    <field id="strd_dmp_e3t"      unit="1e-3/s * m"  >  strd_dmp * e3t </field>
+    <field id="ttrd_bbl_e3t"      unit="degC/s * m"  >  ttrd_bbl * e3t </field>
+    <field id="strd_bbl_e3t"      unit="1e-3/s * m"  >  strd_bbl * e3t </field>
+    <field id="ttrd_npc_e3t"      unit="degC/s * m"  >  ttrd_npc * e3t </field>
+    <field id="strd_npc_e3t"      unit="1e-3/s * m"  >  strd_npc * e3t </field>
+    <field id="ttrd_qns_e3t"      unit="degC/s * m"  >  ttrd_qns * e3ts </field>
+    <field id="strd_cdt_e3t"      unit="degC/s * m"  >  strd_cdt * e3ts </field>
+    <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field>
+    <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field>
+
+    <!-- OMIP  layer-integrated trends -->
+    <field id="ttrd_totad_li"    long_name="layer integrated heat-trend: total advection"         unit="W/m^2"     > ttrd_totad_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_totad_li"    long_name="layer integrated salt-trend: total advection"         unit="kg/(m^2 s)"    > strd_totad_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_osm_li"    long_name="layer integrated heat-trend: non-local OSM"         unit="W/m^2"     > ttrd_osm_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_osm_li"    long_name="layer integrated salt-trend: non-local OSM"         unit="kg/(m^2 s)"    > strd_osm_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: EVD convection"          unit="W/m^2"    > ttrd_evd_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_evd_li"      long_name="layer integrated salt-trend: EVD convection"          unit="kg/(m^2 s)"  > strd_evd_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_iso_li"      long_name="layer integrated heat-trend: isopycnal diffusion"     unit="W/m^2" > ttrd_iso_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_iso_li"      long_name="layer integrated salt-trend: isopycnal diffusion"     unit="kg/(m^2 s)" > strd_iso_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_zdfp_li"     long_name="layer integrated heat-trend: pure vert. diffusion"    unit="W/m^2" > ttrd_zdfp_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_zdfp_li"     long_name="layer integrated salt-trend: pure vert. diffusion"    unit="kg/(m^2 s)" > strd_zdfp_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_qns_li"      long_name="layer integrated heat-trend: non-solar flux + runoff" unit="W/m^2" grid_ref="grid_T_2D"> ttrd_qns_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="ttrd_qsr_li"      long_name="layer integrated heat-trend: solar flux"              unit="W/m^2"  grid_ref="grid_T_3D"> ttrd_qsr_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="ttrd_bbl_li"      long_name="layer integrated heat-trend: bottom boundary layer "  unit="W/m^2" > ttrd_bbl_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_bbl_li"      long_name="layer integrated salt-trend: bottom boundary layer "  unit="kg/(m^2 s)" > strd_bbl_e3t * 1026.0 * 0.001  </field>
+    <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: evd convection "         unit="W/m^2" >ttrd_evd_e3t * 1026.0 * 3991.86795711963  </field>
+    <field id="strd_evd_li"      long_name="layer integrated salt-trend: evd convection "         unit="kg/(m^2 s)" > strd_evd_e3t * 1026.0 * 0.001  </field>
+
+  </field_group>
+
+  <!--  Total trends calculated every time step-->
+  <field_group id="trendT" grid_ref="grid_T_3D">
+    <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" />
+    <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" />
+    <!-- Thickness weighted versions: -->
+    <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field>
+    <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field>
+    <!-- OMIP  layer-integrated total trends -->
+    <field id="ttrd_tot_li"      long_name="layer integrated heat-trend: total model trend :"         unit="W/m^2" > ttrd_tot_e3t * 1026.0 * 3991.86795711963 </field>
+    <field id="strd_tot_li"      long_name="layer integrated salt-trend: total model trend :"         unit="kg/(m^2 s)" > strd_tot_e3t * 1026.0 * 0.001  </field>
+
+    <!-- **** these trends have not been apportioned to all/even/odd ts yet **** -->
+    <!-- variables available with ln_KE_trd -->
+    <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        />
+    <field id="ketrd_spg"     long_name="ke-trend: surface     pressure gradient"          unit="W/s^3"                        />
+    <field id="ketrd_spgexp"  long_name="ke-trend: surface pressure gradient (explicit)"   unit="W/s^3"                        />
+    <field id="ketrd_spgflt"  long_name="ke-trend: surface pressure gradient (filter)"     unit="W/s^3"                        />
+    <field id="ssh_flt"       long_name="filtered contribution to ssh (dynspg_flt)"        unit="m"       grid_ref="grid_T_2D" />
+    <field id="w0"            long_name="surface vertical velocity"                        unit="m/s"     grid_ref="grid_T_2D" />
+    <field id="pw0_exp"       long_name="surface pressure flux due to ssh"                 unit="W/s^2"   grid_ref="grid_T_2D" />
+    <field id="pw0_flt"       long_name="surface pressure flux due to filtered ssh"        unit="W/s^2"   grid_ref="grid_T_2D" />
+    <field id="ketrd_keg"     long_name="ke-trend: KE gradient         or hor. adv."       unit="W/s^3"                        />
+    <field id="ketrd_rvo"     long_name="ke-trend: relative  vorticity or metric term"     unit="W/s^3"                        />
+    <field id="ketrd_pvo"     long_name="ke-trend: planetary vorticity"                    unit="W/s^3"                        />
+    <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        />
+    <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        />
+    <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        />
+    <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        />
+    <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" />
+    <field id="ketrd_bfr"     long_name="ke-trend: bottom friction (explicit)"             unit="W/s^3"                        />
+    <field id="ketrd_bfri"    long_name="ke-trend: bottom friction (implicit)"             unit="W/s^3"                        />
+    <field id="ketrd_atf"     long_name="ke-trend: asselin time filter trend"              unit="W/s^3"                        />
+    <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        />
+    <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />
+
+    <!-- variables available when explicit lateral mixing is used (ln_dynldf_OFF=F) -->
+    <field id="dispkexyfo"    long_name="KE-trend: lateral  mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction"                   unit="W/m^2" grid_ref="grid_T_2D" />
+    <field id="dispkevfo"     long_name="KE-trend: vertical mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction"             unit="W/m^2" grid_ref="grid_T_2D" />
+    <!-- variables available with ln_traadv_eiv=T and ln_diaeiv=T -->
+    <field id="eketrd_eiv"    long_name="EKE-trend due to parameterized eddy advection"   standard_name="tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection"   unit="W/m^2" grid_ref="grid_T_2D" />
+
+    <!-- variables available with ln_PE_trd -->
+    <field id="petrd_xad"     long_name="pe-trend: i-advection"                unit="W/m^3"                        />
+    <field id="petrd_yad"     long_name="pe-trend: j-advection"                unit="W/m^3"                        />
+    <field id="petrd_zad"     long_name="pe-trend: k-advection"                unit="W/m^3"                        />
+    <field id="petrd_sad"     long_name="pe-trend: surface adv. (linssh true)" unit="W/m^3"   grid_ref="grid_T_2D" />
+    <field id="petrd_ldf"     long_name="pe-trend: lateral  diffusion"         unit="W/m^3"                        />
+    <field id="petrd_zdf"     long_name="pe-trend: vertical diffusion"         unit="W/m^3"                        />
+    <field id="petrd_zdfp"    long_name="pe-trend: pure vert. diffusion"       unit="W/m^3"                        />
+    <field id="petrd_dmp"     long_name="pe-trend: interior restoring"         unit="W/m^3"                        />
+    <field id="petrd_bbl"     long_name="pe-trend: bottom boundary layer"      unit="W/m^3"                        />
+    <field id="petrd_npc"     long_name="pe-trend: non-penetrative conv."      unit="W/m^3"                        />
+    <field id="petrd_nsr"     long_name="pe-trend: surface forcing + runoff"   unit="W/m^3"                        />
+    <field id="petrd_qsr"     long_name="pe-trend: solar penetr. heating"      unit="W/m^3"                        />
+    <field id="petrd_bbc"     long_name="pe-trend: geothermal heating"         unit="W/m^3"                        />
+    <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        />
+    <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />
+    <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />
+    <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />
+  </field_group>
+
+  <field_group id="trendU" grid_ref="grid_U_3D">
+    <!-- variables available with ln_dyn_trd -->
+    <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
+    <field id="utrd_spg"       long_name="i-trend: surface     pressure gradient"          unit="m/s^2"                        />
+    <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
+    <field id="utrd_spgflt"    long_name="i-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
+    <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
+    <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
+    <field id="utrd_pvo"       long_name="i-trend: planetary vorticity"                    unit="m/s^2"                        />
+    <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        />
+    <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        />
+    <field id="utrd_ldf"       long_name="i-trend: lateral   diffusion"                    unit="m/s^2"                        />
+    <field id="utrd_zdf"       long_name="i-trend: vertical  diffusion"                    unit="m/s^2"                        />
+    <field id="utrd_tau"       long_name="i-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_U_2D" />
+    <field id="utrd_bfr"       long_name="i-trend: bottom friction (explicit)"             unit="m/s^2"                        />
+    <field id="utrd_bfri"      long_name="i-trend: bottom friction (implicit)"             unit="m/s^2"                        />
+    <field id="utrd_tot"       long_name="i-trend: total momentum trend before atf"        unit="m/s^2"                        />
+    <field id="utrd_atf"       long_name="i-trend: asselin time filter trend"              unit="m/s^2"                        />
+  </field_group>
+
+  <field_group id="trendV" grid_ref="grid_V_3D">
+    <!-- variables available with ln_dyn_trd -->
+    <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
+    <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        />
+    <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
+    <field id="vtrd_spgflt"    long_name="j-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
+    <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
+    <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
+    <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity"                    unit="m/s^2"                        />
+    <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        />
+    <field id="vtrd_vdy"       long_name="i-trend: V.dx[V]"                                unit="m/s^2"                        />
+    <field id="vtrd_ldf"       long_name="j-trend: lateral   diffusion"                    unit="m/s^2"                        />
+    <field id="vtrd_zdf"       long_name="j-trend: vertical  diffusion"                    unit="m/s^2"                        />
+    <field id="vtrd_tau"       long_name="j-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_V_2D" />
+    <field id="vtrd_bfr"       long_name="j-trend: bottom friction (explicit)"             unit="m/s^2"                        />
+    <field id="vtrd_bfri"      long_name="j-trend: bottom friction (implicit)"             unit="m/s^2"                        />
+    <field id="vtrd_tot"       long_name="j-trend: total momentum trend before atf"        unit="m/s^2"                        />
+    <field id="vtrd_atf"       long_name="j-trend: asselin time filter trend"              unit="m/s^2"                        />
+  </field_group>
+
+
+  <!--
+      ============================================================================================================
+      Definitions for iodef_demo.xml
+      ============================================================================================================
+  -->
+
+  <field_group id="TRD" >
+    <field field_ref="ttrd_totad_li"   name="opottempadvect"  />
+    <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  />
+    <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  />
+    <field field_ref="ttrd_evd_li"     name="opottempevd" />
+    <field field_ref="strd_evd_li"     name="osaltevd" />
+    <field field_ref="ttrd_qns_li"     name="opottempqns"  />
+    <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" />
+    <field field_ref="strd_totad_li"   name="osaltadvect" />
+    <field field_ref="strd_iso_li"     name="osaltpmdiff"  />
+    <field field_ref="strd_zdfp_li"    name="osaltdiff" />
+  </field_group>
+
+  <field_group id="mooring" >
+    <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      />
+    <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                   />
+    <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity"                 />
+    <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity"                 />
+    <field field_ref="woce"         name="wo"       long_name="sea_water_z_velocity"                 />
+    <field field_ref="avt"          name="difvho"   long_name="ocean_vertical_heat_diffusivity"      />
+    <field field_ref="avm"          name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"  />
+
+    <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
+    <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
+    <field field_ref="sstgrad"      name="tosgrad"  long_name="module_of_sea_surface_temperature_gradient"    />
+    <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
+    <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
+    <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
+    <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
+    <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
+    <field field_ref="taum"                                                                                   />
+    <field field_ref="20d"                                                                                    />
+    <field field_ref="mldkz5"                                                                                 />
+    <field field_ref="mldr10_1"                                                                               />
+    <field field_ref="mldr10_3"                                                                               />
+    <field field_ref="mldr0_1"                                                                                />
+    <field field_ref="mldr0_3"                                                                                />
+    <field field_ref="mld_dt02"                                                                               />
+    <field field_ref="topthdep"                                                                               />
+    <field field_ref="pycndep"                                                                                />
+    <field field_ref="tinv"                                                                                   />
+    <field field_ref="depti"                                                                                  />
+    <field field_ref="BLT"          name="blt"      long_name="barrier_layer_thickness"                       />
+    <field field_ref="utau"         name="tauuo"    long_name="surface_downward_x_stress"                     />
+    <field field_ref="vtau"         name="tauvo"    long_name="surface_downward_y_stress"                     />
+  </field_group>
+
+  <field_group id="groupT" >
+    <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               />
+    <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            />
+    <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
+    <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
+    <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
+    <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
+    <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
+    <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
+    <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
+    <field field_ref="taum"                                                                                   />
+    <field field_ref="20d"                                                                                    />
+    <field field_ref="mldkz5"                                                                                 />
+    <field field_ref="mldr10_1"                                                                               />
+    <field field_ref="mldr10_3"                                                                               />
+    <field field_ref="mld_dt02"                                                                               />
+    <field field_ref="topthdep"                                                                               />
+    <field field_ref="pycndep"                                                                                />
+    <field field_ref="tinv"                                                                                   />
+    <field field_ref="depti"                                                                                  />
+    <field field_ref="BLT"          name="blt"      long_name="Barrier Layer Thickness"                       />
+  </field_group>
+
+  <field_group id="groupU" >
+    <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      />
+    <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" />
+  </field_group>
+
+  <field_group id="groupV" >
+    <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      />
+    <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" />
+  </field_group>
+
+  <field_group id="groupW" >
+    <field field_ref="woce"         name="wo"       long_name="ocean vertical velocity"  />
+  </field_group>
+
+  <!-- TMB diagnostic output -->
+  <field_group  id="1h_grid_T_tmb" grid_ref="grid_T_2D" operation="instant">
+    <field id="top_temp"           name="votemper_top"  unit="degC"  />
+    <field id="mid_temp"           name="votemper_mid"  unit="degC"  />
+    <field id="bot_temp"           name="votemper_bot"  unit="degC"  />
+    <field id="top_sal"            name="vosaline_top"  unit="psu"   />
+    <field id="mid_sal"            name="vosaline_mid"  unit="psu"   />
+    <field id="bot_sal"            name="vosaline_bot"  unit="psu"   />
+    <field id="sshnmasked"         name="sossheig"      unit="m"     />
+  </field_group>
+
+  <field_group  id="1h_grid_U_tmb" grid_ref="grid_U_2D" operation="instant">
+    <field id="top_u"           name="vozocrtx_top"  unit="m/s"  />
+    <field id="mid_u"           name="vozocrtx_mid"  unit="m/s"  />
+    <field id="bot_u"           name="vozocrtx_bot"  unit="m/s"  />
+    <field id="baro_u"          name="vobtcrtx"      unit="m/s"  />
+  </field_group>
+
+  <field_group  id="1h_grid_V_tmb" grid_ref="grid_V_2D" operation="instant">
+    <field id="top_v"           name="vomecrty_top"  unit="m/s"  />
+    <field id="mid_v"           name="vomecrty_mid"  unit="m/s"  />
+    <field id="bot_v"           name="vomecrty_bot"  unit="m/s"  />
+    <field id="baro_v"          name="vobtcrty"      unit="m/s"  />
+  </field_group>
+
+  <!-- 25h diagnostic output -->
+  <field_group id="25h_grid_T" grid_ref="grid_T_3D" operation="instant">
+    <field id="temper25h"         name="potential temperature 25h mean"    unit="degC" />
+    <field id="tempis25h"         name="insitu temperature 25h mean"    unit="degC" />
+    <field id="salin25h"          name="salinity 25h mean"                 unit="psu"  />
+    <field id="ssh25h"            name="sea surface height 25h mean"  grid_ref="grid_T_2D"      unit="m"    />
+  </field_group>
+
+  <field_group id="25h_grid_U" grid_ref="grid_U_3D" operation="instant" >
+    <field id="vozocrtx25h"         name="i current 25h mean"    unit="m/s"   />
+  </field_group>
+
+  <field_group id="25h_grid_V" grid_ref="grid_V_3D" operation="instant">
+    <field id="vomecrty25h"         name="j current 25h mean"    unit="m/s"    />
+  </field_group>
+
+  <field_group id="25h_grid_W" grid_ref="grid_W_3D" operation="instant">
+    <field id="vovecrtz25h"         name="k current 25h mean"                 unit="m/s"      />
+    <field id="avt25h"              name="vertical diffusivity25h mean"       unit="m2/s" />
+    <field id="avm25h"              name="vertical viscosity 25h mean"        unit="m2/s" />
+    <field id="tke25h"              name="turbulent kinetic energy 25h mean" />
+    <field id="mxln25h"             name="mixing length 25h mean"             unit="m" />
+  </field_group>
+
+  <!--
+      ============================================================================================================
+  -->
+  <!-- output variables for my configuration (example) -->
+
+  <field_group id="myvarOCE" >
+    <!-- grid T -->
+    <field field_ref="e3t"          name="e3t"      long_name="vertical scale factor"           />
+    <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"         />
+    <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"            />
+    <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"  />
+
+    <!-- grid U -->
+    <field field_ref="e3u"          name="e3u"     long_name="vertical scale factor"            />
+    <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"           />
+
+    <!-- grid V -->
+    <field field_ref="e3v"          name="e3v"     long_name="vertical scale factor"            />
+    <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"           />
+  </field_group>
+
+</field_definition>
Index: /NEMO/trunk/cfgs/SHARED/field_def_nemo-pisces.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/field_def_nemo-pisces.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/field_def_nemo-pisces.xml	(revision 14072)
@@ -1,318 +1,318 @@
-<?xml version="1.0"?> 
-    <!-- $id$ -->
-    
-    <!-- 
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+<!--
 ============================================================================================================
 =                                  definition of all existing variables                                    =
 =                                            DO NOT CHANGE                                                 =
 ============================================================================================================
-    -->
-   <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
-
-    <!-- 
-============================================================================================================
-                                     Biogeochemistry model variables
-============================================================================================================
-    -->
-
-      <!-- ptrc on T grid -->
-
-     <field_group id="ptrc_T" grid_ref="grid_T_3D">
-       <!-- PISCES standard : variables available with ln_p4z  -->
-       <field id="DIC"          long_name="Dissolved inorganic Concentration"        unit="mmol/m3" />
-       <field id="DIC_e3t"      long_name="DIC * e3t"                                unit="mmol/m2" > DIC * e3t </field >
-       <field id="Alkalini"     long_name="Total Alkalinity Concentration"           unit="mmol/m3" />
-       <field id="Alkalini_e3t" long_name="Alkalini * e3t"                           unit="mmol/m2"  > Alkalini * e3t </field >
-       <field id="O2"           long_name="Oxygen Concentration"                     unit="mmol/m3" />
-       <field id="O2_e3t"       long_name="O2 * e3t"                                 unit="mmol/m2"  > O2 * e3t </field >
-       <field id="CaCO3"        long_name="Calcite Concentration"                    unit="mmol/m3" />
-       <field id="CaCO3_e3t"    long_name="CaCO3 * e3t"                              unit="mmol/m2"  > CaCO3 * e3t </field >
-       <field id="PO4"          long_name="Phosphate Concentration"                  unit="mmol/m3" />
-       <field id="PO4_e3t"      long_name="PO4 * e3t"                                unit="mmol/m2"  > PO4 * e3t </field >
-       <field id="POC"          long_name="Small organic carbon Concentration"       unit="mmol/m3" />
-       <field id="POC_e3t"      long_name="POC * e3t"                                unit="mmol/m2"  > POC * e3t </field >
-       <field id="Si"           long_name="Silicate Concentration"                   unit="mmol/m3" />
-       <field id="Si_e3t"       long_name="Si * e3t"                                 unit="mmol/m2"  > Si * e3t </field >
-       <field id="PHY"          long_name="(Nano)Phytoplankton Concentration"        unit="mmol/m3" />
-       <field id="PHY_e3t"      long_name="PHY * e3t"                                unit="mmol/m2"  > PHY * e3t </field >
-       <field id="ZOO"          long_name="(Micro)Zooplankton Concentration"         unit="mmol/m3" />
-       <field id="ZOO_e3t"      long_name="ZOO2 * e3t"                               unit="mmol/m2"  > ZOO * e3t </field >
-       <field id="DOC"          long_name="Dissolved organic Concentration"          unit="mmol/m3" />
-       <field id="DOC_e3t"      long_name="DOC * e3t"                                unit="mmol/m2"  > DOC * e3t </field >
-       <field id="PHY2"         long_name="Diatoms Concentration"                    unit="mmol/m3" />
-       <field id="PHY2_e3t"     long_name="PHY2 * e3t"                               unit="mmol/m2"  > PHY2 * e3t </field >
-       <field id="ZOO2"         long_name="Mesozooplankton Concentration"            unit="mmol/m3" />
-       <field id="ZOO2_e3t"     long_name="ZOO2 * e3t"                               unit="mmol/m2"  > ZOO2 * e3t </field >
-       <field id="DSi"          long_name="Diatoms Silicate Concentration"           unit="mmol/m3" />
-       <field id="DSi_e3t"      long_name="Dsi * e3t"                                unit="mmol/m2"  > DSi * e3t </field >
-       <field id="Fer"          long_name="Dissolved Iron Concentration"             unit="mmol/m3" />
-       <field id="Fer_e3t"      long_name="Fer * e3t"                                unit="mmol/m2"  > Fer * e3t </field >
-       <field id="BFe"          long_name="Big iron particles Concentration"         unit="mmol/m3" />
-       <field id="BFe_e3t"      long_name="BFe * e3t"                                unit="mmol/m2"  > BFe * e3t </field >
-       <field id="GOC"          long_name="Big organic carbon Concentration"         unit="mmol/m3" />
-       <field id="GOC_e3t"      long_name="GOC * e3t"                                unit="mmol/m2"  > GOC * e3t </field >
-       <field id="SFe"          long_name="Small iron particles Concentration"       unit="mmol/m3" />
-       <field id="SFe_e3t"      long_name="SFe * e3t"                                unit="mmol/m2"  > SFe * e3t </field >
-       <field id="DFe"          long_name="Diatoms iron  Concentration"              unit="mmol/m3" />
-       <field id="DFe_e3t"      long_name="DFe * e3t"                                unit="mmol/m2"  > DFe * e3t </field >
-       <field id="GSi"          long_name="Sinking biogenic Silicate Concentration"  unit="mmol/m3" />
-       <field id="GSi_e3t"      long_name="GSi * e3t"                                unit="mmol/m2"  > GSi * e3t </field >
-       <field id="NFe"          long_name="Nano iron Concentration"                  unit="mmol/m3" />
-       <field id="NFe_e3t"      long_name="NFe * e3t"                                unit="mmol/m2"  > NFe * e3t </field >
-       <field id="NCHL"         long_name="Nano chlorophyl Concentration"            unit="gChl/m3"   />
-       <field id="NCHL_e3t"     long_name="NCHL * e3t"                               unit="mmol/m2"  > NCHL * e3t </field >
-       <field id="DCHL"         long_name="Diatoms chlorophyl Concentration"         unit="gChl/m3"   />
-       <field id="DCHL_e3t"     long_name="DCHL * e3t"                               unit="mmol/m2"  > DCHL * e3t </field >
-       <field id="NO3"          long_name="Nitrate Concentration"                    unit="mmol/m3" />
-       <field id="NO3_e3t"      long_name="NO3 * e3t"                                unit="mmol/m2"  > NO3 * e3t </field >
-       <field id="NH4"          long_name="Ammonium Concentration"                   unit="mmol/m3" />
-       <field id="NH4_e3t"      long_name="NH4 * e3t"                                unit="mmol/m2"  > NH4 * e3t </field >
-
-       <!-- PISCES quota : variables available with ln_p5z  -->
-
-       <field id="DON"          long_name="Dissolved organic N Concentration"        unit="mmol/m3" />
-       <field id="DON_e3t"      long_name="DON * e3t"                                unit="mmol/m2"  > DON * e3t </field >
-       <field id="DOP"          long_name="Dissolved organic P Concentration"        unit="mmol/m3" />
-       <field id="DOP_e3t"      long_name="DOP * e3t"                                unit="mmol/m2"  > DOP * e3t </field >
-       <field id="PON"          long_name="Small PON Concentration"                  unit="mmol/m3" />
-       <field id="PON_e3t"      long_name="PON * e3t"                                unit="mmol/m2"  > PON * e3t </field >
-       <field id="POP"          long_name="Small POP Concentration"                  unit="mmol/m3" />
-       <field id="POP_e3t"      long_name="POP * e3t"                                unit="mmol/m2"  > POP * e3t </field >
-       <field id="GON"          long_name="Big PON Concentration"                    unit="mmol/m3" />
-       <field id="GON_e3t"      long_name="GON * e3t"                                unit="mmol/m2"  > GON * e3t </field >
-       <field id="GOP"          long_name="Big POP Concentration"                    unit="mmol/m3" />
-       <field id="GOP_e3t"      long_name="GOP * e3t"                                unit="mmol/m2"  > GOP * e3t </field >
-       <field id="PHYN"         long_name="Nanophytoplankton N biomass"              unit="mmol/m3" />
-       <field id="PHYN_e3t"     long_name="PHYN * e3t"                               unit="mmol/m2"  > PHYN * e3t </field >
-       <field id="PHYP"         long_name="Nanophytoplankton P biomass"              unit="mmol/m3" />
-       <field id="PHYP_e3t"     long_name="PHYP * e3t"                               unit="mmol/m2"  > PHYP * e3t </field >
-       <field id="DIAN"         long_name="Diatoms N biomass"                        unit="mmol/m3" />
-       <field id="DIAN_e3t"     long_name="DIAN * e3t"                               unit="mmol/m2"  > DIAN * e3t </field >
-       <field id="DIAP"         long_name="Diatoms P biomass"                        unit="mmol/m3" />
-       <field id="DIAP_e3t"     long_name="DIAP * e3t"                               unit="mmol/m2"  > DIAP * e3t </field >
-       <field id="PIC"          long_name="Picophytoplankton C biomass"              unit="mmol/m3" />
-       <field id="PIC_e3t"      long_name="PIC * e3t"                                unit="mmol/m2"  > PIC * e3t </field >
-       <field id="PICN"         long_name="Picophytoplankton N biomass"              unit="mmol/m3" />
-       <field id="PICN_e3t"     long_name="PICN * e3t"                               unit="mmol/m2"  > PICN * e3t </field >
-       <field id="PICP"         long_name="Picophytoplankton P biomass"              unit="mmol/m3" />
-       <field id="PICP_e3t"     long_name="PICP * e3t"                               unit="mmol/m2"  > PICP * e3t </field >
-       <field id="PFe"          long_name="Picophytoplankton Fe biomass"             unit="mmol/m3" />
-       <field id="PFe_e3t"      long_name="PFe * e3t"                                unit="mmol/m2"  > PFe * e3t </field >
-       <field id="PCHL"         long_name="Picophytoplankton Chl biomass"            unit="gChl/m3" />
-       <field id="PCHL_e3t"     long_name="PCHL * e3t"                               unit="mmol/m2"  > PCHL * e3t </field >
-
-      <!-- PISCES with ligand parametisation : variables available namelist paramter ln_ligand -->
-       <field id="LGW"         long_name="Weak ligands concentration"                unit="mmol/m3" />
-       <field id="LGW_e3t"     long_name="LGW * e3t"                                 unit="mmol/m2"  > LGW * e3t </field >
-
-       <!-- PISCES light : variables available with ln_p2z  -->
-       <field id="DET"         long_name="Detritus"                                 unit="mmol-N/m3" />
-       <field id="DET_e3t"     long_name="DET * e3t"                                unit="mmol-N/m2"  > DET * e3t </field >
-       <field id="DOM"         long_name="Dissolved Organic Matter"                 unit="mmol-N/m3" />
-       <field id="DOM_e3t"     long_name="DOM * e3t"                                unit="mmol-N/m2"  > DOM * e3t </field >
-
-     </field_group>
-
-     <!-- SEDIMENT variables on T sediment grid  -->
-     <field_group id="sed_T" grid_ref="grid_T_3DS">
-       <field id="SedDIC"          long_name="Dissolved inorganic Concentration"        unit="mmol/m3" />
-       <field id="SedAlkalini"     long_name="Total Alkalinity Concentration"           unit="mmol/m3" />
-       <field id="SedO2"           long_name="Oxygen Concentration"                     unit="mmol/m3" />
-       <field id="SedCaCO3"        long_name="Calcite Concentration"                    unit="%" />
-       <field id="SedPOS"          long_name="Semi-ref POC Concentration"               unit="%" />
-       <field id="SedPOR"          long_name="Refractory POC Concentration"             unit="%" />
-       <field id="SedPO4"          long_name="Phosphate Concentration"                  unit="mmol/m3" />
-       <field id="SedPOC"          long_name="Labile POC Concentration"                 unit="%" />
-       <field id="SedSil"          long_name="Silicate Concentration"                   unit="mmol/m3" />
-       <field id="SedFe2"          long_name="Fe2+ Concentration"                       unit="mmol/m3" />
-       <field id="SedBSi"          long_name="Biogenic Silicate Concentration"          unit="%" />
-       <field id="SedNO3"          long_name="Nitrate Concentration"                    unit="mmol/m3" />
-       <field id="SedNH4"          long_name="Ammonium Concentration"                   unit="mmol/m3" />
-       <field id="SedH2S"          long_name="H2S Concentration"                        unit="mmol/m3" />
-       <field id="SedSO4"          long_name="SO4 Concentration"                        unit="mmol/m3" />
-       <field id="SedClay"         long_name="Clay Concentration"                       unit="%" />
-       <field id="SedFeO"          long_name="Fe(OH)3 Concentration"                    unit="%" />
-       <field id="SedFeS"          long_name="FeS Concentration"                        unit="%" />
-       <field id="SedpH"           long_name="PH"                                       unit="1"          />
-       <field id="SedCO3por"       long_name="Bicarbonates"                             unit="mol/m3" />
-     </field_group>
-
-     <!-- SEDIMENT additional variables on T sediment grid  -->
-     <field_group id="Diag_S" grid_ref="grid_T_2D">
-       <field id="FlxSi"       long_name="Si sediment flux"                        unit="mol/cm2/s"     />
-       <field id="FlxO2"       long_name="O2 sediment flux"                        unit="mol/cm2/s"     />
-       <field id="FlxDIC"      long_name="DIC sediment flux"                       unit="mol/cm2/s"     />
-       <field id="FlxNO3"      long_name="NO3 sediment flux"                       unit="mol/cm2/s"     />
-       <field id="FlxPO4"      long_name="PO4 sediment flux"                       unit="mol/cm2/s"     />
-       <field id="FlxAlkalini" long_name="Alkalinity sediment flux"                unit="mol/cm2/s"     />
-       <field id="FlxNH4"      long_name="Ammonium sediment flux"                  unit="mol/cm2/s"     />
-       <field id="FlxH2S"      long_name="H2S sediment flux"                       unit="mol/cm2/s"     />
-       <field id="FlxSO4"      long_name="SO4 sediment flux"                       unit="mol/cm2/s"     />
-       <field id="FlxFe2"      long_name="Fe2+ sediment flux"                      unit="mol/cm2/s"     />
-       <field id="Flxtot"      long_name="Sediment net burial rate"                unit="cm/s"     />
-       <field id="dzdep"       long_name="Sedimentation rate"                      unit="cm/s"     />
-       <field id="sflxclay"    long_name="Clay sedimentation rate"                 unit="g/m2/s"     />
-       <field id="sflxcal"     long_name="Calcite sedimentation rate"              unit="mol/m2/s"     />
-       <field id="sflxbsi"     long_name="BSi Sedimentation rate"                  unit="mol/m2/s"     />
-       <field id="sflxpoc"     long_name="POC Sedimentation rate"                  unit="mol/m2/s"     />
-       <field id="sflxfeo"     long_name="Fe(OH)3 Sedimentation rate"              unit="mol/m2/s"     />
-</field_group>
-
-     <!-- PISCES additional diagnostics on T grid  -->
-
-     <field_group id="diad_T" grid_ref="grid_T_2D">
-       <field id="PH"          long_name="PH"                                      unit="1"          grid_ref="grid_T_3D" />
-       <field id="CO3"         long_name="Bicarbonates"                            unit="mol/m3"     grid_ref="grid_T_3D" />
-       <field id="CO3sat"      long_name="CO3 saturation"                          unit="mol/m3"     grid_ref="grid_T_3D" />
-       <field id="PAR"         long_name="Photosynthetically Available Radiation"  unit="W/m2"       grid_ref="grid_T_3D" />
-       <field id="PARDM"       long_name="Daily mean PAR"                          unit="W/m2"       grid_ref="grid_T_3D" />
-       <field id="PPPHYN"      long_name="Primary production of nanophyto"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PPPHYP"      long_name="Primary production of picophyto"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PPPHYD"      long_name="Primary production of diatoms"           unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PPNEWN"      long_name="New Primary production of nanophyto"     unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PPNEWP"      long_name="New Primary production of picophyto"     unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PPNEWD"      long_name="New Primary production of diatoms"       unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PBSi"        long_name="Primary production of Si diatoms"        unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PFeN"        long_name="Primary production of nano iron"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PFeP"        long_name="Primary production of pico iron"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
-       <field id="PFeD"        long_name="Primary production of diatoms iron"      unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="xfracal"     long_name="Calcifying fraction"                     unit="1"          grid_ref="grid_T_3D" />
-       <field id="PCAL"        long_name="Calcite production"                      unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="DCAL"        long_name="Calcite dissolution"                     unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="GRAZ1"       long_name="Grazing by microzooplankton"             unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="GRAZ2"       long_name="Grazing by mesozooplankton"              unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="REMIN"       long_name="Oxic remineralization of OM"             unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="DENIT"       long_name="Anoxic remineralization of OM"           unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="REMINP"       long_name="Oxic remineralization rate of POC"      unit="d-1"        grid_ref="grid_T_3D" />
-       <field id="REMING"       long_name="Oxic remineralization rate of GOC"      unit="d-1"        grid_ref="grid_T_3D" />
-       <field id="Nfix"        long_name="Nitrogen fixation"                       unit="mol/m3/s"   grid_ref="grid_T_3D" />
-       <field id="Mumax"       long_name="Maximum growth rate"                     unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MuN"         long_name="Realized growth rate for nanophyto"      unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MuP"         long_name="Realized growth rate for picophyto"      unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MuD"         long_name="Realized growth rate for diatomes"       unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MunetN"      long_name="Net growth rate for nanophyto"           unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MunetP"      long_name="Net growth rate for picophyto"           unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="MunetD"      long_name="Net growth rate for diatomes"            unit="s-1"        grid_ref="grid_T_3D" />
-       <field id="LNnut"       long_name="Nutrient limitation term in Nanophyto"   unit=""           grid_ref="grid_T_3D" />
-       <field id="LPnut"       long_name="Nutrient limitation term in Picophyto"   unit="-"          grid_ref="grid_T_3D" />
-       <field id="LDnut"       long_name="Nutrient limitation term in Diatoms"     unit=""           grid_ref="grid_T_3D" />
-       <field id="LNFe"        long_name="Iron limitation term in Nanophyto"       unit=""           grid_ref="grid_T_3D" />
-       <field id="LPFe"        long_name="Iron limitation term in Picophyto"       unit="-"          grid_ref="grid_T_3D" />
-       <field id="LDFe"        long_name="Iron limitation term in Diatoms"         unit=""           grid_ref="grid_T_3D" />
-       <field id="LNlight"     long_name="Light limitation term in Nanophyto"      unit=""           grid_ref="grid_T_3D" />
-       <field id="LPlight"     long_name="Light limitation term in Picophyto"      unit="-"          grid_ref="grid_T_3D" />
-       <field id="LDlight"     long_name="Light limitation term in Diatoms"        unit=""           grid_ref="grid_T_3D" />
-       <field id="SIZEN"       long_name="Mean relative size of nanophyto."        unit="-"          grid_ref="grid_T_3D" />
-       <field id="SIZEP"       long_name="Mean relative size of picophyto."        unit="-"          grid_ref="grid_T_3D" />
-       <field id="SIZED"       long_name="Mean relative size of diatoms"           unit="-"          grid_ref="grid_T_3D" />
-       <field id="Fe3"         long_name="Iron III concentration"                  unit="nmol/m3"    grid_ref="grid_T_3D" />
-       <field id="FeL1"        long_name="Complexed Iron concentration with L1"    unit="nmol/m3"    grid_ref="grid_T_3D" />
-       <field id="TL1"         long_name="Total L1 concentration"                  unit="nmol/m3"    grid_ref="grid_T_3D" />
-       <field id="pdust"       long_name="dust concentration"                      unit="g/m3"                            />
-       <field id="Totlig"      long_name="Total ligand concentation"               unit="nmol/m3"    grid_ref="grid_T_3D" />
-       <field id="Biron"       long_name="Bioavailable iron"                       unit="nmol/m3"    grid_ref="grid_T_3D" />
-       <field id="Sdenit"      long_name="Nitrate reduction in the sediments"      unit="mol/m2/s"                        />
-       <field id="Ironice"     long_name="Iron input/uptake due to sea ice"        unit="mol/m2/s"                        />
-       <field id="SedCal"      long_name="Calcite burial in the sediments"         unit="molC/m2/s"                       />
-       <field id="SedSi"       long_name="Silicon burial in the sediments"         unit="molSi/m2/s"                      />
-       <field id="SedC"        long_name="Organic C burial in the sediments"       unit="molC/m2/s"                       />
-       <field id="HYDR"        long_name="Iron input from hydrothemal vents"       unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="EPC100"      long_name="Export of carbon particles at 100 m"     unit="mol/m2/s"                        />
-       <field id="EPFE100"     long_name="Export of biogenic iron at 100 m"        unit="mol/m2/s"                        />
-       <field id="EPSI100"     long_name="Export of Silicate at 100 m"             unit="mol/m2/s"                        />
-       <field id="EPCAL100"    long_name="Export of Calcite at 100 m"              unit="mol/m2/s"                        />
-       <field id="EXPC"        long_name="Export of carbon"                        unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="EXPFE"       long_name="Export of biogenic iron"                 unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="EXPSI"       long_name="Export of Silicate"                      unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="EXPCAL"      long_name="Export of Calcite"                       unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="Cflx"        long_name="DIC flux"                                unit="mol/m2/s"                        />
-       <field id="Oflx"        long_name="Oxygen flux"                             unit="mol/m2/s"                        />
-       <field id="Kg"          long_name="Gas transfer"                            unit="mol/m2/s/uatm"                   />
-       <field id="Dpco2"       long_name="Delta CO2"                               unit="uatm"                            />
-       <field id="pCO2sea"     long_name="surface ocean pCO2"                      unit="uatm"                            />
-       <field id="Dpo2"        long_name="Delta O2"                                unit="uatm"                            />
-       <field id="Heup"        long_name="Euphotic layer depth"                    unit="m"                               />
-       <field id="AtmCo2"      long_name="Atmospheric CO2 concentration"           unit="ppm"                               />
-       <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                        />
-       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"   grid_ref="grid_T_3D" />
-       <field id="FESCAV"      long_name="Scavenging of Iron"                      unit="mmol-Fe/m3/s"   grid_ref="grid_T_3D" />
-       <field id="FECOLL"      long_name="Colloidal Pumping of FeL"                unit="mmol-FeL/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LGWCOLL"     long_name="Coagulation loss of ligands"             unit="mmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="REMINF"      long_name="Oxic remineralization suppy of Fe"       unit="mmol-Fe/m3/s"  grid_ref="grid_T_3D" />
-       <field id="BACT"        long_name="Bacterial Biomass"                       unit="mmol/m3"  grid_ref="grid_T_3D" />
-       <field id="FEBACT"      long_name="Bacterial uptake of Fe"                  unit="molFe/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LPRODR"      long_name="OM remineralisation ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LPRODP"      long_name="phytoplankton ligand production rate"    unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LIGREM"      long_name="Remineralisation loss of ligands"        unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LIGPR"       long_name="Photochemical loss of ligands"           unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LDETP"       long_name="Ligand destruction during phytoplankton uptake" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LPRODZ2"     long_name="mesozooplankton ligand production rate"  unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="LPRODZ"      long_name="microzooplankton ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
-       <field id="FEZOO"       long_name="microzooplankton iron recycling rate"    unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" />
-       <field id="FEZOO2"      long_name="mesozooplankton iron recycling rate"     unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" />
-
-       <!-- PISCES tracers trends -->
-       <field id="INTdtAlk"    long_name="Vertically int. of change of alkalinity"             unit="mol/m2/s"                       />
-       <field id="INTdtDIC"    long_name="Vertically int. of change of dissic    "             unit="mol/m2/s"                       />
-       <field id="INTdtFer"    long_name="Vertically int. of change of iron      "             unit="mol/m2/s"                       />
-       <field id="INTdtDIN"    long_name="Vertically int. of change of nitrogen  "             unit="mol/m2/s"                       />
-       <field id="INTdtDIP"    long_name="Vertically int. of change of phophate  "             unit="mol/m2/s"                       />
-       <field id="INTdtSil"    long_name="Vertically int. of change of silicon   "             unit="mol/m2/s"                       />
-
-
-       <!-- dbio_T on T grid : variables available with diaar5 -->
-       <field id="TPP"         long_name="Total Primary production of phyto"                   unit="mol/m3/s"  grid_ref="grid_T_3D" />
-       <field id="TPNEW"       long_name="New Primary production of phyto"                     unit="mol/m3/s"  grid_ref="grid_T_3D" />
-       <field id="TPBFE"       long_name="Total biogenic iron production"                      unit="mol/m3/s"  grid_ref="grid_T_3D" />
-       <field id="INTDIC"      long_name="DIC content"                                         unit="kg/m2"                          />
-       <field id="O2MIN"       long_name="Oxygen minimum concentration"                        unit="mol/m3"                          />
-       <field id="ZO2MIN"      long_name="Depth of oxygen minimum concentration"               unit="m"                              />
-       <field id="INTNFIX"     long_name="Nitrogen fixation rate : vert. integrated"           unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > Nfix * e3t </field >
-       <field id="INTPPPHYN"   long_name="Vertically integrated primary production by nanophy" unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYN * e3t </field >
-       <field id="INTPPPHYD"   long_name="Vertically integrated primary production by diatom"  unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYD * e3t </field >                    
-       <field id="INTPPPHYP"   long_name="Vertically integrated primary production by picophy" unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYP * e3t </field >                    
-       <field id="INTPP"       long_name="Vertically integrated primary production by phyto"   unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPP * e3t </field >                            
-       <field id="INTPNEW"     long_name="Vertically integrated new primary production"        unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPNEW * e3t </field >                
-       <field id="INTPBFE"     long_name="Vertically integrated of biogenic iron production"   unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPBFE * e3t </field >                           
-       <field id="INTPBSI"     long_name="Vertically integrated of biogenic Si production"     unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PBSi * e3t </field >                           
-
-       <!-- PISCES light : variables available with key_pisces_reduced -->
-       <field id="FNO3PHY"     long_name="FNO3PHY"                                 unit=""          grid_ref="grid_T_3D" /> 
-       <field id="FNH4PHY"     long_name="FNH4PHY"                                 unit=""          grid_ref="grid_T_3D" /> 
-       <field id="FNH4NO3"     long_name="FNH4NO3"                                 unit=""          grid_ref="grid_T_3D" /> 
-       <field id="TNO3PHY"     long_name="TNO3PHY"                                 unit=""  /> 
-       <field id="TNH4PHY"     long_name="TNH4PHY"                                 unit=""  /> 
-       <field id="TPHYDOM"     long_name="TPHYDOM"                                 unit=""  /> 
-       <field id="TPHYNH4"     long_name="TPHYNH4"                                 unit=""  /> 
-       <field id="TPHYZOO"     long_name="TPHYZOO"                                 unit=""  /> 
-       <field id="TPHYDET"     long_name="TPHYDET"                                 unit=""  /> 
-       <field id="TDETZOO"     long_name="TDETZOO"                                 unit=""  /> 
-       <field id="TZOODET"     long_name="TZOODET"                                 unit=""  /> 
-       <field id="TZOOBOD"     long_name="TZOOBOD"                                 unit=""  /> 
-       <field id="TZOONH4"     long_name="TZOONH4"                                 unit=""  /> 
-       <field id="TZOODOM"     long_name="TZOODOM"                                 unit=""  /> 
-       <field id="TNH4NO3"     long_name="TNH4NO3"                                 unit=""  /> 
-       <field id="TDOMNH4"     long_name="TDOMNH4"                                 unit=""  /> 
-       <field id="TDETNH4"     long_name="TDETNH4"                                 unit=""  /> 
-       <field id="TPHYTOT"     long_name="TPHYTOT"                                 unit=""  /> 
-       <field id="TZOOTOT"     long_name="TZOOTOT"                                 unit=""  /> 
-       <field id="SEDPOC"      long_name="SEDPOC"                                  unit=""  /> 
-       <field id="TDETSED"     long_name="TDETSED"                                 unit=""  /> 
-     </field_group>
-
-     <field_group id="tracer_scalar"  grid_ref="grid_scalar"  >
-     <!-- PISCES scalar  -->
-       <field id="pno3tot"         long_name="Global mean nitrate concentration"                  unit="mol/m3"   />
-       <field id="ppo4tot"         long_name="global mean phosphorus concentration"               unit="mol/m3"   />
-       <field id="psiltot"         long_name="Global mean silicate concentration"                 unit="mol/m3"   />
-       <field id="palktot"         long_name="Global mean alkalinity concentration"               unit="mol/m3"   />
-       <field id="pfertot"         long_name="Global mean iron concentration"                     unit="mol/m3"   />
-       <field id="tcflx"           long_name="Total Flux of Carbon out of the ocean"              unit="mol/s"   />
-       <field id="tcflxcum"        long_name="Cumulative total Flux of Carbon out of the ocean"   unit="mol/s"   />
-       <field id="tcexp"           long_name="Total Carbon export at 100m"                        unit="mol/s"   />
-       <field id="tintpp"          long_name="Global total integrated primary production"         unit="mol/s"   />
-       <field id="tnfix"           long_name="Global total nitrogen fixation"                     unit="mol/s"   />
-       <field id="tdenit"          long_name="Total denitrification"                              unit="mol/s"   />
-     </field_group>
-
-   </field_definition>
+-->
+<field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+
+  <!--
+      ============================================================================================================
+      Biogeochemistry model variables
+      ============================================================================================================
+  -->
+
+  <!-- ptrc on T grid -->
+
+  <field_group id="ptrc_T" grid_ref="grid_T_3D">
+    <!-- PISCES standard : variables available with ln_p4z  -->
+    <field id="DIC"          long_name="Dissolved inorganic Concentration"        unit="mmol/m3" />
+    <field id="DIC_e3t"      long_name="DIC * e3t"                                unit="mmol/m2" > DIC * e3t </field >
+    <field id="Alkalini"     long_name="Total Alkalinity Concentration"           unit="mmol/m3" />
+    <field id="Alkalini_e3t" long_name="Alkalini * e3t"                           unit="mmol/m2"  > Alkalini * e3t </field >
+    <field id="O2"           long_name="Oxygen Concentration"                     unit="mmol/m3" />
+    <field id="O2_e3t"       long_name="O2 * e3t"                                 unit="mmol/m2"  > O2 * e3t </field >
+    <field id="CaCO3"        long_name="Calcite Concentration"                    unit="mmol/m3" />
+    <field id="CaCO3_e3t"    long_name="CaCO3 * e3t"                              unit="mmol/m2"  > CaCO3 * e3t </field >
+    <field id="PO4"          long_name="Phosphate Concentration"                  unit="mmol/m3" />
+    <field id="PO4_e3t"      long_name="PO4 * e3t"                                unit="mmol/m2"  > PO4 * e3t </field >
+    <field id="POC"          long_name="Small organic carbon Concentration"       unit="mmol/m3" />
+    <field id="POC_e3t"      long_name="POC * e3t"                                unit="mmol/m2"  > POC * e3t </field >
+    <field id="Si"           long_name="Silicate Concentration"                   unit="mmol/m3" />
+    <field id="Si_e3t"       long_name="Si * e3t"                                 unit="mmol/m2"  > Si * e3t </field >
+    <field id="PHY"          long_name="(Nano)Phytoplankton Concentration"        unit="mmol/m3" />
+    <field id="PHY_e3t"      long_name="PHY * e3t"                                unit="mmol/m2"  > PHY * e3t </field >
+    <field id="ZOO"          long_name="(Micro)Zooplankton Concentration"         unit="mmol/m3" />
+    <field id="ZOO_e3t"      long_name="ZOO2 * e3t"                               unit="mmol/m2"  > ZOO * e3t </field >
+    <field id="DOC"          long_name="Dissolved organic Concentration"          unit="mmol/m3" />
+    <field id="DOC_e3t"      long_name="DOC * e3t"                                unit="mmol/m2"  > DOC * e3t </field >
+    <field id="PHY2"         long_name="Diatoms Concentration"                    unit="mmol/m3" />
+    <field id="PHY2_e3t"     long_name="PHY2 * e3t"                               unit="mmol/m2"  > PHY2 * e3t </field >
+    <field id="ZOO2"         long_name="Mesozooplankton Concentration"            unit="mmol/m3" />
+    <field id="ZOO2_e3t"     long_name="ZOO2 * e3t"                               unit="mmol/m2"  > ZOO2 * e3t </field >
+    <field id="DSi"          long_name="Diatoms Silicate Concentration"           unit="mmol/m3" />
+    <field id="DSi_e3t"      long_name="Dsi * e3t"                                unit="mmol/m2"  > DSi * e3t </field >
+    <field id="Fer"          long_name="Dissolved Iron Concentration"             unit="mmol/m3" />
+    <field id="Fer_e3t"      long_name="Fer * e3t"                                unit="mmol/m2"  > Fer * e3t </field >
+    <field id="BFe"          long_name="Big iron particles Concentration"         unit="mmol/m3" />
+    <field id="BFe_e3t"      long_name="BFe * e3t"                                unit="mmol/m2"  > BFe * e3t </field >
+    <field id="GOC"          long_name="Big organic carbon Concentration"         unit="mmol/m3" />
+    <field id="GOC_e3t"      long_name="GOC * e3t"                                unit="mmol/m2"  > GOC * e3t </field >
+    <field id="SFe"          long_name="Small iron particles Concentration"       unit="mmol/m3" />
+    <field id="SFe_e3t"      long_name="SFe * e3t"                                unit="mmol/m2"  > SFe * e3t </field >
+    <field id="DFe"          long_name="Diatoms iron  Concentration"              unit="mmol/m3" />
+    <field id="DFe_e3t"      long_name="DFe * e3t"                                unit="mmol/m2"  > DFe * e3t </field >
+    <field id="GSi"          long_name="Sinking biogenic Silicate Concentration"  unit="mmol/m3" />
+    <field id="GSi_e3t"      long_name="GSi * e3t"                                unit="mmol/m2"  > GSi * e3t </field >
+    <field id="NFe"          long_name="Nano iron Concentration"                  unit="mmol/m3" />
+    <field id="NFe_e3t"      long_name="NFe * e3t"                                unit="mmol/m2"  > NFe * e3t </field >
+    <field id="NCHL"         long_name="Nano chlorophyl Concentration"            unit="gChl/m3"   />
+    <field id="NCHL_e3t"     long_name="NCHL * e3t"                               unit="mmol/m2"  > NCHL * e3t </field >
+    <field id="DCHL"         long_name="Diatoms chlorophyl Concentration"         unit="gChl/m3"   />
+    <field id="DCHL_e3t"     long_name="DCHL * e3t"                               unit="mmol/m2"  > DCHL * e3t </field >
+    <field id="NO3"          long_name="Nitrate Concentration"                    unit="mmol/m3" />
+    <field id="NO3_e3t"      long_name="NO3 * e3t"                                unit="mmol/m2"  > NO3 * e3t </field >
+    <field id="NH4"          long_name="Ammonium Concentration"                   unit="mmol/m3" />
+    <field id="NH4_e3t"      long_name="NH4 * e3t"                                unit="mmol/m2"  > NH4 * e3t </field >
+
+    <!-- PISCES quota : variables available with ln_p5z  -->
+
+    <field id="DON"          long_name="Dissolved organic N Concentration"        unit="mmol/m3" />
+    <field id="DON_e3t"      long_name="DON * e3t"                                unit="mmol/m2"  > DON * e3t </field >
+    <field id="DOP"          long_name="Dissolved organic P Concentration"        unit="mmol/m3" />
+    <field id="DOP_e3t"      long_name="DOP * e3t"                                unit="mmol/m2"  > DOP * e3t </field >
+    <field id="PON"          long_name="Small PON Concentration"                  unit="mmol/m3" />
+    <field id="PON_e3t"      long_name="PON * e3t"                                unit="mmol/m2"  > PON * e3t </field >
+    <field id="POP"          long_name="Small POP Concentration"                  unit="mmol/m3" />
+    <field id="POP_e3t"      long_name="POP * e3t"                                unit="mmol/m2"  > POP * e3t </field >
+    <field id="GON"          long_name="Big PON Concentration"                    unit="mmol/m3" />
+    <field id="GON_e3t"      long_name="GON * e3t"                                unit="mmol/m2"  > GON * e3t </field >
+    <field id="GOP"          long_name="Big POP Concentration"                    unit="mmol/m3" />
+    <field id="GOP_e3t"      long_name="GOP * e3t"                                unit="mmol/m2"  > GOP * e3t </field >
+    <field id="PHYN"         long_name="Nanophytoplankton N biomass"              unit="mmol/m3" />
+    <field id="PHYN_e3t"     long_name="PHYN * e3t"                               unit="mmol/m2"  > PHYN * e3t </field >
+    <field id="PHYP"         long_name="Nanophytoplankton P biomass"              unit="mmol/m3" />
+    <field id="PHYP_e3t"     long_name="PHYP * e3t"                               unit="mmol/m2"  > PHYP * e3t </field >
+    <field id="DIAN"         long_name="Diatoms N biomass"                        unit="mmol/m3" />
+    <field id="DIAN_e3t"     long_name="DIAN * e3t"                               unit="mmol/m2"  > DIAN * e3t </field >
+    <field id="DIAP"         long_name="Diatoms P biomass"                        unit="mmol/m3" />
+    <field id="DIAP_e3t"     long_name="DIAP * e3t"                               unit="mmol/m2"  > DIAP * e3t </field >
+    <field id="PIC"          long_name="Picophytoplankton C biomass"              unit="mmol/m3" />
+    <field id="PIC_e3t"      long_name="PIC * e3t"                                unit="mmol/m2"  > PIC * e3t </field >
+    <field id="PICN"         long_name="Picophytoplankton N biomass"              unit="mmol/m3" />
+    <field id="PICN_e3t"     long_name="PICN * e3t"                               unit="mmol/m2"  > PICN * e3t </field >
+    <field id="PICP"         long_name="Picophytoplankton P biomass"              unit="mmol/m3" />
+    <field id="PICP_e3t"     long_name="PICP * e3t"                               unit="mmol/m2"  > PICP * e3t </field >
+    <field id="PFe"          long_name="Picophytoplankton Fe biomass"             unit="mmol/m3" />
+    <field id="PFe_e3t"      long_name="PFe * e3t"                                unit="mmol/m2"  > PFe * e3t </field >
+    <field id="PCHL"         long_name="Picophytoplankton Chl biomass"            unit="gChl/m3" />
+    <field id="PCHL_e3t"     long_name="PCHL * e3t"                               unit="mmol/m2"  > PCHL * e3t </field >
+
+    <!-- PISCES with ligand parametisation : variables available namelist paramter ln_ligand -->
+    <field id="LGW"         long_name="Weak ligands concentration"                unit="mmol/m3" />
+    <field id="LGW_e3t"     long_name="LGW * e3t"                                 unit="mmol/m2"  > LGW * e3t </field >
+
+    <!-- PISCES light : variables available with ln_p2z  -->
+    <field id="DET"         long_name="Detritus"                                 unit="mmol-N/m3" />
+    <field id="DET_e3t"     long_name="DET * e3t"                                unit="mmol-N/m2"  > DET * e3t </field >
+    <field id="DOM"         long_name="Dissolved Organic Matter"                 unit="mmol-N/m3" />
+    <field id="DOM_e3t"     long_name="DOM * e3t"                                unit="mmol-N/m2"  > DOM * e3t </field >
+
+  </field_group>
+
+  <!-- SEDIMENT variables on T sediment grid  -->
+  <field_group id="sed_T" grid_ref="grid_T_3DS">
+    <field id="SedDIC"          long_name="Dissolved inorganic Concentration"        unit="mmol/m3" />
+    <field id="SedAlkalini"     long_name="Total Alkalinity Concentration"           unit="mmol/m3" />
+    <field id="SedO2"           long_name="Oxygen Concentration"                     unit="mmol/m3" />
+    <field id="SedCaCO3"        long_name="Calcite Concentration"                    unit="%" />
+    <field id="SedPOS"          long_name="Semi-ref POC Concentration"               unit="%" />
+    <field id="SedPOR"          long_name="Refractory POC Concentration"             unit="%" />
+    <field id="SedPO4"          long_name="Phosphate Concentration"                  unit="mmol/m3" />
+    <field id="SedPOC"          long_name="Labile POC Concentration"                 unit="%" />
+    <field id="SedSil"          long_name="Silicate Concentration"                   unit="mmol/m3" />
+    <field id="SedFe2"          long_name="Fe2+ Concentration"                       unit="mmol/m3" />
+    <field id="SedBSi"          long_name="Biogenic Silicate Concentration"          unit="%" />
+    <field id="SedNO3"          long_name="Nitrate Concentration"                    unit="mmol/m3" />
+    <field id="SedNH4"          long_name="Ammonium Concentration"                   unit="mmol/m3" />
+    <field id="SedH2S"          long_name="H2S Concentration"                        unit="mmol/m3" />
+    <field id="SedSO4"          long_name="SO4 Concentration"                        unit="mmol/m3" />
+    <field id="SedClay"         long_name="Clay Concentration"                       unit="%" />
+    <field id="SedFeO"          long_name="Fe(OH)3 Concentration"                    unit="%" />
+    <field id="SedFeS"          long_name="FeS Concentration"                        unit="%" />
+    <field id="SedpH"           long_name="PH"                                       unit="1"          />
+    <field id="SedCO3por"       long_name="Bicarbonates"                             unit="mol/m3" />
+  </field_group>
+
+  <!-- SEDIMENT additional variables on T sediment grid  -->
+  <field_group id="Diag_S" grid_ref="grid_T_2D">
+    <field id="FlxSi"       long_name="Si sediment flux"                        unit="mol/cm2/s"     />
+    <field id="FlxO2"       long_name="O2 sediment flux"                        unit="mol/cm2/s"     />
+    <field id="FlxDIC"      long_name="DIC sediment flux"                       unit="mol/cm2/s"     />
+    <field id="FlxNO3"      long_name="NO3 sediment flux"                       unit="mol/cm2/s"     />
+    <field id="FlxPO4"      long_name="PO4 sediment flux"                       unit="mol/cm2/s"     />
+    <field id="FlxAlkalini" long_name="Alkalinity sediment flux"                unit="mol/cm2/s"     />
+    <field id="FlxNH4"      long_name="Ammonium sediment flux"                  unit="mol/cm2/s"     />
+    <field id="FlxH2S"      long_name="H2S sediment flux"                       unit="mol/cm2/s"     />
+    <field id="FlxSO4"      long_name="SO4 sediment flux"                       unit="mol/cm2/s"     />
+    <field id="FlxFe2"      long_name="Fe2+ sediment flux"                      unit="mol/cm2/s"     />
+    <field id="Flxtot"      long_name="Sediment net burial rate"                unit="cm/s"     />
+    <field id="dzdep"       long_name="Sedimentation rate"                      unit="cm/s"     />
+    <field id="sflxclay"    long_name="Clay sedimentation rate"                 unit="g/m2/s"     />
+    <field id="sflxcal"     long_name="Calcite sedimentation rate"              unit="mol/m2/s"     />
+    <field id="sflxbsi"     long_name="BSi Sedimentation rate"                  unit="mol/m2/s"     />
+    <field id="sflxpoc"     long_name="POC Sedimentation rate"                  unit="mol/m2/s"     />
+    <field id="sflxfeo"     long_name="Fe(OH)3 Sedimentation rate"              unit="mol/m2/s"     />
+  </field_group>
+
+  <!-- PISCES additional diagnostics on T grid  -->
+
+  <field_group id="diad_T" grid_ref="grid_T_2D">
+    <field id="PH"          long_name="PH"                                      unit="1"          grid_ref="grid_T_3D" />
+    <field id="CO3"         long_name="Bicarbonates"                            unit="mol/m3"     grid_ref="grid_T_3D" />
+    <field id="CO3sat"      long_name="CO3 saturation"                          unit="mol/m3"     grid_ref="grid_T_3D" />
+    <field id="PAR"         long_name="Photosynthetically Available Radiation"  unit="W/m2"       grid_ref="grid_T_3D" />
+    <field id="PARDM"       long_name="Daily mean PAR"                          unit="W/m2"       grid_ref="grid_T_3D" />
+    <field id="PPPHYN"      long_name="Primary production of nanophyto"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PPPHYP"      long_name="Primary production of picophyto"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PPPHYD"      long_name="Primary production of diatoms"           unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PPNEWN"      long_name="New Primary production of nanophyto"     unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PPNEWP"      long_name="New Primary production of picophyto"     unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PPNEWD"      long_name="New Primary production of diatoms"       unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PBSi"        long_name="Primary production of Si diatoms"        unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PFeN"        long_name="Primary production of nano iron"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PFeP"        long_name="Primary production of pico iron"         unit="molC/m3/s"  grid_ref="grid_T_3D" />
+    <field id="PFeD"        long_name="Primary production of diatoms iron"      unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="xfracal"     long_name="Calcifying fraction"                     unit="1"          grid_ref="grid_T_3D" />
+    <field id="PCAL"        long_name="Calcite production"                      unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="DCAL"        long_name="Calcite dissolution"                     unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="GRAZ1"       long_name="Grazing by microzooplankton"             unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="GRAZ2"       long_name="Grazing by mesozooplankton"              unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="REMIN"       long_name="Oxic remineralization of OM"             unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="DENIT"       long_name="Anoxic remineralization of OM"           unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="REMINP"       long_name="Oxic remineralization rate of POC"      unit="d-1"        grid_ref="grid_T_3D" />
+    <field id="REMING"       long_name="Oxic remineralization rate of GOC"      unit="d-1"        grid_ref="grid_T_3D" />
+    <field id="Nfix"        long_name="Nitrogen fixation"                       unit="mol/m3/s"   grid_ref="grid_T_3D" />
+    <field id="Mumax"       long_name="Maximum growth rate"                     unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MuN"         long_name="Realized growth rate for nanophyto"      unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MuP"         long_name="Realized growth rate for picophyto"      unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MuD"         long_name="Realized growth rate for diatomes"       unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MunetN"      long_name="Net growth rate for nanophyto"           unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MunetP"      long_name="Net growth rate for picophyto"           unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="MunetD"      long_name="Net growth rate for diatomes"            unit="s-1"        grid_ref="grid_T_3D" />
+    <field id="LNnut"       long_name="Nutrient limitation term in Nanophyto"   unit=""           grid_ref="grid_T_3D" />
+    <field id="LPnut"       long_name="Nutrient limitation term in Picophyto"   unit="-"          grid_ref="grid_T_3D" />
+    <field id="LDnut"       long_name="Nutrient limitation term in Diatoms"     unit=""           grid_ref="grid_T_3D" />
+    <field id="LNFe"        long_name="Iron limitation term in Nanophyto"       unit=""           grid_ref="grid_T_3D" />
+    <field id="LPFe"        long_name="Iron limitation term in Picophyto"       unit="-"          grid_ref="grid_T_3D" />
+    <field id="LDFe"        long_name="Iron limitation term in Diatoms"         unit=""           grid_ref="grid_T_3D" />
+    <field id="LNlight"     long_name="Light limitation term in Nanophyto"      unit=""           grid_ref="grid_T_3D" />
+    <field id="LPlight"     long_name="Light limitation term in Picophyto"      unit="-"          grid_ref="grid_T_3D" />
+    <field id="LDlight"     long_name="Light limitation term in Diatoms"        unit=""           grid_ref="grid_T_3D" />
+    <field id="SIZEN"       long_name="Mean relative size of nanophyto."        unit="-"          grid_ref="grid_T_3D" />
+    <field id="SIZEP"       long_name="Mean relative size of picophyto."        unit="-"          grid_ref="grid_T_3D" />
+    <field id="SIZED"       long_name="Mean relative size of diatoms"           unit="-"          grid_ref="grid_T_3D" />
+    <field id="Fe3"         long_name="Iron III concentration"                  unit="nmol/m3"    grid_ref="grid_T_3D" />
+    <field id="FeL1"        long_name="Complexed Iron concentration with L1"    unit="nmol/m3"    grid_ref="grid_T_3D" />
+    <field id="TL1"         long_name="Total L1 concentration"                  unit="nmol/m3"    grid_ref="grid_T_3D" />
+    <field id="pdust"       long_name="dust concentration"                      unit="g/m3"                            />
+    <field id="Totlig"      long_name="Total ligand concentation"               unit="nmol/m3"    grid_ref="grid_T_3D" />
+    <field id="Biron"       long_name="Bioavailable iron"                       unit="nmol/m3"    grid_ref="grid_T_3D" />
+    <field id="Sdenit"      long_name="Nitrate reduction in the sediments"      unit="mol/m2/s"                        />
+    <field id="Ironice"     long_name="Iron input/uptake due to sea ice"        unit="mol/m2/s"                        />
+    <field id="SedCal"      long_name="Calcite burial in the sediments"         unit="molC/m2/s"                       />
+    <field id="SedSi"       long_name="Silicon burial in the sediments"         unit="molSi/m2/s"                      />
+    <field id="SedC"        long_name="Organic C burial in the sediments"       unit="molC/m2/s"                       />
+    <field id="HYDR"        long_name="Iron input from hydrothemal vents"       unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="EPC100"      long_name="Export of carbon particles at 100 m"     unit="mol/m2/s"                        />
+    <field id="EPFE100"     long_name="Export of biogenic iron at 100 m"        unit="mol/m2/s"                        />
+    <field id="EPSI100"     long_name="Export of Silicate at 100 m"             unit="mol/m2/s"                        />
+    <field id="EPCAL100"    long_name="Export of Calcite at 100 m"              unit="mol/m2/s"                        />
+    <field id="EXPC"        long_name="Export of carbon"                        unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="EXPFE"       long_name="Export of biogenic iron"                 unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="EXPSI"       long_name="Export of Silicate"                      unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="EXPCAL"      long_name="Export of Calcite"                       unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="Cflx"        long_name="DIC flux"                                unit="mol/m2/s"                        />
+    <field id="Oflx"        long_name="Oxygen flux"                             unit="mol/m2/s"                        />
+    <field id="Kg"          long_name="Gas transfer"                            unit="mol/m2/s/uatm"                   />
+    <field id="Dpco2"       long_name="Delta CO2"                               unit="uatm"                            />
+    <field id="pCO2sea"     long_name="surface ocean pCO2"                      unit="uatm"                            />
+    <field id="Dpo2"        long_name="Delta O2"                                unit="uatm"                            />
+    <field id="Heup"        long_name="Euphotic layer depth"                    unit="m"                               />
+    <field id="AtmCo2"      long_name="Atmospheric CO2 concentration"           unit="ppm"                               />
+    <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                        />
+    <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"   grid_ref="grid_T_3D" />
+    <field id="FESCAV"      long_name="Scavenging of Iron"                      unit="mmol-Fe/m3/s"   grid_ref="grid_T_3D" />
+    <field id="FECOLL"      long_name="Colloidal Pumping of FeL"                unit="mmol-FeL/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LGWCOLL"     long_name="Coagulation loss of ligands"             unit="mmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="REMINF"      long_name="Oxic remineralization suppy of Fe"       unit="mmol-Fe/m3/s"  grid_ref="grid_T_3D" />
+    <field id="BACT"        long_name="Bacterial Biomass"                       unit="mmol/m3"  grid_ref="grid_T_3D" />
+    <field id="FEBACT"      long_name="Bacterial uptake of Fe"                  unit="molFe/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LPRODR"      long_name="OM remineralisation ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LPRODP"      long_name="phytoplankton ligand production rate"    unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LIGREM"      long_name="Remineralisation loss of ligands"        unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LIGPR"       long_name="Photochemical loss of ligands"           unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LDETP"       long_name="Ligand destruction during phytoplankton uptake" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LPRODZ2"     long_name="mesozooplankton ligand production rate"  unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="LPRODZ"      long_name="microzooplankton ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" />
+    <field id="FEZOO"       long_name="microzooplankton iron recycling rate"    unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" />
+    <field id="FEZOO2"      long_name="mesozooplankton iron recycling rate"     unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" />
+
+    <!-- PISCES tracers trends -->
+    <field id="INTdtAlk"    long_name="Vertically int. of change of alkalinity"             unit="mol/m2/s"                       />
+    <field id="INTdtDIC"    long_name="Vertically int. of change of dissic    "             unit="mol/m2/s"                       />
+    <field id="INTdtFer"    long_name="Vertically int. of change of iron      "             unit="mol/m2/s"                       />
+    <field id="INTdtDIN"    long_name="Vertically int. of change of nitrogen  "             unit="mol/m2/s"                       />
+    <field id="INTdtDIP"    long_name="Vertically int. of change of phophate  "             unit="mol/m2/s"                       />
+    <field id="INTdtSil"    long_name="Vertically int. of change of silicon   "             unit="mol/m2/s"                       />
+
+
+    <!-- dbio_T on T grid : variables available with diaar5 -->
+    <field id="TPP"         long_name="Total Primary production of phyto"                   unit="mol/m3/s"  grid_ref="grid_T_3D" />
+    <field id="TPNEW"       long_name="New Primary production of phyto"                     unit="mol/m3/s"  grid_ref="grid_T_3D" />
+    <field id="TPBFE"       long_name="Total biogenic iron production"                      unit="mol/m3/s"  grid_ref="grid_T_3D" />
+    <field id="INTDIC"      long_name="DIC content"                                         unit="kg/m2"                          />
+    <field id="O2MIN"       long_name="Oxygen minimum concentration"                        unit="mol/m3"                          />
+    <field id="ZO2MIN"      long_name="Depth of oxygen minimum concentration"               unit="m"                              />
+    <field id="INTNFIX"     long_name="Nitrogen fixation rate : vert. integrated"           unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > Nfix * e3t </field >
+    <field id="INTPPPHYN"   long_name="Vertically integrated primary production by nanophy" unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYN * e3t </field >
+    <field id="INTPPPHYD"   long_name="Vertically integrated primary production by diatom"  unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYD * e3t </field >
+    <field id="INTPPPHYP"   long_name="Vertically integrated primary production by picophy" unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PPPHYP * e3t </field >
+    <field id="INTPP"       long_name="Vertically integrated primary production by phyto"   unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPP * e3t </field >
+    <field id="INTPNEW"     long_name="Vertically integrated new primary production"        unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPNEW * e3t </field >
+    <field id="INTPBFE"     long_name="Vertically integrated of biogenic iron production"   unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > TPBFE * e3t </field >
+    <field id="INTPBSI"     long_name="Vertically integrated of biogenic Si production"     unit="mol/m2/s"  grid_ref="grid_T_vsum"  detect_missing_value="true" > PBSi * e3t </field >
+
+    <!-- PISCES light : variables available with key_pisces_reduced -->
+    <field id="FNO3PHY"     long_name="FNO3PHY"                                 unit=""          grid_ref="grid_T_3D" />
+    <field id="FNH4PHY"     long_name="FNH4PHY"                                 unit=""          grid_ref="grid_T_3D" />
+    <field id="FNH4NO3"     long_name="FNH4NO3"                                 unit=""          grid_ref="grid_T_3D" />
+    <field id="TNO3PHY"     long_name="TNO3PHY"                                 unit=""  />
+    <field id="TNH4PHY"     long_name="TNH4PHY"                                 unit=""  />
+    <field id="TPHYDOM"     long_name="TPHYDOM"                                 unit=""  />
+    <field id="TPHYNH4"     long_name="TPHYNH4"                                 unit=""  />
+    <field id="TPHYZOO"     long_name="TPHYZOO"                                 unit=""  />
+    <field id="TPHYDET"     long_name="TPHYDET"                                 unit=""  />
+    <field id="TDETZOO"     long_name="TDETZOO"                                 unit=""  />
+    <field id="TZOODET"     long_name="TZOODET"                                 unit=""  />
+    <field id="TZOOBOD"     long_name="TZOOBOD"                                 unit=""  />
+    <field id="TZOONH4"     long_name="TZOONH4"                                 unit=""  />
+    <field id="TZOODOM"     long_name="TZOODOM"                                 unit=""  />
+    <field id="TNH4NO3"     long_name="TNH4NO3"                                 unit=""  />
+    <field id="TDOMNH4"     long_name="TDOMNH4"                                 unit=""  />
+    <field id="TDETNH4"     long_name="TDETNH4"                                 unit=""  />
+    <field id="TPHYTOT"     long_name="TPHYTOT"                                 unit=""  />
+    <field id="TZOOTOT"     long_name="TZOOTOT"                                 unit=""  />
+    <field id="SEDPOC"      long_name="SEDPOC"                                  unit=""  />
+    <field id="TDETSED"     long_name="TDETSED"                                 unit=""  />
+  </field_group>
+
+  <field_group id="tracer_scalar"  grid_ref="grid_scalar"  >
+    <!-- PISCES scalar  -->
+    <field id="pno3tot"         long_name="Global mean nitrate concentration"                  unit="mol/m3"   />
+    <field id="ppo4tot"         long_name="global mean phosphorus concentration"               unit="mol/m3"   />
+    <field id="psiltot"         long_name="Global mean silicate concentration"                 unit="mol/m3"   />
+    <field id="palktot"         long_name="Global mean alkalinity concentration"               unit="mol/m3"   />
+    <field id="pfertot"         long_name="Global mean iron concentration"                     unit="mol/m3"   />
+    <field id="tcflx"           long_name="Total Flux of Carbon out of the ocean"              unit="mol/s"   />
+    <field id="tcflxcum"        long_name="Cumulative total Flux of Carbon out of the ocean"   unit="mol/s"   />
+    <field id="tcexp"           long_name="Total Carbon export at 100m"                        unit="mol/s"   />
+    <field id="tintpp"          long_name="Global total integrated primary production"         unit="mol/s"   />
+    <field id="tnfix"           long_name="Global total nitrogen fixation"                     unit="mol/s"   />
+    <field id="tdenit"          long_name="Total denitrification"                              unit="mol/s"   />
+  </field_group>
+
+</field_definition>
Index: /NEMO/trunk/cfgs/SHARED/grid_def_nemo.xml
===================================================================
--- /NEMO/trunk/cfgs/SHARED/grid_def_nemo.xml	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/grid_def_nemo.xml	(revision 14072)
@@ -4,377 +4,377 @@
 = grid definition = = DO NOT CHANGE =
 ============================================================================================================
-    -->
-
-    <grid_definition>    
-
-        <!--  -->
-       <grid id="grid_T_2D" >
-         <domain domain_ref="grid_T" />
-       </grid>
-        <!--  -->
-       <grid id="grid_T_ncatice" >
-         <domain domain_ref="grid_T" />
-         <axis axis_ref="ncatice" />
-       </grid>
-        <!--  -->
-       <grid id="grid_T_3D" >
-         <domain domain_ref="grid_T" />
-         <axis axis_ref="deptht" />
-       </grid>
-        <!--  -->
-       <grid id="grid_T_3DS" >
-         <domain domain_ref="grid_T" />
-         <axis axis_ref="profsed" />
-       </grid>
-        <!--  -->
-       <grid id="grid_U_2D" >
-         <domain domain_ref="grid_U" />
-       </grid>
-        <!--  -->
-       <grid id="grid_U_3D" >
-         <domain domain_ref="grid_U" />
-         <axis axis_ref="depthu" />
-       </grid>
-        <!--  -->
-       <grid id="grid_V_2D" >
-         <domain domain_ref="grid_V" />
-       </grid>
-        <!--  -->
-       <grid id="grid_V_3D" >
-         <domain domain_ref="grid_V" />
-         <axis axis_ref="depthv" />
-       </grid>
-        <!--  -->
-       <grid id="grid_W_2D" >
-         <domain domain_ref="grid_W" />
-       </grid>
-        <!--  -->
-       <grid id="grid_W_3D" >
-         <domain domain_ref="grid_W" />
-         <axis axis_ref="depthw" />
-       </grid>
-       <!--  -->
-       <grid id="grid_F_2D" >
-         <domain domain_ref="grid_F" />
-       </grid>
-        <!--  -->
-       <grid id="grid_F_3D" >
-         <domain domain_ref="grid_F" />
-         <axis axis_ref="depthf" />
-       </grid>
-        <!--  -->
-       <grid id="grid_1point" >
-         <domain domain_ref="1point"/>
-       </grid>
-        <!--  -->
-       <grid id="grid_T_nfloat" >
-         <domain domain_ref="grid_T" />
-         <axis axis_ref="nfloat" />
-       </grid>
-        <!--  -->
-       <grid id="grid_EqT" >
-         <domain domain_ref="EqT" />
-       </grid>
-        <!--  -->
-
-
-       <grid id="grid_znl_T_2D">
-         <domain domain_ref="gznl" />
-         <axis axis_ref="basin" />
-       </grid>
-
-       <grid id="grid_znl_T_3D">
-         <domain domain_ref="gznl" />
-         <axis axis_ref="deptht"  />
-         <axis axis_ref="basin" />
-       </grid>
-
-       <grid id="grid_znl_W_3D">
-         <domain domain_ref="gznl" />
-         <axis axis_ref="depthw"  />
-         <axis axis_ref="basin" />
-       </grid>
-
-      <grid id="grid_ptr_T_2D">
-         <domain domain_ref="ptr" />
-         <axis axis_ref="basin" />
-       </grid>
-
-       <grid id="grid_ptr_T_3D">
-         <domain  domain_ref="ptr" />
-         <axis axis_ref="deptht"  />
-         <axis axis_ref="basin" />
-       </grid>
-
-       <grid id="grid_ptr_W_3D">
-         <domain  domain_ref="ptr" />
-         <axis axis_ref="depthw"  />
-         <axis axis_ref="basin" />
-       </grid>
-
-       <grid id="grid_ptr_W_GLO">
-         <domain  domain_ref="ptr" />
-         <axis axis_ref="depthw"  />
-         <scalar>
-           <extract_axis position="0" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_ptr_W_ATL">
-         <domain  domain_ref="ptr" />
-         <axis axis_ref="depthw"  />
-         <scalar>
-           <extract_axis position="1" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_ptr_W_IND">
-         <domain  domain_ref="ptr" />
-         <axis axis_ref="depthw"  />
-         <scalar>
-           <extract_axis position="2" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_T_SFC">
-         <domain domain_ref="grid_T" />
-         <scalar>
-           <extract_axis position="0" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_T_vsum">
-         <domain domain_ref="grid_T"/>
-         <scalar>
-            <reduce_axis operation="sum" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_U_vsum">
-         <domain domain_ref="grid_U"/>
-         <scalar>
-            <reduce_axis operation="sum" />
-         </scalar>
-       </grid>
-
-       <grid id="grid_V_vsum">
-         <domain domain_ref="grid_V"/>
-         <scalar>
-            <reduce_axis operation="sum" />
-         </scalar>
-       </grid>
-
-       <!-- for ORCA2 grid  -->
-       <grid id="cumul_U">
-         <axis axis_ref="cumul_U" n_glo="182" >
-           <reduce_domain local="true" operation="sum" direction="jDir" />
-           <reduce_axis operation="sum" />
-         </axis>
-         <axis axis_ref="depthu" />
-       </grid>
-
-       <!-- for eORCA1 grid
-
-       <grid id="cumul_U">
-         <axis axis_ref="cumul_U" n_glo="362" >
-           <reduce_domain local="true" operation="sum" direction="jDir" />
-           <reduce_axis operation="sum" />
-         </axis>
-         <axis axis_ref="depthu" />
-       </grid>
-
-      -->
-
-
-       <grid id="grid_T_zoom_300">
-         <domain domain_ref="grid_T" />
-         <axis axis_ref="deptht300" />
-       </grid>
-
-       <grid id="grid_U_scalar" >
-         <domain domain_ref="grid_U" />
-         <scalar/>
-       </grid>
-
-       <grid id="grid_V_scalar" >
-         <domain domain_ref="grid_V" />
-         <scalar/>
-       </grid>
- 
-       <grid id="grid_U_4strait">
-         <domain domain_ref="grid_U" />
-         <axis axis_ref="section">
-           <duplicate_scalar/>
-         </axis>
-       </grid>
- 
-       <grid id="grid_V_4strait">
-         <domain domain_ref="grid_V" />
-         <axis axis_ref="section">
-           <duplicate_scalar/>
-         </axis>
-       </grid>
- 
-       <grid id="grid_U_4strait_hsum">
-         <scalar >
-           <reduce_domain operation="sum" local="true"/>
-           <reduce_scalar operation="sum" />
-         </scalar>
-         <axis axis_ref="section"/>
-       </grid>
- 
-       <grid id="grid_V_4strait_hsum">
-         <scalar >
-           <reduce_domain operation="sum" local="true"/>
-           <reduce_scalar operation="sum" />
-         </scalar>
-         <axis axis_ref="section"/>
-       </grid>
- 
-       <grid id="grid_4strait">
-         <axis axis_ref="section"/>
-       </grid>
-
-      <grid id="grid_U_4strait_ice">
-        <domain domain_ref="grid_U" />
-        <axis axis_ref="section_ice">
-          <duplicate_scalar/>
-        </axis>
-      </grid>
-
-      <grid id="grid_V_4strait_ice">
-        <domain domain_ref="grid_V" />
-        <axis axis_ref="section_ice">
-         <duplicate_scalar/>
-        </axis>
-      </grid>
-
-      <grid id="grid_U_4strait_ice_hsum">
-        <scalar >
-         <reduce_domain operation="sum" local="true"/>
-         <reduce_scalar operation="sum" />
-        </scalar>
-        <axis axis_ref="section_ice"/>
-      </grid>
-
-      <grid id="grid_V_4strait_ice_hsum">
-         <scalar >
-          <reduce_domain operation="sum" local="true"/>
-          <reduce_scalar operation="sum" />
-         </scalar>
-         <axis axis_ref="section_ice"/>
-      </grid>
-
-      <grid id="grid_4strait_ice">
-        <axis axis_ref="section_ice"/>
-      </grid>
- 
-      <!-- scalars -->
-      <grid id="grid_scalar" >
-        <scalar/>
-      </grid>
-
-      <!-- ABL grid definition -->
-      <grid id="grid_TA_2D">
-        <domain domain_ref="grid_T" />
-      </grid>
-      <grid id="grid_TA_3D">
-        <domain domain_ref="grid_T" />
-        <axis  id="ght_abl" />
-      </grid>
-      <grid id="grid_WA_3D">
-        <domain domain_ref="grid_T" />
-        <axis  id="ghw_abl" />
-      </grid>
-      <!--  -->
-
-      <!-- grid definitions for multiple-linear-regression analysis (diamlr) -->
-      <grid id="diamlr_grid_scalar" >
-	<scalar />
-	<scalar />
-      </grid>
-      <grid id="diamlr_grid_T_2D" >
-	<domain domain_ref="grid_T" />
-	<scalar />
-      </grid>
-      <grid id="diamlr_grid_U_2D" >
-	<domain domain_ref="grid_U" />
-	<scalar />
-      </grid>
-      <grid id="diamlr_grid_V_2D" >
-	<domain domain_ref="grid_V" />
-	<scalar />
-      </grid>
-      <grid id="diamlr_grid_W_2D" >
-	<domain domain_ref="grid_W" />
-	<scalar />
-      </grid>
-      <grid id="diamlr_grid_2D_to_grid_T_3D" >
-	<domain domain_ref="grid_T" />
-        <axis axis_ref="deptht">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diamlr_grid_2D_to_grid_U_3D" >
-	<domain domain_ref="grid_U" />
-        <axis axis_ref="depthu">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diamlr_grid_2D_to_grid_V_3D" >
-	<domain domain_ref="grid_V" />
-        <axis axis_ref="depthv">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diamlr_grid_2D_to_grid_W_3D" >
-	<domain domain_ref="grid_W" />
-        <axis axis_ref="depthw">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diamlr_grid_2D_to_scalar" >
-        <scalar>
-          <reduce_domain operation="average" />
-        </scalar>
-	<scalar />
-      </grid>
-      <!-- grid definitions for the computation of daily detided model diagnostics (diadetide) -->
-      <grid id="diadetide_grid_T_2D" >
-	<domain domain_ref="grid_T" />
-	<scalar />
-      </grid>
-      <grid id="diadetide_grid_U_2D" >
-	<domain domain_ref="grid_U" />
-	<scalar />
-      </grid>
-      <grid id="diadetide_grid_V_2D" >
-	<domain domain_ref="grid_V" />
-	<scalar />
-      </grid>
-      <grid id="diadetide_grid_2D_to_grid_T_3D" >
-	<domain domain_ref="grid_T" />
-        <axis axis_ref="deptht">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diadetide_grid_2D_to_grid_U_3D" >
-	<domain domain_ref="grid_U" />
-        <axis axis_ref="depthu">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diadetide_grid_2D_to_grid_V_3D" >
-	<domain domain_ref="grid_V" />
-        <axis axis_ref="depthv">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-      <grid id="diadetide_grid_2D_to_grid_W_3D" >
-	<domain domain_ref="grid_W" />
-        <axis axis_ref="depthw">
-          <duplicate_scalar />
-        </axis>
-      </grid>
-
-    </grid_definition>
+-->
+
+<grid_definition>
+
+  <!--  -->
+  <grid id="grid_T_2D" >
+    <domain domain_ref="grid_T" />
+  </grid>
+  <!--  -->
+  <grid id="grid_T_ncatice" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="ncatice" />
+  </grid>
+  <!--  -->
+  <grid id="grid_T_3D" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="deptht" />
+  </grid>
+  <!--  -->
+  <grid id="grid_T_3DS" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="profsed" />
+  </grid>
+  <!--  -->
+  <grid id="grid_U_2D" >
+    <domain domain_ref="grid_U" />
+  </grid>
+  <!--  -->
+  <grid id="grid_U_3D" >
+    <domain domain_ref="grid_U" />
+    <axis axis_ref="depthu" />
+  </grid>
+  <!--  -->
+  <grid id="grid_V_2D" >
+    <domain domain_ref="grid_V" />
+  </grid>
+  <!--  -->
+  <grid id="grid_V_3D" >
+    <domain domain_ref="grid_V" />
+    <axis axis_ref="depthv" />
+  </grid>
+  <!--  -->
+  <grid id="grid_W_2D" >
+    <domain domain_ref="grid_W" />
+  </grid>
+  <!--  -->
+  <grid id="grid_W_3D" >
+    <domain domain_ref="grid_W" />
+    <axis axis_ref="depthw" />
+  </grid>
+  <!--  -->
+  <grid id="grid_F_2D" >
+    <domain domain_ref="grid_F" />
+  </grid>
+  <!--  -->
+  <grid id="grid_F_3D" >
+    <domain domain_ref="grid_F" />
+    <axis axis_ref="depthf" />
+  </grid>
+  <!--  -->
+  <grid id="grid_1point" >
+    <domain domain_ref="1point"/>
+  </grid>
+  <!--  -->
+  <grid id="grid_T_nfloat" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="nfloat" />
+  </grid>
+  <!--  -->
+  <grid id="grid_EqT" >
+    <domain domain_ref="EqT" />
+  </grid>
+  <!--  -->
+
+
+  <grid id="grid_znl_T_2D">
+    <domain domain_ref="gznl" />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_znl_T_3D">
+    <domain domain_ref="gznl" />
+    <axis axis_ref="deptht"  />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_znl_W_3D">
+    <domain domain_ref="gznl" />
+    <axis axis_ref="depthw"  />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_ptr_T_2D">
+    <domain domain_ref="ptr" />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_ptr_T_3D">
+    <domain  domain_ref="ptr" />
+    <axis axis_ref="deptht"  />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_ptr_W_3D">
+    <domain  domain_ref="ptr" />
+    <axis axis_ref="depthw"  />
+    <axis axis_ref="basin" />
+  </grid>
+
+  <grid id="grid_ptr_W_GLO">
+    <domain  domain_ref="ptr" />
+    <axis axis_ref="depthw"  />
+    <scalar>
+      <extract_axis position="0" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_ptr_W_ATL">
+    <domain  domain_ref="ptr" />
+    <axis axis_ref="depthw"  />
+    <scalar>
+      <extract_axis position="1" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_ptr_W_IND">
+    <domain  domain_ref="ptr" />
+    <axis axis_ref="depthw"  />
+    <scalar>
+      <extract_axis position="2" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_T_SFC">
+    <domain domain_ref="grid_T" />
+    <scalar>
+      <extract_axis position="0" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_T_vsum">
+    <domain domain_ref="grid_T"/>
+    <scalar>
+      <reduce_axis operation="sum" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_U_vsum">
+    <domain domain_ref="grid_U"/>
+    <scalar>
+      <reduce_axis operation="sum" />
+    </scalar>
+  </grid>
+
+  <grid id="grid_V_vsum">
+    <domain domain_ref="grid_V"/>
+    <scalar>
+      <reduce_axis operation="sum" />
+    </scalar>
+  </grid>
+
+  <!-- for ORCA2 grid  -->
+  <grid id="cumul_U">
+    <axis axis_ref="cumul_U" n_glo="182" >
+      <reduce_domain local="true" operation="sum" direction="jDir" />
+      <reduce_axis operation="sum" />
+    </axis>
+    <axis axis_ref="depthu" />
+  </grid>
+
+  <!-- for eORCA1 grid
+
+<grid id="cumul_U">
+<axis axis_ref="cumul_U" n_glo="362" >
+<reduce_domain local="true" operation="sum" direction="jDir" />
+<reduce_axis operation="sum" />
+</axis>
+<axis axis_ref="depthu" />
+</grid>
+
+  -->
+
+
+  <grid id="grid_T_zoom_300">
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="deptht300" />
+  </grid>
+
+  <grid id="grid_U_scalar" >
+    <domain domain_ref="grid_U" />
+    <scalar/>
+  </grid>
+
+  <grid id="grid_V_scalar" >
+    <domain domain_ref="grid_V" />
+    <scalar/>
+  </grid>
+
+  <grid id="grid_U_4strait">
+    <domain domain_ref="grid_U" />
+    <axis axis_ref="section">
+      <duplicate_scalar/>
+    </axis>
+  </grid>
+
+  <grid id="grid_V_4strait">
+    <domain domain_ref="grid_V" />
+    <axis axis_ref="section">
+      <duplicate_scalar/>
+    </axis>
+  </grid>
+
+  <grid id="grid_U_4strait_hsum">
+    <scalar >
+      <reduce_domain operation="sum" local="true"/>
+      <reduce_scalar operation="sum" />
+    </scalar>
+    <axis axis_ref="section"/>
+  </grid>
+
+  <grid id="grid_V_4strait_hsum">
+    <scalar >
+      <reduce_domain operation="sum" local="true"/>
+      <reduce_scalar operation="sum" />
+    </scalar>
+    <axis axis_ref="section"/>
+  </grid>
+
+  <grid id="grid_4strait">
+    <axis axis_ref="section"/>
+  </grid>
+
+  <grid id="grid_U_4strait_ice">
+    <domain domain_ref="grid_U" />
+    <axis axis_ref="section_ice">
+      <duplicate_scalar/>
+    </axis>
+  </grid>
+
+  <grid id="grid_V_4strait_ice">
+    <domain domain_ref="grid_V" />
+    <axis axis_ref="section_ice">
+      <duplicate_scalar/>
+    </axis>
+  </grid>
+
+  <grid id="grid_U_4strait_ice_hsum">
+    <scalar >
+      <reduce_domain operation="sum" local="true"/>
+      <reduce_scalar operation="sum" />
+    </scalar>
+    <axis axis_ref="section_ice"/>
+  </grid>
+
+  <grid id="grid_V_4strait_ice_hsum">
+    <scalar >
+      <reduce_domain operation="sum" local="true"/>
+      <reduce_scalar operation="sum" />
+    </scalar>
+    <axis axis_ref="section_ice"/>
+  </grid>
+
+  <grid id="grid_4strait_ice">
+    <axis axis_ref="section_ice"/>
+  </grid>
+
+  <!-- scalars -->
+  <grid id="grid_scalar" >
+    <scalar/>
+  </grid>
+
+  <!-- ABL grid definition -->
+  <grid id="grid_TA_2D">
+    <domain domain_ref="grid_T" />
+  </grid>
+  <grid id="grid_TA_3D">
+    <domain domain_ref="grid_T" />
+    <axis  id="ght_abl" />
+  </grid>
+  <grid id="grid_WA_3D">
+    <domain domain_ref="grid_T" />
+    <axis  id="ghw_abl" />
+  </grid>
+  <!--  -->
+
+  <!-- grid definitions for multiple-linear-regression analysis (diamlr) -->
+  <grid id="diamlr_grid_scalar" >
+    <scalar />
+    <scalar />
+  </grid>
+  <grid id="diamlr_grid_T_2D" >
+    <domain domain_ref="grid_T" />
+    <scalar />
+  </grid>
+  <grid id="diamlr_grid_U_2D" >
+    <domain domain_ref="grid_U" />
+    <scalar />
+  </grid>
+  <grid id="diamlr_grid_V_2D" >
+    <domain domain_ref="grid_V" />
+    <scalar />
+  </grid>
+  <grid id="diamlr_grid_W_2D" >
+    <domain domain_ref="grid_W" />
+    <scalar />
+  </grid>
+  <grid id="diamlr_grid_2D_to_grid_T_3D" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="deptht">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diamlr_grid_2D_to_grid_U_3D" >
+    <domain domain_ref="grid_U" />
+    <axis axis_ref="depthu">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diamlr_grid_2D_to_grid_V_3D" >
+    <domain domain_ref="grid_V" />
+    <axis axis_ref="depthv">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diamlr_grid_2D_to_grid_W_3D" >
+    <domain domain_ref="grid_W" />
+    <axis axis_ref="depthw">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diamlr_grid_2D_to_scalar" >
+    <scalar>
+      <reduce_domain operation="average" />
+    </scalar>
+    <scalar />
+  </grid>
+  <!-- grid definitions for the computation of daily detided model diagnostics (diadetide) -->
+  <grid id="diadetide_grid_T_2D" >
+    <domain domain_ref="grid_T" />
+    <scalar />
+  </grid>
+  <grid id="diadetide_grid_U_2D" >
+    <domain domain_ref="grid_U" />
+    <scalar />
+  </grid>
+  <grid id="diadetide_grid_V_2D" >
+    <domain domain_ref="grid_V" />
+    <scalar />
+  </grid>
+  <grid id="diadetide_grid_2D_to_grid_T_3D" >
+    <domain domain_ref="grid_T" />
+    <axis axis_ref="deptht">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diadetide_grid_2D_to_grid_U_3D" >
+    <domain domain_ref="grid_U" />
+    <axis axis_ref="depthu">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diadetide_grid_2D_to_grid_V_3D" >
+    <domain domain_ref="grid_V" />
+    <axis axis_ref="depthv">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+  <grid id="diadetide_grid_2D_to_grid_W_3D" >
+    <domain domain_ref="grid_W" />
+    <axis axis_ref="depthw">
+      <duplicate_scalar />
+    </axis>
+  </grid>
+
+</grid_definition>
Index: /NEMO/trunk/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/trunk/cfgs/SHARED/namelist_ref	(revision 14071)
+++ /NEMO/trunk/cfgs/SHARED/namelist_ref	(revision 14072)
@@ -257,25 +257,35 @@
 !-----------------------------------------------------------------------
    !                    !  bulk algorithm :
-   ln_NCAR      = .true.    ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .false.   ! "COARE 3.6" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .false.   ! "ECMWF"     algorithm   (IFS cycle 45r1)
-      !
-      rn_zqt     = 10.      !  Air temperature & humidity reference height (m)
-      rn_zu      = 10.      !  Wind vector reference height (m)
-      ln_Cd_L12  = .false.  !  air-ice drags = F(ice conc.) (Lupkes et al. 2012)
-      ln_Cd_L15  = .false.  !  air-ice drags = F(ice conc.) (Lupkes et al. 2015)
-      ln_crt_fbk = .false.     !  Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
+   ln_NCAR      = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       = 10.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 5       !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization  => use at least nn_iter_algo > 10
+      ln_skin_wl   = .false. !  use the warm-layer parameterization => use at least nn_iter_algo > 10
+   !
+   rn_pfac    = 1.          !  multipl. factor for precipitation (total & snow)
+   rn_efac    = 1.          !  multipl. factor for evaporation (0. or 1.)
+   !
+   ln_crt_fbk = .false.     !  Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
          rn_stau_a = -2.9e-3   !     Alpha from eq. 10: Stau = Alpha * Wnd + Beta
          rn_stau_b =  8.0e-3   !     Beta 
-      rn_pfac    = 1.       !  multipl. factor for precipitation (total & snow)
-      rn_efac    = 1.       !  multipl. factor for evaporation (0. or 1.)
-      ln_skin_cs = .false.  !  use the cool-skin parameterization
-      ln_skin_wl = .false.  !  use the warm-layer parameterization
-      !                     !   ==> only available in ECMWF and COARE algorithms
-      ln_humi_sph = .true.  !  humidity "sn_humi" is specific humidity  [kg/kg]
-      ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
-      ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-      ln_tpot     = .true.  !!GS: compute potential temperature or not
+   !
+   ln_humi_sph = .true.  !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !!   
+   !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+   ln_Cx_ice_cst = .true.     ! use constant ice-air bulk transfer coefficients (value given below)
+      rn_Cd_i  = 1.4e-3       ! sea-ice drag coefficient
+      rn_Ce_i  = 1.4e-3       !    "    sublimation coefficient
+      rn_Ch_i  = 1.4e-3       !    "    sensible heat flux coefficient
+   ln_Cx_ice_AN05  = .false.  !  (Andreas et al. 2005)
+   ln_Cx_ice_LU12  = .false.  !  (Lupkes et al. 2012)
+   ln_Cx_ice_LG15  = .false.  !  (Lupkes & Gryanik 2015)
    !
    cn_dir      = './'      !  root directory for the bulk data location
@@ -404,4 +414,9 @@
    sn_e3t      = 'sas_grid_T'            ,       120.        , 'e3t_m'   ,   .true.    , .true. , 'yearly'  ,    ''            ,    ''    ,    ''
    sn_frq      = 'sas_grid_T'            ,       120.        , 'frq_m'   ,   .true.    , .true. , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+   !! Following only needed with STATION_ASF compiled with "sea-ice" support: "key_si3" (ice fraction, ice surface temperature and sea-ice albedo:
+   sn_ifr  = 'NOT USED'                  , 1.         , 'siconc'  ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tic  = 'NOT USED'                  , 1.         , 'istl1'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ial  = 'NOT USED'                  , 1.         , 'fal'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
 /
 !-----------------------------------------------------------------------
Index: /NEMO/trunk/src/ABL/ablmod.F90
===================================================================
--- /NEMO/trunk/src/ABL/ablmod.F90	(revision 14071)
+++ /NEMO/trunk/src/ABL/ablmod.F90	(revision 14072)
@@ -18,6 +18,6 @@
    USE dom_oce, ONLY  : tmask
    USE sbc_oce, ONLY  : ght_abl, ghw_abl, e3t_abl, e3w_abl, jpka, jpkam1, rhoa
-   USE sbcblk         ! use rn_efac, cdn_oce
-   USE sbcblk_phy     ! use some physical constants for flux computation
+   USE sbcblk         ! use rn_efac
+   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
    !
    USE prtctl         ! Print control                    (prt_ctl routine)
@@ -135,6 +135,10 @@
          ustar2(ji,jj) = zzoce
 #endif
-         zrough(ji,jj) = ght_abl(2) * EXP( - vkarmn / SQRT( MAX( Cdn_oce(ji,jj), 1.e-4 ) ) ) !<-- recover the value of z0 from Cdn_oce
+         !#LB: sorry Cdn_oce is gone:
+         !zrough(ji,jj) = ght_abl(2) * EXP( - vkarmn / SQRT( MAX( Cdn_oce(ji,jj), 1.e-4 ) ) ) !<-- recover the value of z0 from Cdn_oce
       END_2D
+
+      zrough(:,:) = z0_from_Cd( ght_abl(2), pCd_du(:,:) / MAX( pwndm(:,:), 0.5_wp ) ) ! #LB: z0_from_Cd is define in sbc_phy.F90...
+
       !
       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -252,5 +256,5 @@
                   &                     + rDt_abl * fft_abl(ji, jj) * v_abl( ji, jj, jk, nt_n ) )  &
                   &                               / (1._wp + gamma_Cor*gamma_Cor*zcff)
-   
+
                v_abl( ji, jj, jk, nt_a ) =  e3t_abl(jk) *(                                         &
                   &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * v_abl( ji, jj, jk, nt_n )    &
@@ -590,6 +594,6 @@
 
       DO_2D( 0, 1, 0, 1 )
-         zwnd_i(ji,jj) = u_abl(ji  ,jj,2,nt_a) - 0.5_wp * ( pssu(ji  ,jj) + pssu(ji-1,jj) )  
-         zwnd_j(ji,jj) = v_abl(ji,jj  ,2,nt_a) - 0.5_wp * ( pssv(ji,jj  ) + pssv(ji,jj-1) ) 
+         zwnd_i(ji,jj) = u_abl(ji  ,jj,2,nt_a) - 0.5_wp * ( pssu(ji  ,jj) + pssu(ji-1,jj) )
+         zwnd_j(ji,jj) = v_abl(ji,jj  ,2,nt_a) - 0.5_wp * ( pssv(ji,jj  ) + pssv(ji,jj-1) )
       END_2D
       !
@@ -633,5 +637,5 @@
       !    Wind stress relative to the moving ice ( U10m - U_ice )   !
       ! ------------------------------------------------------------ !
-      DO_2D( 0, 0, 0, 0 )           
+      DO_2D( 0, 0, 0, 0 )
          ptaui_ice(ji,jj) = 0.5_wp * ( rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj) + rhoa(ji,jj) * pCd_du_ice(ji,jj)      )   &
             &                      * ( 0.5_wp * ( u_abl(ji+1,jj,2,nt_a) + u_abl(ji,jj,2,nt_a) ) - pssu_ice(ji,jj) )
Index: /NEMO/trunk/src/ABL/sbcabl.F90
===================================================================
--- /NEMO/trunk/src/ABL/sbcabl.F90	(revision 14071)
+++ /NEMO/trunk/src/ABL/sbcabl.F90	(revision 14072)
@@ -22,5 +22,5 @@
    USE sbc_oce        ! Surface boundary condition: ocean fields
    USE sbcblk         ! Surface boundary condition: bulk formulae
-   USE sbcblk_phy     ! Surface boundary condition: bulk formulae
+   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
    USE dom_oce, ONLY  : tmask
    !
@@ -175,6 +175,6 @@
          IF(nn_amxl==0) WRITE(numout,*) 'Deardorff 80 length-scale '
          IF(nn_amxl==1) WRITE(numout,*) 'Modified Deardorff 80 length-scale '
-         IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale '		 
-         IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale '	
+         IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale '
+         IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale '
          WRITE(numout,*) ' Minimum value of atmospheric TKE           = ',tke_min,' m^2 s^-2'
          WRITE(numout,*) ' Minimum value of atmospheric mixing length = ',mxl_min,' m'
@@ -320,5 +320,5 @@
       INTEGER ,         INTENT(in) ::   kt   ! ocean time step
       !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zssq, zcd_du, zsen, zevp
+      REAL(wp), DIMENSION(jpi,jpj) ::   zssq, zcd_du, zsen, zlat, zevp
 #if defined key_si3
       REAL(wp), DIMENSION(jpi,jpj) ::   zssqi, zcd_dui, zseni, zevpi
@@ -344,5 +344,5 @@
             &                sf(jp_uoatm)%fnow(:,:,1), sf(jp_voatm)%fnow(:,:,1),   &   !   <<= in
             &                sf(jp_qsr )%fnow(:,:,1) , sf(jp_qlw )%fnow(:,:,1) ,   &   !   <<= in
-            &                tsk_m, zssq, zcd_du, zsen, zevp                       )   !   =>> out
+            &                tsk_m, zssq, zcd_du, zsen, zlat, zevp                 )   !   =>> out
 
 #if defined key_si3
@@ -356,5 +356,5 @@
          !! 3 - Advance ABL variables from now (n) to after (n+1)
          !!-------------------------------------------------------------------------------------------
-   
+
          CALL abl_stp( kt, tsk_m, ssu_m, ssv_m, zssq,                          &   !   <<= in
             &              sf(jp_wndi)%fnow(:,:,:), sf(jp_wndj)%fnow(:,:,:),   &   !   <<= in
@@ -375,9 +375,8 @@
          !!-------------------------------------------------------------------------------------------
 
-         CALL blk_oce_2( tq_abl(:,:,2,nt_n,jp_ta),                            &
-            &            sf(jp_qsr )%fnow(:,:,1) , sf(jp_qlw )%fnow(:,:,1),   &
+         CALL blk_oce_2( tq_abl(:,:,2,nt_n,jp_ta), sf(jp_qlw )%fnow(:,:,1),   &
             &            sf(jp_prec)%fnow(:,:,1) , sf(jp_snow)%fnow(:,:,1),   &
-            &            tsk_m, zsen, zevp                                )
-   
+            &            tsk_m, zsen, zlat, zevp                                )
+
          CALL abl_rst_opn( kt )                       ! Open abl restart file (if necessary)
          IF( lrst_abl ) CALL abl_rst_write( kt )      ! -- abl restart file
Index: /NEMO/trunk/src/ICE/ice.F90
===================================================================
--- /NEMO/trunk/src/ICE/ice.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/ice.F90	(revision 14072)
@@ -64,8 +64,8 @@
    !! sv_i        |      -      |    Sea ice salt content         | pss.m |
    !! oa_i        |      -      |    Sea ice areal age content    | s     |
-   !! e_i         |             |    Ice enthalpy                 | J/m2  | 
-   !!             |    e_i_1d   |    Ice enthalpy per unit vol.   | J/m3  | 
-   !! e_s         |             |    Snow enthalpy                | J/m2  | 
-   !!             |    e_s_1d   |    Snow enthalpy per unit vol.  | J/m3  | 
+   !! e_i         |             |    Ice enthalpy                 | J/m2  |
+   !!             |    e_i_1d   |    Ice enthalpy per unit vol.   | J/m3  |
+   !! e_s         |             |    Snow enthalpy                | J/m2  |
+   !!             |    e_s_1d   |    Snow enthalpy per unit vol.  | J/m3  |
    !! a_ip        |      -      |    Ice pond concentration       |       |
    !! v_ip        |      -      |    Ice pond volume per unit area| m     |
@@ -108,7 +108,7 @@
    !! tm_i        |      -      |    Mean sea ice temperature     | K     |
    !! tm_s        |      -      |    Mean snow    temperature     | K     |
-   !! et_i        |      -      |    Total ice enthalpy           | J/m2  | 
-   !! et_s        |      -      |    Total snow enthalpy          | J/m2  | 
-   !! bv_i        |      -      |    relative brine volume        | ???   | 
+   !! et_i        |      -      |    Total ice enthalpy           | J/m2  |
+   !! et_s        |      -      |    Total snow enthalpy          | J/m2  |
+   !! bv_i        |      -      |    relative brine volume        | ???   |
    !! at_ip       |      -      |    Total ice pond concentration |       |
    !! hm_ip       |      -      |    Mean ice pond depth          | m     |
@@ -122,7 +122,7 @@
    !!----------------------------------------------------------------------
    !                                     !!** ice-generic parameters namelist (nampar) **
-   INTEGER           , PUBLIC ::   jpl              !: number of ice  categories 
-   INTEGER           , PUBLIC ::   nlay_i           !: number of ice  layers 
-   INTEGER           , PUBLIC ::   nlay_s           !: number of snow layers 
+   INTEGER           , PUBLIC ::   jpl              !: number of ice  categories
+   INTEGER           , PUBLIC ::   nlay_i           !: number of ice  layers
+   INTEGER           , PUBLIC ::   nlay_s           !: number of snow layers
    LOGICAL           , PUBLIC ::   ln_virtual_itd   !: virtual ITD mono-category parameterization (T) or not (F)
    LOGICAL           , PUBLIC ::   ln_icedyn        !: flag for ice dynamics (T) or not (F)
@@ -137,10 +137,10 @@
    !                                     !!** ice-itd namelist (namitd) **
    REAL(wp), PUBLIC ::   rn_himin         !: minimum ice thickness
-   
+
    !                                     !!** ice-dynamics namelist (namdyn) **
    REAL(wp), PUBLIC ::   rn_ishlat        !: lateral boundary condition for sea-ice
-   LOGICAL , PUBLIC ::   ln_landfast_L16  !: landfast ice parameterizationfrom lemieux2016 
+   LOGICAL , PUBLIC ::   ln_landfast_L16  !: landfast ice parameterizationfrom lemieux2016
    REAL(wp), PUBLIC ::   rn_lf_depfra     !:    fraction of ocean depth that ice must reach to initiate landfast ice
-   REAL(wp), PUBLIC ::   rn_lf_bfr        !:    maximum bottom stress per unit area of contact (lemieux2016) or per unit volume (home) 
+   REAL(wp), PUBLIC ::   rn_lf_bfr        !:    maximum bottom stress per unit area of contact (lemieux2016) or per unit volume (home)
    REAL(wp), PUBLIC ::   rn_lf_relax      !:    relaxation time scale (s-1) to reach static friction
    REAL(wp), PUBLIC ::   rn_lf_tensile    !:    isotropic tensile strength
@@ -153,10 +153,10 @@
    LOGICAL , PUBLIC ::   ln_rhg_EVP       ! EVP rheology switch, used for rdgrft and rheology
    LOGICAL , PUBLIC ::   ln_rhg_EAP       ! EAP rheology switch, used for rdgrft and rheology
-   LOGICAL , PUBLIC ::   ln_aEVP          !: using adaptive EVP (T or F) 
+   LOGICAL , PUBLIC ::   ln_aEVP          !: using adaptive EVP (T or F)
    REAL(wp), PUBLIC ::   rn_creepl        !: creep limit (has to be low enough, circa 10-9 m/s, depending on rheology)
    REAL(wp), PUBLIC ::   rn_ecc           !: eccentricity of the elliptical yield curve
    INTEGER , PUBLIC ::   nn_nevp          !: number of iterations for subcycling
-   REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rDt_ice (1/3 or 1/9 depending on nb of subcycling nevp) 
-   INTEGER , PUBLIC ::   nn_rhg_chkcvg    !: check ice rheology convergence 
+   REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rDt_ice (1/3 or 1/9 depending on nb of subcycling nevp)
+   INTEGER , PUBLIC ::   nn_rhg_chkcvg    !: check ice rheology convergence
    ! -- vp
    LOGICAL , PUBLIC ::   ln_rhg_VP        !: VP rheology
@@ -181,10 +181,10 @@
    INTEGER , PUBLIC ::   nn_flxdist       !: Redistribute heat flux over ice categories
    !                                      !   =-1  Do nothing (needs N(cat) fluxes)
-   !                                      !   = 0  Average N(cat) fluxes then apply the average over the N(cat) ice 
+   !                                      !   = 0  Average N(cat) fluxes then apply the average over the N(cat) ice
    !                                      !   = 1  Average N(cat) fluxes then redistribute over the N(cat) ice using T-ice and albedo sensitivity
    !                                      !   = 2  Redistribute a single flux over categories
                                           ! -- icethd_zdf -- !
-   LOGICAL , PUBLIC ::   ln_cndflx        !: use conduction flux as surface boundary condition (instead of qsr and qns) 
-   LOGICAL , PUBLIC ::   ln_cndemulate    !: emulate conduction flux (if not provided) 
+   LOGICAL , PUBLIC ::   ln_cndflx        !: use conduction flux as surface boundary condition (instead of qsr and qns)
+   LOGICAL , PUBLIC ::   ln_cndemulate    !: emulate conduction flux (if not provided)
    !                                      ! Conduction flux as surface forcing or not
    INTEGER, PUBLIC, PARAMETER ::   np_cnd_OFF = 0  !: no forcing from conduction flux (ice thermodynamics forced via qsr and qns)
@@ -192,5 +192,5 @@
    INTEGER, PUBLIC, PARAMETER ::   np_cnd_EMU = 2  !: emulate conduction flux via icethd_zdf.F90 (BL99) (1st round compute qcn and qsr_tr, 2nd round use it)
    INTEGER, PUBLIC ::   nn_qtrice         !: Solar flux transmitted thru the surface scattering layer:
-   !                                      !   = 0  Grenfell and Maykut 1977 (depends on cloudiness and is 0 when there is snow) 
+   !                                      !   = 0  Grenfell and Maykut 1977 (depends on cloudiness and is 0 when there is snow)
    !                                      !   = 1  Lebrun 2019 (equals 0.3 anytime with different melting/dry snw conductivities)
    !
@@ -198,5 +198,5 @@
    LOGICAL , PUBLIC ::   ln_cndi_U64      !: thermal conductivity: Untersteiner (1964)
    LOGICAL , PUBLIC ::   ln_cndi_P07      !: thermal conductivity: Pringle et al (2007)
-   REAL(wp), PUBLIC ::   rn_cnd_s         !: thermal conductivity of the snow [W/m/K]   
+   REAL(wp), PUBLIC ::   rn_cnd_s         !: thermal conductivity of the snow [W/m/K]
    REAL(wp), PUBLIC ::   rn_kappa_i       !: coef. for the extinction of radiation in sea ice, Grenfell et al. (2006) [1/m]
    REAL(wp), PUBLIC ::   rn_kappa_s       !: coef. for the extinction of radiation in snw (nn_qtrice=0) [1/m]
@@ -236,15 +236,15 @@
    INTEGER , PUBLIC ::   jiceprt          !: debug j-point
 
-   !                                     !!** some other parameters 
+   !                                     !!** some other parameters
    INTEGER , PUBLIC ::   kt_ice           !: iteration number
    REAL(wp), PUBLIC ::   rDt_ice          !: ice time step
    REAL(wp), PUBLIC ::   r1_Dt_ice        !: = 1. / rDt_ice
    REAL(wp), PUBLIC ::   r1_nlay_i        !: 1 / nlay_i
-   REAL(wp), PUBLIC ::   r1_nlay_s        !: 1 / nlay_s 
+   REAL(wp), PUBLIC ::   r1_nlay_s        !: 1 / nlay_s
    REAL(wp), PUBLIC ::   rswitch          !: switch for the presence of ice (1) or not (0)
    REAL(wp), PUBLIC ::   rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft   !: conservation diagnostics
-   REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number 
-   REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number 
-   REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number 
+   REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number
+   REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number
+   REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number
 
    !                                     !!** define arrays
@@ -259,5 +259,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdg_conv
    !
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   t_bo            !: Sea-Ice bottom temperature [Kelvin]     
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   t_bo            !: Sea-Ice bottom temperature [Kelvin]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qlead           !: heat balance of the lead (or of the open ocean)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qsb_ice_bot     !: net downward heat flux from the ice to the ocean
@@ -306,5 +306,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qt_atm_oi       !: heat flux at the interface atm-[oce+ice]            [W.m-2]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qt_oce_ai       !: heat flux at the interface oce-[atm+ice]            [W.m-2]
-   
+
    ! heat flux associated with ice-atmosphere mass exchange
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hfx_sub         !: heat flux for sublimation            [W.m-2]
@@ -389,10 +389,10 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   u_ice_b, v_ice_b           !: ice velocity
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   at_i_b                     !: ice concentration (total)
-            
+
    !!----------------------------------------------------------------------
    !! * Ice thickness distribution variables
    !!----------------------------------------------------------------------
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_max            !: Boundary of ice thickness categories in thickness space
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean           !: Mean ice thickness in catgories 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean           !: Mean ice thickness in catgories
    !
    !!----------------------------------------------------------------------
@@ -405,10 +405,10 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_trp_sv       !: transport of salt content
    !
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_heat         !: snw/ice heat content variation   [W/m2] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_sice         !: ice salt content variation   [] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vice         !: ice volume variation   [m/s] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vsnw         !: snw volume variation   [m/s] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_aice         !: ice conc.  variation   [s-1] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vpnd         !: pond volume variation  [m/s] 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_heat         !: snw/ice heat content variation   [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_sice         !: ice salt content variation   []
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vice         !: ice volume variation   [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vsnw         !: snw volume variation   [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_aice         !: ice conc.  variation   [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vpnd         !: pond volume variation  [m/s]
    !
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_adv_mass     !: advection of mass (kg/m2/s)
@@ -430,6 +430,6 @@
    !!----------------------------------------------------------------------
    ! Extra sea ice diagnostics to address the data request
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_si            !: Temperature at Snow-ice interface (K) 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tm_si           !: mean temperature at the snow-ice interface (K) 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_si            !: Temperature at Snow-ice interface (K)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tm_si           !: mean temperature at the snow-ice interface (K)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice_bot     !: Bottom  conduction flux (W/m2)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice_top     !: Surface conduction flux (W/m2)
@@ -469,5 +469,5 @@
          &      sfx_res    (jpi,jpj) , sfx_bri   (jpi,jpj) , sfx_dyn(jpi,jpj) , sfx_sub(jpi,jpj) , sfx_lam(jpi,jpj) ,  &
          &      sfx_bog    (jpi,jpj) , sfx_bom   (jpi,jpj) , sfx_sum(jpi,jpj) , sfx_sni(jpi,jpj) , sfx_opw(jpi,jpj) ,  &
-         &      hfx_res    (jpi,jpj) , hfx_snw   (jpi,jpj) , hfx_sub(jpi,jpj) ,                        & 
+         &      hfx_res    (jpi,jpj) , hfx_snw   (jpi,jpj) , hfx_sub(jpi,jpj) ,                        &
          &      qt_atm_oi  (jpi,jpj) , qt_oce_ai (jpi,jpj) , fhld   (jpi,jpj) ,                        &
          &      hfx_sum    (jpi,jpj) , hfx_bom   (jpi,jpj) , hfx_bog(jpi,jpj) , hfx_dif(jpi,jpj) ,     &
@@ -513,5 +513,5 @@
       ii = ii + 1
       ALLOCATE( u_ice_b(jpi,jpj) , v_ice_b(jpi,jpj) , at_i_b(jpi,jpj) , STAT=ierr(ii) )
-      
+
       ! * Ice thickness distribution variables
       ii = ii + 1
@@ -520,5 +520,5 @@
       ! * Ice diagnostics
       ii = ii + 1
-      ALLOCATE( diag_trp_vi(jpi,jpj) , diag_trp_vs (jpi,jpj) , diag_trp_ei(jpi,jpj),                      & 
+      ALLOCATE( diag_trp_vi(jpi,jpj) , diag_trp_vs (jpi,jpj) , diag_trp_ei(jpi,jpj),                      &
          &      diag_trp_es(jpi,jpj) , diag_trp_sv (jpi,jpj) , diag_heat  (jpi,jpj),                      &
          &      diag_sice  (jpi,jpj) , diag_vice   (jpi,jpj) , diag_vsnw  (jpi,jpj), diag_aice(jpi,jpj), diag_vpnd(jpi,jpj),  &
@@ -527,7 +527,7 @@
       ! * Ice conservation
       ii = ii + 1
-      ALLOCATE( diag_v (jpi,jpj) , diag_s (jpi,jpj) , diag_t (jpi,jpj),   & 
+      ALLOCATE( diag_v (jpi,jpj) , diag_s (jpi,jpj) , diag_t (jpi,jpj),   &
          &      diag_fv(jpi,jpj) , diag_fs(jpi,jpj) , diag_ft(jpi,jpj), STAT=ierr(ii) )
-      
+
       ! * SIMIP diagnostics
       ii = ii + 1
Index: /NEMO/trunk/src/ICE/icectl.F90
===================================================================
--- /NEMO/trunk/src/ICE/icectl.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icectl.F90	(revision 14072)
@@ -12,5 +12,5 @@
    !!   'key_si3'                                       SI3 sea-ice model
    !!----------------------------------------------------------------------
-   !!    ice_cons_hsm     : conservation tests on heat, salt and mass during a  time step (global) 
+   !!    ice_cons_hsm     : conservation tests on heat, salt and mass during a  time step (global)
    !!    ice_cons_final   : conservation tests on heat, salt and mass at end of time step (global)
    !!    ice_cons2D       : conservation tests on heat, salt and mass at each gridcell
@@ -55,7 +55,7 @@
    CHARACTER(LEN=50)   ::   clname="icedrift_diagnostics.ascii"   ! ascii filename
    INTEGER             ::   numicedrift                           ! outfile unit
-   REAL(wp)            ::   rdiag_icemass, rdiag_icesalt, rdiag_iceheat 
-   REAL(wp)            ::   rdiag_adv_icemass, rdiag_adv_icesalt, rdiag_adv_iceheat 
-   
+   REAL(wp)            ::   rdiag_icemass, rdiag_icesalt, rdiag_iceheat
+   REAL(wp)            ::   rdiag_adv_icemass, rdiag_adv_icesalt, rdiag_adv_iceheat
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -77,6 +77,6 @@
       !!              It prints in ocean.output if there is a violation of conservation at each time-step
       !!              The thresholds (zchk_m, zchk_s, zchk_t) determine violations
-      !!              For salt and heat thresholds, ice is considered to have a salinity of 10 
-      !!              and a heat content of 3e5 J/kg (=latent heat of fusion) 
+      !!              For salt and heat thresholds, ice is considered to have a salinity of 10
+      !!              and a heat content of 3e5 J/kg (=latent heat of fusion)
       !!-------------------------------------------------------------------
       INTEGER         , INTENT(in)    ::   icount        ! called at: =0 the begining of the routine, =1  the end
@@ -148,5 +148,5 @@
          zetrp = glob_sum( 'icectl', diag_adv_heat * e1e2t )
 
-         ! ice area (+epsi10 to set a threshold > 0 when there is no ice) 
+         ! ice area (+epsi10 to set a threshold > 0 when there is no ice)
          zarea = glob_sum( 'icectl', SUM( a_i + epsi10, dim=3 ) * e1e2t )
 
@@ -191,6 +191,6 @@
       !!              It prints in ocean.output if there is a violation of conservation at each time-step
       !!              The thresholds (zchk_m, zchk_s, zchk_t) determine the violations
-      !!              For salt and heat thresholds, ice is considered to have a salinity of 10 
-      !!              and a heat content of 3e5 J/kg (=latent heat of fusion) 
+      !!              For salt and heat thresholds, ice is considered to have a salinity of 10
+      !!              and a heat content of 3e5 J/kg (=latent heat of fusion)
       !!-------------------------------------------------------------------
       CHARACTER(len=*), INTENT(in) ::   cd_routine    ! name of the routine
@@ -214,5 +214,5 @@
       !!   &                                          ) * e1e2t )
 
-      ! ice area (+epsi10 to set a threshold > 0 when there is no ice) 
+      ! ice area (+epsi10 to set a threshold > 0 when there is no ice)
       zarea = glob_sum( 'icectl', SUM( a_i + epsi10, dim=3 ) * e1e2t )
 
@@ -243,5 +243,5 @@
       !!
       REAL(wp), DIMENSION(jpi,jpj) ::   zdiag_mass, zdiag_salt, zdiag_heat, &
-         &                              zdiag_amin, zdiag_vmin, zdiag_smin, zdiag_emin !!, zdiag_amax  
+         &                              zdiag_amin, zdiag_vmin, zdiag_smin, zdiag_emin !!, zdiag_amax
       INTEGER ::   jl, jk
       LOGICAL ::   ll_stop_m = .FALSE.
@@ -261,7 +261,7 @@
             &       wfx_snw_sni + wfx_snw_sum + wfx_snw_dyn + wfx_snw_sub + wfx_ice_sub + wfx_spr
          ! salt flux
-         pdiag_fs = sfx_bri + sfx_bog + sfx_bom + sfx_sum + sfx_sni + sfx_opw + sfx_res + sfx_dyn + sfx_sub + sfx_lam 
+         pdiag_fs = sfx_bri + sfx_bog + sfx_bom + sfx_sum + sfx_sni + sfx_opw + sfx_res + sfx_dyn + sfx_sub + sfx_lam
          ! heat flux
-         pdiag_ft =   hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw  & 
+         pdiag_ft =   hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw  &
             &       - hfx_thd - hfx_dyn - hfx_res - hfx_sub - hfx_spr
 
@@ -283,5 +283,5 @@
          ! -- heat diag -- !
          zdiag_heat =   ( SUM( SUM( e_i, dim=4 ), dim=3 ) + SUM( SUM( e_s, dim=4 ), dim=3 ) - pdiag_t ) * r1_Dt_ice &
-            &         + (  hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw                                & 
+            &         + (  hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw                                &
             &            - hfx_thd - hfx_dyn - hfx_res - hfx_sub - hfx_spr )                                        &
             &         - pdiag_ft
@@ -324,5 +324,5 @@
          IF( ll_stop_s )   CALL ctl_stop( 'STOP', cd_routine//': ice salt conservation issue' )
          IF( ll_stop_t )   CALL ctl_stop( 'STOP', cd_routine//': ice heat conservation issue' )
-         
+
       ENDIF
 
@@ -332,6 +332,6 @@
       !!---------------------------------------------------------------------
       !!                 ***  ROUTINE ice_cons_wri  ***
-      !!        
-      !! ** Purpose :   create a NetCDF file named cdfile_name which contains 
+      !!
+      !! ** Purpose :   create a NetCDF file named cdfile_name which contains
       !!                the instantaneous fields when conservation issue occurs
       !!
@@ -340,24 +340,24 @@
       CHARACTER(len=*), INTENT( in ) ::   cdfile_name      ! name of the file created
       REAL(wp), DIMENSION(:,:), INTENT( in ) ::   pdiag_mass, pdiag_salt, pdiag_heat, &
-         &                                        pdiag_amin, pdiag_vmin, pdiag_smin, pdiag_emin !!, pdiag_amax  
+         &                                        pdiag_amin, pdiag_vmin, pdiag_smin, pdiag_emin !!, pdiag_amax
       !!
       INTEGER ::   inum
       !!----------------------------------------------------------------------
-      ! 
+      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'ice_cons_wri : single instantaneous ice state'
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~  named :', cdfile_name, '...nc'
-      IF(lwp) WRITE(numout,*)                
+      IF(lwp) WRITE(numout,*)
 
       CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' )
-      
+
       CALL iom_rstput( 0, 0, inum, 'cons_mass', pdiag_mass(:,:) , ktype = jp_r8 )    ! ice mass spurious lost/gain
       CALL iom_rstput( 0, 0, inum, 'cons_salt', pdiag_salt(:,:) , ktype = jp_r8 )    ! ice salt spurious lost/gain
       CALL iom_rstput( 0, 0, inum, 'cons_heat', pdiag_heat(:,:) , ktype = jp_r8 )    ! ice heat spurious lost/gain
       ! other diags
-      CALL iom_rstput( 0, 0, inum, 'aneg_count', pdiag_amin(:,:) , ktype = jp_r8 )    ! 
-      CALL iom_rstput( 0, 0, inum, 'vneg_count', pdiag_vmin(:,:) , ktype = jp_r8 )    ! 
-      CALL iom_rstput( 0, 0, inum, 'sneg_count', pdiag_smin(:,:) , ktype = jp_r8 )    ! 
-      CALL iom_rstput( 0, 0, inum, 'eneg_count', pdiag_emin(:,:) , ktype = jp_r8 )    ! 
+      CALL iom_rstput( 0, 0, inum, 'aneg_count', pdiag_amin(:,:) , ktype = jp_r8 )    !
+      CALL iom_rstput( 0, 0, inum, 'vneg_count', pdiag_vmin(:,:) , ktype = jp_r8 )    !
+      CALL iom_rstput( 0, 0, inum, 'sneg_count', pdiag_smin(:,:) , ktype = jp_r8 )    !
+      CALL iom_rstput( 0, 0, inum, 'eneg_count', pdiag_emin(:,:) , ktype = jp_r8 )    !
       ! mean state
       CALL iom_rstput( 0, 0, inum, 'icecon'    , SUM(a_i ,dim=3) , ktype = jp_r8 )    !
@@ -366,13 +366,13 @@
       CALL iom_rstput( 0, 0, inum, 'pndvol'    , SUM(v_ip,dim=3) , ktype = jp_r8 )    !
       CALL iom_rstput( 0, 0, inum, 'lidvol'    , SUM(v_il,dim=3) , ktype = jp_r8 )    !
-      
+
       CALL iom_close( inum )
 
    END SUBROUTINE ice_cons_wri
-   
+
    SUBROUTINE ice_ctl( kt )
       !!-------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_ctl *** 
-      !!                 
+      !!                   ***  ROUTINE ice_ctl ***
+      !!
       !! ** Purpose :   control checks
       !!-------------------------------------------------------------------
@@ -386,5 +386,5 @@
       inb_alp(:) = 0
       ialert_id = 0
-      
+
       ! Alert if very high salinity
       ialert_id = ialert_id + 1 ! reference number of this alert
@@ -430,5 +430,5 @@
          END_3D
       END DO
-  
+
       ! Alert if very warm ice
       ialert_id = ialert_id + 1 ! reference number of this alert
@@ -444,9 +444,9 @@
          END_3D
       END DO
-      
+
       ! Alerte if very thick ice
       ialert_id = ialert_id + 1 ! reference number of this alert
       cl_alname(ialert_id) = ' Very thick ice ' ! name of the alert
-      jl = jpl 
+      jl = jpl
       DO_2D( 1, 1, 1, 1 )
          IF( h_i(ji,jj,jl) > 50._wp ) THEN
@@ -460,5 +460,5 @@
       ialert_id = ialert_id + 1 ! reference number of this alert
       cl_alname(ialert_id) = ' Very thin ice ' ! name of the alert
-      jl = 1 
+      jl = 1
       DO_2D( 1, 1, 1, 1 )
          IF( h_i(ji,jj,jl) < rn_himin ) THEN
@@ -484,5 +484,5 @@
       cl_alname(ialert_id) = ' Ice on continents ' ! name of the alert
       DO_2D( 1, 1, 1, 1 )
-         IF( tmask(ji,jj,1) == 0._wp .AND. ( at_i(ji,jj) > 0._wp .OR. vt_i(ji,jj) > 0._wp ) ) THEN 
+         IF( tmask(ji,jj,1) == 0._wp .AND. ( at_i(ji,jj) > 0._wp .OR. vt_i(ji,jj) > 0._wp ) ) THEN
             WRITE(numout,*) ' ALERTE :   Ice on continents ',at_i(ji,jj),vt_i(ji,jj)
             WRITE(numout,*) ' at i,j = ',ji,jj
@@ -496,5 +496,5 @@
       DO_2D( 1, 1, 1, 1 )
          IF(  ( vt_i(ji,jj) == 0._wp .AND. at_i(ji,jj) >  0._wp ) .OR. &
-            & ( vt_i(ji,jj) >  0._wp .AND. at_i(ji,jj) == 0._wp ) ) THEN 
+            & ( vt_i(ji,jj) >  0._wp .AND. at_i(ji,jj) == 0._wp ) ) THEN
             WRITE(numout,*) ' ALERTE :   Incompatible ice conc and vol ',at_i(ji,jj),vt_i(ji,jj)
             WRITE(numout,*) ' at i,j = ',ji,jj
@@ -520,17 +520,17 @@
      !
    END SUBROUTINE ice_ctl
- 
+
    SUBROUTINE ice_prt( kt, ki, kj, kn, cd1 )
       !!-------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_prt *** 
-      !!                 
-      !! ** Purpose :   Writes global ice state on the (i,j) point 
-      !!                in ocean.ouput 
-      !!                3 possibilities exist 
+      !!                   ***  ROUTINE ice_prt ***
+      !!
+      !! ** Purpose :   Writes global ice state on the (i,j) point
+      !!                in ocean.ouput
+      !!                3 possibilities exist
       !!                n = 1/-1 -> simple ice state
       !!                n = 2    -> exhaustive state
       !!                n = 3    -> ice/ocean salt fluxes
       !!
-      !! ** input   :   point coordinates (i,j) 
+      !! ** input   :   point coordinates (i,j)
       !!                n : number of the option
       !!-------------------------------------------------------------------
@@ -550,5 +550,5 @@
             !  Simple state
             !----------------
-            
+
             IF ( kn == 1 .OR. kn == -1 ) THEN
                WRITE(numout,*) ' ice_prt - Point : ',ji,jj
@@ -566,8 +566,8 @@
                WRITE(numout,*) ' - Cell values '
                WRITE(numout,*) '   ~~~~~~~~~~~ '
-               WRITE(numout,*) ' at_i          : ', at_i(ji,jj)       
-               WRITE(numout,*) ' ato_i         : ', ato_i(ji,jj)       
-               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)       
-               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)       
+               WRITE(numout,*) ' at_i          : ', at_i(ji,jj)
+               WRITE(numout,*) ' ato_i         : ', ato_i(ji,jj)
+               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)
+               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)
                DO jl = 1, jpl
                   WRITE(numout,*) ' - Category (', jl,')'
@@ -592,5 +592,5 @@
             !  Exhaustive state
             !--------------------
-            
+
             IF ( kn .EQ. 2 ) THEN
                WRITE(numout,*) ' ice_prt - Point : ',ji,jj
@@ -598,10 +598,10 @@
                WRITE(numout,*) ' Exhaustive state '
                WRITE(numout,*) ' lat - long ', gphit(ji,jj), glamt(ji,jj)
-               WRITE(numout,*) 
+               WRITE(numout,*)
                WRITE(numout,*) ' - Cell values '
                WRITE(numout,*) '   ~~~~~~~~~~~ '
-               WRITE(numout,*) ' at_i          : ', at_i(ji,jj)       
-               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)       
-               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)       
+               WRITE(numout,*) ' at_i          : ', at_i(ji,jj)
+               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)
+               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)
                WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ji-1,jj)
                WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ji,jj)
@@ -610,21 +610,21 @@
                WRITE(numout,*) ' strength      : ', strength(ji,jj)
                WRITE(numout,*)
-               
+
                DO jl = 1, jpl
                   WRITE(numout,*) ' - Category (',jl,')'
-                  WRITE(numout,*) '   ~~~~~~~~         ' 
+                  WRITE(numout,*) '   ~~~~~~~~         '
                   WRITE(numout,*) ' h_i        : ', h_i(ji,jj,jl)              , ' h_s        : ', h_s(ji,jj,jl)
                   WRITE(numout,*) ' t_i        : ', t_i(ji,jj,1:nlay_i,jl)
                   WRITE(numout,*) ' t_su       : ', t_su(ji,jj,jl)             , ' t_s        : ', t_s(ji,jj,1:nlay_s,jl)
                   WRITE(numout,*) ' s_i        : ', s_i(ji,jj,jl)              , ' o_i        : ', o_i(ji,jj,jl)
-                  WRITE(numout,*) ' a_i        : ', a_i(ji,jj,jl)              , ' a_i_b      : ', a_i_b(ji,jj,jl)   
-                  WRITE(numout,*) ' v_i        : ', v_i(ji,jj,jl)              , ' v_i_b      : ', v_i_b(ji,jj,jl)   
-                  WRITE(numout,*) ' v_s        : ', v_s(ji,jj,jl)              , ' v_s_b      : ', v_s_b(ji,jj,jl)  
-                  WRITE(numout,*) ' e_i1       : ', e_i(ji,jj,1,jl)            , ' ei1        : ', e_i_b(ji,jj,1,jl) 
-                  WRITE(numout,*) ' e_i2       : ', e_i(ji,jj,2,jl)            , ' ei2_b      : ', e_i_b(ji,jj,2,jl)  
-                  WRITE(numout,*) ' e_snow     : ', e_s(ji,jj,1,jl)            , ' e_snow_b   : ', e_s_b(ji,jj,1,jl) 
-                  WRITE(numout,*) ' sv_i       : ', sv_i(ji,jj,jl)             , ' sv_i_b     : ', sv_i_b(ji,jj,jl)   
+                  WRITE(numout,*) ' a_i        : ', a_i(ji,jj,jl)              , ' a_i_b      : ', a_i_b(ji,jj,jl)
+                  WRITE(numout,*) ' v_i        : ', v_i(ji,jj,jl)              , ' v_i_b      : ', v_i_b(ji,jj,jl)
+                  WRITE(numout,*) ' v_s        : ', v_s(ji,jj,jl)              , ' v_s_b      : ', v_s_b(ji,jj,jl)
+                  WRITE(numout,*) ' e_i1       : ', e_i(ji,jj,1,jl)            , ' ei1        : ', e_i_b(ji,jj,1,jl)
+                  WRITE(numout,*) ' e_i2       : ', e_i(ji,jj,2,jl)            , ' ei2_b      : ', e_i_b(ji,jj,2,jl)
+                  WRITE(numout,*) ' e_snow     : ', e_s(ji,jj,1,jl)            , ' e_snow_b   : ', e_s_b(ji,jj,1,jl)
+                  WRITE(numout,*) ' sv_i       : ', sv_i(ji,jj,jl)             , ' sv_i_b     : ', sv_i_b(ji,jj,jl)
                END DO !jl
-               
+
                WRITE(numout,*)
                WRITE(numout,*) ' - Heat / FW fluxes '
@@ -634,20 +634,20 @@
                WRITE(numout,*) ' qns_ini       : ', (1._wp-at_i_b(ji,jj)) * qns(ji,jj) + SUM( a_i_b(ji,jj,:) * qns_ice(ji,jj,:) )
                WRITE(numout,*)
-               WRITE(numout,*) 
-               WRITE(numout,*) ' sst        : ', sst_m(ji,jj)  
-               WRITE(numout,*) ' sss        : ', sss_m(ji,jj)  
-               WRITE(numout,*) 
+               WRITE(numout,*)
+               WRITE(numout,*) ' sst        : ', sst_m(ji,jj)
+               WRITE(numout,*) ' sss        : ', sss_m(ji,jj)
+               WRITE(numout,*)
                WRITE(numout,*) ' - Stresses '
                WRITE(numout,*) '   ~~~~~~~~ '
-               WRITE(numout,*) ' utau_ice   : ', utau_ice(ji,jj) 
+               WRITE(numout,*) ' utau_ice   : ', utau_ice(ji,jj)
                WRITE(numout,*) ' vtau_ice   : ', vtau_ice(ji,jj)
-               WRITE(numout,*) ' utau       : ', utau    (ji,jj) 
+               WRITE(numout,*) ' utau       : ', utau    (ji,jj)
                WRITE(numout,*) ' vtau       : ', vtau    (ji,jj)
             ENDIF
-            
+
             !---------------------
             ! Salt / heat fluxes
             !---------------------
-            
+
             IF ( kn .EQ. 3 ) THEN
                WRITE(numout,*) ' ice_prt - Point : ',ji,jj
@@ -664,10 +664,10 @@
                WRITE(numout,*) ' qt_atm_oi    : ', qt_atm_oi(ji,jj)
                WRITE(numout,*) ' qt_oce_ai    : ', qt_oce_ai(ji,jj)
-               WRITE(numout,*) ' dhc          : ', diag_heat(ji,jj)              
+               WRITE(numout,*) ' dhc          : ', diag_heat(ji,jj)
                WRITE(numout,*)
                WRITE(numout,*) ' hfx_dyn      : ', hfx_dyn(ji,jj)
                WRITE(numout,*) ' hfx_thd      : ', hfx_thd(ji,jj)
                WRITE(numout,*) ' hfx_res      : ', hfx_res(ji,jj)
-               WRITE(numout,*) ' qsb_ice_bot  : ', qsb_ice_bot(ji,jj) 
+               WRITE(numout,*) ' qsb_ice_bot  : ', qsb_ice_bot(ji,jj)
                WRITE(numout,*) ' qlead        : ', qlead(ji,jj) * r1_Dt_ice
                WRITE(numout,*)
@@ -680,7 +680,7 @@
                WRITE(numout,*)
                WRITE(numout,*) ' - Momentum fluxes '
-               WRITE(numout,*) ' utau      : ', utau(ji,jj) 
+               WRITE(numout,*) ' utau      : ', utau(ji,jj)
                WRITE(numout,*) ' vtau      : ', vtau(ji,jj)
-            ENDIF 
+            ENDIF
             WRITE(numout,*) ' '
             !
@@ -694,10 +694,10 @@
       !!                  ***  ROUTINE ice_prt3D ***
       !!
-      !! ** Purpose : CTL prints of ice arrays in case sn_cfctl%prtctl is activated 
+      !! ** Purpose : CTL prints of ice arrays in case sn_cfctl%prtctl is activated
       !!
       !!-------------------------------------------------------------------
       CHARACTER(len=*), INTENT(in) ::   cd_routine    ! name of the routine
       INTEGER                      ::   jk, jl        ! dummy loop indices
-      
+
       CALL prt_ctl_info(' ========== ')
       CALL prt_ctl_info( cd_routine )
@@ -718,5 +718,5 @@
       CALL prt_ctl(tab2d_1=delta_i    , clinfo1=' delta_i     :')
       CALL prt_ctl(tab2d_1=u_ice      , clinfo1=' u_ice       :', tab2d_2=v_ice      , clinfo2=' v_ice       :')
-       
+
       DO jl = 1, jpl
          CALL prt_ctl_info(' ')
@@ -735,5 +735,5 @@
          CALL prt_ctl(tab2d_1=sv_i       (:,:,jl)        , clinfo1= ' sv_i        : ')
          CALL prt_ctl(tab2d_1=oa_i       (:,:,jl)        , clinfo1= ' oa_i        : ')
-         
+
          DO jk = 1, nlay_i
             CALL prt_ctl_info(' - Layer : ', ivar=jk)
@@ -742,5 +742,5 @@
          END DO
       END DO
-      
+
       CALL prt_ctl_info(' ')
       CALL prt_ctl_info(' - Stresses : ')
@@ -748,5 +748,5 @@
       CALL prt_ctl(tab2d_1=utau       , clinfo1= ' utau      : ', tab2d_2=vtau       , clinfo2= ' vtau      : ')
       CALL prt_ctl(tab2d_1=utau_ice   , clinfo1= ' utau_ice  : ', tab2d_2=vtau_ice   , clinfo2= ' vtau_ice  : ')
-      
+
    END SUBROUTINE ice_prt3D
 
@@ -853,5 +853,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ice_drift_init  ***
-      !!                   
+      !!
       !! ** Purpose :   create output file, initialise arrays
       !!----------------------------------------------------------------------
@@ -879,5 +879,5 @@
       !
    END SUBROUTINE ice_drift_init
-      
+
 #else
    !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/ICE/icedia.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedia.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedia.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE icedia  ***
-   !!  Sea-Ice:   global budgets 
+   !!  Sea-Ice:   global budgets
    !!======================================================================
    !! History :  3.4  !  2012-10  (C. Rousset)       original code
@@ -37,5 +37,5 @@
    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   vol_loc_ini, sal_loc_ini, tem_loc_ini                    ! initial volume, salt and heat contents
    REAL(wp)                              ::   frc_sal, frc_voltop, frc_volbot, frc_temtop, frc_tembot  ! global forcing trends
-   
+
    !!----------------------------------------------------------------------
    !! NEMO/ICE 4.0 , NEMO Consortium (2018)
@@ -59,15 +59,15 @@
       !!---------------------------------------------------------------------------
       !!                  ***  ROUTINE ice_dia  ***
-      !!     
-      !! ** Purpose:   Compute the sea-ice global heat content, salt content 
+      !!
+      !! ** Purpose:   Compute the sea-ice global heat content, salt content
       !!             and volume conservation
       !!---------------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt   ! ocean time step 
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
       !!
       REAL(wp)   ::   zbg_ivol, zbg_item, zbg_area, zbg_isal
       REAL(wp)   ::   zbg_svol, zbg_stem
       REAL(wp)   ::   z_frc_voltop, z_frc_temtop, z_frc_sal
-      REAL(wp)   ::   z_frc_volbot, z_frc_tembot  
-      REAL(wp)   ::   zdiff_vol, zdiff_sal, zdiff_tem  
+      REAL(wp)   ::   z_frc_volbot, z_frc_tembot
+      REAL(wp)   ::   zdiff_vol, zdiff_sal, zdiff_tem
       !!---------------------------------------------------------------------------
       IF( ln_timing )   CALL timing_start('ice_dia')
@@ -82,5 +82,5 @@
          z1_e1e2 = 1._wp / glob_sum( 'icedia', e1e2t(:,:) )
       ENDIF
-      
+
       ! ----------------------- !
       ! 1 -  Contents           !
@@ -96,11 +96,11 @@
          zbg_stem = glob_sum( 'icedia', et_s(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J)
 
-         CALL iom_put( 'ibgvol_tot'  , zbg_ivol ) 
-         CALL iom_put( 'sbgvol_tot'  , zbg_svol ) 
-         CALL iom_put( 'ibgarea_tot' , zbg_area ) 
-         CALL iom_put( 'ibgsalt_tot' , zbg_isal ) 
-         CALL iom_put( 'ibgheat_tot' , zbg_item ) 
-         CALL iom_put( 'sbgheat_tot' , zbg_stem ) 
- 
+         CALL iom_put( 'ibgvol_tot'  , zbg_ivol )
+         CALL iom_put( 'sbgvol_tot'  , zbg_svol )
+         CALL iom_put( 'ibgarea_tot' , zbg_area )
+         CALL iom_put( 'ibgsalt_tot' , zbg_isal )
+         CALL iom_put( 'ibgheat_tot' , zbg_item )
+         CALL iom_put( 'sbgheat_tot' , zbg_stem )
+
       ENDIF
 
@@ -109,5 +109,5 @@
       ! ---------------------------!
       ! they must be kept outside an IF(iom_use) because of the call to dia_rst below
-      z_frc_volbot = r1_rho0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-ocean 
+      z_frc_volbot = r1_rho0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-ocean
       z_frc_voltop = r1_rho0 * glob_sum( 'icedia', -( wfx_sub(:,:) + wfx_spr(:,:) )                    * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-atm
       z_frc_sal    = r1_rho0 * glob_sum( 'icedia', -      sfx(:,:)                                     * e1e2t(:,:) ) * 1.e-9   ! salt fluxes ice/snow-ocean
@@ -121,35 +121,35 @@
       frc_tembot  = frc_tembot  + z_frc_tembot  * rDt_ice ! 1.e20 J
 
-      CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water) 
-      CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water) 
-      CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water)   
-      CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J)   
-      CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J)   
+      CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water)
+      CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water)
+      CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water)
+      CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J)
+      CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J)
 
       IF(  iom_use('ibgfrchfxtop') .OR. iom_use('ibgfrchfxbot') ) THEN
          CALL iom_put( 'ibgfrchfxtop' , frc_temtop * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ice/snw/ocean      (W/m2)
-         CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ocean(below ice)   (W/m2) 
-      ENDIF
-      
+         CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ocean(below ice)   (W/m2)
+      ENDIF
+
       ! ---------------------------------- !
       ! 3 -  Content variations and drifts !
       ! ---------------------------------- !
       IF(  iom_use('ibgvolume') .OR. iom_use('ibgsaltco') .OR. iom_use('ibgheatco') .OR. iom_use('ibgheatfx') ) THEN
-            
-         zdiff_vol = r1_rho0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3) 
+
+         zdiff_vol = r1_rho0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3)
          zdiff_sal = r1_rho0 * glob_sum( 'icedia', ( rhoi*st_i(:,:)                  - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! salt content trend (km3*pss)
          zdiff_tem =           glob_sum( 'icedia', ( et_i(:,:) + et_s(:,:)           - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20  ! heat content trend (1.e20 J)
          !                               + SUM( qevap_ice * a_i_b, dim=3 )       !! clem: I think this term should not be there (but needs a check)
-         
+
          zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot )
          zdiff_sal = zdiff_sal - frc_sal
          zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop )
-         
-         CALL iom_put( 'ibgvolume' , zdiff_vol )   ! ice/snow volume  drift            (km3 equivalent ocean water)         
+
+         CALL iom_put( 'ibgvolume' , zdiff_vol )   ! ice/snow volume  drift            (km3 equivalent ocean water)
          CALL iom_put( 'ibgsaltco' , zdiff_sal )   ! ice salt content drift            (psu*km3 equivalent ocean water)
          CALL iom_put( 'ibgheatco' , zdiff_tem )   ! ice/snow heat content drift       (1.e20 J)
          !
       ENDIF
-      
+
       IF( lrst_ice )   CALL ice_dia_rst( 'WRITE', kt_ice )
       !
@@ -162,7 +162,7 @@
       !!---------------------------------------------------------------------------
       !!                  ***  ROUTINE ice_dia_init  ***
-      !!     
+      !!
       !! ** Purpose: Initialization for the heat salt volume budgets
-      !!	
+      !!
       !! ** Method : Compute initial heat content, salt content and volume
       !!
@@ -173,5 +173,5 @@
       INTEGER            ::   ios, ierror   ! local integer
       !!
-      NAMELIST/namdia/ ln_icediachk, rn_icechk_cel, rn_icechk_glo, ln_icediahsb, ln_icectl, iiceprt, jiceprt  
+      NAMELIST/namdia/ ln_icediachk, rn_icechk_cel, rn_icechk_glo, ln_icediahsb, ln_icectl, iiceprt, jiceprt
       !!----------------------------------------------------------------------
       !
@@ -194,5 +194,5 @@
          WRITE(numout,*) '         chosen grid point position          (iiceprt,jiceprt)  = (', iiceprt,',', jiceprt,')'
       ENDIF
-      !      
+      !
       IF( ln_icediahsb ) THEN
          IF( ice_dia_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ice_dia_init : unable to allocate arrays' )   ! allocate tke arrays
@@ -206,5 +206,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE icedia_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write DIA file in restart file
       !!
@@ -218,5 +218,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
@@ -238,9 +238,9 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~'
             ! set trends to 0
-            frc_voltop  = 0._wp                                          
-            frc_volbot  = 0._wp                                          
-            frc_temtop  = 0._wp                                                 
-            frc_tembot  = 0._wp                                                 
-            frc_sal     = 0._wp                                                 
+            frc_voltop  = 0._wp
+            frc_volbot  = 0._wp
+            frc_temtop  = 0._wp
+            frc_tembot  = 0._wp
+            frc_sal     = 0._wp
             ! record initial ice volume, salt and temp
             vol_loc_ini(:,:) = rhoi * vt_i(:,:) + rhos * vt_s(:,:)  ! ice/snow volume (kg/m2)
@@ -260,5 +260,5 @@
          !
          ! Write in numriw (if iter == nitrst)
-         ! ------------------ 
+         ! ------------------
          CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop )
          CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot )
@@ -273,5 +273,5 @@
       !
    END SUBROUTINE ice_dia_rst
- 
+
 #else
    !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/ICE/icedyn.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                     ***  MODULE  icedyn  ***
-   !!   Sea-Ice dynamics : master routine for sea ice dynamics 
+   !!   Sea-Ice dynamics : master routine for sea ice dynamics
    !!======================================================================
    !! history :  4.0  ! 2018  (C. Rousset)  original code SI3 [aka Sea Ice cube]
@@ -36,9 +36,9 @@
    PUBLIC   ice_dyn        ! called by icestp.F90
    PUBLIC   ice_dyn_init   ! called by icestp.F90
-   
+
    INTEGER ::              nice_dyn   ! choice of the type of dynamics
    !                                        ! associated indices:
    INTEGER, PARAMETER ::   np_dynALL     = 1   ! full ice dynamics               (rheology + advection + ridging/rafting + correction)
-   INTEGER, PARAMETER ::   np_dynRHGADV  = 2   ! pure dynamics                   (rheology + advection) 
+   INTEGER, PARAMETER ::   np_dynRHGADV  = 2   ! pure dynamics                   (rheology + advection)
    INTEGER, PARAMETER ::   np_dynADV1D   = 3   ! only advection 1D - test case from Schar & Smolarkiewicz 1996
    INTEGER, PARAMETER ::   np_dynADV2D   = 4   ! only advection 2D w prescribed vel.(rn_uvice + advection)
@@ -51,5 +51,5 @@
    REAL(wp) ::   rn_uice          !    prescribed u-vel (case np_dynADV1D & np_dynADV2D)
    REAL(wp) ::   rn_vice          !    prescribed v-vel (case np_dynADV1D & np_dynADV2D)
-   
+
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_icbmsk   ! structure of input grounded icebergs mask (file informations, fields read)
 
@@ -66,5 +66,5 @@
       !!-------------------------------------------------------------------
       !!               ***  ROUTINE ice_dyn  ***
-      !!               
+      !!
       !! ** Purpose :   this routine manages sea ice dynamics
       !!
@@ -91,5 +91,5 @@
          WRITE(numout,*)'~~~~~~~'
       ENDIF
-      !                      
+      !
       ! retrieve thickness from volume for landfast param. and UMx advection scheme
       WHERE( a_i(:,:,:) >= epsi20 )
@@ -118,12 +118,12 @@
       CASE ( np_dynALL )           !==  all dynamical processes  ==!
          !
-         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology  
+         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology
          CALL ice_dyn_adv   ( kt )                                          ! -- advection of ice
-         CALL ice_dyn_rdgrft( kt )                                          ! -- ridging/rafting 
+         CALL ice_dyn_rdgrft( kt )                                          ! -- ridging/rafting
          CALL ice_cor       ( kt , 1 )                                      ! -- Corrections
          !
       CASE ( np_dynRHGADV  )       !==  no ridge/raft & no corrections ==!
          !
-         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology  
+         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology
          CALL ice_dyn_adv   ( kt )                                          ! -- advection of ice
          CALL Hpiling                                                       ! -- simple pile-up (replaces ridging/rafting)
@@ -134,5 +134,5 @@
          ! --- monotonicity test from Schar & Smolarkiewicz 1996 --- !
          ! CFL = 0.5 at a distance from the bound of 1/6 of the basin length
-         ! Then for dx = 2m and dt = 1s => rn_uice = u (1/6th) = 1m/s 
+         ! Then for dx = 2m and dt = 1s => rn_uice = u (1/6th) = 1m/s
          DO_2D( 1, 1, 1, 1 )
             zcoefu = ( REAL(jpiglo+1)*0.5_wp - REAL(ji+nimpp-1) ) / ( REAL(jpiglo+1)*0.5_wp - 1._wp )
@@ -156,5 +156,5 @@
       !
       !
-      ! diagnostics: divergence at T points 
+      ! diagnostics: divergence at T points
       IF( iom_use('icediv') ) THEN
          !
@@ -259,5 +259,5 @@
       ENDIF
       !                             !== set the choice of ice dynamics ==!
-      ioptio = 0 
+      ioptio = 0
       !      !--- full dynamics                               (rheology + advection + ridging/rafting + correction)
       IF( ln_dynALL    ) THEN   ;   ioptio = ioptio + 1   ;   nice_dyn = np_dynALL       ;   ENDIF
@@ -292,9 +292,9 @@
          ALLOCATE( sf_icbmsk(1)%fnow(jpi,jpj,1) )
          IF( sf_icbmsk(1)%ln_tint )   ALLOCATE( sf_icbmsk(1)%fdta(jpi,jpj,1,2) )
-         IF( TRIM(sf_icbmsk(1)%clrootname) == 'NOT USED' ) sf_icbmsk(1)%fnow(:,:,1) = 0._wp   ! not used field  (set to 0)         
+         IF( TRIM(sf_icbmsk(1)%clrootname) == 'NOT USED' ) sf_icbmsk(1)%fnow(:,:,1) = 0._wp   ! not used field  (set to 0)
       ELSE
          icb_mask(:,:) = 0._wp
       ENDIF
-      !                                      !--- other init 
+      !                                      !--- other init
       CALL ice_dyn_rdgrft_init          ! set ice ridging/rafting parameters
       CALL ice_dyn_rhg_init             ! set ice rheology parameters
@@ -307,5 +307,5 @@
    !!   Default option         Empty module           NO SI3 sea-ice model
    !!----------------------------------------------------------------------
-#endif 
+#endif
 
    !!======================================================================
Index: /NEMO/trunk/src/ICE/icedyn_adv_pra.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_adv_pra.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_adv_pra.F90	(revision 14072)
@@ -1,3 +1,3 @@
-MODULE icedyn_adv_pra 
+MODULE icedyn_adv_pra
    !!======================================================================
    !!                       ***  MODULE icedyn_adv_pra   ***
@@ -35,5 +35,5 @@
 
    ! Moments for advection
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   ! ice thickness 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   ! ice thickness
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsn , sysn , sxxsn , syysn , sxysn    ! snow thickness
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxa  , sya  , sxxa  , syya  , sxya     ! ice concentration
@@ -59,5 +59,5 @@
       !!----------------------------------------------------------------------
       !!                **  routine ice_dyn_adv_pra  **
-      !!  
+      !!
       !! ** purpose :   Computes and adds the advection trend to sea-ice
       !!
@@ -101,5 +101,5 @@
       REAL(wp), DIMENSION(jpi,jpj,nlay_i,jpl) ::   z0ei
       !! diagnostics
-      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat      
+      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat
       !!----------------------------------------------------------------------
       !
@@ -127,5 +127,5 @@
          ELSEWHERE                      ; ze_s(:,:,jk,:) = 0._wp
          END WHERE
-      END DO   
+      END DO
       CALL icemax4D( ze_i , zei_max )
       CALL icemax4D( ze_s , zes_max )
@@ -139,5 +139,5 @@
       zcflnow(1) =                  MAXVAL( ABS( pu_ice(:,:) ) * rDt_ice * r1_e1u(:,:) )
       zcflnow(1) = MAX( zcflnow(1), MAXVAL( ABS( pv_ice(:,:) ) * rDt_ice * r1_e2v(:,:) ) )
-      
+
       ! non-blocking global communication send zcflnow and receive zcflprv
       CALL mpp_delay_max( 'icedyn_adv_pra', 'cflice', zcflnow(:), zcflprv(:), kt == nitend - nn_fsbc + 1 )
@@ -148,5 +148,5 @@
       zdt = rDt_ice / REAL(icycle)
       z1_dt = 1._wp / zdt
-      
+
       ! --- transport --- !
       zudy(:,:) = pu_ice(:,:) * e2u(:,:)
@@ -164,6 +164,6 @@
          ! record at_i before advection (for open water)
          zati1(:,:) = SUM( pa_i(:,:,:), dim=3 )
-         
-         ! --- transported fields --- !                                        
+
+         ! --- transported fields --- !
          DO jl = 1, jpl
             zarea(:,:,jl) = e1e2t(:,:)
@@ -209,7 +209,7 @@
             END DO
             DO jk = 1, nlay_i                                                                           !--- ice heat content
-               CALL adv_x( zdt, zudy, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
+               CALL adv_x( zdt, zudy, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &
                   &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) )
-               CALL adv_y( zdt, zvdx, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
+               CALL adv_y( zdt, zvdx, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &
                   &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) )
             END DO
@@ -217,10 +217,10 @@
             IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN
                CALL adv_x( zdt , zudy , 1._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap )    !--- melt pond fraction
-               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap ) 
+               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap )
                CALL adv_x( zdt , zudy , 1._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp )    !--- melt pond volume
-               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp ) 
+               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp )
                IF ( ln_pnd_lids ) THEN
                   CALL adv_x( zdt , zudy , 1._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) !--- melt pond lid volume
-                  CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) 
+                  CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl )
                ENDIF
             ENDIF
@@ -245,7 +245,7 @@
             END DO
             DO jk = 1, nlay_i                                                                           !--- ice heat content
-               CALL adv_y( zdt, zvdx, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
+               CALL adv_y( zdt, zvdx, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &
                   &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) )
-               CALL adv_x( zdt, zudy, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
+               CALL adv_x( zdt, zudy, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &
                   &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) )
             END DO
@@ -257,10 +257,10 @@
                IF ( ln_pnd_lids ) THEN
                   CALL adv_y( zdt , zvdx , 1._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) !--- melt pond lid volume
-                  CALL adv_x( zdt , zudy , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) 
+                  CALL adv_x( zdt , zudy , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl )
                ENDIF
             ENDIF
             !
          ENDIF
-         
+
          ! --- Lateral boundary conditions --- !
          !     caution: for gradients (sx and sy) the sign changes
@@ -276,5 +276,5 @@
             &                                , sxxage, 'T', 1._wp, syyage, 'T',  1._wp, sxyage, 'T',  1._wp  )
          CALL lbc_lnk_multi( 'icedyn_adv_pra', z0es  , 'T', 1._wp, sxc0  , 'T', -1._wp, syc0  , 'T', -1._wp  & ! snw enthalpy
-            &                                , sxxc0 , 'T', 1._wp, syyc0 , 'T',  1._wp, sxyc0 , 'T',  1._wp  ) 
+            &                                , sxxc0 , 'T', 1._wp, syyc0 , 'T',  1._wp, sxyc0 , 'T',  1._wp  )
          CALL lbc_lnk_multi( 'icedyn_adv_pra', z0ei  , 'T', 1._wp, sxe   , 'T', -1._wp, sye   , 'T', -1._wp  & ! ice enthalpy
             &                                , sxxe  , 'T', 1._wp, syye  , 'T',  1._wp, sxye  , 'T',  1._wp  )
@@ -283,8 +283,8 @@
                &                                , sxxap, 'T', 1._wp, syyap, 'T',  1._wp, sxyap, 'T',  1._wp  &
                &                                , z0vp , 'T', 1._wp, sxvp , 'T', -1._wp, syvp , 'T', -1._wp  & ! melt pond volume
-               &                                , sxxvp, 'T', 1._wp, syyvp, 'T',  1._wp, sxyvp, 'T',  1._wp  ) 
+               &                                , sxxvp, 'T', 1._wp, syyvp, 'T',  1._wp, sxyvp, 'T',  1._wp  )
             IF ( ln_pnd_lids ) THEN
                CALL lbc_lnk_multi( 'icedyn_adv_pra', z0vl ,'T', 1._wp, sxvl ,'T', -1._wp, syvl ,'T', -1._wp  & ! melt pond lid volume
-                  &                                , sxxvl,'T', 1._wp, syyvl,'T',  1._wp, sxyvl,'T',  1._wp  ) 
+                  &                                , sxxvl,'T', 1._wp, syyvl,'T',  1._wp, sxyvl,'T',  1._wp  )
             ENDIF
          ENDIF
@@ -348,11 +348,11 @@
       !
    END SUBROUTINE ice_dyn_adv_pra
-   
-   
+
+
    SUBROUTINE adv_x( pdt, put , pcrh, psm , ps0 ,   &
       &              psx, psxx, psy , psyy, psxy )
       !!----------------------------------------------------------------------
       !!                **  routine adv_x  **
-      !!  
+      !!
       !! ** purpose :   Computes and adds the advection trend to sea-ice
       !!                variable on x axis
@@ -363,7 +363,7 @@
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psm                ! area
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ps0                ! field to be advected
-      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments 
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psxx, psyy, psxy   ! 2nd moments
-      !! 
+      !!
       INTEGER  ::   ji, jj, jl, jcat                     ! dummy loop indices
       INTEGER  ::   jj0                                  ! dummy loop indices
@@ -386,7 +386,7 @@
       DO jl = 1, jcat   ! loop on categories
          !
-         ! Limitation of moments.                                           
+         ! Limitation of moments.
          DO jj = Njs0 - jj0, Nje0 + jj0
-            
+
             DO ji = Nis0 - 1, Nie0 + 1
 
@@ -399,5 +399,5 @@
                zpsxy = psxy(ji,jj,jl)
 
-               !  Initialize volumes of boxes  (=area if adv_x first called, =psm otherwise)                                     
+               !  Initialize volumes of boxes  (=area if adv_x first called, =psm otherwise)
                zpsm = MAX( pcrh * e1e2t(ji,jj) + ( 1.0 - pcrh ) * zpsm , epsi20 )
                !
@@ -408,5 +408,5 @@
                rswitch = ( 1.0 - MAX( 0._wp, SIGN( 1._wp, -zslpmax) ) ) * tmask(ji,jj,1)   ! Case of empty boxes & Apply mask
 
-               zps0  = zslpmax  
+               zps0  = zslpmax
                zpsx  = zs1new  * rswitch
                zpsxx = zs2new  * rswitch
@@ -415,6 +415,6 @@
                zpsxy = MIN( zslpmax, MAX( -zslpmax, zpsxy ) ) * rswitch
 
-               !  Calculate fluxes and moments between boxes i<-->i+1              
-               !                                !  Flux from i to i+1 WHEN u GT 0 
+               !  Calculate fluxes and moments between boxes i<-->i+1
+               !                                !  Flux from i to i+1 WHEN u GT 0
                zbet(ji,jj)  =  MAX( 0._wp, SIGN( 1._wp, put(ji,jj) ) )
                zalf         =  MAX( 0._wp, put(ji,jj) ) * pdt / zpsm
@@ -423,5 +423,5 @@
                zalf1q       =  zalf1 * zalf1
                !
-               zfm (ji,jj)  =  zalf  *   zpsm 
+               zfm (ji,jj)  =  zalf  *   zpsm
                zf0 (ji,jj)  =  zalf  * ( zps0  + zalf1 * ( zpsx + (zalf1 - zalf) * zpsxx ) )
                zfx (ji,jj)  =  zalfq * ( zpsx  + 3.0 * zalf1 * zpsxx )
@@ -441,16 +441,16 @@
                !
                psm (ji,jj,jl) = zpsm ! optimization
-               ps0 (ji,jj,jl) = zps0 
-               psx (ji,jj,jl) = zpsx 
+               ps0 (ji,jj,jl) = zps0
+               psx (ji,jj,jl) = zpsx
                psxx(ji,jj,jl) = zpsxx
-               psy (ji,jj,jl) = zpsy 
+               psy (ji,jj,jl) = zpsy
                psyy(ji,jj,jl) = zpsyy
                psxy(ji,jj,jl) = zpsxy
                !
             END DO
-            
+
             DO ji = Nis0 - 1, Nie0
                !                                !  Flux from i+1 to i when u LT 0.
-               zalf          = MAX( 0._wp, -put(ji,jj) ) * pdt / psm(ji+1,jj,jl) 
+               zalf          = MAX( 0._wp, -put(ji,jj) ) * pdt / psm(ji+1,jj,jl)
                zalg  (ji,jj) = zalf
                zalfq         = zalf * zalf
@@ -491,5 +491,5 @@
                zpsxy = zalg1q(ji-1,jj) * zpsxy
 
-               !   Put the temporary moments into appropriate neighboring boxes.    
+               !   Put the temporary moments into appropriate neighboring boxes.
                !                                !   Flux from i to i+1 IF u GT 0.
                zbt   =       zbet(ji-1,jj)
@@ -508,5 +508,5 @@
                   &            + 3.0 * (- zalf1*zfy(ji-1,jj)  + zalf * zpsy ) )  &
                   &            + zbt1 * zpsxy
-               zpsy  =  zbt  * ( zpsy  + zfy (ji-1,jj) ) + zbt1 * zpsy 
+               zpsy  =  zbt  * ( zpsy  + zfy (ji-1,jj) ) + zbt1 * zpsy
                zpsyy =  zbt  * ( zpsyy + zfyy(ji-1,jj) ) + zbt1 * zpsyy
 
@@ -530,8 +530,8 @@
                !
                psm (ji,jj,jl) = zpsm  ! optimization
-               ps0 (ji,jj,jl) = zps0 
-               psx (ji,jj,jl) = zpsx 
+               ps0 (ji,jj,jl) = zps0
+               psx (ji,jj,jl) = zpsx
                psxx(ji,jj,jl) = zpsxx
-               psy (ji,jj,jl) = zpsy 
+               psy (ji,jj,jl) = zpsy
                psyy(ji,jj,jl) = zpsyy
                psxy(ji,jj,jl) = zpsxy
@@ -541,5 +541,5 @@
          !
       END DO
-      !      
+      !
    END SUBROUTINE adv_x
 
@@ -549,6 +549,6 @@
       !!---------------------------------------------------------------------
       !!                **  routine adv_y  **
-      !!            
-      !! ** purpose :   Computes and adds the advection trend to sea-ice 
+      !!
+      !! ** purpose :   Computes and adds the advection trend to sea-ice
       !!                variable on y axis
       !!---------------------------------------------------------------------
@@ -558,5 +558,5 @@
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psm                ! area
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ps0                ! field to be advected
-      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments 
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psxx, psyy, psxy   ! 2nd moments
       !!
@@ -578,5 +578,5 @@
       !
       jcat = SIZE( ps0 , 3 )   ! size of input arrays
-      !      
+      !
       DO jl = 1, jcat   ! loop on categories
          !
@@ -601,5 +601,5 @@
             rswitch = ( 1.0 - MAX( 0._wp, SIGN( 1._wp, -zslpmax) ) ) * tmask(ji,jj,1)   ! Case of empty boxes & Apply mask
             !
-            zps0  = zslpmax  
+            zps0  = zslpmax
             zpsx  = zpsx  * rswitch
             zpsxx = zpsxx * rswitch
@@ -608,6 +608,6 @@
             zpsxy = MIN( zslpmax, MAX( -zslpmax, zpsxy ) ) * rswitch
 
-            !  Calculate fluxes and moments between boxes j<-->j+1              
-            !                                !  Flux from j to j+1 WHEN v GT 0   
+            !  Calculate fluxes and moments between boxes j<-->j+1
+            !                                !  Flux from j to j+1 WHEN v GT 0
             zbet(ji,jj)  =  MAX( 0._wp, SIGN( 1._wp, pvt(ji,jj) ) )
             zalf         =  MAX( 0._wp, pvt(ji,jj) ) * pdt / zpsm
@@ -617,5 +617,5 @@
             !
             zfm (ji,jj)  =  zalf  * zpsm
-            zf0 (ji,jj)  =  zalf  * ( zps0 + zalf1 * ( zpsy  + (zalf1-zalf) * zpsyy ) ) 
+            zf0 (ji,jj)  =  zalf  * ( zps0 + zalf1 * ( zpsy  + (zalf1-zalf) * zpsyy ) )
             zfy (ji,jj)  =  zalfq *( zpsy + 3.0*zalf1*zpsyy )
             zfyy(ji,jj)  =  zalf  * zalfq * zpsyy
@@ -634,8 +634,8 @@
             !
             psm (ji,jj,jl) = zpsm ! optimization
-            ps0 (ji,jj,jl) = zps0 
-            psx (ji,jj,jl) = zpsx 
+            ps0 (ji,jj,jl) = zps0
+            psx (ji,jj,jl) = zpsx
             psxx(ji,jj,jl) = zpsxx
-            psy (ji,jj,jl) = zpsy 
+            psy (ji,jj,jl) = zpsy
             psyy(ji,jj,jl) = zpsyy
             psxy(ji,jj,jl) = zpsxy
@@ -644,5 +644,5 @@
          DO_2D( 1, 0, ji0, ji0 )
             !                                !  Flux from j+1 to j when v LT 0.
-            zalf          = MAX( 0._wp, -pvt(ji,jj) ) * pdt / psm(ji,jj+1,jl) 
+            zalf          = MAX( 0._wp, -pvt(ji,jj) ) * pdt / psm(ji,jj+1,jl)
             zalg  (ji,jj) = zalf
             zalfq         = zalf * zalf
@@ -683,10 +683,10 @@
             zpsxy = zalg1q(ji,jj-1) * zpsxy
 
-            !   Put the temporary moments into appropriate neighboring boxes.    
+            !   Put the temporary moments into appropriate neighboring boxes.
             !                                !   Flux from j to j+1 IF v GT 0.
             zbt   =       zbet(ji,jj-1)
             zbt1  = 1.0 - zbet(ji,jj-1)
-            zpsm  = zbt * ( zpsm + zfm(ji,jj-1) ) + zbt1 * zpsm 
-            zalf  = zbt * zfm(ji,jj-1) / zpsm 
+            zpsm  = zbt * ( zpsm + zfm(ji,jj-1) ) + zbt1 * zpsm
+            zalf  = zbt * zfm(ji,jj-1) / zpsm
             zalf1 = 1.0 - zalf
             ztemp = zalf * zps0 - zalf1 * zf0(ji,jj-1)
@@ -694,12 +694,12 @@
             zps0  =   zbt  * ( zps0 + zf0(ji,jj-1) ) + zbt1 * zps0
             zpsy  =   zbt  * ( zalf * zfy(ji,jj-1) + zalf1 * zpsy + 3.0 * ztemp )  &
-               &             + zbt1 * zpsy  
+               &             + zbt1 * zpsy
             zpsyy =   zbt  * ( zalf * zalf * zfyy(ji,jj-1) + zalf1 * zalf1 * zpsyy                           &
-               &             + 5.0 * ( zalf * zalf1 * ( zpsy - zfy(ji,jj-1) ) - ( zalf1 - zalf ) * ztemp ) ) & 
+               &             + 5.0 * ( zalf * zalf1 * ( zpsy - zfy(ji,jj-1) ) - ( zalf1 - zalf ) * ztemp ) ) &
                &             + zbt1 * zpsyy
             zpsxy =   zbt  * ( zalf * zfxy(ji,jj-1) + zalf1 * zpsxy             &
                &             + 3.0 * (- zalf1 * zfx(ji,jj-1) + zalf * zpsx ) )  &
                &             + zbt1 * zpsxy
-            zpsx  =   zbt * ( zpsx  + zfx (ji,jj-1) ) + zbt1 * zpsx 
+            zpsx  =   zbt * ( zpsx  + zfx (ji,jj-1) ) + zbt1 * zpsx
             zpsxx =   zbt * ( zpsxx + zfxx(ji,jj-1) ) + zbt1 * zpsxx
 
@@ -723,8 +723,8 @@
             !
             psm (ji,jj,jl) = zpsm ! optimization
-            ps0 (ji,jj,jl) = zps0 
-            psx (ji,jj,jl) = zpsx 
+            ps0 (ji,jj,jl) = zps0
+            psx (ji,jj,jl) = zpsx
             psxx(ji,jj,jl) = zpsxx
-            psy (ji,jj,jl) = zpsy 
+            psy (ji,jj,jl) = zpsy
             psyy(ji,jj,jl) = zpsyy
             psxy(ji,jj,jl) = zpsxy
@@ -796,6 +796,6 @@
                   pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra
                   pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl)
-               ENDIF           
-               !                  
+               ENDIF
+               !
                !                               ! -- check s_i -- !
                ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean
@@ -809,5 +809,5 @@
             ENDIF
          END_2D
-      END DO 
+      END DO
       !
       !                                           ! -- check e_i/v_i -- !
@@ -899,5 +899,5 @@
       !!                  ***  ROUTINE adv_pra_init  ***
       !!
-      !! ** Purpose :   allocate and initialize arrays for Prather advection 
+      !! ** Purpose :   allocate and initialize arrays for Prather advection
       !!-------------------------------------------------------------------
       INTEGER ::   ierr
@@ -932,5 +932,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE adv_pra_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write file in restart file
       !!
@@ -991,13 +991,13 @@
             DO jk = 1, nlay_s
                WRITE(zchar1,'(I2.2)') jk
-               znam = 'sxc0'//'_l'//zchar1  
+               znam = 'sxc0'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
-               znam = 'syc0'//'_l'//zchar1  
+               znam = 'syc0'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxxc0'//'_l'//zchar1 
+               znam = 'sxxc0'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
-               znam = 'syyc0'//'_l'//zchar1 
+               znam = 'syyc0'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxyc0'//'_l'//zchar1 
+               znam = 'sxyc0'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
             END DO
@@ -1005,13 +1005,13 @@
             DO jk = 1, nlay_i
                WRITE(zchar1,'(I2.2)') jk
-               znam = 'sxe'//'_l'//zchar1   
+               znam = 'sxe'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sye'//'_l'//zchar1   
+               znam = 'sye'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sye (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxxe'//'_l'//zchar1  
+               znam = 'sxxe'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
-               znam = 'syye'//'_l'//zchar1  
+               znam = 'syye'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syye(:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxye'//'_l'//zchar1  
+               znam = 'sxye'//'_l'//zchar1
                CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
             END DO
@@ -1165,5 +1165,5 @@
    SUBROUTINE icemax3D( pice , pmax )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE icemax3D ***                     
+      !!                   ***  ROUTINE icemax3D ***
       !! ** Purpose :  compute the max of the 9 points around
       !!----------------------------------------------------------------------
@@ -1174,10 +1174,10 @@
       !!----------------------------------------------------------------------
       DO jl = 1, jpl
-         DO jj = Njs0-1, Nje0+1    
+         DO jj = Njs0-1, Nje0+1
             DO ji = Nis0, Nie0
                zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jl), pice(ji-1,jj,jl), pice(ji+1,jj,jl) )
             END DO
          END DO
-         DO jj = Njs0, Nje0    
+         DO jj = Njs0, Nje0
             DO ji = Nis0, Nie0
                pmax(ji,jj,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) )
@@ -1189,5 +1189,5 @@
    SUBROUTINE icemax4D( pice , pmax )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE icemax4D ***                     
+      !!                   ***  ROUTINE icemax4D ***
       !! ** Purpose :  compute the max of the 9 points around
       !!----------------------------------------------------------------------
@@ -1200,10 +1200,10 @@
       DO jl = 1, jpl
          DO jk = 1, jlay
-            DO jj = Njs0-1, Nje0+1    
+            DO jj = Njs0-1, Nje0+1
                DO ji = Nis0, Nie0
                   zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jk,jl), pice(ji-1,jj,jk,jl), pice(ji+1,jj,jk,jl) )
                END DO
             END DO
-            DO jj = Njs0, Nje0    
+            DO jj = Njs0, Nje0
                DO ji = Nis0, Nie0
                   pmax(ji,jj,jk,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) )
Index: /NEMO/trunk/src/ICE/icedyn_adv_umx.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_adv_umx.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_adv_umx.F90	(revision 14072)
@@ -14,5 +14,5 @@
    !!   ultimate_x(_y)    : compute a tracer value at velocity points using ULTIMATE scheme at various orders
    !!   macho             : compute the fluxes
-   !!   nonosc_ice        : limit the fluxes using a non-oscillatory algorithm 
+   !!   nonosc_ice        : limit the fluxes using a non-oscillatory algorithm
    !!----------------------------------------------------------------------
    USE phycst         ! physical constant
@@ -63,10 +63,10 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ice_dyn_adv_umx  ***
-      !! 
-      !! **  Purpose :   Compute the now trend due to total advection of 
+      !!
+      !! **  Purpose :   Compute the now trend due to total advection of
       !!                 tracers and add it to the general trend of tracer equations
       !!                 using an "Ultimate-Macho" scheme
       !!
-      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
+      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.
       !!----------------------------------------------------------------------
       INTEGER                     , INTENT(in   ) ::   kn_umx     ! order of the scheme (1-5=UM or 20=CEN2)
@@ -103,7 +103,7 @@
       REAL(wp), DIMENSION(jpi,jpj,nlay_s,jpl) ::   ze_s, zes_max
       !
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs 
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs
       !! diagnostics
-      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat      
+      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat
       !!----------------------------------------------------------------------
       !
@@ -131,5 +131,5 @@
          ELSEWHERE                      ; ze_s(:,:,jk,:) = 0._wp
          END WHERE
-      END DO   
+      END DO
       CALL icemax4D( ze_i , zei_max )
       CALL icemax4D( ze_s , zes_max )
@@ -143,5 +143,5 @@
       zcflnow(1) =                  MAXVAL( ABS( pu_ice(:,:) ) * rDt_ice * r1_e1u(:,:) )
       zcflnow(1) = MAX( zcflnow(1), MAXVAL( ABS( pv_ice(:,:) ) * rDt_ice * r1_e2v(:,:) ) )
-      
+
       ! non-blocking global communication send zcflnow and receive zcflprv
       CALL mpp_delay_max( 'icedyn_adv_umx', 'cflice', zcflnow(:), zcflprv(:), kt == nitend - nn_fsbc + 1 )
@@ -157,5 +157,5 @@
       zvdx(:,:) = pv_ice(:,:) * e1v(:,:)
       !
-      ! setup transport for each ice cat 
+      ! setup transport for each ice cat
       DO jl = 1, jpl
          zu_cat(:,:,jl) = zudy(:,:)
@@ -190,5 +190,5 @@
          ! record at_i before advection (for open water)
          zati1(:,:) = SUM( pa_i(:,:,:), dim=3 )
-         
+
          ! inverse of A and Ap
          WHERE( pa_i(:,:,:) >= epsi20 )   ;   z1_ai(:,:,:) = 1._wp / pa_i(:,:,:)
@@ -201,6 +201,6 @@
          ! setup a mask where advection will be upstream
          IF( ll_neg ) THEN
-            IF( .NOT. ALLOCATED(imsk_small) )   ALLOCATE( imsk_small(jpi,jpj,jpl) ) 
-            IF( .NOT. ALLOCATED(jmsk_small) )   ALLOCATE( jmsk_small(jpi,jpj,jpl) ) 
+            IF( .NOT. ALLOCATED(imsk_small) )   ALLOCATE( imsk_small(jpi,jpj,jpl) )
+            IF( .NOT. ALLOCATED(jmsk_small) )   ALLOCATE( jmsk_small(jpi,jpj,jpl) )
             DO jl = 1, jpl
                DO_2D( 1, 0, 1, 0 )
@@ -232,5 +232,5 @@
             CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, &
                &                                      zhvar, pv_i, zua_ups, zva_ups )
-            !== Snw volume ==!         
+            !== Snw volume ==!
             zhvar(:,:,:) = pv_s(:,:,:) * z1_ai(:,:,:)
             CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, &
@@ -260,5 +260,5 @@
             CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, &
                &                                      zhvar, pv_i, zua_ups, zva_ups )
-            !== Snw volume ==!         
+            !== Snw volume ==!
             zhvar(:,:,:) = pv_s(:,:,:) * z1_ai(:,:,:)
             CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, &
@@ -316,5 +316,5 @@
                   &                                      zhvar, pe_i(:,:,jk,:), zuv_ups, zvv_ups )
             END DO
-            !== Snow volume ==!         
+            !== Snow volume ==!
             zuv_ups = zua_ups
             zvv_ups = zva_ups
@@ -374,5 +374,5 @@
          zati2(:,:) = SUM( pa_i(:,:,:), dim=3 )
          DO_2D( 0, 0, 0, 0 )
-            pato_i(ji,jj) = pato_i(ji,jj) - ( zati2(ji,jj) - zati1(ji,jj) ) & 
+            pato_i(ji,jj) = pato_i(ji,jj) - ( zati2(ji,jj) - zati1(ji,jj) ) &
                &                          - ( zudy(ji,jj) - zudy(ji-1,jj) + zvdx(ji,jj) - zvdx(ji,jj-1) ) * r1_e1e2t(ji,jj) * zdt
          END_2D
@@ -406,11 +406,11 @@
    END SUBROUTINE ice_dyn_adv_umx
 
-   
+
    SUBROUTINE adv_umx( pamsk, kn_umx, jt, kt, pdt, pu, pv, puc, pvc, pubox, pvbox,  &
       &                                            pt, ptc, pua_ups, pva_ups, pua_ho, pva_ho )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE adv_umx  ***
-      !! 
-      !! **  Purpose :   Compute the now trend due to total advection of 
+      !!
+      !! **  Purpose :   Compute the now trend due to total advection of
       !!                 tracers and add it to the general trend of tracer equations
       !!
@@ -434,5 +434,5 @@
       !!
       !!             in eq. c), one can solve the equation for  S (ln_advS=T), then dVS/dt = -div(uV * uS  / u)
-      !!                                                or for HS (ln_advS=F), then dVS/dt = -div(uA * uHS / u) 
+      !!                                                or for HS (ln_advS=F), then dVS/dt = -div(uA * uHS / u)
       !!
       !! ** Note : - this method can lead to tiny negative V (-1.e-20) => set it to 0 while conserving mass etc.
@@ -462,5 +462,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out), OPTIONAL ::   pua_ho, pva_ho   ! high order u*a fluxes
       !
-      INTEGER  ::   ji, jj, jl       ! dummy loop indices  
+      INTEGER  ::   ji, jj, jl       ! dummy loop indices
       REAL(wp) ::   ztra             ! local scalar
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ho , zfv_ho , zpt
@@ -468,9 +468,9 @@
       !!----------------------------------------------------------------------
       !
-      ! Upstream (_ups) fluxes 
+      ! Upstream (_ups) fluxes
       ! -----------------------
       CALL upstream( pamsk, jt, kt, pdt, pt, pu, pv, zt_ups, zfu_ups, zfv_ups )
-      
-      ! High order (_ho) fluxes 
+
+      ! High order (_ho) fluxes
       ! -----------------------
       SELECT CASE( kn_umx )
@@ -506,6 +506,6 @@
                   zfv_ups(ji,jj,jl) = zfv_ups(ji,jj,jl) * pva_ups(ji,jj,jl) / pv(ji,jj)
                ELSE
-                  zfv_ho (ji,jj,jl) = 0._wp  
-                  zfv_ups(ji,jj,jl) = 0._wp  
+                  zfv_ho (ji,jj,jl) = 0._wp
+                  zfv_ups(ji,jj,jl) = 0._wp
                ENDIF
             END_2D
@@ -551,7 +551,7 @@
       DO jl = 1, jpl
          DO_2D( 0, 0, 0, 0 )
-            ztra = - ( zfu_ho(ji,jj,jl) - zfu_ho(ji-1,jj,jl) + zfv_ho(ji,jj,jl) - zfv_ho(ji,jj-1,jl) )  
-            !
-            ptc(ji,jj,jl) = ( ptc(ji,jj,jl) + ztra * r1_e1e2t(ji,jj) * pdt ) * tmask(ji,jj,1)               
+            ztra = - ( zfu_ho(ji,jj,jl) - zfu_ho(ji-1,jj,jl) + zfv_ho(ji,jj,jl) - zfv_ho(ji,jj-1,jl) )
+            !
+            ptc(ji,jj,jl) = ( ptc(ji,jj,jl) + ztra * r1_e1e2t(ji,jj) * pdt ) * tmask(ji,jj,1)
          END_2D
       END DO
@@ -563,5 +563,5 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE upstream  ***
-      !!     
+      !!
       !! **  Purpose :   compute the upstream fluxes and upstream guess of tracer
       !!----------------------------------------------------------------------
@@ -572,6 +572,6 @@
       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt               ! tracer fields
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_ups           ! upstream guess of tracer 
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ups, pfv_ups ! upstream fluxes 
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_ups           ! upstream guess of tracer
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ups, pfv_ups ! upstream fluxes
       !
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
@@ -638,5 +638,5 @@
             !
          ENDIF
-         
+
       ENDIF
       !
@@ -655,11 +655,11 @@
    END SUBROUTINE upstream
 
-   
+
    SUBROUTINE cen2( pamsk, jt, kt, pdt, pt, pu, pv, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE cen2  ***
-      !!     
+      !!
       !! **  Purpose :   compute the high order fluxes using a centered
-      !!                 second order scheme 
+      !!                 second order scheme
       !!----------------------------------------------------------------------
       REAL(wp)                        , INTENT(in   ) ::   pamsk            ! advection of concentration (1) or other tracers (0)
@@ -669,7 +669,7 @@
       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt               ! tracer fields
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components
-      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer 
-      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes 
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes 
+      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer
+      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes
       !
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
@@ -750,19 +750,19 @@
          ENDIF
          IF( np_limiter == 1 )   CALL nonosc_ice( pamsk, pdt, pu, pv, pt, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho )
-         
+
       ENDIF
-   
+
    END SUBROUTINE cen2
 
-   
+
    SUBROUTINE macho( pamsk, kn_umx, jt, kt, pdt, pt, pu, pv, pubox, pvbox, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE macho  ***
-      !!     
-      !! **  Purpose :   compute the high order fluxes using Ultimate-Macho scheme  
+      !!
+      !! **  Purpose :   compute the high order fluxes using Ultimate-Macho scheme
       !!
       !! **  Method  :   ...
       !!
-      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
+      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.
       !!----------------------------------------------------------------------
       REAL(wp)                        , INTENT(in   ) ::   pamsk            ! advection of concentration (1) or other tracers (0)
@@ -774,7 +774,7 @@
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pubox, pvbox     ! upstream velocity
-      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer 
-      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes 
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes 
+      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer
+      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes
       !
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
@@ -807,5 +807,5 @@
          !                                                        !--  limiter in y --!
          IF( np_limiter == 2 .OR. np_limiter == 3 )   CALL limiter_y( pdt, pv, pt, pfv_ups, pfv_ho )
-         !         
+         !
          !
       ELSE                                                               !==  even ice time step:  adv_y then adv_x  ==!
@@ -821,5 +821,5 @@
                   &                              + pt   (ji,jj,jl) * ( pv  (ji,jj   ) - pv  (ji,jj-1   ) ) * r1_e1e2t(ji,jj) &
                   &                                                                                        * pamsk           &
-                  &                             ) * pdt ) * tmask(ji,jj,1) 
+                  &                             ) * pdt ) * tmask(ji,jj,1)
             END_2D
          END DO
@@ -845,10 +845,10 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE ultimate_x  ***
-      !!     
-      !! **  Purpose :   compute tracer at u-points 
+      !!
+      !! **  Purpose :   compute tracer at u-points
       !!
       !! **  Method  :   ...
       !!
-      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
+      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.
       !!----------------------------------------------------------------------
       REAL(wp)                        , INTENT(in   ) ::   pamsk     ! advection of concentration (1) or other tracers (0)
@@ -857,6 +857,6 @@
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu        ! ice i-velocity component
       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt        ! tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_u      ! tracer at u-point 
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho    ! high order flux 
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_u      ! tracer at u-point
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho    ! high order flux
       !
       INTEGER  ::   ji, jj, jl             ! dummy loop indices
@@ -897,5 +897,5 @@
       !
       CASE( 1 )                                                   !==  1st order central TIM  ==! (Eq. 21)
-         !        
+         !
          DO jl = 1, jpl
             DO_2D( 0, 0, 1, 0 )
@@ -911,8 +911,8 @@
                zcu  = pu(ji,jj) * r1_e2u(ji,jj) * pdt * r1_e1u(ji,jj)
                pt_u(ji,jj,jl) = 0.5_wp * umask(ji,jj,1) * (                                pt(ji+1,jj,jl) + pt(ji,jj,jl)   &
-                  &                                                            - zcu   * ( pt(ji+1,jj,jl) - pt(ji,jj,jl) ) ) 
-            END_2D
-         END DO
-         !  
+                  &                                                            - zcu   * ( pt(ji+1,jj,jl) - pt(ji,jj,jl) ) )
+            END_2D
+         END DO
+         !
       CASE( 3 )                                                   !==  3rd order central TIM  ==! (Eq. 24)
          !
@@ -983,15 +983,15 @@
       !
    END SUBROUTINE ultimate_x
-   
- 
+
+
    SUBROUTINE ultimate_y( pamsk, kn_umx, pdt, pt, pv, pt_v, pfv_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE ultimate_y  ***
-      !!     
-      !! **  Purpose :   compute tracer at v-points 
+      !!
+      !! **  Purpose :   compute tracer at v-points
       !!
       !! **  Method  :   ...
       !!
-      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
+      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.
       !!----------------------------------------------------------------------
       REAL(wp)                        , INTENT(in   ) ::   pamsk     ! advection of concentration (1) or other tracers (0)
@@ -1000,6 +1000,6 @@
       REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pv        ! ice j-velocity component
       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt        ! tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_v      ! tracer at v-point 
-      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfv_ho    ! high order flux 
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_v      ! tracer at v-point
+      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfv_ho    ! high order flux
       !
       INTEGER  ::   ji, jj, jl         ! dummy loop indices
@@ -1115,12 +1115,12 @@
       !
    END SUBROUTINE ultimate_y
-     
+
 
    SUBROUTINE nonosc_ice( pamsk, pdt, pu, pv, pt, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE nonosc_ice  ***
-      !!     
-      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
-      !!       scheme and the before field by a non-oscillatory algorithm 
+      !!
+      !! **  Purpose :   compute monotonic tracer fluxes from the upstream
+      !!       scheme and the before field by a non-oscillatory algorithm
       !!
       !! **  Method  :   ...
@@ -1141,5 +1141,5 @@
       !!----------------------------------------------------------------------
       zbig = 1.e+40_wp
-      
+
       ! antidiffusive flux : high order minus low order
       ! --------------------------------------------------
@@ -1157,10 +1157,10 @@
       !                                    pfu_ho
       !                           *         --->
-      !                        |      |  *   |        | 
-      !                        |      |      |    *   |    
+      !                        |      |  *   |        |
+      !                        |      |      |    *   |
       !                        |      |      |        |    *
-      !            t_ups :       i-1     i       i+1       i+2   
+      !            t_ups :       i-1     i       i+1       i+2
       IF( ll_prelim ) THEN
-         
+
          DO jl = 1, jpl
             DO_2D( 0, 0, 0, 0 )
@@ -1200,5 +1200,5 @@
       z1_dt = 1._wp / pdt
       DO jl = 1, jpl
-         
+
          DO_2D( 1, 1, 1, 1 )
             IF    ( pt(ji,jj,jl) <= 0._wp .AND. pt_ups(ji,jj,jl) <= 0._wp ) THEN
@@ -1244,5 +1244,5 @@
             ! if all the points are outside ice cover
             IF( zup == -zbig )   zbetup(ji,jj,jl) = 0._wp ! zbig
-            IF( zdo ==  zbig )   zbetdo(ji,jj,jl) = 0._wp ! zbig            
+            IF( zdo ==  zbig )   zbetdo(ji,jj,jl) = 0._wp ! zbig
             !
          END_2D
@@ -1250,5 +1250,5 @@
       CALL lbc_lnk_multi( 'icedyn_adv_umx', zbetup, 'T', 1.0_wp, zbetdo, 'T', 1.0_wp )   ! lateral boundary cond. (unchanged sign)
 
-      
+
       ! monotonic flux in the y direction
       ! ---------------------------------
@@ -1280,10 +1280,10 @@
    END SUBROUTINE nonosc_ice
 
-   
+
    SUBROUTINE limiter_x( pdt, pu, pt, pfu_ups, pfu_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE limiter_x  ***
-      !!     
-      !! **  Purpose :   compute flux limiter 
+      !!
+      !! **  Purpose :   compute flux limiter
       !!----------------------------------------------------------------------
       REAL(wp)                  , INTENT(in   ) ::   pdt          ! tracer time-step
@@ -1295,5 +1295,5 @@
       REAL(wp) ::   Cr, Rjm, Rj, Rjp, uCFL, zpsi, zh3, zlimiter, Rr
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes 
+      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes
       !!----------------------------------------------------------------------
       !
@@ -1304,9 +1304,9 @@
       END DO
       CALL lbc_lnk( 'icedyn_adv_umx', zslpx, 'U', -1.0_wp)   ! lateral boundary cond.
-      
+
       DO jl = 1, jpl
          DO_2D( 0, 0, 0, 0 )
             uCFL = pdt * ABS( pu(ji,jj) ) * r1_e1e2t(ji,jj)
-            
+
             Rjm = zslpx(ji-1,jj,jl)
             Rj  = zslpx(ji  ,jj,jl)
@@ -1319,5 +1319,5 @@
                ENDIF
 
-               zh3 = pfu_ho(ji,jj,jl) - pfu_ups(ji,jj,jl)     
+               zh3 = pfu_ho(ji,jj,jl) - pfu_ups(ji,jj,jl)
                IF( Rj > 0. ) THEN
                   zlimiter =  MAX( 0., MIN( zh3, MAX(-Rr * 0.5 * ABS(pu(ji,jj)),  &
@@ -1371,10 +1371,10 @@
    END SUBROUTINE limiter_x
 
-   
+
    SUBROUTINE limiter_y( pdt, pv, pt, pfv_ups, pfv_ho )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE limiter_y  ***
-      !!     
-      !! **  Purpose :   compute flux limiter 
+      !!
+      !! **  Purpose :   compute flux limiter
       !!----------------------------------------------------------------------
       REAL(wp)                   , INTENT(in   ) ::   pdt          ! tracer time-step
@@ -1386,5 +1386,5 @@
       REAL(wp) ::   Cr, Rjm, Rj, Rjp, vCFL, zpsi, zh3, zlimiter, Rr
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpy       ! tracer slopes 
+      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpy       ! tracer slopes
       !!----------------------------------------------------------------------
       !
@@ -1410,5 +1410,5 @@
                ENDIF
 
-               zh3 = pfv_ho(ji,jj,jl) - pfv_ups(ji,jj,jl)     
+               zh3 = pfv_ho(ji,jj,jl) - pfv_ups(ji,jj,jl)
                IF( Rj > 0. ) THEN
                   zlimiter =  MAX( 0., MIN( zh3, MAX(-Rr * 0.5 * ABS(pv(ji,jj)),  &
@@ -1524,6 +1524,6 @@
                   pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra
                   pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl)
-               ENDIF           
-               !                  
+               ENDIF
+               !
                !                               ! -- check s_i -- !
                ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean
@@ -1537,5 +1537,5 @@
             ENDIF
          END_2D
-      END DO 
+      END DO
       !
       !                                           ! -- check e_i/v_i -- !
@@ -1624,5 +1624,5 @@
    SUBROUTINE icemax3D( pice , pmax )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE icemax3D ***                     
+      !!                   ***  ROUTINE icemax3D ***
       !! ** Purpose :  compute the max of the 9 points around
       !!----------------------------------------------------------------------
@@ -1633,10 +1633,10 @@
       !!----------------------------------------------------------------------
       DO jl = 1, jpl
-         DO jj = Njs0-1, Nje0+1    
+         DO jj = Njs0-1, Nje0+1
             DO ji = Nis0, Nie0
                zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jl), pice(ji-1,jj,jl), pice(ji+1,jj,jl) )
             END DO
          END DO
-         DO jj = Njs0, Nje0    
+         DO jj = Njs0, Nje0
             DO ji = Nis0, Nie0
                pmax(ji,jj,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) )
@@ -1648,5 +1648,5 @@
    SUBROUTINE icemax4D( pice , pmax )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE icemax4D ***                     
+      !!                   ***  ROUTINE icemax4D ***
       !! ** Purpose :  compute the max of the 9 points around
       !!----------------------------------------------------------------------
@@ -1659,10 +1659,10 @@
       DO jl = 1, jpl
          DO jk = 1, jlay
-            DO jj = Njs0-1, Nje0+1    
+            DO jj = Njs0-1, Nje0+1
                DO ji = Nis0, Nie0
                   zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jk,jl), pice(ji-1,jj,jk,jl), pice(ji+1,jj,jk,jl) )
                END DO
             END DO
-            DO jj = Njs0, Nje0    
+            DO jj = Njs0, Nje0
                DO ji = Nis0, Nie0
                   pmax(ji,jj,jk,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) )
Index: /NEMO/trunk/src/ICE/icedyn_rdgrft.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_rdgrft.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_rdgrft.F90	(revision 14072)
@@ -2,7 +2,7 @@
    !!======================================================================
    !!                       ***  MODULE icedyn_rdgrft ***
-   !!    sea-ice : Mechanical impact on ice thickness distribution      
+   !!    sea-ice : Mechanical impact on ice thickness distribution
    !!======================================================================
-   !! History :       !  2006-02  (M. Vancoppenolle) Original code 
+   !! History :       !  2006-02  (M. Vancoppenolle) Original code
    !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
    !!----------------------------------------------------------------------
@@ -16,5 +16,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean domain
-   USE phycst         ! physical constants (ocean directory) 
+   USE phycst         ! physical constants (ocean directory)
    USE sbc_oce , ONLY : sss_m, sst_m   ! surface boundary condition: ocean fields
    USE ice1D          ! sea-ice: thermodynamics
@@ -59,16 +59,16 @@
    LOGICAL  ::   ln_str_H79       ! ice strength parameterization (Hibler79)
    REAL(wp) ::   rn_pstar         ! determines ice strength, Hibler JPO79
-   REAL(wp) ::   rn_csrdg         ! fraction of shearing energy contributing to ridging            
+   REAL(wp) ::   rn_csrdg         ! fraction of shearing energy contributing to ridging
    LOGICAL  ::   ln_partf_lin     ! participation function linear (Thorndike et al. (1975))
    REAL(wp) ::   rn_gstar         !    fractional area of young ice contributing to ridging
    LOGICAL  ::   ln_partf_exp     ! participation function exponential (Lipscomb et al. (2007))
    REAL(wp) ::   rn_astar         !    equivalent of G* for an exponential participation function
-   LOGICAL  ::   ln_ridging       ! ridging of ice or not                        
+   LOGICAL  ::   ln_ridging       ! ridging of ice or not
    REAL(wp) ::   rn_hstar         !    thickness that determines the maximal thickness of ridged ice
    REAL(wp) ::   rn_porordg       !    initial porosity of ridges (0.3 regular value)
    REAL(wp) ::   rn_fsnwrdg       !    fractional snow loss to the ocean during ridging
    REAL(wp) ::   rn_fpndrdg       !    fractional pond loss to the ocean during ridging
-   LOGICAL  ::   ln_rafting       ! rafting of ice or not                        
-   REAL(wp) ::   rn_hraft         !    threshold thickness (m) for rafting / ridging 
+   LOGICAL  ::   ln_rafting       ! rafting of ice or not
+   REAL(wp) ::   rn_hraft         !    threshold thickness (m) for rafting / ridging
    REAL(wp) ::   rn_craft         !    coefficient for smoothness of the hyperbolic tangent in rafting
    REAL(wp) ::   rn_fsnwrft       !    fractional snow loss to the ocean during rafting
@@ -124,8 +124,8 @@
       !!                Hibler, W. D. III, 1980, MWR, 108, 1943-1973, 1980.
       !!                Rothrock, D. A., 1975: JGR, 80, 4514-4519.
-      !!                Thorndike et al., 1975, JGR, 80, 4501-4513. 
+      !!                Thorndike et al., 1975, JGR, 80, 4501-4513.
       !!                Bitz et al., JGR, 2001
       !!                Amundrud and Melling, JGR 2005
-      !!                Babko et al., JGR 2002 
+      !!                Babko et al., JGR 2002
       !!
       !!     This routine is based on CICE code and authors William H. Lipscomb,
@@ -135,5 +135,5 @@
       !!
       INTEGER  ::   ji, jj, jk, jl             ! dummy loop index
-      INTEGER  ::   iter, iterate_ridging      ! local integer 
+      INTEGER  ::   iter, iterate_ridging      ! local integer
       INTEGER  ::   ipti                       ! local integer
       REAL(wp) ::   zfac                       ! local scalar
@@ -142,5 +142,5 @@
       REAL(wp), DIMENSION(jpij) ::   zconv         ! 1D rdg_conv (if EAP rheology)
       !
-      INTEGER, PARAMETER ::   jp_itermax = 20    
+      INTEGER, PARAMETER ::   jp_itermax = 20
       !!-------------------------------------------------------------------
       ! controls
@@ -153,5 +153,5 @@
          IF(lwp) WRITE(numout,*)'ice_dyn_rdgrft: ice ridging and rafting'
          IF(lwp) WRITE(numout,*)'~~~~~~~~~~~~~~'
-      ENDIF      
+      ENDIF
 
       !--------------------------------
@@ -168,10 +168,10 @@
          ENDIF
       END_2D
-      
+
       !--------------------------------------------------------
       ! 1) Dynamical inputs (closing rate, divergence, opening)
       !--------------------------------------------------------
       IF( npti > 0 ) THEN
-        
+
          ! just needed here
          CALL tab_2d_1d( npti, nptidx(1:npti), zdelt   (1:npti)      , delta_i )
@@ -184,7 +184,7 @@
 
          DO ji = 1, npti
-            ! closing_net = rate at which open water area is removed + ice area removed by ridging 
+            ! closing_net = rate at which open water area is removed + ice area removed by ridging
             !                                                        - ice area added in new ridges
-            IF( ln_rhg_EVP .OR. ln_rhg_VP ) & 
+            IF( ln_rhg_EVP .OR. ln_rhg_VP ) &
                &               closing_net(ji) = rn_csrdg * 0.5_wp * ( zdelt(ji) - ABS( zdivu(ji) ) ) - MIN( zdivu(ji), 0._wp )
             IF( ln_rhg_EAP )   closing_net(ji) = zconv(ji)
@@ -225,9 +225,9 @@
       !-----------------
       IF( npti > 0 ) THEN
-         
+
          CALL ice_dyn_1d2d( 1 )            ! --- Move to 1D arrays --- !
 
          iter            = 1
-         iterate_ridging = 1      
+         iterate_ridging = 1
          !                                                        !----------------------!
          DO WHILE( iterate_ridging > 0 .AND. iter < jp_itermax )  !  ridging iterations  !
@@ -268,6 +268,6 @@
 
       ENDIF
-   
-      CALL ice_var_agg( 1 ) 
+
+      CALL ice_var_agg( 1 )
 
       ! controls
@@ -287,13 +287,13 @@
       !! ** Purpose :   preparation for ridging calculations
       !!
-      !! ** Method  :   Compute the thickness distribution of the ice and open water 
+      !! ** Method  :   Compute the thickness distribution of the ice and open water
       !!                participating in ridging and of the resulting ridges.
       !!-------------------------------------------------------------------
-      REAL(wp), DIMENSION(:)  , INTENT(in) ::   pato_i, pclosing_net 
-      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pa_i, pv_i 
+      REAL(wp), DIMENSION(:)  , INTENT(in) ::   pato_i, pclosing_net
+      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pa_i, pv_i
       !!
       INTEGER  ::   ji, jl                     ! dummy loop indices
       REAL(wp) ::   z1_gstar, z1_astar, zhmean, zfac   ! local scalar
-      REAL(wp), DIMENSION(jpij)        ::   zasum, z1_asum, zaksum   ! sum of a_i+ato_i and reverse 
+      REAL(wp), DIMENSION(jpij)        ::   zasum, z1_asum, zaksum   ! sum of a_i+ato_i and reverse
       REAL(wp), DIMENSION(jpij,jpl)    ::   zhi                      ! ice thickness
       REAL(wp), DIMENSION(jpij,-1:jpl) ::   zGsum                    ! zGsum(n) = sum of areas in categories 0 to n
@@ -321,5 +321,5 @@
       ! This is analogous to
       !   a(h) = b(h)g(h) as defined in Thorndike et al. (1975).
-      !   assuming b(h) = (2/Gstar) * (1 - G(h)/Gstar). 
+      !   assuming b(h) = (2/Gstar) * (1 - G(h)/Gstar).
       !
       ! apartf = integrating b(h)g(h) between the category boundaries
@@ -346,5 +346,5 @@
       !
       IF( ln_partf_lin ) THEN          !--- Linear formulation (Thorndike et al., 1975)
-         DO jl = 0, jpl    
+         DO jl = 0, jpl
             DO ji = 1, npti
                IF    ( zGsum(ji,jl)   < rn_gstar ) THEN
@@ -361,5 +361,5 @@
          !
       ELSEIF( ln_partf_exp ) THEN      !--- Exponential, more stable formulation (Lipscomb et al, 2007)
-         !                        
+         !
          zfac = 1._wp / ( 1._wp - EXP(-z1_astar) )
          DO jl = -1, jpl
@@ -391,5 +391,5 @@
             END DO
          END DO
-      ELSEIF( ln_rafting .AND. .NOT. ln_ridging ) THEN   !- rafting alone   
+      ELSEIF( ln_rafting .AND. .NOT. ln_ridging ) THEN   !- rafting alone
          DO jl = 1, jpl
             DO ji = 1, npti
@@ -402,5 +402,5 @@
             DO ji = 1, npti
                aridge(ji,jl) = 0._wp
-               araft (ji,jl) = 0._wp         
+               araft (ji,jl) = 0._wp
             END DO
          END DO
@@ -411,13 +411,13 @@
       ! Compute max and min ridged ice thickness for each ridging category.
       ! Assume ridged ice is uniformly distributed between hrmin and hrmax.
-      ! 
+      !
       ! This parameterization is a modified version of Hibler (1980).
       ! The mean ridging thickness, zhmean, is proportional to hi^(0.5)
       !  and for very thick ridging ice must be >= hrdg_hi_min*hi
       !
-      ! The minimum ridging thickness, hrmin, is equal to 2*hi 
+      ! The minimum ridging thickness, hrmin, is equal to 2*hi
       !  (i.e., rafting) and for very thick ridging ice is
       !  constrained by hrmin <= (zhmean + hi)/2.
-      ! 
+      !
       ! The maximum ridging thickness, hrmax, is determined by zhmean and hrmin.
       !
@@ -445,7 +445,7 @@
                   &                    + araft (ji,jl) * ( 1._wp - hi_hrft )
             ELSE
-               hrmin  (ji,jl) = 0._wp 
-               hrmax  (ji,jl) = 0._wp 
-               hraft  (ji,jl) = 0._wp 
+               hrmin  (ji,jl) = 0._wp
+               hrmax  (ji,jl) = 0._wp
+               hraft  (ji,jl) = 0._wp
                hi_hrdg(ji,jl) = 1._wp
             ENDIF
@@ -455,10 +455,10 @@
       ! 3) closing_gross
       !-----------------
-      ! Based on the ITD of ridging and ridged ice, convert the net closing rate to a gross closing rate.  
+      ! Based on the ITD of ridging and ridged ice, convert the net closing rate to a gross closing rate.
       ! NOTE: 0 < aksum <= 1
       WHERE( zaksum(1:npti) > epsi10 )   ;   closing_gross(1:npti) = pclosing_net(1:npti) / zaksum(1:npti)
       ELSEWHERE                          ;   closing_gross(1:npti) = 0._wp
       END WHERE
-      
+
       ! correction to closing rate if excessive ice removal
       !----------------------------------------------------
@@ -472,5 +472,5 @@
             ENDIF
          END DO
-      END DO      
+      END DO
 
       ! 4) correction to opening if excessive open water removal
@@ -478,10 +478,10 @@
       ! Reduce the closing rate if more than 100% of the open water would be removed
       ! Reduce the opening rate in proportion
-      DO ji = 1, npti  
+      DO ji = 1, npti
          zfac = pato_i(ji) + ( opning(ji) - apartf(ji,0) * closing_gross(ji) ) * rDt_ice
          IF( zfac < 0._wp ) THEN           ! would lead to negative ato_i
-            opning(ji) = apartf(ji,0) * closing_gross(ji) - pato_i(ji) * r1_Dt_ice 
+            opning(ji) = apartf(ji,0) * closing_gross(ji) - pato_i(ji) * r1_Dt_ice
          ELSEIF( zfac > zasum(ji) ) THEN   ! would lead to ato_i > asum
-            opning(ji) = apartf(ji,0) * closing_gross(ji) + ( zasum(ji) - pato_i(ji) ) * r1_Dt_ice 
+            opning(ji) = apartf(ji,0) * closing_gross(ji) + ( zasum(ji) - pato_i(ji) ) * r1_Dt_ice
          ENDIF
       END DO
@@ -503,5 +503,5 @@
       REAL(wp) ::   hL, hR, farea              ! left and right limits of integration and new area going to jl2
       REAL(wp) ::   vsw                        ! vol of water trapped into ridges
-      REAL(wp) ::   afrdg, afrft               ! fraction of category area ridged/rafted 
+      REAL(wp) ::   afrdg, afrft               ! fraction of category area ridged/rafted
       REAL(wp)                  ::   airdg1, oirdg1, aprdg1, virdg1, sirdg1
       REAL(wp)                  ::   airft1, oirft1, aprft1
@@ -516,5 +516,5 @@
       REAL(wp), DIMENSION(jpij,nlay_s) ::   esrft     ! snow energy of rafting ice
       REAL(wp), DIMENSION(jpij,nlay_i) ::   eirft     ! ice  energy of rafting ice
-      REAL(wp), DIMENSION(jpij,nlay_s) ::   esrdg     ! enth*volume of new ridges      
+      REAL(wp), DIMENSION(jpij,nlay_s) ::   esrdg     ! enth*volume of new ridges
       REAL(wp), DIMENSION(jpij,nlay_i) ::   eirdg     ! enth*volume of new ridges
       !
@@ -529,10 +529,10 @@
          ato_i_1d(ji) = MAX( 0._wp, ato_i_1d(ji) + ( opning(ji) - apartf(ji,0) * closing_gross(ji) ) * rDt_ice )
       END DO
-      
-      ! 2) compute categories in which ice is removed (jl1) 
+
+      ! 2) compute categories in which ice is removed (jl1)
       !----------------------------------------------------
       DO jl1 = 1, jpl
 
-         IF( nn_icesal /= 2 )  THEN      
+         IF( nn_icesal /= 2 )  THEN
             CALL tab_2d_1d( npti, nptidx(1:npti), s_i_1d(1:npti), s_i(:,:,jl1) )
          ENDIF
@@ -545,5 +545,5 @@
                ELSE                                 ;   z1_ai(ji) = 0._wp
                ENDIF
-               
+
                ! area of ridging / rafting ice (airdg1) and of new ridge (airdg2)
                airdg1 = aridge(ji,jl1) * closing_gross(ji) * rDt_ice
@@ -571,11 +571,11 @@
                sirdg2(ji) = sv_i_2d(ji,jl1)   * afrdg + vsw * sss_1d(ji)
                oirdg1     = oa_i_2d(ji,jl1)   * afrdg
-               oirdg2(ji) = oa_i_2d(ji,jl1)   * afrdg * hi_hrdg(ji,jl1) 
+               oirdg2(ji) = oa_i_2d(ji,jl1)   * afrdg * hi_hrdg(ji,jl1)
 
                virft(ji)  = v_i_2d (ji,jl1)   * afrft
                vsrft(ji)  = v_s_2d (ji,jl1)   * afrft
-               sirft(ji)  = sv_i_2d(ji,jl1)   * afrft 
-               oirft1     = oa_i_2d(ji,jl1)   * afrft 
-               oirft2(ji) = oa_i_2d(ji,jl1)   * afrft * hi_hrft 
+               sirft(ji)  = sv_i_2d(ji,jl1)   * afrft
+               oirft1     = oa_i_2d(ji,jl1)   * afrft
+               oirft2(ji) = oa_i_2d(ji,jl1)   * afrft * hi_hrft
 
                IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN
@@ -595,5 +595,5 @@
                wfx_dyn_1d(ji) = wfx_dyn_1d(ji) - vsw * rhoi * r1_Dt_ice   ! increase in ice volume due to seawater frozen in voids
                sfx_dyn_1d(ji) = sfx_dyn_1d(ji) - vsw * sss_1d(ji) * rhoi * r1_Dt_ice
-               hfx_dyn_1d(ji) = hfx_dyn_1d(ji) + ersw(ji) * r1_Dt_ice          ! > 0 [W.m-2] 
+               hfx_dyn_1d(ji) = hfx_dyn_1d(ji) + ersw(ji) * r1_Dt_ice          ! > 0 [W.m-2]
 
                ! Put the snow lost by ridging into the ocean
@@ -606,5 +606,5 @@
                   sirdg2(ji)     = sirdg2(ji)     - vsw * ( sss_1d(ji) - s_i_1d(ji) )       ! ridge salinity = s_i
                   sfx_bri_1d(ji) = sfx_bri_1d(ji) + sss_1d(ji) * vsw * rhoi * r1_Dt_ice  &  ! put back sss_m into the ocean
-                     &                            - s_i_1d(ji) * vsw * rhoi * r1_Dt_ice     ! and get  s_i  from the ocean 
+                     &                            - s_i_1d(ji) * vsw * rhoi * r1_Dt_ice     ! and get  s_i  from the ocean
                ENDIF
 
@@ -643,9 +643,9 @@
                   ! Remove energy of new ridge to each category jl1
                   !-------------------------------------------------
-                  ze_s_2d(ji,jk,jl1) = ze_s_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft ) 
+                  ze_s_2d(ji,jk,jl1) = ze_s_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft )
                ENDIF
             END DO
          END DO
-                  
+
          ! special loop for e_i because of layers jk
          DO jk = 1, nlay_i
@@ -661,14 +661,14 @@
                   ! Remove energy of new ridge to each category jl1
                   !-------------------------------------------------
-                  ze_i_2d(ji,jk,jl1) = ze_i_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft ) 
+                  ze_i_2d(ji,jk,jl1) = ze_i_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft )
                ENDIF
             END DO
          END DO
-         
-         ! 3) compute categories in which ice is added (jl2) 
+
+         ! 3) compute categories in which ice is added (jl2)
          !--------------------------------------------------
          itest_rdg(1:npti) = 0
          itest_rft(1:npti) = 0
-         DO jl2  = 1, jpl 
+         DO jl2  = 1, jpl
             !
             DO ji = 1, npti
@@ -685,6 +685,6 @@
                      itest_rdg(ji) = 1   ! test for conservation
                   ELSE
-                     farea    = 0._wp 
-                     fvol(ji) = 0._wp                  
+                     farea    = 0._wp
+                     fvol(ji) = 0._wp
                   ENDIF
 
@@ -701,5 +701,5 @@
                   ! Sometimes thickness is larger than hi_max(jpl) because of advection scheme (for very small areas)
                   ! Then ice volume is removed from one category but the ridging/rafting scheme
-                  ! does not know where to move it, leading to a conservation issue.  
+                  ! does not know where to move it, leading to a conservation issue.
                   IF( itest_rdg(ji) == 0 .AND. jl2 == jpl ) THEN   ;   farea = 1._wp   ;   fvol(ji) = 1._wp   ;   ENDIF
                   IF( itest_rft(ji) == 0 .AND. jl2 == jpl )      zswitch(ji) = 1._wp
@@ -716,5 +716,5 @@
                      v_ip_2d (ji,jl2) = v_ip_2d(ji,jl2) + (   vprdg (ji) * rn_fpndrdg * fvol   (ji)   &
                         &                                   + vprft (ji) * rn_fpndrft * zswitch(ji)   )
-                     a_ip_2d (ji,jl2) = a_ip_2d(ji,jl2) + (   aprdg2(ji) * rn_fpndrdg * farea         & 
+                     a_ip_2d (ji,jl2) = a_ip_2d(ji,jl2) + (   aprdg2(ji) * rn_fpndrdg * farea         &
                         &                                   + aprft2(ji) * rn_fpndrft * zswitch(ji)   )
                      IF ( ln_pnd_lids ) THEN
@@ -723,5 +723,5 @@
                      ENDIF
                   ENDIF
-                  
+
                ENDIF
 
@@ -741,5 +741,5 @@
                DO ji = 1, npti
                   IF( apartf(ji,jl1) > 0._wp .AND. closing_gross(ji) > 0._wp )   &
-                     &   ze_i_2d(ji,jk,jl2) = ze_i_2d(ji,jk,jl2) + eirdg(ji,jk) * fvol(ji) + eirft(ji,jk) * zswitch(ji)                  
+                     &   ze_i_2d(ji,jk,jl2) = ze_i_2d(ji,jk,jl2) + eirdg(ji,jk) * fvol(ji) + eirft(ji,jk) * zswitch(ji)
                END DO
             END DO
@@ -763,5 +763,5 @@
       !! ** Purpose :   computes ice strength used in dynamics routines of ice thickness
       !!
-      !! ** Method  :   Compute the strength of the ice pack, defined as the energy (J m-2) 
+      !! ** Method  :   Compute the strength of the ice pack, defined as the energy (J m-2)
       !!              dissipated per unit area removed from the ice pack under compression,
       !!              and assumed proportional to the change in potential energy caused
@@ -793,7 +793,7 @@
       CASE( 1 )               !--- Spatial smoothing
          DO_2D( 0, 0, 0, 0 )
-            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN 
+            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN
                zworka(ji,jj) = ( 4.0 * strength(ji,jj)              &
-                  &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) &  
+                  &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) &
                   &                  + strength(ji,jj-1) * tmask(ji,jj-1,1) + strength(ji,jj+1) * tmask(ji,jj+1,1) &
                   &            ) / ( 4.0 + tmask(ji-1,jj,1) + tmask(ji+1,jj,1) + tmask(ji,jj-1,1) + tmask(ji,jj+1,1) )
@@ -802,5 +802,5 @@
             ENDIF
          END_2D
-         
+
          DO_2D( 0, 0, 0, 0 )
             strength(ji,jj) = zworka(ji,jj)
@@ -815,5 +815,5 @@
          !
          DO_2D( 0, 0, 0, 0 )
-            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN 
+            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN
                itframe = 1 ! number of time steps for the running mean
                IF ( zstrp1(ji,jj) > 0._wp ) itframe = itframe + 1
@@ -831,9 +831,9 @@
    END SUBROUTINE ice_strength
 
-   
+
    SUBROUTINE ice_dyn_1d2d( kn )
       !!-----------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_dyn_1d2d *** 
-      !!                 
+      !!                   ***  ROUTINE ice_dyn_1d2d ***
+      !!
       !! ** Purpose :   move arrays from 1d to 2d and the reverse
       !!-----------------------------------------------------------------------
@@ -905,5 +905,5 @@
       !
    END SUBROUTINE ice_dyn_1d2d
-   
+
 
    SUBROUTINE ice_dyn_rdgrft_init
@@ -911,9 +911,9 @@
       !!                  ***  ROUTINE ice_dyn_rdgrft_init ***
       !!
-      !! ** Purpose :   Physical constants and parameters linked 
+      !! ** Purpose :   Physical constants and parameters linked
       !!                to the mechanical ice redistribution
       !!
-      !! ** Method  :   Read the namdyn_rdgrft namelist 
-      !!                and check the parameters values 
+      !! ** Method  :   Read the namdyn_rdgrft namelist
+      !!                and check the parameters values
       !!                called at the first timestep (nit000)
       !!
@@ -925,6 +925,6 @@
          &                    rn_csrdg  ,                    &
          &                    ln_partf_lin, rn_gstar,        &
-         &                    ln_partf_exp, rn_astar,        & 
-         &                    ln_ridging, rn_hstar, rn_porordg, rn_fsnwrdg, rn_fpndrdg,  & 
+         &                    ln_partf_exp, rn_astar,        &
+         &                    ln_ridging, rn_hstar, rn_porordg, rn_fsnwrdg, rn_fpndrdg,  &
          &                    ln_rafting, rn_hraft, rn_craft  , rn_fsnwrft, rn_fpndrft
       !!-------------------------------------------------------------------
@@ -941,8 +941,8 @@
          WRITE(numout,*) '~~~~~~~~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namdyn_rdgrft:'
-         WRITE(numout,*) '      ice strength parameterization Hibler (1979)              ln_str_H79   = ', ln_str_H79 
+         WRITE(numout,*) '      ice strength parameterization Hibler (1979)              ln_str_H79   = ', ln_str_H79
          WRITE(numout,*) '            1st bulk-rheology parameter                        rn_pstar     = ', rn_pstar
          WRITE(numout,*) '            2nd bulk-rhelogy parameter                         rn_crhg      = ', rn_crhg
-         WRITE(numout,*) '      Fraction of shear energy contributing to ridging         rn_csrdg     = ', rn_csrdg 
+         WRITE(numout,*) '      Fraction of shear energy contributing to ridging         rn_csrdg     = ', rn_csrdg
          WRITE(numout,*) '      linear ridging participation function                    ln_partf_lin = ', ln_partf_lin
          WRITE(numout,*) '            Fraction of ice coverage contributing to ridging   rn_gstar     = ', rn_gstar
@@ -952,11 +952,11 @@
          WRITE(numout,*) '            max ridged ice thickness                           rn_hstar     = ', rn_hstar
          WRITE(numout,*) '            Initial porosity of ridges                         rn_porordg   = ', rn_porordg
-         WRITE(numout,*) '            Fraction of snow volume conserved during ridging   rn_fsnwrdg   = ', rn_fsnwrdg 
-         WRITE(numout,*) '            Fraction of pond volume conserved during ridging   rn_fpndrdg   = ', rn_fpndrdg 
+         WRITE(numout,*) '            Fraction of snow volume conserved during ridging   rn_fsnwrdg   = ', rn_fsnwrdg
+         WRITE(numout,*) '            Fraction of pond volume conserved during ridging   rn_fpndrdg   = ', rn_fpndrdg
          WRITE(numout,*) '      Rafting of ice sheets or not                             ln_rafting   = ', ln_rafting
          WRITE(numout,*) '            Parmeter thickness (threshold between ridge-raft)  rn_hraft     = ', rn_hraft
-         WRITE(numout,*) '            Rafting hyperbolic tangent coefficient             rn_craft     = ', rn_craft  
-         WRITE(numout,*) '            Fraction of snow volume conserved during rafting   rn_fsnwrft   = ', rn_fsnwrft 
-         WRITE(numout,*) '            Fraction of pond volume conserved during rafting   rn_fpndrft   = ', rn_fpndrft 
+         WRITE(numout,*) '            Rafting hyperbolic tangent coefficient             rn_craft     = ', rn_craft
+         WRITE(numout,*) '            Fraction of snow volume conserved during rafting   rn_fsnwrft   = ', rn_fsnwrft
+         WRITE(numout,*) '            Fraction of pond volume conserved during rafting   rn_fpndrft   = ', rn_fpndrft
       ENDIF
       !
@@ -972,8 +972,8 @@
             WRITE(numout,*) '      ==> only ice dynamics is activated, thus some parameters must be changed'
             WRITE(numout,*) '            rn_porordg   = ', rn_porordg
-            WRITE(numout,*) '            rn_fsnwrdg   = ', rn_fsnwrdg 
-            WRITE(numout,*) '            rn_fpndrdg   = ', rn_fpndrdg 
-            WRITE(numout,*) '            rn_fsnwrft   = ', rn_fsnwrft 
-            WRITE(numout,*) '            rn_fpndrft   = ', rn_fpndrft 
+            WRITE(numout,*) '            rn_fsnwrdg   = ', rn_fsnwrdg
+            WRITE(numout,*) '            rn_fpndrdg   = ', rn_fpndrdg
+            WRITE(numout,*) '            rn_fsnwrft   = ', rn_fsnwrft
+            WRITE(numout,*) '            rn_fpndrft   = ', rn_fpndrft
          ENDIF
       ENDIF
Index: /NEMO/trunk/src/ICE/icedyn_rhg.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_rhg.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_rhg.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                     ***  MODULE  icedyn_rhg  ***
-   !!   Sea-Ice dynamics : master routine for rheology 
+   !!   Sea-Ice dynamics : master routine for rheology
    !!======================================================================
    !! history :  4.0  !  2018     (C. Rousset)      Original code
@@ -49,5 +49,5 @@
       !!-------------------------------------------------------------------
       !!               ***  ROUTINE ice_dyn_rhg  ***
-      !!               
+      !!
       !! ** Purpose :   compute ice velocity
       !!
@@ -72,5 +72,5 @@
       !--------------!
       !== Rheology ==!
-      !--------------!   
+      !--------------!
       SELECT CASE( nice_rhg )
       !                                !------------------------!
@@ -78,5 +78,5 @@
          !                             !------------------------!
          CALL ice_dyn_rhg_evp( kt, Kmm, stress1_i, stress2_i, stress12_i, shear_i, divu_i, delta_i )
-         !        
+         !
          !                             !------------------------!
       CASE( np_rhgVP  )                ! Viscous-Plastic        !
@@ -121,5 +121,5 @@
       !!
       NAMELIST/namdyn_rhg/  ln_rhg_EVP, ln_aEVP, ln_rhg_EAP, rn_creepl, rn_ecc , nn_nevp, rn_relast, nn_rhg_chkcvg, &  !-- evp
-         &                  ln_rhg_VP, nn_vp_nout, nn_vp_ninn, nn_vp_chkcvg                                            !-- vp 
+         &                  ln_rhg_VP, nn_vp_nout, nn_vp_ninn, nn_vp_chkcvg                                            !-- vp
       !!-------------------------------------------------------------------
       !
@@ -156,8 +156,8 @@
       !
       !                             !== set the choice of ice advection ==!
-      ioptio = 0 
+      ioptio = 0
       IF( ln_rhg_EVP ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgEVP    ;   ENDIF
       IF( ln_rhg_EAP ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgEAP    ;   ENDIF
-      IF( ln_rhg_VP  ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgVP     ;   ENDIF 
+      IF( ln_rhg_VP  ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgVP     ;   ENDIF
       IF( ioptio /= 1 )   CALL ctl_stop( 'ice_dyn_rhg_init: choose one and only one ice rheology' )
       !
@@ -172,5 +172,5 @@
    !!   Default option         Empty module           NO SI3 sea-ice model
    !!----------------------------------------------------------------------
-#endif 
+#endif
 
    !!======================================================================
Index: /NEMO/trunk/src/ICE/icedyn_rhg_eap.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_rhg_eap.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_rhg_eap.F90	(revision 14072)
@@ -6,7 +6,7 @@
    !! History :   -   !  2007-03  (M.A. Morales Maqueda, S. Bouillon) Original code
    !!            3.0  !  2008-03  (M. Vancoppenolle) adaptation to new model
-   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy 
+   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy
    !!            3.3  !  2009-05  (G.Garric)    addition of the evp case
-   !!            3.4  !  2011-01  (A. Porter)   dynamical allocation 
+   !!            3.4  !  2011-01  (A. Porter)   dynamical allocation
    !!            3.5  !  2012-08  (R. Benshila) AGRIF
    !!            3.6  !  2016-06  (C. Rousset)  Rewriting + landfast ice + mEVP (Bouillon 2013)
@@ -14,5 +14,5 @@
    !!            4.0  !  2018     (many people) SI3 [aka Sea Ice cube]
    !!                 !  2019     (S. Rynders, Y. Aksenov, C. Rousset)  change into eap rheology from
-   !!                                           CICE code (Tsamados, Heorton) 
+   !!                                           CICE code (Tsamados, Heorton)
    !!----------------------------------------------------------------------
 #if defined key_si3 && ! defined key_agrif
@@ -30,6 +30,6 @@
    USE icevar         ! ice_var_sshdyn
    USE icedyn_rdgrft  ! sea-ice: ice strength
-   USE bdy_oce , ONLY : ln_bdy 
-   USE bdyice 
+   USE bdy_oce , ONLY : ln_bdy
+   USE bdyice
 #if defined key_agrif
    USE agrif_ice_interp
@@ -80,7 +80,7 @@
       !!
       !! ** purpose : determines sea ice drift from wind stress, ice-ocean
-      !!  stress and sea-surface slope. Ice-ice interaction is described by 
-      !!  a non-linear elasto-anisotropic-plastic (EAP) law including shear 
-      !!  strength and a bulk rheology .	
+      !!  stress and sea-surface slope. Ice-ice interaction is described by
+      !!  a non-linear elasto-anisotropic-plastic (EAP) law including shear
+      !!  strength and a bulk rheology .
       !!
       !!  The points in the C-grid look like this, dear reader
@@ -90,9 +90,9 @@
       !!                                 |
       !!                      (ji-1,jj)  |  (ji,jj)
-      !!                             ---------   
+      !!                             ---------
       !!                            |         |
       !!                            | (ji,jj) |------(ji,jj)
       !!                            |         |
-      !!                             ---------   
+      !!                             ---------
       !!                     (ji-1,jj-1)     (ji,jj-1)
       !!
@@ -101,5 +101,5 @@
       !!                snow total volume (vt_s) per unit area
       !!
-      !! ** Action  : - compute u_ice, v_ice : the components of the 
+      !! ** Action  : - compute u_ice, v_ice : the components of the
       !!                sea-ice velocity vector
       !!              - compute delta_i, shear_i, divu_i, which are inputs
@@ -107,5 +107,5 @@
       !!
       !! ** Steps   : 0) compute mask at F point
-      !!              1) Compute ice snow mass, ice strength 
+      !!              1) Compute ice snow mass, ice strength
       !!              2) Compute wind, oceanic stresses, mass terms and
       !!                 coriolis terms of the momentum equation
@@ -164,5 +164,5 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zmU_t, zmV_t                    ! (ice-snow_mass / dt) on U/V points
       REAL(wp), DIMENSION(jpi,jpj) ::   zmf                             ! coriolis parameter at T points
-      REAL(wp), DIMENSION(jpi,jpj) ::   v_oceU, u_oceV, v_iceU, u_iceV  ! ocean/ice u/v component on V/U points                           
+      REAL(wp), DIMENSION(jpi,jpj) ::   v_oceU, u_oceV, v_iceU, u_iceV  ! ocean/ice u/v component on V/U points
       !
       REAL(wp), DIMENSION(jpi,jpj) ::   zds                             ! shear
@@ -170,5 +170,5 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zsshdyn                         ! array used for the calculation of ice surface slope:
       !                                                                 !    ocean surface (ssh_m) if ice is not embedded
-      !                                                                 !    ice bottom surface if ice is embedded   
+      !                                                                 !    ice bottom surface if ice is embedded
       REAL(wp), DIMENSION(jpi,jpj) ::   zfU  , zfV                      ! internal stresses
       REAL(wp), DIMENSION(jpi,jpj) ::   zspgU, zspgV                    ! surface pressure gradient at U/V points
@@ -190,5 +190,5 @@
       !! --- diags
       REAL(wp) ::   zsig1, zsig2, zsig12, zfac, z1_strength
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p         
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p
       !! --- SIMIP diags
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xmtrp_ice ! X-component of ice mass transport (kg/s)
@@ -197,5 +197,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_ymtrp_snw ! Y-component of snow mass transport (kg/s)
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xatrp     ! X-component of area transport (m2/s)
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s)      
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s)
       !!-------------------------------------------------------------------
 
@@ -247,5 +247,5 @@
       ! 1) define some variables and initialize arrays
       !------------------------------------------------------------------------------!
-      zrhoco = rho0 * rn_cio 
+      zrhoco = rho0 * rn_cio
 
       ! ecc2: square of yield ellipse eccenticrity
@@ -266,7 +266,7 @@
       ENDIF
       z1_dtevp = 1._wp / zdtevp
-         
-      ! Initialise stress tensor 
-      zs1 (:,:) = pstress1_i (:,:) 
+
+      ! Initialise stress tensor
+      zs1 (:,:) = pstress1_i (:,:)
       zs2 (:,:) = pstress2_i (:,:)
       zs12(:,:) = pstress12_i(:,:)
@@ -315,9 +315,9 @@
          ! dt/m at T points (for alpha and beta coefficients)
          zdt_m(ji,jj)    = zdtevp / MAX( zm1, zmmin )
-         
+
          ! m/dt
          zmU_t(ji,jj)    = zmassU * z1_dtevp
          zmV_t(ji,jj)    = zmassV * z1_dtevp
-         
+
          ! Drag ice-atm.
          ztaux_ai(ji,jj) = zaU(ji,jj) * utau_ice(ji,jj)
@@ -373,5 +373,5 @@
       !                                               ! ==================== !
       DO jter = 1 , nn_nevp                           !    loop over jter    !
-         !                                            ! ==================== !        
+         !                                            ! ==================== !
          l_full_nf_update = jter == nn_nevp   ! false: disable full North fold update (performances) for iter = 1 to nn_nevp-1
          !
@@ -400,5 +400,5 @@
                &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
                &   ) * 0.25_wp * r1_e1e2t(ji,jj)
-           
+
             ! divergence at T points
             zdiv  = ( e2u(ji,jj) * u_ice(ji,jj) - e2u(ji-1,jj) * u_ice(ji-1,jj)   &
@@ -406,5 +406,5 @@
                &    ) * r1_e1e2t(ji,jj)
             zdiv2 = zdiv * zdiv
-            
+
             ! tension at T points
             zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
@@ -414,9 +414,9 @@
 
             ! delta at T points
-            zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 )  
+            zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 )
 
          END_2D
          CALL lbc_lnk( 'icedyn_rhg_eap', zdelta, 'T', 1.0_wp )
-               
+
          ! P/delta at T points
          DO_2D( 1, 1, 1, 1 )
@@ -426,14 +426,14 @@
          DO_2D( 0, 1, 0, 1 )   ! loop ends at jpi,jpj so that no lbc_lnk are needed for zs1 and zs2
 
-             ! shear at T points 
+             ! shear at T points
             zdsT = ( zds(ji,jj  ) * e1e2f(ji,jj  ) + zds(ji-1,jj  ) * e1e2f(ji-1,jj  )  &
                &   + zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
                &   ) * 0.25_wp * r1_e1e2t(ji,jj)
-            
+
            ! divergence at T points (duplication to avoid communications)
             zdiv  = ( e2u(ji,jj) * u_ice(ji,jj) - e2u(ji-1,jj) * u_ice(ji-1,jj)   &
                &    + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   &
                &    ) * r1_e1e2t(ji,jj)
-            
+
             ! tension at T points (duplication to avoid communications)
             zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
@@ -455,5 +455,5 @@
                zyield22(ji,jj) = 0.5_wp * (zstressptmp - zstressmtmp)
                zyield12(ji,jj) = zstress12tmp(ji,jj)
-               prdg_conv(ji,jj) = -min( zalphar, 0._wp)    
+               prdg_conv(ji,jj) = -min( zalphar, 0._wp)
             ENDIF
 
@@ -487,5 +487,5 @@
 
          DO_2D( 1, 0, 1, 0 )
-            ! stress12tmp at F points 
+            ! stress12tmp at F points
             zstress12tmpF = ( zstress12tmp(ji,jj+1) * e1e2t(ji,jj+1) + zstress12tmp(ji+1,jj+1) * e1e2t(ji+1,jj+1)  &
                &            + zstress12tmp(ji,jj  ) * e1e2t(ji,jj  ) + zstress12tmp(ji+1,jj  ) * e1e2t(ji+1,jj  )  &
@@ -500,5 +500,5 @@
                ! zalph2 = zalph2 - 1._wp
             ENDIF
-            
+
             ! stress at F points (zkt/=0 if landfast)
             zs12(ji,jj) = ( zs12(ji,jj) * zalph1 + zstress12tmpF ) * z1_alph1
@@ -566,5 +566,5 @@
                      &                                    + zRHS + zTauO * v_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
                      &                                    ) / MAX( zepsi, zmV_t(ji,jj) * ( zbetav + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast
-                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   & 
+                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   &
                      &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
                      &                                    ) / ( zbetav + 1._wp )                                              &
@@ -621,5 +621,5 @@
                      &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
                      &                                    ) / ( zbetau + 1._wp )                                              &
-                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
+                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &           )   * zmsk00x(ji,jj)
                ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009)
@@ -628,5 +628,5 @@
                      &                                    ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                      & ! m/dt + tau_io(only ice part) + landfast
                      &            + ( 1._wp - rswitch ) *   u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lf_relax )         & ! static friction => slow decrease to v=0
-                     &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                  & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
+                     &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                  & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &            )   * zmsk00x(ji,jj)
                ENDIF
@@ -675,5 +675,5 @@
                      &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
                      &                                    ) / ( zbetau + 1._wp )                                              &
-                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
+                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &           )   * zmsk00x(ji,jj)
                ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009)
@@ -726,5 +726,5 @@
                      &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   &
                      &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
-                     &                                    ) / ( zbetav + 1._wp )                                              & 
+                     &                                    ) / ( zbetav + 1._wp )                                              &
                      &             ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &           )   * zmsk00y(ji,jj)
@@ -759,5 +759,5 @@
       !
       !------------------------------------------------------------------------------!
-      ! 4) Recompute delta, shear and div (inputs for mechanical redistribution) 
+      ! 4) Recompute delta, shear and div (inputs for mechanical redistribution)
       !------------------------------------------------------------------------------!
       DO_2D( 1, 0, 1, 0 )
@@ -769,7 +769,7 @@
 
       END_2D
-      
+
       DO_2D( 0, 0, 0, 0 )
-         
+
          ! tension**2 at T points
          zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
@@ -777,5 +777,5 @@
             &   ) * r1_e1e2t(ji,jj)
          zdt2 = zdt * zdt
-         
+
          zten_i(ji,jj) = zdt
 
@@ -784,5 +784,5 @@
             &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
             &   ) * 0.25_wp * r1_e1e2t(ji,jj)
-         
+
          ! shear at T points
          pshear_i(ji,jj) = SQRT( zdt2 + zds2 )
@@ -792,7 +792,7 @@
             &             + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   &
             &             ) * r1_e1e2t(ji,jj)
-         
+
          ! delta at T points
-         zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta  
+         zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta
          rswitch         = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zfac ) ) ! 0 if delta=0
          pdelta_i(ji,jj) = zfac + rn_creepl * rswitch ! delta+creepl
@@ -802,5 +802,5 @@
          &                                    zten_i, 'T', 1.0_wp, zs1    , 'T', 1.0_wp, zs2     , 'T', 1.0_wp, &
          &                                      zs12, 'F', 1.0_wp )
-      
+
       ! --- Store the stress tensor for the next time step --- !
       pstress1_i (:,:) = zs1 (:,:)
@@ -826,5 +826,5 @@
          CALL iom_put( 'vtau_bi' , ztauy_bi * zmsk00 )
       ENDIF
-       
+
       ! --- divergence, shear and strength --- !
       IF( iom_use('icediv') )   CALL iom_put( 'icediv' , pdivu_i  * zmsk00 )   ! divergence
@@ -837,20 +837,20 @@
          !
          ALLOCATE( zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )
-         !         
+         !
          DO_2D( 1, 1, 1, 1 )
-         
+
             ! Ice stresses
             ! sigma1, sigma2, sigma12 are some useful recombination of the stresses (Hunke and Dukowicz MWR 2002, Bouillon et al., OM2013)
             ! These are NOT stress tensor components, neither stress invariants, neither stress principal components
             ! I know, this can be confusing...
-            zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl ) 
+            zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl )
             zsig1            =   zfac * ( pdivu_i(ji,jj) - pdelta_i(ji,jj) )
             zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj)
             zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj)
-            
+
             ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008)
             zsig_I (ji,jj)   =   zsig1 * 0.5_wp                                           ! 1st stress invariant, aka average normal stress, aka negative pressure
             zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )  ! 2nd  ''       '', aka maximum shear stress
-            
+
          END_2D
          !
@@ -858,7 +858,7 @@
          IF( iom_use('normstr') )   CALL iom_put( 'normstr', zsig_I (:,:) * zmsk00(:,:) ) ! Normal stress
          IF( iom_use('sheastr') )   CALL iom_put( 'sheastr', zsig_II(:,:) * zmsk00(:,:) ) ! Maximum shear stress
-         
+
          DEALLOCATE ( zsig_I, zsig_II )
-         
+
       ENDIF
 
@@ -869,9 +869,9 @@
       IF( iom_use('sig1_pnorm') .OR. iom_use('sig2_pnorm') ) THEN
          !
-         ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )         
-         !         
+         ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )
+         !
          DO_2D( 1, 1, 1, 1 )
-         
-            ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates 
+
+            ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates
             !                        and **deformations** at current iterates
             !                        following Lemieux & Dupont (2020)
@@ -880,9 +880,9 @@
             zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj)
             zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj)
-            
+
             ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008), T-point
             zsig_I(ji,jj)    =   zsig1 * 0.5_wp                                           ! 1st stress invariant, aka average normal stress, aka negative pressure
             zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )  ! 2nd  ''       '', aka maximum shear stress
-   
+
             ! Normalized  principal stresses (used to display the ellipse)
             z1_strength      =   1._wp / MAX( 1._wp, strength(ji,jj) )
@@ -891,9 +891,9 @@
          END_2D
          !
-         CALL iom_put( 'sig1_pnorm' , zsig1_p ) 
-         CALL iom_put( 'sig2_pnorm' , zsig2_p ) 
-      
+         CALL iom_put( 'sig1_pnorm' , zsig1_p )
+         CALL iom_put( 'sig2_pnorm' , zsig2_p )
+
          DEALLOCATE( zsig1_p , zsig2_p , zsig_I, zsig_II )
-         
+
       ENDIF
 
@@ -909,9 +909,9 @@
 
       ! --- anisotropy tensor --- !
-      IF( iom_use('aniso') ) THEN       
-         CALL lbc_lnk( 'icedyn_rhg_eap', paniso_11, 'T', 1.0_wp ) 
+      IF( iom_use('aniso') ) THEN
+         CALL lbc_lnk( 'icedyn_rhg_eap', paniso_11, 'T', 1.0_wp )
          CALL iom_put( 'aniso' , paniso_11 * zmsk00 )
       ENDIF
-      
+
       ! --- SIMIP --- !
       IF(  iom_use('dssh_dx') .OR. iom_use('dssh_dy') .OR. &
@@ -957,5 +957,5 @@
 
          CALL iom_put( 'xmtrpice' , zdiag_xmtrp_ice )   ! X-component of sea-ice mass transport (kg/s)
-         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport 
+         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport
          CALL iom_put( 'xmtrpsnw' , zdiag_xmtrp_snw )   ! X-component of snow mass transport (kg/s)
          CALL iom_put( 'ymtrpsnw' , zdiag_ymtrp_snw )   ! Y-component of snow mass transport
@@ -979,5 +979,5 @@
             ENDIF
          ENDIF
-      ENDIF      
+      ENDIF
       !
       DEALLOCATE( zmsk00, zmsk15 )
@@ -985,9 +985,9 @@
    END SUBROUTINE ice_dyn_rhg_eap
 
-   
+
    SUBROUTINE rhg_cvg( kt, kiter, kitermax, pu, pv, pub, pvb )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE rhg_cvg  ***
-      !!                     
+      !!
       !! ** Purpose :   check convergence of oce rheology
       !!
@@ -997,5 +997,5 @@
       !!                This routine is called every sub-iteration, so it is cpu expensive
       !!
-      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)   
+      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)
       !!----------------------------------------------------------------------
       INTEGER ,                 INTENT(in) ::   kt, kiter, kitermax       ! ocean time-step index
@@ -1004,5 +1004,5 @@
       INTEGER           ::   it, idtime, istatus
       INTEGER           ::   ji, jj          ! dummy loop indices
-      REAL(wp)          ::   zresm           ! local real 
+      REAL(wp)          ::   zresm           ! local real
       CHARACTER(len=20) ::   clname
       REAL(wp), DIMENSION(jpi,jpj) ::   zres           ! check convergence
@@ -1031,5 +1031,5 @@
       ! time
       it = ( kt - 1 ) * kitermax + kiter
-      
+
       ! convergence
       IF( kiter == 1 ) THEN ! remove the first iteration for calculations of convergence (always very large)
@@ -1050,5 +1050,5 @@
          IF( kt == nitend )   istatus = NF90_CLOSE(ncvgid)
       ENDIF
-      
+
    END SUBROUTINE rhg_cvg
 
@@ -1058,5 +1058,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE update_stress_rdg  ***
-      !!                     
+      !!
       !! ** Purpose :   Updates the stress depending on values of strain rate and structure
       !!                tensor and for the last subcycle step it computes closing and sliding rate
@@ -1071,18 +1071,18 @@
       INTEGER  ::   kx ,ky, ka
 
-      REAL(wp) ::   zstemp11r, zstemp12r, zstemp22r   
-      REAL(wp) ::   zstemp11s, zstemp12s, zstemp22s 
-      REAL(wp) ::   za22, zQd11Qd11, zQd11Qd12, zQd12Qd12 
-      REAL(wp) ::   zQ11Q11, zQ11Q12, zQ12Q12 
-      REAL(wp) ::   zdtemp11, zdtemp12, zdtemp22 
-      REAL(wp) ::   zrotstemp11r, zrotstemp12r, zrotstemp22r   
+      REAL(wp) ::   zstemp11r, zstemp12r, zstemp22r
+      REAL(wp) ::   zstemp11s, zstemp12s, zstemp22s
+      REAL(wp) ::   za22, zQd11Qd11, zQd11Qd12, zQd12Qd12
+      REAL(wp) ::   zQ11Q11, zQ11Q12, zQ12Q12
+      REAL(wp) ::   zdtemp11, zdtemp12, zdtemp22
+      REAL(wp) ::   zrotstemp11r, zrotstemp12r, zrotstemp22r
       REAL(wp) ::   zrotstemp11s, zrotstemp12s, zrotstemp22s
-      REAL(wp) ::   zsig11, zsig12, zsig22 
-      REAL(wp) ::   zsgprm11, zsgprm12, zsgprm22 
-      REAL(wp) ::   zinvstressconviso 
-      REAL(wp) ::   zAngle_denom_gamma,  zAngle_denom_alpha 
-      REAL(wp) ::   zTany_1, zTany_2 
+      REAL(wp) ::   zsig11, zsig12, zsig22
+      REAL(wp) ::   zsgprm11, zsgprm12, zsgprm22
+      REAL(wp) ::   zinvstressconviso
+      REAL(wp) ::   zAngle_denom_gamma,  zAngle_denom_alpha
+      REAL(wp) ::   zTany_1, zTany_2
       REAL(wp) ::   zx, zy, zdx, zdy, zda, zkxw, kyw, kaw
-      REAL(wp) ::   zinvdx, zinvdy, zinvda   
+      REAL(wp) ::   zinvdx, zinvdy, zinvda
       REAL(wp) ::   zdtemp1, zdtemp2, zatempprime, zinvsin
 
@@ -1093,8 +1093,8 @@
 !      zinvstressconviso = 1._wp/(1._wp+kfriction*kfriction)
       zinvstressconviso = 1._wp
- 
-      zinvsin = 1._wp/sin(2._wp*pphi) * zinvstressconviso 
+
+      zinvsin = 1._wp/sin(2._wp*pphi) * zinvstressconviso
       !now uses phi as set in higher code
-       
+
       ! compute eigenvalues, eigenvectors and angles for structure tensor, strain
       ! rates
@@ -1105,22 +1105,22 @@
       zQ12Q12 = rsmall
       zQ11Q12 = rsmall
- 
-      ! gamma: angle between general coordiantes and principal axis of A 
-      ! here Tan2gamma = 2 a12 / (a11 - a22) 
-      IF((ABS(pa11 - za22) > rsmall).OR.(ABS(pa12) > rsmall)) THEN      
+
+      ! gamma: angle between general coordiantes and principal axis of A
+      ! here Tan2gamma = 2 a12 / (a11 - a22)
+      IF((ABS(pa11 - za22) > rsmall).OR.(ABS(pa12) > rsmall)) THEN
          zAngle_denom_gamma = 1._wp/sqrt( ( pa11 - za22 )*( pa11 - za22) + &
                               4._wp*pa12*pa12 )
-   
-         zQ11Q11 = 0.5_wp + ( pa11 - za22 )*0.5_wp*zAngle_denom_gamma   !Cos^2 
+
+         zQ11Q11 = 0.5_wp + ( pa11 - za22 )*0.5_wp*zAngle_denom_gamma   !Cos^2
          zQ12Q12 = 0.5_wp - ( pa11 - za22 )*0.5_wp*zAngle_denom_gamma   !Sin^2
-         zQ11Q12 = pa12*zAngle_denom_gamma                     !CosSin 
-      ENDIF
- 
+         zQ11Q12 = pa12*zAngle_denom_gamma                     !CosSin
+      ENDIF
+
       ! rotation Q*atemp*Q^T
-      zatempprime = zQ11Q11*pa11 + 2.0_wp*zQ11Q12*pa12 + zQ12Q12*za22 
-      
+      zatempprime = zQ11Q11*pa11 + 2.0_wp*zQ11Q12*pa12 + zQ12Q12*za22
+
       ! make first principal value the largest
       zatempprime = max(zatempprime, 1.0_wp - zatempprime)
- 
+
       ! 2) strain rate
       zdtemp11 = 0.5_wp*(pdivu + ptension)
@@ -1128,5 +1128,5 @@
       zdtemp22 = 0.5_wp*(pdivu - ptension)
 
-      ! here Tan2alpha = 2 dtemp12 / (dtemp11 - dtemp22) 
+      ! here Tan2alpha = 2 dtemp12 / (dtemp11 - dtemp22)
 
       zQd11Qd11 = 1.0_wp
@@ -1139,5 +1139,5 @@
                              ( zdtemp11 - zdtemp22 ) + 4.0_wp*zdtemp12*zdtemp12)
 
-         zQd11Qd11 = 0.5_wp + ( zdtemp11 - zdtemp22 )*0.5_wp*zAngle_denom_alpha !Cos^2 
+         zQd11Qd11 = 0.5_wp + ( zdtemp11 - zdtemp22 )*0.5_wp*zAngle_denom_alpha !Cos^2
          zQd12Qd12 = 0.5_wp - ( zdtemp11 - zdtemp22 )*0.5_wp*zAngle_denom_alpha !Sin^2
          zQd11Qd12 = zdtemp12*zAngle_denom_alpha !CosSin
@@ -1150,29 +1150,29 @@
       IF ((ABS(zdtemp1) > rsmall).OR.(ABS(zdtemp2) > rsmall)) THEN
          zx = atan2(zdtemp2,zdtemp1)
-      ENDIF      
-               
-      ! to ensure the angle lies between pi/4 and 9 pi/4 
+      ENDIF
+
+      ! to ensure the angle lies between pi/4 and 9 pi/4
       IF (zx < rpi*0.25_wp) zx = zx + rpi*2.0_wp
-      
+
       ! y: angle between major principal axis of strain rate and structure
       ! tensor
-      ! y = gamma - alpha 
+      ! y = gamma - alpha
       ! Expressesed componently with
       ! Tany = (Singamma*Cosgamma - Sinalpha*Cosgamma)/(Cos^2gamma - Sin^alpha)
-      
+
       zTany_1 = zQ11Q12 - zQd11Qd12
       zTany_2 = zQ11Q11 - zQd12Qd12
-      
+
       zy = 0._wp
-      
+
       IF ((ABS(zTany_1) > rsmall).OR.(ABS(zTany_2) > rsmall)) THEN
          zy = atan2(zTany_1,zTany_2)
       ENDIF
-      
+
       ! to make sure y is between 0 and pi
       IF (zy > rpi) zy = zy - rpi
       IF (zy < 0)  zy = zy + rpi
 
-      ! 3) update anisotropic stress tensor 
+      ! 3) update anisotropic stress tensor
       zdx   = rpi/real(nx_yield-1,kind=wp)
       zdy   = rpi/real(ny_yield-1,kind=wp)
@@ -1186,14 +1186,14 @@
       kx  = int((zx-rpi*0.25_wp-rpi)*zinvdx) + 1
       !!clem kx  = MAX( 1, MIN( nx_yield-1, INT((zx-rpi*0.25_wp-rpi)*zinvdx) + 1  ) )
-      zkxw = kx - (zx-rpi*0.25_wp-rpi)*zinvdx  
-      
+      zkxw = kx - (zx-rpi*0.25_wp-rpi)*zinvdx
+
       ky  = int(zy*zinvdy) + 1
       !!clem ky  = MAX( 1, MIN( ny_yield-1, INT(zy*zinvdy) + 1 ) )
-      kyw = ky - zy*zinvdy 
-      
+      kyw = ky - zy*zinvdy
+
       ka  = int((zatempprime-0.5_wp)*zinvda) + 1
       !!clem ka  = MAX( 1, MIN( na_yield-1, INT((zatempprime-0.5_wp)*zinvda) + 1 ) )
       kaw = ka - (zatempprime-0.5_wp)*zinvda
-      
+
       ! % Determine sigma_r(A1,Zeta,y) and sigma_s (see Section A1 of Tsamados 2013)
 !!$      zstemp11r =  zkxw  * kyw         * kaw         * s11r(kx  ,ky  ,ka  ) &
@@ -1221,5 +1221,5 @@
 !!$        & + zkxw         * (1._wp-kyw) * (1._wp-kaw) * s22r(kx  ,ky+1,ka+1) &
 !!$        & + (1._wp-zkxw) * (1._wp-kyw) * (1._wp-kaw) * s22r(kx+1,ky+1,ka+1)
-!!$      
+!!$
 !!$      zstemp11s =  zkxw  * kyw         * kaw         * s11s(kx  ,ky  ,ka  ) &
 !!$        & + (1._wp-zkxw) * kyw         * kaw         * s11s(kx+1,ky  ,ka  ) &
@@ -1253,6 +1253,6 @@
       zstemp12s = s12s(kx,ky,ka)
       zstemp22s = s22s(kx,ky,ka)
-      
-      
+
+
       ! Calculate mean ice stress over a collection of floes (Equation 3 in
       ! Tsamados 2013)
@@ -1273,5 +1273,5 @@
       pstressm  = zsgprm11 - zsgprm22
 
-      ! Compute ridging and sliding functions in general coordinates 
+      ! Compute ridging and sliding functions in general coordinates
       ! (Equation 11 in Tsamados 2013)
       IF (ksub == kndte) THEN
@@ -1280,5 +1280,5 @@
          zrotstemp12r = zQ11Q11*zstemp12r +       zQ11Q12*(zstemp11r-zstemp22r) &
                       - zQ12Q12*zstemp12r
-         zrotstemp22r = zQ12Q12*zstemp11r + 2._wp*zQ11Q12* zstemp12r & 
+         zrotstemp22r = zQ12Q12*zstemp11r + 2._wp*zQ11Q12* zstemp12r &
                       + zQ11Q11*zstemp22r
 
@@ -1287,5 +1287,5 @@
          zrotstemp12s = zQ11Q11*zstemp12s +       zQ11Q12*(zstemp11s-zstemp22s) &
                       - zQ12Q12*zstemp12s
-         zrotstemp22s = zQ12Q12*zstemp11s + 2._wp*zQ11Q12* zstemp12s & 
+         zrotstemp22s = zQ12Q12*zstemp11s + 2._wp*zQ11Q12* zstemp12s &
                       + zQ11Q11*zstemp22s
 
@@ -1295,5 +1295,5 @@
                   + zrotstemp22s*zdtemp22
       ENDIF
-   END SUBROUTINE update_stress_rdg 
+   END SUBROUTINE update_stress_rdg
 
 !=======================================================================
@@ -1304,5 +1304,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE calc_ffrac  ***
-      !!                     
+      !!
       !! ** Purpose :   Computes term in evolution equation for structure tensor
       !!                which determines the ice floe re-orientation due to fracture
@@ -1319,20 +1319,20 @@
       REAL (wp) ::   zQ11, zQ12, zQ11Q11, zQ11Q12, zQ12Q12
 
-!!$      REAL (wp), PARAMETER ::   kfrac = 0.0001_wp   ! rate of fracture formation 
-      REAL (wp), PARAMETER ::   kfrac = 1.e-3_wp   ! rate of fracture formation 
-      REAL (wp), PARAMETER ::   threshold = 0.3_wp  ! critical confinement ratio 
+!!$      REAL (wp), PARAMETER ::   kfrac = 0.0001_wp   ! rate of fracture formation
+      REAL (wp), PARAMETER ::   kfrac = 1.e-3_wp   ! rate of fracture formation
+      REAL (wp), PARAMETER ::   threshold = 0.3_wp  ! critical confinement ratio
       !!---------------------------------------------------------------
       !
-      zsigma11 = 0.5_wp*(pstressp+pstressm) 
-      zsigma12 = pstress12 
-      zsigma22 = 0.5_wp*(pstressp-pstressm) 
+      zsigma11 = 0.5_wp*(pstressp+pstressm)
+      zsigma12 = pstress12
+      zsigma22 = 0.5_wp*(pstressp-pstressm)
 
       ! Here's the change - no longer calculate gamma,
       ! use trig formulation, angle signs are kept correct, don't worry
-   
+
       ! rotate tensor to get into sigma principal axis
-   
-      ! here Tan2gamma = 2 sig12 / (sig11 - sig12) 
-      ! add rsmall to the denominator to stop 1/0 errors, makes very little 
+
+      ! here Tan2gamma = 2 sig12 / (sig11 - sig12)
+      ! add rsmall to the denominator to stop 1/0 errors, makes very little
       ! error to the calculated angles < rsmall
 
@@ -1346,7 +1346,7 @@
                        zsigma22 ) + 4.0_wp*zsigma12*zsigma12)
 
-         zQ11Q11 = 0.5_wp + ( zsigma11 - zsigma22 )*0.5_wp*zAngle_denom   !Cos^2 
+         zQ11Q11 = 0.5_wp + ( zsigma11 - zsigma22 )*0.5_wp*zAngle_denom   !Cos^2
          zQ12Q12 = 0.5_wp - ( zsigma11 - zsigma22 )*0.5_wp*zAngle_denom   !Sin^2
-         zQ11Q12 = zsigma12*zAngle_denom                      !CosSin 
+         zQ11Q12 = zsigma12*zAngle_denom                      !CosSin
       ENDIF
 
@@ -1375,5 +1375,5 @@
 
       ! Horizontal spalling
-      ELSE 
+      ELSE
          pmresult11 = 0.0_wp
          pmresult12 = 0.0_wp
@@ -1386,7 +1386,7 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE rhg_eap_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write RHG file in restart file
-      !!      
+      !!
       !! ** Method  :   use of IOM library
       !!----------------------------------------------------------------------
@@ -1397,7 +1397,7 @@
       INTEGER  ::   id1, id2, id3, id4, id5   ! local integers
       INTEGER  ::   ix, iy, ip, iz, n, ia     ! local integers
-    
+
       INTEGER, PARAMETER            ::    nz = 100
-      
+
       REAL(wp) ::   ainit, xinit, yinit, pinit, zinit
       REAL(wp) ::   da, dx, dy, dp, dz, a1
@@ -1481,5 +1481,5 @@
 !!$                        s22r(ix,iy,ia) = s22r(ix,iy,ia) + 1*w1(ainit+ia*da)* &
 !!$                           exp(-w2(ainit+ia*da)*(zinit+iz*dz)*(zinit+iz*dz))* &
-!!$                           s22kr(xinit+ix*dx,yinit+iy*dy,zinit+iz*dz)*dz/sin(2._wp*pphi) 
+!!$                           s22kr(xinit+ix*dx,yinit+iy*dy,zinit+iz*dz)*dz/sin(2._wp*pphi)
 !!$                        s11s(ix,iy,ia) = s11s(ix,iy,ia) + 1*w1(ainit+ia*da)* &
 !!$                           exp(-w2(ainit+ia*da)*(zinit+iz*dz)*(zinit+iz*dz))* &
@@ -1516,5 +1516,5 @@
 !!$         ENDDO
 
-         !! faster but still very slow => to be improved         
+         !! faster but still very slow => to be improved
          zfac = dz/sin(2._wp*pphi)
          DO ia = 1, na_yield-1
@@ -1530,5 +1530,5 @@
                      s11r(ix,iy,ia) = s11r(ix,iy,ia) + ztemp * s11kr(idx,idy,idz)*zfac
                      s12r(ix,iy,ia) = s12r(ix,iy,ia) + ztemp * s12kr(idx,idy,idz)*zfac
-                     s22r(ix,iy,ia) = s22r(ix,iy,ia) + ztemp * s22kr(idx,idy,idz)*zfac 
+                     s22r(ix,iy,ia) = s22r(ix,iy,ia) + ztemp * s22kr(idx,idy,idz)*zfac
                      s11s(ix,iy,ia) = s11s(ix,iy,ia) + ztemp * s11ks(idx,idy,idz)*zfac
                      s12s(ix,iy,ia) = s12s(ix,iy,ia) + ztemp * s12ks(idx,idy,idz)*zfac
@@ -1544,5 +1544,5 @@
             idy = yinit+iy*dy
             DO ix = 1, nx_yield
-               idx = xinit+ix*dx                  
+               idx = xinit+ix*dx
                s11r(ix,iy,ia) = 0.5_wp*s11kr(idx,idy,0._wp)*zfac
                s12r(ix,iy,ia) = 0.5_wp*s12kr(idx,idy,0._wp)*zfac
@@ -1584,5 +1584,5 @@
       REAL(wp) ::   w1
       !!-------------------------------------------------------------------
-   
+
       w1 = -   223.87569446_wp &
        &   +  2361.21986630_wp*pa &
@@ -1593,5 +1593,5 @@
        &   - 16789.98003081_wp*pa*pa*pa*pa*pa*pa &
        &   +  3495.82839237_wp*pa*pa*pa*pa*pa*pa*pa
-   
+
    END FUNCTION w1
 
@@ -1604,5 +1604,5 @@
       REAL(wp) ::   w2
       !!-------------------------------------------------------------------
-   
+
       w2 = -    6670.68911883_wp &
        &   +   70222.33061536_wp*pa &
@@ -1613,15 +1613,15 @@
        &   -  493379.44906738_wp*pa*pa*pa*pa*pa*pa &
        &   +  102356.55151800_wp*pa*pa*pa*pa*pa*pa*pa
-   
+
    END FUNCTION w2
 
-   FUNCTION s11kr(px,py,pz) 
+   FUNCTION s11kr(px,py,pz)
       !!-------------------------------------------------------------------
       !! Function : s11kr
       !!-------------------------------------------------------------------
       REAL(wp), INTENT(in   ) ::   px,py,pz
-   
+
       REAL(wp) ::   s11kr, zpih
-   
+
       REAL(wp) ::   zn1t2i11, zn1t2i12, zn1t2i21, zn1t2i22
       REAL(wp) ::   zn2t1i11, zn2t1i12, zn2t1i21, zn2t1i22
@@ -1632,7 +1632,7 @@
       REAL(wp) ::   zHen1t2, zHen2t1
       !!-------------------------------------------------------------------
-   
+
       zpih = 0.5_wp*rpi
-   
+
       zn1t2i11 = cos(pz+zpih-pphi) * cos(pz+pphi)
       zn1t2i12 = cos(pz+zpih-pphi) * sin(pz+pphi)
@@ -1660,5 +1660,5 @@
       zIIn2t1 = zn2t1i11 * zd11 + (zn2t1i12 + zn2t1i21) * zd12 + zn2t1i22 * zd22
       zIIt1t2 = zt1t2i11 * zd11 + (zt1t2i12 + zt1t2i21) * zd12 + zt1t2i22 * zd22
-   
+
       IF (-zIIn1t2>=rsmall) THEN
       zHen1t2 = 1._wp
@@ -1666,5 +1666,5 @@
       zHen1t2 = 0._wp
       ENDIF
-   
+
       IF (-zIIn2t1>=rsmall) THEN
       zHen2t1 = 1._wp
@@ -1672,5 +1672,5 @@
       zHen2t1 = 0._wp
       ENDIF
-   
+
       s11kr = (- zHen1t2 * zn1t2i11 - zHen2t1 * zn2t1i11)
 
@@ -1694,5 +1694,5 @@
       !!-------------------------------------------------------------------
       zpih = 0.5_wp*rpi
-   
+
       zn1t2i11 = cos(pz+zpih-pphi) * cos(pz+pphi)
       zn1t2i12 = cos(pz+zpih-pphi) * sin(pz+pphi)
@@ -1717,5 +1717,5 @@
       zIIn2t1 = zn2t1i11 * zd11 + (zn2t1i12 + zn2t1i21) * zd12 + zn2t1i22 * zd22
       zIIt1t2 = zt1t2i11 * zd11 + (zt1t2i12 + zt1t2i21) * zd12 + zt1t2i22 * zd22
-   
+
       IF (-zIIn1t2>=rsmall) THEN
       zHen1t2 = 1._wp
@@ -1723,5 +1723,5 @@
       zHen1t2 = 0._wp
       ENDIF
-   
+
       IF (-zIIn2t1>=rsmall) THEN
       zHen2t1 = 1._wp
@@ -1729,9 +1729,9 @@
       zHen2t1 = 0._wp
       ENDIF
-   
+
       zs12r0 = (- zHen1t2 * zn1t2i12 - zHen2t1 * zn2t1i12)
       zs21r0 = (- zHen1t2 * zn1t2i21 - zHen2t1 * zn2t1i21)
       s12kr=0.5_wp*(zs12r0+zs21r0)
-   
+
    END FUNCTION s12kr
 
@@ -1909,5 +1909,5 @@
    END FUNCTION s12ks
 
-   FUNCTION s22ks(px,py,pz) 
+   FUNCTION s22ks(px,py,pz)
       !!-------------------------------------------------------------------
       !! Function : s22ks
Index: /NEMO/trunk/src/ICE/icedyn_rhg_evp.F90
===================================================================
--- /NEMO/trunk/src/ICE/icedyn_rhg_evp.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icedyn_rhg_evp.F90	(revision 14072)
@@ -6,7 +6,7 @@
    !! History :   -   !  2007-03  (M.A. Morales Maqueda, S. Bouillon) Original code
    !!            3.0  !  2008-03  (M. Vancoppenolle) adaptation to new model
-   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy 
+   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy
    !!            3.3  !  2009-05  (G.Garric)    addition of the evp case
-   !!            3.4  !  2011-01  (A. Porter)   dynamical allocation 
+   !!            3.4  !  2011-01  (A. Porter)   dynamical allocation
    !!            3.5  !  2012-08  (R. Benshila) AGRIF
    !!            3.6  !  2016-06  (C. Rousset)  Rewriting + landfast ice + mEVP (Bouillon 2013)
@@ -28,6 +28,6 @@
    USE icevar         ! ice_var_sshdyn
    USE icedyn_rdgrft  ! sea-ice: ice strength
-   USE bdy_oce , ONLY : ln_bdy 
-   USE bdyice 
+   USE bdy_oce , ONLY : ln_bdy
+   USE bdyice
 #if defined key_agrif
    USE agrif_ice_interp
@@ -69,7 +69,7 @@
       !!
       !! ** purpose : determines sea ice drift from wind stress, ice-ocean
-      !!  stress and sea-surface slope. Ice-ice interaction is described by 
-      !!  a non-linear elasto-viscous-plastic (EVP) law including shear 
-      !!  strength and a bulk rheology (Hunke and Dukowicz, 2002).	
+      !!  stress and sea-surface slope. Ice-ice interaction is described by
+      !!  a non-linear elasto-viscous-plastic (EVP) law including shear
+      !!  strength and a bulk rheology (Hunke and Dukowicz, 2002).
       !!
       !!  The points in the C-grid look like this, dear reader
@@ -79,9 +79,9 @@
       !!                                 |
       !!                      (ji-1,jj)  |  (ji,jj)
-      !!                             ---------   
+      !!                             ---------
       !!                            |         |
       !!                            | (ji,jj) |------(ji,jj)
       !!                            |         |
-      !!                             ---------   
+      !!                             ---------
       !!                     (ji-1,jj-1)     (ji,jj-1)
       !!
@@ -90,5 +90,5 @@
       !!                snow total volume (vt_s) per unit area
       !!
-      !! ** Action  : - compute u_ice, v_ice : the components of the 
+      !! ** Action  : - compute u_ice, v_ice : the components of the
       !!                sea-ice velocity vector
       !!              - compute delta_i, shear_i, divu_i, which are inputs
@@ -96,5 +96,5 @@
       !!
       !! ** Steps   : 0) compute mask at F point
-      !!              1) Compute ice snow mass, ice strength 
+      !!              1) Compute ice snow mass, ice strength
       !!              2) Compute wind, oceanic stresses, mass terms and
       !!                 coriolis terms of the momentum equation
@@ -152,5 +152,5 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zsshdyn                         ! array used for the calculation of ice surface slope:
       !                                                                 !    ocean surface (ssh_m) if ice is not embedded
-      !                                                                 !    ice bottom surface if ice is embedded   
+      !                                                                 !    ice bottom surface if ice is embedded
       REAL(wp), DIMENSION(jpi,jpj) ::   zfU  , zfV                      ! internal stresses
       REAL(wp), DIMENSION(jpi,jpj) ::   zspgU, zspgV                    ! surface pressure gradient at U/V points
@@ -172,5 +172,5 @@
       !! --- diags
       REAL(wp) ::   zsig1, zsig2, zsig12, zfac, z1_strength
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p         
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p
       !! --- SIMIP diags
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xmtrp_ice ! X-component of ice mass transport (kg/s)
@@ -179,5 +179,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_ymtrp_snw ! Y-component of snow mass transport (kg/s)
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xatrp     ! X-component of area transport (m2/s)
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s)      
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s)
       !!-------------------------------------------------------------------
 
@@ -229,5 +229,5 @@
       ! 1) define some variables and initialize arrays
       !------------------------------------------------------------------------------!
-      zrhoco = rho0 * rn_cio 
+      zrhoco = rho0 * rn_cio
 
       ! ecc2: square of yield ellipse eccenticrity
@@ -248,7 +248,7 @@
       ENDIF
       z1_dtevp = 1._wp / zdtevp
-         
-      ! Initialise stress tensor 
-      zs1 (:,:) = pstress1_i (:,:) 
+
+      ! Initialise stress tensor
+      zs1 (:,:) = pstress1_i (:,:)
       zs2 (:,:) = pstress2_i (:,:)
       zs12(:,:) = pstress12_i(:,:)
@@ -292,9 +292,9 @@
          ! dt/m at T points (for alpha and beta coefficients)
          zdt_m(ji,jj)    = zdtevp / MAX( zm1, zmmin )
-         
+
          ! m/dt
          zmU_t(ji,jj)    = zmassU * z1_dtevp
          zmV_t(ji,jj)    = zmassV * z1_dtevp
-         
+
          ! Drag ice-atm.
          ztaux_ai(ji,jj) = zaU(ji,jj) * utau_ice(ji,jj)
@@ -350,5 +350,5 @@
       !                                               ! ==================== !
       DO jter = 1 , nn_nevp                           !    loop over jter    !
-         !                                            ! ==================== !        
+         !                                            ! ==================== !
          l_full_nf_update = jter == nn_nevp   ! false: disable full North fold update (performances) for iter = 1 to nn_nevp-1
          !
@@ -377,5 +377,5 @@
                &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
                &   ) * 0.25_wp * r1_e1e2t(ji,jj)
-           
+
             ! divergence at T points
             zdiv  = ( e2u(ji,jj) * u_ice(ji,jj) - e2u(ji-1,jj) * u_ice(ji-1,jj)   &
@@ -383,5 +383,5 @@
                &    ) * r1_e1e2t(ji,jj)
             zdiv2 = zdiv * zdiv
-            
+
             ! tension at T points
             zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
@@ -389,7 +389,7 @@
                &   ) * r1_e1e2t(ji,jj)
             zdt2 = zdt * zdt
-            
+
             ! delta at T points
-            zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 )  
+            zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 )
 
          END_2D
@@ -407,10 +407,10 @@
                &    + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   &
                &    ) * r1_e1e2t(ji,jj)
-            
+
             ! tension at T points (duplication to avoid communications)
             zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
                &   - ( v_ice(ji,jj) * r1_e1v(ji,jj) - v_ice(ji,jj-1) * r1_e1v(ji,jj-1) ) * e1t(ji,jj) * e1t(ji,jj)   &
                &   ) * r1_e1e2t(ji,jj)
-            
+
             ! alpha for aEVP
             !   gamma = 0.5*P/(delta+creepl) * (c*pi)**2/Area * dt/m
@@ -427,9 +427,9 @@
                ! zalph2 = zalph1
             ENDIF
-            
+
             ! stress at T points (zkt/=0 if landfast)
             zs1(ji,jj) = ( zs1(ji,jj)*zalph1 + zp_delt(ji,jj) * ( zdiv*(1._wp + zkt) - zdelta(ji,jj)*(1._wp - zkt) ) ) * z1_alph1
             zs2(ji,jj) = ( zs2(ji,jj)*zalph2 + zp_delt(ji,jj) * ( zdt * z1_ecc2 * (1._wp + zkt) ) ) * z1_alph2
-          
+
          END_2D
 
@@ -440,5 +440,5 @@
             END_2D
          ENDIF
-         
+
          DO_2D( 1, 0, 1, 0 )
 
@@ -451,8 +451,8 @@
                ! zalph2 = zalph2 - 1._wp
             ENDIF
-            
+
             ! P/delta at F points
             zp_delf = 0.25_wp * ( zp_delt(ji,jj) + zp_delt(ji+1,jj) + zp_delt(ji,jj+1) + zp_delt(ji+1,jj+1) )
-            
+
             ! stress at F points (zkt/=0 if landfast)
             zs12(ji,jj)= ( zs12(ji,jj) * zalph2 + zp_delf * ( zds(ji,jj) * z1_ecc2 * (1._wp + zkt) ) * 0.5_wp ) * z1_alph2
@@ -519,5 +519,5 @@
                      &                                    + zRHS + zTauO * v_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
                      &                                    ) / MAX( zepsi, zmV_t(ji,jj) * ( zbetav + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast
-                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   & 
+                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   &
                      &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
                      &                                    ) / ( zbetav + 1._wp )                                              &
@@ -574,59 +574,5 @@
                      &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
                      &                                    ) / ( zbetau + 1._wp )                                              &
-                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
-                     &           )   * zmsk00x(ji,jj)
-               ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009)
-                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * u_ice(ji,jj)                                       & ! previous velocity
-                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
-                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                      & ! m/dt + tau_io(only ice part) + landfast
-                     &            + ( 1._wp - rswitch ) *   u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lf_relax )         & ! static friction => slow decrease to v=0
-                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
-                     &           )   * zmsk00x(ji,jj)
-               ENDIF
-            END_2D
-            CALL lbc_lnk( 'icedyn_rhg_evp', u_ice, 'U', -1.0_wp )
-            !
-#if defined key_agrif
-!!            CALL agrif_interp_ice( 'U', jter, nn_nevp )
-            CALL agrif_interp_ice( 'U' )
-#endif
-            IF( ln_bdy )   CALL bdy_ice_dyn( 'U' )
-            !
-         ELSE ! odd iterations
-            !
-            DO_2D( 0, 0, 0, 0 )
-               !                 !--- tau_io/(u_oce - u_ice)
-               zTauO = zaU(ji,jj) * zrhoco * SQRT( ( u_ice (ji,jj) - u_oce (ji,jj) ) * ( u_ice (ji,jj) - u_oce (ji,jj) )  &
-                  &                              + ( v_iceU(ji,jj) - v_oceU(ji,jj) ) * ( v_iceU(ji,jj) - v_oceU(ji,jj) ) )
-               !                 !--- Ocean-to-Ice stress
-               ztaux_oi(ji,jj) = zTauO * ( u_oce(ji,jj) - u_ice(ji,jj) )
-               !
-               !                 !--- tau_bottom/u_ice
-               zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) )
-               zTauB = ztaux_base(ji,jj) / zvel
-               !                 !--- OceanBottom-to-Ice stress
-               ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj)
-               !
-               !                 !--- Coriolis at U-points (energy conserving formulation)
-               zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  &
-                  &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  &
-                  &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) )
-               !
-               !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io
-               zRHS = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj)
-               !
-               !                 !--- landfast switch => 0 = static  friction : TauB > RHS & sign(TauB) /= sign(RHS)
-               !                                         1 = sliding friction : TauB < RHS
-               rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zRHS + ztaux_base(ji,jj) ) - SIGN( 1._wp, zRHS ) ) )
-               !
-               IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017)
-                  zbetau = MAX( zbeta(ji,jj), zbeta(ji+1,jj) )
-                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * ( zbetau * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity
-                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
-                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) * ( zbetau + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast
-                     &            + ( 1._wp - rswitch ) * (  u_ice_b(ji,jj)                                                   &
-                     &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
-                     &                                    ) / ( zbetau + 1._wp )                                              &
-                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
+                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &           )   * zmsk00x(ji,jj)
                ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009)
@@ -647,4 +593,58 @@
             IF( ln_bdy )   CALL bdy_ice_dyn( 'U' )
             !
+         ELSE ! odd iterations
+            !
+            DO_2D( 0, 0, 0, 0 )
+               !                 !--- tau_io/(u_oce - u_ice)
+               zTauO = zaU(ji,jj) * zrhoco * SQRT( ( u_ice (ji,jj) - u_oce (ji,jj) ) * ( u_ice (ji,jj) - u_oce (ji,jj) )  &
+                  &                              + ( v_iceU(ji,jj) - v_oceU(ji,jj) ) * ( v_iceU(ji,jj) - v_oceU(ji,jj) ) )
+               !                 !--- Ocean-to-Ice stress
+               ztaux_oi(ji,jj) = zTauO * ( u_oce(ji,jj) - u_ice(ji,jj) )
+               !
+               !                 !--- tau_bottom/u_ice
+               zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) )
+               zTauB = ztaux_base(ji,jj) / zvel
+               !                 !--- OceanBottom-to-Ice stress
+               ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj)
+               !
+               !                 !--- Coriolis at U-points (energy conserving formulation)
+               zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  &
+                  &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  &
+                  &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) )
+               !
+               !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io
+               zRHS = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj)
+               !
+               !                 !--- landfast switch => 0 = static  friction : TauB > RHS & sign(TauB) /= sign(RHS)
+               !                                         1 = sliding friction : TauB < RHS
+               rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zRHS + ztaux_base(ji,jj) ) - SIGN( 1._wp, zRHS ) ) )
+               !
+               IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017)
+                  zbetau = MAX( zbeta(ji,jj), zbeta(ji+1,jj) )
+                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * ( zbetau * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity
+                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
+                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) * ( zbetau + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast
+                     &            + ( 1._wp - rswitch ) * (  u_ice_b(ji,jj)                                                   &
+                     &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
+                     &                                    ) / ( zbetau + 1._wp )                                              &
+                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
+                     &           )   * zmsk00x(ji,jj)
+               ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009)
+                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * u_ice(ji,jj)                                       & ! previous velocity
+                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part)
+                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                      & ! m/dt + tau_io(only ice part) + landfast
+                     &            + ( 1._wp - rswitch ) *   u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lf_relax )         & ! static friction => slow decrease to v=0
+                     &             ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
+                     &           )   * zmsk00x(ji,jj)
+               ENDIF
+            END_2D
+            CALL lbc_lnk( 'icedyn_rhg_evp', u_ice, 'U', -1.0_wp )
+            !
+#if defined key_agrif
+!!            CALL agrif_interp_ice( 'U', jter, nn_nevp )
+            CALL agrif_interp_ice( 'U' )
+#endif
+            IF( ln_bdy )   CALL bdy_ice_dyn( 'U' )
+            !
             DO_2D( 0, 0, 0, 0 )
                !                 !--- tau_io/(v_oce - v_ice)
@@ -679,5 +679,5 @@
                      &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   &
                      &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0
-                     &                                    ) / ( zbetav + 1._wp )                                              & 
+                     &                                    ) / ( zbetav + 1._wp )                                              &
                      &             ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                   & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin
                      &           )   * zmsk00y(ji,jj)
@@ -710,5 +710,5 @@
       !
       !------------------------------------------------------------------------------!
-      ! 4) Recompute delta, shear and div (inputs for mechanical redistribution) 
+      ! 4) Recompute delta, shear and div (inputs for mechanical redistribution)
       !------------------------------------------------------------------------------!
       DO_2D( 1, 0, 1, 0 )
@@ -720,7 +720,7 @@
 
       END_2D
-      
+
       DO_2D( 0, 0, 0, 0 )   ! no vector loop
-         
+
          ! tension**2 at T points
          zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   &
@@ -730,10 +730,10 @@
 
          zten_i(ji,jj) = zdt
-         
+
          ! shear**2 at T points (doc eq. A16)
          zds2 = ( zds(ji,jj  ) * zds(ji,jj  ) * e1e2f(ji,jj  ) + zds(ji-1,jj  ) * zds(ji-1,jj  ) * e1e2f(ji-1,jj  )  &
             &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
             &   ) * 0.25_wp * r1_e1e2t(ji,jj)
-         
+
          ! shear at T points
          pshear_i(ji,jj) = SQRT( zdt2 + zds2 )
@@ -743,7 +743,7 @@
             &             + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   &
             &             ) * r1_e1e2t(ji,jj)
-         
+
          ! delta at T points
-         zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta  
+         zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta
          rswitch         = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zfac ) ) ! 0 if delta=0
          pdelta_i(ji,jj) = zfac + rn_creepl * rswitch ! delta+creepl
@@ -752,5 +752,5 @@
       CALL lbc_lnk_multi( 'icedyn_rhg_evp', pshear_i, 'T', 1._wp, pdivu_i, 'T', 1._wp, pdelta_i, 'T', 1._wp, zten_i, 'T', 1._wp, &
          &                                  zs1     , 'T', 1._wp, zs2    , 'T', 1._wp, zs12    , 'F', 1._wp )
-      
+
       ! --- Store the stress tensor for the next time step --- !
       pstress1_i (:,:) = zs1 (:,:)
@@ -776,5 +776,5 @@
          CALL iom_put( 'vtau_bi' , ztauy_bi * zmsk00 )
       ENDIF
-       
+
       ! --- divergence, shear and strength --- !
       IF( iom_use('icediv') )   CALL iom_put( 'icediv' , pdivu_i  * zmsk00 )   ! divergence
@@ -786,28 +786,28 @@
          !
          ALLOCATE( zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )
-         !         
+         !
          DO_2D( 1, 1, 1, 1 )
-            
+
             ! Ice stresses
             ! sigma1, sigma2, sigma12 are some useful recombination of the stresses (Hunke and Dukowicz MWR 2002, Bouillon et al., OM2013)
             ! These are NOT stress tensor components, neither stress invariants, neither stress principal components
             ! I know, this can be confusing...
-            zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl ) 
+            zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl )
             zsig1            =   zfac * ( pdivu_i(ji,jj) - pdelta_i(ji,jj) )
             zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj)
             zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj)
-            
+
             ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008)
             zsig_I (ji,jj)   =   zsig1 * 0.5_wp                                           ! 1st stress invariant, aka average normal stress, aka negative pressure
             zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )  ! 2nd  ''       '', aka maximum shear stress
-               
-         END_2D         
+
+         END_2D
          !
          ! Stress tensor invariants (normal and shear stress N/m) - SIMIP diags - definitions following Coon (1974) and Feltham (2008)
          IF( iom_use('normstr') )   CALL iom_put( 'normstr', zsig_I (:,:) * zmsk00(:,:) ) ! Normal stress
          IF( iom_use('sheastr') )   CALL iom_put( 'sheastr', zsig_II(:,:) * zmsk00(:,:) ) ! Maximum shear stress
-         
+
          DEALLOCATE ( zsig_I, zsig_II )
-         
+
       ENDIF
 
@@ -818,9 +818,9 @@
       IF( iom_use('sig1_pnorm') .OR. iom_use('sig2_pnorm') ) THEN
          !
-         ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )         
-         !         
+         ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )
+         !
          DO_2D( 1, 1, 1, 1 )
-            
-            ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates 
+
+            ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates
             !                        and **deformations** at current iterates
             !                        following Lemieux & Dupont (2020)
@@ -829,20 +829,20 @@
             zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj)
             zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj)
-            
+
             ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008), T-point
             zsig_I(ji,jj)    =   zsig1 * 0.5_wp                                            ! 1st stress invariant, aka average normal stress, aka negative pressure
             zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )   ! 2nd  ''       '', aka maximum shear stress
-            
+
             ! Normalized  principal stresses (used to display the ellipse)
             z1_strength      =   1._wp / MAX( 1._wp, strength(ji,jj) )
             zsig1_p(ji,jj)   =   ( zsig_I(ji,jj) + zsig_II(ji,jj) ) * z1_strength
             zsig2_p(ji,jj)   =   ( zsig_I(ji,jj) - zsig_II(ji,jj) ) * z1_strength
-         END_2D              
-         !
-         CALL iom_put( 'sig1_pnorm' , zsig1_p ) 
-         CALL iom_put( 'sig2_pnorm' , zsig2_p ) 
+         END_2D
+         !
+         CALL iom_put( 'sig1_pnorm' , zsig1_p )
+         CALL iom_put( 'sig2_pnorm' , zsig2_p )
 
          DEALLOCATE( zsig1_p , zsig2_p , zsig_I, zsig_II )
-         
+
       ENDIF
 
@@ -889,5 +889,5 @@
 
          CALL iom_put( 'xmtrpice' , zdiag_xmtrp_ice )   ! X-component of sea-ice mass transport (kg/s)
-         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport 
+         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport
          CALL iom_put( 'xmtrpsnw' , zdiag_xmtrp_snw )   ! X-component of snow mass transport (kg/s)
          CALL iom_put( 'ymtrpsnw' , zdiag_ymtrp_snw )   ! Y-component of snow mass transport
@@ -911,5 +911,5 @@
             ENDIF
          ENDIF
-      ENDIF      
+      ENDIF
       !
       DEALLOCATE( zmsk00, zmsk15 )
@@ -921,5 +921,5 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE rhg_cvg  ***
-      !!                     
+      !!
       !! ** Purpose :   check convergence of oce rheology
       !!
@@ -929,5 +929,5 @@
       !!                This routine is called every sub-iteration, so it is cpu expensive
       !!
-      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)   
+      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)
       !!----------------------------------------------------------------------
       INTEGER ,                 INTENT(in) ::   kt, kiter, kitermax       ! ocean time-step index
@@ -936,5 +936,5 @@
       INTEGER           ::   it, idtime, istatus
       INTEGER           ::   ji, jj          ! dummy loop indices
-      REAL(wp)          ::   zresm           ! local real 
+      REAL(wp)          ::   zresm           ! local real
       CHARACTER(len=20) ::   clname
       REAL(wp), DIMENSION(jpi,jpj) ::   zres           ! check convergence
@@ -963,5 +963,5 @@
       ! time
       it = ( kt - 1 ) * kitermax + kiter
-      
+
       ! convergence
       IF( kiter == 1 ) THEN ! remove the first iteration for calculations of convergence (always very large)
@@ -982,5 +982,5 @@
          IF( kt == nitend - nn_fsbc + 1 )   istatus = NF90_CLOSE(ncvgid)
       ENDIF
-      
+
    END SUBROUTINE rhg_cvg
 
@@ -989,5 +989,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE rhg_evp_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write RHG file in restart file
       !!
@@ -1041,5 +1041,5 @@
    END SUBROUTINE rhg_evp_rst
 
-   
+
 #else
    !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/ICE/iceistate.F90
===================================================================
--- /NEMO/trunk/src/ICE/iceistate.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/iceistate.F90	(revision 14072)
@@ -18,5 +18,5 @@
    USE oce            ! dynamics and tracers variables
    USE dom_oce        ! ocean domain
-   USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd 
+   USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd
    USE sbc_ice , ONLY : tn_ice, snwice_mass, snwice_mass_b
    USE eosbn2         ! equation of state
@@ -40,6 +40,6 @@
    USE agrif_oce
    USE agrif_ice
-   USE agrif_ice_interp 
-# endif   
+   USE agrif_ice_interp
+# endif
 
    IMPLICIT NONE
@@ -91,7 +91,7 @@
       !!
       !! ** Method  :   This routine will put some ice where ocean
-      !!                is at the freezing point, then fill in ice 
-      !!                state variables using prescribed initial 
-      !!                values in the namelist            
+      !!                is at the freezing point, then fill in ice
+      !!                state variables using prescribed initial
+      !!                values in the namelist
       !!
       !! ** Steps   :   1) Set initial surface and basal temperatures
@@ -103,5 +103,5 @@
       !!              where there is no ice
       !!--------------------------------------------------------------------
-      INTEGER, INTENT(in) :: kt            ! time step 
+      INTEGER, INTENT(in) :: kt            ! time step
       INTEGER, INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices
       !
@@ -129,5 +129,5 @@
       ! basal temperature (considered at freezing point)   [Kelvin]
       CALL eos_fzp( sss_m(:,:), t_bo(:,:) )
-      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) 
+      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)
       !
       ! surface temperature and conductivity
@@ -154,5 +154,5 @@
       e_i (:,:,:,:) = 0._wp
       e_s (:,:,:,:) = 0._wp
-      
+
       ! general fields
       a_i (:,:,:) = 0._wp
@@ -229,5 +229,5 @@
                IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' ) &
                   &     si(jp_apd)%fnow(:,:,1) = ( rn_apd_ini_n * zswitch + rn_apd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) & ! rn_apd = pond fraction => rn_apnd * a_i = pond conc.
-                  &                              * si(jp_ati)%fnow(:,:,1) 
+                  &                              * si(jp_ati)%fnow(:,:,1)
                !
                ! pond depth
@@ -248,5 +248,5 @@
                !
                ! change the switch for the following
-               WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1) 
+               WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1)
                ELSEWHERE                         ;   zswitch(:,:) = 0._wp
                END WHERE
@@ -256,5 +256,5 @@
                !                          !---------------!
                ! no ice if (sst - Tfreez) >= thresold
-               WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp 
+               WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp
                ELSEWHERE                                                                    ;   zswitch(:,:) = tmask(:,:,1)
                END WHERE
@@ -269,5 +269,5 @@
                   zt_su_ini(:,:) = rn_tsu_ini_n * zswitch(:,:)
                   ztm_s_ini(:,:) = rn_tms_ini_n * zswitch(:,:)
-                  zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc. 
+                  zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc.
                   zhpnd_ini(:,:) = rn_hpd_ini_n * zswitch(:,:)
                   zhlid_ini(:,:) = rn_hld_ini_n * zswitch(:,:)
@@ -295,9 +295,9 @@
                zhlid_ini(:,:) = 0._wp
             ENDIF
-            
+
             IF ( .NOT.ln_pnd_lids ) THEN
                zhlid_ini(:,:) = 0._wp
             ENDIF
-            
+
             !----------------!
             ! 3) fill fields !
@@ -323,5 +323,5 @@
             CALL tab_2d_1d( npti, nptidx(1:npti), h_ip_1d(1:npti)  , zhpnd_ini )
             CALL tab_2d_1d( npti, nptidx(1:npti), h_il_1d(1:npti)  , zhlid_ini )
-            
+
             ! allocate temporary arrays
             ALLOCATE( zhi_2d (npti,jpl), zhs_2d (npti,jpl), zai_2d (npti,jpl), &
@@ -377,5 +377,5 @@
             DO jl = 1, jpl
                DO_3D( 1, 1, 1, 1, 1, nlay_i )
-                  t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl) 
+                  t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl)
                   ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 ! melting temperature in K
                   e_i(ji,jj,jk,jl) = zswitch(ji,jj) * v_i(ji,jj,jl) * r1_nlay_i * &
@@ -385,8 +385,8 @@
                END_3D
             END DO
-            
+
 #if  defined key_agrif
          ELSE
- 
+
             Agrif_SpecialValue    = -9999.
             Agrif_UseSpecialValue = .TRUE.
@@ -399,5 +399,5 @@
             use_sign_north = .FALSE.
             Agrif_UseSpecialValue = .FALSE.
-        ! lbc ???? 
+        ! lbc ????
    ! Here we know : a_i, v_i, v_s, sv_i, oa_i, a_ip, v_ip, v_il, t_su, e_s, e_i
             CALL ice_var_glo2eqv
@@ -413,5 +413,5 @@
          v_ip(:,:,:) = h_ip(:,:,:) * a_ip(:,:,:)
          v_il(:,:,:) = h_il(:,:,:) * a_ip(:,:,:)
-         
+
          ! specific temperatures for coupled runs
          tn_ice(:,:,:) = t_su(:,:,:)
@@ -456,8 +456,8 @@
       !!-------------------------------------------------------------------
       !!                   ***  ROUTINE ice_istate_init  ***
-      !!        
-      !! ** Purpose :   Definition of initial state of the ice 
-      !!
-      !! ** Method  :   Read the namini namelist and check the parameter 
+      !!
+      !! ** Purpose :   Definition of initial state of the ice
+      !!
+      !! ** Method  :   Read the namini namelist and check the parameter
       !!              values called at the first timestep (nit000)
       !!
@@ -500,5 +500,5 @@
          WRITE(numout,*) '      max ocean temp. above Tfreeze with initial ice   rn_thres_sst   = ', rn_thres_sst
          IF( ln_iceini .AND. nn_iceini_file == 0 ) THEN
-            WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s 
+            WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s
             WRITE(numout,*) '      initial ice thickness in the north-south         rn_hti_ini     = ', rn_hti_ini_n,rn_hti_ini_s
             WRITE(numout,*) '      initial ice concentr  in the north-south         rn_ati_ini     = ', rn_ati_ini_n,rn_ati_ini_s
Index: /NEMO/trunk/src/ICE/iceitd.F90
===================================================================
--- /NEMO/trunk/src/ICE/iceitd.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/iceitd.F90	(revision 14072)
@@ -18,5 +18,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean domain
-   USE phycst         ! physical constants 
+   USE phycst         ! physical constants
    USE ice1D          ! sea-ice: thermodynamic variables
    USE ice            ! sea-ice: variables
@@ -66,9 +66,9 @@
       !!                after thermodynamic growth of ice thickness
       !!
-      !! ** Method  :   Linear remapping 
+      !! ** Method  :   Linear remapping
       !!
       !! References :   W.H. Lipscomb, JGR 2001
       !!------------------------------------------------------------------
-      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
+      INTEGER , INTENT (in) ::   kt      ! Ocean time step
       !
       INTEGER  ::   ji, jj, jl, jcat     ! dummy loop index
@@ -76,5 +76,5 @@
       REAL(wp) ::   zx1, zwk1, zdh0, zetamin, zdamax   ! local scalars
       REAL(wp) ::   zx2, zwk2, zda0, zetamax           !   -      -
-      REAL(wp) ::   zx3        
+      REAL(wp) ::   zx3
       REAL(wp) ::   zslope          ! used to compute local thermodynamic "speeds"
       !
@@ -90,5 +90,5 @@
       IF( ln_timing )   CALL timing_start('iceitd_rem')
 
-      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution' 
+      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution'
 
       IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_rem', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft)
@@ -107,5 +107,5 @@
          ENDIF
       END_2D
-      
+
       !-----------------------------------------------------------------------------------------------
       !  2) Compute new category boundaries
@@ -143,11 +143,11 @@
                ELSEIF( a_ib_2d(ji,jl) <= epsi10 .AND. a_ib_2d(ji,jl+1) >  epsi10 ) THEN   ! a(jl)=0 => Hn* = Hn + fn+1*dt
                   zhbnew(ji,jl) = hi_max(jl) + zdhice(ji,jl+1)
-               ELSE                                                                       ! a(jl+1) & a(jl) = 0 
+               ELSE                                                                       ! a(jl+1) & a(jl) = 0
                   zhbnew(ji,jl) = hi_max(jl)
                ENDIF
                !
                ! --- 2 conditions for remapping --- !
-               ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi               
-               !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
+               ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi
+               !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible
                !          in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice)
 # if defined key_single
@@ -159,5 +159,5 @@
 # endif
                !
-               ! 2) Hn-1 < Hn* < Hn+1  
+               ! 2) Hn-1 < Hn* < Hn+1
                IF( zhbnew(ji,jl) < hi_max(jl-1) )   nptidx(ji) = 0
                IF( zhbnew(ji,jl) > hi_max(jl+1) )   nptidx(ji) = 0
@@ -171,10 +171,10 @@
                zhbnew(ji,jpl) = MAX( hi_max(jpl-1), 3._wp * h_i_2d(ji,jpl) - 2._wp * zhbnew(ji,jpl-1) )
             ELSE
-               zhbnew(ji,jpl) = hi_max(jpl)  
+               zhbnew(ji,jpl) = hi_max(jpl)
             ENDIF
             !
             ! --- 1 additional condition for remapping (1st category) --- !
-            ! H0+epsi < h1(t) < H1-epsi 
-            !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
+            ! H0+epsi < h1(t) < H1-epsi
+            !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible
             !    in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice)
 # if defined key_single
@@ -202,13 +202,13 @@
          !
       ENDIF
-   
+
       !-----------------------------------------------------------------------------------------------
-      !  4) Compute g(h) 
+      !  4) Compute g(h)
       !-----------------------------------------------------------------------------------------------
       IF( npti > 0 ) THEN
          !
          zhb0(:) = hi_max(0)   ;   zhb1(:) = hi_max(1)
-         g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp 
-         hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp 
+         g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp
+         hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp
          !
          DO jl = 1, jpl
@@ -220,5 +220,5 @@
             !
             IF( jl == 1 ) THEN
-               !  
+               !
                ! --- g(h) for category 1 --- !
                CALL itd_glinear( zhb0(1:npti)  , zhb1(1:npti)  , h_ib_1d(1:npti)  , a_i_1d(1:npti)  ,  &   ! in
@@ -230,5 +230,5 @@
                   IF( a_i_1d(ji) > epsi10 ) THEN
                      !
-                     zdh0 =  h_i_1d(ji) - h_ib_1d(ji)                
+                     zdh0 =  h_i_1d(ji) - h_ib_1d(ji)
                      IF( zdh0 < 0.0 ) THEN      ! remove area from category 1
                         zdh0 = MIN( -zdh0, hi_max(1) )
@@ -238,7 +238,7 @@
                         IF( zetamax > 0.0 ) THEN
                            zx1    = zetamax
-                           zx2    = 0.5 * zetamax * zetamax 
+                           zx2    = 0.5 * zetamax * zetamax
                            zda0   = g1(ji,1) * zx2 + g0(ji,1) * zx1                ! ice area removed
-                           zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i                
+                           zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i
                            zda0   = MIN( zda0, zdamax )                            ! ice area lost due to melting of thin ice (zdamax > 0)
                            ! Remove area, conserving volume
@@ -250,5 +250,5 @@
                      ELSE ! if ice accretion zdh0 > 0
                         ! zhbnew was 0, and is shifted to the right to account for thin ice growth in openwater (F0 = f1)
-                        zhbnew(ji,0) = MIN( zdh0, hi_max(1) ) 
+                        zhbnew(ji,0) = MIN( zdh0, hi_max(1) )
                      ENDIF
                      !
@@ -263,10 +263,10 @@
             ENDIF ! jl=1
             !
-            ! --- g(h) for each thickness category --- !  
+            ! --- g(h) for each thickness category --- !
             CALL itd_glinear( zhbnew(1:npti,jl-1), zhbnew(1:npti,jl), h_i_1d(1:npti)   , a_i_1d(1:npti)   ,  &   ! in
                &              g0    (1:npti,jl  ), g1    (1:npti,jl), hL    (1:npti,jl), hR    (1:npti,jl)   )   ! out
             !
          END DO
-         
+
          !-----------------------------------------------------------------------------------------------
          !  5) Compute area and volume to be shifted across each boundary (Eq. 18)
@@ -278,5 +278,5 @@
                ! left and right integration limits in eta space
                IF (zhbnew(ji,jl) > hi_max(jl)) THEN ! Hn* > Hn => transfer from jl to jl+1
-                  zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL 
+                  zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL
                   zetamax = MIN( zhbnew(ji,jl), hR(ji,jl) ) - hL(ji,jl)   ! hR - hL
                   jdonor(ji,jl) = jl
@@ -301,10 +301,10 @@
             END DO
          END DO
-         
+
          !----------------------------------------------------------------------------------------------
          ! 6) Shift ice between categories
          !----------------------------------------------------------------------------------------------
          CALL itd_shiftice ( jdonor(1:npti,:), zdaice(1:npti,:), zdvice(1:npti,:) )
-         
+
          !----------------------------------------------------------------------------------------------
          ! 7) Make sure h_i >= minimum ice thickness hi_min
@@ -316,5 +316,5 @@
          DO ji = 1, npti
             IF ( a_i_1d(ji) > epsi10 .AND. h_i_1d(ji) < rn_himin ) THEN
-               a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin 
+               a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin
                IF( ln_pnd_LEV .OR. ln_pnd_TOPO )   a_ip_1d(ji) = a_ip_1d(ji) * h_i_1d(ji) / rn_himin
                h_i_1d(ji) = rn_himin
@@ -384,5 +384,5 @@
             pg1(ji) = 2._wp * zdhr * zwk1 * ( zwk2 - 0.5_wp )   ! Eq. 14
             !
-         ELSE  ! remap_flag = .false. or a_i < epsi10 
+         ELSE  ! remap_flag = .false. or a_i < epsi10
             phL(ji) = 0._wp
             phR(ji) = 0._wp
@@ -415,5 +415,5 @@
       REAL(wp), DIMENSION(jpij,nlay_s,jpl) ::   ze_s_2d
       !!------------------------------------------------------------------
-         
+
       CALL tab_3d_2d( npti, nptidx(1:npti), h_i_2d (1:npti,1:jpl), h_i  )
       CALL tab_3d_2d( npti, nptidx(1:npti), a_i_2d (1:npti,1:jpl), a_i  )
@@ -445,5 +445,5 @@
          END DO
       END DO
-      
+
       !-------------------------------------------------------------------------------
       ! 2) Transfer volume and energy between categories
@@ -457,5 +457,5 @@
                !
                IF ( jl1 == jl  ) THEN   ;   jl2 = jl1+1
-               ELSE                     ;   jl2 = jl 
+               ELSE                     ;   jl2 = jl
                ENDIF
                !
@@ -475,5 +475,5 @@
                ztrans         = v_s_2d(ji,jl1) * zworkv(ji)          ! Snow volumes
                v_s_2d(ji,jl1) = v_s_2d(ji,jl1) - ztrans
-               v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans 
+               v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans
                !
                ztrans          = oa_i_2d(ji,jl1) * zworka(ji)        ! Ice age
@@ -488,10 +488,10 @@
                zaTsfn(ji,jl1)  = zaTsfn(ji,jl1) - ztrans
                zaTsfn(ji,jl2)  = zaTsfn(ji,jl2) + ztrans
-               !  
+               !
                IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN
                   ztrans          = a_ip_2d(ji,jl1) * zworka(ji)     ! Pond fraction
                   a_ip_2d(ji,jl1) = a_ip_2d(ji,jl1) - ztrans
                   a_ip_2d(ji,jl2) = a_ip_2d(ji,jl2) + ztrans
-                  !                                              
+                  !
                   ztrans          = v_ip_2d(ji,jl1) * zworkv(ji)     ! Pond volume
                   v_ip_2d(ji,jl1) = v_ip_2d(ji,jl1) - ztrans
@@ -555,5 +555,5 @@
             &   a_i_2d(1:npti,jl) = a_i_2d(1:npti,jl) * rn_amax_1d(1:npti) / zworka(1:npti)
       END DO
-      
+
       !-------------------------------------------------------------------------------
       ! 4) Update ice thickness and temperature
@@ -564,6 +564,6 @@
       WHERE( a_i_2d(1:npti,:) >= epsi20 )
 # endif
-         h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:) 
-         t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:) 
+         h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:)
+         t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:)
       ELSEWHERE
          h_i_2d (1:npti,:)  = 0._wp
@@ -591,5 +591,5 @@
       !
    END SUBROUTINE itd_shiftice
-   
+
 
    SUBROUTINE ice_itd_reb( kt )
@@ -603,5 +603,5 @@
       !!              to the neighboring category
       !!------------------------------------------------------------------
-      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
+      INTEGER , INTENT (in) ::   kt      ! Ocean time step
       INTEGER ::   ji, jj, jl   ! dummy loop indices
       !
@@ -611,5 +611,5 @@
       IF( ln_timing )   CALL timing_start('iceitd_reb')
       !
-      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution' 
+      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution'
       !
       IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_reb', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft)
@@ -627,9 +627,9 @@
             IF( a_i(ji,jj,jl) > 0._wp .AND. v_i(ji,jj,jl) > (a_i(ji,jj,jl) * hi_max(jl)) ) THEN
                npti = npti + 1
-               nptidx( npti ) = (jj - 1) * jpi + ji                  
+               nptidx( npti ) = (jj - 1) * jpi + ji
             ENDIF
          END_2D
          !
-         IF( npti > 0 ) THEN            
+         IF( npti > 0 ) THEN
             !!clem   CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d(1:npti), h_i(:,:,jl) )
             CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl) )
@@ -637,5 +637,5 @@
             !
             DO ji = 1, npti
-               jdonor(ji,jl)  = jl 
+               jdonor(ji,jl)  = jl
                ! how much of a_i you send in cat sup is somewhat arbitrary
                ! these are from CICE => transfer everything
@@ -663,5 +663,5 @@
             IF( a_i(ji,jj,jl+1) > 0._wp .AND. v_i(ji,jj,jl+1) <= (a_i(ji,jj,jl+1) * hi_max(jl)) ) THEN
                npti = npti + 1
-               nptidx( npti ) = (jj - 1) * jpi + ji                  
+               nptidx( npti ) = (jj - 1) * jpi + ji
             ENDIF
          END_2D
@@ -672,5 +672,5 @@
             DO ji = 1, npti
                jdonor(ji,jl) = jl + 1
-               zdaice(ji,jl) = a_i_1d(ji) 
+               zdaice(ji,jl) = a_i_1d(ji)
                zdvice(ji,jl) = v_i_1d(ji)
             END DO
@@ -721,6 +721,6 @@
          WRITE(numout,*) '         mean ice thickness in the domain                               rn_himean  = ', rn_himean
          WRITE(numout,*) '      Ice categories are defined by rn_catbnd                           ln_cat_usr = ', ln_cat_usr
-         WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin 
-         WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax 
+         WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin
+         WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax
       ENDIF
       !
@@ -729,5 +729,5 @@
       !-----------------------------------!
       !                             !== set the choice of ice categories ==!
-      ioptio = 0 
+      ioptio = 0
       IF( ln_cat_hfn ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_cathfn    ;   ENDIF
       IF( ln_cat_usr ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_catusr    ;   ENDIF
Index: /NEMO/trunk/src/ICE/icerst.F90
===================================================================
--- /NEMO/trunk/src/ICE/icerst.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icerst.F90	(revision 14072)
@@ -11,6 +11,6 @@
    !!----------------------------------------------------------------------
    !!   ice_rst_opn   : open  restart file
-   !!   ice_rst_write : write restart file 
-   !!   ice_rst_read  : read  restart file 
+   !!   ice_rst_write : write restart file
+   !!   ice_rst_read  : read  restart file
    !!----------------------------------------------------------------------
    USE ice            ! sea-ice: variables
@@ -54,5 +54,5 @@
       CHARACTER(len=20)   ::   clkt     ! ocean time-step define as a character
       CHARACTER(len=50)   ::   clname   ! ice output restart file name
-      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file 
+      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file
       CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF
       !!----------------------------------------------------------------------
@@ -61,6 +61,6 @@
 
       IF( ln_rst_list .OR. nn_stock /= -1 ) THEN
-      ! in order to get better performances with NetCDF format, we open and define the ice restart file 
-      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice 
+      ! in order to get better performances with NetCDF format, we open and define the ice restart file
+      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice
       ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1
       IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nn_stock == nn_fsbc    &
@@ -73,5 +73,5 @@
             ! create the file
             clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)
-            clpath = TRIM(cn_icerst_outdir) 
+            clpath = TRIM(cn_icerst_outdir)
             IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/'
             IF(lwp) THEN
@@ -132,13 +132,13 @@
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'ice_rst_write : write ice restart file  kt =', kt
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
-      ENDIF
-      
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'
+      ENDIF
+
       ! Write in numriw (if iter == nitrst)
-      ! ------------------ 
+      ! ------------------
       !                                                                        ! calendar control
-      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step 
+      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step
       CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
-      
+
       IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables
 
@@ -156,5 +156,5 @@
       CALL iom_rstput( iter, nitrst, numriw, 'v_il' , v_il  )
       ! Snow enthalpy
-      DO jk = 1, nlay_s 
+      DO jk = 1, nlay_s
          WRITE(zchar1,'(I2.2)') jk
          znam = 'e_s'//'_l'//zchar1
@@ -163,5 +163,5 @@
       END DO
       ! Ice enthalpy
-      DO jk = 1, nlay_i 
+      DO jk = 1, nlay_i
          WRITE(zchar1,'(I2.2)') jk
          znam = 'e_i'//'_l'//zchar1
@@ -224,10 +224,10 @@
 !            clpname = cn_icerst_in
 !         ELSE
-!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in   
+!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in
 !         ENDIF
           CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. )
       ENDIF
 
-      ! test if v_i exists 
+      ! test if v_i exists
       id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. )
 
@@ -237,5 +237,5 @@
          ! Time info
          CALL iom_get( numrir, 'nn_fsbc', zfice )
-         CALL iom_get( numrir, 'kt_ice' , ziter )    
+         CALL iom_get( numrir, 'kt_ice' , ziter )
          IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
          IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
@@ -251,5 +251,5 @@
             &                   '   control of time parameter  nrstdt' )
 
-         ! --- mandatory fields --- ! 
+         ! --- mandatory fields --- !
          CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i   )
          CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s   )
Index: /NEMO/trunk/src/ICE/icesbc.F90
===================================================================
--- /NEMO/trunk/src/ICE/icesbc.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icesbc.F90	(revision 14072)
@@ -59,5 +59,5 @@
       !!
       INTEGER  ::   ji, jj                 ! dummy loop index
-      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice 
+      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice
       !!-------------------------------------------------------------------
       !
@@ -72,8 +72,9 @@
       SELECT CASE( ksbc )
          CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation
-         CASE( jp_blk     )   ;    CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   &
-            &                                      sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),   &
+      CASE( jp_blk     )
+         CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   &
+            &                                      theta_air_zt(:,:), q_air_zt(:,:),   &   ! #LB: known from "sbc_oce" module...
             &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs
-            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs                             
+            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs
  !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod
          CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation
@@ -93,5 +94,5 @@
    END SUBROUTINE ice_sbc_tau
 
-   
+
    SUBROUTINE ice_sbc_flx( kt, ksbc )
       !!-------------------------------------------------------------------
@@ -108,5 +109,5 @@
       !!                dqns_ice                                 = non solar  heat sensistivity                  [W/m2]
       !!                qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2]
-      !!            + some fields that are not used outside this module: 
+      !!            + some fields that are not used outside this module:
       !!                qla_ice                                  = latent heat flux over ice                     [W/m2]
       !!                dqla_ice                                 = latent heat sensistivity                      [W/m2]
@@ -118,5 +119,5 @@
       !
       INTEGER  ::   ji, jj, jl      ! dummy loop index
-      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios 
+      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios
       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace
       !!--------------------------------------------------------------------
@@ -142,6 +143,8 @@
                                   CALL usrdef_sbc_ice_flx( kt, h_s, h_i )
       CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation
-                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),    &
-            &                                           sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )    ! 
+                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, &
+            &                                         theta_air_zt(:,:), q_air_zt(:,:),    &   ! #LB: known from "sbc_oce" module...
+            &                                         sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), &
+            &                                         sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )
          IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i )
          IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
@@ -163,5 +166,5 @@
             zalb  (:,:) = rn_alb_oce
          ELSEWHERE
-            zmsk00(:,:) = 1._wp            
+            zmsk00(:,:) = 1._wp
             zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b
          END WHERE
@@ -185,5 +188,5 @@
       !!                  ***  ROUTINE ice_flx_dist  ***
       !!
-      !! ** Purpose :   update the ice surface boundary condition by averaging 
+      !! ** Purpose :   update the ice surface boundary condition by averaging
       !!              and/or redistributing fluxes on ice categories
       !!
@@ -192,5 +195,5 @@
       !! ** Action  :   depends on k_flxdist
       !!                = -1  Do nothing (needs N(cat) fluxes)
-      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice 
+      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice
       !!                =  1  Average N(cat) fluxes then redistribute over the N(cat) ice
       !!                                                 using T-ice and albedo sensitivity
@@ -222,10 +225,10 @@
       ELSEWHERE                      ; z1_at_i(:,:) = 0._wp
       END WHERE
-      
+
       SELECT CASE( k_flxdist )       !==  averaged on all ice categories  ==!
       !
       CASE( 0 , 1 )
          !
-         ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) )  
+         ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) )
          !
          z_qns_m  (:,:) = SUM( a_i(:,:,:) * pqns_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
@@ -242,5 +245,5 @@
          END DO
          !
-         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m )  
+         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m )
          !
       END SELECT
@@ -250,5 +253,5 @@
       CASE( 1 , 2 )
          !
-         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) )  
+         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) )
          !
          zalb_m(:,:) = SUM( a_i(:,:,:) * palb_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
@@ -260,5 +263,5 @@
          END DO
          !
-         DEALLOCATE( zalb_m, ztem_m )  
+         DEALLOCATE( zalb_m, ztem_m )
          !
       END SELECT
@@ -272,5 +275,5 @@
       !!
       !! ** Purpose :   Physical constants and parameters linked to the ice dynamics
-      !!      
+      !!
       !! ** Method  :   Read the namsbc namelist and check the ice-dynamic
       !!              parameter values called at the first timestep (nit000)
Index: /NEMO/trunk/src/ICE/icestp.F90
===================================================================
--- /NEMO/trunk/src/ICE/icestp.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icestp.F90	(revision 14072)
@@ -8,5 +8,5 @@
    !!                        aka Sea Ice cube for its nickname
    !!
-   !!    is originally based on LIM3, developed in Louvain-la-Neuve by: 
+   !!    is originally based on LIM3, developed in Louvain-la-Neuve by:
    !!       * Martin Vancoppenolle (UCL-ASTR, Belgium)
    !!       * Sylvain Bouillon (UCL-ASTR, Belgium)
@@ -140,5 +140,5 @@
          IF( .NOT. Agrif_Root() )       nbstep_ice = MOD( nbstep_ice, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1
          !                              ! these calls must remain here for restartability purposes
-                                        CALL agrif_interp_ice( 'T' ) 
+                                        CALL agrif_interp_ice( 'T' )
                                         CALL agrif_interp_ice( 'U' )
                                         CALL agrif_interp_ice( 'V' )
@@ -152,10 +152,10 @@
          !    utau_ice, vtau_ice = surface ice stress [N/m2]
          !------------------------------------------------!
-                                        CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )          
+                                        CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )
          !-------------------------------------!
          ! --- ice dynamics and advection  --- !
          !-------------------------------------!
                                         CALL diag_set0                ! set diag of mass, heat and salt fluxes to 0
-                                        CALL ice_rst_opn( kt )        ! Open Ice restart file (if necessary) 
+                                        CALL ice_rst_opn( kt )        ! Open Ice restart file (if necessary)
          !
          IF( ln_icedyn .AND. .NOT.lk_c1d )   &
@@ -169,5 +169,5 @@
          !                          !==  previous lead fraction and ice volume for flux calculations
                                         CALL ice_var_glo2eqv          ! h_i and h_s for ice albedo calculation
-                                        CALL ice_var_agg(1)           ! at_i for coupling 
+                                        CALL ice_var_agg(1)           ! at_i for coupling
                                         CALL store_fields             ! Store now ice values
          !
@@ -189,5 +189,5 @@
          ! --- ice thermodynamics --- !
          !----------------------------!
-         IF( ln_icethd )                CALL ice_thd( kt )            ! -- Ice thermodynamics      
+         IF( ln_icethd )                CALL ice_thd( kt )            ! -- Ice thermodynamics
          !
                                         CALL diag_trends( 2 )         ! record thermo trends
@@ -197,11 +197,11 @@
                                         CALL ice_update_flx( kt )     ! -- Update ocean surface mass, heat and salt fluxes
          !
-         IF( ln_icediahsb )             CALL ice_dia( kt )            ! -- Diagnostics outputs 
-         !
-         IF( ln_icediachk )             CALL ice_drift_wri( kt )      ! -- Diagnostics outputs for conservation 
-         !
-                                        CALL ice_wri( kt )            ! -- Ice outputs 
-         !
-         IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file 
+         IF( ln_icediahsb )             CALL ice_dia( kt )            ! -- Diagnostics outputs
+         !
+         IF( ln_icediachk )             CALL ice_drift_wri( kt )      ! -- Diagnostics outputs for conservation
+         !
+                                        CALL ice_wri( kt )            ! -- Ice outputs
+         !
+         IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file
          !
          IF( ln_icectl )                CALL ice_ctl( kt )            ! -- Control checks
@@ -231,8 +231,8 @@
       !!----------------------------------------------------------------------
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)' 
+      IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)'
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state' 
+      IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state'
       IF(lwp) WRITE(numout,*) '~~~~~~~~'
       !
@@ -250,5 +250,5 @@
       !                                ! Allocate the ice arrays (sbc_ice already allocated in sbc_init)
       ierr =        ice_alloc        ()      ! ice variables
-      ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions 
+      ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions
       ierr = ierr + ice1D_alloc      ()      ! thermodynamics
       !
@@ -333,5 +333,5 @@
          WRITE(numout,*) '         Ice dynamics       (T) or not (F)                   ln_icedyn = ', ln_icedyn
          WRITE(numout,*) '         Ice thermodynamics (T) or not (F)                   ln_icethd = ', ln_icethd
-         WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n 
+         WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n
          WRITE(numout,*) '         maximum ice concentration for SH                              = ', rn_amax_s
       ENDIF
@@ -417,8 +417,8 @@
          wfx_bom(ji,jj) = 0._wp   ;   wfx_sum(ji,jj) = 0._wp
          wfx_res(ji,jj) = 0._wp   ;   wfx_sub(ji,jj) = 0._wp
-         wfx_spr(ji,jj) = 0._wp   ;   wfx_lam(ji,jj) = 0._wp  
+         wfx_spr(ji,jj) = 0._wp   ;   wfx_lam(ji,jj) = 0._wp
          wfx_snw_dyn(ji,jj) = 0._wp ; wfx_snw_sum(ji,jj) = 0._wp
          wfx_snw_sub(ji,jj) = 0._wp ; wfx_ice_sub(ji,jj) = 0._wp
-         wfx_snw_sni(ji,jj) = 0._wp 
+         wfx_snw_sni(ji,jj) = 0._wp
          wfx_pnd(ji,jj) = 0._wp
 
Index: /NEMO/trunk/src/ICE/icetab.F90
===================================================================
--- /NEMO/trunk/src/ICE/icetab.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icetab.F90	(revision 14072)
@@ -17,5 +17,5 @@
    USE par_oce
    USE ice, ONLY : jpl
-   
+
    IMPLICIT NONE
    PRIVATE
Index: /NEMO/trunk/src/ICE/icethd.F90
===================================================================
--- /NEMO/trunk/src/ICE/icethd.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icethd.F90	(revision 14072)
@@ -69,8 +69,8 @@
    SUBROUTINE ice_thd( kt )
       !!-------------------------------------------------------------------
-      !!                ***  ROUTINE ice_thd  ***       
-      !!  
+      !!                ***  ROUTINE ice_thd  ***
+      !!
       !! ** Purpose : This routine manages ice thermodynamics
-      !!         
+      !!
       !! ** Action : - computation of oceanic sensible heat flux at the ice base
       !!                              energy budget in the leads
@@ -114,5 +114,5 @@
          ztice_cvgerr = 0._wp ; ztice_cvgstp = 0._wp
       ENDIF
-      
+
       !---------------------------------------------!
       ! computation of friction velocity at T points
@@ -157,8 +157,8 @@
          ! --- Sensible ocean-to-ice heat flux (W/m2) --- !
          !     (mostly>0 but <0 if supercooling)
-         zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin ) 
+         zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin )
          qsb_ice_bot(ji,jj) = rswitch * rho0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) )
-         
-         ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach 
+
+         ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach
          !                              the freezing point, so that we do not have SST < T_freeze
          !                              This implies: qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice <= - zqfr_neg
@@ -210,5 +210,5 @@
          !
       END_2D
-      
+
       ! In case we bypass open-water ice formation
       IF( .NOT. ln_icedO )  qlead(:,:) = 0._wp
@@ -227,5 +227,5 @@
          npti = 0 ; nptidx(:) = 0
          DO_2D( 1, 1, 1, 1 )
-            IF ( a_i(ji,jj,jl) > epsi10 ) THEN     
+            IF ( a_i(ji,jj,jl) > epsi10 ) THEN
                npti         = npti  + 1
                nptidx(npti) = (jj - 1) * jpi + ji
@@ -234,20 +234,20 @@
 
          IF( npti > 0 ) THEN  ! If there is no ice, do nothing.
-            !                                                                
+            !
                               CALL ice_thd_1d2d( jl, 1 )            ! --- Move to 1D arrays --- !
             !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- !
             !
-            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here) 
-            dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp 
+            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here)
+            dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp
             dh_i_sub  (1:npti) = 0._wp ; dh_i_bog(1:npti) = 0._wp
             dh_snowice(1:npti) = 0._wp ; dh_s_mlt(1:npti) = 0._wp
-            !                                      
+            !
                               CALL ice_thd_zdf                      ! --- Ice-Snow temperature --- !
             !
             IF( ln_icedH ) THEN                                     ! --- Growing/Melting --- !
-                              CALL ice_thd_dh                           ! Ice-Snow thickness   
+                              CALL ice_thd_dh                           ! Ice-Snow thickness
                               CALL ice_thd_ent( e_i_1d(1:npti,:) )      ! Ice enthalpy remapping
             ENDIF
-                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !    
+                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !
             !
                               CALL ice_thd_temp                     ! --- Temperature update --- !
@@ -266,7 +266,7 @@
       IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft)
       IF( ln_icediachk )   CALL ice_cons2D  (1, 'icethd',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft)
-      !                   
+      !
       IF ( ln_pnd .AND. ln_icedH ) &
-         &                    CALL ice_thd_pnd                      ! --- Melt ponds 
+         &                    CALL ice_thd_pnd                      ! --- Melt ponds
       !
       IF( jpl > 1  )          CALL ice_itd_rem( kt )                ! --- Transport ice between thickness categories --- !
@@ -276,5 +276,5 @@
                               CALL ice_cor( kt , 2 )                ! --- Corrections --- !
       !
-      oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation     
+      oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation
       !
       ! convergence tests
@@ -290,11 +290,11 @@
       IF( ln_timing )   CALL timing_stop('icethd')                                        ! timing
       !
-   END SUBROUTINE ice_thd 
-
- 
+   END SUBROUTINE ice_thd
+
+
    SUBROUTINE ice_thd_temp
       !!-----------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_thd_temp *** 
-      !!                 
+      !!                   ***  ROUTINE ice_thd_temp ***
+      !!
       !! ** Purpose :   Computes sea ice temperature (Kelvin) from enthalpy
       !!
@@ -302,5 +302,5 @@
       !!-------------------------------------------------------------------
       INTEGER  ::   ji, jk   ! dummy loop indices
-      REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar 
+      REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar
       !!-------------------------------------------------------------------
       ! Recover ice temperature
@@ -312,10 +312,10 @@
             zccc          = SQRT( MAX( zbbb * zbbb - 4._wp * rcpi * rLfus * ztmelts, 0._wp ) )
             t_i_1d(ji,jk) = rt0 - ( zbbb + zccc ) * 0.5_wp * r1_rcpi
-            
+
             ! mask temperature
-            rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) ) 
+            rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) )
             t_i_1d(ji,jk) = rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0
-         END DO 
-      END DO 
+         END DO
+      END DO
       !
    END SUBROUTINE ice_thd_temp
@@ -324,6 +324,6 @@
    SUBROUTINE ice_thd_mono
       !!-----------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_thd_mono *** 
-      !!                 
+      !!                   ***  ROUTINE ice_thd_mono ***
+      !!
       !! ** Purpose :   Lateral melting in case virtual_itd
       !!                          ( dA = A/2h dh )
@@ -332,5 +332,5 @@
       REAL(wp) ::   zhi_bef            ! ice thickness before thermo
       REAL(wp) ::   zdh_mel, zda_mel   ! net melting
-      REAL(wp) ::   zvi, zvs           ! ice/snow volumes 
+      REAL(wp) ::   zvi, zvs           ! ice/snow volumes
       !!-----------------------------------------------------------------------
       !
@@ -344,8 +344,8 @@
             rswitch     = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) )
             zda_mel     = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) )
-            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel ) 
+            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel )
             ! adjust thickness
-            h_i_1d(ji) = zvi / a_i_1d(ji)            
-            h_s_1d(ji) = zvs / a_i_1d(ji)            
+            h_i_1d(ji) = zvi / a_i_1d(ji)
+            h_s_1d(ji) = zvs / a_i_1d(ji)
             ! retrieve total concentration
             at_i_1d(ji) = a_i_1d(ji)
@@ -358,9 +358,9 @@
    SUBROUTINE ice_thd_1d2d( kl, kn )
       !!-----------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_thd_1d2d *** 
-      !!                 
+      !!                   ***  ROUTINE ice_thd_1d2d ***
+      !!
       !! ** Purpose :   move arrays from 1d to 2d and the reverse
       !!-----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kl   ! index of the ice category 
+      INTEGER, INTENT(in) ::   kl   ! index of the ice category
       INTEGER, INTENT(in) ::   kn   ! 1= from 2D to 1D   ;   2= from 1D to 2D
       !
@@ -394,8 +394,8 @@
          CALL tab_2d_1d( npti, nptidx(1:npti), dqns_ice_1d   (1:npti), dqns_ice(:,:,kl)     )
          CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d       (1:npti), t_bo                 )
-         CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              ) 
+         CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              )
          CALL tab_2d_1d( npti, nptidx(1:npti), qsb_ice_bot_1d(1:npti), qsb_ice_bot          )
          CALL tab_2d_1d( npti, nptidx(1:npti), fhld_1d       (1:npti), fhld                 )
-         
+
          CALL tab_2d_1d( npti, nptidx(1:npti), qml_ice_1d    (1:npti), qml_ice    (:,:,kl) )
          CALL tab_2d_1d( npti, nptidx(1:npti), qcn_ice_1d    (1:npti), qcn_ice    (:,:,kl) )
@@ -471,5 +471,5 @@
          sv_i_1d(1:npti) = s_i_1d (1:npti) * v_i_1d (1:npti)
          oa_i_1d(1:npti) = o_i_1d (1:npti) * a_i_1d (1:npti)
-         
+
          CALL tab_1d_2d( npti, nptidx(1:npti), at_i_1d(1:npti), at_i             )
          CALL tab_1d_2d( npti, nptidx(1:npti), a_i_1d (1:npti), a_i (:,:,kl)     )
@@ -532,5 +532,5 @@
          CALL tab_1d_2d( npti, nptidx(1:npti), dh_i_sum  (1:npti) , dh_i_sum_2d(:,:,kl) )
          CALL tab_1d_2d( npti, nptidx(1:npti), dh_s_mlt  (1:npti) , dh_s_mlt_2d(:,:,kl) )
-         ! SIMIP diagnostics         
+         ! SIMIP diagnostics
          CALL tab_1d_2d( npti, nptidx(1:npti), t_si_1d       (1:npti), t_si       (:,:,kl) )
          CALL tab_1d_2d( npti, nptidx(1:npti), qcn_ice_bot_1d(1:npti), qcn_ice_bot(:,:,kl) )
@@ -554,6 +554,6 @@
    SUBROUTINE ice_thd_init
       !!-------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_thd_init *** 
-      !!                 
+      !!                   ***  ROUTINE ice_thd_init ***
+      !!
       !! ** Purpose :   Physical constants and parameters associated with
       !!                ice thermodynamics
Index: /NEMO/trunk/src/ICE/icethd_dh.F90
===================================================================
--- /NEMO/trunk/src/ICE/icethd_dh.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icethd_dh.F90	(revision 14072)
@@ -2,8 +2,8 @@
    !!======================================================================
    !!                       ***  MODULE icethd_dh ***
-   !!   seaice : thermodynamic growth and melt 
+   !!   seaice : thermodynamic growth and melt
    !!======================================================================
    !! History :       !  2003-05  (M. Vancoppenolle) Original code in 1D
-   !!                 !  2005-06  (M. Vancoppenolle) 3D version 
+   !!                 !  2005-06  (M. Vancoppenolle) 3D version
    !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
    !!----------------------------------------------------------------------
@@ -24,5 +24,5 @@
    USE lib_mpp        ! MPP library
    USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
-   
+
    IMPLICIT NONE
    PRIVATE
@@ -59,6 +59,6 @@
       !!
       !! References : Bitz and Lipscomb, 1999, J. Geophys. Res.
-      !!              Fichefet T. and M. Maqueda 1997, J. Geophys. Res., 102(C6), 12609-12646   
-      !!              Vancoppenolle, Fichefet and Bitz, 2005, Geophys. Res. Let. 
+      !!              Fichefet T. and M. Maqueda 1997, J. Geophys. Res., 102(C6), 12609-12646
+      !!              Vancoppenolle, Fichefet and Bitz, 2005, Geophys. Res. Let.
       !!              Vancoppenolle et al.,2009, Ocean Modelling
       !!------------------------------------------------------------------
@@ -67,5 +67,5 @@
 
       REAL(wp) ::   ztmelts      ! local scalar
-      REAL(wp) ::   zdum       
+      REAL(wp) ::   zdum
       REAL(wp) ::   zfracs       ! fractionation coefficient for bottom salt entrapment
       REAL(wp) ::   zswi1        ! switch for computation of bottom salinity
@@ -87,8 +87,8 @@
       REAL(wp), DIMENSION(jpij) ::   zf_tt       ! Heat budget to determine melting or freezing(W.m-2)
       REAL(wp), DIMENSION(jpij) ::   zevap_rema  ! remaining mass flux from sublimation        (kg.m-2)
-      REAL(wp), DIMENSION(jpij) ::   zdeltah     
+      REAL(wp), DIMENSION(jpij) ::   zdeltah
       REAL(wp), DIMENSION(jpij) ::   zsnw        ! distribution of snow after wind blowing
 
-      INTEGER , DIMENSION(jpij,nlay_i)     ::   icount    ! number of layers vanishing by melting 
+      INTEGER , DIMENSION(jpij,nlay_i)     ::   icount    ! number of layers vanishing by melting
       REAL(wp), DIMENSION(jpij,0:nlay_i+1) ::   zh_i      ! ice layer thickness (m)
       REAL(wp), DIMENSION(jpij,0:nlay_s  ) ::   zh_s      ! snw layer thickness (m)
@@ -97,5 +97,5 @@
       REAL(wp) ::   zswitch_sal
 
-      INTEGER  ::   num_iter_max      ! Heat conservation 
+      INTEGER  ::   num_iter_max      ! Heat conservation
       !!------------------------------------------------------------------
 
@@ -149,5 +149,5 @@
       !
       DO ji = 1, npti
-         zf_tt(ji)         = qcn_ice_bot_1d(ji) + qsb_ice_bot_1d(ji) + fhld_1d(ji) + qtr_ice_bot_1d(ji) * frq_m_1d(ji) 
+         zf_tt(ji)         = qcn_ice_bot_1d(ji) + qsb_ice_bot_1d(ji) + fhld_1d(ji) + qtr_ice_bot_1d(ji) * frq_m_1d(ji)
          zq_bot(ji)        = MAX( 0._wp, zf_tt(ji) * rDt_ice )
       END DO
@@ -172,5 +172,5 @@
             END IF
          END DO
-      END DO         
+      END DO
 
       ! Snow precipitation
@@ -202,8 +202,8 @@
                zdum    = - rswitch * zq_top(ji) / MAX( ze_s(ji,jk), epsi20 )   ! thickness change
                zdum    = MAX( zdum , - zh_s(ji,jk) )                           ! bound melting
-               
+
                hfx_snw_1d    (ji) = hfx_snw_1d    (ji) - ze_s(ji,jk) * zdum * a_i_1d(ji) * r1_Dt_ice   ! heat used to melt snow(W.m-2, >0)
                wfx_snw_sum_1d(ji) = wfx_snw_sum_1d(ji) - rhos        * zdum * a_i_1d(ji) * r1_Dt_ice   ! snow melting only = water into the ocean
-               
+
                ! updates available heat + thickness
                dh_s_mlt(ji)    =              dh_s_mlt(ji)    + zdum
@@ -217,5 +217,5 @@
       END DO
 
-      ! Snow sublimation 
+      ! Snow sublimation
       !-----------------
       ! qla_ice is always >=0 (upwards), heat goes to the atmosphere, therefore snow sublimates
@@ -225,9 +225,9 @@
       DO ji = 1, npti
          IF( evap_ice_1d(ji) > 0._wp ) THEN
-            zdeltah   (ji) = MAX( - evap_ice_1d(ji) * r1_rhos * rDt_ice, - h_s_1d(ji) )   ! amount of snw that sublimates, < 0            
+            zdeltah   (ji) = MAX( - evap_ice_1d(ji) * r1_rhos * rDt_ice, - h_s_1d(ji) )   ! amount of snw that sublimates, < 0
             zevap_rema(ji) = MAX( 0._wp, evap_ice_1d(ji) * rDt_ice + zdeltah(ji) * rhos ) ! remaining evap in kg.m-2 (used for ice sublimation later on)
          ENDIF
       END DO
-      
+
       DO jk = 0, nlay_s
          DO ji = 1, npti
@@ -247,21 +247,21 @@
       END DO
 
-      !      
+      !
       !                       ! ============ !
       !                       !     Ice      !
       !                       ! ============ !
 
-      ! Surface ice melting 
+      ! Surface ice melting
       !--------------------
       DO jk = 1, nlay_i
          DO ji = 1, npti
             ztmelts = - rTmlt * sz_i_1d(ji,jk)   ! Melting point of layer k [C]
-            
+
             IF( t_i_1d(ji,jk) >= (ztmelts+rt0) ) THEN   !-- Internal melting
 
-               zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0]       
+               zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0]
                zdE            =   0._wp                               ! Specific enthalpy difference (J/kg, <0)
                !                                                          set up at 0 since no energy is needed to melt water...(it is already melted)
-               zdum           = MIN( 0._wp , - zh_i(ji,jk) )          ! internal melting occurs when the internal temperature is above freezing     
+               zdum           = MIN( 0._wp , - zh_i(ji,jk) )          ! internal melting occurs when the internal temperature is above freezing
                !                                                          this should normally not happen, but sometimes, heat diffusion leads to this
                zfmdt          = - zdum * rhoi                         ! Recompute mass flux [kg/m2, >0]
@@ -275,28 +275,28 @@
                !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok
             ELSE                                        !-- Surface melting
-               
+
                zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0]
                zEw            =    rcp * ztmelts                      ! Specific enthalpy of resulting meltwater [J/kg, <0]
                zdE            =    zEi - zEw                          ! Specific enthalpy difference < 0
-               
+
                zfmdt          = - zq_top(ji) / zdE                    ! Mass flux to the ocean [kg/m2, >0]
-               
+
                zdum           = - zfmdt * r1_rhoi                     ! Melt of layer jk [m, <0]
-               
+
                zdum           = MIN( 0._wp , MAX( zdum , - zh_i(ji,jk) ) )    ! Melt of layer jk cannot exceed the layer thickness [m, <0]
 
                zq_top(ji)     = MAX( 0._wp , zq_top(ji) - zdum * rhoi * zdE ) ! update available heat
-               
+
                dh_i_sum(ji)   = dh_i_sum(ji) + zdum                   ! Cumulate surface melt
-               
+
                zfmdt          = - rhoi * zdum                         ! Recompute mass flux [kg/m2, >0]
-               
+
                zQm            = zfmdt * zEw                           ! Energy of the melt water sent to the ocean [J/m2, <0]
-               
+
                hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux [W.m-2], < 0
-               hfx_sum_1d(ji) = hfx_sum_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux used in this process [W.m-2], > 0  
+               hfx_sum_1d(ji) = hfx_sum_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux used in this process [W.m-2], > 0
                wfx_sum_1d(ji) = wfx_sum_1d(ji) - rhoi * zdum              * a_i_1d(ji) * r1_Dt_ice    ! Mass flux
                sfx_sum_1d(ji) = sfx_sum_1d(ji) - rhoi * zdum * s_i_1d(ji) * a_i_1d(ji) * r1_Dt_ice    ! Salt flux >0
-               !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok) 
+               !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok)
             END IF
             ! update thickness
@@ -320,5 +320,5 @@
             !                                                                                                            if all ice is melted. => must be corrected
             ! update remaining mass flux and thickness
-            zevap_rema(ji) = zevap_rema(ji) + zdum * rhoi            
+            zevap_rema(ji) = zevap_rema(ji) + zdum * rhoi
             zh_i(ji,jk)    = MAX( 0._wp, zh_i(ji,jk) + zdum )
             h_i_1d(ji)     = MAX( 0._wp, h_i_1d(ji)  + zdum )
@@ -329,13 +329,13 @@
             h_i_old (ji,jk) = h_i_old (ji,jk) + zdum
 
-            ! record which layers have disappeared (for bottom melting) 
+            ! record which layers have disappeared (for bottom melting)
             !    => icount=0 : no layer has vanished
             !    => icount=5 : 5 layers have vanished
-            rswitch       = MAX( 0._wp , SIGN( 1._wp , - zh_i(ji,jk) ) ) 
+            rswitch       = MAX( 0._wp , SIGN( 1._wp , - zh_i(ji,jk) ) )
             icount(ji,jk) = NINT( rswitch )
-                        
-         END DO
-      END DO
-      
+
+         END DO
+      END DO
+
       ! remaining "potential" evap is sent to ocean
       DO ji = 1, npti
@@ -344,10 +344,10 @@
 
 
-      ! Ice Basal growth 
+      ! Ice Basal growth
       !------------------
       ! Basal growth is driven by heat imbalance at the ice-ocean interface,
-      ! between the inner conductive flux  (qcn_ice_bot), from the open water heat flux 
-      ! (fhld) and the sensible ice-ocean flux (qsb_ice_bot). 
-      ! qcn_ice_bot is positive downwards. qsb_ice_bot and fhld are positive to the ice 
+      ! between the inner conductive flux  (qcn_ice_bot), from the open water heat flux
+      ! (fhld) and the sensible ice-ocean flux (qsb_ice_bot).
+      ! qcn_ice_bot is positive downwards. qsb_ice_bot and fhld are positive to the ice
 
       ! If salinity varies in time, an iterative procedure is required, because
@@ -359,5 +359,5 @@
       num_iter_max = 1
       IF( nn_icesal == 2 )   num_iter_max = 5  ! salinity varying in time
-      
+
       DO ji = 1, npti
          IF(  zf_tt(ji) < 0._wp  ) THEN
@@ -366,5 +366,5 @@
                ! New bottom ice salinity (Cox & Weeks, JGR88 )
                !--- zswi1  if dh/dt < 2.0e-8
-               !--- zswi12 if 2.0e-8 < dh/dt < 3.6e-7 
+               !--- zswi12 if 2.0e-8 < dh/dt < 3.6e-7
                !--- zswi2  if dh/dt > 3.6e-7
                zgrr     = MIN( 1.0e-3, MAX ( dh_i_bog(ji) * r1_Dt_ice , epsi10 ) )
@@ -380,5 +380,5 @@
 
                zt_i_new       = zswitch_sal * t_bo_1d(ji) + ( 1. - zswitch_sal) * t_i_1d(ji, nlay_i)
-               
+
                zEi            = rcpi * ( zt_i_new - (ztmelts+rt0) ) &                                  ! Specific enthalpy of forming ice (J/kg, <0)
                   &             - rLfus * ( 1.0 - ztmelts / ( MIN( zt_i_new - rt0, -epsi10 ) ) ) + rcp * ztmelts
@@ -389,11 +389,11 @@
 
                dh_i_bog(ji)   = rDt_ice * MAX( 0._wp , zf_tt(ji) / ( zdE * rhoi ) )
-               
+
             END DO
-            ! Contribution to Energy and Salt Fluxes                                    
+            ! Contribution to Energy and Salt Fluxes
             zfmdt = - rhoi * dh_i_bog(ji)                                                              ! Mass flux x time step (kg/m2, < 0)
-            
+
             hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], >0
-            hfx_bog_1d(ji) = hfx_bog_1d(ji) - zdE  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux used in this process [W.m-2], <0          
+            hfx_bog_1d(ji) = hfx_bog_1d(ji) - zdE  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux used in this process [W.m-2], <0
             wfx_bog_1d(ji) = wfx_bog_1d(ji) - rhoi * dh_i_bog(ji)               * a_i_1d(ji) * r1_Dt_ice   ! Mass flux, <0
             sfx_bog_1d(ji) = sfx_bog_1d(ji) - rhoi * dh_i_bog(ji) * s_i_new(ji) * a_i_1d(ji) * r1_Dt_ice   ! Salt flux, <0
@@ -415,5 +415,5 @@
       DO jk = nlay_i, 1, -1
          DO ji = 1, npti
-            IF(  zf_tt(ji)  >  0._wp  .AND. jk > icount(ji,jk) ) THEN   ! do not calculate where layer has already disappeared by surface melting 
+            IF(  zf_tt(ji)  >  0._wp  .AND. jk > icount(ji,jk) ) THEN   ! do not calculate where layer has already disappeared by surface melting
 
                ztmelts = - rTmlt * sz_i_1d(ji,jk)  ! Melting point of layer jk (C)
@@ -424,5 +424,5 @@
                   zdE            = 0._wp                         ! Specific enthalpy difference   (J/kg, <0)
                   !                                                  set up at 0 since no energy is needed to melt water...(it is already melted)
-                  zdum           = MIN( 0._wp , - zh_i(ji,jk) )  ! internal melting occurs when the internal temperature is above freezing     
+                  zdum           = MIN( 0._wp , - zh_i(ji,jk) )  ! internal melting occurs when the internal temperature is above freezing
                   !                                                  this should normally not happen, but sometimes, heat diffusion leads to this
                   dh_i_itm (ji)  = dh_i_itm(ji) + zdum
@@ -446,5 +446,5 @@
 
                   zdum           = MIN( 0._wp , MAX( zdum, - zh_i(ji,jk) ) )       ! bound thickness change
-                  
+
                   zq_bot(ji)     = MAX( 0._wp , zq_bot(ji) - zdum * rhoi * zdE )   ! update available heat. MAX is necessary for roundup errors
 
@@ -455,5 +455,5 @@
                   zQm            = zfmdt * zEw                                     ! Heat exchanged with ocean
 
-                  hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], <0  
+                  hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], <0
                   hfx_bom_1d(ji) = hfx_bom_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat used in this process [W.m-2], >0
                   wfx_bom_1d(ji) = wfx_bom_1d(ji) - rhoi * zdum              * a_i_1d(ji) * r1_Dt_ice   ! Mass flux
@@ -488,5 +488,5 @@
          END DO
       END DO
-      
+
       ! Snow load on ice
       ! -----------------
@@ -511,8 +511,8 @@
          END DO
       END DO
-      
+
       ! Snow-Ice formation
       ! ------------------
-      ! When snow load exceeds Archimede's limit, snow-ice interface goes down under sea-level, 
+      ! When snow load exceeds Archimede's limit, snow-ice interface goes down under sea-level,
       ! flooding of seawater transforms snow into ice. Thickness that is transformed is dh_snowice (positive for the ice)
       z1_rho = 1._wp / ( rhos+rho0-rhoi )
@@ -528,6 +528,6 @@
          zfmdt          = ( rhos - rhoi ) * dh_snowice(ji)    ! <0
          zEw            = rcp * sst_1d(ji)
-         zQm            = zfmdt * zEw 
-         
+         zQm            = zfmdt * zEw
+
          hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw        * zfmdt * a_i_1d(ji) * r1_Dt_ice ! Heat flux
          sfx_sni_1d(ji) = sfx_sni_1d(ji) + sss_1d(ji) * zfmdt * a_i_1d(ji) * r1_Dt_ice ! Salt flux
@@ -536,5 +536,5 @@
          IF( nn_icesal /= 2 )  THEN
             sfx_bri_1d(ji) = sfx_bri_1d(ji) - sss_1d(ji) * zfmdt                 * a_i_1d(ji) * r1_Dt_ice  &  ! put back sss_m     into the ocean
-               &                            - s_i_1d(ji) * dh_snowice(ji) * rhoi * a_i_1d(ji) * r1_Dt_ice     ! and get  rn_icesal from the ocean 
+               &                            - s_i_1d(ji) * dh_snowice(ji) * rhoi * a_i_1d(ji) * r1_Dt_ice     ! and get  rn_icesal from the ocean
          ENDIF
 
@@ -574,5 +574,5 @@
       !--------------------------------------------
       CALL snw_ent( zh_s, ze_s, e_s_1d )
-      
+
       ! recalculate t_s_1d from e_s_1d
       DO jk = 1, nlay_s
@@ -589,10 +589,10 @@
 
       ! --- ensure that a_i = 0 & h_s = 0 where h_i = 0 ---
-      WHERE( h_i_1d(1:npti) == 0._wp )   
+      WHERE( h_i_1d(1:npti) == 0._wp )
          a_i_1d (1:npti) = 0._wp
          h_s_1d (1:npti) = 0._wp
          t_su_1d(1:npti) = rt0
       END WHERE
-      
+
    END SUBROUTINE ice_thd_dh
 
@@ -602,11 +602,11 @@
       !!
       !! ** Purpose :
-      !!           This routine computes new vertical grids in the snow, 
-      !!           and consistently redistributes temperatures. 
+      !!           This routine computes new vertical grids in the snow,
+      !!           and consistently redistributes temperatures.
       !!           Redistribution is made so as to ensure to energy conservation
       !!
       !!
       !! ** Method  : linear conservative remapping
-      !!           
+      !!
       !! ** Steps : 1) cumulative integrals of old enthalpies/thicknesses
       !!            2) linear remapping on the new layers
@@ -637,5 +637,5 @@
       !  1) Cumulative integral of old enthalpy * thickness and layers interfaces
       !--------------------------------------------------------------------------
-      zeh_cum0(1:npti,0) = 0._wp 
+      zeh_cum0(1:npti,0) = 0._wp
       zh_cum0 (1:npti,0) = 0._wp
       DO jk0 = 1, nlay_s+1
@@ -651,5 +651,5 @@
       ! new layer thickesses
       DO ji = 1, npti
-         zhnew(ji) = SUM( ph_old(ji,0:nlay_s) ) * r1_nlay_s  
+         zhnew(ji) = SUM( ph_old(ji,0:nlay_s) ) * r1_nlay_s
       END DO
 
@@ -662,5 +662,5 @@
       END DO
 
-      zeh_cum1(1:npti,0:nlay_s) = 0._wp 
+      zeh_cum1(1:npti,0:nlay_s) = 0._wp
       ! new cumulative q*h => linear interpolation
       DO jk0 = 1, nlay_s+1
@@ -676,17 +676,17 @@
       END DO
       ! to ensure that total heat content is strictly conserved, set:
-      zeh_cum1(1:npti,nlay_s) = zeh_cum0(1:npti,nlay_s+1) 
+      zeh_cum1(1:npti,nlay_s) = zeh_cum0(1:npti,nlay_s+1)
 
       ! new enthalpies
       DO jk1 = 1, nlay_s
          DO ji = 1, npti
-            rswitch      = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) ) 
+            rswitch      = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) )
             pe_new(ji,jk1) = rswitch * ( zeh_cum1(ji,jk1) - zeh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi20 )
          END DO
       END DO
-      
+
    END SUBROUTINE snw_ent
 
-   
+
 #else
    !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/ICE/icethd_pnd.F90
===================================================================
--- /NEMO/trunk/src/ICE/icethd_pnd.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icethd_pnd.F90	(revision 14072)
@@ -1,3 +1,3 @@
-MODULE icethd_pnd 
+MODULE icethd_pnd
    !!======================================================================
    !!                     ***  MODULE  icethd_pnd   ***
@@ -41,5 +41,5 @@
    INTEGER, PARAMETER ::   np_pndTOPO = 3   ! Level ice pond scheme
 
-   !-------------------------------------------------------------------------- 
+   !--------------------------------------------------------------------------
    ! Diagnostics for pond volume per area
    !
@@ -56,5 +56,5 @@
    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_drn       ! pond volume lost by drainage     [-]
    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_lid       ! exchange with lid / refreezing   [-]
-   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_rnf       ! meltwater pond lost to runoff    [-]      
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_rnf       ! meltwater pond lost to runoff    [-]
    REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   diag_dvpn_mlt_1d    ! meltwater pond volume input      [-]
    REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   diag_dvpn_drn_1d    ! pond volume lost by drainage     [-]
@@ -75,5 +75,5 @@
       !!-------------------------------------------------------------------
       !!               ***  ROUTINE ice_thd_pnd   ***
-      !!               
+      !!
       !! ** Purpose :   change melt pond fraction and thickness
       !!
@@ -84,5 +84,5 @@
       INTEGER ::   ji, jj, jl        ! loop indices
       !!-------------------------------------------------------------------
-      
+
       ALLOCATE( diag_dvpn_mlt(jpi,jpj), diag_dvpn_lid(jpi,jpj), diag_dvpn_drn(jpi,jpj), diag_dvpn_rnf(jpi,jpj) )
       ALLOCATE( diag_dvpn_mlt_1d(jpij), diag_dvpn_lid_1d(jpij), diag_dvpn_drn_1d(jpij), diag_dvpn_rnf_1d(jpij) )
@@ -111,5 +111,5 @@
          END_2D
       END DO
-      
+
       !------------------------------
       !  Identify grid cells with ice
@@ -148,9 +148,9 @@
       DEALLOCATE( diag_dvpn_mlt   , diag_dvpn_lid   , diag_dvpn_drn   , diag_dvpn_rnf    )
       DEALLOCATE( diag_dvpn_mlt_1d, diag_dvpn_lid_1d, diag_dvpn_drn_1d, diag_dvpn_rnf_1d )
-      
-   END SUBROUTINE ice_thd_pnd 
-
-
-   SUBROUTINE pnd_CST 
+
+   END SUBROUTINE ice_thd_pnd
+
+
+   SUBROUTINE pnd_CST
       !!-------------------------------------------------------------------
       !!                ***  ROUTINE pnd_CST  ***
@@ -158,9 +158,9 @@
       !! ** Purpose :   Compute melt pond evolution
       !!
-      !! ** Method  :   Melt pond fraction and thickness are prescribed 
+      !! ** Method  :   Melt pond fraction and thickness are prescribed
       !!                to non-zero values when t_su = 0C
       !!
       !! ** Tunable parameters : pond fraction (rn_apnd), pond depth (rn_hpnd)
-      !!                
+      !!
       !! ** Note   : Coupling with such melt ponds is only radiative
       !!             Advection, ridging, rafting... are bypassed
@@ -172,5 +172,5 @@
       !!-------------------------------------------------------------------
       DO jl = 1, jpl
-         
+
          CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d    (1:npti), a_i    (:,:,jl) )
          CALL tab_2d_1d( npti, nptidx(1:npti), t_su_1d   (1:npti), t_su   (:,:,jl) )
@@ -185,9 +185,9 @@
             !
             IF( a_i_1d(ji) >= 0.01_wp .AND. t_su_1d(ji) >= rt0 ) THEN
-               h_ip_1d(ji)      = rn_hpnd    
+               h_ip_1d(ji)      = rn_hpnd
                a_ip_1d(ji)      = rn_apnd * a_i_1d(ji)
                h_il_1d(ji)      = 0._wp    ! no pond lids whatsoever
             ELSE
-               h_ip_1d(ji)      = 0._wp    
+               h_ip_1d(ji)      = 0._wp
                a_ip_1d(ji)      = 0._wp
                h_il_1d(ji)      = 0._wp
@@ -222,5 +222,5 @@
       !! ** Method  : A fraction of meltwater is accumulated in ponds and sent to ocean when surface is freezing
       !!              We  work with volumes and then redistribute changes into thickness and concentration
-      !!              assuming linear relationship between the two. 
+      !!              assuming linear relationship between the two.
       !!
       !! ** Action  : - pond growth:      Vp = Vp + dVmelt                                          --- from Holland et al 2012 ---
@@ -237,5 +237,5 @@
       !!                                     dH = lid thickness change. Retrieved from this eq.:    --- from Flocco et al 2010 ---
       !!
-      !!                                                                   rhoi * Lf * dH/dt = ki * MAX(Tp-Tsu,0) / H 
+      !!                                                                   rhoi * Lf * dH/dt = ki * MAX(Tp-Tsu,0) / H
       !!                                                                      H = lid thickness
       !!                                                                      Lf = latent heat of fusion
@@ -260,6 +260,6 @@
       !!
       !! ** Tunable parameters : rn_apnd_max, rn_apnd_min, rn_pnd_flush
-      !! 
-      !! ** Note       :   Mostly stolen from CICE but not only. These are between level-ice ponds and CESM ponds. 
+      !!
+      !! ** Note       :   Mostly stolen from CICE but not only. These are between level-ice ponds and CESM ponds.
       !!
       !! ** References :   Flocco and Feltham (JGR, 2007)
@@ -267,5 +267,5 @@
       !!                   Holland et al      (J. Clim, 2012)
       !!                   Hunke et al        (OM 2012)
-      !!-------------------------------------------------------------------  
+      !!-------------------------------------------------------------------
       REAL(wp), DIMENSION(nlay_i) ::   ztmp           ! temporary array
       !!
@@ -287,11 +287,11 @@
       INTEGER  ::   ji, jk, jl                        ! loop indices
       !!-------------------------------------------------------------------
-      z1_rhow   = 1._wp / rhow 
+      z1_rhow   = 1._wp / rhow
       z1_aspect = 1._wp / zaspect
-      z1_Tp     = 1._wp / zTp 
-      
+      z1_Tp     = 1._wp / zTp
+
       CALL tab_2d_1d( npti, nptidx(1:npti), at_i_1d          (1:npti), at_i          )
       CALL tab_2d_1d( npti, nptidx(1:npti), wfx_pnd_1d       (1:npti), wfx_pnd       )
-      
+
       CALL tab_2d_1d( npti, nptidx(1:npti), diag_dvpn_mlt_1d (1:npti), diag_dvpn_mlt )
       CALL tab_2d_1d( npti, nptidx(1:npti), diag_dvpn_drn_1d (1:npti), diag_dvpn_drn )
@@ -315,5 +315,5 @@
             CALL tab_2d_1d( npti, nptidx(1:npti), t_i_1d (1:npti,jk), t_i (:,:,jk,jl) )
          END DO
-         
+
          !-----------------------
          ! Melt pond calculations
@@ -342,5 +342,5 @@
                zdv_avail = -( dh_i_sum(ji)*rhoi + dh_s_mlt(ji)*rhos ) * z1_rhow * a_i_1d(ji) ! > 0
                zfr_mlt   = rn_apnd_min + ( rn_apnd_max - rn_apnd_min ) * at_i_1d(ji) !  = ( 1 - r ) = fraction of melt water that is not flushed
-               zdv_mlt   = MAX( 0._wp, zfr_mlt * zdv_avail ) ! max for roundoff errors? 
+               zdv_mlt   = MAX( 0._wp, zfr_mlt * zdv_avail ) ! max for roundoff errors?
                !
                !--- overflow ---!
@@ -349,5 +349,5 @@
                !    If pond area exceeds zfr_mlt * a_i_1d(ji) then reduce the pond volume
                !       a_ip_max = zfr_mlt * a_i
-               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as: 
+               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as:
                zv_ip_max = zfr_mlt**2 * a_i_1d(ji) * zaspect
                zdv_mlt   = MAX( 0._wp, MIN( zdv_mlt, zv_ip_max - v_ip_1d(ji) ) )
@@ -356,5 +356,5 @@
                !    If pond depth exceeds half the ice thickness then reduce the pond volume
                !       h_ip_max = 0.5 * h_i
-               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as: 
+               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as:
                zv_ip_max = z1_aspect * a_i_1d(ji) * 0.25 * h_i_1d(ji) * h_i_1d(ji)
                zdv_mlt   = MAX( 0._wp, MIN( zdv_mlt, zv_ip_max - v_ip_1d(ji) ) )
@@ -375,5 +375,5 @@
                IF( ln_pnd_lids ) THEN
                   !
-                  !--- Lid growing and subsequent pond shrinking ---! 
+                  !--- Lid growing and subsequent pond shrinking ---!
                   zdv_frz = - 0.5_wp * MAX( 0._wp, -v_il_1d(ji) + & ! Flocco 2010 (eq. 5) solved implicitly as aH**2 + bH + c = 0
                      &                    SQRT( v_il_1d(ji)**2 + a_ip_1d(ji)**2 * 4._wp * rcnd_i * zdT * rDt_ice / (rLfus * rhow) ) ) ! max for roundoff errors
@@ -386,5 +386,5 @@
 
                ELSE
-                  zdv_frz = v_ip_1d(ji) * ( EXP( 0.01_wp * zdT * z1_Tp ) - 1._wp )  ! Holland 2012 (eq. 6) 
+                  zdv_frz = v_ip_1d(ji) * ( EXP( 0.01_wp * zdT * z1_Tp ) - 1._wp )  ! Holland 2012 (eq. 6)
                   ! Pond shrinking
                   v_ip_1d(ji) = MAX( 0._wp, v_ip_1d(ji) + zdv_frz )
@@ -398,5 +398,5 @@
                !
 
-               !------------------------------------------------!            
+               !------------------------------------------------!
                ! Pond drainage through brine network (flushing) !
                !------------------------------------------------!
@@ -420,5 +420,5 @@
                ! Do the drainage using Darcy's law
                zdv_flush   = -zperm * rho0 * grav * zhp * rDt_ice / (zvisc * h_i_1d(ji)) * a_ip_1d(ji) * rn_pnd_flush ! zflush comes from Hunke et al. (2012)
-               zdv_flush   = MAX( zdv_flush, -v_ip_1d(ji) ) ! < 0 
+               zdv_flush   = MAX( zdv_flush, -v_ip_1d(ji) ) ! < 0
                v_ip_1d(ji) = v_ip_1d(ji) + zdv_flush
 
@@ -479,6 +479,6 @@
 
 
-   SUBROUTINE pnd_TOPO    
-                                         
+   SUBROUTINE pnd_TOPO
+
       !!-------------------------------------------------------------------
       !!                ***  ROUTINE pnd_TOPO  ***
@@ -488,5 +488,5 @@
       !!
       !! ** Method  :   This code is initially based on Flocco and Feltham
-      !!                (2007) and Flocco et al. (2010). 
+      !!                (2007) and Flocco et al. (2010).
       !!
       !!                - Calculate available pond water base on surface meltwater
@@ -532,5 +532,5 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zvolp, &     !! total melt pond water available before redistribution and drainage
                                         zvolp_res    !! remaining melt pond water available after drainage
-                                        
+
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_a_i
 
@@ -545,5 +545,5 @@
 
       CALL ctl_stop( 'STOP', 'icethd_pnd : topographic melt ponds are still an ongoing work' )
-      
+
       !---------------------------------------------------------------
       ! Initialise
@@ -553,14 +553,14 @@
       zrhoi_L   = rhoi * rLfus      ! volumetric latent heat (J/m^3)
       zTp       = rt0 - 0.15_wp          ! pond freezing point, slightly below 0C (ponds are bid saline)
-      z1_rhow   = 1._wp / rhow 
+      z1_rhow   = 1._wp / rhow
 
       ! Set required ice variables (hard-coded here for now)
-!      zfpond(:,:) = 0._wp          ! contributing freshwater flux (?) 
-      
+!      zfpond(:,:) = 0._wp          ! contributing freshwater flux (?)
+
       at_i (:,:) = SUM( a_i (:,:,:), dim=3 ) ! ice fraction
       vt_i (:,:) = SUM( v_i (:,:,:), dim=3 ) ! volume per grid area
       vt_ip(:,:) = SUM( v_ip(:,:,:), dim=3 ) ! pond volume per grid area
       vt_il(:,:) = SUM( v_il(:,:,:), dim=3 ) ! lid volume per grid area
-      
+
       ! thickness
       WHERE( a_i(:,:,:) > epsi20 )   ;   z1_a_i(:,:,:) = 1._wp / a_i(:,:,:)
@@ -568,9 +568,9 @@
       END WHERE
       h_i(:,:,:) = v_i (:,:,:) * z1_a_i(:,:,:)
-      
+
       !---------------------------------------------------------------
       ! Change 2D to 1D
       !---------------------------------------------------------------
-      ! MV 
+      ! MV
       ! a less computing-intensive version would have 2D-1D passage here
       ! use what we have in iceitd.F90 (incremental remapping)
@@ -582,15 +582,15 @@
       ! Holland et al (2012) suggest that the fraction of runoff decreases with total ice fraction
       ! I cite her words, they are very talkative
-      ! "grid cells with very little ice cover (and hence more open water area) 
+      ! "grid cells with very little ice cover (and hence more open water area)
       ! have a higher runoff fraction to rep- resent the greater proximity of ice to open water."
       ! "This results in the same runoff fraction r for each ice category within a grid cell"
-      
+
       zvolp(:,:) = 0._wp
 
       DO jl = 1, jpl
          DO_2D( 1, 1, 1, 1 )
-                 
+
                IF ( a_i(ji,jj,jl) > epsi10 ) THEN
-            
+
                   !--- Available and contributing meltwater for melt ponding ---!
                   zv_mlt  = - ( dh_i_sum_2d(ji,jj,jl) * rhoi + dh_s_mlt_2d(ji,jj,jl) * rhos ) &        ! available volume of surface melt water per grid area
@@ -601,5 +601,5 @@
 
                   diag_dvpn_mlt(ji,jj) = diag_dvpn_mlt(ji,jj) + zv_mlt * r1_Dt_ice                     ! diags
-                  diag_dvpn_rnf(ji,jj) = diag_dvpn_rnf(ji,jj) + ( 1. - zfr_mlt ) * zv_mlt * r1_Dt_ice   
+                  diag_dvpn_rnf(ji,jj) = diag_dvpn_rnf(ji,jj) + ( 1. - zfr_mlt ) * zv_mlt * r1_Dt_ice
 
                   !--- Create possible new ponds
@@ -610,27 +610,27 @@
                      a_ip_frac(ji,jj,jl)  = 1.0_wp    ! pond fraction of sea ice (apnd for CICE)
                   ENDIF
-                  
+
                   !--- Deepen existing ponds with no change in pond fraction, before redistribution and drainage
                   v_ip(ji,jj,jl) = v_ip(ji,jj,jl) +  zv_pnd                                            ! use pond water to increase thickness
                   h_ip(ji,jj,jl) = v_ip(ji,jj,jl) / a_ip(ji,jj,jl)
-                  
+
                   !--- Total available pond water volume (pre-existing + newly produced)j
-                  zvolp(ji,jj)   = zvolp(ji,jj)   + v_ip(ji,jj,jl) 
+                  zvolp(ji,jj)   = zvolp(ji,jj)   + v_ip(ji,jj,jl)
 !                 zfpond(ji,jj) = zfpond(ji,jj) + zpond * a_ip_frac(ji,jj,jl) ! useless for now
-                   
+
                ENDIF ! a_i
 
          END_2D
       END DO ! ji
-                  
+
       !--------------------------------------------------------------
       ! Redistribute and drain water from ponds
-      !--------------------------------------------------------------   
+      !--------------------------------------------------------------
       CALL ice_thd_pnd_area( zvolp, zvolp_res )
-                                   
+
       !--------------------------------------------------------------
       ! Melt pond lid growth and melt
-      !--------------------------------------------------------------   
-      
+      !--------------------------------------------------------------
+
       IF( ln_pnd_lids ) THEN
 
@@ -638,5 +638,5 @@
 
             IF ( at_i(ji,jj) > 0.01 .AND. hm_i(ji,jj) > rn_himin .AND. vt_ip(ji,jj) > zvp_min * at_i(ji,jj) ) THEN
-                  
+
                !--------------------------
                ! Pond lid growth and melt
@@ -648,9 +648,9 @@
                END DO
                zTavg = zTavg / a_i(ji,jj,jl) !!! could get a division by zero here
-         
+
                DO jl = 1, jpl-1
-            
+
                   IF ( v_il(ji,jj,jl) > epsi10 ) THEN
-               
+
                      !----------------------------------------------------------------
                      ! Lid melting: floating upper ice layer melts in whole or part
@@ -660,27 +660,27 @@
 
                         zdvice = MIN( dh_i_sum_2d(ji,jj,jl)*a_ip(ji,jj,jl), v_il(ji,jj,jl) )
-                        
+
                         IF ( zdvice > epsi10 ) THEN
-                        
+
                            v_il (ji,jj,jl) = v_il (ji,jj,jl)   - zdvice
-                           v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)    + zdvice ! MV: not sure i understand dh_i_sum seems counted twice - 
+                           v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)    + zdvice ! MV: not sure i understand dh_i_sum seems counted twice -
                                                                         ! as it is already counted in surface melt
 !                          zvolp(ji,jj)     = zvolp(ji,jj)     + zdvice ! pointless to calculate total volume (done in icevar)
 !                          zfpond(ji,jj)    = fpond(ji,jj)     + zdvice ! pointless to follow fw budget (ponds have no fw)
-                     
+
                            IF ( v_il(ji,jj,jl) < epsi10 .AND. v_ip(ji,jj,jl) > epsi10) THEN
                            ! ice lid melted and category is pond covered
-                              v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)  + v_il(ji,jj,jl) 
-!                             zfpond(ji,jj)    = zfpond (ji,jj)    + v_il(ji,jj,jl) 
+                              v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)  + v_il(ji,jj,jl)
+!                             zfpond(ji,jj)    = zfpond (ji,jj)    + v_il(ji,jj,jl)
                               v_il(ji,jj,jl)   = 0._wp
                            ENDIF
                            h_ip(ji,jj,jl) = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) !!! could get a division by zero here
-                           
+
                            diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) + zdvice   ! diag
-                           
+
                         ENDIF
-                        
+
                      !----------------------------------------------------------------
-                     ! Freeze pre-existing lid 
+                     ! Freeze pre-existing lid
                      !----------------------------------------------------------------
 
@@ -688,10 +688,10 @@
 
                         ! differential growth of base of surface floating ice layer
-                        zdTice = MAX( - t_su(ji,jj,jl) - zTd , 0._wp ) ! > 0   
+                        zdTice = MAX( - t_su(ji,jj,jl) - zTd , 0._wp ) ! > 0
                         zomega = rcnd_i * zdTice / zrhoi_L
                         zdHui  = SQRT( 2._wp * zomega * rDt_ice + ( v_il(ji,jj,jl) / a_i(ji,jj,jl) )**2 ) &
                                - v_il(ji,jj,jl) / a_i(ji,jj,jl)
                         zdvice = min( zdHui*a_ip(ji,jj,jl) , v_ip(ji,jj,jl) )
-                  
+
                         IF ( zdvice > epsi10 ) THEN
                            v_il (ji,jj,jl)  = v_il(ji,jj,jl)   + zdvice
@@ -700,9 +700,9 @@
 !                          zfpond(ji,jj)   = zfpond(ji,jj)    - zdvice
                            h_ip(ji,jj,jl)   = v_ip(ji,jj,jl) / a_ip(ji,jj,jl)
-                           
+
                            diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) - zdvice    ! diag
-                           
+
                         ENDIF
-                  
+
                      ENDIF ! Tsfcn(i,j,n)
 
@@ -714,14 +714,14 @@
 
                   ELSE ! v_il < epsi10
-                    
+
                      ! thickness of newly formed ice
                      ! the surface temperature of a meltpond is the same as that
-                     ! of the ice underneath (0C), and the thermodynamic surface 
+                     ! of the ice underneath (0C), and the thermodynamic surface
                      ! flux is the same
-                     
+
                      !!! we need net surface energy flux, excluding conduction
                      !!! fsurf is summed over categories in CICE
                      !!! we have the category-dependent flux, let us use it ?
-                     zfsurf = qns_ice(ji,jj,jl) + qsr_ice(ji,jj,jl)                     
+                     zfsurf = qns_ice(ji,jj,jl) + qsr_ice(ji,jj,jl)
                      zdHui  = MAX ( -zfsurf * rDt_ice/zrhoi_L , 0._wp )
                      zdvice = MIN ( zdHui * a_ip(ji,jj,jl) , v_ip(ji,jj,jl) )
@@ -729,5 +729,5 @@
                         v_il (ji,jj,jl)  = v_il(ji,jj,jl)   + zdvice
                         v_ip(ji,jj,jl)   = v_ip(ji,jj,jl)   - zdvice
-                        
+
                         diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) - zdvice      ! diag
 !                       zvolp(ji,jj)     = zvolp(ji,jj)     - zdvice
@@ -735,7 +735,7 @@
                         h_ip(ji,jj,jl)   = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) ! MV - in principle, this is useless as h_ip is computed in icevar
                      ENDIF
-               
+
                   ENDIF  ! v_il
-            
+
                END DO ! jl
 
@@ -745,5 +745,5 @@
                v_il(ji,jj,:) = 0._wp
 !              zfpond(ji,jj) = zfpond(ji,jj)- zvolp(ji,jj)
-!		            zvolp(ji,jj)    = 0._wp         
+!		            zvolp(ji,jj)    = 0._wp
 
             ENDIF
@@ -769,5 +769,5 @@
 !                 v_il(ji,jj,jl) = 0._wp ! probably uselesss now since we get zap_small
 !              ENDIF
-      
+
                ! recalculate equivalent pond variables
                IF ( a_ip(ji,jj,jl) > epsi10) THEN
@@ -779,5 +779,5 @@
 !                 h_il(ji,jj,jl)      = 0._wp ! MV in principle, useless as omputed in icevar
 !              ENDIF
-               
+
          END_2D
 
@@ -787,5 +787,5 @@
    END SUBROUTINE pnd_TOPO
 
-   
+
    SUBROUTINE ice_thd_pnd_area( zvolp , zdvolp )
 
@@ -793,5 +793,5 @@
        !!                ***  ROUTINE ice_thd_pnd_area ***
        !!
-       !! ** Purpose : Given the total volume of available pond water, 
+       !! ** Purpose : Given the total volume of available pond water,
        !!              redistribute and drain water
        !!
@@ -823,5 +823,5 @@
        !!
        !!------------------------------------------------------------------
-       
+
        REAL (wp), DIMENSION(jpi,jpj), INTENT(INOUT) :: &
           zvolp,                                       &  ! total available pond water
@@ -865,19 +865,19 @@
        a_ip(:,:,:) = 0._wp
        h_ip(:,:,:) = 0._wp
- 
+
        DO_2D( 1, 1, 1, 1 )
- 
+
              IF ( at_i(ji,jj) > 0.01 .AND. hm_i(ji,jj) > rn_himin .AND. zvolp(ji,jj) > zvp_min * at_i(ji,jj) ) THEN
- 
+
         !-------------------------------------------------------------------
         ! initialize
         !-------------------------------------------------------------------
- 
+
         DO jl = 1, jpl
- 
+
            !----------------------------------------
            ! compute the effective snow fraction
            !----------------------------------------
- 
+
            IF (a_i(ji,jj,jl) < epsi10)  THEN
               hicen(jl) =  0._wp
@@ -889,18 +889,18 @@
               hsnon(jl) = v_s(ji,jj,jl) / a_i(ji,jj,jl)
               reduced_aicen(jl) = 1._wp ! n=jpl
- 
+
               !js: initial code in NEMO_DEV
               !IF (n < jpl) reduced_aicen(jl) = aicen(jl) &
               !                     * (-0.024_wp*hicen(jl) + 0.832_wp)
- 
+
               !js: from CICE 5.1.2: this limit reduced_aicen to 0.2 when hicen is too large
-              IF (jl < jpl) reduced_aicen(jl) = a_i(ji,jj,jl) & 
+              IF (jl < jpl) reduced_aicen(jl) = a_i(ji,jj,jl) &
                                    * max(0.2_wp,(-0.024_wp*hicen(jl) + 0.832_wp))
- 
+
               asnon(jl) = reduced_aicen(jl)  ! effective snow fraction (empirical)
               ! MV should check whether this makes sense to have the same effective snow fraction in here
               ! OLI: it probably doesn't
            END IF
- 
+
   ! This choice for alfa and beta ignores hydrostatic equilibium of categories.
   ! Hydrostatic equilibium of the entire ITD is accounted for below, assuming
@@ -911,27 +911,27 @@
   ! alfan = 60% of the ice volume) in each category lies above the reference line,
   ! and 40% below. Note: p6 is an arbitrary choice, but alfa+beta=1 is required.
- 
+
   ! MV:
   ! Note that this choice is not in the original FF07 paper and has been adopted in CICE
   ! No reason why is explained in the doc, but I guess there is a reason. I'll try to investigate, maybe
- 
+
   ! Where does that choice come from ? => OLI : Coz' Chuck Norris said so...
- 
+
            alfan(jl) = 0.6 * hicen(jl)
            betan(jl) = 0.4 * hicen(jl)
- 
+
            cum_max_vol(jl)     = 0._wp
            cum_max_vol_tmp(jl) = 0._wp
- 
+
         END DO ! jpl
- 
+
         cum_max_vol_tmp(0) = 0._wp
         drain = 0._wp
         zdvolp(ji,jj) = 0._wp
- 
+
         !----------------------------------------------------------
         ! Drain overflow water, update pond fraction and volume
         !----------------------------------------------------------
- 
+
         !--------------------------------------------------------------------------
         ! the maximum amount of water that can be contained up to each ice category
@@ -940,13 +940,13 @@
         ! Then the excess volume cum_max_vol(jl) drains out of the system
         ! It should be added to wfx_pnd_out
- 
+
         DO jl = 1, jpl-1 ! last category can not hold any volume
- 
+
            IF (alfan(jl+1) >= alfan(jl) .AND. alfan(jl+1) > 0._wp ) THEN
- 
+
               ! total volume in level including snow
               cum_max_vol_tmp(jl) = cum_max_vol_tmp(jl-1) + &
                  (alfan(jl+1) - alfan(jl)) * sum(reduced_aicen(1:jl))
- 
+
               ! subtract snow solid volumes from lower categories in current level
               DO ns = 1, jl
@@ -956,5 +956,5 @@
                       max(min(hsnon(ns)+alfan(ns)-alfan(jl), alfan(jl+1)-alfan(jl)), 0._wp)
               END DO
- 
+
            ELSE ! assume higher categories unoccupied
               cum_max_vol_tmp(jl) = cum_max_vol_tmp(jl-1)
@@ -966,5 +966,5 @@
         cum_max_vol_tmp(jpl) = cum_max_vol_tmp(jpl-1)  ! last category holds no volume
         cum_max_vol  (1:jpl) = cum_max_vol_tmp(1:jpl)
- 
+
         !----------------------------------------------------------------
         ! is there more meltwater than can be held in the floe?
@@ -973,7 +973,7 @@
            drain = zvolp(ji,jj) - cum_max_vol(jpl) + epsi10
            zvolp(ji,jj) = zvolp(ji,jj) - drain ! update meltwater volume available
- 
+
            diag_dvpn_rnf(ji,jj) = - drain      ! diag - overflow counted in the runoff part (arbitrary choice)
-           
+
            zdvolp(ji,jj) = drain         ! this is the drained water
            IF (zvolp(ji,jj) < epsi10) THEN
@@ -982,9 +982,9 @@
            END IF
         END IF
- 
+
         ! height and area corresponding to the remaining volume
         ! routine leaves zvolp unchanged
         CALL ice_thd_pnd_depth(reduced_aicen, asnon, hsnon, alfan, zvolp(ji,jj), cum_max_vol, hpond, m_index)
- 
+
         DO jl = 1, m_index
            !h_ip(jl) = hpond - alfan(jl) + alfan(1) ! here oui choulde update
@@ -996,12 +996,12 @@
         END DO
         !zapond = sum(a_ip(1:m_index))     !js: from CICE 5.1.2; not in Icepack1.1.0-6-gac6195d
- 
+
         !------------------------------------------------------------------------
         ! Drainage through brine network (permeability)
         !------------------------------------------------------------------------
         !!! drainage due to ice permeability - Darcy's law
- 
+
         ! sea water level
-        msno = 0._wp 
+        msno = 0._wp
         DO jl = 1 , jpl
           msno = msno + v_s(ji,jj,jl) * rhos
@@ -1010,28 +1010,28 @@
         hsl_rel = floe_weight / rho0 &
                 - ( ( sum(betan(:)*a_i(ji,jj,:)) / at_i(ji,jj) ) + alfan(1) )
- 
+
         deltah = hpond - hsl_rel
         pressure_head = grav * rho0 * max(deltah, 0._wp)
- 
+
         ! drain if ice is permeable
         permflag = 0
- 
+
         IF (pressure_head > 0._wp) THEN
            DO jl = 1, jpl-1
               IF ( hicen(jl) /= 0._wp ) THEN
- 
+
               !IF (hicen(jl) > 0._wp) THEN           !js: from CICE 5.1.2
- 
+
                  perm = 0._wp ! MV ugly dummy patch
-                 CALL ice_thd_pnd_perm(t_i(ji,jj,:,jl),  sz_i(ji,jj,:,jl), perm) ! bof 
+                 CALL ice_thd_pnd_perm(t_i(ji,jj,:,jl),  sz_i(ji,jj,:,jl), perm) ! bof
                  IF (perm > 0._wp) permflag = 1
- 
+
                  drain = perm*a_ip(ji,jj,jl)*pressure_head*rDt_ice / &
                                           (viscosity*hicen(jl))
                  zdvolp(ji,jj) = zdvolp(ji,jj) + min(drain, zvolp(ji,jj))
                  zvolp(ji,jj) = max(zvolp(ji,jj) - drain, 0._wp)
- 
+
                  diag_dvpn_drn(ji,jj) = - drain ! diag (could be better coded)
-                 
+
                  IF (zvolp(ji,jj) < epsi10) THEN
                     zdvolp(ji,jj) = zdvolp(ji,jj) + zvolp(ji,jj)
@@ -1040,5 +1040,5 @@
              END IF
           END DO
- 
+
            ! adjust melt pond dimensions
            IF (permflag > 0) THEN
@@ -1052,5 +1052,5 @@
            END IF
         END IF ! pressure_head
- 
+
         !-------------------------------
         ! remove water from the snow
@@ -1060,10 +1060,10 @@
         ! snow in melt ponds is not melted
         !------------------------------------------------------------------------
-        
+
         ! MV here, it seems that we remove some meltwater from the ponds, but I can't really tell
         ! how much, so I did not diagnose it
         ! so if there is a problem here, nobody is going to see it...
-        
- 
+
+
         ! Calculate pond volume for lower categories
         DO jl = 1,m_index-1
@@ -1071,19 +1071,19 @@
                           - (rhos/rhow) * asnon(jl) * min(hsnon(jl), h_ip(ji,jj,jl))
         END DO
- 
+
         ! Calculate pond volume for highest category = remaining pond volume
- 
+
         ! The following is completely unclear to Martin at least
         ! Could we redefine properly and recode in a more readable way ?
- 
+
         ! m_index = last category with melt pond
- 
+
         IF (m_index == 1) v_ip(ji,jj,m_index) = zvolp(ji,jj) ! volume of mw in 1st category is the total volume of melt water
- 
+
         IF (m_index > 1) THEN
           IF (zvolp(ji,jj) > sum( v_ip(ji,jj,1:m_index-1))) THEN
              v_ip(ji,jj,m_index) = zvolp(ji,jj) - sum(v_ip(ji,jj,1:m_index-1))
           ELSE
-             v_ip(ji,jj,m_index) = 0._wp 
+             v_ip(ji,jj,m_index) = 0._wp
              h_ip(ji,jj,m_index) = 0._wp
              a_ip(ji,jj,m_index) = 0._wp
@@ -1094,5 +1094,5 @@
           END IF
         END IF
- 
+
         DO jl = 1,m_index
            IF (a_ip(ji,jj,jl) > epsi10) THEN
@@ -1100,5 +1100,5 @@
            ELSE
               zdvolp(ji,jj) = zdvolp(ji,jj) + v_ip(ji,jj,jl)
-              h_ip(ji,jj,jl) = 0._wp 
+              h_ip(ji,jj,jl) = 0._wp
               v_ip(ji,jj,jl)  = 0._wp
               a_ip(ji,jj,jl) = 0._wp
@@ -1106,9 +1106,9 @@
         END DO
         DO jl = m_index+1, jpl
-           h_ip(ji,jj,jl) = 0._wp 
-           a_ip(ji,jj,jl) = 0._wp 
-           v_ip(ji,jj,jl) = 0._wp 
+           h_ip(ji,jj,jl) = 0._wp
+           a_ip(ji,jj,jl) = 0._wp
+           v_ip(ji,jj,jl) = 0._wp
         END DO
-        
+
            ENDIF
 
@@ -1319,10 +1319,10 @@
 
        DO k = 1, nlay_i
-       
+
           Sbr    = - Tin(k) / rTmlt ! Consistent expression with SI3 (linear liquidus)
           ! Best expression to date is that one (Vancoppenolle et al JGR 2019)
           ! Sbr  = - 18.7 * Tin(k) - 0.519 * Tin(k)**2 - 0.00535 * Tin(k) **3
           phi(k) = salin(k) / Sbr
-          
+
        END DO
 
@@ -1335,5 +1335,5 @@
    END SUBROUTINE ice_thd_pnd_perm
 
-   SUBROUTINE ice_thd_pnd_init 
+   SUBROUTINE ice_thd_pnd_init
       !!-------------------------------------------------------------------
       !!                  ***  ROUTINE ice_thd_pnd_init   ***
@@ -1342,8 +1342,8 @@
       !!              over sea ice
       !!
-      !! ** Method  :  Read the namthd_pnd  namelist and check the melt pond  
+      !! ** Method  :  Read the namthd_pnd  namelist and check the melt pond
       !!               parameter values called at the first timestep (nit000)
       !!
-      !! ** input   :   Namelist namthd_pnd  
+      !! ** input   :   Namelist namthd_pnd
       !!-------------------------------------------------------------------
       INTEGER  ::   ios, ioptio   ! Local integer
@@ -1389,19 +1389,19 @@
       !
       SELECT CASE( nice_pnd )
-      CASE( np_pndNO )         
+      CASE( np_pndNO )
          IF( ln_pnd_alb  ) THEN ; ln_pnd_alb  = .FALSE. ; CALL ctl_warn( 'ln_pnd_alb=false when no ponds' )  ; ENDIF
          IF( ln_pnd_lids ) THEN ; ln_pnd_lids = .FALSE. ; CALL ctl_warn( 'ln_pnd_lids=false when no ponds' ) ; ENDIF
-      CASE( np_pndCST )         
+      CASE( np_pndCST )
          IF( ln_pnd_lids ) THEN ; ln_pnd_lids = .FALSE. ; CALL ctl_warn( 'ln_pnd_lids=false when constant ponds' ) ; ENDIF
       END SELECT
       !
    END SUBROUTINE ice_thd_pnd_init
-   
+
 #else
    !!----------------------------------------------------------------------
    !!   Default option          Empty module          NO SI3 sea-ice model
    !!----------------------------------------------------------------------
-#endif 
+#endif
 
    !!======================================================================
-END MODULE icethd_pnd 
+END MODULE icethd_pnd
Index: /NEMO/trunk/src/ICE/icethd_zdf_bl99.F90
===================================================================
--- /NEMO/trunk/src/ICE/icethd_zdf_bl99.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icethd_zdf_bl99.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE icethd_zdf_BL99 ***
-   !!   sea-ice: vertical heat diffusion in sea ice (computation of temperatures) 
+   !!   sea-ice: vertical heat diffusion in sea ice (computation of temperatures)
    !!======================================================================
    !! History :       !  2003-02  (M. Vancoppenolle) original 1D code
@@ -15,5 +15,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants (ocean directory) 
+   USE phycst         ! physical constants (ocean directory)
    USE ice            ! sea-ice: variables
    USE ice1D          ! sea-ice: thermodynamics variables
@@ -44,8 +44,8 @@
       !!
       !! ** Method  : solves the heat equation diffusion with a Neumann boundary
-      !!              condition at the surface and a Dirichlet one at the bottom. 
+      !!              condition at the surface and a Dirichlet one at the bottom.
       !!              Solar radiation is partially absorbed into the ice.
-      !!              The specific heat and thermal conductivities depend on ice 
-      !!              salinity and temperature to take into account brine pocket   
+      !!              The specific heat and thermal conductivities depend on ice
+      !!              salinity and temperature to take into account brine pocket
       !!              melting. The numerical scheme is an iterative Crank-Nicolson
       !!              on a non-uniform multilayer grid in the ice and snow system.
@@ -91,11 +91,11 @@
       REAL(wp) ::   zbeta     =  0.117_wp     ! for thermal conductivity (could be 0.13)
       REAL(wp) ::   zkimin    =  0.10_wp      ! minimum ice thermal conductivity
-      REAL(wp) ::   ztsu_err  =  1.e-5_wp     ! range around which t_su is considered at 0C 
-      REAL(wp) ::   zdti_bnd  =  1.e-4_wp     ! maximal authorized error on temperature 
-      REAL(wp) ::   zhs_ssl   =  0.03_wp      ! surface scattering layer in the snow 
+      REAL(wp) ::   ztsu_err  =  1.e-5_wp     ! range around which t_su is considered at 0C
+      REAL(wp) ::   zdti_bnd  =  1.e-4_wp     ! maximal authorized error on temperature
+      REAL(wp) ::   zhs_ssl   =  0.03_wp      ! surface scattering layer in the snow
       REAL(wp) ::   zhi_ssl   =  0.10_wp      ! surface scattering layer in the ice
       REAL(wp) ::   zh_min    =  1.e-3_wp     ! minimum ice/snow thickness for conduction
       REAL(wp) ::   ztmelts                   ! ice melting temperature
-      REAL(wp) ::   zdti_max                  ! current maximal error on temperature 
+      REAL(wp) ::   zdti_max                  ! current maximal error on temperature
       REAL(wp) ::   zcpi                      ! Ice specific heat
       REAL(wp) ::   zhfx_err, zdq             ! diag errors on heat
@@ -127,7 +127,7 @@
       REAL(wp), DIMENSION(jpij)          ::   zq_ini      ! diag errors on heat
       REAL(wp), DIMENSION(jpij)          ::   zghe        ! G(he), th. conduct enhancement factor, mono-cat
-      REAL(wp), DIMENSION(jpij)          ::   za_s_fra    ! ice fraction covered by snow 
-      REAL(wp), DIMENSION(jpij)          ::   isnow       ! snow presence (1) or not (0) 
-      REAL(wp), DIMENSION(jpij)          ::   isnow_comb  ! snow presence for met-office 
+      REAL(wp), DIMENSION(jpij)          ::   za_s_fra    ! ice fraction covered by snow
+      REAL(wp), DIMENSION(jpij)          ::   isnow       ! snow presence (1) or not (0)
+      REAL(wp), DIMENSION(jpij)          ::   isnow_comb  ! snow presence for met-office
       REAL(wp), DIMENSION(jpij,nlay_i+nlay_s+1)   ::   zindterm    ! 'Ind'ependent term
       REAL(wp), DIMENSION(jpij,nlay_i+nlay_s+1)   ::   zindtbis    ! Temporary 'ind'ependent term
@@ -139,15 +139,15 @@
       REAL(wp) ::   zhe        ! dummy factor
       REAL(wp) ::   zcnd_i     ! mean sea ice thermal conductivity
-      !!------------------------------------------------------------------     
+      !!------------------------------------------------------------------
 
       ! --- diag error on heat diffusion - PART 1 --- !
       DO ji = 1, npti
          zq_ini(ji) = ( SUM( e_i_1d(ji,1:nlay_i) ) * h_i_1d(ji) * r1_nlay_i +  &
-            &           SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s ) 
+            &           SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s )
       END DO
 
       ! calculate ice fraction covered by snow for radiation
       CALL ice_var_snwfra( h_s_1d(1:npti), za_s_fra(1:npti) )
-      
+
       !------------------
       ! 1) Initialization
@@ -155,5 +155,5 @@
       !
       ! extinction radiation in the snow
-      IF    ( nn_qtrice == 0 ) THEN   ! constant 
+      IF    ( nn_qtrice == 0 ) THEN   ! constant
          zraext_s(1:npti) = rn_kappa_s
       ELSEIF( nn_qtrice == 1 ) THEN   ! depends on melting/freezing conditions
@@ -166,5 +166,5 @@
       DO ji = 1, npti
          ! ice thickness
-         IF( h_i_1d(ji) > 0._wp ) THEN 
+         IF( h_i_1d(ji) > 0._wp ) THEN
             zh_i  (ji) = MAX( zh_min , h_i_1d(ji) ) * r1_nlay_i ! set a minimum thickness for conduction
             z1_h_i(ji) = 1._wp / zh_i(ji)                       !       it must be very small
@@ -198,5 +198,5 @@
          ztsuold    (1:npti) = t_su_1d(1:npti)                          ! surface temperature initial value
          t_su_1d    (1:npti) = MIN( t_su_1d(1:npti), rt0 - ztsu_err )   ! required to leave the choice between melting or not
-         zdqns_ice_b(1:npti) = dqns_ice_1d(1:npti)                      ! derivative of incoming nonsolar flux 
+         zdqns_ice_b(1:npti) = dqns_ice_1d(1:npti)                      ! derivative of incoming nonsolar flux
          zqns_ice_b (1:npti) = qns_ice_1d(1:npti)                       ! store previous qns_ice_1d value
          !
@@ -221,5 +221,5 @@
       !
       zradtr_i(1:npti,0) = zradtr_s(1:npti,nlay_s) * za_s_fra(1:npti) + qtr_ice_top_1d(1:npti) * ( 1._wp - za_s_fra(1:npti) )
-      DO jk = 1, nlay_i 
+      DO jk = 1, nlay_i
          DO ji = 1, npti
             !                             ! radiation transmitted below the layer-th ice layer
@@ -227,5 +227,5 @@
                &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zh_min  ) ) &
                &            + ( 1._wp - za_s_fra(ji) ) * qtr_ice_top_1d(ji)                        &   ! part snow free
-               &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zhi_ssl ) )            
+               &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zhi_ssl ) )
             !                             ! radiation absorbed by the layer-th ice layer
             zradab_i(ji,jk) = zradtr_i(ji,jk-1) - zradtr_i(ji,jk)
@@ -288,5 +288,5 @@
          DO ji = 1, npti
             IF ( .NOT. l_T_converged(ji) ) &
-               ztcond_i(ji,:) = MAX( zkimin, ztcond_i_cp(ji,:) )        
+               ztcond_i(ji,:) = MAX( zkimin, ztcond_i_cp(ji,:) )
          END DO
          !
@@ -401,5 +401,5 @@
             zdiagbis(1:npti,:)   = 0._wp
 
-            DO jm = nlay_s + 2, nlay_s + nlay_i 
+            DO jm = nlay_s + 2, nlay_s + nlay_i
                DO ji = 1, npti
                   jk = jm - nlay_s - 1
@@ -414,9 +414,9 @@
             DO ji = 1, npti
                ! ice bottom term
-               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)   
+               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)
                ztrid   (ji,jm,2) = 1._wp + zeta_i(ji,nlay_i) * ( zkappa_i(ji,nlay_i-1) + zkappa_i(ji,nlay_i) * zg1 )
                ztrid   (ji,jm,3) = 0._wp
                zindterm(ji,jm)   = ztiold(ji,nlay_i) + zeta_i(ji,nlay_i) *  &
-                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) ) 
+                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) )
             END DO
 
@@ -433,16 +433,16 @@
                      zindterm(ji,jm)   = ztsold(ji,jk) + zeta_s(ji,jk) * zradab_s(ji,jk)
                   END DO
-                  
+
                   ! case of only one layer in the ice (ice equation is altered)
                   IF( nlay_i == 1 ) THEN
                      ztrid   (ji,nlay_s+2,3) = 0._wp
-                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji) 
-                  ENDIF
-                  
+                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji)
+                  ENDIF
+
                   IF( t_su_1d(ji) < rt0 ) THEN   !--  case 1 : no surface melting
-                     
+
                      jm_min(ji) = 1
                      jm_max(ji) = nlay_i + nlay_s + 1
-                     
+
                      ! surface equation
                      ztrid   (ji,1,1) = 0._wp
@@ -450,5 +450,5 @@
                      ztrid   (ji,1,3) =                   zg1s * zkappa_s(ji,0)
                      zindterm(ji,1)   = zdqns_ice_b(ji) * t_su_1d(ji) - zfnet(ji)
-                     
+
                      ! first layer of snow equation
                      ztrid   (ji,2,1) =       - zeta_s(ji,1) *                    zkappa_s(ji,0) * zg1s
@@ -456,15 +456,15 @@
                      ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1)
                      zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * zradab_s(ji,1)
-                     
+
                   ELSE                            !--  case 2 : surface is melting
                      !
                      jm_min(ji) = 2
                      jm_max(ji) = nlay_i + nlay_s + 1
-                     
+
                      ! first layer of snow equation
                      ztrid   (ji,2,1) = 0._wp
                      ztrid   (ji,2,2) = 1._wp + zeta_s(ji,1) * ( zkappa_s(ji,1) + zkappa_s(ji,0) * zg1s )
-                     ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1) 
-                     zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + zkappa_s(ji,0) * zg1s * t_su_1d(ji) ) 
+                     ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1)
+                     zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + zkappa_s(ji,0) * zg1s * t_su_1d(ji) )
                   ENDIF
                   !                            !---------------------!
@@ -476,17 +476,17 @@
                      jm_min(ji) = nlay_s + 1
                      jm_max(ji) = nlay_i + nlay_s + 1
-                     
-                     ! surface equation	
+
+                     ! surface equation
                      ztrid   (ji,jm_min(ji),1) = 0._wp
-                     ztrid   (ji,jm_min(ji),2) = zdqns_ice_b(ji) - zkappa_i(ji,0) * zg1    
+                     ztrid   (ji,jm_min(ji),2) = zdqns_ice_b(ji) - zkappa_i(ji,0) * zg1
                      ztrid   (ji,jm_min(ji),3) =                   zkappa_i(ji,0) * zg1
                      zindterm(ji,jm_min(ji))   = zdqns_ice_b(ji) * t_su_1d(ji) - zfnet(ji)
-                     
+
                      ! first layer of ice equation
                      ztrid   (ji,jm_min(ji)+1,1) =       - zeta_i(ji,1) *                    zkappa_i(ji,0) * zg1
                      ztrid   (ji,jm_min(ji)+1,2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 )
-                     ztrid   (ji,jm_min(ji)+1,3) =       - zeta_i(ji,1) *   zkappa_i(ji,1)  
-                     zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * zradab_i(ji,1)  
-                     
+                     ztrid   (ji,jm_min(ji)+1,3) =       - zeta_i(ji,1) *   zkappa_i(ji,1)
+                     zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * zradab_i(ji,1)
+
                      ! case of only one layer in the ice (surface & ice equations are altered)
                      IF( nlay_i == 1 ) THEN
@@ -499,16 +499,16 @@
                         zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,1) * t_bo_1d(ji))
                      ENDIF
-                     
+
                   ELSE                            !--  case 2 : surface is melting
-                     
+
                      jm_min(ji) = nlay_s + 2
                      jm_max(ji) = nlay_i + nlay_s + 1
-                     
+
                      ! first layer of ice equation
                      ztrid   (ji,jm_min(ji),1) = 0._wp
-                     ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 )  
+                     ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 )
                      ztrid   (ji,jm_min(ji),3) =       - zeta_i(ji,1) *   zkappa_i(ji,1)
-                     zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,0) * zg1 * t_su_1d(ji)) 
-                     
+                     zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,0) * zg1 * t_su_1d(ji))
+
                      ! case of only one layer in the ice (surface & ice equations are altered)
                      IF( nlay_i == 1 ) THEN
@@ -519,5 +519,5 @@
                            &                      + t_su_1d(ji) * zeta_i(ji,1) * zkappa_i(ji,0) * 2._wp
                      ENDIF
-                     
+
                   ENDIF
                ENDIF
@@ -540,5 +540,5 @@
 !!$            END DO
 !!$            !!clem SNWLAY => check why LIM1D does not get this loop. Is nlay_i+5 correct?
-!!$            
+!!$
 !!$            DO jk = jm_mint+1, jm_maxt
 !!$               DO ji = 1, npti
@@ -574,5 +574,5 @@
             END DO
 
-            ! snow temperatures      
+            ! snow temperatures
             DO ji = 1, npti
                ! Variables used after iterations
@@ -589,5 +589,5 @@
                END DO
             END DO
-            
+
             ! surface temperature
             DO ji = 1, npti
@@ -628,5 +628,5 @@
                      zdti_max      =  MAX( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) )
                   END DO
-                  
+
                   ! convergence test
                   IF( ln_zdf_chkcvg ) THEN
@@ -665,5 +665,5 @@
             zdiagbis(1:npti,:)   = 0._wp
 
-            DO jm = nlay_s + 2, nlay_s + nlay_i 
+            DO jm = nlay_s + 2, nlay_s + nlay_i
                DO ji = 1, npti
                   jk = jm - nlay_s - 1
@@ -678,9 +678,9 @@
             DO ji = 1, npti
                ! ice bottom term
-               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)   
+               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)
                ztrid   (ji,jm,2) = 1._wp + zeta_i(ji,nlay_i) * ( zkappa_i(ji,nlay_i-1) + zkappa_i(ji,nlay_i) * zg1 )
                ztrid   (ji,jm,3) = 0._wp
                zindterm(ji,jm)   = ztiold(ji,nlay_i) + zeta_i(ji,nlay_i) *  &
-                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) ) 
+                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) )
             ENDDO
 
@@ -697,20 +697,20 @@
                      zindterm(ji,jm)   = ztsold(ji,jk) + zeta_s(ji,jk) * zradab_s(ji,jk)
                   END DO
-                  
+
                   ! case of only one layer in the ice (ice equation is altered)
                   IF ( nlay_i == 1 ) THEN
                      ztrid   (ji,nlay_s+2,3) = 0._wp
-                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji) 
-                  ENDIF
-                  
+                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji)
+                  ENDIF
+
                   jm_min(ji) = 2
                   jm_max(ji) = nlay_i + nlay_s + 1
-                  
+
                   ! first layer of snow equation
                   ztrid   (ji,2,1) = 0._wp
                   ztrid   (ji,2,2) = 1._wp + zeta_s(ji,1) * zkappa_s(ji,1)
-                  ztrid   (ji,2,3) =       - zeta_s(ji,1) * zkappa_s(ji,1) 
-                  zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + qcn_ice_1d(ji) ) 
-                  
+                  ztrid   (ji,2,3) =       - zeta_s(ji,1) * zkappa_s(ji,1)
+                  zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + qcn_ice_1d(ji) )
+
                   !                            !---------------------!
                ELSE                            ! cells without snow  !
@@ -718,11 +718,11 @@
                   jm_min(ji) = nlay_s + 2
                   jm_max(ji) = nlay_i + nlay_s + 1
-                  
+
                   ! first layer of ice equation
                   ztrid   (ji,jm_min(ji),1) = 0._wp
-                  ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * zkappa_i(ji,1)  
+                  ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * zkappa_i(ji,1)
                   ztrid   (ji,jm_min(ji),3) =       - zeta_i(ji,1) * zkappa_i(ji,1)
                   zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * ( zradab_i(ji,1) + qcn_ice_1d(ji) )
-                  
+
                   ! case of only one layer in the ice (surface & ice equations are altered)
                   IF( nlay_i == 1 ) THEN
@@ -733,5 +733,5 @@
                         &                                     ( zradab_i(ji,1) + zkappa_i(ji,1) * t_bo_1d(ji) + qcn_ice_1d(ji) )
                   ENDIF
-                  
+
                ENDIF
                !
@@ -752,5 +752,5 @@
 !!$               jm_maxt = MAX(jm_max(ji),jm_maxt)
 !!$            END DO
-!!$            
+!!$
 !!$            DO jk = jm_mint+1, jm_maxt
 !!$               DO ji = 1, npti
@@ -786,6 +786,6 @@
                END DO
             END DO
-            
-            ! snow temperatures      
+
+            ! snow temperatures
             DO ji = 1, npti
                ! Variables used after iterations
@@ -823,5 +823,5 @@
 
                   DO jk = 1, nlay_i
-                     ztmelts       = -rTmlt * sz_i_1d(ji,jk) + rt0 
+                     ztmelts       = -rTmlt * sz_i_1d(ji,jk) + rt0
                      t_i_1d(ji,jk) =  MAX( MIN( t_i_1d(ji,jk), ztmelts ), rt0 - 100._wp )
                      zdti_max      =  MAX ( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) )
@@ -885,5 +885,5 @@
          !
          DO ji = 1, npti
-            hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) - ( qns_ice_1d(ji) - zqns_ice_b(ji) ) * a_i_1d(ji) 
+            hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) - ( qns_ice_1d(ji) - zqns_ice_b(ji) ) * a_i_1d(ji)
          END DO
          !
@@ -893,14 +893,14 @@
       !
       IF( k_cnd == np_cnd_OFF .OR. k_cnd == np_cnd_ON ) THEN
-         
-         CALL ice_var_enthalpy       
-         
+
+         CALL ice_var_enthalpy
+
          ! zhfx_err = correction on the diagnosed heat flux due to non-convergence of the algorithm used to solve heat equation
          DO ji = 1, npti
             zdq = - zq_ini(ji) + ( SUM( e_i_1d(ji,1:nlay_i) ) * h_i_1d(ji) * r1_nlay_i +  &
                &                   SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s )
-            
+
             IF( k_cnd == np_cnd_OFF ) THEN
-               
+
                IF( t_su_1d(ji) < rt0 ) THEN  ! case T_su < 0degC
                   zhfx_err = ( qns_ice_1d(ji)     + qsr_ice_1d(ji)     - zradtr_i(ji,nlay_i) - qcn_ice_bot_1d(ji)  &
@@ -910,10 +910,10 @@
                      &       + zdq * r1_Dt_ice ) * a_i_1d(ji)
                ENDIF
-               
+
             ELSEIF( k_cnd == np_cnd_ON ) THEN
-            
+
                zhfx_err    = ( qcn_ice_top_1d(ji) + qtr_ice_top_1d(ji) - zradtr_i(ji,nlay_i) - qcn_ice_bot_1d(ji)  &
                   &          + zdq * r1_Dt_ice ) * a_i_1d(ji)
-            
+
             ENDIF
             !
@@ -921,5 +921,5 @@
             hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) + zhfx_err
             !
-            ! hfx_dif = Heat flux diagnostic of sensible heat used to warm/cool ice in W.m-2   
+            ! hfx_dif = Heat flux diagnostic of sensible heat used to warm/cool ice in W.m-2
             hfx_dif_1d(ji) = hfx_dif_1d(ji) - zdq * r1_Dt_ice * a_i_1d(ji)
             !
@@ -952,5 +952,5 @@
       ! --- SIMIP diagnostics
       !
-      DO ji = 1, npti         
+      DO ji = 1, npti
          !--- Snow-ice interfacial temperature (diagnostic SIMIP)
          IF( h_s_1d(ji) >= zhs_ssl ) THEN
Index: /NEMO/trunk/src/ICE/iceupdate.F90
===================================================================
--- /NEMO/trunk/src/ICE/iceupdate.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/iceupdate.F90	(revision 14072)
@@ -67,16 +67,16 @@
       !!-------------------------------------------------------------------
       !!                ***  ROUTINE ice_update_flx ***
-      !!  
-      !! ** Purpose :   Update the surface ocean boundary condition for heat 
+      !!
+      !! ** Purpose :   Update the surface ocean boundary condition for heat
       !!                salt and mass over areas where sea-ice is non-zero
-      !!         
+      !!
       !! ** Action  : - computes the heat and freshwater/salt fluxes
       !!                at the ice-ocean interface.
       !!              - Update the ocean sbc
-      !!     
-      !! ** Outputs : - qsr     : sea heat flux:     solar 
+      !!
+      !! ** Outputs : - qsr     : sea heat flux:     solar
       !!              - qns     : sea heat flux: non solar
-      !!              - emp     : freshwater budget: volume flux 
-      !!              - sfx     : salt flux 
+      !!              - emp     : freshwater budget: volume flux
+      !!              - sfx     : salt flux
       !!              - fr_i    : ice fraction
       !!              - tn_ice  : sea-ice surface temperature
@@ -104,5 +104,5 @@
       ! Net heat flux on top of the ice-ocean (W.m-2)
       !----------------------------------------------
-      qt_atm_oi(:,:) = qns_tot(:,:) + qsr_tot(:,:) 
+      qt_atm_oi(:,:) = qns_tot(:,:) + qsr_tot(:,:)
 
       ! --- case we bypass ice thermodynamics --- !
@@ -114,18 +114,18 @@
          qevap_ice  (:,:,:) = 0._wp
       ENDIF
-      
+
       DO_2D( 1, 1, 1, 1 )
 
-         ! Solar heat flux reaching the ocean (max) = zqsr (W.m-2) 
+         ! Solar heat flux reaching the ocean (max) = zqsr (W.m-2)
          !---------------------------------------------------
          zqsr = qsr_tot(ji,jj) - SUM( a_i_b(ji,jj,:) * ( qsr_ice(ji,jj,:) - qtr_ice_bot(ji,jj,:) ) )
 
-         ! Total heat flux reaching the ocean = qt_oce_ai (W.m-2) 
+         ! Total heat flux reaching the ocean = qt_oce_ai (W.m-2)
          !---------------------------------------------------
          qt_oce_ai(ji,jj) = qt_atm_oi(ji,jj) - hfx_sum(ji,jj) - hfx_bom(ji,jj) - hfx_bog(ji,jj) &
             &                                - hfx_dif(ji,jj) - hfx_opw(ji,jj) - hfx_snw(ji,jj) &
             &                                + hfx_thd(ji,jj) + hfx_dyn(ji,jj) + hfx_res(ji,jj) &
-            &                                + hfx_sub(ji,jj) - SUM( qevap_ice(ji,jj,:) * a_i_b(ji,jj,:) ) + hfx_spr(ji,jj)                 
-         
+            &                                + hfx_sub(ji,jj) - SUM( qevap_ice(ji,jj,:) * a_i_b(ji,jj,:) ) + hfx_spr(ji,jj)
+
          ! New qsr and qns used to compute the oceanic heat flux at the next time step
          !----------------------------------------------------------------------------
@@ -144,42 +144,42 @@
          !
          ! the non-solar is simply derived from the solar flux
-         qns(ji,jj) = qt_oce_ai(ji,jj) - zqsr              
-         
-         ! Mass flux at the atm. surface       
+         qns(ji,jj) = qt_oce_ai(ji,jj) - zqsr
+
+         ! Mass flux at the atm. surface
          !-----------------------------------
          wfx_sub(ji,jj) = wfx_snw_sub(ji,jj) + wfx_ice_sub(ji,jj)
 
-         ! Mass flux at the ocean surface      
+         ! Mass flux at the ocean surface
          !------------------------------------
          ! ice-ocean  mass flux
          wfx_ice(ji,jj) = wfx_bog(ji,jj) + wfx_bom(ji,jj) + wfx_sum(ji,jj) + wfx_sni(ji,jj)   &
             &           + wfx_opw(ji,jj) + wfx_dyn(ji,jj) + wfx_res(ji,jj) + wfx_lam(ji,jj)
-         
+
          ! snw-ocean mass flux
          wfx_snw(ji,jj) = wfx_snw_sni(ji,jj) + wfx_snw_dyn(ji,jj) + wfx_snw_sum(ji,jj)
-         
+
          ! total mass flux at the ocean/ice interface
          fmmflx(ji,jj) =                - wfx_ice(ji,jj) - wfx_snw(ji,jj) - wfx_pnd(ji,jj) - wfx_err_sub(ji,jj)   ! ice-ocean mass flux saved at least for biogeochemical model
          emp   (ji,jj) = emp_oce(ji,jj) - wfx_ice(ji,jj) - wfx_snw(ji,jj) - wfx_pnd(ji,jj) - wfx_err_sub(ji,jj)   ! atm-ocean + ice-ocean mass flux
 
-         ! Salt flux at the ocean surface      
+         ! Salt flux at the ocean surface
          !------------------------------------------
          sfx(ji,jj) = sfx_bog(ji,jj) + sfx_bom(ji,jj) + sfx_sum(ji,jj) + sfx_sni(ji,jj) + sfx_opw(ji,jj)   &
             &       + sfx_res(ji,jj) + sfx_dyn(ji,jj) + sfx_bri(ji,jj) + sfx_sub(ji,jj) + sfx_lam(ji,jj)
-         
-         ! Mass of snow and ice per unit area   
+
+         ! Mass of snow and ice per unit area
          !----------------------------------------
          snwice_mass_b(ji,jj) = snwice_mass(ji,jj)       ! save mass from the previous ice time step
          !                                               ! new mass per unit area
-         snwice_mass  (ji,jj) = tmask(ji,jj,1) * ( rhos * vt_s(ji,jj) + rhoi * vt_i(ji,jj) + rhow * (vt_ip(ji,jj) + vt_il(ji,jj)) ) 
+         snwice_mass  (ji,jj) = tmask(ji,jj,1) * ( rhos * vt_s(ji,jj) + rhoi * vt_i(ji,jj) + rhow * (vt_ip(ji,jj) + vt_il(ji,jj)) )
          !                                               ! time evolution of snow+ice mass
          snwice_fmass (ji,jj) = ( snwice_mass(ji,jj) - snwice_mass_b(ji,jj) ) * r1_Dt_ice
-         
+
       END_2D
 
       ! Storing the transmitted variables
       !----------------------------------
-      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction            
-      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                      
+      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction
+      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature
 
       ! Snow/ice albedo (only if sent to coupler, useless in forced mode)
@@ -216,16 +216,16 @@
       CALL iom_put( 'vfxice'    , wfx_ice     )   ! mass flux from total ice growth/melt
       CALL iom_put( 'vfxbog'    , wfx_bog     )   ! mass flux from bottom growth
-      CALL iom_put( 'vfxbom'    , wfx_bom     )   ! mass flux from bottom melt 
-      CALL iom_put( 'vfxsum'    , wfx_sum     )   ! mass flux from surface melt 
-      CALL iom_put( 'vfxlam'    , wfx_lam     )   ! mass flux from lateral melt 
+      CALL iom_put( 'vfxbom'    , wfx_bom     )   ! mass flux from bottom melt
+      CALL iom_put( 'vfxsum'    , wfx_sum     )   ! mass flux from surface melt
+      CALL iom_put( 'vfxlam'    , wfx_lam     )   ! mass flux from lateral melt
       CALL iom_put( 'vfxsni'    , wfx_sni     )   ! mass flux from snow-ice formation
       CALL iom_put( 'vfxopw'    , wfx_opw     )   ! mass flux from growth in open water
       CALL iom_put( 'vfxdyn'    , wfx_dyn     )   ! mass flux from dynamics (ridging)
-      CALL iom_put( 'vfxres'    , wfx_res     )   ! mass flux from undiagnosed processes 
+      CALL iom_put( 'vfxres'    , wfx_res     )   ! mass flux from undiagnosed processes
       CALL iom_put( 'vfxpnd'    , wfx_pnd     )   ! mass flux from melt ponds
       CALL iom_put( 'vfxsub'    , wfx_ice_sub )   ! mass flux from ice sublimation (ice-atm.)
-      CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean      
-
-      IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations  
+      CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean
+
+      IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations
          WHERE( hm_i(:,:) < 0.2 .AND. hm_i(:,:) > 0. ) ; z2d = wfx_bog
          ELSEWHERE                                     ; z2d = 0._wp
@@ -237,7 +237,7 @@
       CALL iom_put( 'vfxsnw'     , wfx_snw     )   ! mass flux from total snow growth/melt
       CALL iom_put( 'vfxsnw_sum' , wfx_snw_sum )   ! mass flux from snow melt at the surface
-      CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation 
-      CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging) 
-      CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.) 
+      CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation
+      CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging)
+      CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.)
       CALL iom_put( 'vfxsnw_pre' , wfx_spr     )   ! snow precip
 
@@ -252,6 +252,6 @@
       IF( iom_use('qt_oce'     ) )   CALL iom_put( 'qt_oce'     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce )
       IF( iom_use('qt_ice'     ) )   CALL iom_put( 'qt_ice'     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice )
-      IF( iom_use('qt_oce_ai'  ) )   CALL iom_put( 'qt_oce_ai'  , qt_oce_ai * tmask(:,:,1)                                   )   ! total heat flux at the ocean   surface: interface oce-(ice+atm) 
-      IF( iom_use('qt_atm_oi'  ) )   CALL iom_put( 'qt_atm_oi'  , qt_atm_oi * tmask(:,:,1)                                   )   ! total heat flux at the oce-ice surface: interface atm-(ice+oce) 
+      IF( iom_use('qt_oce_ai'  ) )   CALL iom_put( 'qt_oce_ai'  , qt_oce_ai * tmask(:,:,1)                                   )   ! total heat flux at the ocean   surface: interface oce-(ice+atm)
+      IF( iom_use('qt_atm_oi'  ) )   CALL iom_put( 'qt_atm_oi'  , qt_atm_oi * tmask(:,:,1)                                   )   ! total heat flux at the oce-ice surface: interface atm-(ice+oce)
       IF( iom_use('qemp_oce'   ) )   CALL iom_put( 'qemp_oce'   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean
       IF( iom_use('qemp_ice'   ) )   CALL iom_put( 'qemp_ice'   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice
@@ -259,18 +259,18 @@
       ! heat fluxes from ice transformations
       !                            ! hfxdhc = hfxbog + hfxbom + hfxsum + hfxopw + hfxdif + hfxsnw - ( hfxthd + hfxdyn + hfxres + hfxsub + hfxspr )
-      CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth 
+      CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth
       CALL iom_put ('hfxbom'     , hfx_bom     )   ! heat flux used for ice bottom melt
       CALL iom_put ('hfxsum'     , hfx_sum     )   ! heat flux used for ice surface melt
       CALL iom_put ('hfxopw'     , hfx_opw     )   ! heat flux used for ice formation in open water
       CALL iom_put ('hfxdif'     , hfx_dif     )   ! heat flux used for ice temperature change
-      CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt 
+      CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt
       CALL iom_put ('hfxerr'     , hfx_err_dif )   ! heat flux error after heat diffusion
 
       ! heat fluxes associated with mass exchange (freeze/melt/precip...)
-      CALL iom_put ('hfxthd'     , hfx_thd     )   !  
-      CALL iom_put ('hfxdyn'     , hfx_dyn     )   !  
-      CALL iom_put ('hfxres'     , hfx_res     )   !  
-      CALL iom_put ('hfxsub'     , hfx_sub     )   !  
-      CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content 
+      CALL iom_put ('hfxthd'     , hfx_thd     )   !
+      CALL iom_put ('hfxdyn'     , hfx_dyn     )   !
+      CALL iom_put ('hfxres'     , hfx_res     )   !
+      CALL iom_put ('hfxsub'     , hfx_sub     )   !
+      CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content
 
       ! other heat fluxes
@@ -294,14 +294,14 @@
       !!-------------------------------------------------------------------
       !!                ***  ROUTINE ice_update_tau ***
-      !!  
+      !!
       !! ** Purpose : Update the ocean surface stresses due to the ice
-      !!         
+      !!
       !! ** Action  : * at each ice time step (every nn_fsbc time step):
-      !!                - compute the modulus of ice-ocean relative velocity 
+      !!                - compute the modulus of ice-ocean relative velocity
       !!                  (*rho*Cd) at T-point (C-grid) or I-point (B-grid)
       !!                      tmod_io = rhoco * | U_ice-U_oce |
       !!                - update the modulus of stress at ocean surface
       !!                      taum = (1-a) * taum + a * tmod_io * | U_ice-U_oce |
-      !!              * at each ocean time step (every kt): 
+      !!              * at each ocean time step (every kt):
       !!                  compute linearized ice-ocean stresses as
       !!                      Utau = tmod_io * | U_ice - pU_oce |
@@ -310,5 +310,5 @@
       !!    NB: - ice-ocean rotation angle no more allowed
       !!        - here we make an approximation: taum is only computed every ice time step
-      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids 
+      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids
       !!          to T grid. taum is used in TKE and GLS, which should not be too sensitive to this approximaton...
       !!
@@ -337,6 +337,6 @@
          DO_2D( 0, 0, 0, 0 )                          !* update the modulus of stress at ocean surface (T-point)
             !                                               ! 2*(U_ice-U_oce) at T-point
-            zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)   
-            zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1) 
+            zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)
+            zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1)
             !                                              ! |U_ice-U_oce|^2
             zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  )
@@ -354,6 +354,6 @@
       !                                      !==  every ocean time-step  ==!
       IF ( ln_drgice_imp ) THEN
-         ! Save drag with right sign to update top drag in the ocean implicit friction 
-         rCdU_ice(:,:) = -r1_rho0 * tmod_io(:,:) * at_i(:,:) * tmask(:,:,1) 
+         ! Save drag with right sign to update top drag in the ocean implicit friction
+         rCdU_ice(:,:) = -r1_rho0 * tmod_io(:,:) * at_i(:,:) * tmask(:,:,1)
          zflagi = 0._wp
       ELSE
@@ -362,5 +362,5 @@
       !
       DO_2D( 0, 0, 0, 0 )                             !* update the stress WITHOUT an ice-ocean rotation angle
-         ! ice area at u and v-points 
+         ! ice area at u and v-points
          zat_u  = ( at_i(ji,jj) * tmask(ji,jj,1) + at_i (ji+1,jj    ) * tmask(ji+1,jj  ,1) )  &
             &     / MAX( 1.0_wp , tmask(ji,jj,1) + tmask(ji+1,jj  ,1) )
@@ -377,5 +377,5 @@
       !
       IF( ln_timing )   CALL timing_stop('ice_update')
-      !  
+      !
    END SUBROUTINE ice_update_tau
 
@@ -384,5 +384,5 @@
       !!-------------------------------------------------------------------
       !!                  ***  ROUTINE ice_update_init  ***
-      !!             
+      !!
       !! ** Purpose :   allocate ice-ocean stress fields and read restarts
       !!                containing the snow & ice mass
@@ -408,5 +408,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE rhg_evp_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write RHG file in restart file
       !!
@@ -456,5 +456,5 @@
    !!   Default option         Dummy module           NO SI3 sea-ice model
    !!----------------------------------------------------------------------
-#endif 
+#endif
 
    !!======================================================================
Index: /NEMO/trunk/src/ICE/icevar.F90
===================================================================
--- /NEMO/trunk/src/ICE/icevar.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icevar.F90	(revision 14072)
@@ -34,5 +34,5 @@
    !!                        - st_i(jpi,jpj)
    !!                        - et_s(jpi,jpj)  total snow heat content
-   !!                        - et_i(jpi,jpj)  total ice thermal content 
+   !!                        - et_i(jpi,jpj)  total ice thermal content
    !!                        - sm_i(jpi,jpj)  mean ice salinity
    !!                        - tm_i(jpi,jpj)  mean ice temperature
@@ -55,5 +55,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants (ocean directory) 
+   USE phycst         ! physical constants (ocean directory)
    USE sbc_oce , ONLY : sss_m, ln_ice_embd, nn_fsbc
    USE ice            ! sea-ice: variables
@@ -67,14 +67,14 @@
    PRIVATE
 
-   PUBLIC   ice_var_agg          
-   PUBLIC   ice_var_glo2eqv      
-   PUBLIC   ice_var_eqv2glo      
-   PUBLIC   ice_var_salprof      
-   PUBLIC   ice_var_salprof1d    
+   PUBLIC   ice_var_agg
+   PUBLIC   ice_var_glo2eqv
+   PUBLIC   ice_var_eqv2glo
+   PUBLIC   ice_var_salprof
+   PUBLIC   ice_var_salprof1d
    PUBLIC   ice_var_zapsmall
    PUBLIC   ice_var_zapneg
    PUBLIC   ice_var_roundoff
-   PUBLIC   ice_var_bv           
-   PUBLIC   ice_var_enthalpy           
+   PUBLIC   ice_var_bv
+   PUBLIC   ice_var_enthalpy
    PUBLIC   ice_var_sshdyn
    PUBLIC   ice_var_itd
@@ -108,5 +108,5 @@
       !!                ***  ROUTINE ice_var_agg  ***
       !!
-      !! ** Purpose :   aggregates ice-thickness-category variables to 
+      !! ** Purpose :   aggregates ice-thickness-category variables to
       !!              all-ice variables, i.e. it turns VGLO into VAGG
       !!-------------------------------------------------------------------
@@ -130,5 +130,5 @@
       vt_il(:,:) = SUM( v_il(:,:,:), dim=3 )
       !
-      ato_i(:,:) = 1._wp - at_i(:,:)         ! open water fraction  
+      ato_i(:,:) = 1._wp - at_i(:,:)         ! open water fraction
       !
       !!GS: tm_su always needed by ABL over sea-ice
@@ -155,5 +155,5 @@
          hm_i(:,:) = vt_i(:,:) * z1_at_i(:,:)
          hm_s(:,:) = vt_s(:,:) * z1_at_i(:,:)
-         !         
+         !
          !                          ! mean temperature (K), salinity and age
          tm_si(:,:) = SUM( t_si(:,:,:) * a_i(:,:,:) , dim=3 ) * z1_at_i(:,:)
@@ -182,5 +182,5 @@
          WHERE( at_ip(:,:) > epsi20 )   ;   hm_ip(:,:) = vt_ip(:,:) / at_ip(:,:)   ;   hm_il(:,:) = vt_il(:,:) / at_ip(:,:)
          ELSEWHERE                      ;   hm_ip(:,:) = 0._wp                     ;   hm_il(:,:) = 0._wp
-         END WHERE         
+         END WHERE
          !
          DEALLOCATE( z1_vt_i , z1_vt_s )
@@ -197,5 +197,5 @@
       !!                ***  ROUTINE ice_var_glo2eqv ***
       !!
-      !! ** Purpose :   computes equivalent variables as function of  
+      !! ** Purpose :   computes equivalent variables as function of
       !!              global variables, i.e. it turns VGLO into VEQV
       !!-------------------------------------------------------------------
@@ -210,5 +210,5 @@
       !!-------------------------------------------------------------------
 
-!!gm Question 2:  It is possible to define existence of sea-ice in a common way between 
+!!gm Question 2:  It is possible to define existence of sea-ice in a common way between
 !!                ice area and ice volume ?
 !!                the idea is to be able to define one for all at the begining of this routine
@@ -234,15 +234,15 @@
 
       zhmax    =          hi_max(jpl)
-      z1_zhmax =  1._wp / hi_max(jpl)               
+      z1_zhmax =  1._wp / hi_max(jpl)
       WHERE( h_i(:,:,jpl) > zhmax )   ! bound h_i by hi_max (i.e. 99 m) with associated update of ice area
          h_i   (:,:,jpl) = zhmax
-         a_i   (:,:,jpl) = v_i(:,:,jpl) * z1_zhmax 
+         a_i   (:,:,jpl) = v_i(:,:,jpl) * z1_zhmax
          z1_a_i(:,:,jpl) = zhmax * z1_v_i(:,:,jpl)
       END WHERE
       !                                           !--- snow thickness
       h_s(:,:,:) = v_s (:,:,:) * z1_a_i(:,:,:)
-      !                                           !--- ice age      
+      !                                           !--- ice age
       o_i(:,:,:) = oa_i(:,:,:) * z1_a_i(:,:,:)
-      !                                           !--- pond and lid thickness      
+      !                                           !--- pond and lid thickness
       h_ip(:,:,:) = v_ip(:,:,:) * z1_a_ip(:,:,:)
       h_il(:,:,:) = v_il(:,:,:) * z1_a_ip(:,:,:)
@@ -258,5 +258,5 @@
       a_ip_eff = MIN( a_ip_eff, 1._wp - za_s_fra )   ! make sure (a_ip_eff + a_s_fra) <= 1
       !
-      !                                           !---  salinity (with a minimum value imposed everywhere)     
+      !                                           !---  salinity (with a minimum value imposed everywhere)
       IF( nn_icesal == 2 ) THEN
          WHERE( v_i(:,:,:) > epsi20 )   ;   s_i(:,:,:) = MAX( rn_simin , MIN( rn_simax, sv_i(:,:,:) * z1_v_i(:,:,:) ) )
@@ -272,5 +272,5 @@
       DO jl = 1, jpl
          DO_3D( 1, 1, 1, 1, 1, nlay_i )
-            IF ( v_i(ji,jj,jl) > epsi20 ) THEN     !--- icy area 
+            IF ( v_i(ji,jj,jl) > epsi20 ) THEN     !--- icy area
                !
                ze_i             =   e_i (ji,jj,jk,jl) * z1_v_i(ji,jj,jl) * zlay_i             ! Energy of melting e(S,T) [J.m-3]
@@ -300,5 +300,5 @@
       END DO
       !
-      ! integrated values 
+      ! integrated values
       vt_i (:,:) = SUM( v_i , dim=3 )
       vt_s (:,:) = SUM( v_s , dim=3 )
@@ -312,5 +312,5 @@
       !!                ***  ROUTINE ice_var_eqv2glo ***
       !!
-      !! ** Purpose :   computes global variables as function of 
+      !! ** Purpose :   computes global variables as function of
       !!              equivalent variables,  i.e. it turns VEQV into VGLO
       !!-------------------------------------------------------------------
@@ -329,7 +329,7 @@
       !!                ***  ROUTINE ice_var_salprof ***
       !!
-      !! ** Purpose :   computes salinity profile in function of bulk salinity     
-      !!
-      !! ** Method  : If bulk salinity greater than zsi1, 
+      !! ** Purpose :   computes salinity profile in function of bulk salinity
+      !!
+      !! ** Method  : If bulk salinity greater than zsi1,
       !!              the profile is assumed to be constant (S_inf)
       !!              If bulk salinity lower than zsi0,
@@ -348,5 +348,5 @@
       !!-------------------------------------------------------------------
 
-!!gm Question: Remove the option 3 ?  How many years since it last use ? 
+!!gm Question: Remove the option 3 ?  How many years since it last use ?
 
       SELECT CASE ( nn_icesal )
@@ -369,5 +369,5 @@
             END DO
          END DO
-         !                                      ! Slope of the linear profile 
+         !                                      ! Slope of the linear profile
          WHERE( h_i(:,:,:) > epsi20 )   ;   z_slope_s(:,:,:) = 2._wp * s_i(:,:,:) / h_i(:,:,:)
          ELSEWHERE                      ;   z_slope_s(:,:,:) = 0._wp
@@ -379,5 +379,5 @@
                zalpha(ji,jj,jl) = MAX(  0._wp , MIN( ( zsi1 - s_i(ji,jj,jl) ) * z1_dS , 1._wp )  )
                !                             ! force a constant profile when SSS too low (Baltic Sea)
-               IF( 2._wp * s_i(ji,jj,jl) >= sss_m(ji,jj) )   zalpha(ji,jj,jl) = 0._wp  
+               IF( 2._wp * s_i(ji,jj,jl) >= sss_m(ji,jj) )   zalpha(ji,jj,jl) = 0._wp
             END_2D
          END DO
@@ -448,9 +448,9 @@
          ALLOCATE( z_slope_s(jpij), zalpha(jpij) )
          !
-         !                                      ! Slope of the linear profile 
+         !                                      ! Slope of the linear profile
          WHERE( h_i_1d(1:npti) > epsi20 )   ;   z_slope_s(1:npti) = 2._wp * s_i_1d(1:npti) / h_i_1d(1:npti)
          ELSEWHERE                          ;   z_slope_s(1:npti) = 0._wp
          END WHERE
-         
+
          z1_dS = 1._wp / ( zsi1 - zsi0 )
          DO ji = 1, npti
@@ -557,5 +557,5 @@
          END_2D
          !
-      END DO 
+      END DO
 
       ! to be sure that at_i is the sum of a_i(jl)
@@ -648,5 +648,5 @@
          END_2D
          !
-      END DO 
+      END DO
       !
       WHERE( pato_i(:,:)   < 0._wp )   pato_i(:,:)   = 0._wp
@@ -693,5 +693,5 @@
       !
    END SUBROUTINE ice_var_roundoff
-   
+
 
    SUBROUTINE ice_var_bv
@@ -713,5 +713,5 @@
       DO jl = 1, jpl
          DO jk = 1, nlay_i
-            WHERE( t_i(:,:,jk,jl) < rt0 - epsi10 )   
+            WHERE( t_i(:,:,jk,jl) < rt0 - epsi10 )
                bv_i(:,:,jl) = bv_i(:,:,jl) - rTmlt * sz_i(:,:,jk,jl) * r1_nlay_i / ( t_i(:,:,jk,jl) - rt0 )
             END WHERE
@@ -727,6 +727,6 @@
    SUBROUTINE ice_var_enthalpy
       !!-------------------------------------------------------------------
-      !!                   ***  ROUTINE ice_var_enthalpy *** 
-      !!                 
+      !!                   ***  ROUTINE ice_var_enthalpy ***
+      !!
       !! ** Purpose :   Computes sea ice energy of melting q_i (J.m-3) from temperature
       !!
@@ -734,5 +734,5 @@
       !!-------------------------------------------------------------------
       INTEGER  ::   ji, jk   ! dummy loop indices
-      REAL(wp) ::   ztmelts  ! local scalar 
+      REAL(wp) ::   ztmelts  ! local scalar
       !!-------------------------------------------------------------------
       !
@@ -741,5 +741,5 @@
             ztmelts      = - rTmlt  * sz_i_1d(ji,jk)
             t_i_1d(ji,jk) = MIN( t_i_1d(ji,jk), ztmelts + rt0 ) ! Force t_i_1d to be lower than melting point => likely conservation issue
-                                                                !   (sometimes zdf scheme produces abnormally high temperatures)   
+                                                                !   (sometimes zdf scheme produces abnormally high temperatures)
             e_i_1d(ji,jk) = rhoi * ( rcpi  * ( ztmelts - ( t_i_1d(ji,jk) - rt0 ) )           &
                &                   + rLfus * ( 1._wp - ztmelts / ( t_i_1d(ji,jk) - rt0 ) )   &
@@ -755,9 +755,9 @@
    END SUBROUTINE ice_var_enthalpy
 
-   
+
    FUNCTION ice_var_sshdyn(pssh, psnwice_mass, psnwice_mass_b)
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE ice_var_sshdyn  ***
-      !!                     
+      !!
       !! ** Purpose :  compute the equivalent ssh in lead when sea ice is embedded
       !!
@@ -765,5 +765,5 @@
       !!
       !! ** Reference : Jean-Michel Campin, John Marshall, David Ferreira,
-      !!                Sea ice-ocean coupling using a rescaled vertical coordinate z*, 
+      !!                Sea ice-ocean coupling using a rescaled vertical coordinate z*,
       !!                Ocean Modelling, Volume 24, Issues 1-2, 2008
       !!----------------------------------------------------------------------
@@ -783,5 +783,5 @@
       ! compute ice load used to define the equivalent ssh in lead
       IF( ln_ice_embd ) THEN
-         !                                            
+         !
          ! average interpolation coeff as used in dynspg = (1/nn_fsbc)   * {SUM[n/nn_fsbc], n=0,nn_fsbc-1}
          !                                               = (1/nn_fsbc)^2 * {SUM[n]        , n=0,nn_fsbc-1}
@@ -802,5 +802,5 @@
    END FUNCTION ice_var_sshdyn
 
-   
+
    !!-------------------------------------------------------------------
    !!                ***  INTERFACE ice_var_itd   ***
@@ -831,5 +831,5 @@
       ph_ip(:) = phtip(:)
       ph_il(:) = phtil(:)
-      
+
    END SUBROUTINE ice_var_itd_1c1c
 
@@ -846,5 +846,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:) ::   z1_ai, z1_vi, z1_vs
       !
-      INTEGER ::   idim  
+      INTEGER ::   idim
       !!-------------------------------------------------------------------
       !
@@ -888,5 +888,5 @@
       !
    END SUBROUTINE ice_var_itd_Nc1c
-   
+
    SUBROUTINE ice_var_itd_1cMc( phti, phts, pati ,                             ph_i, ph_s, pa_i, &
       &                         ptmi, ptms, ptmsu, psmi, patip, phtip, phtil,  pt_i, pt_s, pt_su, ps_i, pa_ip, ph_ip, ph_il )
@@ -898,5 +898,5 @@
       !! ** Method:   ice thickness distribution follows a gamma function from Abraham et al. (2015)
       !!              it has the property of conserving total concentration and volume
-      !!              
+      !!
       !!
       !! ** Arguments : phti: 1-cat ice thickness
@@ -904,9 +904,9 @@
       !!                pati: 1-cat ice concentration
       !!
-      !! ** Output    : jpl-cat 
+      !! ** Output    : jpl-cat
       !!
       !!  Abraham, C., Steiner, N., Monahan, A. and Michel, C., 2015.
       !!               Effects of subgrid‐scale snow thickness variability on radiative transfer in sea ice.
-      !!               Journal of Geophysical Research: Oceans, 120(8), pp.5597-5614 
+      !!               Journal of Geophysical Research: Oceans, 120(8), pp.5597-5614
       !!-------------------------------------------------------------------
       REAL(wp), DIMENSION(:),   INTENT(in)    ::   phti, phts, pati    ! input  ice/snow variables
@@ -987,5 +987,5 @@
                ! In case snow load is in excess that would lead to transformation from snow to ice
                ! Then, transfer the snow excess into the ice (different from icethd_dh)
-               zdh = MAX( 0._wp, ( rhos * ph_s(ji,jl) + ( rhoi - rho0 ) * ph_i(ji,jl) ) * r1_rho0 ) 
+               zdh = MAX( 0._wp, ( rhos * ph_s(ji,jl) + ( rhoi - rho0 ) * ph_i(ji,jl) ) * r1_rho0 )
                ! recompute h_i, h_s avoiding out of bounds values
                ph_i(ji,jl) = MIN( hi_max(jl), ph_i(ji,jl) + zdh )
@@ -1047,12 +1047,12 @@
       !!
       !! ** Method:   Iterative procedure
-      !!                
+      !!
       !!               1) Fill ice cat that correspond to input thicknesses
       !!                  Find the lowest(jlmin) and highest(jlmax) cat that are filled
       !!
       !!               2) Expand the filling to the cat jlmin-1 and jlmax+1
-      !!                   by removing 25% ice area from jlmin and jlmax (resp.) 
-      !!              
-      !!               3) Expand the filling to the empty cat between jlmin and jlmax 
+      !!                   by removing 25% ice area from jlmin and jlmax (resp.)
+      !!
+      !!               3) Expand the filling to the empty cat between jlmin and jlmax
       !!                   by a) removing 25% ice area from the lower cat (ascendant loop jlmin=>jlmax)
       !!                      b) removing 25% ice area from the higher cat (descendant loop jlmax=>jlmin)
@@ -1062,7 +1062,7 @@
       !!                pati: N-cat ice concentration
       !!
-      !! ** Output    : jpl-cat 
-      !!
-      !!  (Example of application: BDY forcings when inputs have N-cat /= jpl)  
+      !! ** Output    : jpl-cat
+      !!
+      !!  (Example of application: BDY forcings when inputs have N-cat /= jpl)
       !!-------------------------------------------------------------------
       REAL(wp), DIMENSION(:,:), INTENT(in)    ::   phti, phts, pati    ! input  ice/snow variables
@@ -1077,5 +1077,5 @@
       REAL(wp), PARAMETER ::   ztrans = 0.25_wp
       INTEGER  ::   ji, jl, jl1, jl2
-      INTEGER  ::   idim, icat  
+      INTEGER  ::   idim, icat
       !!-------------------------------------------------------------------
       !
@@ -1116,5 +1116,5 @@
       ELSE                              ! input cat /= output cat !
          !                              ! ----------------------- !
-         
+
          ALLOCATE( jlfil(idim,jpl), jlfil2(idim,jpl) )       ! allocate arrays
          ALLOCATE( jlmin(idim), jlmax(idim) )
@@ -1126,5 +1126,5 @@
          !
          ! --- fill the categories --- !
-         !     find where cat-input = cat-output and fill cat-output fields  
+         !     find where cat-input = cat-output and fill cat-output fields
          jlmax(:) = 0
          jlmin(:) = 999
@@ -1147,5 +1147,5 @@
          END DO
          !
-         ! --- fill the gaps between categories --- !  
+         ! --- fill the gaps between categories --- !
          !     transfer from categories filled at the previous step to the empty ones in between
          DO ji = 1, idim
@@ -1168,5 +1168,5 @@
          END DO
          !
-         jlfil2(:,:) = jlfil(:,:) 
+         jlfil2(:,:) = jlfil(:,:)
          ! fill categories from low to high
          DO jl = 2, jpl-1
@@ -1189,5 +1189,5 @@
                   ! fill low
                   pa_i(ji,jl) = pa_i(ji,jl) + ztrans * pa_i(ji,jl+1)
-                  ph_i(ji,jl) = hi_mean(jl) 
+                  ph_i(ji,jl) = hi_mean(jl)
                   jlfil2(ji,jl) = jl
                   ! remove high
@@ -1279,7 +1279,7 @@
    !!               we argue that snow does not cover the whole ice because
    !!               of wind blowing...
-   !!                
+   !!
    !! ** Arguments : ph_s: snow thickness
-   !!                
+   !!
    !! ** Output    : pa_s_fra: fraction of ice covered by snow
    !!
@@ -1326,5 +1326,5 @@
       ENDIF
    END SUBROUTINE ice_var_snwfra_1d
-   
+
    !!--------------------------------------------------------------------------
    !! INTERFACE ice_var_snwblow
@@ -1336,8 +1336,8 @@
    !!                If snow fall was uniform, a fraction (1-at_i) would fall into leads
    !!                but because of the winds, more snow falls on leads than on sea ice
-   !!                and a greater fraction (1-at_i)^beta of the total mass of snow 
+   !!                and a greater fraction (1-at_i)^beta of the total mass of snow
    !!                (beta < 1) falls in leads.
-   !!                In reality, beta depends on wind speed, 
-   !!                and should decrease with increasing wind speed but here, it is 
+   !!                In reality, beta depends on wind speed,
+   !!                and should decrease with increasing wind speed but here, it is
    !!                considered as a constant. an average value is 0.66
    !!--------------------------------------------------------------------------
Index: /NEMO/trunk/src/ICE/icewri.F90
===================================================================
--- /NEMO/trunk/src/ICE/icewri.F90	(revision 14071)
+++ /NEMO/trunk/src/ICE/icewri.F90	(revision 14072)
@@ -10,5 +10,5 @@
    !!   'key_si3'                                       SI3 sea-ice model
    !!----------------------------------------------------------------------
-   !!   ice_wri       : write of the diagnostics variables in ouput file 
+   !!   ice_wri       : write of the diagnostics variables in ouput file
    !!   ice_wri_state : write for initial state or/and abandon
    !!----------------------------------------------------------------------
@@ -33,5 +33,5 @@
 
    PUBLIC ice_wri        ! called by ice_stp
-   PUBLIC ice_wri_state  ! called by dia_wri_state 
+   PUBLIC ice_wri_state  ! called by dia_wri_state
 
    !! * Substitutions
@@ -52,5 +52,5 @@
       INTEGER  ::   ji, jj, jk, jl  ! dummy loop indices
       REAL(wp) ::   z2da, z2db, zrho1, zrho2
-      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios 
+      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios
       REAL(wp), DIMENSION(jpi,jpj)     ::   z2d, zfast                     ! 2D workspace
       REAL(wp), DIMENSION(jpi,jpj)     ::   zmsk00, zmsk05, zmsk15, zmsksn ! O%, 5% and 15% concentration mask and snow mask
@@ -59,5 +59,5 @@
       ! Global ice diagnostics (SIMIP)
       REAL(wp) ::   zdiag_area_nh, zdiag_extt_nh, zdiag_volu_nh   ! area, extent, volume
-      REAL(wp) ::   zdiag_area_sh, zdiag_extt_sh, zdiag_volu_sh 
+      REAL(wp) ::   zdiag_area_sh, zdiag_extt_sh, zdiag_volu_sh
       !!-------------------------------------------------------------------
       !
@@ -92,8 +92,8 @@
       CALL iom_put( 'icemask05', zmsk05 )   ! ice mask 5%
       CALL iom_put( 'icemask15', zmsk15 )   ! ice mask 15%
-      CALL iom_put( 'icepres'  , zmsk00 )   ! Ice presence (1 or 0) 
+      CALL iom_put( 'icepres'  , zmsk00 )   ! Ice presence (1 or 0)
       !
       ! general fields
-      IF( iom_use('icemass' ) )   CALL iom_put( 'icemass', vt_i * rhoi * zmsk00 )                                           ! Ice mass per cell area 
+      IF( iom_use('icemass' ) )   CALL iom_put( 'icemass', vt_i * rhoi * zmsk00 )                                           ! Ice mass per cell area
       IF( iom_use('snwmass' ) )   CALL iom_put( 'snwmass', vt_s * rhos * zmsksn )                                           ! Snow mass per cell area
       IF( iom_use('iceconc' ) )   CALL iom_put( 'iceconc', at_i        * zmsk00 )                                           ! ice concentration
@@ -106,5 +106,5 @@
       IF( iom_use('snwvolu' ) )   CALL iom_put( 'snwvolu', vt_s        * zmsksn )                                           ! snow volume
       IF( iom_use('icefrb'  ) ) THEN                                                                                        ! Ice freeboard
-         z2d(:,:) = ( zrho1 * hm_i(:,:) - zrho2 * hm_s(:,:) )                                         
+         z2d(:,:) = ( zrho1 * hm_i(:,:) - zrho2 * hm_s(:,:) )
          WHERE( z2d < 0._wp )   z2d = 0._wp
                                   CALL iom_put( 'icefrb' , z2d * zmsk00         )
@@ -186,5 +186,5 @@
       IF( iom_use('dmsmel') )   CALL iom_put( 'dmsmel', - wfx_snw_sum                                                         ) ! Snow mass change through melt
       IF( iom_use('dmsdyn') )   CALL iom_put( 'dmsdyn', - wfx_snw_dyn + rhos * diag_trp_vs                                    ) ! Snow mass change through dynamics(kg/m2/s)
-      
+
       ! Global ice diagnostics
       IF(  iom_use('NH_icearea') .OR. iom_use('NH_icevolu') .OR. iom_use('NH_iceextt') .OR. &
@@ -221,10 +221,10 @@
    END SUBROUTINE ice_wri
 
- 
+
    SUBROUTINE ice_wri_state( kid )
       !!---------------------------------------------------------------------
       !!                 ***  ROUTINE ice_wri_state  ***
-      !!        
-      !! ** Purpose :   create a NetCDF file named cdfile_name which contains 
+      !!
+      !! ** Purpose :   create a NetCDF file named cdfile_name which contains
       !!      the instantaneous ice state and forcing fields for ice model
       !!        Used to find errors in the initial state or save the last
@@ -233,5 +233,5 @@
       !! History :   4.0  !  2013-06  (C. Rousset)
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kid 
+      INTEGER, INTENT( in ) ::   kid
       !!----------------------------------------------------------------------
       !
Index: /NEMO/trunk/src/OCE/ASM/asminc.F90
===================================================================
--- /NEMO/trunk/src/OCE/ASM/asminc.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ASM/asminc.F90	(revision 14072)
@@ -9,5 +9,5 @@
    !!                 ! 2007-04  (A. Weaver)  Merge with OPAVAR/NEMOVAR
    !!   NEMO     3.3  ! 2010-05  (D. Lea)  Update to work with NEMO v3.2
-   !!             -   ! 2010-05  (D. Lea)  add calc_month_len routine based on day_init 
+   !!             -   ! 2010-05  (D. Lea)  add calc_month_len routine based on day_init
    !!            3.4  ! 2012-10  (A. Weaver and K. Mogensen) Fix for direct initialization
    !!                 ! 2014-09  (D. Lea)  Local calc_date removed use routine from OBS
@@ -32,5 +32,5 @@
    USE zpshde          ! Partial step : Horizontal Derivative
    USE asmpar          ! Parameters for the assmilation interface
-   USE asmbkg          ! 
+   USE asmbkg          !
    USE c1d             ! 1D initialization
    USE sbc_oce         ! Surface boundary condition variables.
@@ -46,5 +46,5 @@
    IMPLICIT NONE
    PRIVATE
-   
+
    PUBLIC   asm_inc_init   !: Initialize the increment arrays and IAU weights
    PUBLIC   tra_asm_inc    !: Apply the tracer (T and S) increments
@@ -73,5 +73,5 @@
    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkg   , v_bkg      !: Background u- & v- velocity components
    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkginc, s_bkginc   !: Increment to the background T & S
-   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkginc, v_bkginc   !: Increment to the u- & v-components 
+   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkginc, v_bkginc   !: Increment to the u- & v-components
    REAL(wp), PUBLIC, DIMENSION(:)    , ALLOCATABLE ::   wgtiau               !: IAU weights for each time step
 #if defined key_asminc
@@ -81,9 +81,9 @@
    INTEGER , PUBLIC ::   nitbkg      !: Time step of the background state used in the Jb term
    INTEGER , PUBLIC ::   nitdin      !: Time step of the background state for direct initialization
-   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval 
+   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval
    INTEGER , PUBLIC ::   nitiaufin   !: Time step of the end of the IAU interval
-   ! 
+   !
    INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting
-   !                                 !: = 1   Linear hat-like, centred in middle of IAU interval 
+   !                                 !: = 1   Linear hat-like, centred in middle of IAU interval
    REAL(wp), PUBLIC ::   salfixmin   !: Ensure that the salinity is larger than this  value if (ln_salfix)
 
@@ -107,10 +107,10 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE asm_inc_init  ***
-      !!          
+      !!
       !! ** Purpose : Initialize the assimilation increment and IAU weights.
       !!
       !! ** Method  : Initialize the assimilation increment and IAU weights.
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::  Kbb, Kmm, Krhs  ! time level indices
@@ -264,5 +264,5 @@
          !
          !                                !---------------------------------------------------------
-         IF( niaufn == 0 ) THEN           ! Constant IAU forcing 
+         IF( niaufn == 0 ) THEN           ! Constant IAU forcing
             !                             !---------------------------------------------------------
             DO jt = 1, iiauper
@@ -270,10 +270,10 @@
             END DO
             !                             !---------------------------------------------------------
-         ELSEIF ( niaufn == 1 ) THEN      ! Linear hat-like, centred in middle of IAU interval 
+         ELSEIF ( niaufn == 1 ) THEN      ! Linear hat-like, centred in middle of IAU interval
             !                             !---------------------------------------------------------
             ! Compute the normalization factor
             znorm = 0._wp
             IF( MOD( iiauper, 2 ) == 0 ) THEN   ! Even number of time steps in IAU interval
-               imid = iiauper / 2 
+               imid = iiauper / 2
                DO jt = 1, imid
                   znorm = znorm + REAL( jt )
@@ -281,5 +281,5 @@
                znorm = 2.0 * znorm
             ELSE                                ! Odd number of time steps in IAU interval
-               imid = ( iiauper + 1 ) / 2        
+               imid = ( iiauper + 1 ) / 2
                DO jt = 1, imid - 1
                   znorm = znorm + REAL( jt )
@@ -308,11 +308,11 @@
              DO jt = 1, icycper
                 ztotwgt = ztotwgt + wgtiau(jt)
-                WRITE(numout,*) '         ', jt, '       ', wgtiau(jt) 
-             END DO   
+                WRITE(numout,*) '         ', jt, '       ', wgtiau(jt)
+             END DO
              WRITE(numout,*) '         ==================================='
              WRITE(numout,*) '         Time-integrated weight = ', ztotwgt
              WRITE(numout,*) '         ==================================='
           ENDIF
-         
+
       ENDIF
 
@@ -339,5 +339,5 @@
          CALL iom_open( c_asminc, inum )
          !
-         CALL iom_get( inum, 'time'       , zdate_inc   ) 
+         CALL iom_get( inum, 'time'       , zdate_inc   )
          CALL iom_get( inum, 'z_inc_dateb', z_inc_dateb )
          CALL iom_get( inum, 'z_inc_datef', z_inc_datef )
@@ -346,5 +346,5 @@
          !
          IF(lwp) THEN
-            WRITE(numout,*) 
+            WRITE(numout,*)
             WRITE(numout,*) 'asm_inc_init : Assimilation increments valid between dates ', z_inc_dateb,' and ', z_inc_datef
             WRITE(numout,*) '~~~~~~~~~~~~'
@@ -360,5 +360,5 @@
             &                ' not agree with Direct Initialization time' )
 
-         IF ( ln_trainc ) THEN   
+         IF ( ln_trainc ) THEN
             CALL iom_get( inum, jpdom_auto, 'bckint', t_bkginc, 1 )
             CALL iom_get( inum, jpdom_auto, 'bckins', s_bkginc, 1 )
@@ -372,7 +372,7 @@
          ENDIF
 
-         IF ( ln_dyninc ) THEN   
-            CALL iom_get( inum, jpdom_auto, 'bckinu', u_bkginc, 1 )              
-            CALL iom_get( inum, jpdom_auto, 'bckinv', v_bkginc, 1 )              
+         IF ( ln_dyninc ) THEN
+            CALL iom_get( inum, jpdom_auto, 'bckinu', u_bkginc, 1 )
+            CALL iom_get( inum, jpdom_auto, 'bckinv', v_bkginc, 1 )
             ! Apply the masks
             u_bkginc(:,:,:) = u_bkginc(:,:,:) * umask(:,:,:)
@@ -383,5 +383,5 @@
             WHERE( ABS( v_bkginc(:,:,:) ) > 1.0e+10 ) v_bkginc(:,:,:) = 0.0
          ENDIF
-        
+
          IF ( ln_sshinc ) THEN
             CALL iom_get( inum, jpdom_auto, 'bckineta', ssh_bkginc, 1 )
@@ -409,5 +409,5 @@
       IF ( ln_dyninc .AND. nn_divdmp > 0 ) THEN    ! Apply divergence damping filter
          !                                         !--------------------------------------
-         ALLOCATE( zhdiv(jpi,jpj) ) 
+         ALLOCATE( zhdiv(jpi,jpj) )
          !
          DO jt = 1, nn_divdmp
@@ -428,5 +428,5 @@
                      &               + 0.2_wp * ( zhdiv(ji+1,jj) - zhdiv(ji  ,jj) ) * r1_e1u(ji,jj) * umask(ji,jj,jk)
                   v_bkginc(ji,jj,jk) = v_bkginc(ji,jj,jk)                         &
-                     &               + 0.2_wp * ( zhdiv(ji,jj+1) - zhdiv(ji,jj  ) ) * r1_e2v(ji,jj) * vmask(ji,jj,jk) 
+                     &               + 0.2_wp * ( zhdiv(ji,jj+1) - zhdiv(ji,jj  ) ) * r1_e2v(ji,jj) * vmask(ji,jj,jk)
                END_2D
             END DO
@@ -434,5 +434,5 @@
          END DO
          !
-         DEALLOCATE( zhdiv ) 
+         DEALLOCATE( zhdiv )
          !
       ENDIF
@@ -455,8 +455,8 @@
          CALL iom_open( c_asmdin, inum )
          !
-         CALL iom_get( inum, 'rdastp', zdate_bkg ) 
+         CALL iom_get( inum, 'rdastp', zdate_bkg )
          !
          IF(lwp) THEN
-            WRITE(numout,*) 
+            WRITE(numout,*)
             WRITE(numout,*) '   ==>>>  Assimilation background state valid at : ', zdate_bkg
             WRITE(numout,*)
@@ -467,5 +467,5 @@
             &                ' not agree with Direct Initialization time' )
          !
-         IF ( ln_trainc ) THEN   
+         IF ( ln_trainc ) THEN
             CALL iom_get( inum, jpdom_auto, 'tn', t_bkg )
             CALL iom_get( inum, jpdom_auto, 'sn', s_bkg )
@@ -474,5 +474,5 @@
          ENDIF
          !
-         IF ( ln_dyninc ) THEN   
+         IF ( ln_dyninc ) THEN
             CALL iom_get( inum, jpdom_auto, 'un', u_bkg, cd_type = 'U', psgn = 1._wp )
             CALL iom_get( inum, jpdom_auto, 'vn', v_bkg, cd_type = 'V', psgn = 1._wp )
@@ -502,15 +502,15 @@
       !
    END SUBROUTINE asm_inc_init
-   
-   
+
+
    SUBROUTINE tra_asm_inc( kt, Kbb, Kmm, pts, Krhs )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE tra_asm_inc  ***
-      !!          
+      !!
       !! ** Purpose : Apply the tracer (T and S) assimilation increments
       !!
       !! ** Method  : Direct initialization or Incremental Analysis Updating
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!----------------------------------------------------------------------
       INTEGER                                  , INTENT(in   ) :: kt             ! Current time step
@@ -524,6 +524,6 @@
       !!----------------------------------------------------------------------
       !
-      ! freezing point calculation taken from oc_fz_pt (but calculated for all depths) 
-      ! used to prevent the applied increments taking the temperature below the local freezing point 
+      ! freezing point calculation taken from oc_fz_pt (but calculated for all depths)
+      ! used to prevent the applied increments taking the temperature below the local freezing point
       IF( ln_temnofreeze ) THEN
          DO jk = 1, jpkm1
@@ -587,5 +587,5 @@
       ELSEIF ( ln_asmdin ) THEN        ! Direct Initialization
          !                             !--------------------------------------
-         !            
+         !
          IF ( kt == nitdin_r ) THEN
             !
@@ -647,5 +647,5 @@
          !
          ENDIF
-         !  
+         !
       ENDIF
       ! Perhaps the following call should be in step
@@ -658,10 +658,10 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE dyn_asm_inc  ***
-      !!          
+      !!
       !! ** Purpose : Apply the dynamics (u and v) assimilation increments.
       !!
       !! ** Method  : Direct initialization or Incremental Analysis Updating.
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!----------------------------------------------------------------------
       INTEGER                             , INTENT( in )  ::  kt             ! ocean time-step index
@@ -684,5 +684,5 @@
             !
             IF(lwp) THEN
-               WRITE(numout,*) 
+               WRITE(numout,*)
                WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
                WRITE(numout,*) '~~~~~~~~~~~~'
@@ -704,5 +704,5 @@
       ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization
          !                          !-----------------------------------------
-         !         
+         !
          IF ( kt == nitdin_r ) THEN
             !
@@ -711,5 +711,5 @@
             ! Initialize the now fields with the background + increment
             puu(:,:,:,Kmm) = u_bkg(:,:,:) + u_bkginc(:,:,:)
-            pvv(:,:,:,Kmm) = v_bkg(:,:,:) + v_bkginc(:,:,:)  
+            pvv(:,:,:,Kmm) = v_bkg(:,:,:) + v_bkginc(:,:,:)
             !
             puu(:,:,:,Kbb) = puu(:,:,:,Kmm)         ! Update before fields
@@ -730,10 +730,10 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE ssh_asm_inc  ***
-      !!          
+      !!
       !! ** Purpose : Apply the sea surface height assimilation increment.
       !!
       !! ** Method  : Direct initialization or Incremental Analysis Updating.
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!----------------------------------------------------------------------
       INTEGER, INTENT(IN) :: kt         ! Current time step
@@ -755,5 +755,5 @@
             !
             IF(lwp) THEN
-               WRITE(numout,*) 
+               WRITE(numout,*)
                WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
                   &  kt,' with IAU weight = ', wgtiau(it)
@@ -807,5 +807,5 @@
       !!                  ***  ROUTINE ssh_asm_div  ***
       !!
-      !! ** Purpose :   ssh increment with z* is incorporated via a correction of the local divergence          
+      !! ** Purpose :   ssh increment with z* is incorporated via a correction of the local divergence
       !!                across all the water column
       !!
@@ -823,15 +823,15 @@
       REAL(wp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array
       !!----------------------------------------------------------------------
-      ! 
+      !
 #if defined key_asminc
       CALL ssh_asm_inc( kt, Kbb, Kmm ) !==   (calculate increments)
       !
-      IF( ln_linssh ) THEN 
+      IF( ln_linssh ) THEN
          phdivn(:,:,1) = phdivn(:,:,1) - ssh_iau(:,:) / e3t(:,:,1,Kmm) * tmask(:,:,1)
-      ELSE 
+      ELSE
          ALLOCATE( ztim(jpi,jpj) )
          ztim(:,:) = ssh_iau(:,:) / ( ht(:,:) + 1.0 - ssmask(:,:) )
-         DO jk = 1, jpkm1                                 
-            phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk) 
+         DO jk = 1, jpkm1
+            phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk)
          END DO
          !
@@ -846,10 +846,10 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE seaice_asm_inc  ***
-      !!          
+      !!
       !! ** Purpose : Apply the sea ice assimilation increment.
       !!
       !! ** Method  : Direct initialization or Incremental Analysis Updating.
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!
       !!----------------------------------------------------------------------
@@ -873,5 +873,5 @@
             !
             it = kt - nit000 + 1
-            zincwgt = wgtiau(it)      ! IAU weight for the current time step 
+            zincwgt = wgtiau(it)      ! IAU weight for the current time step
             ! note this is not a tendency so should not be divided by rn_Dt (as with the tracer and other increments)
             !
@@ -997,5 +997,5 @@
 !#if defined defined key_si3 || defined key_cice
 !
-!            IF (ln_seaicebal ) THEN       
+!            IF (ln_seaicebal ) THEN
 !             !! balancing salinity increments
 !             !! simple case from limflx.F90 (doesn't include a mass flux)
@@ -1009,5 +1009,5 @@
 !
 !             DO jj = 1, jpj
-!               DO ji = 1, jpi 
+!               DO ji = 1, jpi
 !           ! calculate change in ice and snow mass per unit area
 !           ! positive values imply adding salt to the ocean (results from ice formation)
@@ -1020,8 +1020,8 @@
 !
 !           ! prevent small mld
-!           ! less than 10m can cause salinity instability 
+!           ! less than 10m can cause salinity instability
 !                 IF (mld < 10) mld=10
 !
-!           ! set to bottom of a level 
+!           ! set to bottom of a level
 !                 DO jk = jpk-1, 2, -1
 !                   IF ((mld > gdepw(ji,jj,jk,Kmm)) .and. (mld < gdepw(ji,jj,jk+1,Kmm))) THEN
@@ -1032,5 +1032,5 @@
 !
 !            ! avoid applying salinity balancing in shallow water or on land
-!            ! 
+!            !
 !
 !            ! dsal_ocn (psu kg m^-2) / (kg m^-3 * m)
@@ -1043,9 +1043,9 @@
 !
 !           ! put increments in for levels in the mixed layer
-!           ! but prevent salinity below a threshold value 
-!
-!                   DO jk = 1, jkmax              
-!
-!                     IF (dsal_ocn > 0.0_wp .or. sb(ji,jj,jk)+dsal_ocn > sal_thresh) THEN 
+!           ! but prevent salinity below a threshold value
+!
+!                   DO jk = 1, jkmax
+!
+!                     IF (dsal_ocn > 0.0_wp .or. sb(ji,jj,jk)+dsal_ocn > sal_thresh) THEN
 !                           sb(ji,jj,jk) = sb(ji,jj,jk) + dsal_ocn
 !                           sn(ji,jj,jk) = sn(ji,jj,jk) + dsal_ocn
@@ -1058,7 +1058,7 @@
 !      !
 !      !! Adjust fsalt. A +ve fsalt means adding salt to ocean
-!      !!           fsalt(ji,jj) =  fsalt(ji,jj) + zpmess     ! adjust fsalt  
-!      !!               
-!      !!           emps(ji,jj) = emps(ji,jj) + zpmess        ! or adjust emps (see icestp1d) 
+!      !!           fsalt(ji,jj) =  fsalt(ji,jj) + zpmess     ! adjust fsalt
+!      !!
+!      !!           emps(ji,jj) = emps(ji,jj) + zpmess        ! or adjust emps (see icestp1d)
 !      !!                                                     ! E-P (kg m-2 s-2)
 !      !            emp(ji,jj) = emp(ji,jj) + zpmess          ! E-P (kg m-2 s-2)
@@ -1073,5 +1073,5 @@
       !
    END SUBROUTINE seaice_asm_inc
-   
+
    !!======================================================================
 END MODULE asminc
Index: /NEMO/trunk/src/OCE/BDY/bdytra.F90
===================================================================
--- /NEMO/trunk/src/OCE/BDY/bdytra.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/BDY/bdytra.F90	(revision 14072)
@@ -30,10 +30,10 @@
    END TYPE
 
-   PUBLIC   bdy_tra      ! called in tranxt.F90 
-   PUBLIC   bdy_tra_dmp  ! called in step.F90 
+   PUBLIC   bdy_tra      ! called in tranxt.F90
+   PUBLIC   bdy_tra_dmp  ! called in step.F90
 
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -56,5 +56,5 @@
       LOGICAL, DIMENSION(4)          :: llsend1, llrecv1       ! indicate how communications are to be carried out
       !!----------------------------------------------------------------------
-      igrd = 1 
+      igrd = 1
       llsend1(:) = .false.  ;   llrecv1(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
@@ -83,5 +83,5 @@
                CASE DEFAULT           ;   CALL ctl_stop( 'bdy_tra : unrecognised option for open boundaries for T and S' )
                END SELECT
-               ! 
+               !
             END DO
          END DO
@@ -111,9 +111,9 @@
       !!----------------------------------------------------------------------
       !!                 ***  SUBROUTINE bdy_rnf  ***
-      !!                    
+      !!
       !! ** Purpose : Specialized routine to apply TRA runoff values at OBs:
       !!                  - duplicate the neighbour value for the temperature
       !!                  - specified to 0.1 PSU for the salinity
-      !! 
+      !!
       !!----------------------------------------------------------------------
       TYPE(OBC_INDEX),                     INTENT(in) ::   idx      ! OBC indices
@@ -143,7 +143,7 @@
       !!----------------------------------------------------------------------
       !!                 ***  SUBROUTINE bdy_tra_dmp  ***
-      !!                    
+      !!
       !! ** Purpose : Apply damping for tracers at open boundaries.
-      !! 
+      !!
       !!----------------------------------------------------------------------
       INTEGER                                  , INTENT(in)    :: kt        ! time step
@@ -181,5 +181,5 @@
       !
    END SUBROUTINE bdy_tra_dmp
- 
+
    !!======================================================================
 END MODULE bdytra
Index: /NEMO/trunk/src/OCE/C1D/step_c1d.F90
===================================================================
--- /NEMO/trunk/src/OCE/C1D/step_c1d.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/C1D/step_c1d.F90	(revision 14072)
@@ -11,8 +11,8 @@
    !!----------------------------------------------------------------------
    !!   'key_c1d'                                       1D Configuration
-   !!----------------------------------------------------------------------  
+   !!----------------------------------------------------------------------
    !!   stp_c1d        : NEMO system time-stepping in c1d case
    !!----------------------------------------------------------------------
-   USE step_oce        ! time stepping definition modules 
+   USE step_oce        ! time stepping definition modules
    USE step, ONLY : Nbb, Nnn, Naa, Nrhs ! time level indices
 #if defined key_top
@@ -22,5 +22,5 @@
    USE dynatf          ! time filtering                   (dyn_atf routine)
    USE dyndmp          ! U & V momentum damping           (dyn_dmp routine)
-   USE restart         ! restart 
+   USE restart         ! restart
 
    IMPLICIT NONE
@@ -39,13 +39,13 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE stp_c1d  ***
-      !!                      
+      !!
       !! ** Purpose :  - Time stepping of SBC including sea ice (dynamic and thermodynamic eqs.)
       !!               - Time stepping of OPA (momentum and active tracer eqs.)
       !!               - Time stepping of TOP (passive tracer eqs.)
-      !! 
-      !! ** Method  : -1- Update forcings and data  
-      !!              -2- Update vertical ocean physics 
-      !!              -3- Compute the t and s trends 
-      !!              -4- Update t and s 
+      !!
+      !! ** Method  : -1- Update forcings and data
+      !!              -2- Update vertical ocean physics
+      !!              -3- Compute the t and s trends
+      !!              -4- Update t and s
       !!              -5- Compute the momentum trends
       !!              -6- Update the horizontal velocity
@@ -67,5 +67,5 @@
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Ocean physics update        
+      ! Ocean physics update
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL eos_rab( ts(:,:,:,:,Nbb), rab_b, Nnn )  ! before local thermal/haline expension ratio at T-points
@@ -73,14 +73,14 @@
                          CALL bn2( ts(:,:,:,:,Nbb), rab_b, rn2b, Nnn ) ! before Brunt-Vaisala frequency
                          CALL bn2( ts(:,:,:,:,Nnn), rab_n, rn2 , Nnn ) ! now    Brunt-Vaisala frequency
-      
+
       !  VERTICAL PHYSICS
                          CALL zdf_phy( kstp, Nbb, Nnn, Nrhs  )    ! vertical physics update (bfr, avt, avs, avm + MLD)
 
       IF(.NOT.ln_linssh )   CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )  ! after ssh (includes call to div_hor)
-      IF(.NOT.ln_linssh )   CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )  ! after vertical scale factors 
+      IF(.NOT.ln_linssh )   CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )  ! after vertical scale factors
 
-      IF(.NOT.ln_linssh )   CALL wzv           ( kstp, Nbb, Nnn, Naa, ww )  ! now cross-level velocity 
+      IF(.NOT.ln_linssh )   CALL wzv           ( kstp, Nbb, Nnn, Naa, ww )  ! now cross-level velocity
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! diagnostics and outputs       
+      ! diagnostics and outputs
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL dia_wri( kstp, Nnn )  ! ocean model: outputs
@@ -123,6 +123,6 @@
                         CALL dyn_atf    ( kstp, Nbb, Nnn, Naa , uu, vv, e3t, e3u, e3v )  ! time filtering of "now" fields
       IF(.NOT.ln_linssh)CALL ssh_atf    ( kstp, Nbb, Nnn, Naa , ssh )                    ! time filtering of "now" sea surface height
-      IF( kstp == nit000 .AND. ln_linssh) THEN 
-         ssh(:,:,Naa) = ssh(:,:,Nnn)  ! init ssh after in ln_linssh case 
+      IF( kstp == nit000 .AND. ln_linssh) THEN
+         ssh(:,:,Naa) = ssh(:,:,Nnn)  ! init ssh after in ln_linssh case
       ENDIF
       !
Index: /NEMO/trunk/src/OCE/DIA/diaar5.F90
===================================================================
--- /NEMO/trunk/src/OCE/DIA/diaar5.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DIA/diaar5.F90	(revision 14072)
@@ -10,5 +10,5 @@
    !!   dia_ar5_init  : initialisation of AR5 diagnostics
    !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and active tracers 
+   USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
    USE eosbn2         ! equation of state                (eos_bn2 routine)
@@ -37,5 +37,5 @@
 
    LOGICAL  :: l_ar5
-      
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -78,6 +78,6 @@
       REAL(wp) ::   zaw, zbw, zrw
       !
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace 
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: z2d, zpe                   ! 2D workspace 
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: z2d, zpe                   ! 2D workspace
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   :: z3d, zrhd, ztpot, zgdept   ! 3D workspace (zgdept: needed to use the substitute)
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace
@@ -85,8 +85,8 @@
       !!--------------------------------------------------------------------
       IF( ln_timing )   CALL timing_start('dia_ar5')
- 
+
       IF( kt == nit000 )     CALL dia_ar5_init
 
-      IF( l_ar5 ) THEN 
+      IF( l_ar5 ) THEN
          ALLOCATE( zarea_ssh(jpi,jpj), zbotpres(jpi,jpj), z2d(jpi,jpj) )
          ALLOCATE( zrhd(jpi,jpj,jpk) )
@@ -99,5 +99,5 @@
       CALL iom_put( 'areacello', e1e2t(:,:) )
       !
-      IF( iom_use( 'volcello' ) .OR. iom_use( 'masscello' )  ) THEN  
+      IF( iom_use( 'volcello' ) .OR. iom_use( 'masscello' )  ) THEN
          zrhd(:,:,jpk) = 0._wp        ! ocean volume ; rhd is used as workspace
          DO jk = 1, jpkm1
@@ -106,8 +106,8 @@
          DO jk = 1, jpk
             z3d(:,:,jk) =  rho0 * e3t(:,:,jk,Kmm) * tmask(:,:,jk)
-         END DO 
+         END DO
          CALL iom_put( 'volcello'  , zrhd(:,:,:)  )  ! WARNING not consistent with CMIP DR where volcello is at ca. 2000
          CALL iom_put( 'masscello' , z3d (:,:,:) )   ! ocean mass
-      ENDIF 
+      ENDIF
       !
       IF( iom_use( 'e3tb' ) )  THEN    ! bottom layer thickness
@@ -117,11 +117,11 @@
          END_2D
          CALL iom_put( 'e3tb', z2d )
-      ENDIF 
-      !
-      IF( iom_use( 'voltot' ) .OR. iom_use( 'sshtot' )  .OR. iom_use( 'sshdyn' )  ) THEN    
+      ENDIF
+      !
+      IF( iom_use( 'voltot' ) .OR. iom_use( 'sshtot' )  .OR. iom_use( 'sshdyn' )  ) THEN
          !                                         ! total volume of liquid seawater
-         zvolssh = glob_sum( 'diaar5', zarea_ssh(:,:) ) 
+         zvolssh = glob_sum( 'diaar5', zarea_ssh(:,:) )
          zvol    = vol0 + zvolssh
-      
+
          CALL iom_put( 'voltot', zvol               )
          CALL iom_put( 'sshtot', zvolssh / area_tot )
@@ -130,6 +130,6 @@
       ENDIF
 
-      IF( iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' )  ) THEN    
-         !                     
+      IF( iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' )  ) THEN
+         !
          ztsn(:,:,:,jp_tem) = ts(:,:,:,jp_tem,Kmm)                    ! thermosteric ssh
          ztsn(:,:,:,jp_sal) = sn0(:,:,:)
@@ -157,9 +157,9 @@
 !!gm
          END IF
-         !                                         
-         zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) ) 
+         !
+         zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) )
          zssh_steric = - zarho / area_tot
          CALL iom_put( 'sshthster', zssh_steric )
-      
+
          !                                         ! steric sea surface height
          zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
@@ -179,6 +179,6 @@
             END IF
          END IF
-         !    
-         zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) ) 
+         !
+         zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) )
          zssh_steric = - zarho / area_tot
          CALL iom_put( 'sshsteric', zssh_steric )
@@ -192,5 +192,5 @@
       ENDIF
 
-      IF( iom_use( 'masstot' ) .OR. iom_use( 'temptot' )  .OR. iom_use( 'saltot' )  ) THEN    
+      IF( iom_use( 'masstot' ) .OR. iom_use( 'temptot' )  .OR. iom_use( 'saltot' )  ) THEN
           !                                         ! Mean density anomalie, temperature and salinity
           ztsn(:,:,:,:) = 0._wp                    ! ztsn(:,:,1,jp_tem/sal) is used here as 2D Workspace for temperature & salinity
@@ -206,11 +206,11 @@
                   DO jj = 1, jpj
                      iks = mikt(ji,jj)
-                     ztsn(ji,jj,1,jp_tem) = ztsn(ji,jj,1,jp_tem) + zarea_ssh(ji,jj) * ts(ji,jj,iks,jp_tem,Kmm) 
-                     ztsn(ji,jj,1,jp_sal) = ztsn(ji,jj,1,jp_sal) + zarea_ssh(ji,jj) * ts(ji,jj,iks,jp_sal,Kmm) 
+                     ztsn(ji,jj,1,jp_tem) = ztsn(ji,jj,1,jp_tem) + zarea_ssh(ji,jj) * ts(ji,jj,iks,jp_tem,Kmm)
+                     ztsn(ji,jj,1,jp_sal) = ztsn(ji,jj,1,jp_sal) + zarea_ssh(ji,jj) * ts(ji,jj,iks,jp_sal,Kmm)
                   END DO
                END DO
             ELSE
-               ztsn(:,:,1,jp_tem) = ztsn(:,:,1,jp_tem) + zarea_ssh(:,:) * ts(:,:,1,jp_tem,Kmm) 
-               ztsn(:,:,1,jp_sal) = ztsn(:,:,1,jp_sal) + zarea_ssh(:,:) * ts(:,:,1,jp_sal,Kmm) 
+               ztsn(:,:,1,jp_tem) = ztsn(:,:,1,jp_tem) + zarea_ssh(:,:) * ts(:,:,1,jp_tem,Kmm)
+               ztsn(:,:,1,jp_sal) = ztsn(:,:,1,jp_sal) + zarea_ssh(:,:) * ts(:,:,1,jp_sal,Kmm)
             END IF
          ENDIF
@@ -218,5 +218,5 @@
          ztemp = glob_sum( 'diaar5', ztsn(:,:,1,jp_tem) )
          zsal  = glob_sum( 'diaar5', ztsn(:,:,1,jp_sal) )
-         zmass = rho0 * ( zarho + zvol )      
+         zmass = rho0 * ( zarho + zvol )
          !
          CALL iom_put( 'masstot', zmass )
@@ -224,5 +224,5 @@
          CALL iom_put( 'saltot' , zsal  / zvol )
          !
-      ENDIF     
+      ENDIF
 
       IF( ln_teos10 ) THEN        ! ! potential temperature (TEOS-10 case)
@@ -244,10 +244,10 @@
                  z2d(:,:) = z2d(:,:) + e1e2t(:,:) * e3t(:,:,jk,Kmm) * ztpot(:,:,jk)
                END DO
-               ztemp = glob_sum( 'diaar5', z2d(:,:)  ) 
+               ztemp = glob_sum( 'diaar5', z2d(:,:)  )
                CALL iom_put( 'temptot_pot', ztemp / zvol )
              ENDIF
              !
              IF( iom_use( 'ssttot' ) ) THEN   ! Output potential temperature in case we use TEOS-10
-               zsst = glob_sum( 'diaar5',  e1e2t(:,:) * ztpot(:,:,1)  ) 
+               zsst = glob_sum( 'diaar5',  e1e2t(:,:) * ztpot(:,:,1)  )
                CALL iom_put( 'ssttot', zsst / area_tot )
              ENDIF
@@ -258,9 +258,9 @@
                   z2d(ji,jj) = z2d(ji,jj) + rho0 * e3t(ji,jj,jk,Kmm) *  ztpot(ji,jj,jk)
                END_3D
-               CALL iom_put( 'tosmint_pot', z2d ) 
+               CALL iom_put( 'tosmint_pot', z2d )
             ENDIF
             DEALLOCATE( ztpot )
         ENDIF
-      ELSE       
+      ELSE
          IF( iom_use('ssttot') ) THEN   ! Output sst in case we use EOS-80
             zsst  = glob_sum( 'diaar5', e1e2t(:,:) * ts(:,:,1,jp_tem,Kmm) )
@@ -269,5 +269,5 @@
       ENDIF
 
-      IF( iom_use( 'tnpeo' )) THEN    
+      IF( iom_use( 'tnpeo' )) THEN
         ! Work done against stratification by vertical mixing
         ! Exclude points where rn2 is negative as convection kicks in here and
@@ -358,5 +358,5 @@
          ENDIF
       ENDIF
-    
+
    END SUBROUTINE dia_ar5_hst
 
@@ -365,5 +365,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dia_ar5_init  ***
-      !!                   
+      !!
       !! ** Purpose :   initialization for AR5 diagnostic computation
       !!----------------------------------------------------------------------
@@ -371,13 +371,13 @@
       INTEGER  ::   ik, idep
       INTEGER  ::   ji, jj, jk  ! dummy loop indices
-      REAL(wp) ::   zztmp  
+      REAL(wp) ::   zztmp
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   zsaldta   ! Jan/Dec levitus salinity
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     ::   zvol0     
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     ::   zvol0
       !
       !!----------------------------------------------------------------------
       !
       l_ar5 = .FALSE.
-      IF(   iom_use( 'voltot'  ) .OR. iom_use( 'sshtot'    )  .OR. iom_use( 'sshdyn' )  .OR.  & 
-         &  iom_use( 'masstot' ) .OR. iom_use( 'temptot'   )  .OR. iom_use( 'saltot' ) .OR.  &    
+      IF(   iom_use( 'voltot'  ) .OR. iom_use( 'sshtot'    )  .OR. iom_use( 'sshdyn' )  .OR.  &
+         &  iom_use( 'masstot' ) .OR. iom_use( 'temptot'   )  .OR. iom_use( 'saltot' ) .OR.  &
          &  iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' ) .OR. &
          &  iom_use( 'uadv_heattr' ) .OR. iom_use( 'udiff_heattr' ) .OR. &
@@ -386,5 +386,5 @@
          &  iom_use( 'vadv_salttr' ) .OR. iom_use( 'vdiff_salttr' ) .OR. &
          &  iom_use( 'rhop' )  ) L_ar5 = .TRUE.
-  
+
       IF( l_ar5 ) THEN
          !
@@ -400,5 +400,5 @@
             idep = tmask(ji,jj,jk) * e3t_0(ji,jj,jk)
             zvol0 (ji,jj) = zvol0 (ji,jj) +  idep * e1e2t(ji,jj)
-            thick0(ji,jj) = thick0(ji,jj) +  idep    
+            thick0(ji,jj) = thick0(ji,jj) +  idep
          END_3D
          vol0 = glob_sum( 'diaar5', zvol0 )
@@ -412,5 +412,5 @@
             CALL iom_close( inum )
 
-            sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )        
+            sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )
             sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:)
             IF( ln_zps ) THEN               ! z-coord. partial steps
Index: /NEMO/trunk/src/OCE/DIA/diahsb.F90
===================================================================
--- /NEMO/trunk/src/OCE/DIA/diahsb.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DIA/diahsb.F90	(revision 14072)
@@ -4,5 +4,5 @@
    !! Ocean diagnostics: Heat, salt and volume budgets
    !!======================================================================
-   !! History :  3.3  ! 2010-09  (M. Leclair)  Original code 
+   !! History :  3.3  ! 2010-09  (M. Leclair)  Original code
    !!                 ! 2012-10  (C. Rousset)  add iom_put
    !!----------------------------------------------------------------------
@@ -21,5 +21,5 @@
    USE domvvl         ! vertical scale factors
    USE traqsr         ! penetrative solar radiation
-   USE trabbc         ! bottom boundary condition 
+   USE trabbc         ! bottom boundary condition
    USE trabbc         ! bottom boundary condition
    USE restart        ! ocean restart
@@ -44,5 +44,5 @@
    REAL(wp) ::   frc_wn_t, frc_wn_s    ! global forcing trends
    !
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   surf 
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   surf
    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   surf_ini      , ssh_ini          !
    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   ssh_hc_loc_ini, ssh_sc_loc_ini   !
@@ -62,7 +62,7 @@
       !!---------------------------------------------------------------------------
       !!                  ***  ROUTINE dia_hsb  ***
-      !!     
+      !!
       !! ** Purpose: Compute the ocean global heat content, salt content and volume conservation
-      !!	
+      !!
       !! ** Method : - Compute the deviation of heat content, salt content and volume
       !!	            at the current time step from their values at nit000
@@ -75,5 +75,5 @@
       INTEGER    ::   ji, jj, jk                  ! dummy loop indice
       REAL(wp)   ::   zdiff_hc    , zdiff_sc      ! heat and salt content variations
-      REAL(wp)   ::   zdiff_hc1   , zdiff_sc1     !  -         -     -        - 
+      REAL(wp)   ::   zdiff_hc1   , zdiff_sc1     !  -         -     -        -
       REAL(wp)   ::   zdiff_v1    , zdiff_v2      ! volume variation
       REAL(wp)   ::   zerr_hc1    , zerr_sc1      ! heat and salt content misfit
@@ -86,5 +86,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpkm1) ::   zwrk         ! 3D workspace
       !!---------------------------------------------------------------------------
-      IF( ln_timing )   CALL timing_start('dia_hsb')      
+      IF( ln_timing )   CALL timing_start('dia_hsb')
       !
       ts(:,:,:,1,Kmm) = ts(:,:,:,1,Kmm) * tmask(:,:,:) ; ts(:,:,:,1,Kbb) = ts(:,:,:,1,Kbb) * tmask(:,:,:) ;
@@ -119,5 +119,5 @@
             z2d1(:,:) = surf(:,:) * ww(:,:,1) * ts(:,:,1,jp_sal,Kbb)
          END IF
-         z_wn_trd_t = - glob_sum( 'diahsb', z2d0 ) 
+         z_wn_trd_t = - glob_sum( 'diahsb', z2d0 )
          z_wn_trd_s = - glob_sum( 'diahsb', z2d1 )
       ENDIF
@@ -145,14 +145,14 @@
             DO ji = 1, jpi
                DO jj = 1, jpj
-                  z2d0(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) * ssh(ji,jj,Kmm) - ssh_hc_loc_ini(ji,jj) ) 
-                  z2d1(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) * ssh(ji,jj,Kmm) - ssh_sc_loc_ini(ji,jj) ) 
+                  z2d0(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) * ssh(ji,jj,Kmm) - ssh_hc_loc_ini(ji,jj) )
+                  z2d1(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) * ssh(ji,jj,Kmm) - ssh_sc_loc_ini(ji,jj) )
                END DO
             END DO
          ELSE                          ! no under ice-shelf seas
-            z2d0(:,:) = surf(:,:) * ( ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) - ssh_hc_loc_ini(:,:) ) 
-            z2d1(:,:) = surf(:,:) * ( ts(:,:,1,jp_sal,Kmm) * ssh(:,:,Kmm) - ssh_sc_loc_ini(:,:) ) 
+            z2d0(:,:) = surf(:,:) * ( ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) - ssh_hc_loc_ini(:,:) )
+            z2d1(:,:) = surf(:,:) * ( ts(:,:,1,jp_sal,Kmm) * ssh(:,:,Kmm) - ssh_sc_loc_ini(:,:) )
          END IF
-         z_ssh_hc = glob_sum_full( 'diahsb', z2d0 ) 
-         z_ssh_sc = glob_sum_full( 'diahsb', z2d1 ) 
+         z_ssh_hc = glob_sum_full( 'diahsb', z2d0 )
+         z_ssh_sc = glob_sum_full( 'diahsb', z2d1 )
       ENDIF
       !
@@ -181,5 +181,5 @@
       zdiff_sc = zdiff_sc - frc_s
       IF( ln_linssh ) THEN
-         zdiff_hc1 = zdiff_hc + z_ssh_hc 
+         zdiff_hc1 = zdiff_hc + z_ssh_hc
          zdiff_sc1 = zdiff_sc + z_ssh_sc
          zerr_hc1  = z_ssh_hc - frc_wn_t
@@ -201,19 +201,19 @@
 !!gm end
 
-      CALL iom_put(   'bgfrcvol' , frc_v    * 1.e-9    )              ! vol - surface forcing (km3) 
-      CALL iom_put(   'bgfrctem' , frc_t    * rho0 * rcp * 1.e-20 )   ! hc  - surface forcing (1.e20 J) 
-      CALL iom_put(   'bgfrchfx' , frc_t    * rho0 * rcp /  &         ! hc  - surface forcing (W/m2) 
+      CALL iom_put(   'bgfrcvol' , frc_v    * 1.e-9    )              ! vol - surface forcing (km3)
+      CALL iom_put(   'bgfrctem' , frc_t    * rho0 * rcp * 1.e-20 )   ! hc  - surface forcing (1.e20 J)
+      CALL iom_put(   'bgfrchfx' , frc_t    * rho0 * rcp /  &         ! hc  - surface forcing (W/m2)
          &                       ( surf_tot * kt * rn_Dt )        )
-      CALL iom_put(   'bgfrcsal' , frc_s    * 1.e-9    )              ! sc  - surface forcing (psu*km3) 
+      CALL iom_put(   'bgfrcsal' , frc_s    * 1.e-9    )              ! sc  - surface forcing (psu*km3)
 
       IF( .NOT. ln_linssh ) THEN
-         CALL iom_put( 'bgtemper' , zdiff_hc / zvol_tot )              ! Temperature drift     (C) 
+         CALL iom_put( 'bgtemper' , zdiff_hc / zvol_tot )              ! Temperature drift     (C)
          CALL iom_put( 'bgsaline' , zdiff_sc / zvol_tot )              ! Salinity    drift     (PSU)
-         CALL iom_put( 'bgheatco' , zdiff_hc * 1.e-20 * rho0 * rcp )   ! Heat content drift    (1.e20 J) 
-         CALL iom_put( 'bgheatfx' , zdiff_hc * rho0 * rcp /  &         ! Heat flux drift       (W/m2) 
+         CALL iom_put( 'bgheatco' , zdiff_hc * 1.e-20 * rho0 * rcp )   ! Heat content drift    (1.e20 J)
+         CALL iom_put( 'bgheatfx' , zdiff_hc * rho0 * rcp /  &         ! Heat flux drift       (W/m2)
             &                       ( surf_tot * kt * rn_Dt )        )
          CALL iom_put( 'bgsaltco' , zdiff_sc * 1.e-9    )              ! Salt content drift    (psu*km3)
-         CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9    )              ! volume ssh drift      (km3)  
-         CALL iom_put( 'bgvole3t' , zdiff_v2 * 1.e-9    )              ! volume e3t drift      (km3)  
+         CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9    )              ! volume ssh drift      (km3)
+         CALL iom_put( 'bgvole3t' , zdiff_v2 * 1.e-9    )              ! volume e3t drift      (km3)
          !
          IF( kt == nitend .AND. lwp ) THEN
@@ -228,11 +228,11 @@
          !
       ELSE
-         CALL iom_put( 'bgtemper' , zdiff_hc1 / zvol_tot)              ! Heat content drift    (C) 
+         CALL iom_put( 'bgtemper' , zdiff_hc1 / zvol_tot)              ! Heat content drift    (C)
          CALL iom_put( 'bgsaline' , zdiff_sc1 / zvol_tot)              ! Salt content drift    (PSU)
-         CALL iom_put( 'bgheatco' , zdiff_hc1 * 1.e-20 * rho0 * rcp )  ! Heat content drift    (1.e20 J) 
-         CALL iom_put( 'bgheatfx' , zdiff_hc1 * rho0 * rcp /  &        ! Heat flux drift       (W/m2) 
+         CALL iom_put( 'bgheatco' , zdiff_hc1 * 1.e-20 * rho0 * rcp )  ! Heat content drift    (1.e20 J)
+         CALL iom_put( 'bgheatfx' , zdiff_hc1 * rho0 * rcp /  &        ! Heat flux drift       (W/m2)
             &                       ( surf_tot * kt * rn_Dt )         )
          CALL iom_put( 'bgsaltco' , zdiff_sc1 * 1.e-9    )             ! Salt content drift    (psu*km3)
-         CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9    )              ! volume ssh drift      (km3)  
+         CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9    )              ! volume ssh drift      (km3)
          CALL iom_put( 'bgmistem' , zerr_hc1 / zvol_tot )              ! hc  - error due to free surface (C)
          CALL iom_put( 'bgmissal' , zerr_sc1 / zvol_tot )              ! sc  - error due to free surface (psu)
@@ -249,5 +249,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE dia_hsb_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write DIA file in restart file
       !!
@@ -261,5 +261,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
@@ -298,6 +298,6 @@
             END DO
             frc_v = 0._wp                                           ! volume       trend due to forcing
-            frc_t = 0._wp                                           ! heat content   -    -   -    -   
-            frc_s = 0._wp                                           ! salt content   -    -   -    -        
+            frc_t = 0._wp                                           ! heat content   -    -   -    -
+            frc_s = 0._wp                                           ! salt content   -    -   -    -
             IF( ln_linssh ) THEN
                IF( ln_isfcav ) THEN
@@ -349,7 +349,7 @@
       !!---------------------------------------------------------------------------
       !!                  ***  ROUTINE dia_hsb  ***
-      !!     
+      !!
       !! ** Purpose: Initialization for the heat salt volume budgets
-      !!	
+      !!
       !! ** Method : Compute initial heat content, salt content and volume
       !!
@@ -403,5 +403,5 @@
       surf_tot  = glob_sum( 'diahsb', surf(:,:) )         ! total ocean surface area
 
-      IF( ln_bdy ) CALL ctl_warn( 'dia_hsb_init: heat/salt budget does not consider open boundary fluxes' )         
+      IF( ln_bdy ) CALL ctl_warn( 'dia_hsb_init: heat/salt budget does not consider open boundary fluxes' )
       !
       ! ---------------------------------- !
Index: /NEMO/trunk/src/OCE/DIA/diaptr.F90
===================================================================
--- /NEMO/trunk/src/OCE/DIA/diaptr.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DIA/diaptr.F90	(revision 14072)
@@ -66,5 +66,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -75,5 +75,5 @@
       !!                  ***  ROUTINE dia_ptr  ***
       !!----------------------------------------------------------------------
-      INTEGER                         , INTENT(in)           ::   kt     ! ocean time-step index     
+      INTEGER                         , INTENT(in)           ::   kt     ! ocean time-step index
       INTEGER                         , INTENT(in)           ::   Kmm    ! time level index
       REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in), OPTIONAL ::   pvtr   ! j-effective transport
@@ -177,5 +177,5 @@
 
          IF( iom_use( 'sopstbtr' ) .OR. iom_use( 'sophtbtr' ) ) THEN
-            ! Calculate barotropic heat and salt transport here 
+            ! Calculate barotropic heat and salt transport here
             ALLOCATE( sjk(jpj,1,nbasin), r1_sjk(jpj,1,nbasin) )
             !
@@ -245,6 +245,6 @@
          !
          !                                ! Advective and diffusive heat and salt transport
-         IF( iom_use( 'sophtadv' ) .OR. iom_use( 'sopstadv' ) ) THEN  
-            ! 
+         IF( iom_use( 'sophtadv' ) .OR. iom_use( 'sopstadv' ) ) THEN
+            !
             DO jn = 1, nbasin
                z3dtr(1,:,jn) = hstr_adv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
@@ -263,6 +263,6 @@
          ENDIF
          !
-         IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) THEN  
-            ! 
+         IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) THEN
+            !
             DO jn = 1, nbasin
                z3dtr(1,:,jn) = hstr_ldf(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
@@ -281,6 +281,6 @@
          ENDIF
          !
-         IF( iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) ) THEN  
-            ! 
+         IF( iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) ) THEN
+            !
             DO jn = 1, nbasin
                z3dtr(1,:,jn) = hstr_eiv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
@@ -319,5 +319,5 @@
             IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain
             CALL iom_get_var(  'uocetr_vsum_op', z2d ) ! get uocetr_vsum_op from xml
-            z2d(:,:) = ptr_ci_2d( z2d(:,:) )  
+            z2d(:,:) = ptr_ci_2d( z2d(:,:) )
             CALL iom_put( 'uocetr_vsum_cumul', z2d )
             IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )   ! Revert to tile domain
@@ -455,5 +455,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dia_ptr_init  ***
-      !!                   
+      !!
       !! ** Purpose :   Initialization
       !!----------------------------------------------------------------------
@@ -472,5 +472,5 @@
          &       iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) .OR. iom_use( 'sopstvtr' ) .OR.  &
          &       iom_use( 'sophtvtr' ) .OR. iom_use( 'uocetr_vsum_cumul' )
-      
+
       IF(lwp) THEN                     ! Control print
          WRITE(numout,*)
@@ -480,5 +480,5 @@
       ENDIF
 
-      IF( l_diaptr ) THEN  
+      IF( l_diaptr ) THEN
          !
          IF( dia_ptr_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_ptr_init : unable to allocate arrays' )
@@ -489,5 +489,5 @@
          IF( lk_mpp )   CALL mpp_ini_znl( numout )     ! Define MPI communicator for zonal sum
 
-         btmsk(:,:,1) = tmask_i(:,:)                 
+         btmsk(:,:,1) = tmask_i(:,:)
          IF( nbasin == 5 ) THEN   ! nbasin has been initialized in iom_init to define the axis "basin"
             CALL iom_open( 'subbasins', inum )
@@ -504,8 +504,8 @@
          WHERE( gphit(:,:)*tmask_i(:,:) < -34._wp)
            zmsk(:,:) = 0._wp      ! mask out Southern Ocean
-         ELSE WHERE                  
+         ELSE WHERE
            zmsk(:,:) = ssmask(:,:)
          END WHERE
-         btmsk34(:,:,1) = btmsk(:,:,1)                 
+         btmsk34(:,:,1) = btmsk(:,:,1)
          DO jn = 2, nbasin
             btmsk34(:,:,jn) = btmsk(:,:,jn) * zmsk(:,:)                  ! interior domain only
@@ -514,8 +514,8 @@
          ! Initialise arrays to zero because diatpr is called before they are first calculated
          ! Note that this means diagnostics will not be exactly correct when model run is restarted.
-         hstr_adv(:,:,:) = 0._wp           
-         hstr_ldf(:,:,:) = 0._wp           
-         hstr_eiv(:,:,:) = 0._wp           
-         hstr_ove(:,:,:) = 0._wp           
+         hstr_adv(:,:,:) = 0._wp
+         hstr_ldf(:,:,:) = 0._wp
+         hstr_eiv(:,:,:) = 0._wp
+         hstr_ove(:,:,:) = 0._wp
          hstr_btr(:,:,:) = 0._wp           !
          hstr_vtr(:,:,:) = 0._wp           !
@@ -525,10 +525,10 @@
          ll_init = .FALSE.
          !
-      ENDIF 
-      ! 
+      ENDIF
+      !
    END SUBROUTINE dia_ptr_init
 
 
-   SUBROUTINE dia_ptr_hst( ktra, cptr, pvflx ) 
+   SUBROUTINE dia_ptr_hst( ktra, cptr, pvflx )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE dia_ptr_hst ***
@@ -727,8 +727,8 @@
       !
       INTEGER                  ::   ji,jj,jc       ! dummy loop arguments
-      INTEGER                  ::   ijpj        ! ??? 
+      INTEGER                  ::   ijpj        ! ???
       REAL(wp), DIMENSION(jpi,jpj) :: p_fval ! function value
       !!--------------------------------------------------------------------
-      ! 
+      !
       ijpj = jpj  ! ???
       p_fval(:,:) = 0._wp
@@ -738,5 +738,5 @@
          END_2D
       END DO
-      ! 
+      !
    END FUNCTION ptr_ci_2d
 
Index: /NEMO/trunk/src/OCE/DIU/diu_coolskin.F90
===================================================================
--- /NEMO/trunk/src/OCE/DIU/diu_coolskin.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DIU/diu_coolskin.F90	(revision 14072)
@@ -20,5 +20,5 @@
    USE lib_mpp
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   
+
    IMPLICIT NONE
    PRIVATE
@@ -34,5 +34,5 @@
    REAL(wp), PRIVATE, PARAMETER :: pp_rhoa = 1.20421_wp     ! density of air (at 20C)
    REAL(wp), PRIVATE, PARAMETER :: pp_cda = 1.45e-3_wp      ! assumed air-sea drag coefficient for calculating wind speed
-   
+
    ! Key variables
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: x_csdsst    ! Cool skin delta SST
@@ -46,7 +46,7 @@
    !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
-   !!----------------------------------------------------------------------   
-   CONTAINS 
-   
+   !!----------------------------------------------------------------------
+   CONTAINS
+
    SUBROUTINE diurnal_sst_coolskin_init
       !!----------------------------------------------------------------------
@@ -55,8 +55,8 @@
       !! ** Purpose :   initialise the cool skin model
       !!
-      !! ** Method : 
+      !! ** Method :
       !!
       !! ** Reference :
-      !! 
+      !!
       !!----------------------------------------------------------------------
       ALLOCATE( x_csdsst(jpi,jpj), x_csthick(jpi,jpj) )
@@ -73,7 +73,7 @@
       !! ** Purpose :   Time-step the Artale cool skin model
       !!
-      !! ** Method : 
+      !! ** Method :
       !!
-      !! ** Reference : 
+      !! ** Reference :
       !!----------------------------------------------------------------------
       ! Dummy variables
@@ -82,7 +82,7 @@
       REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: psrho       ! Water density (kg/m^3)
       REAL(wp), INTENT(IN) :: pDt                             ! Time-step
-     
+
       ! Local variables
-      REAL(wp), DIMENSION(jpi,jpj) :: z_fv                    ! Friction velocity     
+      REAL(wp), DIMENSION(jpi,jpj) :: z_fv                    ! Friction velocity
       REAL(wp), DIMENSION(jpi,jpj) :: z_gamma                 ! Dimensionless function of wind speed
       REAL(wp), DIMENSION(jpi,jpj) :: z_lamda                 ! Sauders (dimensionless) proportionality constant
@@ -91,5 +91,5 @@
       REAL(wp) :: z_zty                                       ! Temporary v wind stress
       REAL(wp) :: z_zmod                                      ! Temporary total wind stress
-     
+
       INTEGER :: ji,jj
       !!----------------------------------------------------------------------
@@ -105,5 +105,5 @@
          ELSE
             z_fv(ji,jj) = 0.
-            z_wspd(ji,jj) = 0.     
+            z_wspd(ji,jj) = 0.
          ENDIF
          !
Index: /NEMO/trunk/src/OCE/DOM/daymod.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/daymod.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/daymod.F90	(revision 14072)
@@ -19,6 +19,6 @@
    !!                    ----------- WARNING -----------
    !!                    -------------------------------
-   !!   sbcmod assume that the time step is dividing the number of second of 
-   !!   in a day, i.e. ===> MOD( rday, rn_Dt ) == 0 
+   !!   sbcmod assume that the time step is dividing the number of second of
+   !!   in a day, i.e. ===> MOD( rday, rn_Dt ) == 0
    !!   except when user defined forcing is used (see sbcmod.F90)
    !!----------------------------------------------------------------------
@@ -84,5 +84,5 @@
       lrst_oce = .NOT. l_offline   ! force definition of offline
       IF( lrst_oce )   CALL day_rst( nit000, 'READ' )
-      
+
       ! set the calandar from ndastp (read in restart file and namelist)
       nyear   =   ndastp / 10000
@@ -94,5 +94,5 @@
       isecrst = ( nhour * NINT(rhhmm) + nminute ) * NINT(rmmss)
 
-      CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday )  
+      CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday )
       IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error
       IF( nhour*NINT(rhhmm*rmmss) + nminute*NINT(rmmss) - ndt05 .LT. 0 ) fjulday = fjulday+1.       ! move back to the day at nit000 (and not at nit000 - 1)
@@ -124,13 +124,13 @@
       IF( isecrst - ndt05 .GT. 0 ) THEN
          ! 1 timestep before current middle of first time step is still the same day
-         nsec_year  = (nday_year-1) * nsecd + isecrst - ndt05 
-         nsec_month = (nday-1)      * nsecd + isecrst - ndt05    
+         nsec_year  = (nday_year-1) * nsecd + isecrst - ndt05
+         nsec_month = (nday-1)      * nsecd + isecrst - ndt05
       ELSE
-         ! 1 time step before the middle of the first time step is the previous day 
-         nsec_year  = nday_year     * nsecd + isecrst - ndt05 
-         nsec_month = nday          * nsecd + isecrst - ndt05   
+         ! 1 time step before the middle of the first time step is the previous day
+         nsec_year  = nday_year     * nsecd + isecrst - ndt05
+         nsec_month = nday          * nsecd + isecrst - ndt05
       ENDIF
       nsec_monday   = imonday       * nsecd + isecrst - ndt05
-      nsec_day      =                         isecrst - ndt05 
+      nsec_day      =                         isecrst - ndt05
       IF( nsec_day    .LT. 0 ) nsec_day    = nsec_day    + nsecd
       IF( nsec_monday .LT. 0 ) nsec_monday = nsec_monday + nsecd*7
@@ -144,5 +144,5 @@
       nsec000_1jan000 = nsec1jan000 + nsec_year + ndt05
       nsecend_1jan000 = nsec000_1jan000 + ndt * ( nitend - nit000 + 1 )
-      
+
       ! Up to now, calendar parameters are related to the end of previous run (nit000-1)
       ! call day to set the calendar parameters at the begining of the current simulaton. needed by iom_init
@@ -344,13 +344,13 @@
                ! calculate start time in hours and minutes
                zdayfrac = adatrj - REAL(INT(adatrj), wp)
-	       ksecs = NINT(zdayfrac * rday)	       ! Nearest second to catch rounding errors in adatrj	       
+	       ksecs = NINT(zdayfrac * rday)	       ! Nearest second to catch rounding errors in adatrj
                ihour = ksecs / NINT( rhhmm*rmmss )
 	       iminute = ksecs / NINT(rmmss) - ihour*NINT(rhhmm)
- 	        
+
                ! Add to nn_time0
                nhour   =   nn_time0 / 100
                nminute = ( nn_time0 - nhour * 100 )
 	       nminute = nminute + iminute
-	       
+
                IF( nminute >= NINT(rhhmm) ) THEN
 	          nminute = nminute - NINT(rhhmm)
@@ -361,7 +361,7 @@
 		  nhour = nhour - NINT(rjjhh)
 	          adatrj = adatrj + 1.
-	       ENDIF	       
+	       ENDIF
 	       nn_time0 = nhour * 100 + nminute
-               adatrj = REAL(INT(adatrj), wp)                    ! adatrj set to integer as nn_time0 updated	       
+               adatrj = REAL(INT(adatrj), wp)                    ! adatrj set to integer as nn_time0 updated
             ELSE
                ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day)
Index: /NEMO/trunk/src/OCE/DOM/dom_oce.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 14072)
@@ -4,5 +4,5 @@
    !! ** Purpose :   Define in memory all the ocean space domain variables
    !!======================================================================
-   !! History :  1.0  ! 2005-10  (A. Beckmann, G. Madec)  reactivate s-coordinate 
+   !! History :  1.0  ! 2005-10  (A. Beckmann, G. Madec)  reactivate s-coordinate
    !!            3.3  ! 2010-11  (G. Madec) add mbk. arrays associated to the deepest ocean level
    !!            3.4  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
@@ -72,5 +72,5 @@
    !                                !  = 6 cyclic East-West AND North fold F-point pivot
    !                                !  = 7 bi-cyclic East-West AND North-South
-   LOGICAL, PUBLIC ::   l_Iperio, l_Jperio   !   should we explicitely take care I/J periodicity 
+   LOGICAL, PUBLIC ::   l_Iperio, l_Jperio   !   should we explicitely take care I/J periodicity
 
    ! Tiling namelist
@@ -91,11 +91,11 @@
    INTEGER, ALLOCATABLE, PUBLIC ::   nbondi_bdy(:)    !: mark i-direction local boundaries for BDY open boundaries
    INTEGER, ALLOCATABLE, PUBLIC ::   nbondj_bdy(:)    !: mark j-direction local boundaries for BDY open boundaries
-   INTEGER, ALLOCATABLE, PUBLIC ::   nbondi_bdy_b(:)  !: mark i-direction of neighbours local boundaries for BDY open boundaries  
-   INTEGER, ALLOCATABLE, PUBLIC ::   nbondj_bdy_b(:)  !: mark j-direction of neighbours local boundaries for BDY open boundaries  
+   INTEGER, ALLOCATABLE, PUBLIC ::   nbondi_bdy_b(:)  !: mark i-direction of neighbours local boundaries for BDY open boundaries
+   INTEGER, ALLOCATABLE, PUBLIC ::   nbondj_bdy_b(:)  !: mark j-direction of neighbours local boundaries for BDY open boundaries
 
    INTEGER, PUBLIC ::   npolj             !: north fold mark (0, 3 or 4)
    INTEGER, PUBLIC ::   noea, nowe        !: index of the local neighboring processors in
    INTEGER, PUBLIC ::   noso, nono        !: east, west, south and north directions
-   INTEGER, PUBLIC ::   nones, nonws        !: north-east, north-west directions for sending 
+   INTEGER, PUBLIC ::   nones, nonws        !: north-east, north-west directions for sending
    INTEGER, PUBLIC ::   noses, nosws        !: south-east, south-west directions for sending
    INTEGER, PUBLIC ::   noner, nonwr        !: north-east, north-west directions for receiving
@@ -142,5 +142,5 @@
    LOGICAL, PUBLIC ::   ln_zps       !: z-coordinate - partial step
    LOGICAL, PUBLIC ::   ln_sco       !: s-coordinate or hybrid z-s coordinate
-   LOGICAL, PUBLIC ::   ln_isfcav    !: presence of ISF 
+   LOGICAL, PUBLIC ::   ln_isfcav    !: presence of ISF
    !                                                        !  reference scale factors
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::     e3t_0   !: t- vert. scale factor [m]
@@ -166,7 +166,7 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   gde3w_0  !: w- depth (sum of e3w) [m]
    !                                                        !  time-dependent depths of cells
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  gdept, gdepw  
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gde3w  
-   
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  gdept, gdepw
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gde3w
+
    !                                                        !  reference heights of ocean water column and its inverse
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   ht_0, r1_ht_0   !: t-depth        [m] and [1/m]
@@ -182,5 +182,5 @@
 
    INTEGER, PUBLIC ::   nla10              !: deepest    W level Above  ~10m (nlb10 - 1)
-   INTEGER, PUBLIC ::   nlb10              !: shallowest W level Bellow ~10m (nla10 + 1) 
+   INTEGER, PUBLIC ::   nlb10              !: shallowest W level Bellow ~10m (nla10 + 1)
 
    !! 1D reference  vertical coordinate
@@ -207,5 +207,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   tmask, umask, vmask, wmask, fmask   !: land/ocean mask at T-, U-, V-, W- and F-pts
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   wumask, wvmask                      !: land/ocean mask at WU- and WV-pts
-#if defined key_qco   
+#if defined key_qco
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   fe3mask                             !: land/ocean mask at F-pts for qco
 #endif
@@ -224,5 +224,5 @@
    INTEGER , PUBLIC ::   nsec_monday   !: seconds between 00h         of the last Monday   and half of the current time step
    INTEGER , PUBLIC ::   nsec_day      !: seconds between 00h         of the current   day and half of the current time step
-   REAL(wp), PUBLIC ::   fjulday       !: current julian day 
+   REAL(wp), PUBLIC ::   fjulday       !: current julian day
    REAL(wp), PUBLIC ::   fjulstartyear !: first day of the current year in julian days
    REAL(wp), PUBLIC ::   adatrj        !: number of elapsed days since the begining of the whole simulation
@@ -252,5 +252,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -270,5 +270,5 @@
 
    CHARACTER(len=3) FUNCTION Agrif_CFixed()
-      Agrif_CFixed = '0' 
+      Agrif_CFixed = '0'
    END FUNCTION Agrif_CFixed
 #endif
@@ -311,5 +311,5 @@
       ii = ii+1
       ALLOCATE( r3t  (jpi,jpj,jpt)   , r3u  (jpi,jpj,jpt)    , r3v  (jpi,jpj,jpt)    , r3f  (jpi,jpj) ,      &
-         &      r3t_f(jpi,jpj)       , r3u_f(jpi,jpj)        , r3v_f(jpi,jpj)                         ,  STAT=ierr(ii) )             
+         &      r3t_f(jpi,jpj)       , r3u_f(jpi,jpj)        , r3v_f(jpi,jpj)                         ,  STAT=ierr(ii) )
 #else
       ii = ii+1
Index: /NEMO/trunk/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/domain.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/domain.F90	(revision 14072)
@@ -6,5 +6,5 @@
    !! History :  OPA  !  1990-10  (C. Levy - G. Madec)  Original code
    !!                 !  1992-01  (M. Imbard) insert time step initialization
-   !!                 !  1996-06  (G. Madec) generalized vertical coordinate 
+   !!                 !  1996-06  (G. Madec) generalized vertical coordinate
    !!                 !  1997-02  (G. Madec) creation of domwri.F
    !!                 !  2001-05  (E.Durand - G. Madec) insert closed sea
@@ -17,5 +17,5 @@
    !!            4.1  !  2020-02  (G. Madec, S. Techene)  introduce ssh to h0 ratio
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
    !!   dom_init      : initialize the space and time domain
@@ -33,5 +33,5 @@
    USE domvvl         ! variable volume
 #endif
-   USE sshwzv  , ONLY : ssh_init_rst   ! set initial ssh 
+   USE sshwzv  , ONLY : ssh_init_rst   ! set initial ssh
    USE sbc_oce        ! surface boundary condition: ocean
    USE trc_oce        ! shared ocean & passive tracers variab
@@ -72,7 +72,7 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_init  ***
-      !!                    
-      !! ** Purpose :   Domain initialization. Call the routines that are 
-      !!              required to create the arrays which define the space 
+      !!
+      !! ** Purpose :   Domain initialization. Call the routines that are
+      !!              required to create the arrays which define the space
       !!              and time domain of the ocean model.
       !!
@@ -89,5 +89,5 @@
       INTEGER ::   iconf = 0    ! local integers
       REAL(wp)::   zrdt
-      CHARACTER (len=64) ::   cform = "(A12, 3(A13, I7))" 
+      CHARACTER (len=64) ::   cform = "(A12, 3(A13, I7))"
       INTEGER , DIMENSION(jpi,jpj) ::   ik_top , ik_bot       ! top and bottom ocean level
       REAL(wp), DIMENSION(jpi,jpj) ::   z1_hu_0, z1_hv_0
@@ -126,5 +126,5 @@
          WRITE(numout,*)     '         cn_cfg = ', TRIM( cn_cfg ), '   nn_cfg = ', nn_cfg
       ENDIF
-      
+
       !
       !           !==  Reference coordinate system  ==!
@@ -240,5 +240,5 @@
          WRITE(numout,*) 'dom_init :   ==>>>   END of domain initialization'
          WRITE(numout,*) '~~~~~~~~'
-         WRITE(numout,*) 
+         WRITE(numout,*)
       ENDIF
       !
@@ -252,5 +252,5 @@
       !! ** Purpose :   initialization of global domain <--> local domain indices
       !!
-      !! ** Method  :   
+      !! ** Method  :
       !!
       !! ** Action  : - mig , mjg : local  domain indices ==> global domain, including halos, indices
@@ -271,6 +271,6 @@
       !
       mig0(:) = mig(:) - nn_hls
-      mjg0(:) = mjg(:) - nn_hls  
-      ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data, 
+      mjg0(:) = mjg(:) - nn_hls
+      ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data,
       ! we must define mig0 and mjg0 as bellow.
       ! Once we decide to forget trunk compatibility, we must simply define mig0 and mjg0 as:
@@ -279,6 +279,6 @@
       !
       !                              ! global domain, including halos, indices ==> local domain indices
-      !                                   ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the 
-      !                                   ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain. 
+      !                                   ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the
+      !                                   ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain.
       DO ji = 1, jpiglo
         mi0(ji) = MAX( 1 , MIN( ji - nimpp + 1, jpi+1 ) )
@@ -387,5 +387,5 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE dom_nam  ***
-      !!                    
+      !!
       !! ** Purpose :   read domaine namelists and print the variables.
       !!
@@ -549,5 +549,5 @@
          !
          IF( .NOT.l_SAS .AND. iom_varid( numror, 'sshb', ldstop = .FALSE. ) <= 0 ) THEN   !- Check absence of one of the Kbb field (here sshb)
-            !                                                                             !  (any Kbb field is missing ==> all Kbb fields are missing) 
+            !                                                                             !  (any Kbb field is missing ==> all Kbb fields are missing)
             IF( .NOT.l_1st_euler ) THEN
                CALL ctl_warn('dom_nam : ssh at Kbb not found in restart files ',   &
@@ -558,7 +558,7 @@
          ENDIF
       ELSEIF( .NOT.l_1st_euler ) THEN                   !*  Initialization case
-         IF(lwp) WRITE(numout,*)  
+         IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*)'   ==>>>   Start from rest (ln_rstart=F)'
-         IF(lwp) WRITE(numout,*)'           an Euler initial time step is used : l_1st_euler is forced to .true. '   
+         IF(lwp) WRITE(numout,*)'           an Euler initial time step is used : l_1st_euler is forced to .true. '
          l_1st_euler = .TRUE.
       ENDIF
@@ -586,5 +586,5 @@
          IF(lwp) WRITE(numout,*)
          SELECT CASE ( nleapy )                !==  Choose calendar for IOIPSL  ==!
-         CASE (  1 ) 
+         CASE (  1 )
             CALL ioconf_calendar('gregorian')
             IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "gregorian", i.e. leap year'
@@ -699,5 +699,5 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE domain_cfg  ***
-      !!                    
+      !!
       !! ** Purpose :   read the domain size in domain configuration file
       !!
@@ -706,6 +706,6 @@
       CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
       INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
-      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes 
-      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c. 
+      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
+      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
       !
       INTEGER ::   inum   ! local integer
@@ -739,6 +739,6 @@
          cd_cfg = 'UNKNOWN'
          kk_cfg = -9999999
-                                          !- or they may be present as global attributes 
-                                          !- (netcdf only)  
+                                          !- or they may be present as global attributes
+                                          !- (netcdf only)
          CALL iom_getatt( inum, 'cn_cfg', cd_cfg )  ! returns   !  if not found
          CALL iom_getatt( inum, 'nn_cfg', kk_cfg )  ! returns -999 if not found
@@ -762,14 +762,14 @@
          WRITE(numout,*) '      type of global domain lateral boundary   jperio = ', kperio
       ENDIF
-      !        
+      !
    END SUBROUTINE domain_cfg
-   
-   
+
+
    SUBROUTINE cfg_write
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE cfg_write  ***
-      !!                   
-      !! ** Purpose :   Create the "cn_domcfg_out" file, a NetCDF file which 
-      !!              contains all the ocean domain informations required to 
+      !!
+      !! ** Purpose :   Create the "cn_domcfg_out" file, a NetCDF file which
+      !!              contains all the ocean domain informations required to
       !!              define an ocean configuration.
       !!
@@ -777,5 +777,5 @@
       !!              ocean configuration.
       !!
-      !! ** output file :   domcfg_out.nc : domain size, characteristics, horizontal 
+      !! ** output file :   domcfg_out.nc : domain size, characteristics, horizontal
       !!                       mesh, Coriolis parameter, and vertical scale factors
       !!                    NB: also contain ORCA family information
@@ -794,12 +794,12 @@
       !                       !  create 'domcfg_out.nc' file  !
       !                       ! ============================= !
-      !         
+      !
       clnam = cn_domcfg_out  ! filename (configuration information)
-      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. )     
+      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. )
       !
       !                             !==  ORCA family specificities  ==!
       IF( TRIM(cn_cfg) == "orca" .OR. TRIM(cn_cfg) == "ORCA" ) THEN
          CALL iom_rstput( 0, 0, inum, 'ORCA'      , 1._wp            , ktype = jp_i4 )
-         CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 )         
+         CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 )
       ENDIF
       !
@@ -823,10 +823,10 @@
       CALL iom_rstput( 0, 0, inum, 'glamv', glamv, ktype = jp_r8 )
       CALL iom_rstput( 0, 0, inum, 'glamf', glamf, ktype = jp_r8 )
-      !                                
+      !
       CALL iom_rstput( 0, 0, inum, 'gphit', gphit, ktype = jp_r8 )   ! longitude
       CALL iom_rstput( 0, 0, inum, 'gphiu', gphiu, ktype = jp_r8 )
       CALL iom_rstput( 0, 0, inum, 'gphiv', gphiv, ktype = jp_r8 )
       CALL iom_rstput( 0, 0, inum, 'gphif', gphif, ktype = jp_r8 )
-      !                                
+      !
       CALL iom_rstput( 0, 0, inum, 'e1t'  , e1t  , ktype = jp_r8 )   ! i-scale factors (e1.)
       CALL iom_rstput( 0, 0, inum, 'e1u'  , e1u  , ktype = jp_r8 )
@@ -843,5 +843,5 @@
       !
       !                             !==  vertical mesh  ==!
-      !                                                     
+      !
       CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d , ktype = jp_r8 )   ! reference 1D-coordinate
       CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d , ktype = jp_r8 )
@@ -854,5 +854,5 @@
       CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0 , ktype = jp_r8 )
       CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0 , ktype = jp_r8 )
-      !                                         
+      !
       !                             !==  wet top and bottom level  ==!   (caution: multiplied by ssmask)
       !
@@ -874,5 +874,5 @@
       !
       !                                ! ============================
-      !                                !        close the files 
+      !                                !        close the files
       !                                ! ============================
       CALL iom_close( inum )
Index: /NEMO/trunk/src/OCE/DOM/domutl.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/domutl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/domutl.F90	(revision 14072)
@@ -31,5 +31,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.2 , NEMO Consortium (2020)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -42,5 +42,5 @@
       !! ** Purpose :   find the closest grid point from a given lon/lat position
       !!
-      !! ** Method  :   look for minimum distance in cylindrical projection 
+      !! ** Method  :   look for minimum distance in cylindrical projection
       !!                -> not good if located at too high latitude...
       !!----------------------------------------------------------------------
@@ -86,5 +86,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_uniq  ***
-      !!                   
+      !!
       !! ** Purpose :   identify unique point of a grid (TUVF)
       !!
@@ -92,6 +92,6 @@
       !!                2) check which elements have been changed
       !!----------------------------------------------------------------------
-      CHARACTER(len=1)        , INTENT(in   ) ::   cdgrd   ! 
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   puniq   ! 
+      CHARACTER(len=1)        , INTENT(in   ) ::   cdgrd   !
+      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   puniq   !
       !
       REAL(wp)                       ::  zshift   ! shift value link to the process number
@@ -101,5 +101,5 @@
       !!----------------------------------------------------------------------
       !
-      ! build an array with different values for each element 
+      ! build an array with different values for each element
       ! in mpp: make sure that these values are different even between process
       ! -> apply a shift value according to the process number
@@ -109,5 +109,5 @@
       puniq(:,:) = ztstref(:,:)                    ! default definition
       CALL lbc_lnk( 'domwri', puniq, cdgrd, 1. )   ! apply boundary conditions
-      lluniq(:,:,1) = puniq(:,:) == ztstref(:,:)   ! check which values have not been changed 
+      lluniq(:,:,1) = puniq(:,:) == ztstref(:,:)   ! check which values have not been changed
       !
       puniq(:,:) = REAL( COUNT( lluniq(:,:,:), dim = 3 ), wp )
Index: /NEMO/trunk/src/OCE/DOM/domvvl.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/domvvl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/domvvl.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE domvvl   ***
-   !! Ocean : 
+   !! Ocean :
    !!======================================================================
    !! History :  2.0  !  2006-06  (B. Levier, L. Marie)  original code
@@ -58,5 +58,5 @@
    !!   Default key      Old management of time varying vertical coordinate
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
    !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness
@@ -73,5 +73,5 @@
    PUBLIC  dom_vvl_sf_update  ! called by step.F90
    PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90
-   
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -109,5 +109,5 @@
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE dom_vvl_init  ***
-      !!                   
+      !!
       !! ** Purpose :  Initialization of all scale factors, depths
       !!               and water column heights
@@ -118,8 +118,8 @@
       !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b)
       !!              - Regrid: e3[u/v](:,:,:,Kmm)
-      !!                        e3[u/v](:,:,:,Kmm)       
-      !!                        e3w(:,:,:,Kmm)           
+      !!                        e3[u/v](:,:,:,Kmm)
+      !!                        e3w(:,:,:,Kmm)
       !!                        e3[u/v]w_b
-      !!                        e3[u/v]w_n      
+      !!                        e3[u/v]w_n
       !!                        gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w
       !!              - h(t/u/v)_0
@@ -151,6 +151,6 @@
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE dom_vvl_init  ***
-      !!                   
-      !! ** Purpose :  Interpolation of all scale factors, 
+      !!
+      !! ** Purpose :  Interpolation of all scale factors,
       !!               depths and water column heights
       !!
@@ -159,8 +159,8 @@
       !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b)
       !!              - Regrid: e3(u/v)_n
-      !!                        e3(u/v)_b       
-      !!                        e3w_n           
-      !!                        e3(u/v)w_b      
-      !!                        e3(u/v)w_n      
+      !!                        e3(u/v)_b
+      !!                        e3w_n
+      !!                        e3(u/v)w_b
+      !!                        e3(u/v)w_n
       !!                        gdept_n, gdepw_n and gde3w_n
       !!              - h(t/u/v)_0
@@ -180,8 +180,8 @@
       CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' )    ! from T to U
       CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' )
-      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V 
+      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V
       CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' )
       CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' )    ! from U to F
-      !                                ! Vertical interpolation of e3t,u,v 
+      !                                ! Vertical interpolation of e3t,u,v
       CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W'  )  ! from T to W
       CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W'  )
@@ -205,14 +205,14 @@
          !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt
          !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf)
-         !                             ! 0.5 where jk = mikt     
+         !                             ! 0.5 where jk = mikt
 !!gm ???????   BUG ?  gdept(:,:,:,Kmm) as well as gde3w  does not include the thickness of ISF ??
          zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) )
          gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm)
          gdept(ji,jj,jk,Kmm) =      zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm))  &
-            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm)) 
+            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm))
          gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm)
          gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb)
          gdept(ji,jj,jk,Kbb) =      zcoef  * ( gdepw(ji,jj,jk  ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb))  &
-            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb)) 
+            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb))
       END_3D
       !
@@ -273,5 +273,5 @@
             IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
                IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2
-                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1      
+                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1
                   ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls
                   frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp
@@ -285,13 +285,13 @@
 
 
-   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall ) 
+   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall )
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE dom_vvl_sf_nxt  ***
-      !!                   
+      !!
       !! ** Purpose :  - compute the after scale factors used in tra_zdf, dynnxt,
       !!                 tranxt and dynspg routines
       !!
       !! ** Method  :  - z_star case:  Repartition of ssh INCREMENT proportionnaly to the level thickness.
-      !!               - z_tilde_case: after scale factor increment = 
+      !!               - z_tilde_case: after scale factor increment =
       !!                                    high frequency part of horizontal divergence
       !!                                  + retsoring towards the background grid
@@ -301,5 +301,5 @@
       !!
       !! ** Action  :  - hdiv_lf    : restoring towards full baroclinic divergence in z_tilde case
-      !!               - tilde_e3t_a: after increment of vertical scale factor 
+      !!               - tilde_e3t_a: after increment of vertical scale factor
       !!                              in z_tilde case
       !!               - e3(t/u/v)_a
@@ -405,5 +405,5 @@
             un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           &
                &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) )
-            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           & 
+            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &
                &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) )
             zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk)
@@ -450,5 +450,5 @@
                WRITE(numout, *) 'at i, j, k=', ijk_max
                WRITE(numout, *) 'MIN( tilde_e3t_a(:,:,:) / e3t_0(:,:,:) ) =', z_tmin
-               WRITE(numout, *) 'at i, j, k=', ijk_min            
+               WRITE(numout, *) 'at i, j, k=', ijk_min
                CALL ctl_stop( 'STOP', 'MAX( ABS( tilde_e3t_a(:,:,: ) ) / e3t_0(:,:,:) ) too high')
             ENDIF
@@ -566,6 +566,6 @@
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE dom_vvl_sf_update  ***
-      !!                   
-      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors 
+      !!
+      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors
       !!               compute all depths and related variables for next time step
       !!               write outputs and restart file
@@ -577,8 +577,8 @@
       !! ** Action  :  - tilde_e3t_(b/n) ready for next time step
       !!               - Recompute:
-      !!                    e3(u/v)_b       
-      !!                    e3w(:,:,:,Kmm)           
-      !!                    e3(u/v)w_b      
-      !!                    e3(u/v)w_n      
+      !!                    e3(u/v)_b
+      !!                    e3w(:,:,:,Kmm)
+      !!                    e3(u/v)w_b
+      !!                    e3(u/v)w_n
       !!                    gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm)  and gde3w
       !!                    h(u/v) and h(u/v)r
@@ -611,5 +611,5 @@
             tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:)
          ELSE
-            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) & 
+            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) &
             &         + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) )
          ENDIF
@@ -623,7 +623,7 @@
       ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt
       ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also
-      
+
       CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F'  )
-      
+
       ! Vertical scale factor interpolations
       CALL dom_vvl_interpol( e3t(:,:,:,Kmm),  e3w(:,:,:,Kmm), 'W'  )
@@ -644,5 +644,5 @@
          gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm)
          gdept(ji,jj,jk,Kmm) =    zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) )  &
-             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) ) 
+             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) )
          gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm)
       END_3D
@@ -763,5 +763,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE dom_vvl_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write VVL file in restart file
       !!
@@ -807,5 +807,5 @@
             IF(lwp) WRITE(numout,*)    '          Kmm scale factor read in the restart file'
             CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
-            WHERE ( tmask(:,:,:) == 0.0_wp ) 
+            WHERE ( tmask(:,:,:) == 0.0_wp )
                e3t(:,:,:,Kmm) = e3t_0(:,:,:)
             END WHERE
@@ -816,5 +816,5 @@
                IF(lwp) WRITE(numout,*) '          Kbb scale factor read in the restart file'
                CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
-               WHERE ( tmask(:,:,:) == 0.0_wp ) 
+               WHERE ( tmask(:,:,:) == 0.0_wp )
                   e3t(:,:,:,Kbb) = e3t_0(:,:,:)
                END WHERE
@@ -840,5 +840,5 @@
                      CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) )
                   ENDIF
-               ELSE 
+               ELSE
                   tilde_e3t_b(:,:,:) = 0.0_wp
                   tilde_e3t_n(:,:,:) = 0.0_wp
@@ -850,5 +850,5 @@
                      CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) )
                   ELSE                ! array is missing
-                     hdiv_lf(:,:,:) = 0.0_wp 
+                     hdiv_lf(:,:,:) = 0.0_wp
                   ENDIF
                ENDIF
@@ -884,5 +884,5 @@
             CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:))
          END IF
-         !                                           ! -------------!    
+         !                                           ! -------------!
          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
             !                                        ! ------------ !
@@ -898,5 +898,5 @@
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE dom_vvl_ctl  ***
-      !!                
+      !!
       !! ** Purpose :   Control the consistency between namelist options
       !!                for vertical coordinate
@@ -907,5 +907,5 @@
          &              ln_vvl_zstar_at_eqtor      , rn_ahe3     , rn_rst_e3t            , &
          &              rn_lf_cutoff               , rn_zdef_max , ln_vvl_dbg                ! not yet implemented: ln_vvl_kepe
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !
       READ  ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901)
Index: /NEMO/trunk/src/OCE/DOM/dtatsd.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/dtatsd.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/dtatsd.F90	(revision 14072)
@@ -6,6 +6,6 @@
    !! History :  OPA  ! 1991-03  ()  Original code
    !!             -   ! 1992-07  (M. Imbard)
-   !!            8.0  ! 1999-10  (M.A. Foujols, M. Imbard)  NetCDF FORMAT 
-   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module 
+   !!            8.0  ! 1999-10  (M.A. Foujols, M. Imbard)  NetCDF FORMAT
+   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module
    !!            3.3  ! 2010-10  (C. Bricaud, S. Masson)  use of fldread
    !!            3.4  ! 2010-11  (G. Madec, C. Ethe) Merge of dtatem and dtasal + remove CPP keys
@@ -40,5 +40,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -48,9 +48,9 @@
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE dta_tsd_init  ***
-      !!                    
-      !! ** Purpose :   initialisation of T & S input data 
-      !! 
+      !!
+      !! ** Purpose :   initialisation of T & S input data
+      !!
       !! ** Method  : - Read namtsd namelist
-      !!              - allocates T & S data structure 
+      !!              - allocates T & S data structure
       !!----------------------------------------------------------------------
       LOGICAL, INTENT(in), OPTIONAL ::   ld_tradmp   ! force the initialization when tradp is used
@@ -75,5 +75,5 @@
 
       IF( PRESENT( ld_tradmp ) )   ln_tsd_dmp = .TRUE.     ! forces the initialization when tradmp is used
-      
+
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
@@ -124,9 +124,9 @@
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE dta_tsd  ***
-      !!                    
+      !!
       !! ** Purpose :   provides T and S data at kt
-      !! 
+      !!
       !! ** Method  : - call fldread routine
-      !!              - ORCA_R2: add some hand made alteration to read data  
+      !!              - ORCA_R2: add some hand made alteration to read data
       !!              - 'key_orca_lev10' interpolates on 10 times more levels
       !!              - s- or mixed z-s coordinate: vertical interpolation on model mesh
@@ -211,5 +211,5 @@
                      IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
                         zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
-                        ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi 
+                        ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi
                         zsp(jk) = ptsd(ji,jj,jkk,jp_sal) + ( ptsd(ji,jj,jkk+1,jp_sal) - ptsd(ji,jj,jkk,jp_sal) ) * zi
                      ENDIF
@@ -224,7 +224,7 @@
             ptsd(ji,jj,jpk,jp_sal) = 0._wp
          END_2D
-         ! 
+         !
       ELSE                                !==   z- or zps- coordinate   ==!
-         !                             
+         !
          DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
             ptsd(ji,jj,jk,jp_tem) = ptsd(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)    ! Mask
@@ -235,5 +235,5 @@
             ! NOTE: [tiling-comms-merge] This fix was necessary to take out tra_adv lbc_lnk statements in the zps case
             DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-               ik = mbkt(ji,jj) 
+               ik = mbkt(ji,jj)
                IF( ik > 1 ) THEN
                   zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
@@ -243,5 +243,5 @@
                ik = mikt(ji,jj)
                IF( ik > 1 ) THEN
-                  zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 
+                  zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
                   ptsd(ji,jj,ik,jp_tem) = (1.-zl) * ptsd(ji,jj,ik,jp_tem) + zl * ptsd(ji,jj,ik+1,jp_tem)
                   ptsd(ji,jj,ik,jp_sal) = (1.-zl) * ptsd(ji,jj,ik,jp_sal) + zl * ptsd(ji,jj,ik+1,jp_sal)
@@ -252,5 +252,5 @@
       ENDIF
       !
-      IF( .NOT.ln_tsd_dmp ) THEN                   !==   deallocate T & S structure   ==! 
+      IF( .NOT.ln_tsd_dmp ) THEN                   !==   deallocate T & S structure   ==!
          !                                              (data used only for initialisation)
          IF(lwp) WRITE(numout,*) 'dta_tsd: deallocte T & S arrays as they are only use to initialize the run'
Index: /NEMO/trunk/src/OCE/DOM/phycst.F90
===================================================================
--- /NEMO/trunk/src/OCE/DOM/phycst.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DOM/phycst.F90	(revision 14072)
@@ -7,7 +7,7 @@
    !!             8.1  !  1991-11  (G. Madec, M. Imbard)  cosmetic changes
    !!   NEMO      1.0  !  2002-08  (G. Madec, C. Ethe)  F90, add ice constants
-   !!              -   !  2006-08  (G. Madec)  style 
-   !!             3.2  !  2006-08  (S. Masson, G. Madec)  suppress useless variables + style 
-   !!             3.4  !  2011-11  (C. Harris)  minor changes for CICE constants 
+   !!              -   !  2006-08  (G. Madec)  style
+   !!             3.2  !  2006-08  (S. Masson, G. Madec)  suppress useless variables + style
+   !!             3.4  !  2011-11  (C. Harris)  minor changes for CICE constants
    !!----------------------------------------------------------------------
 
@@ -26,5 +26,5 @@
    REAL(wp), PUBLIC ::   rad      = 3.141592653589793_wp / 180._wp   !: conversion from degre into radian
    REAL(wp), PUBLIC ::   rsmall   = 0.5 * EPSILON( 1.e0 )            !: smallest real computer value
-   
+
    REAL(wp), PUBLIC ::   rday     = 24.*60.*60.      !: day                                [s]
    REAL(wp), PUBLIC ::   rsiyea                      !: sideral year                       [s]
@@ -36,5 +36,5 @@
    REAL(wp), PUBLIC ::   omega                       !: earth rotation parameter           [s-1]
    REAL(wp), PUBLIC ::   ra       = 6371229._wp      !: earth radius                       [m]
-   REAL(wp), PUBLIC ::   grav     = 9.80665_wp       !: gravity                            [m/s2]   
+   REAL(wp), PUBLIC ::   grav     = 9.80665_wp       !: gravity                            [m/s2]
    REAL(wp), PUBLIC ::   rt0      = 273.15_wp        !: freezing point of fresh water [Kelvin]
 
@@ -43,5 +43,5 @@
    REAL(wp), PUBLIC ::   rcp                         !: ocean specific heat           [J/Kelvin]
    REAL(wp), PUBLIC ::   r1_rcp                      !: = 1. / rcp                    [Kelvin/J]
-   REAL(wp), PUBLIC ::   rho0_rcp                    !: = rho0 * rcp 
+   REAL(wp), PUBLIC ::   rho0_rcp                    !: = rho0 * rcp
    REAL(wp), PUBLIC ::   r1_rho0_rcp                 !: = 1. / ( rho0 * rcp )
 
@@ -52,5 +52,6 @@
    REAL(wp), PUBLIC ::   rLevap   =    2.5e+6_wp     !: latent heat of evaporation (water)
    REAL(wp), PUBLIC ::   vkarmn   =    0.4_wp        !: von Karman constant
-   REAL(wp), PUBLIC ::   stefan   =    5.67e-8_wp    !: Stefan-Boltzmann constant 
+   REAL(wp), PUBLIC ::   vkarmn2  =    0.4_wp*0.4_wp !: square of von Karman constant
+   REAL(wp), PUBLIC ::   stefan   =    5.67e-8_wp    !: Stefan-Boltzmann constant
 
    REAL(wp), PUBLIC ::   rhos     =  330._wp         !: volumic mass of snow                                  [kg/m3]
@@ -66,13 +67,13 @@
    REAL(wp), PUBLIC ::   r1_rhos                     !: 1 / rhos
    REAL(wp), PUBLIC ::   r1_rcpi                     !: 1 / rcpi
-   
+
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
-   
+
 CONTAINS
-   
+
    SUBROUTINE phy_cst
       !!----------------------------------------------------------------------
@@ -87,5 +88,5 @@
       omega  = 7.292116e-05
 #else
-      omega  = 2._wp * rpi / rsiday 
+      omega  = 2._wp * rpi / rsiday
 #endif
 
@@ -126,6 +127,6 @@
          WRITE(numout,*) '      salinity of ice (for pisces)              = ', sice    , ' psu'
          WRITE(numout,*) '      salinity of sea (for pisces and isf)      = ', soce    , ' psu'
-         WRITE(numout,*) '      latent heat of evaporation (water)        = ', rLevap  , ' J/m^3' 
-         WRITE(numout,*) '      von Karman constant                       = ', vkarmn 
+         WRITE(numout,*) '      latent heat of evaporation (water)        = ', rLevap  , ' J/m^3'
+         WRITE(numout,*) '      von Karman constant                       = ', vkarmn
          WRITE(numout,*) '      Stefan-Boltzmann constant                 = ', stefan  , ' J/s/m^2/K^4'
          WRITE(numout,*)
Index: /NEMO/trunk/src/OCE/DYN/dynatf.F90
===================================================================
--- /NEMO/trunk/src/OCE/DYN/dynatf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DYN/dynatf.F90	(revision 14072)
@@ -13,5 +13,5 @@
    !!             -   !  2002-10  (C. Talandier, A-M. Treguier) Open boundary cond.
    !!            2.0  !  2005-11  (V. Garnier) Surface pressure gradient organization
-   !!            2.3  !  2007-07  (D. Storkey) Calls to BDY routines. 
+   !!            2.3  !  2007-07  (D. Storkey) Calls to BDY routines.
    !!            3.2  !  2009-06  (G. Madec, R.Benshila)  re-introduce the vvl option
    !!            3.3  !  2010-09  (D. Storkey, E.O'Dea) Bug fix for BDY module
@@ -22,5 +22,5 @@
    !!            4.1  !  2019-08  (A. Coward, D. Storkey) Rename dynnxt.F90 -> dynatf.F90. Now just does time filtering.
    !!-------------------------------------------------------------------------
-  
+
    !!----------------------------------------------------------------------------------------------
    !!   dyn_atf       : apply Asselin time filtering to "now" velocities and vertical scale factors
@@ -42,5 +42,5 @@
    USE trdken         ! trend manager: kinetic energy
    USE isf_oce   , ONLY: ln_isf     ! ice shelf
-   USE isfdynatf , ONLY: isf_dynatf ! ice shelf volume filter correction subroutine 
+   USE isfdynatf , ONLY: isf_dynatf ! ice shelf volume filter correction subroutine
    !
    USE in_out_manager ! I/O manager
@@ -81,5 +81,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -89,6 +89,6 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dyn_atf  ***
-      !!                   
-      !! ** Purpose :   Finalize after horizontal velocity. Apply the boundary 
+      !!
+      !! ** Purpose :   Finalize after horizontal velocity. Apply the boundary
       !!             condition on the after velocity and apply the Asselin time
       !!             filter to the now fields.
@@ -97,5 +97,5 @@
       !!             estimate (ln_dynspg_ts=T)
       !!
-      !!              * Apply lateral boundary conditions on after velocity 
+      !!              * Apply lateral boundary conditions on after velocity
       !!             at the local domain boundaries through lbc_lnk call,
       !!             at the one-way open boundaries (ln_bdy=T),
@@ -104,5 +104,5 @@
       !!              * Apply the Asselin time filter to the now fields
       !!             arrays to start the next time step:
-      !!                (puu(Kmm),pvv(Kmm)) = (puu(Kmm),pvv(Kmm)) 
+      !!                (puu(Kmm),pvv(Kmm)) = (puu(Kmm),pvv(Kmm))
       !!                                    + rn_atfp [ (puu(Kbb),pvv(Kbb)) + (puu(Kaa),pvv(Kaa)) - 2 (puu(Kmm),pvv(Kmm)) ]
       !!             Note that with flux form advection and non linear free surface,
@@ -110,5 +110,5 @@
       !!             As a result, dyn_atf MUST be called after tra_atf.
       !!
-      !! ** Action :   puu(Kmm),pvv(Kmm)   filtered now horizontal velocity 
+      !! ** Action :   puu(Kmm),pvv(Kmm)   filtered now horizontal velocity
       !!----------------------------------------------------------------------
       INTEGER                             , INTENT(in   ) :: kt               ! ocean time-step index
@@ -122,5 +122,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   zue, zve, zwfld
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   zutau, zvtau
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ze3t_f, ze3u_f, ze3v_f, zua, zva 
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ze3t_f, ze3u_f, ze3v_f, zua, zva
       !!----------------------------------------------------------------------
       !
@@ -150,17 +150,17 @@
          !
          IF( .NOT.ln_bt_fw ) THEN
-            ! Remove advective velocity from "now velocities" 
-            ! prior to asselin filtering     
-            ! In the forward case, this is done below after asselin filtering   
-            ! so that asselin contribution is removed at the same time 
+            ! Remove advective velocity from "now velocities"
+            ! prior to asselin filtering
+            ! In the forward case, this is done below after asselin filtering
+            ! so that asselin contribution is removed at the same time
             DO jk = 1, jpkm1
                puu(:,:,jk,Kmm) = ( puu(:,:,jk,Kmm) - un_adv(:,:)*r1_hu(:,:,Kmm) + uu_b(:,:,Kmm) )*umask(:,:,jk)
                pvv(:,:,jk,Kmm) = ( pvv(:,:,jk,Kmm) - vn_adv(:,:)*r1_hv(:,:,Kmm) + vv_b(:,:,Kmm) )*vmask(:,:,jk)
-            END DO  
+            END DO
          ENDIF
       ENDIF
 
       ! Update after velocity on domain lateral boundaries
-      ! --------------------------------------------------      
+      ! --------------------------------------------------
 # if defined key_agrif
       CALL Agrif_dyn( kt )             !* AGRIF zoom boundaries
@@ -194,6 +194,6 @@
       ! Time filter and swap of dynamics arrays
       ! ------------------------------------------
-         
-      IF( .NOT. l_1st_euler ) THEN    !* Leap-Frog : Asselin time filter 
+
+      IF( .NOT. l_1st_euler ) THEN    !* Leap-Frog : Asselin time filter
          !                                ! =============!
          IF( ln_linssh ) THEN             ! Fixed volume !
@@ -220,5 +220,5 @@
             DO jk = 1, jpkm1
                ze3t_f(:,:,jk) = ze3t_f(:,:,jk) - zcoef * zwfld(:,:) * tmask(:,:,jk) &
-                              &                        * pe3t(:,:,jk,Kmm) / ( ht(:,:) + 1._wp - ssmask(:,:) ) 
+                              &                        * pe3t(:,:,jk,Kmm) / ( ht(:,:) + 1._wp - ssmask(:,:) )
             END DO
             !
@@ -257,5 +257,5 @@
                   pvv(ji,jj,jk,Kmm) = ( zve3n + rn_atfp * ( zve3b - 2._wp * zve3n  + zve3a ) ) / ze3v_f(ji,jj,jk)
                END_3D
-               pe3u(:,:,1:jpkm1,Kmm) = ze3u_f(:,:,1:jpkm1)  
+               pe3u(:,:,1:jpkm1,Kmm) = ze3u_f(:,:,1:jpkm1)
                pe3v(:,:,1:jpkm1,Kmm) = ze3v_f(:,:,1:jpkm1)
                !
@@ -268,10 +268,10 @@
          IF( ln_dynspg_ts .AND. ln_bt_fw ) THEN
             ! Revert filtered "now" velocities to time split estimate
-            ! Doing it here also means that asselin filter contribution is removed  
+            ! Doing it here also means that asselin filter contribution is removed
             zue(:,:) = pe3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1)
-            zve(:,:) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1)    
+            zve(:,:) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1)
             DO jk = 2, jpkm1
                zue(:,:) = zue(:,:) + pe3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk)
-               zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk)    
+               zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk)
             END DO
             DO jk = 1, jpkm1
@@ -325,7 +325,7 @@
       IF ( iom_use("utau") ) THEN
          IF ( ln_drgice_imp.OR.ln_isfcav ) THEN
-            ALLOCATE(zutau(jpi,jpj)) 
+            ALLOCATE(zutau(jpi,jpj))
             DO_2D( 0, 0, 0, 0 )
-               jk = miku(ji,jj) 
+               jk = miku(ji,jj)
                zutau(ji,jj) = utau(ji,jj) + 0.5_wp * rho0 * ( rCdU_top(ji+1,jj)+rCdU_top(ji,jj) ) * puu(ji,jj,jk,Kaa)
             END_2D
@@ -353,5 +353,5 @@
       IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Kaa), clinfo1=' nxt  - puu(:,:,:,Kaa): ', mask1=umask,   &
          &                                  tab3d_2=pvv(:,:,:,Kaa), clinfo2=' pvv(:,:,:,Kaa): '       , mask2=vmask )
-      ! 
+      !
       IF( ln_dynspg_ts )   DEALLOCATE( zue, zve )
       IF( l_trddyn     )   DEALLOCATE( zua, zva )
Index: /NEMO/trunk/src/OCE/DYN/dynspg.F90
===================================================================
--- /NEMO/trunk/src/OCE/DYN/dynspg.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DYN/dynspg.F90	(revision 14072)
@@ -11,5 +11,5 @@
 
    !!----------------------------------------------------------------------
-   !!   dyn_spg     : update the dynamics trend with surface pressure gradient 
+   !!   dyn_spg     : update the dynamics trend with surface pressure gradient
    !!   dyn_spg_init: initialization, namelist read, and parameters control
    !!----------------------------------------------------------------------
@@ -39,5 +39,5 @@
    PUBLIC   dyn_spg_init   ! routine called by opa module
 
-   INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from lk_dynspg_... 
+   INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from lk_dynspg_...
 
    !                       ! Parameter to control the surface pressure gradient scheme
@@ -52,5 +52,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -61,5 +61,5 @@
       !!                  ***  ROUTINE dyn_spg  ***
       !!
-      !! ** Purpose :   compute surface pressure gradient including the 
+      !! ** Purpose :   compute surface pressure gradient including the
       !!              atmospheric pressure forcing (ln_apr_dyn=T).
       !!
@@ -68,5 +68,5 @@
       !!              - split-explicit : a time splitting technique is used
       !!
-      !!              ln_apr_dyn=T : the atmospheric pressure forcing is applied 
+      !!              ln_apr_dyn=T : the atmospheric pressure forcing is applied
       !!             as the gradient of the inverse barometer ssh:
       !!                apgu = - 1/rho0 di[apr] = 0.5*grav di[ssh_ib+ssh_ibb]
@@ -90,5 +90,5 @@
       !
       IF( l_trddyn )   THEN                      ! temporary save of ta and sa trends
-         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) ) 
+         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )
          ztrdu(:,:,:) = puu(:,:,:,Krhs)
          ztrdv(:,:,:) = pvv(:,:,:,Krhs)
@@ -144,5 +144,5 @@
                zpgv(ji,jj) = zpgv(ji,jj) + ( zpice(ji,jj+1) - zpice(ji,jj) ) * r1_e2v(ji,jj)
             END_2D
-            DEALLOCATE( zpice )         
+            DEALLOCATE( zpice )
          ENDIF
          !
@@ -160,5 +160,5 @@
          !
 !!gm add here a call to dyn_trd for ice pressure gradient, the surf pressure trends ????
-         !    
+         !
       ENDIF
       !
@@ -167,10 +167,10 @@
       CASE ( np_TS  )   ;   CALL dyn_spg_ts ( kt, Kbb, Kmm, Krhs, puu, pvv, pssh, puu_b, pvv_b, Kaa ) ! time-splitting
       END SELECT
-      !                    
+      !
       IF( l_trddyn )   THEN                  ! save the surface pressure gradient trends for further diagnostics
          ztrdu(:,:,:) = puu(:,:,:,Krhs) - ztrdu(:,:,:)
          ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:)
          CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt, Kmm )
-         DEALLOCATE( ztrdu , ztrdv ) 
+         DEALLOCATE( ztrdu , ztrdv )
       ENDIF
       !                                      ! print mean trends (used for debugging)
@@ -186,6 +186,6 @@
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE dyn_spg_init  ***
-      !!                
-      !! ** Purpose :   Control the consistency between namelist options for 
+      !!
+      !! ** Purpose :   Control the consistency between namelist options for
       !!              surface pressure gradient schemes
       !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/OCE/DYN/dynvor.F90
===================================================================
--- /NEMO/trunk/src/OCE/DYN/dynvor.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DYN/dynvor.F90	(revision 14072)
@@ -15,5 +15,5 @@
    !!            3.2  ! 2009-04  (R. Benshila)  vvl: correction of een scheme
    !!            3.3  ! 2010-10  (C. Ethe, G. Madec)  reorganisation of initialisation phase
-   !!            3.7  ! 2014-04  (G. Madec)  trend simplification: suppress jpdyn_trd_dat vorticity 
+   !!            3.7  ! 2014-04  (G. Madec)  trend simplification: suppress jpdyn_trd_dat vorticity
    !!             -   ! 2014-06  (G. Madec)  suppression of velocity curl from in-core memory
    !!             -   ! 2016-12  (G. Madec, E. Clementi) add Stokes-Coriolis trends (ln_stcor=T)
@@ -74,5 +74,5 @@
    INTEGER, PUBLIC, PARAMETER ::   np_MIX = 5   ! MIX scheme
 
-   INTEGER ::   ncor, nrvm, ntot   ! choice of calculated vorticity 
+   INTEGER ::   ncor, nrvm, ntot   ! choice of calculated vorticity
    !                               ! associated indices:
    INTEGER, PUBLIC, PARAMETER ::   np_COR = 1         ! Coriolis (planetary)
@@ -83,14 +83,14 @@
 
    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   di_e2u_2        ! = di(e2u)/2          used in T-point metric term calculation
-   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1v_2        ! = dj(e1v)/2           -        -      -       - 
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1v_2        ! = dj(e1v)/2           -        -      -       -
    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   di_e2v_2e1e2f   ! = di(e2u)/(2*e1e2f)  used in F-point metric term calculation
    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1u_2e1e2f   ! = dj(e1v)/(2*e1e2f)   -        -      -       -
    !
    REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   e3f_0vor   ! e3f used in EEN, ENE and ENS cases (key_qco only)
-   
+
    REAL(wp) ::   r1_4  = 0.250_wp         ! =1/4
    REAL(wp) ::   r1_8  = 0.125_wp         ! =1/8
    REAL(wp) ::   r1_12 = 1._wp / 12._wp   ! 1/12
-   
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -111,5 +111,5 @@
       !! ** Action : - Update (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) with the now vorticity term trend
       !!             - save the trends in (ztrdu,ztrdv) in 2 parts (relative
-      !!               and planetary vorticity trends) and send them to trd_dyn 
+      !!               and planetary vorticity trends) and send them to trd_dyn
       !!               for futher diagnostics (l_trddyn=T)
       !!----------------------------------------------------------------------
@@ -163,5 +163,5 @@
                              CALL vor_enT( kt, Kmm, ntot, puu(:,:,:,Kmm) , pvv(:,:,:,Kmm) , puu(:,:,:,Krhs), pvv(:,:,:,Krhs) )   ! total vorticity trend
             IF( ln_stcor .AND. .NOT. ln_vortex_force )  THEN
-                             CALL vor_enT( kt, Kmm, ncor, usd, vsd, puu(:,:,:,Krhs), pvv(:,:,:,Krhs) )   ! add the Stokes-Coriolis trend 
+                             CALL vor_enT( kt, Kmm, ncor, usd, vsd, puu(:,:,:,Krhs), pvv(:,:,:,Krhs) )   ! add the Stokes-Coriolis trend
             ELSE IF( ln_stcor .AND. ln_vortex_force )   THEN
                              CALL vor_enT( kt, Kmm, ntot, usd, vsd, puu(:,:,:,Krhs), pvv(:,:,:,Krhs) )   ! add the Stokes-Coriolis trend and vortex force
@@ -218,11 +218,11 @@
       !!                  ***  ROUTINE vor_enT  ***
       !!
-      !! ** Purpose :   Compute the now total vorticity trend and add it to 
+      !! ** Purpose :   Compute the now total vorticity trend and add it to
       !!      the general trend of the momentum equation.
       !!
-      !! ** Method  :   Trend evaluated using now fields (centered in time) 
+      !! ** Method  :   Trend evaluated using now fields (centered in time)
       !!       and t-point evaluation of vorticity (planetary and relative).
       !!       conserves the horizontal kinetic energy.
-      !!         The general trend of momentum is increased due to the vorticity 
+      !!         The general trend of momentum is increased due to the vorticity
       !!       term which is given by:
       !!          voru = 1/bu  mj[ ( mi(mj(bf*rvor))+bt*f_t)/e3t  mj[vn] ]
@@ -260,5 +260,5 @@
                   &             - e1u(ji,jj+1) * pu(ji,jj+1,jk) + e1u(ji,jj) * pu(ji,jj,jk)  ) * r1_e1e2f(ji,jj)
             END_2D
-            IF( ln_dynvor_msk ) THEN                     ! mask relative vorticity 
+            IF( ln_dynvor_msk ) THEN                     ! mask relative vorticity
                DO_2D( 1, 0, 1, 0 )
                   zwz(ji,jj,jk) = zwz(ji,jj,jk) * fmask(ji,jj,jk)
@@ -314,6 +314,6 @@
                !
             pv_rhs(ji,jj,jk) = pv_rhs(ji,jj,jk) - r1_4 * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm)                    &
-               &                                * (  zwt(ji,jj+1) * ( pu(ji,jj+1,jk) + pu(ji-1,jj+1,jk) )   & 
-               &                                   + zwt(ji,jj  ) * ( pu(ji,jj  ,jk) + pu(ji-1,jj  ,jk) )   ) 
+               &                                * (  zwt(ji,jj+1) * ( pu(ji,jj+1,jk) + pu(ji-1,jj+1,jk) )   &
+               &                                   + zwt(ji,jj  ) * ( pu(ji,jj  ,jk) + pu(ji-1,jj  ,jk) )   )
          END_2D
          !                                             ! ===============
@@ -332,11 +332,11 @@
       !!                  ***  ROUTINE vor_ene  ***
       !!
-      !! ** Purpose :   Compute the now total vorticity trend and add it to 
+      !! ** Purpose :   Compute the now total vorticity trend and add it to
       !!      the general trend of the momentum equation.
       !!
-      !! ** Method  :   Trend evaluated using now fields (centered in time) 
+      !! ** Method  :   Trend evaluated using now fields (centered in time)
       !!       and the Sadourny (1975) flux form formulation : conserves the
       !!       horizontal kinetic energy.
-      !!         The general trend of momentum is increased due to the vorticity 
+      !!         The general trend of momentum is increased due to the vorticity
       !!       term which is given by:
       !!          voru = 1/e1u  mj-1[ (rvor+f)/e3f  mi(e1v*e3v pvv(:,:,:,Kmm)) ]
@@ -371,5 +371,5 @@
          SELECT CASE( kvor )                 !==  vorticity considered  ==!
          CASE ( np_COR )                           !* Coriolis (planetary vorticity)
-            zwz(:,:) = ff_f(:,:) 
+            zwz(:,:) = ff_f(:,:)
          CASE ( np_RVO )                           !* relative vorticity
             DO_2D( 1, 0, 1, 0 )
@@ -447,5 +447,5 @@
             zx2 = zwx(ji  ,jj) + zwx(ji  ,jj+1)
             pu_rhs(ji,jj,jk) = pu_rhs(ji,jj,jk) + r1_4 * r1_e1u(ji,jj) * ( zwz(ji  ,jj-1) * zy1 + zwz(ji,jj) * zy2 )
-            pv_rhs(ji,jj,jk) = pv_rhs(ji,jj,jk) - r1_4 * r1_e2v(ji,jj) * ( zwz(ji-1,jj  ) * zx1 + zwz(ji,jj) * zx2 ) 
+            pv_rhs(ji,jj,jk) = pv_rhs(ji,jj,jk) - r1_4 * r1_e2v(ji,jj) * ( zwz(ji-1,jj  ) * zx1 + zwz(ji,jj) * zx2 )
          END_2D
          !                                             ! ===============
@@ -497,5 +497,5 @@
          SELECT CASE( kvor )                 !==  vorticity considered  ==!
          CASE ( np_COR )                           !* Coriolis (planetary vorticity)
-            zwz(:,:) = ff_f(:,:) 
+            zwz(:,:) = ff_f(:,:)
          CASE ( np_RVO )                           !* relative vorticity
             DO_2D( 1, 0, 1, 0 )
@@ -586,9 +586,9 @@
       !!                ***  ROUTINE vor_een  ***
       !!
-      !! ** Purpose :   Compute the now total vorticity trend and add it to 
+      !! ** Purpose :   Compute the now total vorticity trend and add it to
       !!      the general trend of the momentum equation.
       !!
-      !! ** Method  :   Trend evaluated using now fields (centered in time) 
-      !!      and the Arakawa and Lamb (1980) flux form formulation : conserves 
+      !! ** Method  :   Trend evaluated using now fields (centered in time)
+      !!      and the Arakawa and Lamb (1980) flux form formulation : conserves
       !!      both the horizontal kinetic energy and the potential enstrophy
       !!      when horizontal divergence is zero (see the NEMO documentation)
@@ -684,5 +684,5 @@
             IF( ln_dynvor_msk ) THEN                     ! mask the relative vorticity
                DO_2D( 1, 0, 1, 0 )
-                  zwz(ji,jj,jk) = ( zwz(ji,jj,jk) - ff_f(ji,jj) ) * fmask(ji,jj,jk) + ff_f(ji,jj) 
+                  zwz(ji,jj,jk) = ( zwz(ji,jj,jk) - ff_f(ji,jj) ) * fmask(ji,jj,jk) + ff_f(ji,jj)
                END_2D
             ENDIF
@@ -735,11 +735,11 @@
       !!                ***  ROUTINE vor_eeT  ***
       !!
-      !! ** Purpose :   Compute the now total vorticity trend and add it to 
+      !! ** Purpose :   Compute the now total vorticity trend and add it to
       !!      the general trend of the momentum equation.
       !!
-      !! ** Method  :   Trend evaluated using now fields (centered in time) 
-      !!      and the Arakawa and Lamb (1980) vector form formulation using 
+      !! ** Method  :   Trend evaluated using now fields (centered in time)
+      !!      and the Arakawa and Lamb (1980) vector form formulation using
       !!      a modified version of Arakawa and Lamb (1980) scheme (see vor_een).
-      !!      The change consists in 
+      !!      The change consists in
       !!      Add this trend to the general momentum trend (pu_rhs,pv_rhs).
       !!
@@ -758,5 +758,5 @@
       REAL(wp) ::   zua, zva       ! local scalars
       REAL(wp) ::   zmsk, z1_e3t   ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj)       ::   zwx , zwy 
+      REAL(wp), DIMENSION(jpi,jpj)       ::   zwx , zwy
       REAL(wp), DIMENSION(jpi,jpj)       ::   ztnw, ztne, ztsw, ztse
       REAL(wp), DIMENSION(jpi,jpj,jpkm1) ::   zwz   ! 3D workspace, avoid lbc_lnk on jpk that is not defined
@@ -803,5 +803,5 @@
             IF( ln_dynvor_msk ) THEN                     ! mask the relative vorticity
                DO_2D( 1, 0, 1, 0 )
-                  zwz(ji,jj,jk) = ( zwz(ji,jj,jk) - ff_f(ji,jj) ) * fmask(ji,jj,jk) + ff_f(ji,jj) 
+                  zwz(ji,jj,jk) = ( zwz(ji,jj,jk) - ff_f(ji,jj) ) * fmask(ji,jj,jk) + ff_f(ji,jj)
                END_2D
             ENDIF
@@ -916,5 +916,5 @@
       !
       IF( ioptio /= 1 ) CALL ctl_stop( ' use ONE and ONLY one vorticity scheme' )
-      !                      
+      !
       IF(lwp) WRITE(numout,*)        ! type of calculated vorticity (set ncor, nrvm, ntot)
       ncor = np_COR                       ! planetary vorticity
@@ -925,7 +925,7 @@
          ntot = np_COR        !     -         -
       CASE( np_VEC_c2  )
-         IF(lwp) WRITE(numout,*) '   ==>>>   vector form dynamics : total vorticity = Coriolis + relative vorticity' 
+         IF(lwp) WRITE(numout,*) '   ==>>>   vector form dynamics : total vorticity = Coriolis + relative vorticity'
          nrvm = np_RVO        ! relative vorticity
-         ntot = np_CRV        ! relative + planetary vorticity         
+         ntot = np_CRV        ! relative + planetary vorticity
       CASE( np_FLX_c2 , np_FLX_ubs  )
          IF(lwp) WRITE(numout,*) '   ==>>>   flux form dynamics : total vorticity = Coriolis + metric term'
@@ -971,5 +971,5 @@
                   &  + tmask(ji,jj  ,jk) +tmask(ji+1,jj  ,jk)  )
                !
-               IF( zmsk /= 0._wp ) THEN 
+               IF( zmsk /= 0._wp ) THEN
                   e3f_0vor(ji,jj,jk) = (   e3t_0(ji  ,jj+1,jk)*tmask(ji  ,jj+1,jk)   &
                      &                   + e3t_0(ji+1,jj+1,jk)*tmask(ji+1,jj+1,jk)   &
@@ -997,5 +997,5 @@
          CASE( np_EEN )   ;   WRITE(numout,*) '   ==>>>   energy and enstrophy conserving scheme (EEN)'
          CASE( np_MIX )   ;   WRITE(numout,*) '   ==>>>   mixed enstrophy/energy conserving scheme (MIX)'
-         END SELECT         
+         END SELECT
       ENDIF
       !
Index: /NEMO/trunk/src/OCE/DYN/dynzad.F90
===================================================================
--- /NEMO/trunk/src/OCE/DYN/dynzad.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/DYN/dynzad.F90	(revision 14072)
@@ -7,5 +7,5 @@
    !!   NEMO     0.5  ! 2002-07  (G. Madec) Free form, F90
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
    !!   dyn_zad       : vertical advection momentum trend
@@ -25,5 +25,5 @@
    IMPLICIT NONE
    PRIVATE
-   
+
    PUBLIC   dyn_zad       ! routine called by dynadv.F90
 
@@ -41,6 +41,6 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dynzad  ***
-      !! 
-      !! ** Purpose :   Compute the now vertical momentum advection trend and 
+      !!
+      !! ** Purpose :   Compute the now vertical momentum advection trend and
       !!      add it to the general trend of momentum equation.
       !!
@@ -73,9 +73,9 @@
 
       IF( l_trddyn )   THEN           ! Save puu(:,:,:,Krhs) and pvv(:,:,:,Krhs) trends
-         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) ) 
-         ztrdu(:,:,:) = puu(:,:,:,Krhs) 
-         ztrdv(:,:,:) = pvv(:,:,:,Krhs) 
+         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )
+         ztrdu(:,:,:) = puu(:,:,:,Krhs)
+         ztrdv(:,:,:) = pvv(:,:,:,Krhs)
       ENDIF
-      
+
       DO jk = 2, jpkm1                ! Vertical momentum advection at level w and u- and v- vertical
          DO_2D( 0, 1, 0, 1 )              ! vertical fluxes
@@ -111,5 +111,5 @@
          ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:)
          CALL trd_dyn( ztrdu, ztrdv, jpdyn_zad, kt, Kmm )
-         DEALLOCATE( ztrdu, ztrdv ) 
+         DEALLOCATE( ztrdu, ztrdv )
       ENDIF
       !                               ! Control print
Index: /NEMO/trunk/src/OCE/IOM/in_out_manager.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/in_out_manager.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/in_out_manager.F90	(revision 14072)
@@ -1,3 +1,3 @@
-MODULE in_out_manager   
+MODULE in_out_manager
    !!======================================================================
    !!                       ***  MODULE  in_out_manager  ***
@@ -53,14 +53,14 @@
    ! The following four values determine the partitioning of the output fields
    ! into netcdf4 chunks. They are unrelated to the nn_chunk_sz setting which is
-   ! for runtime optimisation. The individual netcdf4 chunks can be optionally 
-   ! gzipped (recommended) leading to significant reductions in I/O volumes 
+   ! for runtime optimisation. The individual netcdf4 chunks can be optionally
+   ! gzipped (recommended) leading to significant reductions in I/O volumes
    !                         !!!**  variables only used with iom_nf90 routines and key_netcdf4 **
-   INTEGER ::   nn_nchunks_i   !: number of chunks required in the i-dimension 
-   INTEGER ::   nn_nchunks_j   !: number of chunks required in the j-dimension 
-   INTEGER ::   nn_nchunks_k   !: number of chunks required in the k-dimension 
-   INTEGER ::   nn_nchunks_t   !: number of chunks required in the t-dimension 
+   INTEGER ::   nn_nchunks_i   !: number of chunks required in the i-dimension
+   INTEGER ::   nn_nchunks_j   !: number of chunks required in the j-dimension
+   INTEGER ::   nn_nchunks_k   !: number of chunks required in the k-dimension
+   INTEGER ::   nn_nchunks_t   !: number of chunks required in the t-dimension
    LOGICAL ::   ln_nc4zip      !: netcdf4 usage: (T) chunk and compress output using the HDF5 sublayers of netcdf4
-   !                           !                 (F) ignore chunking request and use the netcdf4 library 
-   !                           !                     to produce netcdf3-compatible files 
+   !                           !                 (F) ignore chunking request and use the netcdf4 library
+   !                           !                     to produce netcdf3-compatible files
 #endif
 
@@ -85,7 +85,7 @@
    !!----------------------------------------------------------------------
    INTEGER ::   nitrst                !: time step at which restart file should be written
-   LOGICAL ::   lrst_oce              !: logical to control the oce restart write 
-   LOGICAL ::   lrst_ice              !: logical to control the ice restart write 
-   LOGICAL ::   lrst_abl              !: logical to control the abl restart write 
+   LOGICAL ::   lrst_oce              !: logical to control the oce restart write
+   LOGICAL ::   lrst_ice              !: logical to control the ice restart write
+   LOGICAL ::   lrst_abl              !: logical to control the abl restart write
    INTEGER ::   numror = 0            !: logical unit for ocean restart (read). Init to 0 is needed for SAS (in daymod.F90)
    INTEGER ::   numrir = 0            !: logical unit for ice   restart (read)
@@ -155,5 +155,5 @@
 
    !!----------------------------------------------------------------------
-   !!                          Run control  
+   !!                          Run control
    !!----------------------------------------------------------------------
    INTEGER       ::   no_print = 0          !: optional argument of fld_fill (if present, suppress some control print)
Index: /NEMO/trunk/src/OCE/IOM/iom.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/iom.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/iom.F90	(revision 14072)
@@ -7,5 +7,5 @@
    !!            2.0  ! 2006-02  (S. Masson) Adaptation to NEMO
    !!            3.0  ! 2007-07  (D. Storkey) Changes to iom_gettime
-   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case  
+   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case
    !!            3.6  ! 2014-15  DIMG format removed
    !!            3.6  ! 2015-15  (J. Harle) Added procedure to read REAL attributes
@@ -21,5 +21,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
-   USE domutl          ! 
+   USE domutl          !
    USE c1d             ! 1D vertical configuration
    USE flo_oce         ! floats module declarations
@@ -44,5 +44,5 @@
    USE trc, ONLY    :  profsed
 #endif
-   USE lib_fortran 
+   USE lib_fortran
    USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal
    USE iom_nf90
@@ -51,5 +51,5 @@
    IMPLICIT NONE
    PUBLIC   !   must be public to be able to access iom_def through iom
-   
+
 #if defined key_iomput
    LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.        !: iom_put flag
@@ -95,5 +95,5 @@
       MODULE PROCEDURE iom_p0d_dp, iom_p1d_dp, iom_p2d_dp, iom_p3d_dp, iom_p4d_dp
    END INTERFACE iom_put
-  
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -105,13 +105,13 @@
 CONTAINS
 
-   SUBROUTINE iom_init( cdname, kdid, ld_closedef ) 
+   SUBROUTINE iom_init( cdname, kdid, ld_closedef )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE   ***
       !!
-      !! ** Purpose :   
+      !! ** Purpose :
       !!
       !!----------------------------------------------------------------------
       CHARACTER(len=*),           INTENT(in)  :: cdname
-      INTEGER         , OPTIONAL, INTENT(in)  :: kdid          
+      INTEGER         , OPTIONAL, INTENT(in)  :: kdid
       LOGICAL         , OPTIONAL, INTENT(in)  :: ld_closedef
 #if defined key_iomput
@@ -123,5 +123,5 @@
       INTEGER           :: ji
       LOGICAL           :: llrst_context              ! is context related to restart
-      LOGICAL           :: llrstr, llrstw 
+      LOGICAL           :: llrstr, llrstw
       INTEGER           :: inum
       !
@@ -152,5 +152,5 @@
       llrst_context = llrstr .OR. llrstw
 
-      ! Calendar type is now defined in xml file 
+      ! Calendar type is now defined in xml file
       IF (.NOT.(xios_getvar('ref_year' ,irefyear ))) irefyear  = 1900
       IF (.NOT.(xios_getvar('ref_month',irefmonth))) irefmonth = 01
@@ -169,6 +169,6 @@
       IF(.NOT.llrst_context) CALL set_scalar
       !
-      IF( cdname == cxios_context ) THEN  
-         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
+      IF( cdname == cxios_context ) THEN
+         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. )
          CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. )
          CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. )
@@ -191,5 +191,5 @@
       ENDIF
       !
-      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN  
+      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN
          CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain
          !
@@ -223,5 +223,5 @@
 
           ! ABL
-         IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
+         IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios)
             ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom
             ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp
@@ -230,5 +230,5 @@
          CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) )
          CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) )
-          
+
          ! Add vertical grid bounds
          zt_bnds(2,:      ) = gdept_1d(:)
@@ -338,9 +338,9 @@
       !!
       !! ** Purpose :  define filename in XIOS context for reading file,
-      !!               enable variables present in a file for reading with XIOS 
+      !!               enable variables present in a file for reading with XIOS
       !!               id of the file is assumed to be rrestart.
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(IN) :: idnum 
-      
+      INTEGER, INTENT(IN) :: idnum
+
 #if defined key_iomput
       INTEGER                                    :: ndims, nvars, natts, unlimitedDimId, dimlen, xtype,mdims
@@ -423,5 +423,5 @@
                CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname,  &
                                    domain_ref="grid_N", prec = 8,                &
-                                   operation = "instant"                         ) 
+                                   operation = "instant"                         )
             ELSEIF(mdims == 1) THEN
                CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, &
@@ -433,5 +433,5 @@
                                    operation = "instant"                        )
             ELSE
-               WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 
+               WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions'
                CALL ctl_stop( 'iom_set_vars_active:', ctmp1 )
             ENDIF
@@ -457,13 +457,13 @@
       CALL xios_get_handle("file_definition", filegroup_hdl )
       CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart')
-      IF(nxioso.eq.1) THEN 
-         CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
-                                       mode="write", output_freq=xios_timestep) 
-         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
-      ELSE  
-         CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
-                                            mode="write", output_freq=xios_timestep) 
-         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
-      ENDIF 
+      IF(nxioso.eq.1) THEN
+         CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,&
+                                       mode="write", output_freq=xios_timestep)
+         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode'
+      ELSE
+         CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,&
+                                            mode="write", output_freq=xios_timestep)
+         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode'
+      ENDIF
       CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file))
 #endif
@@ -486,5 +486,5 @@
       REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rd2
       REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rs2
-      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3  
+      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3
       REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rs3
 #if defined key_iomput
@@ -509,5 +509,5 @@
          CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
                              domain_ref = "grid_N", prec = 8,             &
-                             operation = "instant"                        ) 
+                             operation = "instant"                        )
       ELSEIF(PRESENT(rs2)) THEN
          CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
@@ -540,5 +540,5 @@
       !! ** Purpose : Used for grid definition when XIOS is used to read/write
       !!              restart. Returns axis corresponding to the number of levels
-      !!              given as an input variable. Axes are defined in routine 
+      !!              given as an input variable. Axes are defined in routine
       !!              iom_set_rst_context
       !!---------------------------------------------------------------------
@@ -551,5 +551,5 @@
       ELSEIF(idlev == jpl) THEN
          axis_ref="numcat"
-#endif         
+#endif
       ELSE
          write(str, *) idlev
@@ -562,5 +562,5 @@
       !!                   ***  FUNCTION    ***
       !!
-      !! ** Purpose : this function returns first available id to keep information about file 
+      !! ** Purpose : this function returns first available id to keep information about file
       !!              sets filename in iom_file structure and sets name
       !!              of XIOS context depending on cdcomp
@@ -583,52 +583,52 @@
    END FUNCTION iom_xios_setid
 
-   SUBROUTINE iom_set_rst_context(ld_rstr) 
+   SUBROUTINE iom_set_rst_context(ld_rstr)
       !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE  iom_set_rst_context  ***
       !!
-      !! ** Purpose : Define domain, axis and grid for restart (read/write) 
-      !!              context 
-      !!               
+      !! ** Purpose : Define domain, axis and grid for restart (read/write)
+      !!              context
+      !!
       !!---------------------------------------------------------------------
       LOGICAL, INTENT(IN)               :: ld_rstr
       INTEGER :: ji
 #if defined key_iomput
-      TYPE(xios_domaingroup)            :: domaingroup_hdl 
-      TYPE(xios_domain)                 :: domain_hdl 
-      TYPE(xios_axisgroup)              :: axisgroup_hdl 
-      TYPE(xios_axis)                   :: axis_hdl 
-      TYPE(xios_scalar)                 :: scalar_hdl 
-      TYPE(xios_scalargroup)            :: scalargroup_hdl 
-
-      CALL xios_get_handle("domain_definition",domaingroup_hdl) 
-      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
-      CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
- 
-      CALL xios_get_handle("axis_definition",axisgroup_hdl) 
-      CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
+      TYPE(xios_domaingroup)            :: domaingroup_hdl
+      TYPE(xios_domain)                 :: domain_hdl
+      TYPE(xios_axisgroup)              :: axisgroup_hdl
+      TYPE(xios_axis)                   :: axis_hdl
+      TYPE(xios_scalar)                 :: scalar_hdl
+      TYPE(xios_scalargroup)            :: scalargroup_hdl
+
+      CALL xios_get_handle("domain_definition",domaingroup_hdl)
+      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")
+      CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)
+
+      CALL xios_get_handle("axis_definition",axisgroup_hdl)
+      CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev")
 !AGRIF fails to compile when unit= is in call to xios_set_axis_attr
-!     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
+!     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down")
       CALL xios_set_axis_attr( "nav_lev", long_name = "Vertical levels in meters", positive = "down")
-      CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
+      CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d )
 #if defined key_si3
       CALL xios_add_child(axisgroup_hdl, axis_hdl, "numcat")
       CALL iom_set_axis_attr( "numcat", (/ (REAL(ji,wp), ji=1,jpl) /) )
 #endif
-      CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
-      CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
+      CALL xios_get_handle("scalar_definition", scalargroup_hdl)
+      CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar")
 #endif
    END SUBROUTINE iom_set_rst_context
 
 
-   SUBROUTINE set_xios_context(kdid, cdcont) 
+   SUBROUTINE set_xios_context(kdid, cdcont)
       !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE  iom_set_rst_context  ***
       !!
       !! ** Purpose : set correct XIOS context based on kdid
-      !!               
+      !!
       !!---------------------------------------------------------------------
       INTEGER,           INTENT(IN)     :: kdid           ! Identifier of the file
       CHARACTER(LEN=lc), INTENT(OUT)    :: cdcont         ! name of the context for XIOS read/write
-      
+
       cdcont = "NONE"
 
@@ -637,5 +637,5 @@
             cdcont = cr_ocerst_cxt
          ELSEIF(kdid == numrir) THEN
-            cdcont = cr_icerst_cxt 
+            cdcont = cr_icerst_cxt
          ELSEIF(kdid == numrtr) THEN
             cdcont = cr_toprst_cxt
@@ -696,8 +696,8 @@
       CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu]
       CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode)
-      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" 
+      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc"
       CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits)
       CHARACTER(LEN=256)    ::   clinfo    ! info character
-      LOGICAL               ::   llok      ! check the existence 
+      LOGICAL               ::   llok      ! check the existence
       LOGICAL               ::   llwrt     ! local definition of ldwrt
       LOGICAL               ::   llstop    ! local definition of ldstop
@@ -705,5 +705,5 @@
       INTEGER               ::   icnt      ! counter for digits in clcpu (max = jpmax_digits)
       INTEGER               ::   iln, ils  ! lengths of character
-      INTEGER               ::   istop     ! 
+      INTEGER               ::   istop     !
       ! local number of points for x,y dimensions
       ! position of first local point for x,y dimensions
@@ -741,5 +741,5 @@
       clname   = trim(cdname)
       IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN
-         iln    = INDEX(clname,'/') 
+         iln    = INDEX(clname,'/')
          cltmpn = clname(1:iln)
          clname = clname(iln+1:LEN_TRIM(clname))
@@ -765,5 +765,5 @@
          clname = clname(1:iln-1)//'_'//TRIM(clcpu)//TRIM(clsuffix)
          icnt = 0
-         INQUIRE( FILE = clname, EXIST = llok ) 
+         INQUIRE( FILE = clname, EXIST = llok )
          ! we try different formats for the cpu number by adding 0
          DO WHILE( .NOT.llok .AND. icnt < jpmax_digits )
@@ -783,16 +783,16 @@
       ! if no file was found...
       IF( .NOT. llok ) THEN
-         IF( .NOT. llwrt ) THEN   ! we are in read mode 
+         IF( .NOT. llwrt ) THEN   ! we are in read mode
             IF( llstop ) THEN   ;   CALL ctl_stop( TRIM(clinfo), 'File '//TRIM(cltmpn)//'* not found' )
             ELSE                ;   istop = nstop + 1   ! make sure that istop /= nstop so we don't open the file
             ENDIF
-         ELSE                     ! we are in write mode so we 
+         ELSE                     ! we are in write mode so we
             clname = cltmpn       ! get back the file name without the cpu number
          ENDIF
       ELSE
-         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file 
+         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file
             CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' )
             istop = nstop + 1                      ! make sure that istop /= nstop so we don't open the file
-         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to 
+         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to
             clname = cltmpn       ! overwrite so get back the file name without the cpu number
          ENDIF
@@ -835,5 +835,5 @@
             IF( iom_file(jf)%nfid > 0 ) THEN
                CALL iom_nf90_close( jf )
-               iom_file(jf)%nfid       = 0          ! free the id 
+               iom_file(jf)%nfid       = 0          ! free the id
                IF( PRESENT(kiomid) )   kiomid = 0   ! return 0 as id to specify that the file was closed
                IF(lwp) WRITE(numout,*) TRIM(clinfo)//' close file: '//TRIM(iom_file(jf)%name)//' ok'
@@ -844,9 +844,9 @@
          END DO
       ENDIF
-      !    
+      !
    END SUBROUTINE iom_close
 
 
-   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )  
+   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  iom_varid  ***
@@ -874,5 +874,5 @@
       IF( kiomid > 0 ) THEN
          clinfo = 'iom_varid, file: '//trim(iom_file(kiomid)%name)//', var: '//trim(cdvar)
-         IF( iom_file(kiomid)%nfid == 0 ) THEN 
+         IF( iom_file(kiomid)%nfid == 0 ) THEN
             CALL ctl_stop( trim(clinfo), 'the file is not open' )
          ELSE
@@ -893,8 +893,8 @@
                         &                      'increase the parameter jpmax_vars')
                ENDIF
-               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' ) 
+               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' )
             ELSE
                iom_varid = iiv
-               IF( PRESENT(kdimsz) ) THEN 
+               IF( PRESENT(kdimsz) ) THEN
                   i_nvd = iom_file(kiomid)%ndims(iiv)
                   IF( i_nvd <= size(kdimsz) ) THEN
@@ -1022,5 +1022,5 @@
       REAL(dp)        , ALLOCATABLE  , DIMENSION(:)           ::   ztmp_pvar ! tmp var to read field
       INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number
-      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1043,5 +1043,5 @@
       REAL(dp)        , INTENT(  out), DIMENSION(:)           ::   pvar      ! read field
       INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number
-      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1062,5 +1062,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1086,5 +1086,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1106,5 +1106,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1130,5 +1130,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
       !
@@ -1163,21 +1163,21 @@
       REAL(dp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
+      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis
       !
       LOGICAL                        ::   llok        ! true if ok!
-      INTEGER                        ::   jl          ! loop on number of dimension 
+      INTEGER                        ::   jl          ! loop on number of dimension
       INTEGER                        ::   idom        ! type of domain
       INTEGER                        ::   idvar       ! id of the variable
       INTEGER                        ::   inbdim      ! number of dimensions of the variable
-      INTEGER                        ::   idmspc      ! number of spatial dimensions 
+      INTEGER                        ::   idmspc      ! number of spatial dimensions
       INTEGER                        ::   itime       ! record number
       INTEGER                        ::   istop       ! temporary value of nstop
       INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes
       INTEGER                        ::   ji, jj      ! loop counters
-      INTEGER                        ::   irankpv     ! 
+      INTEGER                        ::   irankpv     !
       INTEGER                        ::   ind1, ind2  ! substring index
       INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis
-      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis 
+      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis
       INTEGER, DIMENSION(jpmax_dims) ::   idimsz      ! size of the dimensions of the variable
       INTEGER, DIMENSION(jpmax_dims) ::   ishape      ! size of the dimensions of the variable
@@ -1187,5 +1187,5 @@
       CHARACTER(LEN=256)             ::   clinfo      ! info character
       CHARACTER(LEN=256)             ::   clname      ! file name
-      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      ! 
+      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !
       CHARACTER(LEN=1)               ::   cl_type     ! local value of cd_type
       LOGICAL                        ::   ll_only3rd  ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension.
@@ -1215,5 +1215,5 @@
          ! Search for the variable in the data base (eventually actualize data)
          !
-         idvar = iom_varid( kiomid, cdvar ) 
+         idvar = iom_varid( kiomid, cdvar )
          IF( idvar > 0 ) THEN
             !
@@ -1222,8 +1222,8 @@
             idmspc = inbdim                                   ! number of spatial dimensions in the file
             IF( iom_file(kiomid)%luld(idvar) )   idmspc = inbdim - 1
-            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...') 
+            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...')
             !
             ! Identify the domain in case of jpdom_auto definition
-            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN            
+            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN
                idom = jpdom_global   ! default
                ! else: if the file name finishes with _xxxx.nc with xxxx any number
@@ -1262,5 +1262,5 @@
                      CALL ctl_warn( trim(clinfo), '2D array input but 3 spatial dimensions in the file...'              ,   &
                            &         'As the size of the z dimension is 1 and as we try to read the first record, ',   &
-                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' )   
+                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' )
                      idmspc = idmspc - 1
                   !!GS: possibility to read 3D ABL atmopsheric forcing and use 1st level to force BULK simulation
@@ -1274,11 +1274,11 @@
             ! definition of istart and icnt
             !
-            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above) 
-            istart(:) = 1              ! default definition (simple way to deal with special cases listed above) 
+            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above)
+            istart(:) = 1              ! default definition (simple way to deal with special cases listed above)
             istart(idmspc+1) = itime   ! temporal dimenstion
             !
             IF( idom == jpdom_unknown ) THEN
-               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN 
-                  istart(1:idmspc) = kstart(1:idmspc) 
+               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN
+                  istart(1:idmspc) = kstart(1:idmspc)
                   icnt  (1:idmspc) = kcount(1:idmspc)
                ELSE
@@ -1286,5 +1286,5 @@
                ENDIF
             ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown
-               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0 
+               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0
                IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /)
                icnt(1:2) = (/ Ni_0, Nj_0 /)
@@ -1306,10 +1306,10 @@
                   WRITE( ctmp1, FMT="('(istart(', i1, ') + icnt(', i1, ') - 1) = ', i5)" ) jl, jl, itmp
                   WRITE( ctmp2, FMT="(' is larger than idimsz(', i1,') = ', i5)"         ) jl, idimsz(jl)
-                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )     
+                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )
                ENDIF
             END DO
             !
             ! check that icnt matches the input array
-            !-     
+            !-
             IF( idom == jpdom_unknown ) THEN
                IF( irankpv == 1 )        ishape(1:1) = SHAPE(pv_r1d)
@@ -1321,8 +1321,8 @@
                   ishape(1:2) = SHAPE(pv_r2d(Nis0:Nie0,Njs0:Nje0  ))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0)'
                ENDIF
-               IF( irankpv == 3 ) THEN 
+               IF( irankpv == 3 ) THEN
                   ishape(1:3) = SHAPE(pv_r3d(Nis0:Nie0,Njs0:Nje0,:))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0,:)'
                ENDIF
-            ENDIF         
+            ENDIF
             DO jl = 1, irankpv
                WRITE( ctmp2, FMT="(', ', i1,'): ', i5,' /= icnt(', i1,'):', i5)" ) jl, ishape(jl), jl, icnt(jl)
@@ -1333,5 +1333,5 @@
 
          ! read the data
-         !-     
+         !-
          IF( idvar > 0 .AND. istop == nstop ) THEN   ! no additional errors until this point...
             !
@@ -1340,5 +1340,5 @@
             ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2)
             ENDIF
-      
+
             CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d )
 
@@ -1394,5 +1394,5 @@
          CALL iom_swap(cxios_context)
 #else
-         istop = istop + 1 
+         istop = istop + 1
          clinfo = 'Can not use XIOS in iom_get_123d, file: '//trim(clname)//', var:'//trim(cdvar)
 #endif
@@ -1407,5 +1407,5 @@
       zofs = iom_file(kiomid)%ofs(idvar)      ! offset
       IF(     PRESENT(pv_r1d) ) THEN
-         IF( zscf /= 1._wp )   pv_r1d(:) = pv_r1d(:) * zscf 
+         IF( zscf /= 1._wp )   pv_r1d(:) = pv_r1d(:) * zscf
          IF( zofs /= 0._wp )   pv_r1d(:) = pv_r1d(:) + zofs
       ELSEIF( PRESENT(pv_r2d) ) THEN
@@ -1421,5 +1421,5 @@
    SUBROUTINE iom_get_var( cdname, z2d)
       CHARACTER(LEN=*), INTENT(in ) ::   cdname
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
+      REAL(wp), DIMENSION(jpi,jpj) ::   z2d
 #if defined key_iomput
       IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN
@@ -1433,5 +1433,5 @@
 
 
-   FUNCTION iom_getszuld ( kiomid )  
+   FUNCTION iom_getszuld ( kiomid )
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  iom_getszuld  ***
@@ -1449,5 +1449,5 @@
       ENDIF
    END FUNCTION iom_getszuld
-   
+
 
    !!----------------------------------------------------------------------
@@ -1513,5 +1513,5 @@
       ENDIF
    END SUBROUTINE iom_g1d_ratt
-   
+
    SUBROUTINE iom_g0d_catt( kiomid, cdatt, cdatt0d, cdvar )
       INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file
@@ -1572,5 +1572,5 @@
       ENDIF
    END SUBROUTINE iom_p1d_ratt
-   
+
    SUBROUTINE iom_p0d_catt( kiomid, cdatt, cdatt0d, cdvar )
       INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file
@@ -1591,5 +1591,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in)                         ::   pvar     ! written field
@@ -1614,5 +1614,5 @@
             IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar)
             CALL iom_swap(context)
-            CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar ) 
+            CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar )
             CALL iom_swap(cxios_context)
          ENDIF
@@ -1631,5 +1631,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in)                         ::   pvar     ! written field
@@ -1654,5 +1654,5 @@
             IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar)
             CALL iom_swap(context)
-            CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar ) 
+            CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar )
             CALL iom_swap(cxios_context)
          ENDIF
@@ -1672,5 +1672,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
@@ -1712,5 +1712,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
@@ -1753,5 +1753,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
@@ -1793,5 +1793,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
@@ -1834,5 +1834,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
@@ -1874,5 +1874,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
@@ -1954,8 +1954,8 @@
          !
       ENDIF
-      
+
    END SUBROUTINE iom_delay_rst
-  
-   
+
+
 
    !!----------------------------------------------------------------------
@@ -1969,5 +1969,5 @@
 !!clem      zz(:,:)=pfield0d
 !!clem      CALL xios_send_field(cdname, zz)
-      CALL xios_send_field(cdname, (/pfield0d/)) 
+      CALL xios_send_field(cdname, (/pfield0d/))
 #else
       IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings
@@ -1982,5 +1982,5 @@
 !!clem      zz(:,:)=pfield0d
 !!clem      CALL xios_send_field(cdname, zz)
-      CALL xios_send_field(cdname, (/pfield0d/)) 
+      CALL xios_send_field(cdname, (/pfield0d/))
 #else
       IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings
@@ -2126,6 +2126,6 @@
       TYPE(xios_gridgroup) :: gridgroup_hdl
       TYPE(xios_grid)      :: grid_hdl
-      TYPE(xios_domain)    :: domain_hdl 
-      TYPE(xios_axis)      :: axis_hdl 
+      TYPE(xios_domain)    :: domain_hdl
+      TYPE(xios_axis)      :: axis_hdl
       CHARACTER(LEN=64)    :: cldomrefid   ! domain_ref name
       CHARACTER(len=1)     :: cl1          ! last character of this name
@@ -2147,5 +2147,5 @@
          CALL xios_add_child(grid_hdl, axis_hdl, 'depth'//cl1)              ! add its axis
       ENDIF
-      !      
+      !
    END SUBROUTINE iom_set_zoom_domain_attr
 
@@ -2240,5 +2240,5 @@
       !!----------------------------------------------------------------------
       !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in) ::   kt 
+      INTEGER         , INTENT(in) ::   kt
       CHARACTER(LEN=*), INTENT(in) ::   cdname
       !!----------------------------------------------------------------------
@@ -2255,5 +2255,5 @@
       !!----------------------------------------------------------------------
       clname = cdname
-      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 
+      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname
       IF( xios_is_valid_context(clname) ) THEN
          CALL iom_swap( cdname )   ! swap to cdname context
@@ -2281,8 +2281,8 @@
       CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=Ni0glo,nj_glo=Nj0glo,ibegin=mig0(Nis0)-1,jbegin=mjg0(Njs0)-1,ni=Ni_0,nj=Nj_0)
       CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni=jpi, data_jbegin = -nn_hls, data_nj=jpj)
-!don't define lon and lat for restart reading context. 
+!don't define lon and lat for restart reading context.
       IF ( .NOT.ldrxios ) &
          CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = real(RESHAPE(plon(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp),   &
-         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))  
+         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))
       !
       IF ( ln_mskland .AND. (.NOT.ldxios) ) THEN
@@ -2384,5 +2384,5 @@
       CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj)
       CALL iom_set_domain_attr("gznl", lonvalue = real(zlon, dp),   &
-         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))  
+         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))
       CALL iom_set_zoom_domain_attr("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=Nj0glo)
       !
@@ -2433,5 +2433,5 @@
       TYPE(xios_duration)            ::   f_op, f_of
       !!----------------------------------------------------------------------
-      ! 
+      !
       ! frequency of the call of iom_put (attribut: freq_op)
       f_op%timestep = 1        ;  f_of%timestep =  0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of)
@@ -2444,18 +2444,18 @@
       ! output file names (attribut: name)
       DO ji = 1, 9
-         WRITE(cl1,'(i1)') ji 
+         WRITE(cl1,'(i1)') ji
          CALL iom_update_file_name('file'//cl1)
       END DO
       DO ji = 1, 99
-         WRITE(cl2,'(i2.2)') ji 
+         WRITE(cl2,'(i2.2)') ji
          CALL iom_update_file_name('file'//cl2)
       END DO
       DO ji = 1, 999
-         WRITE(cl3,'(i3.3)') ji 
+         WRITE(cl3,'(i3.3)') ji
          CALL iom_update_file_name('file'//cl3)
       END DO
 
       ! Zooms...
-      clgrd = (/ 'T', 'U', 'W' /) 
+      clgrd = (/ 'T', 'U', 'W' /)
       DO jg = 1, SIZE(clgrd)                                                                   ! grid type
          cl1 = clgrd(jg)
@@ -2522,18 +2522,18 @@
                IF( zlon == -10. .AND. zlat ==   4. ) THEN   ;   zlon = 0.   ;   zlat = 0.   ;   ENDIF
                CALL dom_ngb( zlon, zlat, ix, iy, cl1 )
-               IF( zlon >= 0. ) THEN  
+               IF( zlon >= 0. ) THEN
                   IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT( zlon), 'e'
                   ELSE                                      ;   WRITE(clon, '(f5.1,a)')       zlon , 'e'
                   ENDIF
-               ELSE             
+               ELSE
                   IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT(-zlon), 'w'
                   ELSE                                      ;   WRITE(clon, '(f5.1,a)')      -zlon , 'w'
                   ENDIF
                ENDIF
-               IF( zlat >= 0. ) THEN  
+               IF( zlat >= 0. ) THEN
                   IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT( zlat), 'n'
                   ELSE                                      ;   WRITE(clat, '(f4.1,a)')       zlat , 'n'
                   ENDIF
-               ELSE             
+               ELSE
                   IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT(-zlat), 's'
                   ELSE                                      ;   WRITE(clat, '(f4.1,a)')      -zlat , 's'
@@ -2549,13 +2549,13 @@
          END DO
       END DO
-      
+
    END SUBROUTINE set_mooring
 
-   
+
    SUBROUTINE iom_update_file_name( cdid )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE iom_update_file_name  ***
       !!
-      !! ** Purpose :   
+      !! ** Purpose :
       !!
       !!----------------------------------------------------------------------
@@ -2571,5 +2571,5 @@
       REAL(wp)           ::   zsec
       LOGICAL            ::   llexist
-      TYPE(xios_duration)   ::   output_freq 
+      TYPE(xios_duration)   ::   output_freq
       !!----------------------------------------------------------------------
       !
@@ -2580,8 +2580,8 @@
          IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname )
          !
-         IF ( TRIM(clname) /= '' ) THEN 
+         IF ( TRIM(clname) /= '' ) THEN
             !
             idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname))
                idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
@@ -2589,25 +2589,25 @@
             !
             idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
               IF ( output_freq%timestep /= 0) THEN
-                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 
+                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%second /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%minute /= 0 ) THEN
-                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi' 
+                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%hour /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%day /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
-              ELSE IF ( output_freq%month /= 0 ) THEN   
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 
+              ELSE IF ( output_freq%month /= 0 ) THEN
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
-              ELSE IF ( output_freq%year /= 0 ) THEN   
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 
+              ELSE IF ( output_freq%year /= 0 ) THEN
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE
@@ -2620,5 +2620,5 @@
             !
             idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday - rn_Dt / rday )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname))
@@ -2627,5 +2627,5 @@
             !
             idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday - rn_Dt / rday, ldfull = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname))
@@ -2634,5 +2634,5 @@
             !
             idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname))
@@ -2641,5 +2641,5 @@
             !
             idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname))
@@ -2669,5 +2669,5 @@
       !
       CHARACTER(LEN=20) ::   iom_sdate
-      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
+      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date
       INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec
       REAL(wp)          ::   zsec
@@ -2691,11 +2691,11 @@
       ENDIF
       !
-      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date 
+      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date
       ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1
       ENDIF
       !
-!$AGRIF_DO_NOT_TREAT      
+!$AGRIF_DO_NOT_TREAT
       ! needed in the conv
-      IF( llfull ) THEN 
+      IF( llfull ) THEN
          clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2"
          ihour   = isec / 3600
@@ -2707,5 +2707,5 @@
          WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run
       ENDIF
-!$AGRIF_END_DO_NOT_TREAT      
+!$AGRIF_END_DO_NOT_TREAT
       !
    END FUNCTION iom_sdate
@@ -2716,5 +2716,5 @@
    !!----------------------------------------------------------------------
    SUBROUTINE iom_setkt( kt, cdname )
-      INTEGER         , INTENT(in)::   kt 
+      INTEGER         , INTENT(in)::   kt
       CHARACTER(LEN=*), INTENT(in) ::   cdname
       IF( .FALSE. )   WRITE(numout,*) kt, cdname   ! useless test to avoid compilation warnings
@@ -2744,6 +2744,6 @@
    SUBROUTINE iom_miss_val( cdname, pmiss_val )
       CHARACTER(LEN=*), INTENT(in ) ::   cdname
-      REAL(wp)        , INTENT(out) ::   pmiss_val   
-      REAL(dp)                      ::   ztmp_pmiss_val   
+      REAL(wp)        , INTENT(out) ::   pmiss_val
+      REAL(dp)                      ::   ztmp_pmiss_val
 #if defined key_iomput
       ! get missing value
@@ -2755,5 +2755,5 @@
 #endif
    END SUBROUTINE iom_miss_val
-  
+
    !!======================================================================
 END MODULE iom
Index: /NEMO/trunk/src/OCE/IOM/iom_def.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/iom_def.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/iom_def.F90	(revision 14072)
@@ -17,5 +17,5 @@
    INTEGER, PARAMETER, PUBLIC ::   jpdom_local         = 2   !: (Nis0: Nie0 ,Njs0: Nje0 )
    INTEGER, PARAMETER, PUBLIC ::   jpdom_unknown       = 3   !: No dimension checking
-   INTEGER, PARAMETER, PUBLIC ::   jpdom_auto          = 4   !: 
+   INTEGER, PARAMETER, PUBLIC ::   jpdom_auto          = 4   !:
    INTEGER, PARAMETER, PUBLIC ::   jpdom_auto_xy       = 5   !: Automatically set horizontal dimensions only
 
@@ -33,8 +33,8 @@
 !$AGRIF_DO_NOT_TREAT
    INTEGER, PUBLIC            ::   iom_open_init = 0   !: used to initialize iom_file(:)%nfid to 0
-!XIOS write restart   
+!XIOS write restart
    LOGICAL, PUBLIC            ::   lwxios = .FALSE.    !: write single file restart using XIOS
    INTEGER, PUBLIC            ::   nxioso = 0          !: type of restart file when writing using XIOS 1 - single, 2 - multiple
-!XIOS read restart   
+!XIOS read restart
    LOGICAL, PUBLIC            ::   lrxios = .FALSE.     !: read single file restart using XIOS main switch
    LOGICAL, PUBLIC            ::   lxios_sini = .FALSE. ! is restart in a single file
@@ -50,5 +50,5 @@
       INTEGER                                   ::   iduld    !: id of the unlimited dimension
       INTEGER                                   ::   lenuld   !: length of the unlimited dimension (number of records in file)
-      INTEGER                                   ::   irec     !: writing record position  
+      INTEGER                                   ::   irec     !: writing record position
       CHARACTER(LEN=32)                         ::   uldname  !: name of the unlimited dimension
       CHARACTER(LEN=32), DIMENSION(jpmax_vars)  ::   cn_var   !: names of the variables
@@ -56,5 +56,5 @@
       INTEGER, DIMENSION(jpmax_vars)            ::   ndims    !: number of dimensions of the variables
       LOGICAL, DIMENSION(jpmax_vars)            ::   luld     !: variable using the unlimited dimension
-      INTEGER, DIMENSION(jpmax_dims,jpmax_vars) ::   dimsz    !: size of variables dimensions 
+      INTEGER, DIMENSION(jpmax_dims,jpmax_vars) ::   dimsz    !: size of variables dimensions
       REAL(kind=wp), DIMENSION(jpmax_vars)      ::   scf      !: scale_factor of the variables
       REAL(kind=wp), DIMENSION(jpmax_vars)      ::   ofs      !: add_offset of the variables
Index: /NEMO/trunk/src/OCE/IOM/iom_nf90.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/iom_nf90.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/iom_nf90.F90	(revision 14072)
@@ -34,5 +34,5 @@
 
    INTERFACE iom_nf90_get
-      MODULE PROCEDURE iom_nf90_g0d_sp                   
+      MODULE PROCEDURE iom_nf90_g0d_sp
       MODULE PROCEDURE iom_nf90_g0d_dp, iom_nf90_g123d_dp
    END INTERFACE
@@ -57,5 +57,5 @@
       INTEGER                , INTENT(  out)           ::   kiomid      ! nf90 identifier of the opened file
       LOGICAL                , INTENT(in   )           ::   ldwrt       ! read or write the file?
-      LOGICAL                , INTENT(in   )           ::   ldok        ! check the existence 
+      LOGICAL                , INTENT(in   )           ::   ldok        ! check the existence
       INTEGER                , INTENT(in   ), OPTIONAL ::   kdlev       ! size of the ice/abl third dimension
       CHARACTER(len=3)       , INTENT(in   ), OPTIONAL ::   cdcomp      ! name of component calling iom_nf90_open
@@ -85,5 +85,5 @@
          clcomp = cdcomp    ! use input value
       ELSE
-         clcomp = 'OCE'     ! by default 
+         clcomp = 'OCE'     ! by default
       ENDIF
       !
@@ -120,5 +120,5 @@
 
             IF( llclobber ) THEN   ;   imode = IOR( NF90_64BIT_OFFSET, NF90_CLOBBER   )
-            ELSE                   ;   imode = IOR( NF90_64BIT_OFFSET, NF90_NOCLOBBER ) 
+            ELSE                   ;   imode = IOR( NF90_64BIT_OFFSET, NF90_NOCLOBBER )
             ENDIF
             IF( snc4set%luse ) THEN
@@ -172,8 +172,8 @@
          iom_file(kiomid)%nfid   = if90id
          iom_file(kiomid)%nvars  = 0
-         iom_file(kiomid)%irec   = -1   ! useless for NetCDF files, used to know if the file is in define mode 
+         iom_file(kiomid)%irec   = -1   ! useless for NetCDF files, used to know if the file is in define mode
          CALL iom_nf90_check(NF90_Inquire(if90id, unlimitedDimId = iom_file(kiomid)%iduld), clinfo)
          IF( iom_file(kiomid)%iduld .GE. 0 ) THEN
-            CALL iom_nf90_check(NF90_Inquire_Dimension(if90id, iom_file(kiomid)%iduld,    & 
+            CALL iom_nf90_check(NF90_Inquire_Dimension(if90id, iom_file(kiomid)%iduld,    &
                &                                       name = iom_file(kiomid)%uldname,   &
                &                                       len  = iom_file(kiomid)%lenuld ), clinfo )
@@ -201,5 +201,5 @@
 
 
-   FUNCTION iom_nf90_varid ( kiomid, cdvar, kiv, kdimsz, kndims, lduld )  
+   FUNCTION iom_nf90_varid ( kiomid, cdvar, kiv, kdimsz, kndims, lduld )
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  iom_varid  ***
@@ -209,5 +209,5 @@
       INTEGER              , INTENT(in   )           ::   kiomid   ! file Identifier
       CHARACTER(len=*)     , INTENT(in   )           ::   cdvar    ! name of the variable
-      INTEGER              , INTENT(in   )           ::   kiv   ! 
+      INTEGER              , INTENT(in   )           ::   kiv   !
       INTEGER, DIMENSION(:), INTENT(  out), OPTIONAL ::   kdimsz   ! size of each dimension
       INTEGER              , INTENT(  out), OPTIONAL ::   kndims   ! number of dimensions
@@ -240,6 +240,6 @@
          iom_file(kiomid)%dimsz(:,kiv) = 0      ! reset dimsz in case previously used
          DO ji = 1, i_nvd                       ! dimensions size
-            CALL iom_nf90_check(NF90_Inquire_Dimension(if90id, idimid(ji), len = iom_file(kiomid)%dimsz(ji,kiv)), clinfo)   
-            IF( idimid(ji) == iom_file(kiomid)%iduld ) iom_file(kiomid)%luld(kiv) = .TRUE.   ! unlimited dimension? 
+            CALL iom_nf90_check(NF90_Inquire_Dimension(if90id, idimid(ji), len = iom_file(kiomid)%dimsz(ji,kiv)), clinfo)
+            IF( idimid(ji) == iom_file(kiomid)%iduld ) iom_file(kiomid)%luld(kiv) = .TRUE.   ! unlimited dimension?
          END DO
          !---------- Deal with scale_factor and add_offset
@@ -257,5 +257,5 @@
          END IF
          ! return the simension size
-         IF( PRESENT(kdimsz) ) THEN 
+         IF( PRESENT(kdimsz) ) THEN
             IF( i_nvd <= SIZE(kdimsz) ) THEN
                kdimsz(1:i_nvd) = iom_file(kiomid)%dimsz(1:i_nvd,kiv)
@@ -267,5 +267,5 @@
          IF( PRESENT(kndims) )  kndims = iom_file(kiomid)%ndims(kiv)
          IF( PRESENT( lduld) )  lduld  = iom_file(kiomid)%luld(kiv)
-      ELSE  
+      ELSE
          iom_nf90_varid = -1   !   variable not found, return error code: -1
       ENDIF
@@ -323,5 +323,5 @@
       INTEGER                    , INTENT(in   )           ::   kvid      ! Name of the variable
       INTEGER                    , INTENT(in   )           ::   knbdim    ! number of dimensions of the variable
-      INTEGER , DIMENSION(:)     , INTENT(in   )           ::   kstart    ! start position of the reading in each axis 
+      INTEGER , DIMENSION(:)     , INTENT(in   )           ::   kstart    ! start position of the reading in each axis
       INTEGER , DIMENSION(:)     , INTENT(in   )           ::   kcount    ! number of points to be read in each axis
       INTEGER ,                    INTENT(in   )           ::   kx1, kx2, ky1, ky2   ! subdomain indexes
@@ -529,9 +529,9 @@
       !!                   ***  SUBROUTINE  iom_nf90_rstput  ***
       !!
-      !! ** Purpose : read the time axis cdvar in the file 
+      !! ** Purpose : read the time axis cdvar in the file
       !!--------------------------------------------------------------------
       INTEGER                     , INTENT(in)           ::   kt       ! ocean time-step
       INTEGER                     , INTENT(in)           ::   kwrite   ! writing time-step
-      INTEGER                     , INTENT(in)           ::   kiomid   ! Identifier of the file 
+      INTEGER                     , INTENT(in)           ::   kiomid   ! Identifier of the file
       CHARACTER(len=*)            , INTENT(in)           ::   cdvar    ! variable name
       INTEGER                     , INTENT(in)           ::   kvid     ! variable id
@@ -544,7 +544,7 @@
       INTEGER               :: idims                ! number of dimension
       INTEGER               :: idvar                ! variable id
-      INTEGER               :: jd                   ! dimension loop counter   
-      INTEGER               :: ix1, ix2, iy1, iy2   ! subdomain indexes   
-      INTEGER, DIMENSION(4) :: idimsz               ! dimensions size  
+      INTEGER               :: jd                   ! dimension loop counter
+      INTEGER               :: ix1, ix2, iy1, iy2   ! subdomain indexes
+      INTEGER, DIMENSION(4) :: idimsz               ! dimensions size
       INTEGER, DIMENSION(4) :: idimid               ! dimensions id
       CHARACTER(LEN=256)    :: clinfo               ! info character
@@ -678,5 +678,5 @@
             ELSEIF( idimsz(1) == jpi  .AND. idimsz(2) == jpj  ) THEN
                ix1 = 1      ;   ix2 = jpi    ;   iy1 = 1      ;   iy2 = jpj
-            ELSE 
+            ELSE
                CALL ctl_stop( 'iom_nf90_rp0123d: should have been an impossible case...' )
             ENDIF
@@ -689,5 +689,5 @@
                CALL iom_nf90_check(    NF90_PUT_VAR( if90id, 2,                            gphit(ix1:ix2, iy1:iy2) ), clinfo )
                SELECT CASE (iom_file(kiomid)%comp)
-               CASE ('OCE')  
+               CASE ('OCE')
                   CALL iom_nf90_check( NF90_PUT_VAR( if90id, 3,                                           gdept_1d ), clinfo )
                CASE ('ABL')
@@ -697,5 +697,5 @@
                END SELECT
                ! "wrong" value: to be improved but not really useful...
-               CALL iom_nf90_check(   NF90_PUT_VAR( if90id, 4,                                                  kt ), clinfo )   
+               CALL iom_nf90_check(   NF90_PUT_VAR( if90id, 4,                                                  kt ), clinfo )
                ! update the size of the variable corresponding to the unlimited dimension
                iom_file(kiomid)%dimsz(1, 4) = 1   ! so we don't enter this IF case any more...
@@ -720,5 +720,5 @@
          IF(lwp) WRITE(numout,*) TRIM(clinfo)//' written ok'
       ENDIF
-      !     
+      !
    END SUBROUTINE iom_nf90_rp0123d_dp
 
Index: /NEMO/trunk/src/OCE/IOM/prtctl.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/prtctl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/prtctl.F90	(revision 14072)
@@ -15,5 +15,5 @@
    IMPLICIT NONE
    PRIVATE
-   
+
    INTEGER , DIMENSION(  :), ALLOCATABLE ::   numprt_oce, numprt_top
    INTEGER , DIMENSION(  :), ALLOCATABLE ::   nall_ictls, nall_ictle   ! first, last indoor index for each i-domain
@@ -22,5 +22,5 @@
    REAL(wp), DIMENSION(  :), ALLOCATABLE ::   u_ctl , v_ctl            ! previous velocity trend values
    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   tra_ctl                  ! previous top trend values
-   !                                          
+   !
    PUBLIC prt_ctl         ! called by all subroutines
    PUBLIC prt_ctl_info    ! called by all subroutines
@@ -31,5 +31,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -70,16 +70,16 @@
       !!                     ***  ROUTINE prt_ctl  ***
       !!
-      !! ** Purpose : - print sum control of 2D or 3D arrays over the same area 
+      !! ** Purpose : - print sum control of 2D or 3D arrays over the same area
       !!                in mono and mpp case. This way can be usefull when
-      !!                debugging a new parametrization in mono or mpp. 
+      !!                debugging a new parametrization in mono or mpp.
       !!
       !! ** Method  : 2 possibilities exist when setting the sn_cfctl%prtctl parameter to
       !!                .true. in the ocean namelist:
-      !!              - to debug a MPI run .vs. a mono-processor one; 
+      !!              - to debug a MPI run .vs. a mono-processor one;
       !!                the control print will be done over each sub-domain.
-      !!                The nictl[se] and njctl[se] parameters in the namelist must 
+      !!                The nictl[se] and njctl[se] parameters in the namelist must
       !!                be set to zero and [ij]splt to the corresponding splitted
       !!                domain in MPI along respectively i-, j- directions.
-      !!              - to debug a mono-processor run over the whole domain/a specific area; 
+      !!              - to debug a mono-processor run over the whole domain/a specific area;
       !!                in the first case the nictl[se] and njctl[se] parameters must be set
       !!                to zero else to the indices of the area to be controled. In both cases
@@ -87,5 +87,5 @@
       !!              - All arguments of the above calling sequence are optional so their
       !!                name must be explicitly typed if used. For instance if the 3D
-      !!                array tn(:,:,:) must be passed through the prt_ctl subroutine, 
+      !!                array tn(:,:,:) must be passed through the prt_ctl subroutine,
       !!                it must look like: CALL prt_ctl(tab3d_1=tn).
       !!
@@ -99,6 +99,6 @@
       !!                    mask2   : mask (3D) to apply to the tab[23]d_2 array
       !!                    clinfo2 : information about the tab[23]d_2 array
-      !!                    kdim    : k- direction for 3D arrays 
-      !!                    clinfo3 : additional information 
+      !!                    kdim    : k- direction for 3D arrays
+      !!                    clinfo3 : additional information
       !!----------------------------------------------------------------------
       INTEGER                             , INTENT(in)           ::   ktab2d_1, ktab3d_1, ktab4d_1, ktab2d_2, ktab3d_2
@@ -123,5 +123,5 @@
       !!----------------------------------------------------------------------
       !
-      ! Arrays, scalars initialization 
+      ! Arrays, scalars initialization
       cl1  = ''
       cl2  = ''
@@ -310,5 +310,5 @@
             WRITE(numout,*) '~~~~~~~~~~~~~'
          ENDIF
-         IF( nn_ictls+nn_ictle+nn_jctls+nn_jctle == 0 )   THEN    ! print control done over the default area         
+         IF( nn_ictls+nn_ictle+nn_jctls+nn_jctle == 0 )   THEN    ! print control done over the default area
             nn_isplt = MAX(1, nn_isplt)            ! number of processors following i-direction
             nn_jsplt = MAX(1, nn_jsplt)            ! number of processors following j-direction
@@ -391,5 +391,5 @@
       ENDIF
 
-      ! Initialization 
+      ! Initialization
       IF( clcomp == 'oce' ) THEN
          ALLOCATE( t_ctl(ijsplt), s_ctl(ijsplt), u_ctl(ijsplt), v_ctl(ijsplt), numprt_oce(ijsplt) )
@@ -424,5 +424,5 @@
          WRITE(inum,*)
          WRITE(inum,'(19x,a20)') cl_run
-         WRITE(inum,*) 
+         WRITE(inum,*)
          WRITE(inum,*) 'prt_ctl :  Sum control indices'
          WRITE(inum,*) '~~~~~~~'
Index: /NEMO/trunk/src/OCE/IOM/restart.F90
===================================================================
--- /NEMO/trunk/src/OCE/IOM/restart.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/IOM/restart.F90	(revision 14072)
@@ -19,7 +19,7 @@
    !!   rst_read   : read the ocean restart file
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers 
+   USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
-   USE sbc_ice         ! only lk_si3 
+   USE sbc_ice         ! only lk_si3
    USE phycst          ! physical constants
    USE eosbn2          ! equation of state            (eos bn2 routine)
@@ -49,6 +49,6 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE rst_opn  ***
-      !!                     
-      !! ** Purpose : + initialization (should be read in the namelist) of nitrst 
+      !!
+      !! ** Purpose : + initialization (should be read in the namelist) of nitrst
       !!              + open the restart when we are one time step before nitrst
       !!                   - restart header is defined when kt = nitrst-1
@@ -66,5 +66,5 @@
       !
       IF( kt == nit000 ) THEN   ! default definitions
-         lrst_oce = .FALSE.   
+         lrst_oce = .FALSE.
          IF( ln_rst_list ) THEN
             nrst_lst = 1
@@ -74,9 +74,9 @@
          ENDIF
       ENDIF
-      
+
       IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart
 
       ! frequency-based restart dumping (nn_stock)
-      IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN   
+      IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN
          ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment
          nitrst = kt + nn_stock - 1                  ! define the next value of nitrst for restart writing
@@ -87,5 +87,5 @@
       ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1
       IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN
-         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
+         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN
             ! beware of the format used to write kt (default is i8.8, that should be large enough...)
             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
@@ -115,5 +115,5 @@
                   clpname = clname
                ELSE
-                  clpname = TRIM(Agrif_CFixed())//"_"//clname   
+                  clpname = TRIM(Agrif_CFixed())//"_"//clname
                ENDIF
                numrow = iom_xios_setid(TRIM(clpath)//TRIM(clpname))
@@ -135,5 +135,5 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE rstwrite  ***
-      !!                     
+      !!
       !! ** Purpose :   Write restart fields in NetCDF format
       !!
@@ -164,6 +164,6 @@
                      CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop      )
       ENDIF
-      
-      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst )  
+
+      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst )
       IF( kt == nitrst ) THEN
          IF(.NOT.lwxios) THEN
@@ -187,9 +187,9 @@
 
    SUBROUTINE rst_read_open
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE rst_read_open  ***
-      !! 
+      !!
       !! ** Purpose :   Open read files for NetCDF restart
-      !! 
+      !!
       !! ** Method  :   Use a non-zero, positive value of numror to assess whether or not
       !!                the file has already been opened
@@ -222,5 +222,5 @@
 !               clpname = cn_ocerst_in
 !            ELSE
-!               clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in   
+!               clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in
 !            ENDIF
              CALL iom_init( cr_ocerst_cxt, kdid = numror, ld_closedef = .TRUE. )
@@ -234,9 +234,9 @@
 
    SUBROUTINE rst_read( Kbb, Kmm )
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE rst_read  ***
-      !! 
+      !!
       !! ** Purpose :   Read velocity and T-S fields in the restart file
-      !! 
+      !!
       !! ** Method  :   Read in restart.nc fields which are necessary for restart
       !!
@@ -255,14 +255,14 @@
       IF(.NOT.lrxios ) CALL iom_delay_rst( 'READ', 'OCE', numror )   ! read only ocean delayed global communication variables
       !
-      !                             !*  Diurnal DSST 
-      IF( ln_diurnal )   CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 
-      IF ( ln_diurnal_only ) THEN 
+      !                             !*  Diurnal DSST
+      IF( ln_diurnal )   CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst )
+      IF ( ln_diurnal_only ) THEN
          IF(lwp) WRITE( numout, * ) &
-         &   "rst_read:- ln_diurnal_only set, setting rhop=rho0" 
+         &   "rst_read:- ln_diurnal_only set, setting rhop=rho0"
          rhop = rho0
-         CALL iom_get( numror, jpdom_auto, 'tn'     , w3d ) 
+         CALL iom_get( numror, jpdom_auto, 'tn'     , w3d )
          ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1)
-         RETURN 
-      ENDIF  
+         RETURN
+      ENDIF
       !
       !                             !*  Read Kmm fields
@@ -289,5 +289,5 @@
          CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop )   ! now    potential density
       ELSE
-         CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )   
+         CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )
       ENDIF
       !
Index: /NEMO/trunk/src/OCE/ISF/isfcav.F90
===================================================================
--- /NEMO/trunk/src/OCE/ISF/isfcav.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ISF/isfcav.F90	(revision 14072)
@@ -79,5 +79,5 @@
       CALL isf_tbl(Kmm, ts(:,:,:,jp_tem,Kmm), zttbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav )
       CALL isf_tbl(Kmm, ts(:,:,:,jp_sal,Kmm), zstbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav )
-      ! 
+      !
       ! output T/S/U/V for the top boundary layer
       CALL iom_put('ttbl_cav',zttbl(:,:) * mskisf_cav(:,:))
@@ -97,5 +97,5 @@
                &                                    zgammat, zgammas )
          END IF
-         !   
+         !
          ! compute tfrz, latent heat and melt (2d)
          CALL isfcav_mlt(kt, zgammat, zgammas, zttbl, zstbl, &
Index: /NEMO/trunk/src/OCE/ISF/isfcpl.F90
===================================================================
--- /NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 14072)
@@ -30,6 +30,6 @@
    PRIVATE
 
-   PUBLIC isfcpl_rst_write, isfcpl_init                    ! iceshelf restart read and write 
-   PUBLIC isfcpl_ssh, isfcpl_tra, isfcpl_vol, isfcpl_cons  ! iceshelf correction for ssh, tra, dyn and conservation 
+   PUBLIC isfcpl_rst_write, isfcpl_init                    ! iceshelf restart read and write
+   PUBLIC isfcpl_ssh, isfcpl_tra, isfcpl_vol, isfcpl_cons  ! iceshelf correction for ssh, tra, dyn and conservation
 
    TYPE isfcons
@@ -57,6 +57,6 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_init  ***
-      !! 
-      !! ** Purpose : correct ocean state for new wet cell and horizontal divergence 
+      !!
+      !! ** Purpose : correct ocean state for new wet cell and horizontal divergence
       !!              correction for the dynamical adjustement
       !!
@@ -74,5 +74,5 @@
       ! start on an euler time step
       l_1st_euler = .TRUE.
-      ! 
+      !
       ! allocation and initialisation to 0
       CALL isf_alloc_cpl()
@@ -88,5 +88,5 @@
       IF(lwp) WRITE(numout,*) ' isfcpl_init:', id
       IF (id == 0) THEN
-         IF(lwp) WRITE(numout,*) ' isfcpl_init: restart variables for ice sheet coupling are missing, skip coupling for this leg ' 
+         IF(lwp) WRITE(numout,*) ' isfcpl_init: restart variables for ice sheet coupling are missing, skip coupling for this leg '
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
          IF(lwp) WRITE(numout,*) ''
@@ -119,12 +119,12 @@
 #if ! defined key_qco
       e3t(:,:,:,Kbb)   = e3t(:,:,:,Kmm)
-#endif 
+#endif
    END SUBROUTINE isfcpl_init
 
-   
+
    SUBROUTINE isfcpl_rst_write( kt, Kmm )
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_rst_write  ***
-      !! 
+      !!
       !! ** Purpose : write icesheet coupling variables in restart
       !!
@@ -143,5 +143,5 @@
          !
          zgdepw(:,:,jk) = gdepw(:,:,jk,Kmm)
-      END DO 
+      END DO
       !
       CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask  )
@@ -154,11 +154,11 @@
    END SUBROUTINE isfcpl_rst_write
 
-   
+
    SUBROUTINE isfcpl_ssh(Kbb, Kmm, Kaa)
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_ssh  ***
-      !! 
+      !!
       !! ** Purpose :   basic guess of ssh in new wet cell
-      !! 
+      !!
       !! ** Method  :   basic extrapolation from neigbourg cells
       !!
@@ -176,5 +176,5 @@
       CALL iom_get( numror, jpdom_auto, 'ssmask'  , zssmask_b   ) ! need to extrapolate T/S
 
-      ! compute new ssh if we open a full water column 
+      ! compute new ssh if we open a full water column
       ! rude average of the closest neigbourgs (e1e2t not taking into account)
       !
@@ -229,11 +229,11 @@
    END SUBROUTINE isfcpl_ssh
 
-   
+
    SUBROUTINE isfcpl_tra(Kmm)
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_tra  ***
-      !! 
-      !! ** Purpose :   compute new tn, sn in case of evolving geometry of ice shelves 
-      !! 
+      !!
+      !! ** Purpose :   compute new tn, sn in case of evolving geometry of ice shelves
+      !!
       !! ** Method  :   tn, sn : basic extrapolation from neigbourg cells
       !!
@@ -250,15 +250,15 @@
       REAL(wp):: zdz, zdzm1, zdzp1
       !!
-      REAL(wp), DIMENSION(jpi,jpj)          :: zdmask 
+      REAL(wp), DIMENSION(jpi,jpj)          :: zdmask
       REAL(wp), DIMENSION(jpi,jpj,jpk)      :: ztmask0, zwmaskn
       REAL(wp), DIMENSION(jpi,jpj,jpk)      :: ztmask1, zwmaskb, ztmp3d
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) :: zts0
       !!----------------------------------------------------------------------
-      ! 
+      !
       CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b   ) ! need to extrapolate T/S
       !CALL iom_get( numror, jpdom_auto, 'wmask'  , zwmask_b  ) ! need to extrapolate T/S
       !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:) ) ! need to interpol vertical profile (vvl)
       !
-      ! 
+      !
       ! compute new T/S (interpolation) if vvl only for common wet cell in before and after wmask
       !PM: Is this IF needed since change to VVL by default
@@ -376,13 +376,13 @@
             &                         in your domain cfg computation'         )
       END_3D
-      ! 
+      !
    END SUBROUTINE isfcpl_tra
-   
+
 
    SUBROUTINE isfcpl_vol(Kmm)
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_vol  ***
-      !! 
-      !! ** Purpose : compute the correction of the local divergence to apply  
+      !!
+      !! ** Purpose : compute the correction of the local divergence to apply
       !!              during the first time step after the coupling.
       !!
@@ -390,10 +390,10 @@
       !!              - compute vertical input
       !!              - compute correction
-      !!                
+      !!
       !!----------------------------------------------------------------------
       !!
       INTEGER, INTENT(in) :: Kmm    ! ocean time level index
       !!----------------------------------------------------------------------
-      INTEGER :: ji, jj, jk 
+      INTEGER :: ji, jj, jk
       INTEGER :: ikb, ikt
       !!
@@ -421,5 +421,5 @@
          !
          ! 1.2: get volume flux after coupling (>0 out)
-         ! properly mask velocity 
+         ! properly mask velocity
          ! (velocity are still mask with old mask at this stage)
          uu(:,:,jk,Kmm) = uu(:,:,jk,Kmm) * umask(:,:,jk)
@@ -459,5 +459,5 @@
       !
       ! 3.2: get 3d tr(:,:,:,:,Krhs) increment to apply at the first time step
-      ! temperature and salt content flux computed using local ts(:,:,:,:,Kmm) 
+      ! temperature and salt content flux computed using local ts(:,:,:,:,Kmm)
       ! (very simple advection scheme)
       ! (>0 out)
@@ -473,16 +473,16 @@
    END SUBROUTINE isfcpl_vol
 
-   
+
    SUBROUTINE isfcpl_cons(Kmm)
-      !!---------------------------------------------------------------------- 
+      !!----------------------------------------------------------------------
       !!                   ***  ROUTINE iscpl_cons  ***
-      !! 
+      !!
       !! ** Purpose :   compute the corrective increment in volume/salt/heat to put back the vol/heat/salt
       !!                removed or added during the coupling processes (wet or dry new cell)
-      !! 
+      !!
       !! ** Method  :   - compare volume/heat/salt before and after
       !!                - look for the closest wet cells (share amoung neigbourgs if there are)
       !!                - build the correction increment to applied at each time step
-      !!                
+      !!
       !!----------------------------------------------------------------------
       !
@@ -496,11 +496,11 @@
       INTEGER  ::   iig  , ijg, ik                    ! dummy indices
       INTEGER  ::   jisf                              ! start, end and current position in the increment array
-      INTEGER  ::   ingb, ifind                       ! 0/1 target found or need to be found 
-      INTEGER  ::   nisfl_area                        ! global number of cell concerned by the wet->dry case 
+      INTEGER  ::   ingb, ifind                       ! 0/1 target found or need to be found
+      INTEGER  ::   nisfl_area                        ! global number of cell concerned by the wet->dry case
       INTEGER, DIMENSION(jpnij) :: nisfl              ! local  number of cell concerned by the wet->dry case
       !
       REAL(wp) ::   z1_sum, z1_rdtiscpl
       REAL(wp) ::   zdtem, zdsal, zdvol, zratio       ! tem, sal, vol increment
-      REAL(wp) ::   zlon , zlat                       ! target location  
+      REAL(wp) ::   zlon , zlat                       ! target location
       REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztmask_b    ! mask before
       REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t_b      ! scale factor before
@@ -522,5 +522,5 @@
       nstp_iscpl  = nitend - nit000 + 1
       rdt_iscpl   = nstp_iscpl * rn_Dt
-      z1_rdtiscpl = 1._wp / rdt_iscpl 
+      z1_rdtiscpl = 1._wp / rdt_iscpl
 
       IF (lwp) WRITE(numout,*) '            nb of stp for cons  = ', nstp_iscpl
@@ -552,5 +552,5 @@
                zdsal = ts(ji,jj,jk,jp_sal,Kmm) *  e3t(ji,jj,jk,Kmm) *  tmask  (ji,jj,jk)   &
                      - zs_b(ji,jj,jk)       * ze3t_b(ji,jj,jk) * ztmask_b(ji,jj,jk)
-            
+
                ! volume, heat and salt differences in each cell (>0 means correction is an outward flux)
                ! in addition to the geometry change unconservation, need to add the divergence correction as it is flux across the boundary
@@ -575,5 +575,5 @@
             DO ji = Nis0,Nie0
                jip1=MIN(ji+1,jpi) ; jim1=MAX(ji-1,1) ; jjp1=MIN(jj+1,jpj) ; jjm1=MAX(jj-1,1) ;
-               IF ( tmask(ji,jj,jk) == 0._wp .AND. ztmask_b(ji,jj,jk) == 1._wp ) THEN 
+               IF ( tmask(ji,jj,jk) == 0._wp .AND. ztmask_b(ji,jj,jk) == 1._wp ) THEN
                   nisfl(narea) = nisfl(narea) + MAX(SUM(tmask(jim1:jip1,jjm1:jjp1,jk)),1._wp)
                ENDIF
@@ -582,5 +582,5 @@
       ENDDO
       !
-      ! global 
+      ! global
       CALL mpp_sum('isfcpl',nisfl  )
       !
@@ -636,5 +636,5 @@
       ! share data among all processes because for some point we need to find the closest wet point (could be on other process)
       DO jproc=1,jpnij
-         ! 
+         !
          ! share total number of isf point treated for proc jproc
          IF (jproc==narea) THEN
@@ -660,7 +660,7 @@
                ingb = zisfpts(jisf)%ngb
             ELSE
-               iig  =0   ; ijg  =0   ; ik   =0  
+               iig  =0   ; ijg  =0   ; ik   =0
                zdvol=-HUGE(1.0) ; zdsal=-HUGE(1.0) ; zdtem=-HUGE(1.0)
-               zlat =-HUGE(1.0) ; zlon =-HUGE(1.0)   
+               zlat =-HUGE(1.0) ; zlon =-HUGE(1.0)
                ingb = 0
             END IF
@@ -711,14 +711,14 @@
       INTEGER,                     INTENT(inout) :: kpts
       !!----------------------------------------------------------------------
-      INTEGER,      INTENT(in   )           :: ki, kj, kk                  !    target location (kfind=0) 
+      INTEGER,      INTENT(in   )           :: ki, kj, kk                  !    target location (kfind=0)
       !                                                                    ! or source location (kfind=1)
       INTEGER,      INTENT(in   ), OPTIONAL :: kfind                       ! 0  target cell already found
       !                                                                    ! 1  target to be determined
-      REAL(wp),     INTENT(in   )           :: pdvol, pdsal, pdtem, pratio ! vol/sal/tem increment 
+      REAL(wp),     INTENT(in   )           :: pdvol, pdsal, pdtem, pratio ! vol/sal/tem increment
       !                                                                    ! and ratio in case increment span over multiple cells.
       !!----------------------------------------------------------------------
       INTEGER :: ifind
       !!----------------------------------------------------------------------
-      ! 
+      !
       ! increment position
       kpts = kpts + 1
Index: /NEMO/trunk/src/OCE/ISF/isfrst.F90
===================================================================
--- /NEMO/trunk/src/OCE/ISF/isfrst.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ISF/isfrst.F90	(revision 14072)
@@ -20,5 +20,5 @@
    PRIVATE
 
-   PUBLIC isfrst_read, isfrst_write ! iceshelf restart read and write 
+   PUBLIC isfrst_read, isfrst_write ! iceshelf restart read and write
 
    !!----------------------------------------------------------------------
@@ -28,5 +28,5 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   
+
    SUBROUTINE isfrst_read( cdisf, ptsc, pfwf, ptsc_b, pfwf_b )
       !!---------------------------------------------------------------------
@@ -63,5 +63,5 @@
    END SUBROUTINE isfrst_read
 
-   
+
    SUBROUTINE isfrst_write( kt, cdisf, ptsc, pfwf )
       !!---------------------------------------------------------------------
@@ -95,5 +95,5 @@
       !
    END SUBROUTINE isfrst_write
-   
+
    !!======================================================================
 END MODULE isfrst
Index: /NEMO/trunk/src/OCE/LBC/lbclnk.F90
===================================================================
--- /NEMO/trunk/src/OCE/LBC/lbclnk.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LBC/lbclnk.F90	(revision 14072)
@@ -6,8 +6,8 @@
    !! History :  OPA  ! 1997-06  (G. Madec)  Original code
    !!   NEMO     1.0  ! 2002-09  (G. Madec)  F90: Free form and module
-   !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment  
+   !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment
    !!            3.5  ! 2012     (S.Mocavero, I. Epicoco)  optimization of BDY comm. via lbc_bdy_lnk and lbc_obc_lnk
-   !!            3.4  ! 2012-12  (R. Bourdalle-Badie, G. Reffray)  add a C1D case  
-   !!            3.6  ! 2015-06  (O. Tintó and M. Castrillo)  add lbc_lnk_multi  
+   !!            3.4  ! 2012-12  (R. Bourdalle-Badie, G. Reffray)  add a C1D case
+   !!            3.6  ! 2015-06  (O. Tintó and M. Castrillo)  add lbc_lnk_multi
    !!            4.0  ! 2017-03  (G. Madec) automatique allocation of array size (use with any 3rd dim size)
    !!             -   ! 2017-04  (G. Madec) remove duplicated routines (lbc_lnk_2d_9, lbc_lnk_2d_multiple, lbc_lnk_3d_gather)
@@ -57,5 +57,5 @@
       MODULE PROCEDURE   mpp_nfd_2d_ptr_sp, mpp_nfd_3d_ptr_sp, mpp_nfd_4d_ptr_sp
       MODULE PROCEDURE   mpp_nfd_2d_ptr_dp, mpp_nfd_3d_ptr_dp, mpp_nfd_4d_ptr_dp
-      
+
    END INTERFACE
 
@@ -527,5 +527,5 @@
 #     include "mpp_lbc_north_icb_generic.h90"
 #     undef ROUTINE_LNK
- 
+
 
       !!----------------------------------------------------------------------
@@ -559,5 +559,4 @@
 #     include "mpp_lnk_icb_generic.h90"
 #     undef ROUTINE_LNK
-  
+
 END MODULE lbclnk
-
Index: /NEMO/trunk/src/OCE/LBC/lib_mpp.F90
===================================================================
--- /NEMO/trunk/src/OCE/LBC/lib_mpp.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LBC/lib_mpp.F90	(revision 14072)
@@ -20,5 +20,5 @@
    !!            4.0  !  2011  (G. Madec)  move ctl_ routines from in_out_manager
    !!            3.5  !  2012  (S.Mocavero, I. Epicoco) Add mpp_lnk_bdy_3d/2d routines to optimize the BDY comm.
-   !!            3.5  !  2013  (C. Ethe, G. Madec)  message passing arrays as local variables 
+   !!            3.5  !  2013  (C. Ethe, G. Madec)  message passing arrays as local variables
    !!            3.5  !  2013  (S.Mocavero, I.Epicoco - CMCC) north fold optimizations
    !!            3.6  !  2015  (O. Tintó and M. Castrillo - BSC) Added '_multiple' case for 2D lbc and max
@@ -77,5 +77,5 @@
    PUBLIC MPI_Wtime
 #endif
-   
+
    !! * Interfaces
    !! define generic interface for these routine as they are called sometimes
@@ -115,5 +115,5 @@
 !$AGRIF_END_DO_NOT_TREAT
    LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .TRUE.    !: mpp flag
-#else   
+#else
    INTEGER, PUBLIC, PARAMETER ::   MPI_STATUS_SIZE = 1
    INTEGER, PUBLIC, PARAMETER ::   MPI_REAL = 4
@@ -183,10 +183,10 @@
    REAL(dp), DIMENSION(2), PUBLIC ::  waiting_time = 0._dp
    REAL(dp)              , PUBLIC ::  compute_time = 0._dp, elapsed_time = 0._dp
-   
+
    REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE ::   tampon   ! buffer in case of bsend
 
    LOGICAL, PUBLIC ::   ln_nnogather                !: namelist control of northfold comms
    LOGICAL, PUBLIC ::   l_north_nogather = .FALSE.  !: internal control of northfold comms
-   
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -223,5 +223,5 @@
          IF( ierr /= MPI_SUCCESS ) CALL ctl_stop( 'STOP', ' lib_mpp: Error in routine mpi_init' )
       ENDIF
-       
+
       IF( PRESENT(localComm) ) THEN
          IF( Agrif_Root() ) THEN
@@ -473,5 +473,5 @@
    END SUBROUTINE mppscatter
 
-   
+
    SUBROUTINE mpp_delay_sum( cdname, cdelay, y_in, pout, ldlast, kcom )
      !!----------------------------------------------------------------------
@@ -498,5 +498,5 @@
 
       isz = SIZE(y_in)
-      
+
       IF( narea == 1 .AND. numcom == -1 ) CALL mpp_report( cdname, ld_dlg = .TRUE. )
 
@@ -519,5 +519,5 @@
          END IF
       ENDIF
-      
+
       IF( ndelayid(idvar) == -1 ) THEN         ! first call without restart: define %y1d and %z1d from y_in with blocking allreduce
          !                                       --------------------------
@@ -547,5 +547,5 @@
    END SUBROUTINE mpp_delay_sum
 
-   
+
    SUBROUTINE mpp_delay_max( cdname, cdelay, p_in, pout, ldlast, kcom )
       !!----------------------------------------------------------------------
@@ -557,6 +557,6 @@
       CHARACTER(len=*), INTENT(in   )                 ::   cdname  ! name of the calling subroutine
       CHARACTER(len=*), INTENT(in   )                 ::   cdelay  ! name (used as id) of the delayed operation
-      REAL(wp),         INTENT(in   ), DIMENSION(:)   ::   p_in    ! 
-      REAL(wp),         INTENT(  out), DIMENSION(:)   ::   pout    ! 
+      REAL(wp),         INTENT(in   ), DIMENSION(:)   ::   p_in    !
+      REAL(wp),         INTENT(  out), DIMENSION(:)   ::   pout    !
       LOGICAL,          INTENT(in   )                 ::   ldlast  ! true if this is the last time we call this routine
       INTEGER,          INTENT(in   ), OPTIONAL       ::   kcom
@@ -567,5 +567,5 @@
       INTEGER ::   MPI_TYPE
       !!----------------------------------------------------------------------
-      
+
 #if defined key_mpp_mpi
       if( wp == dp ) then
@@ -575,5 +575,5 @@
       else
         CALL ctl_stop( "Error defining type, wp is neither dp nor sp" )
-   
+
       end if
 
@@ -629,13 +629,13 @@
    END SUBROUTINE mpp_delay_max
 
-   
+
    SUBROUTINE mpp_delay_rcv( kid )
       !!----------------------------------------------------------------------
       !!                   ***  routine mpp_delay_rcv  ***
       !!
-      !! ** Purpose :  force barrier for delayed mpp (needed for restart) 
-      !!
-      !!----------------------------------------------------------------------
-      INTEGER,INTENT(in   )      ::  kid 
+      !! ** Purpose :  force barrier for delayed mpp (needed for restart)
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER,INTENT(in   )      ::  kid
       INTEGER ::   ierr
       !!----------------------------------------------------------------------
@@ -674,8 +674,8 @@
    END SUBROUTINE mpp_bcast_nml
 
-   
+
    !!----------------------------------------------------------------------
    !!    ***  mppmax_a_int, mppmax_int, mppmax_a_real, mppmax_real  ***
-   !!   
+   !!
    !!----------------------------------------------------------------------
    !!
@@ -729,5 +729,5 @@
    !!----------------------------------------------------------------------
    !!    ***  mppmin_a_int, mppmin_int, mppmin_a_real, mppmin_real  ***
-   !!   
+   !!
    !!----------------------------------------------------------------------
    !!
@@ -781,5 +781,5 @@
    !!----------------------------------------------------------------------
    !!    ***  mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real  ***
-   !!   
+   !!
    !!   Global sum of 1D array or a variable (integer, real or complex)
    !!----------------------------------------------------------------------
@@ -855,5 +855,5 @@
    !!----------------------------------------------------------------------
    !!    ***  mpp_minloc2d, mpp_minloc3d, mpp_maxloc2d, mpp_maxloc3d
-   !!   
+   !!
    !!----------------------------------------------------------------------
    !!
@@ -935,5 +935,5 @@
 
 
-   SUBROUTINE mppstop( ld_abort ) 
+   SUBROUTINE mppstop( ld_abort )
       !!----------------------------------------------------------------------
       !!                  ***  routine mppstop  ***
@@ -1080,5 +1080,5 @@
       !!                collectives
       !!
-      !! ** Method  : - Create graph communicators starting from the processes   
+      !! ** Method  : - Create graph communicators starting from the processes
       !!                distribution along i and j directions
       !
@@ -1411,5 +1411,5 @@
                   jj = 0
                END IF
-               jj = jj + 1 
+               jj = jj + 1
             END DO
             WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_glb(n_sequence_glb))
@@ -1427,5 +1427,5 @@
                   jj = 0
                END IF
-               jj = jj + 1 
+               jj = jj + 1
             END DO
             WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_dlg(n_sequence_dlg))
@@ -1443,5 +1443,5 @@
    END SUBROUTINE mpp_report
 
-   
+
    SUBROUTINE tic_tac (ld_tic, ld_global)
 
@@ -1459,5 +1459,5 @@
        IF( ld_global ) ii = 2
     END IF
-    
+
     IF ( ld_tic ) THEN
        tic_wt(ii) = MPI_Wtime()                                                    ! start count tic->tac (waiting time)
@@ -1468,5 +1468,5 @@
     ENDIF
 #endif
-    
+
    END SUBROUTINE tic_tac
 
@@ -1478,5 +1478,5 @@
    END SUBROUTINE mpi_wait
 
-   
+
    FUNCTION MPI_Wtime()
       REAL(wp) ::  MPI_Wtime
@@ -1540,7 +1540,7 @@
       !
       IF( cd1 == 'STOP' ) THEN
-         WRITE(numout,*)  
+         WRITE(numout,*)
          WRITE(numout,*)  'huge E-R-R-O-R : immediate stop'
-         WRITE(numout,*)  
+         WRITE(numout,*)
          CALL FLUSH(numout)
          CALL SLEEP(60)   ! make sure that all output and abort files are written by all cores. 60s should be enough...
@@ -1639,5 +1639,5 @@
       ENDIF
       IF( iost /= 0 .AND. TRIM(clfile) == '/dev/null' ) &   ! for windows
-         &  OPEN(UNIT=knum,FILE='NUL', FORM=cdform, ACCESS=cdacce, STATUS=cdstat                      , ERR=100, IOSTAT=iost )   
+         &  OPEN(UNIT=knum,FILE='NUL', FORM=cdform, ACCESS=cdacce, STATUS=cdstat                      , ERR=100, IOSTAT=iost )
       IF( iost == 0 ) THEN
          IF(ldwp .AND. kout > 0) THEN
@@ -1681,5 +1681,5 @@
       !
       WRITE (clios, '(I5.0)')   kios
-      IF( kios < 0 ) THEN         
+      IF( kios < 0 ) THEN
          CALL ctl_warn( 'end of record or file while reading namelist '   &
             &           // TRIM(cdnam) // ' iostat = ' // TRIM(clios) )
@@ -1727,5 +1727,5 @@
       !csp = NEW_LINE('A')
       ! a new line character is the best seperator but some systems (e.g.Cray)
-      ! seem to terminate namelist reads from internal files early if they 
+      ! seem to terminate namelist reads from internal files early if they
       ! encounter new-lines. Use a single space for safety.
       csp = ' '
@@ -1746,5 +1746,5 @@
          iltc = LEN_TRIM(chline)
          IF ( iltc.GT.0 ) THEN
-          inl = INDEX(chline, '!') 
+          inl = INDEX(chline, '!')
           IF( inl.eq.0 ) THEN
            itot = itot + iltc + 1                                ! +1 for the newline character
Index: /NEMO/trunk/src/OCE/LBC/mpp_lnk_generic.h90
===================================================================
--- /NEMO/trunk/src/OCE/LBC/mpp_lnk_generic.h90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LBC/mpp_lnk_generic.h90	(revision 14072)
@@ -1,4 +1,4 @@
 #if defined MULTI
-#   define NAT_IN(k)                cd_nat(k)   
+#   define NAT_IN(k)                cd_nat(k)
 #   define SGN_IN(k)                psgn(k)
 #   define F_SIZE(ptab)             kfld
@@ -43,5 +43,5 @@
 #   define SGN_IN(k)                psgn
 #   define F_SIZE(ptab)             1
-#   define OPT_K(k)                 
+#   define OPT_K(k)
 #   if defined DIM_2d
 #      define ARRAY_IN(i,j,k,l,f)   ptab(i,j)
@@ -97,5 +97,5 @@
       REAL(PRECISION), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zsnd_so, zrcv_so, zsnd_no, zrcv_no   ! north-south & south-north  halos
       LOGICAL  ::   llsend_we, llsend_ea, llsend_no, llsend_so       ! communication send
-      LOGICAL  ::   llrecv_we, llrecv_ea, llrecv_no, llrecv_so       ! communication receive 
+      LOGICAL  ::   llrecv_we, llrecv_ea, llrecv_no, llrecv_so       ! communication receive
       LOGICAL  ::   lldo_nfd                                     ! do north pole folding
       !!----------------------------------------------------------------------
@@ -133,6 +133,6 @@
          llrecv_we = llsend_we   ;   llrecv_ea = llsend_ea   ;   llrecv_so = llsend_so   ;   llrecv_no = llsend_no
       END IF
-         
-         
+
+
       lldo_nfd = npolj /= 0                      ! keep for compatibility, should be defined in mppini
 
@@ -178,5 +178,5 @@
       !
       ! Must exchange the whole column (from 1 to jpj) to get the corners if we have no south/north neighbourg
-      isize = nn_hls * jpj * ipk * ipl * ipf      
+      isize = nn_hls * jpj * ipk * ipl * ipf
       !
       ! Allocate local temporary arrays to be sent/received. Fill arrays to be sent
@@ -220,6 +220,6 @@
       ! ishift = 0                         ! fill halo from ji = 1 to nn_hls
       SELECT CASE ( ifill_we )
-      CASE ( jpfillnothing )               ! no filling 
-      CASE ( jpfillmpi   )                 ! use data received by MPI 
+      CASE ( jpfillnothing )               ! no filling
+      CASE ( jpfillmpi   )                 ! use data received by MPI
          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_we(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
@@ -242,8 +242,8 @@
       ! 2.2 fill eastern halo
       ! ---------------------
-      ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi 
+      ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi
       SELECT CASE ( ifill_ea )
-      CASE ( jpfillnothing )               ! no filling 
-      CASE ( jpfillmpi   )                 ! use data received by MPI 
+      CASE ( jpfillnothing )               ! no filling
+      CASE ( jpfillmpi   )                 ! use data received by MPI
          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv_ea(ji,jj,jk,jl,jf)   ! jpi - nn_hls + 1 -> jpi
@@ -290,5 +290,5 @@
       IF( llrecv_no )   ALLOCATE( zrcv_no(jpi,nn_hls,ipk,ipl,ipf) )
       !
-      isize = jpi * nn_hls * ipk * ipl * ipf      
+      isize = jpi * nn_hls * ipk * ipl * ipf
 
       ! allocate local temporary arrays to be sent/received. Fill arrays to be sent
@@ -326,6 +326,6 @@
       ! ishift = 0                         ! fill halo from jj = 1 to nn_hls
       SELECT CASE ( ifill_so )
-      CASE ( jpfillnothing )               ! no filling 
-      CASE ( jpfillmpi   )                 ! use data received by MPI 
+      CASE ( jpfillnothing )               ! no filling
+      CASE ( jpfillmpi   )                 ! use data received by MPI
          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_so(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
@@ -341,5 +341,5 @@
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcst   )                 ! filling with constant value
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi 
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,jj,jk,jl,jf) = zland
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
@@ -348,8 +348,8 @@
       ! 5.2 fill northern halo
       ! ----------------------
-      ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj 
+      ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj
       SELECT CASE ( ifill_no )
-      CASE ( jpfillnothing )               ! no filling 
-      CASE ( jpfillmpi   )                 ! use data received by MPI 
+      CASE ( jpfillnothing )               ! no filling
+      CASE ( jpfillmpi   )                 ! use data received by MPI
          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zrcv_no(ji,jj,jk,jl,jf)   ! jpj-nn_hls+1 -> jpj
Index: /NEMO/trunk/src/OCE/LBC/mppini.F90
===================================================================
--- /NEMO/trunk/src/OCE/LBC/mppini.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LBC/mppini.F90	(revision 14072)
@@ -9,5 +9,5 @@
    !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1
    !!            3.4  !  2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom
-   !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication 
+   !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication
    !!            4.0  !  2016-06  (G. Madec)  use domain configuration file instead of bathymetry file
    !!            4.0  !  2017-06  (J.M. Molines, T. Lovato) merge of mppini and mppini_2
@@ -16,14 +16,14 @@
    !!----------------------------------------------------------------------
    !!  mpp_init       : Lay out the global domain over processors with/without land processor elimination
-   !!      init_ioipsl: IOIPSL initialization in mpp 
+   !!      init_ioipsl: IOIPSL initialization in mpp
    !!      init_nfdcom: Setup for north fold exchanges with explicit point-to-point messaging
-   !!      init_doloop: set the starting/ending indices of DO-loop used in do_loop_substitute 
+   !!      init_doloop: set the starting/ending indices of DO-loop used in do_loop_substitute
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean space and time domain
-   USE bdy_oce        ! open BounDarY  
+   USE bdy_oce        ! open BounDarY
    !
-   USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges 
+   USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges
    USE lib_mpp        ! distribued memory computing library
-   USE iom            ! nemo I/O library 
+   USE iom            ! nemo I/O library
    USE ioipsl         ! I/O IPSL library
    USE in_out_manager ! I/O Manager
@@ -36,11 +36,11 @@
    PUBLIC   mpp_basesplit  ! called by prtctl
    PUBLIC   mpp_is_ocean   ! called by prtctl
-   
+
    INTEGER ::   numbot = -1   ! 'bottom_level' local logical unit
    INTEGER ::   numbdy = -1   ! 'bdy_msk'      local logical unit
-   
+
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -88,5 +88,5 @@
       l_Jperio = jpnj == 1 .AND. (jperio == 2 .OR. jperio == 7)
       !
-      CALL init_doloop                       ! set start/end indices or do-loop depending on the halo width value (nn_hls) 
+      CALL init_doloop                       ! set start/end indices or do-loop depending on the halo width value (nn_hls)
       !
       IF(lwp) THEN
@@ -94,5 +94,5 @@
          WRITE(numout,*) 'mpp_init : NO massively parallel processing'
          WRITE(numout,*) '~~~~~~~~ '
-         WRITE(numout,*) '   l_Iperio = ', l_Iperio, '    l_Jperio = ', l_Jperio 
+         WRITE(numout,*) '   l_Iperio = ', l_Iperio, '    l_Jperio = ', l_Jperio
          WRITE(numout,*) '     npolj  = ',   npolj , '      njmpp  = ', njmpp
       ENDIF
@@ -114,5 +114,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE mpp_init  ***
-      !!                    
+      !!
       !! ** Purpose :   Lay out the global domain over processors.
       !!      If land processors are to be eliminated, this program requires the
@@ -128,5 +128,5 @@
       !!
       !! ** Action : - set domain parameters
-      !!                    nimpp     : longitudinal index 
+      !!                    nimpp     : longitudinal index
       !!                    njmpp     : latitudinal  index
       !!                    narea     : number for local area
@@ -148,5 +148,5 @@
       INTEGER ::   iiea, ijea, iiwe, ijwe     !   -       -
       INTEGER ::   iarea0                     !   -       -
-      INTEGER ::   ierr, ios                  ! 
+      INTEGER ::   ierr, ios                  !
       INTEGER ::   inbi, inbj, iimax,  ijmax, icnt1, icnt2
       LOGICAL ::   llbest, llauto
@@ -162,5 +162,5 @@
       NAMELIST/nambdy/ ln_bdy, nb_bdy, ln_coords_file, cn_coords_file,           &
            &             ln_mask_file, cn_mask_file, cn_dyn2d, nn_dyn2d_dta,     &
-           &             cn_dyn3d, nn_dyn3d_dta, cn_tra, nn_tra_dta,             &  
+           &             cn_dyn3d, nn_dyn3d_dta, cn_tra, nn_tra_dta,             &
            &             ln_tra_dmp, ln_dyn3d_dmp, rn_time_dmp, rn_time_dmp_out, &
            &             cn_ice, nn_ice_dta,                                     &
@@ -177,5 +177,5 @@
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' )
       READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' )   
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' )
       !
       nn_hls = MAX(1, nn_hls)   ! nn_hls must be > 0
@@ -259,5 +259,5 @@
          ENDIF
       ENDIF
-      
+
       ! look for land mpi subdomains...
       ALLOCATE( llisoce(jpni,jpnj) )
@@ -333,5 +333,5 @@
       CALL mpp_sum( 'mppini', ierr )
       IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'mpp_init: unable to allocate standard ocean arrays' )
-      
+
 #if defined key_agrif
       IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
@@ -354,6 +354,6 @@
       !   nfjpi (jn) =   ijpi(ii,ij)
       !END DO
-      nfproc(:) = ipproc(:,jpnj) 
-      nfimpp(:) = iimppt(:,jpnj) 
+      nfproc(:) = ipproc(:,jpnj)
+      nfimpp(:) = iimppt(:,jpnj)
       nfjpi (:) =   ijpi(:,jpnj)
       !
@@ -363,5 +363,5 @@
          WRITE(numout,*)
          WRITE(numout,*) '   defines mpp subdomains'
-         WRITE(numout,*) '      jpni = ', jpni  
+         WRITE(numout,*) '      jpni = ', jpni
          WRITE(numout,*) '      jpnj = ', jpnj
          WRITE(numout,*) '     jpnij = ', jpnij
@@ -370,12 +370,12 @@
          WRITE(numout,*) '      sum ijpj(1,j) = ', sum(ijpj(1,:)), ' jpjglo = ', jpjglo
       ENDIF
-     
+
       ! 3. Subdomain description in the Regular Case
       ! --------------------------------------------
       ! specific cases where there is no communication -> must do the periodicity by itself
-      ! Warning: because of potential land-area suppression, do not use nbond[ij] == 2  
+      ! Warning: because of potential land-area suppression, do not use nbond[ij] == 2
       l_Iperio = jpni == 1 .AND. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7)
       l_Jperio = jpnj == 1 .AND. (jperio == 2 .OR. jperio == 7)
-      
+
       DO jarea = 1, jpni*jpnj
          !
@@ -450,5 +450,5 @@
             ! In case of north fold exchange: I am the n neigbour of my n neigbour!! (#1057)
             ! --> for northern neighbours of northern row processors (in case of north-fold)
-            !     need to reverse the LOGICAL direction of communication 
+            !     need to reverse the LOGICAL direction of communication
             idir = 1                                           ! we are indeed the s neigbour of this n neigbour
             IF( ij == jpnj .AND. ijno == jpnj )   idir = -1    ! both are on the last row, we are in fact the n neigbour
@@ -478,5 +478,5 @@
          ENDIF
       END DO
-      
+
       ! 5. Subdomain print
       ! ------------------
@@ -504,5 +504,5 @@
  9404    FORMAT('           *  '   ,20('     ' ,i4,'   *   ') )
       ENDIF
-         
+
       ! just to save nono etc for all proc
       ! warning ii*ij (zone) /= nproc (processors)!
@@ -511,5 +511,5 @@
       ii_nono(:) = -1
       ii_noea(:) = -1
-      ii_nowe(:) = -1 
+      ii_nowe(:) = -1
       DO jproc = 1, jpnij
          ii = iin(jproc)
@@ -536,5 +536,5 @@
          ENDIF
       END DO
-    
+
       ! 6. Change processor name
       ! ------------------------
@@ -542,13 +542,13 @@
       ij = ijn(narea)
       !
-      jpi    = ijpi(ii,ij)  
+      jpi    = ijpi(ii,ij)
 !!$      Nis0  = iis0(ii,ij)
 !!$      Nie0  = iie0(ii,ij)
-      jpj    = ijpj(ii,ij)  
+      jpj    = ijpj(ii,ij)
 !!$      Njs0  = ijs0(ii,ij)
 !!$      Nje0  = ije0(ii,ij)
       nbondi = ibondi(ii,ij)
       nbondj = ibondj(ii,ij)
-      nimpp = iimppt(ii,ij)  
+      nimpp = iimppt(ii,ij)
       njmpp = ijmppt(ii,ij)
       jpk = jpkglo                              ! third dim
@@ -564,5 +564,5 @@
       noses = -1
       nosws = -1
-      
+
       noner = -1
       nonwr = -1
@@ -613,5 +613,5 @@
 
       !
-      CALL init_doloop                          ! set start/end indices of do-loop, depending on the halo width value (nn_hls) 
+      CALL init_doloop                          ! set start/end indices of do-loop, depending on the halo width value (nn_hls)
       !
       jpim1 = jpi-1                             ! inner domain indices
@@ -630,6 +630,6 @@
          ibonit(jproc) = ibondi(ii,ij)
          ibonjt(jproc) = ibondj(ii,ij)
-         nimppt(jproc) = iimppt(ii,ij)  
-         njmppt(jproc) = ijmppt(ii,ij) 
+         nimppt(jproc) = iimppt(ii,ij)
+         njmppt(jproc) = ijmppt(ii,ij)
       END DO
 
@@ -647,8 +647,8 @@
                &                                nis0all(jproc), njs0all(jproc),   &
                &                                nie0all(jproc), nje0all(jproc),   &
-               &                                nimppt (jproc), njmppt (jproc),   & 
+               &                                nimppt (jproc), njmppt (jproc),   &
                &                                ii_nono(jproc), ii_noso(jproc),   &
                &                                ii_nowe(jproc), ii_noea(jproc),   &
-               &                                ibonit (jproc), ibonjt (jproc) 
+               &                                ibonit (jproc), ibonjt (jproc)
          END DO
       END IF
@@ -707,5 +707,5 @@
       !
       CALL init_ioipsl       ! Prepare NetCDF output file (if necessary)
-      !      
+      !
       IF (( jperio >= 3 .AND. jperio <= 6 .AND. jpni > 1 ).AND.( ln_nnogather )) THEN
          CALL init_nfdcom     ! northfold neighbour lists
@@ -719,5 +719,5 @@
       ENDIF
       !
-      IF (llwrtlay) CLOSE(inum)   
+      IF (llwrtlay) CLOSE(inum)
       !
       DEALLOCATE(iin, ijn, ii_nono, ii_noea, ii_noso, ii_nowe,    &
@@ -733,5 +733,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE mpp_basesplit  ***
-      !!                    
+      !!
       !! ** Purpose :   Lay out the global domain over processors.
       !!
@@ -752,5 +752,5 @@
       !
       INTEGER ::   ji, jj
-      INTEGER ::   i2hls 
+      INTEGER ::   i2hls
       INTEGER ::   iresti, irestj, irm, ijpjmin
       !!----------------------------------------------------------------------
@@ -759,5 +759,5 @@
 #if defined key_nemocice_decomp
       kimax = ( nx_global+2-i2hls + (knbi-1) ) / knbi + i2hls    ! first  dim.
-      kjmax = ( ny_global+2-i2hls + (knbj-1) ) / knbj + i2hls    ! second dim. 
+      kjmax = ( ny_global+2-i2hls + (knbj-1) ) / knbj + i2hls    ! second dim.
 #else
       kimax = ( kiglo - i2hls + (knbi-1) ) / knbi + i2hls    ! first  dim.
@@ -797,5 +797,5 @@
          irm = knbj - irestj                                       ! total number of lines to be removed
          klcj(:,knbj) = MAX( ijpjmin, kjmax-irm )                  ! we must have jpj >= ijpjmin in the last row
-         irm = irm - ( kjmax - klcj(1,knbj) )                      ! remaining number of lines to remove 
+         irm = irm - ( kjmax - klcj(1,knbj) )                      ! remaining number of lines to remove
          irestj = knbj - 1 - irm
          klcj(:, irestj+1:knbj-1) = kjmax-1
@@ -831,5 +831,5 @@
          END DO
       ENDIF
-      
+
    END SUBROUTINE mpp_basesplit
 
@@ -890,5 +890,5 @@
       ! get the list of knbi that gives a smaller jpimax than knbi-1
       ! get the list of knbj that gives a smaller jpjmax than knbj-1
-      DO ji = 1, inbijmax      
+      DO ji = 1, inbijmax
 #if defined key_nemocice_decomp
          iszitst = ( nx_global+2-2*nn_hls + (ji-1) ) / ji + 2*nn_hls    ! first  dim.
@@ -958,5 +958,5 @@
       ! extract only the partitions which reduce the subdomain size in comparison with smaller partitions
       ALLOCATE( indexok(isz1) )                                 ! to store indices of the best partitions
-      isz0 = 0                                                  ! number of best partitions     
+      isz0 = 0                                                  ! number of best partitions
       inbij = 1                                                 ! start with the min value of inbij1 => 1
       iszij = jpiglo*jpjglo+1                                   ! default: larger than global domain
@@ -1018,10 +1018,10 @@
          CALL mppstop( ld_abort = .TRUE. )
       ENDIF
-      
+
       DEALLOCATE( iszi0, iszj0 )
       inbij = inbijmax + 1        ! default: larger than possible
       ii = isz0+1                 ! start from the end of the list (smaller subdomains)
       DO WHILE( inbij > knbij )   ! while the number of ocean subdomains exceed the number of procs
-         ii = ii -1 
+         ii = ii -1
          ALLOCATE( llisoce(inbi0(ii), inbj0(ii)) )
          CALL mpp_is_ocean( llisoce )            ! must be done by all core
@@ -1035,6 +1035,6 @@
       !
    END SUBROUTINE bestpartition
-   
-   
+
+
    SUBROUTINE mpp_init_landprop( propland )
       !!----------------------------------------------------------------------
@@ -1059,7 +1059,7 @@
       ENDIF
 
-      ! number of processes reading the bathymetry file 
+      ! number of processes reading the bathymetry file
       iproc = MINVAL( (/mppsize, Nj0glo/2, 100/) )  ! read a least 2 lines, no more that 100 processes reading at the same time
-      
+
       ! we want to read iproc strips of the land-sea mask. -> pick up iproc processes every idiv processes starting at 1
       IF( iproc == 1 ) THEN   ;   idiv = mppsize
@@ -1084,9 +1084,9 @@
       CALL mpp_sum( 'mppini', inboce )   ! total number of ocean points over the global domain
       !
-      propland = REAL( Ni0glo*Nj0glo - inboce, wp ) / REAL( Ni0glo*Nj0glo, wp ) 
+      propland = REAL( Ni0glo*Nj0glo - inboce, wp ) / REAL( Ni0glo*Nj0glo, wp )
       !
    END SUBROUTINE mpp_init_landprop
-   
-   
+
+
    SUBROUTINE mpp_is_ocean( ldisoce )
       !!----------------------------------------------------------------------
@@ -1104,5 +1104,5 @@
       !! ** Method  : read inbj strips (of length Ni0glo) of the land-sea mask
       !!----------------------------------------------------------------------
-      LOGICAL, DIMENSION(:,:), INTENT(  out) ::   ldisoce        ! .true. if a sub domain constains 1 ocean point 
+      LOGICAL, DIMENSION(:,:), INTENT(  out) ::   ldisoce        ! .true. if a sub domain constains 1 ocean point
       !
       INTEGER :: idiv, iimax, ijmax, iarea
@@ -1113,5 +1113,5 @@
       INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   iimppt, ijpi
       INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   ijmppt, ijpj
-      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce            ! lloce(i,j) = .true. if the point (i,j) is ocean 
+      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce            ! lloce(i,j) = .true. if the point (i,j) is ocean
       !!----------------------------------------------------------------------
       ! do nothing if there is no land-sea mask
@@ -1146,5 +1146,5 @@
             isty = 1 + COUNT( (/ iarea == 1 /) )                       ! read from the first or the second line?
             CALL readbot_strip( ijmppt(1,iarea) - 2 + isty, inry, lloce(2:inx-1, isty:inry+isty-1) )   ! read the strip
-            ! 
+            !
             IF( iarea == 1    ) THEN                                   ! the first line was not read
                IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity
@@ -1157,5 +1157,5 @@
                IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity
                   CALL readbot_strip( 1, 1, lloce(2:inx-1,iny) )       !      read the first line -> last line of lloce
-               ELSEIF( jperio == 3 .OR. jperio == 4 ) THEN             !   north-pole folding T-pivot, T-point 
+               ELSEIF( jperio == 3 .OR. jperio == 4 ) THEN             !   north-pole folding T-pivot, T-point
                   lloce(2,iny) = lloce(2,iny-2)                        !      here we have 1 halo (even if nn_hls>1)
                   DO ji = 3,inx-1
@@ -1191,5 +1191,5 @@
          ENDIF
       END DO
-   
+
       inboce_1d = RESHAPE(inboce, (/ inbi*inbj /))
       CALL mpp_sum( 'mppini', inboce_1d )
@@ -1199,6 +1199,6 @@
       !
    END SUBROUTINE mpp_is_ocean
-   
-   
+
+
    SUBROUTINE readbot_strip( kjstr, kjcnt, ldoce )
       !!----------------------------------------------------------------------
@@ -1213,13 +1213,13 @@
       INTEGER                         , INTENT(in   ) ::   kjstr       ! starting j position of the reading
       INTEGER                         , INTENT(in   ) ::   kjcnt       ! number of lines to read
-      LOGICAL, DIMENSION(Ni0glo,kjcnt), INTENT(  out) ::   ldoce       ! ldoce(i,j) = .true. if the point (i,j) is ocean 
+      LOGICAL, DIMENSION(Ni0glo,kjcnt), INTENT(  out) ::   ldoce       ! ldoce(i,j) = .true. if the point (i,j) is ocean
       !
       INTEGER                           ::   inumsave                ! local logical unit
-      REAL(wp), DIMENSION(Ni0glo,kjcnt) ::   zbot, zbdy 
+      REAL(wp), DIMENSION(Ni0glo,kjcnt) ::   zbot, zbdy
       !!----------------------------------------------------------------------
       !
       inumsave = numout   ;   numout = numnul   !   redirect all print to /dev/null
       !
-      IF( numbot /= -1 ) THEN   
+      IF( numbot /= -1 ) THEN
          CALL iom_get( numbot, jpdom_unknown, 'bottom_level', zbot, kstart = (/1,kjstr/), kcount = (/Ni0glo, kjcnt/) )
       ELSE
@@ -1227,5 +1227,5 @@
       ENDIF
       !
-      IF( numbdy /= -1 ) THEN                   ! Adjust with bdy_msk if it exists    
+      IF( numbdy /= -1 ) THEN                   ! Adjust with bdy_msk if it exists
          CALL iom_get ( numbdy, jpdom_unknown,     'bdy_msk', zbdy, kstart = (/1,kjstr/), kcount = (/Ni0glo, kjcnt/) )
          zbot(:,:) = zbot(:,:) * zbdy(:,:)
@@ -1295,10 +1295,10 @@
       !!                  ***  ROUTINE init_ioipsl  ***
       !!
-      !! ** Purpose :   
-      !!
-      !! ** Method  :   
+      !! ** Purpose :
+      !!
+      !! ** Method  :
       !!
       !! History :
-      !!   9.0  !  04-03  (G. Madec )  MPP-IOIPSL 
+      !!   9.0  !  04-03  (G. Madec )  MPP-IOIPSL
       !!   " "  !  08-12  (A. Coward)  addition in case of jpni*jpnj < jpnij
       !!----------------------------------------------------------------------
@@ -1328,5 +1328,5 @@
       CALL flio_dom_set ( jpnij, nproc, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom)
       !
-   END SUBROUTINE init_ioipsl  
+   END SUBROUTINE init_ioipsl
 
 
@@ -1334,5 +1334,5 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE  init_nfdcom  ***
-      !! ** Purpose :   Setup for north fold exchanges with explicit 
+      !! ** Purpose :   Setup for north fold exchanges with explicit
       !!                point-to-point messaging
       !!
@@ -1340,5 +1340,5 @@
       !!----------------------------------------------------------------------
       !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)
-      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 
+      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)
       !!----------------------------------------------------------------------
       INTEGER  ::   sxM, dxM, sxT, dxT, jn
@@ -1392,6 +1392,6 @@
       !
       Nis0 =   1+nn_hls   ;   Nis1 = Nis0-1   ;   Nis2 = MAX(  1, Nis0-2)
-      Njs0 =   1+nn_hls   ;   Njs1 = Njs0-1   ;   Njs2 = MAX(  1, Njs0-2)  
-      !                                                 
+      Njs0 =   1+nn_hls   ;   Njs1 = Njs0-1   ;   Njs2 = MAX(  1, Njs0-2)
+      !
       Nie0 = jpi-nn_hls   ;   Nie1 = Nie0+1   ;   Nie2 = MIN(jpi, Nie0+2)
       Nje0 = jpj-nn_hls   ;   Nje1 = Nje0+1   ;   Nje2 = MIN(jpj, Nje0+2)
@@ -1402,5 +1402,5 @@
          Nie1nxt2 = Nie0   ;   Nje1nxt2 = Nje0
          !
-      ELSE                            !* larger halo size... 
+      ELSE                            !* larger halo size...
          !
          Nis1nxt2 = Nis1   ;   Njs1nxt2 = Njs1
@@ -1417,5 +1417,5 @@
       !
    END SUBROUTINE init_doloop
-   
+
    !!======================================================================
 END MODULE mppini
Index: /NEMO/trunk/src/OCE/LDF/ldfc1d_c2d.F90
===================================================================
--- /NEMO/trunk/src/OCE/LDF/ldfc1d_c2d.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LDF/ldfc1d_c2d.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                    ***  MODULE  ldfc1d_c2d  ***
-   !! Ocean physics:  profile and horizontal shape of lateral eddy coefficients 
+   !! Ocean physics:  profile and horizontal shape of lateral eddy coefficients
    !!=====================================================================
    !! History :  3.7  ! 2013-12  (G. Madec)  restructuration/simplification of aht/aeiv specification,
@@ -9,5 +9,5 @@
 
    !!----------------------------------------------------------------------
-   !!   ldf_c1d       : ah reduced by 1/4 on the vertical (tanh profile, inflection at 300m) 
+   !!   ldf_c1d       : ah reduced by 1/4 on the vertical (tanh profile, inflection at 300m)
    !!   ldf_c2d       : ah = F(e1,e2) (laplacian or = F(e1^3,e2^3) (bilaplacian)
    !!----------------------------------------------------------------------
@@ -29,5 +29,5 @@
    REAL(wp) ::   r1_4  = 0.25_wp          ! =1/4
    REAL(wp) ::   r1_12 = 1._wp / 12._wp   ! =1/12
- 
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -42,10 +42,10 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ldf_c1d  ***
-      !!              
+      !!
       !! ** Purpose :   1D eddy diffusivity/viscosity coefficients
       !!
       !! ** Method  :   1D eddy diffusivity coefficients F( depth )
-      !!                Reduction by zratio from surface to bottom 
-      !!                hyperbolic tangent profile with inflection point 
+      !!                Reduction by zratio from surface to bottom
+      !!                hyperbolic tangent profile with inflection point
       !!                at zh=500m and a width of zw=200m
       !!
@@ -95,5 +95,5 @@
          END_3D
          ! Lateral boundary conditions
-         CALL lbc_lnk_multi( 'ldfc1d_c2d', pah1, 'U', 1.0_wp , pah2, 'V', 1.0_wp )   
+         CALL lbc_lnk_multi( 'ldfc1d_c2d', pah1, 'U', 1.0_wp , pah2, 'V', 1.0_wp )
          !
       CASE DEFAULT                        ! error
@@ -107,5 +107,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ldf_c2d  ***
-      !!              
+      !!
       !! ** Purpose :   2D eddy diffusivity/viscosity coefficients
       !!
@@ -113,5 +113,5 @@
       !!       laplacian   operator :   ah proportional to the scale factor      [m2/s]
       !!       bilaplacian operator :   ah proportional to the (scale factor)^3  [m4/s]
-      !!       In both cases, pah0 is the maximum value reached by the coefficient 
+      !!       In both cases, pah0 is the maximum value reached by the coefficient
       !!       at the Equator in case of e1=ra*rad= ~111km, not over the whole domain.
       !!
Index: /NEMO/trunk/src/OCE/LDF/ldftra.F90
===================================================================
--- /NEMO/trunk/src/OCE/LDF/ldftra.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/LDF/ldftra.F90	(revision 14072)
@@ -2,9 +2,9 @@
    !!======================================================================
    !!                       ***  MODULE  ldftra  ***
-   !! Ocean physics:  lateral diffusivity coefficients 
+   !! Ocean physics:  lateral diffusivity coefficients
    !!=====================================================================
    !! History :       ! 1997-07  (G. Madec)  from inimix.F split in 2 routines
    !!   NEMO     1.0  ! 2002-09  (G. Madec)  F90: Free form and module
-   !!            2.0  ! 2005-11  (G. Madec)  
+   !!            2.0  ! 2005-11  (G. Madec)
    !!            3.7  ! 2013-12  (F. Lemarie, G. Madec)  restructuration/simplification of aht/aeiv specification,
    !!                 !                                  add velocity dependent coefficient and optional read in file
@@ -13,6 +13,6 @@
    !!----------------------------------------------------------------------
    !!   ldf_tra_init : initialization, namelist read, and parameters control
-   !!   ldf_tra      : update lateral eddy diffusivity coefficients at each time step 
-   !!   ldf_eiv_init : initialization of the eiv coeff. from namelist choices 
+   !!   ldf_tra      : update lateral eddy diffusivity coefficients at each time step
+   !!   ldf_eiv_init : initialization of the eiv coeff. from namelist choices
    !!   ldf_eiv      : time evolution of the eiv coefficients (function of the growth rate of baroclinic instability)
    !!   ldf_eiv_trp  : add to the input ocean transport the contribution of the EIV parametrization
@@ -23,5 +23,5 @@
    USE phycst          ! physical constants
    USE ldfslp          ! lateral diffusion: slope of iso-neutral surfaces
-   USE ldfc1d_c2d      ! lateral diffusion: 1D & 2D cases 
+   USE ldfc1d_c2d      ! lateral diffusion: 1D & 2D cases
    USE diaptr
    !
@@ -40,6 +40,6 @@
    PUBLIC   ldf_eiv_trp    ! called by traadv.F90
    PUBLIC   ldf_eiv_dia    ! called by traldf_iso and traldf_iso_triad.F90
-   
-   !                                   !!* Namelist namtra_ldf : lateral mixing on tracers * 
+
+   !                                   !!* Namelist namtra_ldf : lateral mixing on tracers *
    !                                    != Operator type =!
    LOGICAL , PUBLIC ::   ln_traldf_OFF       !: no operator: No explicit diffusion
@@ -52,5 +52,5 @@
    !		       	                      != iso-neutral options =!
 !  LOGICAL , PUBLIC ::   ln_traldf_triad     !: griffies triad scheme                    (see ldfslp)
-   LOGICAL , PUBLIC ::   ln_traldf_msc       !: Method of Stabilizing Correction 
+   LOGICAL , PUBLIC ::   ln_traldf_msc       !: Method of Stabilizing Correction
 !  LOGICAL , PUBLIC ::   ln_triad_iso        !: pure horizontal mixing in ML             (see ldfslp)
 !  LOGICAL , PUBLIC ::   ln_botmix_triad     !: mixing on bottom                         (see ldfslp)
@@ -59,5 +59,5 @@
    !                                    !=  Coefficients =!
    INTEGER , PUBLIC ::   nn_aht_ijk_t        !: choice of time & space variations of the lateral eddy diffusivity coef.
-   !                                            !  time invariant coefficients:  aht_0 = 1/2  Ud*Ld   (lap case) 
+   !                                            !  time invariant coefficients:  aht_0 = 1/2  Ud*Ld   (lap case)
    !                                            !                                bht_0 = 1/12 Ud*Ld^3 (blp case)
    REAL(wp), PUBLIC ::      rn_Ud               !: lateral diffusive velocity  [m/s]
@@ -72,5 +72,5 @@
    REAL(wp), PUBLIC ::      rn_Ue               !: lateral diffusive velocity  [m/s]
    REAL(wp), PUBLIC ::      rn_Le               !: lateral diffusive length    [m]
-   
+
    !                                  ! Flag to control the type of lateral diffusive operator
    INTEGER, PARAMETER, PUBLIC ::   np_ERROR  =-10   ! error in specification of lateral diffusion
@@ -106,5 +106,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ldf_tra_init  ***
-      !! 
+      !!
       !! ** Purpose :   initializations of the tracer lateral mixing coeff.
       !!
@@ -116,5 +116,5 @@
       !!    nn_aht_ijk_t  =  0 => = constant
       !!                  !
-      !!                  = 10 => = F(z) : constant with a reduction of 1/4 with depth 
+      !!                  = 10 => = F(z) : constant with a reduction of 1/4 with depth
       !!                  !
       !!                  =-20 => = F(i,j)   = shape read in 'eddy_diffusivity.nc' file
@@ -126,6 +126,6 @@
       !!                  = 31    = F(i,j,k,t) = F(local velocity) (  1/2  |u|e     laplacian operator
       !!                                                           or 1/12 |u|e^3 bilaplacian operator )
-      !!              * initialisation of the eddy induced velocity coefficient by a call to ldf_eiv_init 
-      !!            
+      !!              * initialisation of the eddy induced velocity coefficient by a call to ldf_eiv_init
+      !!
       !! ** action  : ahtu, ahtv initialized one for all or l_ldftra_time set to true
       !!              aeiu, aeiv initialized one for all or l_ldfeiv_time set to true
@@ -148,5 +148,5 @@
          WRITE(numout,*) '~~~~~~~~~~~~ '
       ENDIF
-      
+
       !
       !  Choice of lateral tracer physics
@@ -182,5 +182,5 @@
       !
       !
-      ! Operator and its acting direction   (set nldf_tra)  
+      ! Operator and its acting direction   (set nldf_tra)
       ! =================================
       !
@@ -210,5 +210,5 @@
             ENDIF
             IF ( ln_zps ) THEN                  ! z-coordinate with partial step
-               IF ( ln_traldf_lev   )   ierr     = 1          ! iso-level not allowed 
+               IF ( ln_traldf_lev   )   ierr     = 1          ! iso-level not allowed
                IF ( ln_traldf_hor   )   nldf_tra = np_lap     ! horizontal             (no rotation)
                IF ( ln_traldf_iso   )   nldf_tra = np_lap_i   ! iso-neutral: standard     (rotation)
@@ -231,5 +231,5 @@
             ENDIF
             IF ( ln_zps ) THEN                  ! z-coordinate with partial step
-               IF ( ln_traldf_lev   )   ierr     = 1          ! iso-level not allowed 
+               IF ( ln_traldf_lev   )   ierr     = 1          ! iso-level not allowed
                IF ( ln_traldf_hor   )   nldf_tra = np_blp     ! horizontal             (no rotation)
                IF ( ln_traldf_iso   )   nldf_tra = np_blp_i   ! iso-neutral: standard  (   rotation)
@@ -249,5 +249,5 @@
            !
       IF(  nldf_tra == np_lap_i .OR. nldf_tra == np_lap_it .OR. &
-         & nldf_tra == np_blp_i .OR. nldf_tra == np_blp_it  )   l_ldfslp = .TRUE.    ! slope of neutral surfaces required 
+         & nldf_tra == np_blp_i .OR. nldf_tra == np_blp_it  )   l_ldfslp = .TRUE.    ! slope of neutral surfaces required
       !
       IF( ln_traldf_blp .AND. ( ln_traldf_iso .OR. ln_traldf_triad) ) THEN     ! iso-neutral bilaplacian need MSC
@@ -270,5 +270,5 @@
 
       !
-      !  Space/time variation of eddy coefficients 
+      !  Space/time variation of eddy coefficients
       ! ===========================================
       !
@@ -286,5 +286,5 @@
          IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'ldf_tra_init: failed to allocate arrays')
          !
-         ahtu(:,:,jpk) = 0._wp                     ! last level always 0  
+         ahtu(:,:,jpk) = 0._wp                     ! last level always 0
          ahtv(:,:,jpk) = 0._wp
          !.
@@ -363,5 +363,5 @@
          END SELECT
          !
-         IF( .NOT.l_ldftra_time ) THEN             !* No time variation 
+         IF( .NOT.l_ldftra_time ) THEN             !* No time variation
             IF(     ln_traldf_lap ) THEN                 !   laplacian operator (mask only)
                ahtu(:,:,1:jpkm1) =       ahtu(:,:,1:jpkm1)   * umask(:,:,1:jpkm1)
@@ -381,5 +381,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ldf_tra  ***
-      !! 
+      !!
       !! ** Purpose :   update at kt the tracer lateral mixing coeff. (aht and aeiv)
       !!
@@ -395,6 +395,6 @@
       !!              * time varying EIV coefficients: call to ldf_eiv routine
       !!
-      !! ** action  :   ahtu, ahtv   update at each time step   
-      !!                aeiu, aeiv      -       -     -    -   (if ln_ldfeiv=T) 
+      !! ** action  :   ahtu, ahtv   update at each time step
+      !!                aeiu, aeiv      -       -     -    -   (if ln_ldfeiv=T)
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt   ! time step
@@ -420,11 +420,11 @@
             ahtu(:,:,1) = aeiu(:,:,1)
             ahtv(:,:,1) = aeiv(:,:,1)
-         ELSE                                            ! compute aht. 
+         ELSE                                            ! compute aht.
             CALL ldf_eiv( kt, aht0, ahtu, ahtv, Kmm )
          ENDIF
          !
-         z1_f20   = 1._wp / (  2._wp * omega * SIN( rad * 20._wp )  )   ! 1 / ff(20 degrees)   
+         z1_f20   = 1._wp / (  2._wp * omega * SIN( rad * 20._wp )  )   ! 1 / ff(20 degrees)
          zaht_min = 0.2_wp * aht0                                       ! minimum value for aht
-         zDaht    = aht0 - zaht_min                                      
+         zDaht    = aht0 - zaht_min
          ! NOTE: [tiling-comms-merge] Change needed to preserve results with respect to the trunk
          DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
@@ -480,5 +480,5 @@
       !!    nn_aei_ijk_t  =  0 => = constant
       !!                  !
-      !!                  = 10 => = F(z) : constant with a reduction of 1/4 with depth 
+      !!                  = 10 => = F(z) : constant with a reduction of 1/4 with depth
       !!                  !
       !!                  =-20 => = F(i,j)   = shape read in 'eddy_diffusivity.nc' file
@@ -547,5 +547,5 @@
          !                                != Specification of space-time variations of eaiu, aeiv
          !
-         aeiu(:,:,jpk) = 0._wp               ! last level always 0  
+         aeiu(:,:,jpk) = 0._wp               ! last level always 0
          aeiv(:,:,jpk) = 0._wp
          !                                   ! value of EIV coef. (laplacian operator)
@@ -609,5 +609,5 @@
          END SELECT
          !
-         IF( .NOT.l_ldfeiv_time ) THEN             !* mask if No time variation 
+         IF( .NOT.l_ldfeiv_time ) THEN             !* mask if No time variation
             DO jk = 1, jpkm1
                aeiu(:,:,jk) = aeiu(:,:,jk) * umask(:,:,jk)
@@ -617,5 +617,5 @@
          !
       ENDIF
-      !                    
+      !
    END SUBROUTINE ldf_eiv_init
 
@@ -649,11 +649,11 @@
       IF( ln_traldf_triad ) THEN
          DO_3D( 0, 0, 0, 0, 1, jpk )
-            ! Take the max of N^2 and zero then take the vertical sum 
-            ! of the square root of the resulting N^2 ( required to compute 
-            ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
+            ! Take the max of N^2 and zero then take the vertical sum
+            ! of the square root of the resulting N^2 ( required to compute
+            ! internal Rossby radius Ro = .5 * sum_jpk(N) / f
             zn2 = MAX( rn2b(ji,jj,jk), 0._wp )
             zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * e3w(ji,jj,jk,Kmm)
             ! Compute elements required for the inverse time scale of baroclinic
-            ! eddies using the isopycnal slopes calculated in ldfslp.F : 
+            ! eddies using the isopycnal slopes calculated in ldfslp.F :
             ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
             ze3w = e3w(ji,jj,jk,Kmm) * wmask(ji,jj,jk)
@@ -663,11 +663,11 @@
       ELSE
          DO_3D( 0, 0, 0, 0, 1, jpk )
-            ! Take the max of N^2 and zero then take the vertical sum 
-            ! of the square root of the resulting N^2 ( required to compute 
-            ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
+            ! Take the max of N^2 and zero then take the vertical sum
+            ! of the square root of the resulting N^2 ( required to compute
+            ! internal Rossby radius Ro = .5 * sum_jpk(N) / f
             zn2 = MAX( rn2b(ji,jj,jk), 0._wp )
             zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * e3w(ji,jj,jk,Kmm)
             ! Compute elements required for the inverse time scale of baroclinic
-            ! eddies using the isopycnal slopes calculated in ldfslp.F : 
+            ! eddies using the isopycnal slopes calculated in ldfslp.F :
             ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
             ze3w = e3w(ji,jj,jk,Kmm) * wmask(ji,jj,jk)
@@ -693,5 +693,5 @@
       END_2D
       CALL lbc_lnk( 'ldftra', zaeiw(:,:), 'W', 1.0_wp )       ! lateral boundary condition
-      !               
+      !
       DO_2D( 0, 0, 0, 0 )                       !== aei at u- and v-points  ==!
          paeiu(ji,jj,1) = 0.5_wp * ( zaeiw(ji,jj) + zaeiw(ji+1,jj  ) ) * umask(ji,jj,1)
@@ -704,5 +704,5 @@
          paeiv(:,:,jk) = paeiv(:,:,1) * vmask(:,:,jk)
       END DO
-      !  
+      !
    END SUBROUTINE ldf_eiv
 
@@ -711,11 +711,11 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ldf_eiv_trp  ***
-      !! 
-      !! ** Purpose :   add to the input ocean transport the contribution of 
+      !!
+      !! ** Purpose :   add to the input ocean transport the contribution of
       !!              the eddy induced velocity parametrization.
       !!
       !! ** Method  :   The eddy induced transport is computed from a flux stream-
       !!              function which depends on the slope of iso-neutral surfaces
-      !!              (see ldf_slp). For example, in the i-k plan : 
+      !!              (see ldf_slp). For example, in the i-k plan :
       !!                   psi_uw = mk(aeiu) e2u mi(wslpi)   [in m3/s]
       !!                   Utr_eiv = - dk[psi_uw]
@@ -748,5 +748,5 @@
       ENDIF
 
-      
+
       zpsi_uw(:,:, 1 ) = 0._wp   ;   zpsi_vw(:,:, 1 ) = 0._wp
       zpsi_uw(:,:,jpk) = 0._wp   ;   zpsi_vw(:,:,jpk) = 0._wp
@@ -794,5 +794,5 @@
       !
 !!gm I don't like this routine....   Crazy  way of doing things, not optimal at all...
-!!gm     to be redesigned....   
+!!gm     to be redesigned....
       !                                                  !==  eiv stream function: output  ==!
 !!gm      CALL iom_put( "psi_eiv_uw", psi_uw )                 ! output
@@ -826,5 +826,5 @@
             zw3d(:,:,jk) = zw3d(:,:,jk) * zw2d(:,:)
          END DO
-         CALL iom_put( "weiv_masstr" , zw3d )  
+         CALL iom_put( "weiv_masstr" , zw3d )
       ENDIF
       !
@@ -832,16 +832,16 @@
          zw3d(:,:,:) = 0.e0
          DO jk = 1, jpkm1
-            zw3d(:,:,jk) = rho0 * ( psi_uw(:,:,jk+1) - psi_uw(:,:,jk) ) 
+            zw3d(:,:,jk) = rho0 * ( psi_uw(:,:,jk+1) - psi_uw(:,:,jk) )
          END DO
          CALL iom_put( "ueiv_masstr", zw3d )                  ! mass transport in i-direction
       ENDIF
       !
-      zztmp = 0.5_wp * rho0 * rcp 
+      zztmp = 0.5_wp * rho0 * rcp
       IF( iom_use('ueiv_heattr') .OR. iom_use('ueiv_heattr3d') ) THEN
-        zw2d(:,:)   = 0._wp 
-        zw3d(:,:,:) = 0._wp 
+        zw2d(:,:)   = 0._wp
+        zw3d(:,:,:) = 0._wp
         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
            zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_uw(ji,jj,jk+1)          - psi_uw(ji  ,jj,jk)            )   &
-              &                            * ( ts    (ji,jj,jk,jp_tem,Kmm) + ts    (ji+1,jj,jk,jp_tem,Kmm) ) 
+              &                            * ( ts    (ji,jj,jk,jp_tem,Kmm) + ts    (ji+1,jj,jk,jp_tem,Kmm) )
            zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
         END_3D
@@ -853,14 +853,14 @@
          zw3d(:,:,:) = 0.e0
          DO jk = 1, jpkm1
-            zw3d(:,:,jk) = rho0 * ( psi_vw(:,:,jk+1) - psi_vw(:,:,jk) ) 
+            zw3d(:,:,jk) = rho0 * ( psi_vw(:,:,jk+1) - psi_vw(:,:,jk) )
          END DO
          CALL iom_put( "veiv_masstr", zw3d )                  ! mass transport in i-direction
       ENDIF
       !
-      zw2d(:,:)   = 0._wp 
-      zw3d(:,:,:) = 0._wp 
+      zw2d(:,:)   = 0._wp
+      zw3d(:,:,:) = 0._wp
       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
          zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)          - psi_vw(ji,jj  ,jk)            )   &
-            &                            * ( ts    (ji,jj,jk,jp_tem,Kmm) + ts    (ji,jj+1,jk,jp_tem,Kmm) ) 
+            &                            * ( ts    (ji,jj,jk,jp_tem,Kmm) + ts    (ji,jj+1,jk,jp_tem,Kmm) )
          zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
       END_3D
@@ -872,9 +872,9 @@
       zztmp = 0.5_wp * 0.5
       IF( iom_use('ueiv_salttr') .OR. iom_use('ueiv_salttr3d')) THEN
-        zw2d(:,:) = 0._wp 
-        zw3d(:,:,:) = 0._wp 
+        zw2d(:,:) = 0._wp
+        zw3d(:,:,:) = 0._wp
         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
            zw3d(ji,jj,jk) = zw3d(ji,jj,jk) * ( psi_uw(ji,jj,jk+1)          - psi_uw(ji  ,jj,jk)            )   &
-              &                            * ( ts    (ji,jj,jk,jp_sal,Kmm) + ts    (ji+1,jj,jk,jp_sal,Kmm) ) 
+              &                            * ( ts    (ji,jj,jk,jp_sal,Kmm) + ts    (ji+1,jj,jk,jp_sal,Kmm) )
            zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
         END_3D
@@ -882,9 +882,9 @@
         CALL iom_put( "ueiv_salttr3d", zztmp * zw3d )                ! salt transport in i-direction
       ENDIF
-      zw2d(:,:) = 0._wp 
-      zw3d(:,:,:) = 0._wp 
+      zw2d(:,:) = 0._wp
+      zw3d(:,:,:) = 0._wp
       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
          zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)          - psi_vw(ji,jj  ,jk)            )   &
-            &                            * ( ts    (ji,jj,jk,jp_sal,Kmm) + ts    (ji,jj+1,jk,jp_sal,Kmm) ) 
+            &                            * ( ts    (ji,jj,jk,jp_sal,Kmm) + ts    (ji,jj+1,jk,jp_sal,Kmm) )
          zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
       END_3D
Index: /NEMO/trunk/src/OCE/SBC/cpl_oasis3.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/cpl_oasis3.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/cpl_oasis3.F90	(revision 14072)
@@ -14,5 +14,5 @@
    !!            3.6  !  2014-11  (S. Masson) OASIS3-MCT
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
    !!   'key_oasis3'                    coupled Ocean/Atmosphere via OASIS3-MCT
@@ -63,15 +63,15 @@
 #endif
 
-   INTEGER                    ::   nrcv         ! total number of fields received 
-   INTEGER                    ::   nsnd         ! total number of fields sent 
+   INTEGER                    ::   nrcv         ! total number of fields received
+   INTEGER                    ::   nsnd         ! total number of fields sent
    INTEGER                    ::   ncplmodel    ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
    INTEGER, PUBLIC, PARAMETER ::   nmaxfld=62   ! Maximum number of coupling fields
    INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields
    INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields
-   
+
    TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information
       LOGICAL               ::   laction   ! To be coupled or not
-      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field   
-      CHARACTER(len = 1)    ::   clgrid    ! Grid type  
+      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field
+      CHARACTER(len = 1)    ::   clgrid    ! Grid type
       REAL(wp)              ::   nsgn      ! Control of the sign change
       INTEGER, DIMENSION(nmaxcat,nmaxcpl) ::   nid   ! Id of the field (no more than 9 categories and 9 extrena models)
@@ -98,5 +98,5 @@
       !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
       !!
-      !! ** Method  :   OASIS3 MPI communication 
+      !! ** Method  :   OASIS3 MPI communication
       !!--------------------------------------------------------------------
       CHARACTER(len = *), INTENT(in   ) ::   cd_modname   ! model name as set in namcouple file
@@ -132,5 +132,5 @@
       !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
       !!
-      !! ** Method  :   OASIS3 MPI communication 
+      !! ** Method  :   OASIS3 MPI communication
       !!--------------------------------------------------------------------
       INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields
@@ -180,13 +180,13 @@
       !
       ! -----------------------------------------------------------------
-      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis    
+      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis
       ! -----------------------------------------------------------------
-      
+
       paral(1) = 2                                      ! box partitioning
-      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos 
+      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos
       paral(3) = Ni_0                                   ! local extent in i, excluding halos
       paral(4) = Nj_0                                   ! local extent in j, excluding halos
       paral(5) = Ni0glo                                 ! global extent in x, excluding halos
-      
+
       IF( sn_cfctl%l_oasout ) THEN
          WRITE(numout,*) ' multiexchg: paral (1:5)', paral
@@ -195,8 +195,8 @@
          WRITE(numout,*) ' multiexchg: Njs0, Nje0, njmpp =', Njs0, Nje0, njmpp
       ENDIF
-   
+
       CALL oasis_def_partition ( id_part, paral, nerror, Ni0glo*Nj0glo )   ! global number of points, excluding halos
       !
-      ! ... Announce send variables. 
+      ! ... Announce send variables.
       !
       ssnd(:)%ncplmodel = kcplmodel
@@ -210,5 +210,5 @@
                RETURN
             ENDIF
-            
+
             DO jc = 1, ssnd(ji)%nct
                DO jm = 1, kcplmodel
@@ -225,5 +225,5 @@
                   ENDIF
 #if defined key_agrif
-                  IF( agrif_fixed() /= 0 ) THEN 
+                  IF( agrif_fixed() /= 0 ) THEN
                      zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
                   ENDIF
@@ -243,11 +243,11 @@
       END DO
       !
-      ! ... Announce received variables. 
+      ! ... Announce received variables.
       !
       srcv(:)%ncplmodel = kcplmodel
       !
       DO ji = 1, krcv
-         IF( srcv(ji)%laction ) THEN 
-            
+         IF( srcv(ji)%laction ) THEN
+
             IF( srcv(ji)%nct > nmaxcat ) THEN
                CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '//   &
@@ -255,8 +255,8 @@
                RETURN
             ENDIF
-            
+
             DO jc = 1, srcv(ji)%nct
                DO jm = 1, kcplmodel
-                  
+
                   IF( srcv(ji)%nct .GT. 1 ) THEN
                      WRITE(cli2,'(i2.2)') jc
@@ -270,5 +270,5 @@
                   ENDIF
 #if defined key_agrif
-                  IF( agrif_fixed() /= 0 ) THEN 
+                  IF( agrif_fixed() /= 0 ) THEN
                      zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
                   ENDIF
@@ -288,9 +288,9 @@
          ENDIF
       END DO
-      
+
       !------------------------------------------------------------------
       ! End of definition phase
       !------------------------------------------------------------------
-      !     
+      !
 #if defined key_agrif
       IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN
@@ -303,6 +303,6 @@
       !
    END SUBROUTINE cpl_define
-   
-   
+
+
    SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo )
       !!---------------------------------------------------------------------
@@ -324,9 +324,9 @@
       DO jc = 1, ssnd(kid)%nct
          DO jm = 1, ssnd(kid)%ncplmodel
-        
+
             IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN   ! exclude halos from data sent to oasis
                CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0:Nie0, Njs0:Nje0,jc), kinfo )
-               
-               IF ( sn_cfctl%l_oasout ) THEN        
+
+               IF ( sn_cfctl%l_oasout ) THEN
                   IF ( kinfo == OASIS_Sent     .OR. kinfo == OASIS_ToRest .OR.   &
                      & kinfo == OASIS_SentOut  .OR. kinfo == OASIS_ToRestOut ) THEN
@@ -342,7 +342,7 @@
                   ENDIF
                ENDIF
-               
+
             ENDIF
-            
+
          ENDDO
       ENDDO
@@ -379,16 +379,16 @@
             IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN
 
-               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )         
-               
+               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )
+
                llaction =  kinfo == OASIS_Recvd   .OR. kinfo == OASIS_FromRest .OR.   &
                   &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut
-               
+
                IF ( sn_cfctl%l_oasout )   &
                   &  WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm)
-               
+
                IF( llaction ) THEN   ! data received from oasis do not include halos
-                  
+
                   kinfo = OASIS_Rcv
-                  IF( ll_1st ) THEN 
+                  IF( ll_1st ) THEN
                      pdata(Nis0:Nie0,Njs0:Nje0,jc) =   exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
                      ll_1st = .FALSE.
@@ -397,6 +397,6 @@
                         &                                + exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
                   ENDIF
-                  
-                  IF ( sn_cfctl%l_oasout ) THEN        
+
+                  IF ( sn_cfctl%l_oasout ) THEN
                      WRITE(numout,*) '****************'
                      WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname
@@ -409,16 +409,16 @@
                      WRITE(numout,*) '****************'
                   ENDIF
-                  
+
                ENDIF
-               
+
             ENDIF
-            
+
          ENDDO
 
          !--- we must call lbc_lnk to fill the halos that where not received.
          IF( .NOT. ll_1st ) THEN
-            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )   
+            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )
          ENDIF
- 
+
       ENDDO
       !
@@ -426,5 +426,5 @@
 
 
-   INTEGER FUNCTION cpl_freq( cdfieldname )  
+   INTEGER FUNCTION cpl_freq( cdfieldname )
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_freq  ***
@@ -491,8 +491,8 @@
       DEALLOCATE( exfld )
       IF(nstop == 0) THEN
-         CALL oasis_terminate( nerror )         
+         CALL oasis_terminate( nerror )
       ELSE
          CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" )
-      ENDIF       
+      ENDIF
       !
    END SUBROUTINE cpl_finalize
@@ -544,5 +544,5 @@
       WRITE(numout,*) 'oasis_enddef: Error you sould not be there...'
    END SUBROUTINE oasis_enddef
-  
+
    SUBROUTINE oasis_put(k1,k2,p1,k3)
       REAL(wp), DIMENSION(:,:), INTENT(in   ) ::  p1
@@ -574,5 +574,5 @@
       WRITE(numout,*) 'oasis_terminate: Error you sould not be there...'
    END SUBROUTINE oasis_terminate
-   
+
 #endif
 
Index: /NEMO/trunk/src/OCE/SBC/sbc_ice.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbc_ice.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbc_ice.F90	(revision 14072)
@@ -20,5 +20,5 @@
 # endif
 # if defined key_cice
-   USE ice_domain_size, only: ncat 
+   USE ice_domain_size, only: ncat
 #endif
    USE lib_mpp          ! MPP library
@@ -32,5 +32,5 @@
 # if defined  key_si3
    LOGICAL         , PUBLIC, PARAMETER ::   lk_si3     = .TRUE.   !: SI3 ice model
-   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE 
+   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE
 # endif
 # if defined  key_cice
@@ -47,6 +47,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   alb_ice        !: ice albedo                                       [-]
 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qml_ice        !: heat available for snow / ice surface melting     [W/m2] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice        !: heat conduction flux in the layer below surface   [W/m2] 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qml_ice        !: heat available for snow / ice surface melting     [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice        !: heat conduction flux in the layer below surface   [W/m2]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_ice_top    !: solar flux transmitted below the ice surface      [W/m2]
 
@@ -87,9 +87,9 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iu              !: ice fraction at NEMO U point
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iv              !: ice fraction at NEMO V point
-   
+
    ! variables used in the coupled interface
    INTEGER , PUBLIC, PARAMETER ::   jpl = ncat
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice 
-   
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice
+
    ! already defined in ice.F90 for SI3
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i
@@ -98,6 +98,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tatm_ice       !: air temperature [K]
 #endif
-
-   REAL(wp), PUBLIC, SAVE ::   pp_cldf = 0.81    !: cloud fraction over sea ice, summer CLIO value   [-]
 
    !! arrays relating to embedding ice in the ocean
@@ -108,5 +106,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -145,5 +143,5 @@
          &                     v_ice(jpi,jpj)        , alb_ice(jpi,jpj,1)    , &
          &                     emp_ice(jpi,jpj)      , qns_ice(jpi,jpj,1)    , dqns_ice(jpi,jpj,1)   , &
-         &                     STAT= ierr(3) )      
+         &                     STAT= ierr(3) )
       IF( ln_cpl )   ALLOCATE( h_i(jpi,jpj,jpl) , h_s(jpi,jpj,jpl) , STAT=ierr(4) )
 #endif
@@ -168,6 +166,6 @@
    LOGICAL         , PUBLIC, PARAMETER ::   lk_si3     = .FALSE.  !: no SI3 ice model
    LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE ice model
-   REAL(wp)        , PUBLIC, PARAMETER ::   pp_cldf    = 0.81     !: cloud fraction over sea ice, summer CLIO value   [-]
-   INTEGER         , PUBLIC, PARAMETER ::   jpl = 1 
+
+   INTEGER         , PUBLIC, PARAMETER ::   jpl = 1
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice                        ! jpi, jpj
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice, alb_ice, qns_ice, dqns_ice  ! (jpi,jpj,jpl)
@@ -178,6 +176,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   topmelt, botmelt
    !
-   !! arrays related to embedding ice in the ocean. 
-   !! These arrays need to be declared even if no ice model is required. 
+   !! arrays related to embedding ice in the ocean.
+   !! These arrays need to be declared even if no ice model is required.
    !! In the no ice model or traditional levitating ice cases they contain only zeros
    !! ---------------------
Index: /NEMO/trunk/src/OCE/SBC/sbc_oce.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbc_oce.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbc_oce.F90	(revision 14072)
@@ -73,5 +73,5 @@
    LOGICAL , PUBLIC ::   ln_charn       !: =T Chranock coefficient from wave model
    LOGICAL , PUBLIC ::   ln_taw         !: =T wind stress corrected by wave intake
-   LOGICAL , PUBLIC ::   ln_phioc       !: =T TKE surface BC from wave model 
+   LOGICAL , PUBLIC ::   ln_phioc       !: =T TKE surface BC from wave model
    LOGICAL , PUBLIC ::   ln_bern_srfc   !: Bernoulli head, waves' inuced pressure
    LOGICAL , PUBLIC ::   ln_breivikFV_2016 !: Breivik 2016 profile
@@ -153,4 +153,11 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frq_m     !: mean (nn_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level [-]
 
+   !!----------------------------------------------------------------------
+   !!                     Surface atmospheric fields
+   !!----------------------------------------------------------------------
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: q_air_zt       !: specific humidity of air at z=zt [kg/kg]ww
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: theta_air_zt   !: potential temperature of air at z=zt [K]
+
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -166,5 +173,5 @@
       !!                  ***  FUNCTION sbc_oce_alloc  ***
       !!---------------------------------------------------------------------
-      INTEGER :: ierr(5)
+      INTEGER :: ierr(6)
       !!---------------------------------------------------------------------
       ierr(:) = 0
@@ -188,4 +195,6 @@
       !
       ALLOCATE( e3t_m(jpi,jpj) , STAT=ierr(5) )
+      !
+      ALLOCATE( q_air_zt(jpi,jpj) , theta_air_zt(jpi,jpj) , STAT=ierr(6) ) !#LB
       !
       sbc_oce_alloc = MAXVAL( ierr )
Index: /NEMO/trunk/src/OCE/SBC/sbc_phy.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbc_phy.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbc_phy.F90	(revision 14072)
@@ -0,0 +1,1126 @@
+MODULE sbc_phy
+   !!======================================================================
+   !!                       ***  MODULE  sbc_phy  ***
+   !! A set of functions to compute air themodynamics parameters
+   !!                     needed by Aerodynamic Bulk Formulas
+   !!=====================================================================
+   !!            4.x  !  2020 L. Brodeau from AeroBulk package (https://github.com/brodeau/aerobulk/)
+   !!----------------------------------------------------------------------
+
+   !!   virt_temp     : virtual (aka sensible) temperature (potential or absolute)
+   !!   rho_air       : density of (moist) air (depends on T_air, q_air and SLP
+   !!   visc_air      : kinematic viscosity (aka Nu_air) of air from temperature
+   !!   L_vap         : latent heat of vaporization of water as a function of temperature
+   !!   cp_air        : specific heat of (moist) air (depends spec. hum. q_air)
+   !!   gamma_moist   : adiabatic lapse-rate of moist air
+   !!   One_on_L      : 1. / ( Obukhov length )
+   !!   Ri_bulk       : bulk Richardson number aka BRN
+   !!   q_sat         : saturation humidity as a function of SLP and temperature
+   !!   q_air_rh      : specific humidity as a function of RH (fraction, not %), t_air and SLP
+
+   USE dom_oce        ! ocean space and time domain
+   USE phycst         ! physical constants
+
+   IMPLICIT NONE
+   !PRIVATE
+   PUBLIC !! Haleluja that was the solution
+
+   INTEGER , PARAMETER, PUBLIC  :: nb_iter0 = 5 ! Default number of itterations in bulk-param algorithms (can be overriden b.m.o `nb_iter` optional argument)
+
+   !!  (mainly removed from sbcblk.F90)
+   REAL(wp), PARAMETER, PUBLIC :: rCp_dry = 1005.0_wp   !: Specic heat of dry air, constant pressure      [J/K/kg]
+   REAL(wp), PARAMETER, PUBLIC :: rCp_vap = 1860.0_wp   !: Specic heat of water vapor, constant pressure  [J/K/kg]
+   REAL(wp), PARAMETER, PUBLIC :: R_dry   = 287.05_wp   !: Specific gas constant for dry air              [J/K/kg]
+   REAL(wp), PARAMETER, PUBLIC :: R_vap   = 461.495_wp  !: Specific gas constant for water vapor          [J/K/kg]
+   REAL(wp), PARAMETER, PUBLIC :: reps0   = R_dry/R_vap !: ratio of gas constant for dry air and water vapor => ~ 0.622
+   REAL(wp), PARAMETER, PUBLIC :: rctv0   = R_vap/R_dry - 1._wp  !: for virtual temperature (== (1-eps)/eps) => ~ 0.608
+   REAL(wp), PARAMETER, PUBLIC :: rCp_air = 1000.5_wp   !: specific heat of air (only used for ice fluxes now...)
+   REAL(wp), PARAMETER, PUBLIC :: albo    = 0.066_wp    !: ocean albedo assumed to be constant
+   !
+   REAL(wp), PARAMETER, PUBLIC :: rho0_a  = 1.2_wp      !: Approx. of density of air                       [kg/m^3]
+   REAL(wp), PARAMETER, PUBLIC :: rho0_w  = 1025._wp    !: Density of sea-water  (ECMWF->1025)             [kg/m^3]
+   REAL(wp), PARAMETER, PUBLIC :: radrw = rho0_a/rho0_w !: Density ratio
+   REAL(wp), PARAMETER, PUBLIC :: sq_radrw = SQRT(rho0_a/rho0_w)
+   REAL(wp), PARAMETER, PUBLIC :: rCp0_w  = 4190._wp    !: Specific heat capacity of seawater (ECMWF 4190) [J/K/kg]
+   REAL(wp), PARAMETER, PUBLIC :: rnu0_w  = 1.e-6_wp    !: kinetic viscosity of water                      [m^2/s]
+   REAL(wp), PARAMETER, PUBLIC :: rk0_w   = 0.6_wp      !: thermal conductivity of water (at 20C)          [W/m/K]
+   !
+   REAL(wp), PARAMETER, PUBLIC :: emiss_w = 0.98_wp     !: Long-wave (thermal) emissivity of sea-water []
+   !
+   REAL(wp), PARAMETER, PUBLIC :: emiss_i = 0.996_wp    !:  "   for ice and snow => but Rees 1993 suggests can be lower in winter on fresh snow... 0.72 ...
+
+   REAL(wp), PARAMETER, PUBLIC :: wspd_thrshld_ice = 0.2_wp !: minimum scalar wind speed accepted over sea-ice... [m/s]
+
+   !
+   REAL(wp), PARAMETER, PUBLIC :: rdct_qsat_salt = 0.98_wp  !: reduction factor on specific humidity at saturation (q_sat(T_s)) due to salt
+   REAL(wp), PARAMETER, PUBLIC :: rtt0 = 273.16_wp        !: triple point of temperature    [K]
+   !
+   REAL(wp), PARAMETER, PUBLIC :: rcst_cs = -16._wp*9.80665_wp*rho0_w*rCp0_w*rnu0_w*rnu0_w*rnu0_w/(rk0_w*rk0_w) !: for cool-skin parameterizations... (grav = 9.80665_wp)
+   !                              => see eq.(14) in Fairall et al. 1996   (eq.(6) of Zeng aand Beljaars is WRONG! (typo?)
+
+   REAL(wp), PARAMETER, PUBLIC :: z0_sea_max = 0.0025_wp   !: maximum realistic value for roughness length of sea-surface... [m]
+
+   REAL(wp), PUBLIC, SAVE ::   pp_cldf = 0.81    !: cloud fraction over sea ice, summer CLIO value   [-]
+
+
+   REAL(wp), PARAMETER, PUBLIC :: Cx_min = 0.1E-3_wp ! smallest value allowed for bulk transfer coefficients (usually in stable conditions with now wind)
+
+   REAL(wp), PARAMETER :: &
+                                !! Constants for Goff formula in the presence of ice:
+      &      rAg_i = -9.09718_wp, &
+      &      rBg_i = -3.56654_wp, &
+      &      rCg_i = 0.876793_wp, &
+      &      rDg_i = LOG10(6.1071_wp)
+
+   REAL(wp), PARAMETER :: rc_louis  = 5._wp
+   REAL(wp), PARAMETER :: rc2_louis = rc_louis * rc_louis
+   REAL(wp), PARAMETER :: ram_louis = 2. * rc_louis
+   REAL(wp), PARAMETER :: rah_louis = 3. * rc_louis
+
+
+   INTERFACE virt_temp
+      MODULE PROCEDURE virt_temp_vctr, virt_temp_sclr
+   END INTERFACE virt_temp
+
+   INTERFACE visc_air
+      MODULE PROCEDURE visc_air_vctr, visc_air_sclr
+   END INTERFACE visc_air
+
+   INTERFACE gamma_moist
+      MODULE PROCEDURE gamma_moist_vctr, gamma_moist_sclr
+   END INTERFACE gamma_moist
+
+   INTERFACE e_sat
+      MODULE PROCEDURE e_sat_vctr, e_sat_sclr
+   END INTERFACE e_sat
+
+   INTERFACE e_sat_ice
+      MODULE PROCEDURE e_sat_ice_vctr, e_sat_ice_sclr
+   END INTERFACE e_sat_ice
+   INTERFACE de_sat_dt_ice
+      MODULE PROCEDURE de_sat_dt_ice_vctr, de_sat_dt_ice_sclr
+   END INTERFACE de_sat_dt_ice
+
+   INTERFACE Ri_bulk
+      MODULE PROCEDURE Ri_bulk_vctr, Ri_bulk_sclr
+   END INTERFACE Ri_bulk
+
+   INTERFACE q_sat
+      MODULE PROCEDURE q_sat_vctr, q_sat_sclr
+   END INTERFACE q_sat
+
+   INTERFACE dq_sat_dt_ice
+      MODULE PROCEDURE dq_sat_dt_ice_vctr, dq_sat_dt_ice_sclr
+   END INTERFACE dq_sat_dt_ice
+
+   INTERFACE L_vap
+      MODULE PROCEDURE L_vap_vctr, L_vap_sclr
+   END INTERFACE L_vap
+
+   INTERFACE rho_air
+      MODULE PROCEDURE rho_air_vctr, rho_air_sclr
+   END INTERFACE rho_air
+
+   INTERFACE cp_air
+      MODULE PROCEDURE cp_air_vctr, cp_air_sclr
+   END INTERFACE cp_air
+
+   INTERFACE alpha_sw
+      MODULE PROCEDURE alpha_sw_vctr, alpha_sw_sclr
+   END INTERFACE alpha_sw
+
+   INTERFACE bulk_formula
+      MODULE PROCEDURE bulk_formula_vctr, bulk_formula_sclr
+   END INTERFACE bulk_formula
+
+   INTERFACE qlw_net
+      MODULE PROCEDURE qlw_net_vctr, qlw_net_sclr
+   END INTERFACE qlw_net
+
+   INTERFACE f_m_louis
+      MODULE PROCEDURE f_m_louis_vctr, f_m_louis_sclr
+   END INTERFACE f_m_louis
+
+   INTERFACE f_h_louis
+      MODULE PROCEDURE f_h_louis_vctr, f_h_louis_sclr
+   END INTERFACE f_h_louis
+
+
+   PUBLIC virt_temp
+   PUBLIC rho_air
+   PUBLIC visc_air
+   PUBLIC L_vap
+   PUBLIC cp_air
+   PUBLIC gamma_moist
+   PUBLIC One_on_L
+   PUBLIC Ri_bulk
+   PUBLIC q_sat
+   PUBLIC q_air_rh
+   PUBLIC dq_sat_dt_ice
+   !:
+   PUBLIC update_qnsol_tau
+   PUBLIC alpha_sw
+   PUBLIC bulk_formula
+   PUBLIC qlw_net
+   !
+   PUBLIC f_m_louis, f_h_louis
+   PUBLIC z0_from_Cd
+   PUBLIC Cd_from_z0
+   PUBLIC UN10_from_ustar
+   PUBLIC UN10_from_CD
+   PUBLIC z0tq_LKB
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+   !! $Id: sbcblk.F90 10535 2019-01-16 17:36:47Z clem $
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+
+   FUNCTION virt_temp_sclr( pta, pqa )
+      !!------------------------------------------------------------------------
+      !!
+      !! Compute the (absolute/potential) VIRTUAL temperature, based on the
+      !! (absolute/potential) temperature and specific humidity
+      !!
+      !! If input temperature is absolute then output virtual temperature is absolute
+      !! If input temperature is potential then output virtual temperature is potential
+      !!
+      !! Author: L. Brodeau, June 2019 / AeroBulk
+      !!         (https://github.com/brodeau/aerobulk/)
+      !!------------------------------------------------------------------------
+      REAL(wp)             :: virt_temp_sclr !: virtual temperature [K]
+      REAL(wp), INTENT(in) :: pta       !: absolute or potential air temperature [K]
+      REAL(wp), INTENT(in) :: pqa       !: specific humidity of air   [kg/kg]
+      !!-------------------------------------------------------------------
+      !
+      virt_temp_sclr = pta * (1._wp + rctv0*pqa)
+      !!
+      !! This is exactly the same thing as:
+      !! virt_temp_sclr = pta * ( pwa + reps0) / (reps0*(1.+pwa))
+      !! with wpa (mixing ration) defined as : pwa = pqa/(1.-pqa)
+      !
+   END FUNCTION virt_temp_sclr
+   !!
+   FUNCTION virt_temp_vctr( pta, pqa )
+      REAL(wp), DIMENSION(jpi,jpj)             :: virt_temp_vctr !: virtual temperature [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta !: absolute or potential air temperature [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pqa !: specific humidity of air   [kg/kg]
+      virt_temp_vctr(:,:) = pta(:,:) * (1._wp + rctv0*pqa(:,:))
+   END FUNCTION virt_temp_vctr
+   !===============================================================================================
+
+
+   FUNCTION rho_air_vctr( ptak, pqa, ppa )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION rho_air_vctr  ***
+      !!
+      !! ** Purpose : compute density of (moist) air using the eq. of state of the atmosphere
+      !!
+      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!-------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak      ! air temperature             [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa       ! air specific humidity   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ppa      ! pressure in                [Pa]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   rho_air_vctr   ! density of moist air   [kg/m^3]
+      !!-------------------------------------------------------------------------------
+      rho_air_vctr = MAX( ppa / (R_dry*ptak * ( 1._wp + rctv0*pqa )) , 0.8_wp )
+   END FUNCTION rho_air_vctr
+
+   FUNCTION rho_air_sclr( ptak, pqa, ppa )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION rho_air_sclr  ***
+      !!
+      !! ** Purpose : compute density of (moist) air using the eq. of state of the atmosphere
+      !!
+      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!-------------------------------------------------------------------------------
+      REAL(wp), INTENT(in) :: ptak           ! air temperature             [K]
+      REAL(wp), INTENT(in) :: pqa            ! air specific humidity   [kg/kg]
+      REAL(wp), INTENT(in) :: ppa           ! pressure in                [Pa]
+      REAL(wp)             :: rho_air_sclr   ! density of moist air   [kg/m^3]
+      !!-------------------------------------------------------------------------------
+      rho_air_sclr = MAX( ppa / (R_dry*ptak * ( 1._wp + rctv0*pqa )) , 0.8_wp )
+   END FUNCTION rho_air_sclr
+
+
+
+
+   FUNCTION visc_air_sclr(ptak)
+      !!----------------------------------------------------------------------------------
+      !! Air kinetic viscosity (m^2/s) given from air temperature in Kelvin
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             :: visc_air_sclr   ! kinetic viscosity (m^2/s)
+      REAL(wp), INTENT(in) :: ptak       ! air temperature in (K)
+      !
+      REAL(wp) ::   ztc, ztc2   ! local scalar
+      !!----------------------------------------------------------------------------------
+      !
+      ztc  = ptak - rt0   ! air temp, in deg. C
+      ztc2 = ztc*ztc
+      visc_air_sclr = 1.326e-5*(1. + 6.542E-3*ztc + 8.301e-6*ztc2 - 4.84e-9*ztc2*ztc)
+      !
+   END FUNCTION visc_air_sclr
+
+   FUNCTION visc_air_vctr(ptak)
+      REAL(wp), DIMENSION(jpi,jpj)             ::   visc_air_vctr   ! kinetic viscosity (m^2/s)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak       ! air temperature in (K)
+      INTEGER  ::   ji, jj      ! dummy loop indices
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      visc_air_vctr(ji,jj) = visc_air_sclr( ptak(ji,jj) )
+      END_2D
+   END FUNCTION visc_air_vctr
+
+
+   FUNCTION L_vap_vctr( psst )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION L_vap_vctr  ***
+      !!
+      !! ** Purpose : Compute the latent heat of vaporization of water from temperature
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   L_vap_vctr   ! latent heat of vaporization   [J/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   psst   ! water temperature                [K]
+      !!----------------------------------------------------------------------------------
+      !
+      L_vap_vctr = (  2.501_wp - 0.00237_wp * ( psst(:,:) - rt0)  ) * 1.e6_wp
+      !
+   END FUNCTION L_vap_vctr
+
+   FUNCTION L_vap_sclr( psst )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION L_vap_sclr  ***
+      !!
+      !! ** Purpose : Compute the latent heat of vaporization of water from temperature
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             ::   L_vap_sclr   ! latent heat of vaporization   [J/kg]
+      REAL(wp), INTENT(in) ::   psst         ! water temperature                [K]
+      !!----------------------------------------------------------------------------------
+      !
+      L_vap_sclr = (  2.501_wp - 0.00237_wp * ( psst - rt0)  ) * 1.e6_wp
+      !
+   END FUNCTION L_vap_sclr
+
+
+   FUNCTION cp_air_vctr( pqa )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION cp_air_vctr  ***
+      !!
+      !! ** Purpose : Compute specific heat (Cp) of moist air
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!-------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa      ! air specific humidity         [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   cp_air_vctr   ! specific heat of moist air   [J/K/kg]
+      !!-------------------------------------------------------------------------------
+      cp_air_vctr = rCp_dry + rCp_vap * pqa
+   END FUNCTION cp_air_vctr
+
+   FUNCTION cp_air_sclr( pqa )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION cp_air_sclr  ***
+      !!
+      !! ** Purpose : Compute specific heat (Cp) of moist air
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!-------------------------------------------------------------------------------
+      REAL(wp), INTENT(in) :: pqa           ! air specific humidity         [kg/kg]
+      REAL(wp)             :: cp_air_sclr   ! specific heat of moist air   [J/K/kg]
+      !!-------------------------------------------------------------------------------
+      cp_air_sclr = rCp_dry + rCp_vap * pqa
+   END FUNCTION cp_air_sclr
+
+
+
+   !===============================================================================================
+   FUNCTION gamma_moist_sclr( ptak, pqa )
+      !!----------------------------------------------------------------------------------
+      !! ** Purpose : Compute the moist adiabatic lapse-rate.
+      !!     => http://glossary.ametsoc.org/wiki/Moist-adiabatic_lapse_rate
+      !!     => http://www.geog.ucsb.edu/~joel/g266_s10/lecture_notes/chapt03/oh10_3_01/oh10_3_01.html
+      !!
+      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             :: gamma_moist_sclr !                           [K/m]
+      REAL(wp), INTENT(in) ::   ptak           ! absolute air temperature  [K] !#LB: double check it's absolute !!!
+      REAL(wp), INTENT(in) ::   pqa            ! specific humidity     [kg/kg]
+      !
+      REAL(wp) :: zta, zqa, zwa, ziRT, zLvap        ! local scalars
+      !!----------------------------------------------------------------------------------
+      zta = MAX( ptak,  180._wp) ! prevents screw-up over masked regions where field == 0.
+      zqa = MAX( pqa,  1.E-6_wp) !    "                   "                     "
+      !!
+      zwa = zqa / (1._wp - zqa)   ! w is mixing ratio w = q/(1-q) | q = w/(1+w)
+      ziRT = 1._wp / (R_dry*zta)    ! 1/RT
+      zLvap = L_vap_sclr( ptak )
+      !!
+      gamma_moist_sclr = grav * ( 1._wp + zLvap*zwa*ziRT ) / ( rCp_dry + zLvap*zLvap*zwa*reps0*ziRT/zta )
+      !!
+   END FUNCTION gamma_moist_sclr
+   !!
+   FUNCTION gamma_moist_vctr( ptak, pqa )
+      REAL(wp), DIMENSION(jpi,jpj)             ::   gamma_moist_vctr
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa
+      INTEGER  :: ji, jj
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      gamma_moist_vctr(ji,jj) = gamma_moist_sclr( ptak(ji,jj), pqa(ji,jj) )
+      END_2D
+   END FUNCTION gamma_moist_vctr
+   !===============================================================================================
+
+
+   FUNCTION One_on_L( ptha, pqa, pus, pts, pqs )
+      !!------------------------------------------------------------------------
+      !!
+      !! Evaluates the 1./(Obukhov length) from air temperature,
+      !! air specific humidity, and frictional scales u*, t* and q*
+      !!
+      !! Author: L. Brodeau, June 2019 / AeroBulk
+      !!         (https://github.com/brodeau/aerobulk/)
+      !!------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: One_on_L     !: 1./(Obukhov length) [m^-1]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha         !: reference potential temperature of air [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pqa          !: reference specific humidity of air   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pus          !: u*: friction velocity [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pts, pqs     !: \theta* and q* friction aka turb. scales for temp. and spec. hum.
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::     zqa          ! local scalar
+      !!-------------------------------------------------------------------
+      !
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      !
+      zqa = (1._wp + rctv0*pqa(ji,jj))
+      !
+      ! The main concern is to know whether, the vertical turbulent flux of virtual temperature, < u' theta_v' > is estimated with:
+      !  a/  -u* [ theta* (1 + 0.61 q) + 0.61 theta q* ] => this is the one that seems correct! chose this one!
+      !                      or
+      !  b/  -u* [ theta*              + 0.61 theta q* ]
+      !
+      One_on_L(ji,jj) = grav*vkarmn*( pts(ji,jj)*zqa + rctv0*ptha(ji,jj)*pqs(ji,jj) ) &
+         &               / MAX( pus(ji,jj)*pus(ji,jj)*ptha(ji,jj)*zqa , 1.E-9_wp )
+      !
+      END_2D
+      !
+      One_on_L = SIGN( MIN(ABS(One_on_L),200._wp), One_on_L ) ! (prevent FPE from stupid values over masked regions...)
+      !
+   END FUNCTION One_on_L
+
+
+   !===============================================================================================
+   FUNCTION Ri_bulk_sclr( pz, psst, ptha, pssq, pqa, pub,  pta_layer, pqa_layer )
+      !!----------------------------------------------------------------------------------
+      !! Bulk Richardson number according to "wide-spread equation"...
+      !!
+      !!    Reminder: the Richardson number is the ratio "buoyancy" / "shear"
+      !!
+      !! ** Author: L. Brodeau, June 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             :: Ri_bulk_sclr
+      REAL(wp), INTENT(in) :: pz    ! height above the sea (aka "delta z")  [m]
+      REAL(wp), INTENT(in) :: psst  ! SST                                   [K]
+      REAL(wp), INTENT(in) :: ptha  ! pot. air temp. at height "pz"         [K]
+      REAL(wp), INTENT(in) :: pssq  ! 0.98*q_sat(SST)                   [kg/kg]
+      REAL(wp), INTENT(in) :: pqa   ! air spec. hum. at height "pz"     [kg/kg]
+      REAL(wp), INTENT(in) :: pub   ! bulk wind speed                     [m/s]
+      REAL(wp), INTENT(in), OPTIONAL :: pta_layer ! when possible, a better guess of absolute temperature WITHIN the layer [K]
+      REAL(wp), INTENT(in), OPTIONAL :: pqa_layer ! when possible, a better guess of specific humidity    WITHIN the layer [kg/kg]
+      !!
+      LOGICAL  :: l_ptqa_l_prvd = .FALSE.
+      REAL(wp) :: zqa, zta, zgamma, zdthv, ztv, zsstv  ! local scalars
+      !!-------------------------------------------------------------------
+      IF( PRESENT(pta_layer) .AND. PRESENT(pqa_layer) ) l_ptqa_l_prvd=.TRUE.
+      !
+      zsstv = virt_temp_sclr( psst, pssq )          ! virtual SST (absolute==potential because z=0!)
+      !
+      zdthv = virt_temp_sclr( ptha, pqa  ) - zsstv  ! air-sea delta of "virtual potential temperature"
+      !
+      !! ztv: estimate of the ABSOLUTE virtual temp. within the layer
+      IF( l_ptqa_l_prvd ) THEN
+         ztv = virt_temp_sclr( pta_layer, pqa_layer )
+      ELSE
+         zqa = 0.5_wp*( pqa  + pssq )                             ! ~ mean q within the layer...
+         zta = 0.5_wp*( psst + ptha - gamma_moist(ptha, zqa)*pz ) ! ~ mean absolute temperature of air within the layer
+         zta = 0.5_wp*( psst + ptha - gamma_moist( zta, zqa)*pz ) ! ~ mean absolute temperature of air within the layer
+         zgamma =  gamma_moist(zta, zqa)                          ! Adiabatic lapse-rate for moist air within the layer
+         ztv = 0.5_wp*( zsstv + virt_temp_sclr( ptha-zgamma*pz, pqa ) )
+      END IF
+      !
+      Ri_bulk_sclr = grav*zdthv*pz / ( ztv*pub*pub )      ! the usual definition of Ri_bulk_sclr
+      !
+   END FUNCTION Ri_bulk_sclr
+   !!
+   FUNCTION Ri_bulk_vctr( pz, psst, ptha, pssq, pqa, pub,  pta_layer, pqa_layer )
+      REAL(wp), DIMENSION(jpi,jpj)             :: Ri_bulk_vctr
+      REAL(wp)                    , INTENT(in) :: pz    ! height above the sea (aka "delta z")  [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: psst  ! SST                                   [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha  ! pot. air temp. at height "pz"         [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pssq  ! 0.98*q_sat(SST)                   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pqa   ! air spec. hum. at height "pz"     [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pub   ! bulk wind speed                     [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pta_layer ! when possible, a better guess of absolute temperature WITHIN the layer [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pqa_layer ! when possible, a better guess of specific humidity    WITHIN the layer [kg/kg]
+      !!
+      LOGICAL  :: l_ptqa_l_prvd = .FALSE.
+      INTEGER  ::   ji, jj
+      IF( PRESENT(pta_layer) .AND. PRESENT(pqa_layer) ) l_ptqa_l_prvd=.TRUE.
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      IF( l_ptqa_l_prvd ) THEN
+         Ri_bulk_vctr(ji,jj) = Ri_bulk_sclr( pz, psst(ji,jj), ptha(ji,jj), pssq(ji,jj), pqa(ji,jj), pub(ji,jj), &
+            &                                pta_layer=pta_layer(ji,jj ),  pqa_layer=pqa_layer(ji,jj ) )
+      ELSE
+         Ri_bulk_vctr(ji,jj) = Ri_bulk_sclr( pz, psst(ji,jj), ptha(ji,jj), pssq(ji,jj), pqa(ji,jj), pub(ji,jj) )
+      END IF
+      END_2D
+   END FUNCTION Ri_bulk_vctr
+   !===============================================================================================
+
+   !===============================================================================================
+   FUNCTION e_sat_sclr( ptak )
+      !!----------------------------------------------------------------------------------
+      !!                   ***  FUNCTION e_sat_sclr  ***
+      !!                  < SCALAR argument version >
+      !! ** Purpose : water vapor at saturation in [Pa]
+      !!              Based on accurate estimate by Goff, 1957
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!
+      !!    Note: what rt0 should be here, is 273.16 (triple point of water) and not 273.15 like here
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             ::   e_sat_sclr   ! water vapor at saturation   [kg/kg]
+      REAL(wp), INTENT(in) ::   ptak    ! air temperature                  [K]
+      REAL(wp) ::   zta, ztmp   ! local scalar
+      !!----------------------------------------------------------------------------------
+      zta = MAX( ptak , 180._wp )   ! air temp., prevents fpe0 errors dute to unrealistically low values over masked regions...
+      ztmp = rt0 / zta   !#LB: rt0 or rtt0 ???? (273.15 vs 273.16 )
+      !
+      ! Vapour pressure at saturation [Pa] : WMO, (Goff, 1957)
+      e_sat_sclr = 100.*( 10.**( 10.79574*(1. - ztmp) - 5.028*LOG10(zta/rt0)        &
+         &    + 1.50475*10.**(-4)*(1. - 10.**(-8.2969*(zta/rt0 - 1.)) )  &
+         &    + 0.42873*10.**(-3)*(10.**(4.76955*(1. - ztmp)) - 1.) + 0.78614) )
+      !
+   END FUNCTION e_sat_sclr
+   !!
+   FUNCTION e_sat_vctr(ptak)
+      REAL(wp), DIMENSION(jpi,jpj)             :: e_sat_vctr !: vapour pressure at saturation  [Pa]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak    !: temperature (K)
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      e_sat_vctr(ji,jj) = e_sat_sclr(ptak(ji,jj))
+      END_2D
+   END FUNCTION e_sat_vctr
+   !===============================================================================================
+
+   !===============================================================================================
+   FUNCTION e_sat_ice_sclr(ptak)
+      !!---------------------------------------------------------------------------------
+      !! Same as "e_sat" but over ice rather than water!
+      !!---------------------------------------------------------------------------------
+      REAL(wp)             :: e_sat_ice_sclr !: vapour pressure at saturation in presence of ice [Pa]
+      REAL(wp), INTENT(in) :: ptak
+      !!
+      REAL(wp) :: zta, zle, ztmp
+      !!---------------------------------------------------------------------------------
+      zta = MAX( ptak , 180._wp )   ! air temp., prevents fpe0 errors dute to unrealistically low values over masked regions...
+      ztmp = rtt0/zta
+      !!
+      zle  = rAg_i*(ztmp - 1._wp) + rBg_i*LOG10(ztmp) + rCg_i*(1._wp - zta/rtt0) + rDg_i
+      !!
+      e_sat_ice_sclr = 100._wp * 10._wp**zle
+   END FUNCTION e_sat_ice_sclr
+   !!
+   FUNCTION e_sat_ice_vctr(ptak)
+      !! Same as "e_sat" but over ice rather than water!
+      REAL(wp), DIMENSION(jpi,jpj) :: e_sat_ice_vctr !: vapour pressure at saturation in presence of ice [Pa]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      e_sat_ice_vctr(ji,jj) = e_sat_ice_sclr( ptak(ji,jj) )
+      END_2D
+   END FUNCTION e_sat_ice_vctr
+   !!
+   FUNCTION de_sat_dt_ice_sclr(ptak)
+      !!---------------------------------------------------------------------------------
+      !! d [ e_sat_ice ] / dT   (derivative / temperature)
+      !! Analytical exact formulation: double checked!!!
+      !!  => DOUBLE-check possible / finite-difference version with "./bin/test_phymbl.x"
+      !!---------------------------------------------------------------------------------
+      REAL(wp)             :: de_sat_dt_ice_sclr !:  [Pa/K]
+      REAL(wp), INTENT(in) :: ptak
+      !!
+      REAL(wp) :: zta, zde
+      !!---------------------------------------------------------------------------------
+      zta = MAX( ptak , 180._wp )   ! air temp., prevents fpe0 errors dute to unrealistically low values over masked regions...
+      !!
+      zde = -(rAg_i*rtt0)/(zta*zta) - rBg_i/(zta*LOG(10._wp)) - rCg_i/rtt0
+      !!
+      de_sat_dt_ice_sclr = LOG(10._wp) * zde * e_sat_ice_sclr(zta)
+   END FUNCTION de_sat_dt_ice_sclr
+   !!
+   FUNCTION de_sat_dt_ice_vctr(ptak)
+      !! Same as "e_sat" but over ice rather than water!
+      REAL(wp), DIMENSION(jpi,jpj) :: de_sat_dt_ice_vctr !: vapour pressure at saturation in presence of ice [Pa]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      de_sat_dt_ice_vctr(ji,jj) = de_sat_dt_ice_sclr( ptak(ji,jj) )
+      END_2D
+   END FUNCTION de_sat_dt_ice_vctr
+
+
+
+   !===============================================================================================
+
+   !===============================================================================================
+   FUNCTION q_sat_sclr( pta, ppa,  l_ice )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION q_sat_sclr  ***
+      !!
+      !! ** Purpose : Conputes specific humidity of air at saturation
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp) :: q_sat_sclr
+      REAL(wp), INTENT(in) :: pta  !: absolute temperature of air [K]
+      REAL(wp), INTENT(in) :: ppa  !: atmospheric pressure        [Pa]
+      LOGICAL,  INTENT(in), OPTIONAL :: l_ice  !: we are above ice
+      REAL(wp) :: ze_s
+      LOGICAL  :: lice
+      !!----------------------------------------------------------------------------------
+      lice = .FALSE.
+      IF( PRESENT(l_ice) ) lice = l_ice
+      IF( lice ) THEN
+         ze_s = e_sat_ice( pta )
+      ELSE
+         ze_s = e_sat( pta ) ! Vapour pressure at saturation (Goff) :
+      END IF
+      q_sat_sclr = reps0*ze_s/(ppa - (1._wp - reps0)*ze_s)
+   END FUNCTION q_sat_sclr
+   !!
+   FUNCTION q_sat_vctr( pta, ppa,  l_ice )
+      REAL(wp), DIMENSION(jpi,jpj) :: q_sat_vctr
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta  !: absolute temperature of air [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ppa  !: atmospheric pressure        [Pa]
+      LOGICAL,  INTENT(in), OPTIONAL :: l_ice  !: we are above ice
+      LOGICAL  :: lice
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      lice = .FALSE.
+      IF( PRESENT(l_ice) ) lice = l_ice
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      q_sat_vctr(ji,jj) = q_sat_sclr( pta(ji,jj) , ppa(ji,jj), l_ice=lice )
+      END_2D
+   END FUNCTION q_sat_vctr
+   !===============================================================================================
+
+
+   !===============================================================================================
+   FUNCTION dq_sat_dt_ice_sclr( pta, ppa )
+      !!---------------------------------------------------------------------------------
+      !!     ***  FUNCTION dq_sat_dt_ice_sclr  ***
+      !!    => d [ q_sat_ice(T) ] / dT
+      !! Analytical exact formulation: double checked!!!
+      !!  => DOUBLE-check possible / finite-difference version with "./bin/test_phymbl.x"
+      !!----------------------------------------------------------------------------------
+      REAL(wp) :: dq_sat_dt_ice_sclr
+      REAL(wp), INTENT(in) :: pta  !: absolute temperature of air [K]
+      REAL(wp), INTENT(in) :: ppa  !: atmospheric pressure        [Pa]
+      REAL(wp) :: ze_s, zde_s_dt, ztmp
+      !!----------------------------------------------------------------------------------
+      ze_s     =  e_sat_ice_sclr( pta ) ! Vapour pressure at saturation  in presence of ice (Goff)
+      zde_s_dt = de_sat_dt_ice(   pta )
+      !
+      ztmp = (reps0 - 1._wp)*ze_s + ppa
+      !
+      dq_sat_dt_ice_sclr = reps0*ppa*zde_s_dt / ( ztmp*ztmp )
+      !
+   END FUNCTION dq_sat_dt_ice_sclr
+   !!
+   FUNCTION dq_sat_dt_ice_vctr( pta, ppa )
+      REAL(wp), DIMENSION(jpi,jpj) :: dq_sat_dt_ice_vctr
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta  !: absolute temperature of air [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ppa  !: atmospheric pressure        [Pa]
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      dq_sat_dt_ice_vctr(ji,jj) = dq_sat_dt_ice_sclr( pta(ji,jj) , ppa(ji,jj) )
+      END_2D
+   END FUNCTION dq_sat_dt_ice_vctr
+   !===============================================================================================
+
+
+   !===============================================================================================
+   FUNCTION q_air_rh(prha, ptak, ppa)
+      !!----------------------------------------------------------------------------------
+      !! Specific humidity of air out of Relative Humidity
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: q_air_rh
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: prha        !: relative humidity      [fraction, not %!!!]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak        !: air temperature        [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ppa        !: atmospheric pressure   [Pa]
+      !
+      INTEGER  ::   ji, jj      ! dummy loop indices
+      REAL(wp) ::   ze      ! local scalar
+      !!----------------------------------------------------------------------------------
+      !
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      ze = prha(ji,jj)*e_sat_sclr(ptak(ji,jj))
+      q_air_rh(ji,jj) = ze*reps0/(ppa(ji,jj) - (1. - reps0)*ze)
+      END_2D
+      !
+   END FUNCTION q_air_rh
+
+
+   SUBROUTINE UPDATE_QNSOL_TAU( pzu, pTs, pqs, pTa, pqa, pust, ptst, pqst, pwnd, pUb, ppa, prlw, &
+      &                         pQns, pTau,  &
+      &                         Qlat)
+      !!----------------------------------------------------------------------------------
+      !! Purpose: returns the non-solar heat flux to the ocean aka "Qlat + Qsen + Qlw"
+      !!          and the module of the wind stress => pTau = Tau
+      !! ** Author: L. Brodeau, Sept. 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pust ! u*
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: ptst ! t*
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqst ! q*
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: ppa ! sea-level atmospheric pressure [Pa]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: prlw ! downwelling longwave radiative flux [W/m^2]
+      !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQns ! non-solar heat flux to the ocean aka "Qlat + Qsen + Qlw" [W/m^2]]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pTau ! module of the wind stress [N/m^2]
+      !
+      REAL(wp), DIMENSION(jpi,jpj), OPTIONAL, INTENT(out) :: Qlat
+      !
+      REAL(wp) :: zdt, zdq, zCd, zCh, zCe, zz0, zQlat, zQsen, zQlw
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      zdt = pTa(ji,jj) - pTs(ji,jj) ;  zdt = SIGN( MAX(ABS(zdt),1.E-6_wp), zdt )
+      zdq = pqa(ji,jj) - pqs(ji,jj) ;  zdq = SIGN( MAX(ABS(zdq),1.E-9_wp), zdq )
+      zz0 = pust(ji,jj)/pUb(ji,jj)
+      zCd = zz0*zz0
+      zCh = zz0*ptst(ji,jj)/zdt
+      zCe = zz0*pqst(ji,jj)/zdq
+
+      CALL BULK_FORMULA( pzu, pTs(ji,jj), pqs(ji,jj), pTa(ji,jj), pqa(ji,jj), zCd, zCh, zCe, &
+         &              pwnd(ji,jj), pUb(ji,jj), ppa(ji,jj), &
+         &              pTau(ji,jj), zQsen, zQlat )
+
+      zQlw = qlw_net_sclr( prlw(ji,jj), pTs(ji,jj) ) ! Net longwave flux
+
+      pQns(ji,jj) = zQlat + zQsen + zQlw
+
+      IF( PRESENT(Qlat) ) Qlat(ji,jj) = zQlat
+      END_2D
+   END SUBROUTINE UPDATE_QNSOL_TAU
+
+
+   SUBROUTINE BULK_FORMULA_SCLR( pzu, pTs, pqs, pTa, pqa, &
+      &                          pCd, pCh, pCe,           &
+      &                          pwnd, pUb, ppa,         &
+      &                          pTau, pQsen, pQlat,      &
+      &                          pEvap, prhoa, pfact_evap )
+      !!----------------------------------------------------------------------------------
+      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
+      REAL(wp), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
+      REAL(wp), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
+      REAL(wp), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
+      REAL(wp), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
+      REAL(wp), INTENT(in)  :: pCd
+      REAL(wp), INTENT(in)  :: pCh
+      REAL(wp), INTENT(in)  :: pCe
+      REAL(wp), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
+      REAL(wp), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
+      REAL(wp), INTENT(in)  :: ppa ! sea-level atmospheric pressure [Pa]
+      !!
+      REAL(wp), INTENT(out) :: pTau  ! module of the wind stress [N/m^2]
+      REAL(wp), INTENT(out) :: pQsen !  [W/m^2]
+      REAL(wp), INTENT(out) :: pQlat !  [W/m^2]
+      !!
+      REAL(wp), INTENT(out), OPTIONAL :: pEvap ! Evaporation [kg/m^2/s]
+      REAL(wp), INTENT(out), OPTIONAL :: prhoa ! Air density at z=pzu [kg/m^3]
+      REAL(wp), INTENT(in) , OPTIONAL :: pfact_evap  ! ABOMINATION: corrective factor for evaporation (doing this against my will! /laurent)
+      !!
+      REAL(wp) :: ztaa, zgamma, zrho, zUrho, zevap, zfact_evap
+      INTEGER  :: jq
+      !!----------------------------------------------------------------------------------
+      zfact_evap = 1._wp
+      IF( PRESENT(pfact_evap) ) zfact_evap = pfact_evap
+
+      !! Need ztaa, absolute temperature at pzu (formula to estimate rho_air needs absolute temperature, not the potential temperature "pTa")
+      ztaa = pTa ! first guess...
+      DO jq = 1, 4
+         zgamma = gamma_moist( 0.5*(ztaa+pTs) , pqa )  !#LB: why not "0.5*(pqs+pqa)" rather then "pqa" ???
+         ztaa = pTa - zgamma*pzu   ! Absolute temp. is slightly colder...
+      END DO
+      zrho = rho_air(ztaa, pqa, ppa)
+      zrho = rho_air(ztaa, pqa, ppa-zrho*grav*pzu) ! taking into account that we are pzu m above the sea level where SLP is given!
+
+      zUrho = pUb*MAX(zrho, 1._wp)     ! rho*U10
+
+      pTau = zUrho * pCd * pwnd ! Wind stress module
+
+      zevap = zUrho * pCe * (pqa - pqs)
+      pQsen = zUrho * pCh * (pTa - pTs) * cp_air(pqa)
+      pQlat = L_vap(pTs) * zevap
+
+      IF( PRESENT(pEvap) ) pEvap = - zfact_evap * zevap
+      IF( PRESENT(prhoa) ) prhoa = zrho
+
+   END SUBROUTINE BULK_FORMULA_SCLR
+   !!
+   SUBROUTINE BULK_FORMULA_VCTR( pzu, pTs, pqs, pTa, pqa, &
+      &                          pCd, pCh, pCe,           &
+      &                          pwnd, pUb, ppa,         &
+      &                          pTau, pQsen, pQlat,      &
+      &                          pEvap, prhoa, pfact_evap )
+      !!----------------------------------------------------------------------------------
+      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCd
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCh
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCe
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: ppa ! sea-level atmospheric pressure [Pa]
+      !!
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pTau  ! module of the wind stress [N/m^2]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQsen !  [W/m^2]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQlat !  [W/m^2]
+      !!
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out), OPTIONAL :: pEvap ! Evaporation [kg/m^2/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(out), OPTIONAL :: prhoa ! Air density at z=pzu [kg/m^3]
+      REAL(wp),                     INTENT(in) , OPTIONAL :: pfact_evap  ! ABOMINATION: corrective factor for evaporation (doing this against my will! /laurent)
+      !!
+      REAL(wp) :: ztaa, zgamma, zrho, zUrho, zevap, zfact_evap
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      zfact_evap = 1._wp
+      IF( PRESENT(pfact_evap) ) zfact_evap = pfact_evap
+
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+      CALL BULK_FORMULA_SCLR( pzu, pTs(ji,jj), pqs(ji,jj), pTa(ji,jj), pqa(ji,jj), &
+         &                    pCd(ji,jj), pCh(ji,jj), pCe(ji,jj),                  &
+         &                    pwnd(ji,jj), pUb(ji,jj), ppa(ji,jj),                &
+         &                    pTau(ji,jj), pQsen(ji,jj), pQlat(ji,jj),             &
+         &                    pEvap=zevap, prhoa=zrho, pfact_evap=zfact_evap       )
+
+      IF( PRESENT(pEvap) ) pEvap(ji,jj) = zevap
+      IF( PRESENT(prhoa) ) prhoa(ji,jj) = zrho
+      END_2D
+   END SUBROUTINE BULK_FORMULA_VCTR
+
+
+   FUNCTION alpha_sw_vctr( psst )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION alpha_sw_vctr  ***
+      !!
+      !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (P =~ 1010 hpa)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   alpha_sw_vctr   ! thermal expansion coefficient of sea-water [1/K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   psst   ! water temperature                [K]
+      !!----------------------------------------------------------------------------------
+      alpha_sw_vctr = 2.1e-5_wp * MAX(psst(:,:)-rt0 + 3.2_wp, 0._wp)**0.79
+   END FUNCTION alpha_sw_vctr
+
+   FUNCTION alpha_sw_sclr( psst )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION alpha_sw_sclr  ***
+      !!
+      !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (P =~ 1010 hpa)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             ::   alpha_sw_sclr   ! thermal expansion coefficient of sea-water [1/K]
+      REAL(wp), INTENT(in) ::   psst   ! sea-water temperature                   [K]
+      !!----------------------------------------------------------------------------------
+      alpha_sw_sclr = 2.1e-5_wp * MAX(psst-rt0 + 3.2_wp, 0._wp)**0.79
+   END FUNCTION alpha_sw_sclr
+
+
+   !===============================================================================================
+   FUNCTION qlw_net_sclr( pdwlw, pts,  l_ice )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION qlw_net_sclr  ***
+      !!
+      !! ** Purpose : Estimate of the net longwave flux at the surface
+      !!----------------------------------------------------------------------------------
+      REAL(wp) :: qlw_net_sclr
+      REAL(wp), INTENT(in) :: pdwlw !: downwelling longwave (aka infrared, aka thermal) radiation [W/m^2]
+      REAL(wp), INTENT(in) :: pts   !: surface temperature [K]
+      LOGICAL,  INTENT(in), OPTIONAL :: l_ice  !: we are above ice
+      REAL(wp) :: zemiss, zt2
+      LOGICAL  :: lice
+      !!----------------------------------------------------------------------------------
+      lice = .FALSE.
+      IF( PRESENT(l_ice) ) lice = l_ice
+      IF( lice ) THEN
+         zemiss = emiss_i
+      ELSE
+         zemiss = emiss_w
+      END IF
+      zt2 = pts*pts
+      qlw_net_sclr = zemiss*( pdwlw - stefan*zt2*zt2)  ! zemiss used both as the IR albedo and IR emissivity...
+   END FUNCTION qlw_net_sclr
+   !!
+   FUNCTION qlw_net_vctr( pdwlw, pts,  l_ice )
+      REAL(wp), DIMENSION(jpi,jpj) :: qlw_net_vctr
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pdwlw !: downwelling longwave (aka infrared, aka thermal) radiation [W/m^2]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pts   !: surface temperature [K]
+      LOGICAL,  INTENT(in), OPTIONAL :: l_ice  !: we are above ice
+      LOGICAL  :: lice
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------------------
+      lice = .FALSE.
+      IF( PRESENT(l_ice) ) lice = l_ice
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      qlw_net_vctr(ji,jj) = qlw_net_sclr( pdwlw(ji,jj) , pts(ji,jj), l_ice=lice )
+      END_2D
+   END FUNCTION qlw_net_vctr
+   !===============================================================================================
+
+   FUNCTION z0_from_Cd( pzu, pCd,  ppsi )
+      REAL(wp), DIMENSION(jpi,jpj) :: z0_from_Cd        !: roughness length [m]
+      REAL(wp)                    , INTENT(in) :: pzu   !: reference height zu [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pCd   !: (neutral or non-neutral) drag coefficient []
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: ppsi !: "Psi_m(pzu/L)" stability correction profile for momentum []
+      !!
+      !! If pCd is the NEUTRAL-STABILITY drag coefficient then ppsi must be 0 or not given
+      !! If pCd is the drag coefficient (in stable or unstable conditions) then pssi must be provided
+      !!----------------------------------------------------------------------------------
+      IF( PRESENT(ppsi) ) THEN
+         !! Cd provided is the actual Cd (not the neutral-stability CdN) :
+         z0_from_Cd = pzu * EXP( - ( vkarmn/SQRT(pCd(:,:)) + ppsi(:,:) ) ) !LB: ok, double-checked!
+      ELSE
+         !! Cd provided is the neutral-stability Cd, aka CdN :
+         z0_from_Cd = pzu * EXP( - vkarmn/SQRT(pCd(:,:)) )            !LB: ok, double-checked!
+      END IF
+   END FUNCTION z0_from_Cd
+
+   FUNCTION Cd_from_z0( pzu, pz0,  ppsi )
+      REAL(wp), DIMENSION(jpi,jpj) :: Cd_from_z0        !: (neutral or non-neutral) drag coefficient []
+      REAL(wp)                    , INTENT(in) :: pzu   !: reference height zu [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0   !: roughness length [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: ppsi !: "Psi_m(pzu/L)" stability correction profile for momentum []
+      !!
+      !! If we want to return the NEUTRAL-STABILITY drag coefficient then ppsi must be 0 or not given
+      !! If we want to return the stability-corrected Cd (i.e. in stable or unstable conditions) then pssi must be provided
+      !!----------------------------------------------------------------------------------
+      IF( PRESENT(ppsi) ) THEN
+         !! The Cd we return is the actual Cd (not the neutral-stability CdN) :
+         Cd_from_z0 = 1._wp / ( LOG( pzu / pz0(:,:) ) - ppsi(:,:) )
+      ELSE
+         !! The Cd we return is the neutral-stability Cd, aka CdN :
+         Cd_from_z0 = 1._wp /   LOG( pzu / pz0(:,:) )
+      END IF
+      Cd_from_z0 = vkarmn2 * Cd_from_z0 * Cd_from_z0
+   END FUNCTION Cd_from_z0
+
+
+   FUNCTION f_m_louis_sclr( pzu, pRib, pCdn, pz0 )
+      !!----------------------------------------------------------------------------------
+      !!  Stability correction function for MOMENTUM
+      !!                 Louis (1979)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             :: f_m_louis_sclr ! term "f_m" in Eq.(6) when option "Louis" rather than "Psi(zeta) is chosen, Lupkes & Gryanik (2015),
+      REAL(wp), INTENT(in) :: pzu     ! reference height (height for pwnd)  [m]
+      REAL(wp), INTENT(in) :: pRib    ! Bulk Richardson number
+      REAL(wp), INTENT(in) :: pCdn    ! neutral drag coefficient
+      REAL(wp), INTENT(in) :: pz0     ! roughness length                      [m]
+      !!----------------------------------------------------------------------------------
+      REAL(wp) :: ztu, zts, zstab
+      !!----------------------------------------------------------------------------------
+      zstab = 0.5 + SIGN(0.5_wp, pRib) ; ! Unstable (Ri<0) => zstab = 0 | Stable (Ri>0) => zstab = 1
+      !
+      ztu = pRib / ( 1._wp + 3._wp * rc2_louis * pCdn * SQRT( ABS( -pRib * ( pzu / pz0 + 1._wp) ) ) ) ! ABS is just here for when it's stable conditions and ztu is not used anyways
+      zts = pRib / SQRT( ABS( 1._wp + pRib ) ) ! ABS is just here for when it's UNstable conditions and zts is not used anyways
+      !
+      f_m_louis_sclr = (1._wp - zstab) *         ( 1._wp - ram_louis * ztu )  &  ! Unstable Eq.(A6)
+         &               +      zstab  * 1._wp / ( 1._wp + ram_louis * zts )     ! Stable   Eq.(A7)
+      !
+   END FUNCTION f_m_louis_sclr
+   !!
+   FUNCTION f_m_louis_vctr( pzu, pRib, pCdn, pz0 )
+      REAL(wp), DIMENSION(jpi,jpj)             :: f_m_louis_vctr
+      REAL(wp),                     INTENT(in) :: pzu
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pRib
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pCdn
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0
+      INTEGER  :: ji, jj
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      f_m_louis_vctr(ji,jj) = f_m_louis_sclr( pzu, pRib(ji,jj), pCdn(ji,jj), pz0(ji,jj) )
+      END_2D
+   END FUNCTION f_m_louis_vctr
+
+
+   FUNCTION f_h_louis_sclr( pzu, pRib, pChn, pz0 )
+      !!----------------------------------------------------------------------------------
+      !!  Stability correction function for HEAT
+      !!                 Louis (1979)
+      !!----------------------------------------------------------------------------------
+      REAL(wp)             :: f_h_louis_sclr ! term "f_h" in Eq.(6) when option "Louis" rather than "Psi(zeta) is chosen, Lupkes & Gryanik (2015),
+      REAL(wp), INTENT(in) :: pzu     ! reference height (height for pwnd)  [m]
+      REAL(wp), INTENT(in) :: pRib    ! Bulk Richardson number
+      REAL(wp), INTENT(in) :: pChn    ! neutral heat transfer coefficient
+      REAL(wp), INTENT(in) :: pz0     ! roughness length                      [m]
+      !!----------------------------------------------------------------------------------
+      REAL(wp) :: ztu, zts, zstab
+      !!----------------------------------------------------------------------------------
+      zstab = 0.5 + SIGN(0.5_wp, pRib) ; ! Unstable (Ri<0) => zstab = 0 | Stable (Ri>0) => zstab = 1
+      !
+      ztu = pRib / ( 1._wp + 3._wp * rc2_louis * pChn * SQRT( ABS(-pRib * ( pzu / pz0 + 1._wp) ) ) )
+      zts = pRib / SQRT( ABS( 1._wp + pRib ) )
+      !
+      f_h_louis_sclr = (1._wp - zstab) *         ( 1._wp - rah_louis * ztu )  &  ! Unstable Eq.(A6)
+         &              +       zstab  * 1._wp / ( 1._wp + rah_louis * zts )     ! Stable   Eq.(A7)  !#LB: in paper it's "ram_louis" and not "rah_louis" typo or what????
+      !
+   END FUNCTION f_h_louis_sclr
+   !!
+   FUNCTION f_h_louis_vctr( pzu, pRib, pChn, pz0 )
+      REAL(wp), DIMENSION(jpi,jpj)             :: f_h_louis_vctr
+      REAL(wp),                     INTENT(in) :: pzu
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pRib
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pChn
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0
+      INTEGER  :: ji, jj
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+      f_h_louis_vctr(ji,jj) = f_h_louis_sclr( pzu, pRib(ji,jj), pChn(ji,jj), pz0(ji,jj) )
+      END_2D
+   END FUNCTION f_h_louis_vctr
+
+   FUNCTION UN10_from_ustar( pzu, pUzu, pus, ppsi )
+      !!----------------------------------------------------------------------------------
+      !!  Provides the neutral-stability wind speed at 10 m
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: UN10_from_ustar  !: neutral stability wind speed at 10m [m/s]
+      REAL(wp),                     INTENT(in) :: pzu   !: measurement heigh of wind speed   [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pUzu  !: bulk wind speed at height pzu m   [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pus   !: friction velocity                 [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ppsi !: "Psi_m(pzu/L)" stability correction profile for momentum []
+      !!----------------------------------------------------------------------------------
+      UN10_from_ustar(:,:) = pUzu(:,:) - pus(:,:)/vkarmn * ( LOG(pzu/10._wp) - ppsi(:,:) )
+      !!
+   END FUNCTION UN10_from_ustar
+
+
+   FUNCTION UN10_from_CD( pzu, pUb, pCd, ppsi )
+      !!----------------------------------------------------------------------------------
+      !!  Provides the neutral-stability wind speed at 10 m
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: UN10_from_CD  !: [m/s]
+      REAL(wp),                     INTENT(in) :: pzu  !: measurement heigh of bulk wind speed
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pUb  !: bulk wind speed at height pzu m   [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pCd  !: drag coefficient
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ppsi !: "Psi_m(pzu/L)" stability correction profile for momentum []
+      !!----------------------------------------------------------------------------------
+      !! Reminder: UN10 = u*/vkarmn * log(10/z0)
+      !!     and: u* = sqrt(Cd) * Ub
+      !!                                  u*/vkarmn * log(   10   /       z0    )
+      UN10_from_CD(:,:) = SQRT(pCd(:,:))*pUb/vkarmn * LOG( 10._wp / z0_from_Cd( pzu, pCd(:,:), ppsi=ppsi(:,:) ) )
+      !!
+   END FUNCTION UN10_from_CD
+
+
+   FUNCTION z0tq_LKB( iflag, pRer, pz0 )
+      !!---------------------------------------------------------------------------------
+      !!       ***  FUNCTION z0tq_LKB  ***
+      !!
+      !! ** Purpose : returns the "temperature/humidity roughness lengths"
+      !!              * iflag==1 => temperature => returns: z_{0t}
+      !!              * iflag==2 => humidity    => returns: z_{0q}
+      !!              from roughness reynold number "pRer" (i.e. [z_0 u*]/Nu_{air})
+      !!              between 0 and 1000. Out of range "pRer" indicated by prt=-999.
+      !!              and roughness length (for momentum)
+      !!
+      !!              Based on Liu et al. (1979) JAS 36 1722-1723s
+      !!
+      !!              Note: this is what is used into COARE 2.5 to estimate z_{0t} and z_{0q}
+      !!
+      !! ** Author: L. Brodeau, April 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: z0tq_LKB
+      INTEGER,                      INTENT(in) :: iflag     !: 1 => dealing with temperature; 2 => dealing with humidity
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pRer      !: roughness Reynolds number  [z_0 u*]/Nu_{air}
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0       !: roughness length (for momentum) [m]
+      !-------------------------------------------------------------------
+      ! Scalar Re_r relation from Liu et al.
+      REAL(wp), DIMENSION(8,2), PARAMETER :: &
+         & XA = (/ 0.177, 1.376, 1.026, 1.625, 4.661, 34.904, 1667.19, 5.88e5,  &
+         &         0.292, 1.808, 1.393, 1.956, 4.994, 30.709, 1448.68, 2.98e5 /)
+      !!
+      REAL(wp), DIMENSION(8,2), PARAMETER :: &
+         & XB = (/ 0., 0.929, -0.599, -1.018, -1.475, -2.067, -2.907, -3.935,  &
+         &         0., 0.826, -0.528, -0.870, -1.297, -1.845, -2.682, -3.616 /)
+      !!
+      REAL(wp), DIMENSION(0:8),   PARAMETER :: &
+         & XRAN = (/ 0., 0.11, 0.825, 3.0, 10.0, 30.0, 100., 300., 1000. /)
+      !-------------------------------------------------------------------
+      !
+      !-------------------------------------------------------------------
+      ! Scalar Re_r relation from Moana Wave data.
+      !
+      !      real*8 A(9,2),B(9,2),RAN(9),pRer,prt
+      !      integer iflag
+      !      DATA A/0.177,2.7e3,1.03,1.026,1.625,4.661,34.904,1667.19,5.88E5,
+      !     &       0.292,3.7e3,1.4,1.393,1.956,4.994,30.709,1448.68,2.98E5/
+      !      DATA B/0.,4.28,0,-0.599,-1.018,-1.475,-2.067,-2.907,-3.935,
+      !     &       0.,4.28,0,-0.528,-0.870,-1.297,-1.845,-2.682,-3.616/
+      !      DATA RAN/0.11,.16,1.00,3.0,10.0,30.0,100.,300.,1000./
+      !-------------------------------------------------------------------
+
+      LOGICAL  :: lfound=.FALSE.
+      REAL(wp) :: zrr
+      INTEGER  :: ji, jj, jm
+
+      z0tq_LKB(:,:) = -999._wp
+
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+      zrr    = pRer(ji,jj)
+      lfound = .FALSE.
+
+      IF( (zrr > 0.).AND.(zrr < 1000.) ) THEN
+         jm = 0
+         DO WHILE ( .NOT. lfound )
+            jm = jm + 1
+            lfound = ( (zrr > XRAN(jm-1)) .AND. (zrr <= XRAN(jm)) )
+         END DO
+
+         z0tq_LKB(ji,jj) = XA(jm,iflag)*zrr**XB(jm,iflag) * pz0(ji,jj)/zrr
+
+      END IF
+
+      END_2D
+
+      z0tq_LKB(:,:) = MIN( MAX(ABS(z0tq_LKB(:,:)), 1.E-9) , 0.05_wp )
+
+   END FUNCTION z0tq_LKB
+
+
+   !!======================================================================
+END MODULE sbc_phy
Index: /NEMO/trunk/src/OCE/SBC/sbcapr.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcapr.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcapr.F90	(revision 14072)
@@ -6,7 +6,7 @@
    !! History :  3.3  !   2010-09  (J. Chanut, C. Bricaud, G. Madec)  Original code
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
-   !!   sbc_apr        : read atmospheric pressure in netcdf files 
+   !!   sbc_apr        : read atmospheric pressure in netcdf files
    !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
@@ -25,7 +25,7 @@
    PUBLIC   sbc_apr       ! routine called in sbcmod
    PUBLIC   sbc_apr_init  ! routine called in sbcmod
-   
+
    !                                          !!* namsbc_apr namelist (Atmospheric PRessure) *
-   LOGICAL, PUBLIC ::   ln_apr_obc = .false.   !: inverse barometer added to OBC ssh data 
+   LOGICAL, PUBLIC ::   ln_apr_obc = .false.   !: inverse barometer added to OBC ssh data
    LOGICAL, PUBLIC ::   ln_ref_apr             !: ref. pressure: global mean Patm (F) or a constant (F)
    REAL(wp)        ::   rn_pref                !  reference atmospheric pressure   [N/m2]
@@ -34,8 +34,8 @@
    REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   ssh_ibb   ! Inverse barometer before sea surface height   [m]
    REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   apr       ! atmospheric pressure at kt                 [N/m2]
-   
+
    REAL(wp) ::   tarea                ! whole domain mean masked ocean surface
    REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rho0)
-   
+
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_apr   ! structure of input fields (file informations, fields read)
 
@@ -54,5 +54,5 @@
       !!
       !! ** Method  : - Read namelist namsbc_apr
-      !!              - Read Patm fields in netcdf files 
+      !!              - Read Patm fields in netcdf files
       !!              - Compute reference atmospheric pressure
       !!              - Compute inverse barometer ssh
@@ -60,5 +60,5 @@
       !!                ssh_ib   : inverse barometer ssh at kt
       !!---------------------------------------------------------------------
-      INTEGER            ::   ierror  ! local integer 
+      INTEGER            ::   ierror  ! local integer
       INTEGER            ::   ios     ! Local integer output status for namelist read
       !!
@@ -103,5 +103,5 @@
          IF(lwp) WRITE(numout,*) '         Inverse barometer added to OBC ssh data'
       ENDIF
-!jc: stop below should rather be a warning 
+!jc: stop below should rather be a warning
       IF( ln_apr_obc .AND. .NOT.ln_apr_dyn   )   &
             CALL ctl_warn( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' )
@@ -116,5 +116,5 @@
       !!
       !! ** Method  : - Read namelist namsbc_apr
-      !!              - Read Patm fields in netcdf files 
+      !!              - Read Patm fields in netcdf files
       !!              - Compute reference atmospheric pressure
       !!              - Compute inverse barometer ssh
@@ -148,5 +148,5 @@
          !                                      ! ---------------------------------------- !
          !                                            !* Restart: read in restart file
-         IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN 
+         IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN
             IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file'
             CALL iom_get( numror, jpdom_auto, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh
@@ -167,5 +167,5 @@
       !
    END SUBROUTINE sbc_apr
-      
+
    !!======================================================================
 END MODULE sbcapr
Index: /NEMO/trunk/src/OCE/SBC/sbcblk.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk.F90	(revision 14072)
@@ -19,4 +19,5 @@
    !!            4.0  !  2016-10  (M. Vancoppenolle)  Introduce conduction flux emulator (M. Vancoppenolle)
    !!            4.0  !  2019-03  (F. Lemarié & G. Samson)  add ABL compatibility (ln_abl=TRUE)
+   !!            4.2  !  2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
 
@@ -30,6 +31,4 @@
    !!   blk_ice_2   : provide the heat and mass fluxes at air-ice interface
    !!   blk_ice_qcn   : provide ice surface temperature and snow/ice conduction flux (emulating conduction flux)
-   !!   Cdn10_Lupkes2012 : Lupkes et al. (2012) air-ice drag
-   !!   Cdn10_Lupkes2015 : Lupkes et al. (2015) air-ice drag
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and tracers
@@ -41,14 +40,19 @@
    USE sbcdcy         ! surface boundary condition: diurnal cycle
    USE sbcwave , ONLY :   cdn_wave ! wave module
-   USE sbc_ice        ! Surface boundary condition: ice fields
    USE lib_fortran    ! to use key_nosignedzero
+   !
 #if defined key_si3
+   USE sbc_ice        ! Surface boundary condition: ice fields #LB? ok to be in 'key_si3' ???
    USE ice     , ONLY :   u_ice, v_ice, jpl, a_i_b, at_i_b, t_su, rn_cnd_s, hfx_err_dif, nn_qtrice
    USE icevar         ! for CALL ice_var_snwblow
-#endif
-   USE sbcblk_algo_ncar     ! => turb_ncar     : NCAR - CORE (Large & Yeager, 2009)
+   USE sbcblk_algo_ice_an05
+   USE sbcblk_algo_ice_lu12
+   USE sbcblk_algo_ice_lg15
+#endif
+   USE sbcblk_algo_ncar     ! => turb_ncar     : NCAR - (formerly known as CORE, Large & Yeager, 2009)
    USE sbcblk_algo_coare3p0 ! => turb_coare3p0 : COAREv3.0 (Fairall et al. 2003)
    USE sbcblk_algo_coare3p6 ! => turb_coare3p6 : COAREv3.6 (Fairall et al. 2018 + Edson et al. 2013)
    USE sbcblk_algo_ecmwf    ! => turb_ecmwf    : ECMWF (IFS cycle 45r1)
+   USE sbcblk_algo_andreas  ! => turb_andreas  : Andreas et al. 2015
    !
    USE iom            ! I/O manager library
@@ -58,6 +62,5 @@
    USE prtctl         ! Print control
 
-   USE sbcblk_phy     ! a catalog of functions for physical/meteorological parameters in the marine boundary layer, rho_air, q_sat, etc...
-
+   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
 
    IMPLICIT NONE
@@ -100,11 +103,17 @@
    LOGICAL  ::   ln_COARE_3p6   ! "COARE 3.6" algorithm   (Edson et al. 2013)
    LOGICAL  ::   ln_ECMWF       ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   LOGICAL  ::   ln_ANDREAS     ! "ANDREAS"   algorithm   (Andreas et al. 2015)
    !
-   LOGICAL  ::   ln_Cd_L12      ! ice-atm drag = F( ice concentration )                        (Lupkes et al. JGR2012)
-   LOGICAL  ::   ln_Cd_L15      ! ice-atm drag = F( ice concentration, atmospheric stability ) (Lupkes et al. JGR2015)
+   !#LB:
+   LOGICAL  ::   ln_Cx_ice_cst             ! use constant air-ice bulk transfer coefficients (value given in namelist's rn_Cd_i, rn_Ce_i & rn_Ch_i)
+   REAL(wp) ::   rn_Cd_i, rn_Ce_i, rn_Ch_i ! values for  "    "
+   LOGICAL  ::   ln_Cx_ice_AN05            ! air-ice bulk transfer coefficients based on Andreas et al., 2005
+   LOGICAL  ::   ln_Cx_ice_LU12            ! air-ice bulk transfer coefficients based on Lupkes et al., 2012
+   LOGICAL  ::   ln_Cx_ice_LG15            ! air-ice bulk transfer coefficients based on Lupkes & Gryanik, 2015
+   !#LB.
    !
    LOGICAL  ::   ln_crt_fbk     ! Add surface current feedback to the wind stress computation  (Renault et al. 2020)
    REAL(wp) ::   rn_stau_a      ! Alpha and Beta coefficients of Renault et al. 2020, eq. 10: Stau = Alpha * Wnd + Beta
-   REAL(wp) ::   rn_stau_b      ! 
+   REAL(wp) ::   rn_stau_b      !
    !
    REAL(wp)         ::   rn_pfac   ! multiplication factor for precipitation
@@ -113,7 +122,13 @@
    REAL(wp)         ::   rn_zu     ! z(u)   : height of wind measurements
    !
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) ::   Cdn_oce, Chn_oce, Cen_oce  ! neutral coeffs over ocean (L15 bulk scheme and ABL)
-   REAL(wp),         ALLOCATABLE, DIMENSION(:,:) ::   Cd_ice , Ch_ice , Ce_ice   ! transfert coefficients over ice
-   REAL(wp),         ALLOCATABLE, DIMENSION(:,:) ::   t_zu, q_zu                 ! air temp. and spec. hum. at wind speed height (L15 bulk scheme)
+   INTEGER          :: nn_iter_algo   !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+
+   REAL(wp),         ALLOCATABLE, DIMENSION(:,:) ::   theta_zu, q_zu                 ! air temp. and spec. hum. at wind speed height (L15 bulk scheme)
+
+#if defined key_si3
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: Cd_ice , Ch_ice , Ce_ice   !#LB transfert coefficients over ice
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: theta_zu_i, q_zu_i         !#LB fixme ! air temp. and spec. hum. over ice at wind speed height (L15 bulk scheme)
+#endif
+
 
    LOGICAL  ::   ln_skin_cs     ! use the cool-skin (only available in ECMWF and COARE algorithms) !LB
@@ -122,5 +137,5 @@
    LOGICAL  ::   ln_humi_dpt    ! humidity read in files ("sn_humi") is dew-point temperature [K] if .true. !LB
    LOGICAL  ::   ln_humi_rlh    ! humidity read in files ("sn_humi") is relative humidity     [%] if .true. !LB
-   LOGICAL  ::   ln_tpot        !!GS: flag to compute or not potential temperature
+   LOGICAL  ::   ln_tair_pot    ! temperature read in files ("sn_tair") is already potential temperature (not absolute)
    !
    INTEGER  ::   nhumi          ! choice of the bulk algorithm
@@ -136,4 +151,19 @@
    INTEGER, PARAMETER ::   np_COARE_3p6 = 3   ! "COARE 3.6" algorithm   (Edson et al. 2013)
    INTEGER, PARAMETER ::   np_ECMWF     = 4   ! "ECMWF" algorithm       (IFS cycle 45r1)
+   INTEGER, PARAMETER ::   np_ANDREAS   = 5   ! "ANDREAS" algorithm       (Andreas et al. 2015)
+
+   !#LB:
+#if defined key_si3
+   ! Same, over sea-ice:
+   INTEGER  ::   nblk_ice           ! choice of the bulk algorithm
+   !                            ! associated indices:
+   INTEGER, PARAMETER ::   np_ice_cst  = 1   ! constant transfer coefficients
+   INTEGER, PARAMETER ::   np_ice_an05 = 2   ! Andreas et al., 2005
+   INTEGER, PARAMETER ::   np_ice_lu12 = 3   ! Lupkes el al., 2012
+   INTEGER, PARAMETER ::   np_ice_lg15 = 4   ! Lupkes & Gryanik, 2015
+#endif
+   !LB.
+
+
 
    !! * Substitutions
@@ -150,11 +180,20 @@
       !!             ***  ROUTINE sbc_blk_alloc ***
       !!-------------------------------------------------------------------
-      ALLOCATE( t_zu(jpi,jpj)   , q_zu(jpi,jpj)   ,                                      &
-         &      Cdn_oce(jpi,jpj), Chn_oce(jpi,jpj), Cen_oce(jpi,jpj),                    &
-         &      Cd_ice (jpi,jpj), Ch_ice (jpi,jpj), Ce_ice (jpi,jpj), STAT=sbc_blk_alloc )
-      !
+      ALLOCATE( theta_zu(jpi,jpj), q_zu(jpi,jpj),  STAT=sbc_blk_alloc )
       CALL mpp_sum ( 'sbcblk', sbc_blk_alloc )
       IF( sbc_blk_alloc /= 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_alloc: failed to allocate arrays' )
    END FUNCTION sbc_blk_alloc
+
+#if defined key_si3
+   INTEGER FUNCTION sbc_blk_ice_alloc()
+      !!-------------------------------------------------------------------
+      !!             ***  ROUTINE sbc_blk_ice_alloc ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( Cd_ice (jpi,jpj), Ch_ice (jpi,jpj), Ce_ice (jpi,jpj),         &
+         &      theta_zu_i(jpi,jpj), q_zu_i(jpi,jpj),  STAT=sbc_blk_ice_alloc )
+      CALL mpp_sum ( 'sbcblk', sbc_blk_ice_alloc )
+      IF( sbc_blk_ice_alloc /= 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_ice_alloc: failed to allocate arrays' )
+   END FUNCTION sbc_blk_ice_alloc
+#endif
 
 
@@ -178,16 +217,25 @@
       TYPE(FLD_N) ::   sn_cc, sn_hpgi, sn_hpgj                 !       "                        "
       INTEGER     ::   ipka                                    ! number of levels in the atmospheric variable
-      NAMELIST/namsbc_blk/ sn_wndi, sn_wndj, sn_humi, sn_qsr, sn_qlw ,                &   ! input fields
-         &                 sn_tair, sn_prec, sn_snow, sn_slp, sn_uoatm, sn_voatm,     &
-         &                 sn_cc, sn_hpgi, sn_hpgj,                                   &
-         &                 ln_NCAR, ln_COARE_3p0, ln_COARE_3p6, ln_ECMWF,             &   ! bulk algorithm
-         &                 cn_dir , rn_zqt, rn_zu,                                    &
-         &                 rn_pfac, rn_efac, ln_Cd_L12, ln_Cd_L15, ln_tpot,           &
+      NAMELIST/namsbc_blk/ ln_NCAR, ln_COARE_3p0, ln_COARE_3p6, ln_ECMWF, ln_ANDREAS, &   ! bulk algorithm
+         &                 rn_zqt, rn_zu, nn_iter_algo, ln_skin_cs, ln_skin_wl,       &
+         &                 rn_pfac, rn_efac,                                          &
          &                 ln_crt_fbk, rn_stau_a, rn_stau_b,                          &   ! current feedback
-         &                 ln_skin_cs, ln_skin_wl, ln_humi_sph, ln_humi_dpt, ln_humi_rlh  ! cool-skin / warm-layer !LB
+         &                 ln_humi_sph, ln_humi_dpt, ln_humi_rlh, ln_tair_pot,        &
+         &                 ln_Cx_ice_cst, rn_Cd_i, rn_Ce_i, rn_Ch_i,                  &
+         &                 ln_Cx_ice_AN05, ln_Cx_ice_LU12, ln_Cx_ice_LG15,            &
+         &                 cn_dir,                                                    &
+         &                 sn_wndi, sn_wndj, sn_qsr, sn_qlw ,                         &   ! input fields
+         &                 sn_tair, sn_humi, sn_prec, sn_snow, sn_slp,                &
+         &                 sn_uoatm, sn_voatm, sn_cc, sn_hpgi, sn_hpgj
+
+      ! cool-skin / warm-layer !LB
       !!---------------------------------------------------------------------
       !
       !                                      ! allocate sbc_blk_core array
-      IF( sbc_blk_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_blk : unable to allocate standard arrays' )
+      IF( sbc_blk_alloc()     /= 0 )   CALL ctl_stop( 'STOP', 'sbc_blk : unable to allocate standard arrays' )
+      !
+#if defined key_si3
+      IF( sbc_blk_ice_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_blk : unable to allocate standard ice arrays' )
+#endif
       !
       !                             !** read bulk namelist
@@ -215,4 +263,7 @@
          nblk =  np_ECMWF       ;   ioptio = ioptio + 1
       ENDIF
+      IF( ln_ANDREAS     ) THEN
+         nblk =  np_ANDREAS       ;   ioptio = ioptio + 1
+      ENDIF
       IF( ioptio /= 1 )   CALL ctl_stop( 'sbc_blk_init: Choose one and only one bulk algorithm' )
 
@@ -222,4 +273,6 @@
          IF( ln_NCAR )      &
             & CALL ctl_stop( 'sbc_blk_init: Cool-skin/warm-layer param. not compatible with NCAR algorithm' )
+         IF( ln_ANDREAS )      &
+            & CALL ctl_stop( 'sbc_blk_init: Cool-skin/warm-layer param. not compatible with ANDREAS algorithm' )
          IF( nn_fsbc /= 1 ) &
             & CALL ctl_stop( 'sbc_blk_init: Please set "nn_fsbc" to 1 when using cool-skin/warm-layer param.')
@@ -254,4 +307,23 @@
          ENDIF
       ENDIF
+
+#if defined key_si3
+      ioptio = 0
+      IF( ln_Cx_ice_cst ) THEN
+         nblk_ice =  np_ice_cst     ;   ioptio = ioptio + 1
+      ENDIF
+      IF( ln_Cx_ice_AN05 ) THEN
+         nblk_ice =  np_ice_an05   ;   ioptio = ioptio + 1
+      ENDIF
+      IF( ln_Cx_ice_LU12 ) THEN
+         nblk_ice =  np_ice_lu12    ;   ioptio = ioptio + 1
+      ENDIF
+      IF( ln_Cx_ice_LG15 ) THEN
+         nblk_ice =  np_ice_lg15   ;   ioptio = ioptio + 1
+      ENDIF
+      IF( ioptio /= 1 )   CALL ctl_stop( 'sbc_blk_init: Choose one and only one ice-atm bulk algorithm' )
+#endif
+
+
       !                                   !* set the bulk structure
       !                                      !- store namelist information in an array
@@ -322,8 +394,4 @@
       ENDIF
       !
-      ! set transfer coefficients to default sea-ice values
-      Cd_ice(:,:) = rCd_ice
-      Ch_ice(:,:) = rCd_ice
-      Ce_ice(:,:) = rCd_ice
       !
       IF(lwp) THEN                     !** Control print
@@ -331,8 +399,9 @@
          WRITE(numout,*)                  !* namelist
          WRITE(numout,*) '   Namelist namsbc_blk (other than data information):'
-         WRITE(numout,*) '      "NCAR"      algorithm   (Large and Yeager 2008)     ln_NCAR      = ', ln_NCAR
+         WRITE(numout,*) '      "NCAR"      algorithm   (Large and Yeager 2008)      ln_NCAR      = ', ln_NCAR
          WRITE(numout,*) '      "COARE 3.0" algorithm   (Fairall et al. 2003)       ln_COARE_3p0 = ', ln_COARE_3p0
-         WRITE(numout,*) '      "COARE 3.6" algorithm (Fairall 2018 + Edson al 2013)ln_COARE_3p6 = ', ln_COARE_3p6
-         WRITE(numout,*) '      "ECMWF"     algorithm   (IFS cycle 45r1)            ln_ECMWF     = ', ln_ECMWF
+         WRITE(numout,*) '      "COARE 3.6" algorithm (Fairall 2018 + Edson al 2013) ln_COARE_3p6 = ', ln_COARE_3p6
+         WRITE(numout,*) '      "ECMWF"     algorithm   (IFS cycle 45r1)             ln_ECMWF     = ', ln_ECMWF
+         WRITE(numout,*) '      "ANDREAS"   algorithm   (Andreas et al. 2015)       ln_ANDREAS   = ', ln_ANDREAS
          WRITE(numout,*) '      Air temperature and humidity reference height (m)   rn_zqt       = ', rn_zqt
          WRITE(numout,*) '      Wind vector reference height (m)                    rn_zu        = ', rn_zu
@@ -340,6 +409,4 @@
          WRITE(numout,*) '      factor applied on evaporation                       rn_efac      = ', rn_efac
          WRITE(numout,*) '         (form absolute (=0) to relative winds(=1))'
-         WRITE(numout,*) '      use ice-atm drag from Lupkes2012                    ln_Cd_L12    = ', ln_Cd_L12
-         WRITE(numout,*) '      use ice-atm drag from Lupkes2015                    ln_Cd_L15    = ', ln_Cd_L15
          WRITE(numout,*) '      use surface current feedback on wind stress         ln_crt_fbk   = ', ln_crt_fbk
          IF(ln_crt_fbk) THEN
@@ -355,4 +422,5 @@
          CASE( np_COARE_3p6 )   ;   WRITE(numout,*) '   ==>>>   "COARE 3.6" algorithm (Fairall 2018+Edson et al. 2013)'
          CASE( np_ECMWF     )   ;   WRITE(numout,*) '   ==>>>   "ECMWF" algorithm       (IFS cycle 45r1)'
+         CASE( np_ANDREAS   )   ;   WRITE(numout,*) '   ==>>>   "ANDREAS" algorithm (Andreas et al. 2015)'
          END SELECT
          !
@@ -367,4 +435,27 @@
          CASE( np_humi_rlh )   ;   WRITE(numout,*) '   ==>>>   air humidity is RELATIVE HUMIDITY     [%]'
          END SELECT
+         !
+         !#LB:
+#if defined key_si3
+         IF( nn_ice > 0 ) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '      use constant ice-atm bulk transfer coeff.           ln_Cx_ice_cst  = ', ln_Cx_ice_cst
+            WRITE(numout,*) '      use ice-atm bulk coeff. from Andreas et al., 2005   ln_Cx_ice_AN05 = ', ln_Cx_ice_AN05
+            WRITE(numout,*) '      use ice-atm bulk coeff. from Lupkes et al., 2012    ln_Cx_ice_LU12 = ', ln_Cx_ice_LU12
+            WRITE(numout,*) '      use ice-atm bulk coeff. from Lupkes & Gryanik, 2015 ln_Cx_ice_LG15 = ', ln_Cx_ice_LG15
+         ENDIF
+         WRITE(numout,*)
+         SELECT CASE( nblk_ice )              !* Print the choice of bulk algorithm
+         CASE( np_ice_cst  )
+            WRITE(numout,*) '   ==>>>   Constant bulk transfer coefficients over sea-ice:'
+            WRITE(numout,*) '      => Cd_ice, Ce_ice, Ch_ice =', REAL(rn_Cd_i,4), REAL(rn_Ce_i,4), REAL(rn_Ch_i,4)
+            IF( (rn_Cd_i<0._wp).OR.(rn_Cd_i>1.E-2_wp).OR.(rn_Ce_i<0._wp).OR.(rn_Ce_i>1.E-2_wp).OR.(rn_Ch_i<0._wp).OR.(rn_Ch_i>1.E-2_wp) ) &
+               & CALL ctl_stop( 'Be realistic in your pick of Cd_ice, Ce_ice & Ch_ice ! (0 < Cx < 1.E-2)')
+         CASE( np_ice_an05 )   ;   WRITE(numout,*) '   ==>>> bulk algo over ice: Andreas et al, 2005'
+         CASE( np_ice_lu12 )   ;   WRITE(numout,*) '   ==>>> bulk algo over ice: Lupkes et al, 2012'
+         CASE( np_ice_lg15 )   ;   WRITE(numout,*) '   ==>>> bulk algo over ice: Lupkes & Gryanik, 2015'
+         END SELECT
+#endif
+         !#LB.
          !
       ENDIF
@@ -409,5 +500,5 @@
       INTEGER, INTENT(in) ::   kt   ! ocean time step
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) ::   zssq, zcd_du, zsen, zevp
+      REAL(wp), DIMENSION(jpi,jpj) ::   zssq, zcd_du, zsen, zlat, zevp
       REAL(wp) :: ztmp
       !!----------------------------------------------------------------------
@@ -446,15 +537,41 @@
       !                                            ! compute the surface ocean fluxes using bulk formulea
       IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
+
+         ! Specific humidity of air at z=rn_zqt !
+         SELECT CASE( nhumi )
+         CASE( np_humi_sph )
+            q_air_zt(:,:) = sf(jp_humi )%fnow(:,:,1)      ! what we read in file is already a spec. humidity!
+         CASE( np_humi_dpt )
+            IF((kt==nit000).AND.lwp) WRITE(numout,*) ' *** sbc_blk() => computing q_air out of dew-point and P !'
+            q_air_zt(:,:) = q_sat( sf(jp_humi )%fnow(:,:,1), sf(jp_slp  )%fnow(:,:,1) )
+         CASE( np_humi_rlh )
+            IF((kt==nit000).AND.lwp) WRITE(numout,*) ' *** sbc_blk() => computing q_air out of RH, t_air and slp !' !LBrm
+            q_air_zt(:,:) = q_air_rh( 0.01_wp*sf(jp_humi )%fnow(:,:,1), &
+               &                      sf(jp_tair )%fnow(:,:,1), sf(jp_slp  )%fnow(:,:,1) ) !#LB: 0.01 => RH is % percent in file
+         END SELECT
+
+         ! POTENTIAL temperature of air at z=rn_zqt
+         !      based on adiabatic lapse-rate (see Josey, Gulev & Yu, 2013) / doi=10.1016/B978-0-12-391851-2.00005-2
+         !      (most reanalysis products provide absolute temp., not potential temp.)
+         IF( ln_tair_pot ) THEN
+            ! temperature read into file is already potential temperature, do nothing...
+            theta_air_zt(:,:) = sf(jp_tair )%fnow(:,:,1)
+         ELSE
+            ! temperature read into file is ABSOLUTE temperature (that's the case for ECMWF products for example...)
+            IF((kt==nit000).AND.lwp) WRITE(numout,*) ' *** sbc_blk() => air temperature converted from ABSOLUTE to POTENTIAL!'
+            theta_air_zt(:,:) = sf(jp_tair )%fnow(:,:,1) + gamma_moist( sf(jp_tair )%fnow(:,:,1), q_air_zt(:,:) ) * rn_zqt
+         ENDIF
+         !
          CALL blk_oce_1( kt, sf(jp_wndi )%fnow(:,:,1), sf(jp_wndj )%fnow(:,:,1),   &   !   <<= in
-            &                sf(jp_tair )%fnow(:,:,1), sf(jp_humi )%fnow(:,:,1),   &   !   <<= in
+            &                theta_air_zt(:,:), q_air_zt(:,:),                     &   !   <<= in
             &                sf(jp_slp  )%fnow(:,:,1), sst_m, ssu_m, ssv_m,        &   !   <<= in
             &                sf(jp_uoatm)%fnow(:,:,1), sf(jp_voatm)%fnow(:,:,1),   &   !   <<= in
             &                sf(jp_qsr  )%fnow(:,:,1), sf(jp_qlw  )%fnow(:,:,1),   &   !   <<= in (wl/cs)
-            &                tsk_m, zssq, zcd_du, zsen, zevp )                         !   =>> out
-
-         CALL blk_oce_2(     sf(jp_tair )%fnow(:,:,1), sf(jp_qsr  )%fnow(:,:,1),   &   !   <<= in
+            &                tsk_m, zssq, zcd_du, zsen, zlat, zevp )                   !   =>> out
+
+         CALL blk_oce_2(     theta_air_zt(:,:),                                    &   !   <<= in
             &                sf(jp_qlw  )%fnow(:,:,1), sf(jp_prec )%fnow(:,:,1),   &   !   <<= in
             &                sf(jp_snow )%fnow(:,:,1), tsk_m,                      &   !   <<= in
-            &                zsen, zevp )                                              !   <=> in out
+            &                zsen, zlat, zevp )                                        !   <=> in out
       ENDIF
       !
@@ -467,14 +584,8 @@
             qsr_ice(:,:,1) =          sf(jp_qsr)%fnow(:,:,1)
          ENDIF
-         tatm_ice(:,:)    = sf(jp_tair)%fnow(:,:,1)
-
-         SELECT CASE( nhumi )
-         CASE( np_humi_sph )
-            qatm_ice(:,:) =           sf(jp_humi)%fnow(:,:,1)
-         CASE( np_humi_dpt )
-            qatm_ice(:,:) = q_sat(    sf(jp_humi)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1) )
-         CASE( np_humi_rlh )
-            qatm_ice(:,:) = q_air_rh( 0.01_wp*sf(jp_humi)%fnow(:,:,1), sf(jp_tair)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1)) !LB: 0.01 => RH is % percent in file
-         END SELECT
+         tatm_ice(:,:) = sf(jp_tair)%fnow(:,:,1)    !#LB: should it be POTENTIAL temperature instead ????
+         !tatm_ice(:,:) = theta_air_zt(:,:)         !#LB: THIS! ?
+
+         qatm_ice(:,:) = q_air_zt(:,:) !#LB:
 
          tprecip(:,:)     = sf(jp_prec)%fnow(:,:,1) * rn_pfac
@@ -488,8 +599,8 @@
 
 
-   SUBROUTINE blk_oce_1( kt, pwndi, pwndj, ptair, phumi,         &  ! inp
+   SUBROUTINE blk_oce_1( kt, pwndi, pwndj, ptair, pqair,         &  ! inp
       &                      pslp , pst  , pu   , pv,            &  ! inp
-      &                      puatm, pvatm, pqsr , pqlw ,         &  ! inp
-      &                      ptsk , pssq , pcd_du, psen, pevp   )   ! out
+      &                      puatm, pvatm, pdqsr , pdqlw ,       &  ! inp
+      &                      ptsk , pssq , pcd_du, psen, plat, pevp ) ! out
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE blk_oce_1  ***
@@ -504,11 +615,12 @@
       !! ** Outputs : - pssq    : surface humidity used to compute latent heat flux (kg/kg)
       !!              - pcd_du  : Cd x |dU| at T-points  (m/s)
-      !!              - psen    : Ch x |dU| at T-points  (m/s)
-      !!              - pevp    : Ce x |dU| at T-points  (m/s)
+      !!              - psen    : sensible heat flux (W/m^2)
+      !!              - plat    : latent heat flux   (W/m^2)
+      !!              - pevp    : evaporation        (mm/s) #lolo
       !!---------------------------------------------------------------------
       INTEGER , INTENT(in   )                 ::   kt     ! time step index
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pwndi  ! atmospheric wind at U-point              [m/s]
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pwndj  ! atmospheric wind at V-point              [m/s]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   phumi  ! specific humidity at T-points            [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pqair  ! specific humidity at T-points            [kg/kg]
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   ptair  ! potential temperature at T-points        [Kelvin]
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pslp   ! sea-level pressure                       [Pa]
@@ -518,11 +630,12 @@
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   puatm  ! surface current seen by the atm at T-point (i-component) [m/s]
       REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pvatm  ! surface current seen by the atm at T-point (j-component) [m/s]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pqsr   !
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pqlw   !
+      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pdqsr  ! downwelling solar (shortwave) radiation at surface [W/m^2]
+      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pdqlw  ! downwelling longwave radiation at surface [W/m^2]
       REAL(wp), INTENT(  out), DIMENSION(:,:) ::   ptsk   ! skin temp. (or SST if CS & WL not used)  [Celsius]
       REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pssq   ! specific humidity at pst                 [kg/kg]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pcd_du ! Cd x |dU| at T-points                    [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   psen   ! Ch x |dU| at T-points                    [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pevp   ! Ce x |dU| at T-points                    [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pcd_du
+      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   psen
+      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   plat
+      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pevp
       !
       INTEGER  ::   ji, jj               ! dummy loop indices
@@ -534,10 +647,7 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   ztau_i, ztau_j    ! wind stress components at T-point
       REAL(wp), DIMENSION(jpi,jpj) ::   zU_zu             ! bulk wind speed at height zu  [m/s]
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztpot             ! potential temperature of air at z=rn_zqt [K]
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqair             ! specific humidity     of air at z=rn_zqt [kg/kg]
       REAL(wp), DIMENSION(jpi,jpj) ::   zcd_oce           ! momentum transfert coefficient over ocean
       REAL(wp), DIMENSION(jpi,jpj) ::   zch_oce           ! sensible heat transfert coefficient over ocean
       REAL(wp), DIMENSION(jpi,jpj) ::   zce_oce           ! latent   heat transfert coefficient over ocean
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqla              ! latent heat flux
       REAL(wp), DIMENSION(jpi,jpj) ::   zztmp1, zztmp2
       !!---------------------------------------------------------------------
@@ -578,7 +688,7 @@
       zztmp = 1. - albo
       IF( ln_dm2dc ) THEN
-         qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1)
+         qsr(:,:) = zztmp * sbc_dcy( pdqsr(:,:) ) * tmask(:,:,1)
       ELSE
-         qsr(:,:) = zztmp *          sf(jp_qsr)%fnow(:,:,1)   * tmask(:,:,1)
+         qsr(:,:) = zztmp *          pdqsr(:,:)   * tmask(:,:,1)
       ENDIF
 
@@ -597,34 +707,4 @@
       ENDIF
 
-      ! specific humidity of air at "rn_zqt" m above the sea
-      SELECT CASE( nhumi )
-      CASE( np_humi_sph )
-         zqair(:,:) = phumi(:,:)      ! what we read in file is already a spec. humidity!
-      CASE( np_humi_dpt )
-         !IF(lwp) WRITE(numout,*) ' *** blk_oce => computing q_air out of d_air and slp !' !LBrm
-         zqair(:,:) = q_sat( phumi(:,:), pslp(:,:) )
-      CASE( np_humi_rlh )
-         !IF(lwp) WRITE(numout,*) ' *** blk_oce => computing q_air out of RH, t_air and slp !' !LBrm
-         zqair(:,:) = q_air_rh( 0.01_wp*phumi(:,:), ptair(:,:), pslp(:,:) ) !LB: 0.01 => RH is % percent in file
-      END SELECT
-      !
-      ! potential temperature of air at "rn_zqt" m above the sea
-      IF( ln_abl ) THEN
-         ztpot = ptair(:,:)
-      ELSE
-         ! Estimate of potential temperature at z=rn_zqt, based on adiabatic lapse-rate
-         !    (see Josey, Gulev & Yu, 2013) / doi=10.1016/B978-0-12-391851-2.00005-2
-         !    (since reanalysis products provide T at z, not theta !)
-         !#LB: because AGRIF hates functions that return something else than a scalar, need to
-         !     use scalar version of gamma_moist() ...
-         IF( ln_tpot ) THEN
-            DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-               ztpot(ji,jj) = ptair(ji,jj) + gamma_moist( ptair(ji,jj), zqair(ji,jj) ) * rn_zqt
-            END_2D
-         ELSE
-            ztpot = ptair(:,:)
-         ENDIF
-      ENDIF
-
       !! Time to call the user-selected bulk parameterization for
       !!  ==  transfer coefficients  ==!   Cd, Ch, Ce at T-point, and more...
@@ -632,38 +712,50 @@
 
       CASE( np_NCAR      )
-         CALL turb_ncar    ( rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm,                              &
-            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce )
-
+         CALL turb_ncar    (     rn_zqt, rn_zu, ptsk, ptair, pssq, pqair, wndm, &
+            &                zcd_oce, zch_oce, zce_oce, theta_zu, q_zu, zU_zu , &
+            &                nb_iter=nn_iter_algo )
+         !
       CASE( np_COARE_3p0 )
-         CALL turb_coare3p0 ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, &
-            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   &
-            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) )
-
+         CALL turb_coare3p0( kt, rn_zqt, rn_zu, ptsk, ptair, pssq, pqair, wndm, &
+            &                ln_skin_cs, ln_skin_wl,                            &
+            &                zcd_oce, zch_oce, zce_oce, theta_zu, q_zu, zU_zu,  &
+            &                nb_iter=nn_iter_algo,                              &
+            &                Qsw=qsr(:,:), rad_lw=pdqlw(:,:), slp=pslp(:,:) )
+         !
       CASE( np_COARE_3p6 )
-         CALL turb_coare3p6 ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl, &
-            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   &
-            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) )
-
+         CALL turb_coare3p6( kt, rn_zqt, rn_zu, ptsk, ptair, pssq, pqair, wndm, &
+            &                ln_skin_cs, ln_skin_wl,                            &
+            &                zcd_oce, zch_oce, zce_oce, theta_zu, q_zu, zU_zu,  &
+            &                nb_iter=nn_iter_algo,                              &
+            &                Qsw=qsr(:,:), rad_lw=pdqlw(:,:), slp=pslp(:,:) )
+         !
       CASE( np_ECMWF     )
-         CALL turb_ecmwf   ( kt, rn_zqt, rn_zu, ptsk, ztpot, pssq, zqair, wndm, ln_skin_cs, ln_skin_wl,  &
-            &                zcd_oce, zch_oce, zce_oce, t_zu, q_zu, zU_zu, cdn_oce, chn_oce, cen_oce,   &
-            &                Qsw=qsr(:,:), rad_lw=pqlw(:,:), slp=pslp(:,:) )
-
+         CALL turb_ecmwf   ( kt, rn_zqt, rn_zu, ptsk, ptair, pssq, pqair, wndm, &
+            &                ln_skin_cs, ln_skin_wl,                            &
+            &                zcd_oce, zch_oce, zce_oce, theta_zu, q_zu, zU_zu,  &
+            &                nb_iter=nn_iter_algo,                              &
+            &                Qsw=qsr(:,:), rad_lw=pdqlw(:,:), slp=pslp(:,:) )
+         !
+      CASE( np_ANDREAS   )
+         CALL turb_andreas (     rn_zqt, rn_zu, ptsk, ptair, pssq, pqair, wndm, &
+            &                zcd_oce, zch_oce, zce_oce, theta_zu, q_zu, zU_zu , &
+            &                nb_iter=nn_iter_algo   )
+         !
       CASE DEFAULT
-         CALL ctl_stop( 'STOP', 'sbc_oce: non-existing bulk formula selected' )
-
+         CALL ctl_stop( 'STOP', 'sbc_oce: non-existing bulk parameterizaton selected' )
+         !
       END SELECT
-      
+
       IF( iom_use('Cd_oce') )   CALL iom_put("Cd_oce",   zcd_oce * tmask(:,:,1))
       IF( iom_use('Ce_oce') )   CALL iom_put("Ce_oce",   zce_oce * tmask(:,:,1))
       IF( iom_use('Ch_oce') )   CALL iom_put("Ch_oce",   zch_oce * tmask(:,:,1))
       !! LB: mainly here for debugging purpose:
-      IF( iom_use('theta_zt') ) CALL iom_put("theta_zt", (ztpot-rt0) * tmask(:,:,1)) ! potential temperature at z=zt
-      IF( iom_use('q_zt') )     CALL iom_put("q_zt",     zqair       * tmask(:,:,1)) ! specific humidity       "
-      IF( iom_use('theta_zu') ) CALL iom_put("theta_zu", (t_zu -rt0) * tmask(:,:,1)) ! potential temperature at z=zu
+      IF( iom_use('theta_zt') ) CALL iom_put("theta_zt", (ptair-rt0) * tmask(:,:,1)) ! potential temperature at z=zt
+      IF( iom_use('q_zt') )     CALL iom_put("q_zt",     pqair       * tmask(:,:,1)) ! specific humidity       "
+      IF( iom_use('theta_zu') ) CALL iom_put("theta_zu", (theta_zu -rt0) * tmask(:,:,1)) ! potential temperature at z=zu
       IF( iom_use('q_zu') )     CALL iom_put("q_zu",     q_zu        * tmask(:,:,1)) ! specific humidity       "
       IF( iom_use('ssq') )      CALL iom_put("ssq",      pssq        * tmask(:,:,1)) ! saturation specific humidity at z=0
       IF( iom_use('wspd_blk') ) CALL iom_put("wspd_blk", zU_zu       * tmask(:,:,1)) ! bulk wind speed at z=zu
-      
+
       IF( ln_skin_cs .OR. ln_skin_wl ) THEN
          !! ptsk and pssq have been updated!!!
@@ -677,5 +769,5 @@
       END IF
 
-      !  Turbulent fluxes over ocean  => BULK_FORMULA @ sbcblk_phy.F90
+      !  Turbulent fluxes over ocean  => BULK_FORMULA @ sbc_phy.F90
       ! -------------------------------------------------------------
 
@@ -687,32 +779,32 @@
             psen(ji,jj)   = zztmp * zch_oce(ji,jj)
             pevp(ji,jj)   = zztmp * zce_oce(ji,jj)
-            rhoa(ji,jj)   = rho_air( ptair(ji,jj), phumi(ji,jj), pslp(ji,jj) )
+            rhoa(ji,jj)   = rho_air( ptair(ji,jj), pqair(ji,jj), pslp(ji,jj) )
          END_2D
       ELSE                      !==  BLK formulation  ==!   turbulent fluxes computation
-         CALL BULK_FORMULA( rn_zu, ptsk(:,:), pssq(:,:), t_zu(:,:), q_zu(:,:), &
+         CALL BULK_FORMULA( rn_zu, ptsk(:,:), pssq(:,:), theta_zu(:,:), q_zu(:,:), &
             &               zcd_oce(:,:), zch_oce(:,:), zce_oce(:,:),          &
             &               wndm(:,:), zU_zu(:,:), pslp(:,:),                  &
-            &               taum(:,:), psen(:,:), zqla(:,:),                   &
+            &               taum(:,:), psen(:,:), plat(:,:),                   &
             &               pEvap=pevp(:,:), prhoa=rhoa(:,:), pfact_evap=rn_efac )
 
-         zqla(:,:) = zqla(:,:) * tmask(:,:,1)
          psen(:,:) = psen(:,:) * tmask(:,:,1)
+         plat(:,:) = plat(:,:) * tmask(:,:,1)
          taum(:,:) = taum(:,:) * tmask(:,:,1)
          pevp(:,:) = pevp(:,:) * tmask(:,:,1)
 
          DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-            IF( wndm(ji,jj) > 0._wp ) THEN
-               zztmp = taum(ji,jj) / wndm(ji,jj)
+         IF( wndm(ji,jj) > 0._wp ) THEN
+            zztmp = taum(ji,jj) / wndm(ji,jj)
 #if defined key_cyclone
-               ztau_i(ji,jj) = zztmp * zwnd_i(ji,jj)
-               ztau_j(ji,jj) = zztmp * zwnd_j(ji,jj)
+            ztau_i(ji,jj) = zztmp * zwnd_i(ji,jj)
+            ztau_j(ji,jj) = zztmp * zwnd_j(ji,jj)
 #else
-               ztau_i(ji,jj) = zztmp * pwndi(ji,jj)
-               ztau_j(ji,jj) = zztmp * pwndj(ji,jj)
-#endif
-            ELSE
-               ztau_i(ji,jj) = 0._wp
-               ztau_j(ji,jj) = 0._wp                 
-            ENDIF
+            ztau_i(ji,jj) = zztmp * pwndi(ji,jj)
+            ztau_j(ji,jj) = zztmp * pwndj(ji,jj)
+#endif
+         ELSE
+            ztau_i(ji,jj) = 0._wp
+            ztau_j(ji,jj) = 0._wp
+         ENDIF
          END_2D
 
@@ -743,32 +835,32 @@
          ENDIF
 
-         CALL iom_put( "taum_oce", taum )   ! output wind stress module
+         ! Saving open-ocean wind-stress (module and components) on T-points:
+         CALL iom_put( "taum_oce",   taum(:,:)*tmask(:,:,1) )   ! output wind stress module
+         !#LB: These 2 lines below mostly here for 'STATION_ASF' test-case, otherwize "utau" (U-grid) and vtau" (V-grid) does the job in: [DYN/dynatf.F90])
+         CALL iom_put( "utau_oce", ztau_i(:,:)*tmask(:,:,1) )  ! utau at T-points!
+         CALL iom_put( "vtau_oce", ztau_j(:,:)*tmask(:,:,1) )  ! vtau at T-points!
 
          IF(sn_cfctl%l_prtctl) THEN
-            CALL prt_ctl( tab2d_1=wndm  , clinfo1=' blk_oce_1: wndm   : ')
-            CALL prt_ctl( tab2d_1=utau  , clinfo1=' blk_oce_1: utau   : ', mask1=umask,   &
-               &          tab2d_2=vtau  , clinfo2='            vtau   : ', mask2=vmask )
+            CALL prt_ctl( tab2d_1=pssq   , clinfo1=' blk_oce_1: pssq   : ')
+            CALL prt_ctl( tab2d_1=wndm   , clinfo1=' blk_oce_1: wndm   : ')
+            CALL prt_ctl( tab2d_1=utau   , clinfo1=' blk_oce_1: utau   : ', mask1=umask,   &
+               &          tab2d_2=vtau   , clinfo2='            vtau   : ', mask2=vmask )
+            CALL prt_ctl( tab2d_1=zcd_oce, clinfo1=' blk_oce_1: Cd     : ')
          ENDIF
          !
       ENDIF !IF( ln_abl )
-      
+
       ptsk(:,:) = ( ptsk(:,:) - rt0 ) * tmask(:,:,1)  ! Back to Celsius
-            
+
       IF( ln_skin_cs .OR. ln_skin_wl ) THEN
          CALL iom_put( "t_skin" ,  ptsk        )  ! T_skin in Celsius
          CALL iom_put( "dt_skin" , ptsk - pst  )  ! T_skin - SST temperature difference...
       ENDIF
-
-      IF(sn_cfctl%l_prtctl) THEN
-         CALL prt_ctl( tab2d_1=pevp  , clinfo1=' blk_oce_1: pevp   : ' )
-         CALL prt_ctl( tab2d_1=psen  , clinfo1=' blk_oce_1: psen   : ' )
-         CALL prt_ctl( tab2d_1=pssq  , clinfo1=' blk_oce_1: pssq   : ' )
-      ENDIF
       !
    END SUBROUTINE blk_oce_1
 
 
-   SUBROUTINE blk_oce_2( ptair, pqsr, pqlw, pprec,   &   ! <<= in
-      &                  psnow, ptsk, psen, pevp     )   ! <<= in
+   SUBROUTINE blk_oce_2( ptair, pdqlw, pprec, psnow, &   ! <<= in
+      &                   ptsk, psen, plat, pevp     )   ! <<= in
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE blk_oce_2  ***
@@ -786,46 +878,26 @@
       !!              - emp     : evaporation minus precipitation       (kg/m2/s)
       !!---------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptair
-      REAL(wp), INTENT(in), DIMENSION(:,:) ::   pqsr
-      REAL(wp), INTENT(in), DIMENSION(:,:) ::   pqlw
+      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptair   ! potential temperature of air #LB: confirm!
+      REAL(wp), INTENT(in), DIMENSION(:,:) ::   pdqlw   ! downwelling longwave radiation at surface [W/m^2]
       REAL(wp), INTENT(in), DIMENSION(:,:) ::   pprec
       REAL(wp), INTENT(in), DIMENSION(:,:) ::   psnow
       REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptsk   ! SKIN surface temperature   [Celsius]
       REAL(wp), INTENT(in), DIMENSION(:,:) ::   psen
+      REAL(wp), INTENT(in), DIMENSION(:,:) ::   plat
       REAL(wp), INTENT(in), DIMENSION(:,:) ::   pevp
       !
       INTEGER  ::   ji, jj               ! dummy loop indices
       REAL(wp) ::   zztmp,zz1,zz2,zz3    ! local variable
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztskk             ! skin temp. in Kelvin 
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw              ! long wave and sensible heat fluxes      
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqla              ! latent heat fluxes and evaporation
+      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw              ! net long wave radiative heat flux
       !!---------------------------------------------------------------------
       !
       ! local scalars ( place there for vector optimisation purposes)
 
-
-      ztskk(:,:) = ptsk(:,:) + rt0  ! => ptsk in Kelvin rather than Celsius
-      
       ! ----------------------------------------------------------------------------- !
       !     III    Net longwave radiative FLUX                                        !
       ! ----------------------------------------------------------------------------- !
-
-      !! LB: now moved after Turbulent fluxes because must use the skin temperature rather that the SST
-      !! (ztskk is skin temperature if ln_skin_cs==.TRUE. .OR. ln_skin_wl==.TRUE.)
-      zqlw(:,:) = emiss_w * ( pqlw(:,:) - stefan*ztskk(:,:)*ztskk(:,:)*ztskk(:,:)*ztskk(:,:) ) * tmask(:,:,1)   ! Net radiative longwave flux
-
-      !  Latent flux over ocean
-      ! -----------------------
-
-      ! use scalar version of L_vap() for AGRIF compatibility
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         zqla(ji,jj) = - L_vap( ztskk(ji,jj) ) * pevp(ji,jj)    ! Latent Heat flux !!GS: possibility to add a global qla to avoid recomputation after abl update
-      END_2D
-
-      IF(sn_cfctl%l_prtctl) THEN
-         CALL prt_ctl( tab2d_1=zqla  , clinfo1=' blk_oce_2: zqla   : ' )
-         CALL prt_ctl( tab2d_1=zqlw  , clinfo1=' blk_oce_2: zqlw   : ', tab2d_2=qsr, clinfo2=' qsr : ' )
-
-      ENDIF
+      !! #LB: now moved after Turbulent fluxes because must use the skin temperature rather than bulk SST
+      !! (ptsk is skin temperature if ln_skin_cs==.TRUE. .OR. ln_skin_wl==.TRUE.)
+      zqlw(:,:) = qlw_net( pdqlw(:,:), ptsk(:,:)+rt0 )
 
       ! ----------------------------------------------------------------------------- !
@@ -836,5 +908,5 @@
          &         - pprec(:,:) * rn_pfac  ) * tmask(:,:,1)
       !
-      qns(:,:) = zqlw(:,:) + psen(:,:) + zqla(:,:)                   &   ! Downward Non Solar
+      qns(:,:) = zqlw(:,:) + psen(:,:) + plat(:,:)                   &   ! Downward Non Solar
          &     - psnow(:,:) * rn_pfac * rLfus                        &   ! remove latent melting heat for solid precip
          &     - pevp(:,:) * ptsk(:,:) * rcp                         &   ! remove evap heat content at SST
@@ -846,5 +918,5 @@
       !
 #if defined key_si3
-      qns_oce(:,:) = zqlw(:,:) + psen(:,:) + zqla(:,:)                             ! non solar without emp (only needed by SI3)
+      qns_oce(:,:) = zqlw(:,:) + psen(:,:) + plat(:,:)                             ! non solar without emp (only needed by SI3)
       qsr_oce(:,:) = qsr(:,:)
 #endif
@@ -854,5 +926,5 @@
       CALL iom_put( "qlw_oce"  , zqlw )                    ! output downward longwave heat over the ocean
       CALL iom_put( "qsb_oce"  , psen )                    ! output downward sensible heat over the ocean
-      CALL iom_put( "qla_oce"  , zqla )                    ! output downward latent   heat over the ocean
+      CALL iom_put( "qla_oce"  , plat )                    ! output downward latent   heat over the ocean
       tprecip(:,:) = pprec(:,:) * rn_pfac * tmask(:,:,1)   ! output total precipitation [kg/m2/s]
       sprecip(:,:) = psnow(:,:) * rn_pfac * tmask(:,:,1)   ! output solid precipitation [kg/m2/s]
@@ -861,5 +933,5 @@
       !
       IF ( nn_ice == 0 ) THEN
-         CALL iom_put( "qemp_oce" , qns-zqlw-psen-zqla )   ! output downward heat content of E-P over the ocean
+         CALL iom_put( "qemp_oce" , qns-zqlw-psen-plat )   ! output downward heat content of E-P over the ocean
          CALL iom_put( "qns_oce"  ,   qns  )               ! output downward non solar heat over the ocean
          CALL iom_put( "qsr_oce"  ,   qsr  )               ! output downward solar heat over the ocean
@@ -869,5 +941,7 @@
       IF(sn_cfctl%l_prtctl) THEN
          CALL prt_ctl(tab2d_1=zqlw , clinfo1=' blk_oce_2: zqlw  : ')
-         CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce_2: zqla  : ', tab2d_2=qsr  , clinfo2=' qsr   : ')
+         CALL prt_ctl(tab2d_1=psen , clinfo1=' blk_oce_2: psen  : ' )
+         CALL prt_ctl(tab2d_1=plat , clinfo1=' blk_oce_2: plat  : ' )
+         CALL prt_ctl(tab2d_1=qns  , clinfo1=' blk_oce_2: qns   : ' )
          CALL prt_ctl(tab2d_1=emp  , clinfo1=' blk_oce_2: emp   : ')
       ENDIF
@@ -883,9 +957,7 @@
    !!   blk_ice_2   : provide the heat and mass fluxes at air-ice interface
    !!   blk_ice_qcn : provide ice surface temperature and snow/ice conduction flux (emulating conduction flux)
-   !!   Cdn10_Lupkes2012 : Lupkes et al. (2012) air-ice drag
-   !!   Cdn10_Lupkes2015 : Lupkes et al. (2015) air-ice drag
    !!----------------------------------------------------------------------
 
-   SUBROUTINE blk_ice_1( pwndi, pwndj, ptair, phumi, pslp , puice, pvice, ptsui,  &   ! inputs
+   SUBROUTINE blk_ice_1( pwndi, pwndj, ptair, pqair, pslp , puice, pvice, ptsui,  &   ! inputs
       &                  putaui, pvtaui, pseni, pevpi, pssqi, pcd_dui             )   ! optional outputs
       !!---------------------------------------------------------------------
@@ -902,5 +974,5 @@
       REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   pwndj   ! atmospheric wind at T-point [m/s]
       REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   ptair   ! atmospheric wind at T-point [m/s]
-      REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   phumi   ! atmospheric wind at T-point [m/s]
+      REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   pqair   ! atmospheric wind at T-point [m/s]
       REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   puice   ! sea-ice velocity on I or C grid [m/s]
       REAL(wp) , INTENT(in   ), DIMENSION(:,:  ) ::   pvice   ! "
@@ -915,9 +987,10 @@
       INTEGER  ::   ji, jj    ! dummy loop indices
       REAL(wp) ::   zootm_su                      ! sea-ice surface mean temperature
-      REAL(wp) ::   zztmp1, zztmp2                ! temporary arrays
-      REAL(wp), DIMENSION(jpi,jpj) ::   zcd_dui   ! transfer coefficient for momentum      (tau)
-      !!---------------------------------------------------------------------
-      !
-
+      REAL(wp) ::   zztmp1, zztmp2                ! temporary scalars
+      REAL(wp), DIMENSION(jpi,jpj) :: ztmp        ! temporary array
+      !!---------------------------------------------------------------------
+      !
+      ! LB: ptsui is in K !!!
+      !
       ! ------------------------------------------------------------ !
       !    Wind module relative to the moving ice ( U10m - U_ice )   !
@@ -925,23 +998,45 @@
       ! C-grid ice dynamics :   U & V-points (same as ocean)
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         wndm_ice(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) )
+      wndm_ice(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) )
       END_2D
       !
       ! Make ice-atm. drag dependent on ice concentration
-      IF    ( ln_Cd_L12 ) THEN   ! calculate new drag from Lupkes(2012) equations
-         CALL Cdn10_Lupkes2012( Cd_ice )
-         Ch_ice(:,:) = Cd_ice(:,:)       ! momentum and heat transfer coef. are considered identical
-         Ce_ice(:,:) = Cd_ice(:,:)
-      ELSEIF( ln_Cd_L15 ) THEN   ! calculate new drag from Lupkes(2015) equations
-         CALL Cdn10_Lupkes2015( ptsui, pslp, Cd_ice, Ch_ice )
-         Ce_ice(:,:) = Ch_ice(:,:)       ! sensible and latent heat transfer coef. are considered identical
-      ENDIF
-      
-      IF( iom_use('Cd_ice') ) CALL iom_put("Cd_ice", Cd_ice)
-      IF( iom_use('Ce_ice') ) CALL iom_put("Ce_ice", Ce_ice)
-      IF( iom_use('Ch_ice') ) CALL iom_put("Ch_ice", Ch_ice)
-      
-      ! local scalars ( place there for vector optimisation purposes)
-      zcd_dui(:,:) = wndm_ice(:,:) * Cd_ice(:,:)
+
+
+      SELECT CASE( nblk_ice )
+
+      CASE( np_ice_cst      )
+         ! Constant bulk transfer coefficients over sea-ice:
+         Cd_ice(:,:) = rn_Cd_i
+         Ch_ice(:,:) = rn_Ch_i
+         Ce_ice(:,:) = rn_Ce_i
+         ! no height adjustment, keeping zt values:
+         theta_zu_i(:,:) = ptair(:,:)
+         q_zu_i(:,:)     = pqair(:,:)
+
+      CASE( np_ice_an05 )  ! calculate new drag from Lupkes(2015) equations
+         ztmp(:,:) = q_sat( ptsui(:,:), pslp(:,:), l_ice=.TRUE. ) ! temporary array for SSQ
+         CALL turb_ice_an05( rn_zqt, rn_zu, ptsui, ptair, ztmp, pqair, wndm_ice,       &
+            &                      Cd_ice, Ch_ice, Ce_ice, theta_zu_i, q_zu_i )
+         !!
+      CASE( np_ice_lu12 )
+         ztmp(:,:) = q_sat( ptsui(:,:), pslp(:,:), l_ice=.TRUE. ) ! temporary array for SSQ
+         CALL turb_ice_lu12( rn_zqt, rn_zu, ptsui, ptair, ztmp, pqair, wndm_ice, fr_i, &
+            &                      Cd_ice, Ch_ice, Ce_ice, theta_zu_i, q_zu_i )
+         !!
+      CASE( np_ice_lg15 )  ! calculate new drag from Lupkes(2015) equations
+         ztmp(:,:) = q_sat( ptsui(:,:), pslp(:,:), l_ice=.TRUE. ) ! temporary array for SSQ
+         CALL turb_ice_lg15( rn_zqt, rn_zu, ptsui, ptair, ztmp, pqair, wndm_ice, fr_i, &
+            &                      Cd_ice, Ch_ice, Ce_ice, theta_zu_i, q_zu_i )
+         !!
+      END SELECT
+
+      IF( iom_use('Cd_ice').OR.iom_use('Ce_ice').OR.iom_use('Ch_ice').OR.iom_use('taum_ice').OR.iom_use('utau_ice').OR.iom_use('vtau_ice') ) &
+         & ztmp(:,:) = ( 1._wp - MAX(0._wp, SIGN( 1._wp, 1.E-6_wp - fr_i )) )*tmask(:,:,1) ! mask for presence of ice !
+
+      IF( iom_use('Cd_ice') ) CALL iom_put("Cd_ice", Cd_ice*ztmp)
+      IF( iom_use('Ce_ice') ) CALL iom_put("Ce_ice", Ce_ice*ztmp)
+      IF( iom_use('Ch_ice') ) CALL iom_put("Ch_ice", Ch_ice*ztmp)
+
 
       IF( ln_blk ) THEN
@@ -950,11 +1045,20 @@
          ! ---------------------------------------------------- !
          ! supress moving ice in wind stress computation as we don't know how to do it properly...
-         DO_2D( 0, 1, 0, 1 )    ! at T point 
-            putaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndi(ji,jj)
-            pvtaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndj(ji,jj)
+         DO_2D( 0, 1, 0, 1 )    ! at T point
+            zztmp1        = rhoa(ji,jj) * Cd_ice(ji,jj) * wndm_ice(ji,jj)
+            putaui(ji,jj) =  zztmp1 * pwndi(ji,jj)
+            pvtaui(ji,jj) =  zztmp1 * pwndj(ji,jj)
          END_2D
+
+         !#LB: saving the module, and x-y components, of the ai wind-stress at T-points: NOT weighted by the ice concentration !!!
+         IF(iom_use('taum_ice')) CALL iom_put('taum_ice', SQRT( putaui*putaui + pvtaui*pvtaui )*ztmp )
+         !#LB: These 2 lines below mostly here for 'STATION_ASF' test-case, otherwize "utau_oi" (U-grid) and vtau_oi" (V-grid) does the job in: [ICE/icedyn_rhg_evp.F90])
+         IF(iom_use('utau_ice')) CALL iom_put("utau_ice", putaui*ztmp)  ! utau at T-points!
+         IF(iom_use('vtau_ice')) CALL iom_put("vtau_ice", pvtaui*ztmp)  ! vtau at T-points!
+
          !
          DO_2D( 0, 0, 0, 0 )    ! U & V-points (same as ocean).
-            ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology 
+            !#LB: QUESTION?? so SI3 expects wind stress vector to be provided at U & V points? Not at T-points ?
+            ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology
             zztmp1 = 0.5_wp * ( 2. - umask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji+1,jj  ,1) )
             zztmp2 = 0.5_wp * ( 2. - vmask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji  ,jj+1,1) )
@@ -967,14 +1071,13 @@
             &                               , tab2d_2=pvtaui  , clinfo2='          pvtaui : ' )
       ELSE ! ln_abl
-         zztmp1 = 11637800.0_wp
-         zztmp2 =    -5897.8_wp
          DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-            pcd_dui(ji,jj) = zcd_dui (ji,jj)
-            pseni  (ji,jj) = wndm_ice(ji,jj) * Ch_ice(ji,jj)
-            pevpi  (ji,jj) = wndm_ice(ji,jj) * Ce_ice(ji,jj)
-            zootm_su       = zztmp2 / ptsui(ji,jj)   ! ptsui is in K (it can't be zero ??)
-            pssqi  (ji,jj) = zztmp1 * EXP( zootm_su ) / rhoa(ji,jj)
+         pcd_dui(ji,jj) = wndm_ice(ji,jj) * Cd_ice(ji,jj)
+         pseni  (ji,jj) = wndm_ice(ji,jj) * Ch_ice(ji,jj)
+         pevpi  (ji,jj) = wndm_ice(ji,jj) * Ce_ice(ji,jj)
          END_2D
-      ENDIF
+         !#LB:
+         pssqi(:,:) = q_sat( ptsui(:,:), pslp(:,:), l_ice=.TRUE. ) ; ! more accurate way to obtain ssq !
+         !#LB.
+      ENDIF !IF( ln_blk )
       !
       IF(sn_cfctl%l_prtctl)  CALL prt_ctl(tab2d_1=wndm_ice  , clinfo1=' blk_ice: wndm_ice : ')
@@ -983,5 +1086,5 @@
 
 
-   SUBROUTINE blk_ice_2( ptsu, phs, phi, palb, ptair, phumi, pslp, pqlw, pprec, psnow  )
+   SUBROUTINE blk_ice_2( ptsu, phs, phi, palb, ptair, pqair, pslp, pdqlw, pprec, psnow  )
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE blk_ice_2  ***
@@ -999,16 +1102,15 @@
       REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness
       REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   palb   ! ice albedo (all skies)
-      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   ptair
-      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   phumi
+      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   ptair  ! potential temperature of air #LB: okay ???
+      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   pqair  ! specific humidity of air
       REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   pslp
-      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   pqlw
+      REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   pdqlw
       REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   pprec
       REAL(wp), DIMENSION(:,:  ), INTENT(in)  ::   psnow
       !!
       INTEGER  ::   ji, jj, jl               ! dummy loop indices
-      REAL(wp) ::   zst3                     ! local variable
+      REAL(wp) ::   zst, zst3, zsq           ! local variable
       REAL(wp) ::   zcoef_dqlw, zcoef_dqla   !   -      -
-      REAL(wp) ::   zztmp, zztmp2, z1_rLsub  !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_st         ! inverse of surface temperature
+      REAL(wp) ::   zztmp, zzblk, zztmp1, z1_rLsub   !   -      -
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z_qlw         ! long wave heat flux over ice
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z_qsb         ! sensible  heat flux over ice
@@ -1016,42 +1118,33 @@
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z_dqsb        ! sensible  heat sensitivity over ice
       REAL(wp), DIMENSION(jpi,jpj)     ::   zevap, zsnw   ! evaporation and snw distribution after wind blowing (SI3)
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zqair         ! specific humidity of air at z=rn_zqt [kg/kg] !LB
       REAL(wp), DIMENSION(jpi,jpj)     ::   ztmp, ztmp2
       REAL(wp), DIMENSION(jpi,jpj)     ::   ztri
       !!---------------------------------------------------------------------
       !
-      zcoef_dqlw = 4._wp * 0.95_wp * stefan             ! local scalars
-      zcoef_dqla = -rLsub * 11637800._wp * (-5897.8_wp) !LB: BAD!
-      !
-      SELECT CASE( nhumi )
-      CASE( np_humi_sph )
-         zqair(:,:) =  phumi(:,:)      ! what we read in file is already a spec. humidity!
-      CASE( np_humi_dpt )
-         zqair(:,:) = q_sat( phumi(:,:), pslp )
-      CASE( np_humi_rlh )
-         zqair(:,:) = q_air_rh( 0.01_wp*phumi(:,:), ptair(:,:), pslp(:,:) ) !LB: 0.01 => RH is % percent in file
-      END SELECT
-      !
+      zcoef_dqlw = 4._wp * emiss_i * stefan             ! local scalars
+      !
+
       zztmp = 1. / ( 1. - albo )
-      WHERE( ptsu(:,:,:) /= 0._wp )
-         z1_st(:,:,:) = 1._wp / ptsu(:,:,:)
-      ELSEWHERE
-         z1_st(:,:,:) = 0._wp
-      END WHERE
+      dqla_ice(:,:,:) = 0._wp
+
       !                                     ! ========================== !
       DO jl = 1, jpl                        !  Loop over ice categories  !
          !                                  ! ========================== !
-         DO jj = 1 , jpj
-            DO ji = 1, jpi
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+               zst = ptsu(ji,jj,jl)                           ! surface temperature of sea-ice [K]
+               zsq = q_sat( zst, pslp(ji,jj), l_ice=.TRUE. )  ! surface saturation specific humidity when ice present
+
                ! ----------------------------!
                !      I   Radiative FLUXES   !
                ! ----------------------------!
-               zst3 = ptsu(ji,jj,jl) * ptsu(ji,jj,jl) * ptsu(ji,jj,jl)
                ! Short Wave (sw)
                qsr_ice(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr(ji,jj)
+
                ! Long  Wave (lw)
-               z_qlw(ji,jj,jl) = 0.95 * ( pqlw(ji,jj) - stefan * ptsu(ji,jj,jl) * zst3 ) * tmask(ji,jj,1)
+               zst3 = zst * zst * zst
+               z_qlw(ji,jj,jl)   = emiss_i * ( pdqlw(ji,jj) - stefan * zst * zst3 ) * tmask(ji,jj,1)
                ! lw sensitivity
-               z_dqlw(ji,jj,jl) = zcoef_dqlw * zst3
+               z_dqlw(ji,jj,jl)  = zcoef_dqlw * zst3
 
                ! ----------------------------!
@@ -1060,20 +1153,22 @@
 
                ! ... turbulent heat fluxes with Ch_ice recalculated in blk_ice_1
+
+               ! Common term in bulk F. equations...
+               zzblk = rhoa(ji,jj) * wndm_ice(ji,jj)
+
                ! Sensible Heat
-               z_qsb(ji,jj,jl) = rhoa(ji,jj) * rCp_air * Ch_ice(ji,jj) * wndm_ice(ji,jj) * (ptsu(ji,jj,jl) - ptair(ji,jj))
+               zztmp1 = zzblk * rCp_air * Ch_ice(ji,jj)
+               z_qsb (ji,jj,jl) = zztmp1 * (zst - theta_zu_i(ji,jj))
+               z_dqsb(ji,jj,jl) = zztmp1                        ! ==> Qsens sensitivity (Dqsb_ice/Dtn_ice)
+
                ! Latent Heat
-               zztmp2 = EXP( -5897.8 * z1_st(ji,jj,jl) )
-               qla_ice(ji,jj,jl) = rn_efac * MAX( 0.e0, rhoa(ji,jj) * rLsub  * Ce_ice(ji,jj) * wndm_ice(ji,jj) *  &
-                  &                ( 11637800. * zztmp2 / rhoa(ji,jj) - zqair(ji,jj) ) )
-               ! Latent heat sensitivity for ice (Dqla/Dt)
-               IF( qla_ice(ji,jj,jl) > 0._wp ) THEN
-                  dqla_ice(ji,jj,jl) = rn_efac * zcoef_dqla * Ce_ice(ji,jj) * wndm_ice(ji,jj) *  &
-                     &                 z1_st(ji,jj,jl) * z1_st(ji,jj,jl) * zztmp2
-               ELSE
-                  dqla_ice(ji,jj,jl) = 0._wp
-               ENDIF
-
-               ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice)
-               z_dqsb(ji,jj,jl) = rhoa(ji,jj) * rCp_air * Ch_ice(ji,jj) * wndm_ice(ji,jj)
+               zztmp1 = zzblk * rLsub * Ce_ice(ji,jj)
+               qla_ice(ji,jj,jl) = MAX( zztmp1 * (zsq - q_zu_i(ji,jj)) , 0._wp )   ! #LB: only sublimation (and not condensation) ???
+               IF(qla_ice(ji,jj,jl)>0._wp) dqla_ice(ji,jj,jl) = zztmp1*dq_sat_dt_ice(zst, pslp(ji,jj)) ! ==> Qlat sensitivity  (dQlat/dT)
+               !                                                                                       !#LB: dq_sat_dt_ice() in "sbc_phy.F90"
+               !#LB: without this unjustified "condensation sensure":
+               !qla_ice( ji,jj,jl) = zztmp1 * (zsq - q_zu_i(ji,jj))
+               !dqla_ice(ji,jj,jl) = zztmp1 * dq_sat_dt_ice(zst, pslp(ji,jj)) ! ==> Qlat sensitivity  (dQlat/dT)
+
 
                ! ----------------------------!
@@ -1083,8 +1178,7 @@
                qns_ice (ji,jj,jl) =     z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - qla_ice (ji,jj,jl)
                ! Total non solar heat flux sensitivity for ice
-               dqns_ice(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + dqla_ice(ji,jj,jl) )
-            END DO
-            !
-         END DO
+               dqns_ice(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + dqla_ice(ji,jj,jl) ) !#LB: correct signs ????
+
+         END_2D
          !
       END DO
@@ -1138,10 +1232,10 @@
          ztri(:,:) = 0.18 * ( 1.0 - cloud_fra(:,:) ) + 0.35 * cloud_fra(:,:)  ! surface transmission when hi>10cm
          DO jl = 1, jpl
-            WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )     ! linear decrease from hi=0 to 10cm  
+            WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )     ! linear decrease from hi=0 to 10cm
                qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ( ztri(:,:) + ( 1._wp - ztri(:,:) ) * ( 1._wp - phi(:,:,jl) * 10._wp ) )
             ELSEWHERE( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) >= 0.1_wp )     ! constant (ztri) when hi>10cm
                qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ztri(:,:)
             ELSEWHERE                                                         ! zero when hs>0
-               qtr_ice_top(:,:,jl) = 0._wp 
+               qtr_ice_top(:,:,jl) = 0._wp
             END WHERE
          ENDDO
@@ -1182,5 +1276,12 @@
          CALL prt_ctl(tab2d_1=tprecip , clinfo1=' blk_ice: tprecip  : ', tab2d_2=sprecip , clinfo2=' sprecip  : ')
       ENDIF
-      !
+
+      !#LB:
+      ! air-ice heat flux components that are not written from ice_stp()@icestp.F90:
+      IF( iom_use('qla_ice') )  CALL iom_put( 'qla_ice', SUM( - qla_ice * a_i_b, dim=3 ) ) !#LB: sign consistent with what's done for ocean
+      IF( iom_use('qsb_ice') )  CALL iom_put( 'qsb_ice', SUM( -   z_qsb * a_i_b, dim=3 ) ) !#LB:     ==> negative => loss of heat for sea-ice
+      IF( iom_use('qlw_ice') )  CALL iom_put( 'qlw_ice', SUM(     z_qlw * a_i_b, dim=3 ) )
+      !#LB.
+
    END SUBROUTINE blk_ice_2
 
@@ -1278,170 +1379,4 @@
    END SUBROUTINE blk_ice_qcn
 
-
-   SUBROUTINE Cdn10_Lupkes2012( pcd )
-      !!----------------------------------------------------------------------
-      !!                      ***  ROUTINE  Cdn10_Lupkes2012  ***
-      !!
-      !! ** Purpose :    Recompute the neutral air-ice drag referenced at 10m
-      !!                 to make it dependent on edges at leads, melt ponds and flows.
-      !!                 After some approximations, this can be resumed to a dependency
-      !!                 on ice concentration.
-      !!
-      !! ** Method :     The parameterization is taken from Lupkes et al. (2012) eq.(50)
-      !!                 with the highest level of approximation: level4, eq.(59)
-      !!                 The generic drag over a cell partly covered by ice can be re-written as follows:
-      !!
-      !!                 Cd = Cdw * (1-A) + Cdi * A + Ce * (1-A)**(nu+1/(10*beta)) * A**mu
-      !!
-      !!                    Ce = 2.23e-3       , as suggested by Lupkes (eq. 59)
-      !!                    nu = mu = beta = 1 , as suggested by Lupkes (eq. 59)
-      !!                    A is the concentration of ice minus melt ponds (if any)
-      !!
-      !!                 This new drag has a parabolic shape (as a function of A) starting at
-      !!                 Cdw(say 1.5e-3) for A=0, reaching 1.97e-3 for A~0.5
-      !!                 and going down to Cdi(say 1.4e-3) for A=1
-      !!
-      !!                 It is theoretically applicable to all ice conditions (not only MIZ)
-      !!                 => see Lupkes et al (2013)
-      !!
-      !! ** References : Lupkes et al. JGR 2012 (theory)
-      !!                 Lupkes et al. GRL 2013 (application to GCM)
-      !!
-      !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pcd
-      REAL(wp), PARAMETER ::   zCe   = 2.23e-03_wp
-      REAL(wp), PARAMETER ::   znu   = 1._wp
-      REAL(wp), PARAMETER ::   zmu   = 1._wp
-      REAL(wp), PARAMETER ::   zbeta = 1._wp
-      REAL(wp)            ::   zcoef
-      !!----------------------------------------------------------------------
-      zcoef = znu + 1._wp / ( 10._wp * zbeta )
-
-      ! generic drag over a cell partly covered by ice
-      !!Cd(:,:) = Cd_oce(:,:) * ( 1._wp - at_i_b(:,:) ) +  &                        ! pure ocean drag
-      !!   &      Cd_ice      *           at_i_b(:,:)   +  &                        ! pure ice drag
-      !!   &      zCe         * ( 1._wp - at_i_b(:,:) )**zcoef * at_i_b(:,:)**zmu   ! change due to sea-ice morphology
-
-      ! ice-atm drag
-      pcd(:,:) = rCd_ice +  &                                                         ! pure ice drag
-         &      zCe     * ( 1._wp - at_i_b(:,:) )**zcoef * at_i_b(:,:)**(zmu-1._wp)  ! change due to sea-ice morphology
-
-   END SUBROUTINE Cdn10_Lupkes2012
-
-
-   SUBROUTINE Cdn10_Lupkes2015( ptm_su, pslp, pcd, pch )
-      !!----------------------------------------------------------------------
-      !!                      ***  ROUTINE  Cdn10_Lupkes2015  ***
-      !!
-      !! ** pUrpose :    Alternative turbulent transfert coefficients formulation
-      !!                 between sea-ice and atmosphere with distinct momentum
-      !!                 and heat coefficients depending on sea-ice concentration
-      !!                 and atmospheric stability (no meltponds effect for now).
-      !!
-      !! ** Method :     The parameterization is adapted from Lupkes et al. (2015)
-      !!                 and ECHAM6 atmospheric model. Compared to Lupkes2012 scheme,
-      !!                 it considers specific skin and form drags (Andreas et al. 2010)
-      !!                 to compute neutral transfert coefficients for both heat and
-      !!                 momemtum fluxes. Atmospheric stability effect on transfert
-      !!                 coefficient is also taken into account following Louis (1979).
-      !!
-      !! ** References : Lupkes et al. JGR 2015 (theory)
-      !!                 Lupkes et al. ECHAM6 documentation 2015 (implementation)
-      !!
-      !!----------------------------------------------------------------------
-      !
-      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   ptm_su ! sea-ice surface temperature [K]
-      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   pslp   ! sea-level pressure [Pa]
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pcd    ! momentum transfert coefficient
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pch    ! heat transfert coefficient
-      REAL(wp), DIMENSION(jpi,jpj)            ::   zst, zqo_sat, zqi_sat
-      !
-      ! ECHAM6 constants
-      REAL(wp), PARAMETER ::   z0_skin_ice  = 0.69e-3_wp  ! Eq. 43 [m]
-      REAL(wp), PARAMETER ::   z0_form_ice  = 0.57e-3_wp  ! Eq. 42 [m]
-      REAL(wp), PARAMETER ::   z0_ice       = 1.00e-3_wp  ! Eq. 15 [m]
-      REAL(wp), PARAMETER ::   zce10        = 2.80e-3_wp  ! Eq. 41
-      REAL(wp), PARAMETER ::   zbeta        = 1.1_wp      ! Eq. 41
-      REAL(wp), PARAMETER ::   zc           = 5._wp       ! Eq. 13
-      REAL(wp), PARAMETER ::   zc2          = zc * zc
-      REAL(wp), PARAMETER ::   zam          = 2. * zc     ! Eq. 14
-      REAL(wp), PARAMETER ::   zah          = 3. * zc     ! Eq. 30
-      REAL(wp), PARAMETER ::   z1_alpha     = 1._wp / 0.2_wp  ! Eq. 51
-      REAL(wp), PARAMETER ::   z1_alphaf    = z1_alpha    ! Eq. 56
-      REAL(wp), PARAMETER ::   zbetah       = 1.e-3_wp    ! Eq. 26
-      REAL(wp), PARAMETER ::   zgamma       = 1.25_wp     ! Eq. 26
-      REAL(wp), PARAMETER ::   z1_gamma     = 1._wp / zgamma
-      REAL(wp), PARAMETER ::   r1_3         = 1._wp / 3._wp
-      !
-      INTEGER  ::   ji, jj         ! dummy loop indices
-      REAL(wp) ::   zthetav_os, zthetav_is, zthetav_zu
-      REAL(wp) ::   zrib_o, zrib_i
-      REAL(wp) ::   zCdn_skin_ice, zCdn_form_ice, zCdn_ice
-      REAL(wp) ::   zChn_skin_ice, zChn_form_ice
-      REAL(wp) ::   z0w, z0i, zfmi, zfmw, zfhi, zfhw
-      REAL(wp) ::   zCdn_form_tmp
-      !!----------------------------------------------------------------------
-
-      ! Momentum Neutral Transfert Coefficients (should be a constant)
-      zCdn_form_tmp = zce10 * ( LOG( 10._wp / z0_form_ice + 1._wp ) / LOG( rn_zu / z0_form_ice + 1._wp ) )**2   ! Eq. 40
-      zCdn_skin_ice = ( vkarmn                                      / LOG( rn_zu / z0_skin_ice + 1._wp ) )**2   ! Eq. 7
-      zCdn_ice      = zCdn_skin_ice   ! Eq. 7
-      !zCdn_ice     = 1.89e-3         ! old ECHAM5 value (cf Eq. 32)
-
-      ! Heat Neutral Transfert Coefficients
-      zChn_skin_ice = vkarmn**2 / ( LOG( rn_zu / z0_ice + 1._wp ) * LOG( rn_zu * z1_alpha / z0_skin_ice + 1._wp ) )   ! Eq. 50 + Eq. 52
-
-      ! Atmospheric and Surface Variables
-      zst(:,:)     = sst_m(:,:) + rt0                                        ! convert SST from Celcius to Kelvin
-      zqo_sat(:,:) = rdct_qsat_salt * q_sat( zst(:,:)   , pslp(:,:) )   ! saturation humidity over ocean [kg/kg]
-      zqi_sat(:,:) =                  q_sat( ptm_su(:,:), pslp(:,:) )   ! saturation humidity over ice   [kg/kg]
-      !
-      DO_2D( 0, 0, 0, 0 )
-         ! Virtual potential temperature [K]
-         zthetav_os = zst(ji,jj)    * ( 1._wp + rctv0 * zqo_sat(ji,jj) )   ! over ocean
-         zthetav_is = ptm_su(ji,jj) * ( 1._wp + rctv0 * zqi_sat(ji,jj) )   ! ocean ice
-         zthetav_zu = t_zu (ji,jj)  * ( 1._wp + rctv0 * q_zu(ji,jj)    )   ! at zu
-
-         ! Bulk Richardson Number (could use Ri_bulk function from aerobulk instead)
-         zrib_o = grav / zthetav_os * ( zthetav_zu - zthetav_os ) * rn_zu / MAX( 0.5, wndm(ji,jj)     )**2   ! over ocean
-         zrib_i = grav / zthetav_is * ( zthetav_zu - zthetav_is ) * rn_zu / MAX( 0.5, wndm_ice(ji,jj) )**2   ! over ice
-
-         ! Momentum and Heat Neutral Transfert Coefficients
-         zCdn_form_ice = zCdn_form_tmp * at_i_b(ji,jj) * ( 1._wp - at_i_b(ji,jj) )**zbeta  ! Eq. 40
-         zChn_form_ice = zCdn_form_ice / ( 1._wp + ( LOG( z1_alphaf ) / vkarmn ) * SQRT( zCdn_form_ice ) )               ! Eq. 53
-
-         ! Momentum and Heat Stability functions (possibility to use psi_m_ecmwf instead ?)
-         z0w = rn_zu * EXP( -1._wp * vkarmn / SQRT( Cdn_oce(ji,jj) ) ) ! over water
-         z0i = z0_skin_ice                                             ! over ice
-         IF( zrib_o <= 0._wp ) THEN
-            zfmw = 1._wp - zam * zrib_o / ( 1._wp + 3._wp * zc2 * Cdn_oce(ji,jj) * SQRT( -zrib_o * ( rn_zu / z0w + 1._wp ) ) )  ! Eq. 10
-            zfhw = ( 1._wp + ( zbetah * ( zthetav_os - zthetav_zu )**r1_3 / ( Chn_oce(ji,jj) * MAX(0.01, wndm(ji,jj)) )   &     ! Eq. 26
-               &             )**zgamma )**z1_gamma
-         ELSE
-            zfmw = 1._wp / ( 1._wp + zam * zrib_o / SQRT( 1._wp + zrib_o ) )   ! Eq. 12
-            zfhw = 1._wp / ( 1._wp + zah * zrib_o / SQRT( 1._wp + zrib_o ) )   ! Eq. 28
-         ENDIF
-
-         IF( zrib_i <= 0._wp ) THEN
-            zfmi = 1._wp - zam * zrib_i / (1._wp + 3._wp * zc2 * zCdn_ice * SQRT( -zrib_i * ( rn_zu / z0i + 1._wp)))   ! Eq.  9
-            zfhi = 1._wp - zah * zrib_i / (1._wp + 3._wp * zc2 * zCdn_ice * SQRT( -zrib_i * ( rn_zu / z0i + 1._wp)))   ! Eq. 25
-         ELSE
-            zfmi = 1._wp / ( 1._wp + zam * zrib_i / SQRT( 1._wp + zrib_i ) )   ! Eq. 11
-            zfhi = 1._wp / ( 1._wp + zah * zrib_i / SQRT( 1._wp + zrib_i ) )   ! Eq. 27
-         ENDIF
-
-         ! Momentum Transfert Coefficients (Eq. 38)
-         pcd(ji,jj) = zCdn_skin_ice *   zfmi +  &
-            &        zCdn_form_ice * ( zfmi * at_i_b(ji,jj) + zfmw * ( 1._wp - at_i_b(ji,jj) ) ) / MAX( 1.e-06, at_i_b(ji,jj) )
-
-         ! Heat Transfert Coefficients (Eq. 49)
-         pch(ji,jj) = zChn_skin_ice *   zfhi +  &
-            &        zChn_form_ice * ( zfhi * at_i_b(ji,jj) + zfhw * ( 1._wp - at_i_b(ji,jj) ) ) / MAX( 1.e-06, at_i_b(ji,jj) )
-         !
-      END_2D
-      CALL lbc_lnk_multi( 'sbcblk', pcd, 'T',  1.0_wp, pch, 'T', 1.0_wp )
-      !
-   END SUBROUTINE Cdn10_Lupkes2015
-
 #endif
 
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_andreas.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_andreas.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_andreas.F90	(revision 14072)
@@ -0,0 +1,337 @@
+!!! TO DO: consistent psi_m and psi_h needed!!! For now is those of NCAR !!!
+!!
+MODULE sbcblk_algo_andreas
+   !!======================================================================
+   !!                   ***  MODULE  sbcblk_algo_andreas  ***
+   !! Computes:
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at 10m Ubzu
+   !!  according to Andreas et al. (2015)
+   !!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   !!       Andreas, E.L., Mahrt, L. and Vickers, D. (2015),
+   !!       An improved bulk air–sea surface flux algorithm,
+   !!       including spray‐mediated transfer.
+   !!       Q.J.R. Meteorol. Soc., 141: 642-654. doi:10.1002/qj.2424
+   !!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   !!
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at z=zu: Ubzu
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!    Using the bulk formulation/param. of Large & Yeager 2008
+   !!
+   !!       Routine turb_andreas maintained and developed in AeroBulk
+   !!                     (https://github.com/brodeau/aerobulk/)
+   !!
+   !! ** Author: L. Brodeau, August 2020 / AeroBulk (https://github.com/brodeau/aerobulk)
+   !!----------------------------------------------------------------------
+   !! History :  4.x  !  2020-08  (L.Brodeau)   Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! Important (Brodeau fix):
+   REAL(wp), PARAMETER :: rRi_max = 0.15_wp   ! Bulk Ri above which the algorithm fucks up!
+   !                                          ! (increasing (>0) Ri means that surface layer increasingly stable and/or wind increasingly weak)
+   REAL(wp), PARAMETER :: rCs_min = 0.35E-3_wp ! minimum value to tolarate for CE and CH ! Must be larger than "Cx_min" !!!
+
+   PUBLIC :: TURB_ANDREAS, psi_m_andreas, psi_h_andreas
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_andreas( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
+      &                     Cd, Ch, Ce, t_zu, q_zu, Ubzu,       &
+      &                     nb_iter, CdN, ChN, CeN               )
+      !!----------------------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_andreas  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to Large & Yeager (2004) and Large & Yeager (2008)
+      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!                Returns the effective bulk wind speed at zu to be used in the bulk formulas
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (usually 10m)                     [m]
+      !!    *  sst  : bulk SST                                                [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!    *  U_zu : scalar wind speed at zu                                 [m/s]
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd     : drag coefficient
+      !!    *  Ch     : sensible heat coefficient
+      !!    *  Ce     : evaporation coefficient
+      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
+      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
+      !!    *  Ubzu   : bulk wind speed at zu                                 [m/s]
+      !!
+      !!
+      !! ** Author: L. Brodeau, June 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                             [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature                [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity           [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity at zt             [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ubzu    ! bulk wind speed at zu                     [m/s]
+      !
+      INTEGER , INTENT(in   ), OPTIONAL                     :: nb_iter  ! number of iterations
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CdN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   ChN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CeN
+      !
+      INTEGER :: nbit, jit                    ! iterations...
+      LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      !!
+      REAL(wp), DIMENSION(jpi,jpj) ::   u_star, t_star, q_star
+      REAL(wp), DIMENSION(jpi,jpj) ::   z0       ! roughness length (momentum) [m]
+      REAL(wp), DIMENSION(jpi,jpj) ::   UN10     ! Neutral wind speed at zu [m/s]
+      REAL(wp), DIMENSION(jpi,jpj) ::   zeta_u   ! stability parameter at height zu
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztmp0, ztmp1, ztmp2
+      REAL(wp), DIMENSION(jpi,jpj) ::   RiB       ! square root of Cd
+      !!
+      !!----------------------------------------------------------------------------------
+      nbit = nb_iter0
+      IF( PRESENT(nb_iter) ) nbit = nb_iter
+
+      l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp ) ! testing "zu == zt" is risky with double precision
+
+      Ubzu = MAX( 0.25_wp , U_zu )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
+
+      !! First guess:
+      UN10 = Ubzu
+      Cd   = 1.1E-3_wp
+      Ch   = 1.1E-3_wp
+      Ce   = 1.1E-3_wp
+      t_zu = t_zt
+      q_zu = q_zt
+
+      !! First guess of turbulent scales for scalars:
+      ztmp0  = SQRT(Cd)
+      t_star = Ch/ztmp0*(t_zu - sst) ! theta*
+      q_star = Ce/ztmp0*(q_zu - ssq) ! q*
+
+      ! Bulk Richardson number:
+      RiB(:,:) = Ri_bulk( zu, sst, t_zu, ssq, q_zu, Ubzu )
+
+
+      !! ITERATION BLOCK
+      DO jit = 1, nbit
+
+         WHERE ( RiB < rRi_max )
+            !! Normal condition case:
+            u_star = U_STAR_ANDREAS( UN10 )
+         ELSEWHERE
+            !! Extremely stable + weak wind !!!
+            !!  => for we force u* to be consistent with minimum value for CD:
+            !!  (otherwize algorithm becomes nonsense...)
+            u_star = SQRT(Cx_min) * Ubzu     ! Cd does not go below Cx_min !
+         ENDWHERE
+
+         !! Stability parameter :
+         zeta_u = zu*One_on_L( t_zu, q_zu, u_star, t_star, q_star )   ! zu * 1/L
+
+         !! Drag coefficient:
+         ztmp0 = u_star/Ubzu
+
+         Cd = MAX( ztmp0*ztmp0 , Cx_min )
+
+         !! Roughness length:
+         z0 = MIN( z0_from_Cd( zu, Cd,  ppsi=psi_m_andreas(zeta_u) ) , z0_sea_max )
+
+         !! z0t and z0q, based on LKB, just like into COARE 2.5:
+         ztmp0 = z0 * u_star / visc_air(t_zu) ! Re_r
+         ztmp1 = z0tq_LKB( 1, ztmp0, z0 )     ! z0t
+         ztmp2 = z0tq_LKB( 2, ztmp0, z0 )     ! z0q
+
+         !! Turbulent scales at zu :
+         ztmp0 = psi_h_andreas(zeta_u)  ! lolo: zeta_u for scalars???
+         t_star  = (t_zu - sst)*vkarmn/(LOG(zu) - LOG(ztmp1) - ztmp0)  ! theta* (ztmp1 == z0t in rhs term)
+         q_star  = (q_zu - ssq)*vkarmn/(LOG(zu) - LOG(ztmp2) - ztmp0)  !   q*   (ztmp2 == z0q in rhs term)
+
+         IF( (.NOT. l_zt_equal_zu).AND.( jit > 1 ) ) THEN
+            !! Re-updating temperature and humidity at zu if zt /= zu:
+            ztmp0 = zeta_u/zu*zt   ! zeta_t
+            ztmp0 = LOG(zt/zu) + psi_h_andreas(zeta_u) - psi_h_andreas(ztmp0)
+            t_zu = t_zt - t_star/vkarmn*ztmp0
+            q_zu = q_zt - q_star/vkarmn*ztmp0
+            RiB  = Ri_bulk( zu, sst, t_zu, ssq, q_zu, Ubzu ) !LOLO
+         ENDIF
+
+         !! Update neutral-stability wind at zu:
+         UN10 = MAX( 0.1_wp , UN10_from_ustar( zu, Ubzu, u_star, psi_m_andreas(zeta_u) ) ) ! UN10
+
+      END DO !DO jit = 1, nbit
+
+      ! Compute transfer coefficients at zu:
+      ztmp0 = u_star/Ubzu
+
+      Cd = MAX( ztmp0*ztmp0 , Cx_min )   ! the earlier use of Cx_min on u* should make use of Cx_min here unnecessary!
+
+      ztmp1 = t_zu - sst ;  ztmp1 = SIGN( MAX(ABS(ztmp1),1.E-6_wp), ztmp1 )  ! dt_zu
+      ztmp2 = q_zu - ssq ;  ztmp2 = SIGN( MAX(ABS(ztmp2),1.E-9_wp), ztmp2 )  ! dq_zu
+      Ch   = MAX( ztmp0*t_star/ztmp1 , rCs_min )
+      Ce   = MAX( ztmp0*q_star/ztmp2 , rCs_min )
+
+      !! Neutral-stability coefficients:
+      ztmp0 = 1._wp/LOG(zu/z0)
+      ztmp1 = z0 * u_star / visc_air(t_zu)  ! Re_r
+      
+      IF(PRESENT(CdN)) CdN = vkarmn2*ztmp0*ztmp0
+      IF(PRESENT(ChN)) ChN = vkarmn2*ztmp0/LOG(zu/z0tq_LKB( 1, ztmp1, z0 ))
+      IF(PRESENT(CeN)) CeN = vkarmn2*ztmp0/LOG(zu/z0tq_LKB( 2, ztmp1, z0 ))
+      
+   END SUBROUTINE turb_andreas
+
+
+   FUNCTION U_STAR_ANDREAS( pun10 )
+      !!----------------------------------------------------------------------------------
+      !! Estimate of the friction velocity as a function of the neutral-stability wind
+      !! speed at at 10m
+      !!
+      !! Origin: Eq.(2.2) of Andreas et al. (2015)
+      !!
+      !! ** Author: L. Brodeau, April 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pun10          !: neutral-stability scalar wind speed at 10m (m/s)
+      REAL(wp), DIMENSION(jpi,jpj)             :: u_star_andreas !: friction velocity    [m/s]
+      !
+      INTEGER  ::     ji, jj ! dummy loop indices
+      REAL(wp) :: za, zt, zw ! local scalars
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            zw  = pun10(ji,jj)
+            za = zw - 8.271_wp
+            zt = za + SQRT( 0.12_wp*za*za + 0.181_wp )
+            u_star_andreas(ji,jj) =   0.239_wp + 0.0433_wp * zt
+      END_2D
+   END FUNCTION U_STAR_ANDREAS
+
+
+   FUNCTION psi_m_andreas( pzeta )
+      !!----------------------------------------------------------------------------------
+      !!      Universal profile stability function for momentum
+      !!  TO DO !!!!!!!!!!!!!!!!!!!!!
+      !! LOLO: paper says Paulson 1970 when unstable and Grachev et al 2007 for STABLE
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, April 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_andreas
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      REAL(wp), PARAMETER :: zam  = 5._wp      ! a_m (just below Eq.(9b)
+      REAL(wp), PARAMETER :: zbm = zam/6.5_wp  ! b_m (just below Eq.(9b)
+      !
+      REAL(wp), PARAMETER :: z1o3 = 1._wp/3._wp
+      REAL(wp), PARAMETER :: zsr3 = SQRT(3._wp)
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zta, zx2, zx, zpsi_unst, zbbm, zpsi_stab,  zstab   ! local scalars
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            !
+            zta = MIN( pzeta(ji,jj) , 15._wp ) !! Very stable conditions (L positif and big!)
+            !
+            !! *** Unstable: Paulson (1970): #LOLO: DOUBLE CHECK IT IS PAULSON!!!!!
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 - 16z)^0.5
+            zx2 = MAX( zx2 , 1._wp )
+            zx  = SQRT(zx2)                          ! (1 - 16z)^0.25
+            zpsi_unst = 2._wp*LOG(ABS( (1._wp + zx )*0.5_wp ))   &
+               &            + LOG(ABS( (1._wp + zx2)*0.5_wp ))   &
+               &          - 2._wp*ATAN(zx) + rpi*0.5_wp
+            !
+            !! *** Stable: Grachev et al 2007 (SHEBA) [Eq.(12) Grachev et al 2007]:
+            zx   = ABS(1._wp + zta)**z1o3
+            zbbm = ABS( (1._wp - zbm)/zbm )**z1o3 ! B_m
+            !
+            zpsi_stab = -3.*zam/zbm*(zx - 1._wp) + zam*zbbm/(2.*zbm) * ( &
+               &        2.*LOG(ABS( (   zx     +   zbbm         )/(1._wp        +   zbbm   ) )) &
+               &         - LOG(ABS( (zx*zx - zx*zbbm + zbbm*zbbm)/(1._wp - zbbm + zbbm*zbbm) )) &
+               & + 2.*zsr3*( ATAN( (2.*zx - zbbm)/(zsr3*zbbm) ) - ATAN( (2._wp - zbbm)/(zsr3*zbbm) ) ) )
+            !
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_m_andreas(ji,jj) =       zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &              + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
+      END_2D
+   END FUNCTION psi_m_andreas
+
+
+   FUNCTION psi_h_andreas( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! Universal profile stability function for temperature and humidity
+      !!
+      !!    TO DO
+      !!       !! LOLO: paper says Paulson 1970 when unstable and Grachev et al 2007 for STABLE
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_andreas
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      REAL(wp), PARAMETER ::  zah = 5._wp       ! a_h (just below Eq.(9b)
+      REAL(wp), PARAMETER ::  zbh = 5._wp       ! b_h (just below Eq.(9b)
+      REAL(wp), PARAMETER ::  zch = 3._wp       ! c_h (just below Eq.(9b)
+      REAL(wp), PARAMETER :: zbbh = SQRT(5._wp) ! B_h (just below Eq.(13)
+      !
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      REAL(wp) :: zta, zz, zx2, zpsi_unst, zpsi_stab, zstab  ! local scalars
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            !
+            zta = MIN( pzeta(ji,jj) , 15._wp ) !! Very stable conditions (L positif and large!)
+            !
+            !! *** Unstable: Paulson (1970): #LOLO: DOUBLE CHECK IT IS PAULSON!!!!!
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 -16z)^0.5
+            zx2 = MAX( zx2 , 1._wp )
+            zpsi_unst = 2._wp*LOG( 0.5_wp*(1._wp + zx2) )
+            !
+            !! *** Stable: Grachev et al 2007 (SHEBA) [Eq.(13) Grachev et al 2007]:
+            zz = 2.*zta + zch
+            zpsi_stab = - 0.5*zbh*LOG(ABS(1._wp + zch*zta + zta*zta)) &
+               &        +  (-zah/zbbh + 0.5*zbh*zch/zbbh)  &
+               &          *( LOG(ABS((zz  - zbbh)/(zz  + zbbh))) &
+               &           - LOG(ABS((zch - zbbh)/(zch + zbbh)))    )
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_h_andreas(ji,jj) =            zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &                   + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
+      END_2D
+   END FUNCTION psi_h_andreas
+
+   !!======================================================================
+END MODULE sbcblk_algo_andreas
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p0.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p0.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p0.F90	(revision 14072)
@@ -7,5 +7,5 @@
    !!   * bulk transfer coefficients C_D, C_E and C_H
    !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
-   !!   * the effective bulk wind speed at 10m U_blk
+   !!   * the effective bulk wind speed at 10m Ubzu
    !!   => all these are used in bulk formulas in sbcblk.F90
    !!
@@ -15,5 +15,6 @@
    !! ** Author: L. Brodeau, June 2019 / AeroBulk (https://github.com/brodeau/aerobulk)
    !!----------------------------------------------------------------------
-   !! History :  4.0  !  2016-02  (L.Brodeau)   Original code
+   !! History :  4.0  ! 2016-02  (L.Brodeau)   Original code
+   !!            4.2  ! 2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
 
@@ -37,5 +38,5 @@
 
    USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbcblk_phy      ! all thermodynamics functions, rho_air, q_sat, etc... !LB
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
    USE sbcblk_skin_coare ! cool-skin/warm layer scheme (CSWL_ECMWF) !LB
 
@@ -50,6 +51,5 @@
    REAL(wp), PARAMETER :: zi0   = 600._wp     ! scale height of the atmospheric boundary layer...
    REAL(wp), PARAMETER :: Beta0 =  1.25_wp    ! gustiness parameter
-
-   INTEGER , PARAMETER ::   nb_itt = 10             ! number of itterations
+   REAL(wp), PARAMETER :: zeta_abs_max = 50._wp
 
    !!----------------------------------------------------------------------
@@ -90,8 +90,8 @@
 
    SUBROUTINE turb_coare3p0( kt, zt, zu, T_s, t_zt, q_s, q_zt, U_zu, l_use_cs, l_use_wl, &
-      &                      Cd, Ch, Ce, t_zu, q_zu, U_blk,                              &
-      &                      Cdn, Chn, Cen,                                              &
+      &                      Cd, Ch, Ce, t_zu, q_zu, Ubzu,                               &
+      &                      nb_iter, Cdn, Chn, Cen,                                     & ! optional output
       &                      Qsw, rad_lw, slp, pdT_cs,                                   & ! optionals for cool-skin (and warm-layer)
-      &                      pdT_wl, pHz_wl )                                                 ! optionals for warm-layer only
+      &                      pdT_wl, pHz_wl )                                              ! optionals for warm-layer only
       !!----------------------------------------------------------------------
       !!                      ***  ROUTINE  turb_coare3p0  ***
@@ -147,5 +147,5 @@
       !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
       !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
-      !!    *  U_blk  : bulk wind speed at zu                                 [m/s]
+      !!    *  Ubzu  : bulk wind speed at zu                                 [m/s]
       !!
       !!
@@ -167,7 +167,10 @@
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind speed at zu                     [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cdn, Chn, Cen ! neutral transfer coefficients
-      !
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ubzu    ! bulk wind speed at zu                     [m/s]
+      !
+      INTEGER , INTENT(in   ), OPTIONAL                     :: nb_iter  ! number of iterations
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CdN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   ChN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CeN
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   Qsw      !             [W/m^2]
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   rad_lw   !             [W/m^2]
@@ -177,5 +180,5 @@
       REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   pHz_wl   !             [m]
       !
-      INTEGER :: j_itt
+      INTEGER :: nbit, jit
       LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
       !
@@ -194,4 +197,7 @@
       IF( kt == nit000 ) CALL SBCBLK_ALGO_COARE3P0_INIT(l_use_cs, l_use_wl)
 
+      nbit = nb_iter0
+      IF( PRESENT(nb_iter) ) nbit = nb_iter
+
       l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp ) ! testing "zu == zt" is risky with double precision
       IF( .NOT. l_zt_equal_zu )  ALLOCATE( zeta_t(jpi,jpj) )
@@ -211,5 +217,4 @@
       ENDIF
 
-
       !! First guess of temperature and humidity at height zu:
       t_zu = MAX( t_zt ,  180._wp )   ! who knows what's given on masked-continental regions...
@@ -222,11 +227,11 @@
       znu_a = visc_air(t_zu) ! Air viscosity (m^2/s) at zt given from temperature in (K)
 
-      U_blk = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
+      Ubzu = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
 
       ztmp0   = LOG(    zu*10000._wp) ! optimization: 10000. == 1/z0 (with z0 first guess == 0.0001)
       ztmp1   = LOG(10._wp*10000._wp) !       "                    "               "
-      u_star = 0.035_wp*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
-
-      z0     = alfa_charn_3p0(U_zu)*u_star*u_star/grav + 0.11_wp*znu_a/u_star
+      u_star = 0.035_wp*Ubzu*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+      z0     = charn_coare3p0(U_zu)*u_star*u_star/grav + 0.11_wp*znu_a/u_star
       z0     = MIN( MAX(ABS(z0), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
@@ -234,21 +239,19 @@
       z0t    = MIN( MAX(ABS(z0t), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
-      Cd     = (vkarmn/ztmp0)**2    ! first guess of Cd
-
-      ztmp0 = vkarmn*vkarmn/LOG(zt/z0t)/Cd
-
-      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, U_blk ) ! Bulk Richardson Number (BRN)
+      Cd     = MAX( (vkarmn/ztmp0)**2 , Cx_min )    ! first guess of Cd
+
+      ztmp0 = vkarmn2/LOG(zt/z0t)/Cd
+
+      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, Ubzu ) ! Bulk Richardson Number (BRN)
 
       !! First estimate of zeta_u, depending on the stability, ie sign of BRN (ztmp2):
       ztmp1 = 0.5 + SIGN( 0.5_wp , ztmp2 )
-      ztmp0 = ztmp0*ztmp2
-      zeta_u = (1._wp-ztmp1) * (ztmp0/(1._wp+ztmp2/(-zu/(zi0*0.004_wp*Beta0**3)))) & !  BRN < 0
-         &  +     ztmp1   * (ztmp0*(1._wp + 27._wp/9._wp*ztmp2/ztmp0))               !  BRN > 0
-      !#LB: should make sure that the "ztmp0" of "27./9.*ztmp2/ztmp0" is "ztmp0*ztmp2" and not "ztmp0==vkarmn*vkarmn/LOG(zt/z0t)/Cd" !
+      zeta_u = (1._wp - ztmp1) *   ztmp0*ztmp2 / (1._wp - ztmp2*zi0*0.004_wp*Beta0**3/zu) & !  BRN < 0
+         &  +       ztmp1      * ( ztmp0*ztmp2 + 27._wp/9._wp*ztmp2*ztmp2 )                 !  BRN > 0
 
       !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
       ztmp0  = vkarmn/(LOG(zu/z0t) - psi_h_coare(zeta_u))
 
-      u_star = MAX ( U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
+      u_star = MAX ( Ubzu*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
       t_star = dt_zu*ztmp0
       q_star = dq_zu*ztmp0
@@ -269,9 +272,9 @@
 
       !! ITERATION BLOCK
-      DO j_itt = 1, nb_itt
-
-         !!Inverse of Monin-Obukov length (1/L) :
-         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Monin-Obukhov length]
-         ztmp0 = SIGN( MIN(ABS(ztmp0),200._wp), ztmp0 ) ! (prevents FPE from stupid values from masked region later on...)
+      DO jit = 1, nbit
+
+         !!Inverse of Obukov length (1/L) :
+         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Obukhov length]
+         ztmp0 = SIGN( MIN(ABS(ztmp0),200._wp), ztmp0 ) ! 1/L (prevents FPE from stupid values from masked region later on...)
 
          ztmp1 = u_star*u_star   ! u*^2
@@ -280,13 +283,13 @@
          ztmp2 = Beta0*Beta0*ztmp1*(MAX(-zi0*ztmp0/vkarmn,0._wp))**(2._wp/3._wp) ! square of wind gustiness contribution, ztmp2 == Ug^2
          !!   ! Only true when unstable (L<0) => when ztmp0 < 0 => explains "-" before zi0
-         U_blk = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
-         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+         Ubzu = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
+         ! => 0.2 prevents Ubzu to be 0 in stable case when U_zu=0.
 
          !! Stability parameters:
          zeta_u = zu*ztmp0
-         zeta_u = SIGN( MIN(ABS(zeta_u),50.0_wp), zeta_u )
+         zeta_u = SIGN( MIN(ABS(zeta_u),zeta_abs_max), zeta_u )
          IF( .NOT. l_zt_equal_zu ) THEN
             zeta_t = zt*ztmp0
-            zeta_t = SIGN( MIN(ABS(zeta_t),50.0_wp), zeta_t )
+            zeta_t = SIGN( MIN(ABS(zeta_t),zeta_abs_max), zeta_t )
          ENDIF
 
@@ -296,5 +299,5 @@
          !! Roughness lengthes z0, z0t (z0q = z0t) :
          ztmp2 = u_star/vkarmn*LOG(10./z0)                                 ! Neutral wind speed at 10m
-         z0    = alfa_charn_3p0(ztmp2)*ztmp1/grav + 0.11_wp*znu_a/u_star   ! Roughness length (eq.6) [ ztmp1==u*^2 ]
+         z0    = charn_coare3p0(ztmp2)*ztmp1/grav + 0.11_wp*znu_a/u_star   ! Roughness length (eq.6) [ ztmp1==u*^2 ]
          z0     = MIN( MAX(ABS(z0), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
@@ -309,5 +312,5 @@
          t_star = dt_zu*ztmp1
          q_star = dq_zu*ztmp1
-         u_star = MAX( U_blk*vkarmn/(LOG(zu) - LOG(z0) - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
+         u_star = MAX( Ubzu*vkarmn/(LOG(zu) - LOG(z0) - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
 
          IF( .NOT. l_zt_equal_zu ) THEN
@@ -318,9 +321,8 @@
          ENDIF
 
-
          IF( l_use_cs ) THEN
             !! Cool-skin contribution
 
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, zeta_u,  Qlat=ztmp2)  ! Qnsol -> ztmp1 / Tau -> zeta_u
 
@@ -330,13 +332,12 @@
             IF( l_use_wl ) T_s(:,:) = T_s(:,:) + dT_wl(:,:)*tmask(:,:,1)
             q_s(:,:) = rdct_qsat_salt*q_sat(MAX(T_s(:,:), 200._wp), slp(:,:))
-
          ENDIF
 
          IF( l_use_wl ) THEN
             !! Warm-layer contribution
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, zeta_u)  ! Qnsol -> ztmp1 / Tau -> zeta_u
             !! In WL_COARE or , Tau_ac and Qnt_ac must be updated at the final itteration step => add a flag to do this!
-            CALL WL_COARE( Qsw, ztmp1, zeta_u, zsst, MOD(nb_itt,j_itt) )
+            CALL WL_COARE( Qsw, ztmp1, zeta_u, zsst, MOD(nbit,jit) )
 
             !! Updating T_s and q_s !!!
@@ -351,18 +352,17 @@
          ENDIF
 
-      END DO !DO j_itt = 1, nb_itt
+      END DO !DO jit = 1, nbit
 
       ! compute transfer coefficients at zu :
-      ztmp0 = u_star/U_blk
-      Cd   = ztmp0*ztmp0
-      Ch   = ztmp0*t_star/dt_zu
-      Ce   = ztmp0*q_star/dq_zu
-
-      ztmp1 = zu + z0
-      Cdn = vkarmn*vkarmn / (log(ztmp1/z0 )*log(ztmp1/z0 ))
-      Chn = vkarmn*vkarmn / (log(ztmp1/z0t)*log(ztmp1/z0t))
-      Cen = Chn
+      ztmp0 = u_star/Ubzu
+      Cd   = MAX( ztmp0*ztmp0        , Cx_min )
+      Ch   = MAX( ztmp0*t_star/dt_zu , Cx_min )
+      Ce   = MAX( ztmp0*q_star/dq_zu , Cx_min )
 
       IF( .NOT. l_zt_equal_zu ) DEALLOCATE( zeta_t )
+
+      IF(PRESENT(Cdn)) Cdn = MAX( vkarmn2 / (LOG(zu/z0 )*LOG(zu/z0 )) , Cx_min )
+      IF(PRESENT(Chn)) Chn = MAX( vkarmn2 / (LOG(zu/z0t)*LOG(zu/z0t)) , Cx_min )
+      IF(PRESENT(Cen)) Cen = MAX( vkarmn2 / (LOG(zu/z0t)*LOG(zu/z0t)) , Cx_min )
 
       IF( l_use_cs .AND. PRESENT(pdT_cs) ) pdT_cs = dT_cs
@@ -375,5 +375,5 @@
 
 
-   FUNCTION alfa_charn_3p0( pwnd )
+   FUNCTION charn_coare3p0( pwnd )
       !!-------------------------------------------------------------------
       !! Compute the Charnock parameter as a function of the wind speed
@@ -387,5 +387,5 @@
       !! Author: L. Brodeau, June 2016 / AeroBulk  (https://github.com/brodeau/aerobulk/)
       !!-------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) :: alfa_charn_3p0
+      REAL(wp), DIMENSION(jpi,jpj) :: charn_coare3p0
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pwnd   ! wind speed
       !
@@ -393,20 +393,18 @@
       REAL(wp) :: zw, zgt10, zgt18
       !!-------------------------------------------------------------------
-      !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zw = pwnd(ji,jj)   ! wind speed
-      !
-      ! Charnock's constant, increases with the wind :
-      zgt10 = 0.5 + SIGN(0.5_wp,(zw - 10))  ! If zw<10. --> 0, else --> 1
-      zgt18 = 0.5 + SIGN(0.5_wp,(zw - 18.)) ! If zw<18. --> 0, else --> 1
-      !
-      alfa_charn_3p0(ji,jj) =  (1. - zgt10)*0.011    &    ! wind is lower than 10 m/s
-         &     + zgt10*((1. - zgt18)*(0.011 + (0.018 - 0.011) &
-         &      *(zw - 10.)/(18. - 10.)) + zgt18*( 0.018 ) )    ! Hare et al. (1999)
-      !
+            !
+            zw = pwnd(ji,jj)   ! wind speed
+            !
+            ! Charnock's constant, increases with the wind :
+            zgt10 = 0.5 + SIGN(0.5_wp,(zw - 10))  ! If zw<10. --> 0, else --> 1
+            zgt18 = 0.5 + SIGN(0.5_wp,(zw - 18.)) ! If zw<18. --> 0, else --> 1
+            !
+            charn_coare3p0(ji,jj) =  (1. - zgt10)*0.011    &    ! wind is lower than 10 m/s
+               &     + zgt10*((1. - zgt18)*(0.011 + (0.018 - 0.011) &
+               &      *(zw - 10.)/(18. - 10.)) + zgt18*( 0.018 ) )    ! Hare et al. (1999)
+            !
       END_2D
-      !
-   END FUNCTION alfa_charn_3p0
+   END FUNCTION charn_coare3p0
 
    FUNCTION psi_m_coare( pzeta )
@@ -429,30 +427,27 @@
       REAL(wp) :: zta, zphi_m, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
       !!----------------------------------------------------------------------------------
-      !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zta = pzeta(ji,jj)
-      !
-      zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
-      !
-      zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
-         & - 2.*ATAN(zphi_m) + 0.5*rpi
-      !
-      zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
-      !
-      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-         &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-      !
-      zf = zta*zta
-      zf = zf/(1. + zf)
-      zc = MIN(50._wp, 0.35_wp*zta)
-      zstab = 0.5 + SIGN(0.5_wp, zta)
-      !
-      psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
-         &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
-         &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
-      !
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+            !
+            zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+               & - 2.*ATAN(zphi_m) + 0.5*rpi
+            !
+            zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50._wp, 0.35_wp*zta)
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            !
+            psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+               &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+               &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )  !     "
       END_2D
-      !
    END FUNCTION psi_m_coare
 
@@ -474,5 +469,4 @@
       !!         (https://github.com/brodeau/aerobulk/)
       !!----------------------------------------------------------------
-      !!
       REAL(wp), DIMENSION(jpi,jpj) :: psi_h_coare
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
@@ -480,29 +474,27 @@
       INTEGER  ::   ji, jj     ! dummy loop indices
       REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
-      !
+      !!----------------------------------------------------------------
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zta = pzeta(ji,jj)
-      !
-      zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
-      !
-      zpsi_k = 2.*LOG((1. + zphi_h)/2.)
-      !
-      zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
-      !
-      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-         &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-      !
-      zf = zta*zta
-      zf = zf/(1. + zf)
-      zc = MIN(50._wp,0.35_wp*zta)
-      zstab = 0.5 + SIGN(0.5_wp, zta)
-      !
-      psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
-         &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
-         &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
-      !
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+            !
+            zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+            !
+            zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50._wp,0.35_wp*zta)
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            !
+            psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+               &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+               &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
       END_2D
-      !
    END FUNCTION psi_h_coare
 
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p6.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p6.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_coare3p6.F90	(revision 14072)
@@ -7,5 +7,5 @@
    !!   * bulk transfer coefficients C_D, C_E and C_H
    !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
-   !!   * the effective bulk wind speed at 10m U_blk
+   !!   * the effective bulk wind speed at 10m Ubzu
    !!   => all these are used in bulk formulas in sbcblk.F90
    !!
@@ -16,4 +16,5 @@
    !!----------------------------------------------------------------------
    !! History :  4.0  !  2016-02  (L.Brodeau)   Original code
+   !!            4.2  !  2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
 
@@ -23,19 +24,9 @@
    !!                   returns the effective bulk wind speed at 10m
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
-   USE iom             ! I/O manager library
-   USE lib_mpp         ! distribued memory computing library
-   USE in_out_manager  ! I/O manager
-   USE prtctl          ! Print control
-   USE sbcwave, ONLY   :  cdn_wave ! wave module
-#if defined key_si3 || defined key_cice
-   USE sbc_ice         ! Surface boundary condition: ice fields
-#endif
-   USE lib_fortran     ! to use key_nosignedzero
-
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbcblk_phy      ! all thermodynamics functions, rho_air, q_sat, etc... !LB
+   USE lib_mpp,        ONLY: ctl_stop         ! distribued memory computing library
+   USE in_out_manager, ONLY: nit000  ! I/O manager
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
    USE sbcblk_skin_coare ! cool-skin/warm layer scheme (CSWL_ECMWF) !LB
 
@@ -50,6 +41,5 @@
    REAL(wp), PARAMETER :: zi0   = 600._wp     ! scale height of the atmospheric boundary layer...
    REAL(wp), PARAMETER :: Beta0 =  1.2_wp     ! gustiness parameter
-
-   INTEGER , PARAMETER ::   nb_itt = 10             ! number of itterations
+   REAL(wp), PARAMETER :: zeta_abs_max = 50._wp
 
    !!----------------------------------------------------------------------
@@ -90,8 +80,8 @@
 
    SUBROUTINE turb_coare3p6( kt, zt, zu, T_s, t_zt, q_s, q_zt, U_zu, l_use_cs, l_use_wl, &
-      &                      Cd, Ch, Ce, t_zu, q_zu, U_blk,                              &
-      &                      Cdn, Chn, Cen,                                              &
+      &                      Cd, Ch, Ce, t_zu, q_zu, Ubzu,                               &
+      &                      nb_iter, Cdn, Chn, Cen,                                     & ! optional output
       &                      Qsw, rad_lw, slp, pdT_cs,                                   & ! optionals for cool-skin (and warm-layer)
-      &                      pdT_wl, pHz_wl )                                                 ! optionals for warm-layer only
+      &                      pdT_wl, pHz_wl )                                              ! optionals for warm-layer only
       !!----------------------------------------------------------------------
       !!                      ***  ROUTINE  turb_coare3p6  ***
@@ -147,5 +137,5 @@
       !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
       !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
-      !!    *  U_blk  : bulk wind speed at zu                                 [m/s]
+      !!    *  Ubzu  : bulk wind speed at zu                                 [m/s]
       !!
       !!
@@ -167,7 +157,10 @@
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind speed at zu                     [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cdn, Chn, Cen ! neutral transfer coefficients
-      !
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ubzu    ! bulk wind speed at zu                     [m/s]
+      !
+      INTEGER , INTENT(in   ), OPTIONAL                     :: nb_iter  ! number of iterations
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CdN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   ChN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CeN
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   Qsw      !             [W/m^2]
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   rad_lw   !             [W/m^2]
@@ -177,5 +170,5 @@
       REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   pHz_wl   !             [m]
       !
-      INTEGER :: j_itt
+      INTEGER :: nbit, jit
       LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
       !
@@ -194,4 +187,7 @@
       IF( kt == nit000 ) CALL SBCBLK_ALGO_COARE3P6_INIT(l_use_cs, l_use_wl)
 
+      nbit = nb_iter0
+      IF( PRESENT(nb_iter) ) nbit = nb_iter
+
       l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp ) ! testing "zu == zt" is risky with double precision
       IF( .NOT. l_zt_equal_zu )  ALLOCATE( zeta_t(jpi,jpj) )
@@ -211,5 +207,4 @@
       ENDIF
 
-
       !! First guess of temperature and humidity at height zu:
       t_zu = MAX( t_zt ,  180._wp )   ! who knows what's given on masked-continental regions...
@@ -222,11 +217,11 @@
       znu_a = visc_air(t_zu) ! Air viscosity (m^2/s) at zt given from temperature in (K)
 
-      U_blk = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
+      Ubzu = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
 
       ztmp0   = LOG(    zu*10000._wp) ! optimization: 10000. == 1/z0 (with z0 first guess == 0.0001)
       ztmp1   = LOG(10._wp*10000._wp) !       "                    "               "
-      u_star = 0.035_wp*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
-
-      z0     = alfa_charn_3p6(U_zu)*u_star*u_star/grav + 0.11_wp*znu_a/u_star
+      u_star = 0.035_wp*Ubzu*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+      z0     = charn_coare3p6(U_zu)*u_star*u_star/grav + 0.11_wp*znu_a/u_star
       z0     = MIN( MAX(ABS(z0), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
@@ -234,21 +229,19 @@
       z0t    = MIN( MAX(ABS(z0t), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
-      Cd     = (vkarmn/ztmp0)**2    ! first guess of Cd
-
-      ztmp0 = vkarmn*vkarmn/LOG(zt/z0t)/Cd
-
-      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, U_blk ) ! Bulk Richardson Number (BRN)
+      Cd     = MAX( (vkarmn/ztmp0)**2 , Cx_min )    ! first guess of Cd
+
+      ztmp0 = vkarmn2/LOG(zt/z0t)/Cd
+
+      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, Ubzu ) ! Bulk Richardson Number (BRN)
 
       !! First estimate of zeta_u, depending on the stability, ie sign of BRN (ztmp2):
       ztmp1 = 0.5 + SIGN( 0.5_wp , ztmp2 )
-      ztmp0 = ztmp0*ztmp2
-      zeta_u = (1._wp-ztmp1) * (ztmp0/(1._wp+ztmp2/(-zu/(zi0*0.004_wp*Beta0**3)))) & !  BRN < 0
-         &  +     ztmp1   * (ztmp0*(1._wp + 27._wp/9._wp*ztmp2/ztmp0))               !  BRN > 0
-      !#LB: should make sure that the "ztmp0" of "27./9.*ztmp2/ztmp0" is "ztmp0*ztmp2" and not "ztmp0==vkarmn*vkarmn/LOG(zt/z0t)/Cd" !
+      zeta_u = (1._wp - ztmp1) *   ztmp0*ztmp2 / (1._wp - ztmp2*zi0*0.004_wp*Beta0**3/zu) & !  BRN < 0
+         &  +       ztmp1      * ( ztmp0*ztmp2 + 27._wp/9._wp*ztmp2*ztmp2 )                 !  BRN > 0
 
       !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
       ztmp0  = vkarmn/(LOG(zu/z0t) - psi_h_coare(zeta_u))
 
-      u_star = MAX ( U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
+      u_star = MAX ( Ubzu*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
       t_star = dt_zu*ztmp0
       q_star = dq_zu*ztmp0
@@ -269,9 +262,9 @@
 
       !! ITERATION BLOCK
-      DO j_itt = 1, nb_itt
-
-         !!Inverse of Monin-Obukov length (1/L) :
-         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Monin-Obukhov length]
-         ztmp0 = SIGN( MIN(ABS(ztmp0),200._wp), ztmp0 ) ! (prevents FPE from stupid values from masked region later on...)
+      DO jit = 1, nbit
+
+         !!Inverse of Obukov length (1/L) :
+         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Obukhov length]
+         ztmp0 = SIGN( MIN(ABS(ztmp0),200._wp), ztmp0 ) ! 1/L (prevents FPE from stupid values from masked region later on...)
 
          ztmp1 = u_star*u_star   ! u*^2
@@ -280,13 +273,13 @@
          ztmp2 = Beta0*Beta0*ztmp1*(MAX(-zi0*ztmp0/vkarmn,0._wp))**(2._wp/3._wp) ! square of wind gustiness contribution, ztmp2 == Ug^2
          !!   ! Only true when unstable (L<0) => when ztmp0 < 0 => explains "-" before zi0
-         U_blk = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
-         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+         Ubzu = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
+         ! => 0.2 prevents Ubzu to be 0 in stable case when U_zu=0.
 
          !! Stability parameters:
          zeta_u = zu*ztmp0
-         zeta_u = SIGN( MIN(ABS(zeta_u),50.0_wp), zeta_u )
+         zeta_u = SIGN( MIN(ABS(zeta_u),zeta_abs_max), zeta_u )
          IF( .NOT. l_zt_equal_zu ) THEN
             zeta_t = zt*ztmp0
-            zeta_t = SIGN( MIN(ABS(zeta_t),50.0_wp), zeta_t )
+            zeta_t = SIGN( MIN(ABS(zeta_t),zeta_abs_max), zeta_t )
          ENDIF
 
@@ -296,5 +289,5 @@
          !! Roughness lengthes z0, z0t (z0q = z0t) :
          ztmp2 = u_star/vkarmn*LOG(10./z0)                                 ! Neutral wind speed at 10m
-         z0    = alfa_charn_3p6(ztmp2)*ztmp1/grav + 0.11_wp*znu_a/u_star   ! Roughness length (eq.6) [ ztmp1==u*^2 ]
+         z0    = charn_coare3p6(ztmp2)*ztmp1/grav + 0.11_wp*znu_a/u_star   ! Roughness length (eq.6) [ ztmp1==u*^2 ]
          z0     = MIN( MAX(ABS(z0), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
@@ -309,5 +302,5 @@
          t_star = dt_zu*ztmp1
          q_star = dq_zu*ztmp1
-         u_star = MAX( U_blk*vkarmn/(LOG(zu) - LOG(z0) - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
+         u_star = MAX( Ubzu*vkarmn/(LOG(zu) - LOG(z0) - psi_m_coare(zeta_u)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
 
          IF( .NOT. l_zt_equal_zu ) THEN
@@ -318,9 +311,8 @@
          ENDIF
 
-
          IF( l_use_cs ) THEN
             !! Cool-skin contribution
 
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, zeta_u,  Qlat=ztmp2)  ! Qnsol -> ztmp1 / Tau -> zeta_u
 
@@ -330,13 +322,12 @@
             IF( l_use_wl ) T_s(:,:) = T_s(:,:) + dT_wl(:,:)*tmask(:,:,1)
             q_s(:,:) = rdct_qsat_salt*q_sat(MAX(T_s(:,:), 200._wp), slp(:,:))
-
          ENDIF
 
          IF( l_use_wl ) THEN
             !! Warm-layer contribution
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, zeta_u)  ! Qnsol -> ztmp1 / Tau -> zeta_u
             !! In WL_COARE or , Tau_ac and Qnt_ac must be updated at the final itteration step => add a flag to do this!
-            CALL WL_COARE( Qsw, ztmp1, zeta_u, zsst, MOD(nb_itt,j_itt) )
+            CALL WL_COARE( Qsw, ztmp1, zeta_u, zsst, MOD(nbit,jit) )
 
             !! Updating T_s and q_s !!!
@@ -351,18 +342,17 @@
          ENDIF
 
-      END DO !DO j_itt = 1, nb_itt
+      END DO !DO jit = 1, nbit
 
       ! compute transfer coefficients at zu :
-      ztmp0 = u_star/U_blk
-      Cd   = ztmp0*ztmp0
-      Ch   = ztmp0*t_star/dt_zu
-      Ce   = ztmp0*q_star/dq_zu
-
-      ztmp1 = zu + z0
-      Cdn = vkarmn*vkarmn / (log(ztmp1/z0 )*log(ztmp1/z0 ))
-      Chn = vkarmn*vkarmn / (log(ztmp1/z0t)*log(ztmp1/z0t))
-      Cen = Chn
+      ztmp0 = u_star/Ubzu
+      Cd   = MAX( ztmp0*ztmp0        , Cx_min )
+      Ch   = MAX( ztmp0*t_star/dt_zu , Cx_min )
+      Ce   = MAX( ztmp0*q_star/dq_zu , Cx_min )
 
       IF( .NOT. l_zt_equal_zu ) DEALLOCATE( zeta_t )
+
+      IF(PRESENT(Cdn)) Cdn = MAX( vkarmn2 / (LOG(zu/z0 )*LOG(zu/z0 )) , Cx_min )
+      IF(PRESENT(Chn)) Chn = MAX( vkarmn2 / (LOG(zu/z0t)*LOG(zu/z0t)) , Cx_min )
+      IF(PRESENT(Cen)) Cen = MAX( vkarmn2 / (LOG(zu/z0t)*LOG(zu/z0t)) , Cx_min )
 
       IF( l_use_cs .AND. PRESENT(pdT_cs) ) pdT_cs = dT_cs
@@ -375,5 +365,5 @@
 
 
-   FUNCTION alfa_charn_3p6( pwnd )
+   FUNCTION charn_coare3p6( pwnd )
       !!-------------------------------------------------------------------
       !! Computes the Charnock parameter as a function of the Neutral wind speed at 10m
@@ -383,14 +373,14 @@
       !! Author: L. Brodeau, July 2019 / AeroBulk  (https://github.com/brodeau/aerobulk/)
       !!-------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) :: alfa_charn_3p6
+      REAL(wp), DIMENSION(jpi,jpj) :: charn_coare3p6
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pwnd   ! neutral wind speed at 10m
       !
       REAL(wp), PARAMETER :: charn0_max = 0.028  !: value above which the Charnock parameter levels off for winds > 18 m/s
       !!-------------------------------------------------------------------
-      alfa_charn_3p6 = MAX( MIN( 0.0017_wp*pwnd - 0.005_wp , charn0_max) , 0._wp )
-      !!
-   END FUNCTION alfa_charn_3p6
-
-   FUNCTION alfa_charn_3p6_wave( pus, pwsh, pwps )
+      charn_coare3p6 = MAX( MIN( 0.0017_wp*pwnd - 0.005_wp , charn0_max) , 0._wp )
+      !!
+   END FUNCTION charn_coare3p6
+
+   FUNCTION charn_coare3p6_wave( pus, pwsh, pwps )
       !!-------------------------------------------------------------------
       !! Computes the Charnock parameter as a function of wave information and u*
@@ -400,12 +390,12 @@
       !! Author: L. Brodeau, October 2019 / AeroBulk  (https://github.com/brodeau/aerobulk/)
       !!-------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) :: alfa_charn_3p6_wave
+      REAL(wp), DIMENSION(jpi,jpj) :: charn_coare3p6_wave
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pus   ! friction velocity             [m/s]
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pwsh  ! significant wave height       [m]
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pwps  ! phase speed of dominant waves [m/s]
       !!-------------------------------------------------------------------
-      alfa_charn_3p6_wave = ( pwsh*0.2_wp*(pus/pwps)**2.2_wp ) * grav/(pus*pus)
-      !!
-   END FUNCTION alfa_charn_3p6_wave
+      charn_coare3p6_wave = ( pwsh*0.2_wp*(pus/pwps)**2.2_wp ) * grav/(pus*pus)
+      !!
+   END FUNCTION charn_coare3p6_wave
 
 
@@ -429,30 +419,27 @@
       REAL(wp) :: zta, zphi_m, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
       !!----------------------------------------------------------------------------------
-      !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zta = pzeta(ji,jj)
-      !
-      zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
-      !
-      zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
-         & - 2.*ATAN(zphi_m) + 0.5*rpi
-      !
-      zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
-      !
-      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-         &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-      !
-      zf = zta*zta
-      zf = zf/(1. + zf)
-      zc = MIN(50._wp, 0.35_wp*zta)
-      zstab = 0.5 + SIGN(0.5_wp, zta)
-      !
-      psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
-         &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
-         &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
-      !
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+            !
+            zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+               & - 2.*ATAN(zphi_m) + 0.5*rpi
+            !
+            zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50._wp, 0.35_wp*zta)
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            !
+            psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+               &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+               &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )  !     "
       END_2D
-      !
    END FUNCTION psi_m_coare
 
@@ -474,5 +461,4 @@
       !!         (https://github.com/brodeau/aerobulk/)
       !!----------------------------------------------------------------
-      !!
       REAL(wp), DIMENSION(jpi,jpj) :: psi_h_coare
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
@@ -480,29 +466,27 @@
       INTEGER  ::   ji, jj     ! dummy loop indices
       REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
-      !
+      !!----------------------------------------------------------------
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zta = pzeta(ji,jj)
-      !
-      zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
-      !
-      zpsi_k = 2.*LOG((1. + zphi_h)/2.)
-      !
-      zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
-      !
-      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-         &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-      !
-      zf = zta*zta
-      zf = zf/(1. + zf)
-      zc = MIN(50._wp,0.35_wp*zta)
-      zstab = 0.5 + SIGN(0.5_wp, zta)
-      !
-      psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
-         &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
-         &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
-      !
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+            !
+            zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+            !
+            zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50._wp,0.35_wp*zta)
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            !
+            psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+               &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+               &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
       END_2D
-      !
    END FUNCTION psi_h_coare
 
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ecmwf.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ecmwf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ecmwf.F90	(revision 14072)
@@ -5,5 +5,5 @@
    !!   * bulk transfer coefficients C_D, C_E and C_H
    !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
-   !!   * the effective bulk wind speed at 10m U_blk
+   !!   * the effective bulk wind speed at 10m Ubzu
    !!   => all these are used in bulk formulas in sbcblk.F90
    !!
@@ -17,5 +17,5 @@
    !!----------------------------------------------------------------------
    !! History :  4.0  !  2016-02  (L.Brodeau)   Original code
-   !!            4.2  !  2020-12  (G. Madec, E. Clementi) Charnock coeff from wave model
+   !!            4.2  !  2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
 
@@ -25,19 +25,9 @@
    !!                   returns the effective bulk wind speed at 10m
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
-   USE iom             ! I/O manager library
-   USE lib_mpp         ! distribued memory computing library
-   USE in_out_manager  ! I/O manager
-   USE prtctl          ! Print control
-   USE sbcwave, ONLY   : charn ! wave module
-#if defined key_si3 || defined key_cice
-   USE sbc_ice         ! Surface boundary condition: ice fields
-#endif
-   USE lib_fortran     ! to use key_nosignedzero
-
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbcblk_phy      ! all thermodynamics functions, rho_air, q_sat, etc... !LB
+   USE lib_mpp,        ONLY: ctl_stop         ! distribued memory computing library
+   USE in_out_manager, ONLY: nit000  ! I/O manager
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
    USE sbcblk_skin_ecmwf ! cool-skin/warm layer scheme !LB
 
@@ -46,9 +36,7 @@
 
    PUBLIC :: SBCBLK_ALGO_ECMWF_INIT, TURB_ECMWF
-   !! * Substitutions
-#  include "do_loop_substitute.h90"
 
    !! ECMWF own values for given constants, taken form IFS documentation...
-   REAL(wp), PARAMETER ::   charn0 = 0.018    ! Charnock constant (pretty high value here !!!
+   REAL(wp), PARAMETER, PUBLIC :: charn0_ecmwf = 0.018_wp    ! Charnock constant (pretty high value here !!!
    !                                          !    =>  Usually 0.011 for moderate winds)
    REAL(wp), PARAMETER ::   zi0     = 1000.   ! scale height of the atmospheric boundary layer...1
@@ -58,5 +46,6 @@
    REAL(wp), PARAMETER ::   alpha_Q = 0.62    !
 
-   INTEGER , PARAMETER ::   nb_itt = 10             ! number of itterations
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
 
    !!----------------------------------------------------------------------
@@ -95,6 +84,6 @@
 
    SUBROUTINE turb_ecmwf( kt, zt, zu, T_s, t_zt, q_s, q_zt, U_zu, l_use_cs, l_use_wl, &
-      &                      Cd, Ch, Ce, t_zu, q_zu, U_blk,                           &
-      &                      Cdn, Chn, Cen,                                           &
+      &                      Cd, Ch, Ce, t_zu, q_zu, Ubzu,                            &
+      &                      nb_iter, Cdn, Chn, Cen,                                           & ! optional output
       &                      Qsw, rad_lw, slp, pdT_cs,                                & ! optionals for cool-skin (and warm-layer)
       &                      pdT_wl, pHz_wl )                                           ! optionals for warm-layer only
@@ -152,5 +141,5 @@
       !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
       !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
-      !!    *  U_blk  : bulk wind speed at zu                                 [m/s]
+      !!    *  Ubzu   : bulk wind speed at zu                                 [m/s]
       !!
       !!
@@ -172,7 +161,10 @@
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind speed at zu                     [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cdn, Chn, Cen ! neutral transfer coefficients
-      !
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ubzu    ! bulk wind speed at zu                     [m/s]
+      !
+      INTEGER , INTENT(in   ), OPTIONAL                     :: nb_iter  ! number of iterations
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CdN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   ChN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CeN
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   Qsw      !             [W/m^2]
       REAL(wp), INTENT(in   ), OPTIONAL, DIMENSION(jpi,jpj) ::   rad_lw   !             [W/m^2]
@@ -182,5 +174,5 @@
       REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   pHz_wl   !             [m]
       !
-      INTEGER :: j_itt
+      INTEGER :: nbit, jit
       LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
       !
@@ -198,4 +190,7 @@
       !!----------------------------------------------------------------------------------
       IF( kt == nit000 ) CALL SBCBLK_ALGO_ECMWF_INIT(l_use_cs, l_use_wl)
+
+      nbit = nb_iter0
+      IF( PRESENT(nb_iter) ) nbit = nb_iter
 
       l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp ) ! testing "zu == zt" is risky with double precision
@@ -228,16 +223,11 @@
       znu_a = visc_air(t_zu) ! Air viscosity (m^2/s) at zt given from temperature in (K)
 
-      U_blk = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
+      Ubzu = SQRT(U_zu*U_zu + 0.5_wp*0.5_wp) ! initial guess for wind gustiness contribution
 
       ztmp0   = LOG(    zu*10000._wp) ! optimization: 10000. == 1/z0 (with z0 first guess == 0.0001)
       ztmp1   = LOG(10._wp*10000._wp) !       "                    "               "
-      u_star = 0.035_wp*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
-
-      IF (ln_charn)  THEN          !  Charnock value if wave coupling
-         z0     = charn*u_star*u_star/grav + 0.11_wp*znu_a/u_star
-      ELSE
-         z0     = charn0*u_star*u_star/grav + 0.11_wp*znu_a/u_star
-      ENDIF
-
+      u_star = 0.035_wp*Ubzu*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+      z0     = charn0_ecmwf*u_star*u_star/grav + 0.11_wp*znu_a/u_star
       z0     = MIN( MAX(ABS(z0), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
@@ -245,21 +235,19 @@
       z0t    = MIN( MAX(ABS(z0t), 1.E-9) , 1._wp )                      ! (prevents FPE from stupid values from masked region later on)
 
-      Cd     = (vkarmn/ztmp0)**2    ! first guess of Cd
-
-      ztmp0 = vkarmn*vkarmn/LOG(zt/z0t)/Cd
-
-      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, U_blk ) ! Bulk Richardson Number (BRN)
+      Cd     = MAX( (vkarmn/ztmp0)**2 , Cx_min )   ! first guess of Cd
+
+      ztmp0 = vkarmn2/LOG(zt/z0t)/Cd
+
+      ztmp2 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, Ubzu ) ! Bulk Richardson Number (BRN)
 
       !! First estimate of zeta_u, depending on the stability, ie sign of BRN (ztmp2):
       ztmp1 = 0.5 + SIGN( 0.5_wp , ztmp2 )
-      func_m = ztmp0*ztmp2 ! temporary array !!
-      func_h = (1._wp-ztmp1) * (func_m/(1._wp+ztmp2/(-zu/(zi0*0.004_wp*Beta0**3)))) & !  BRN < 0 ! temporary array !!! func_h == zeta_u
-         &  +     ztmp1   * (func_m*(1._wp + 27._wp/9._wp*ztmp2/func_m))              !  BRN > 0
-      !#LB: should make sure that the "func_m" of "27./9.*ztmp2/func_m" is "ztmp0*ztmp2" and not "ztmp0==vkarmn*vkarmn/LOG(zt/z0t)/Cd" !
+      func_h = (1._wp - ztmp1) *   ztmp0*ztmp2 / (1._wp - ztmp2*zi0*0.004_wp*Beta0**3/zu) & !  BRN < 0
+         &  +       ztmp1      * ( ztmp0*ztmp2 + 27._wp/9._wp*ztmp2*ztmp2 )                 !  BRN > 0
 
       !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
       ztmp0  = vkarmn/(LOG(zu/z0t) - psi_h_ecmwf(func_h))
 
-      u_star = MAX ( U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_ecmwf(func_h)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
+      u_star = MAX ( Ubzu*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_ecmwf(func_h)) , 1.E-9 )  !  (MAX => prevents FPE from stupid values from masked region later on)
       t_star = dt_zu*ztmp0
       q_star = dq_zu*ztmp0
@@ -282,8 +270,8 @@
 
 
-      !! First guess of inverse of Monin-Obukov length (1/L) :
+      !! First guess of inverse of Obukov length (1/L) :
       Linv = One_on_L( t_zu, q_zu, u_star, t_star, q_star )
 
-      !! Functions such as  u* = U_blk*vkarmn/func_m
+      !! Functions such as  u* = Ubzu*vkarmn/func_m
       ztmp0 = zu*Linv
       func_m = LOG(zu) - LOG(z0)  - psi_m_ecmwf(ztmp0) + psi_m_ecmwf( z0*Linv)
@@ -291,10 +279,10 @@
 
       !! ITERATION BLOCK
-      DO j_itt = 1, nb_itt
+      DO jit = 1, nbit
 
          !! Bulk Richardson Number at z=zu (Eq. 3.25)
-         ztmp0 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, U_blk ) ! Bulk Richardson Number (BRN)
-
-         !! New estimate of the inverse of the Monin-Obukhon length (Linv == zeta/zu) :
+         ztmp0 = Ri_bulk( zu, T_s, t_zu, q_s, q_zu, Ubzu ) ! Bulk Richardson Number (BRN)
+
+         !! New estimate of the inverse of the Obukhon length (Linv == zeta/zu) :
          Linv = ztmp0*func_m*func_m/func_h / zu     ! From Eq. 3.23, Chap.3.2.3, IFS doc - Cy40r1
          !! Note: it is slightly different that the L we would get with the usual
@@ -305,20 +293,16 @@
 
          !! Need to update roughness lengthes:
-         u_star = U_blk*vkarmn/func_m
+         u_star = Ubzu*vkarmn/func_m
          ztmp2  = u_star*u_star
          ztmp1  = znu_a/u_star
-         IF (ln_charn) THEN     ! Charnock value if wave coupling
-            z0  = MIN( ABS( alpha_M*ztmp1 + charn*ztmp2/grav ) , 0.001_wp)         
-         ELSE
-            z0     = MIN( ABS( alpha_M*ztmp1 + charn0*ztmp2/grav ) , 0.001_wp)
-         ENDIF
-         z0t    = MIN( ABS( alpha_H*ztmp1                     ) , 0.001_wp)   ! eq.3.26, Chap.3, p.34, IFS doc - Cy31r1
-         z0q    = MIN( ABS( alpha_Q*ztmp1                     ) , 0.001_wp)
+         z0     = MIN( ABS( alpha_M*ztmp1 + charn0_ecmwf*ztmp2/grav ) , 0.001_wp)
+         z0t    = MIN( ABS( alpha_H*ztmp1                           ) , 0.001_wp)   ! eq.3.26, Chap.3, p.34, IFS doc - Cy31r1
+         z0q    = MIN( ABS( alpha_Q*ztmp1                           ) , 0.001_wp)
 
          !! Update wind at zu with convection-related wind gustiness in unstable conditions (Chap. 3.2, IFS doc - Cy40r1, Eq.3.17 and Eq.3.18 + Eq.3.8)
          ztmp2 = Beta0*Beta0*ztmp2*(MAX(-zi0*Linv/vkarmn,0._wp))**(2._wp/3._wp) ! square of wind gustiness contribution  (combining Eq. 3.8 and 3.18, hap.3, IFS doc - Cy31r1)
          !!   ! Only true when unstable (L<0) => when ztmp0 < 0 => explains "-" before zi0
-         U_blk = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
-         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+         Ubzu = MAX(SQRT(U_zu*U_zu + ztmp2), 0.2_wp)        ! include gustiness in bulk wind speed
+         ! => 0.2 prevents Ubzu to be 0 in stable case when U_zu=0.
 
 
@@ -356,5 +340,5 @@
             !! Cool-skin contribution
 
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, ztmp0,  Qlat=ztmp2)  ! Qnsol -> ztmp1 / Tau -> ztmp0
 
@@ -369,5 +353,5 @@
          IF( l_use_wl ) THEN
             !! Warm-layer contribution
-            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, U_blk, slp, rad_lw, &
+            CALL UPDATE_QNSOL_TAU( zu, T_s, q_s, t_zu, q_zu, u_star, t_star, q_star, U_zu, Ubzu, slp, rad_lw, &
                &                   ztmp1, ztmp2)  ! Qnsol -> ztmp1 / Tau -> ztmp2
             CALL WL_ECMWF( Qsw, ztmp1, u_star, zsst )
@@ -383,14 +367,14 @@
          ENDIF
 
-      END DO !DO j_itt = 1, nb_itt
-
-      Cd = vkarmn*vkarmn/(func_m*func_m)
-      Ch = vkarmn*vkarmn/(func_m*func_h)
-      ztmp2 = log(zu/z0q) - psi_h_ecmwf(zu*Linv) + psi_h_ecmwf(z0q*Linv)   ! func_q
-      Ce = vkarmn*vkarmn/(func_m*ztmp2)
-
-      Cdn = vkarmn*vkarmn / (log(zu/z0 )*log(zu/z0 ))
-      Chn = vkarmn*vkarmn / (log(zu/z0t)*log(zu/z0t))
-      Cen = vkarmn*vkarmn / (log(zu/z0q)*log(zu/z0q))
+      END DO !DO jit = 1, nbit
+
+      Cd = MAX( vkarmn2/(func_m*func_m) , Cx_min )
+      Ch = MAX( vkarmn2/(func_m*func_h) , Cx_min )
+      ztmp2 = LOG(zu/z0q) - psi_h_ecmwf(zu*Linv) + psi_h_ecmwf(z0q*Linv)   ! func_q
+      Ce = MAX( vkarmn2/(func_m*ztmp2)  , Cx_min )
+
+      IF(PRESENT(Cdn)) Cdn = MAX( vkarmn2 / (LOG(zu/z0 )*LOG(zu/z0 )) , Cx_min )
+      IF(PRESENT(Chn)) Chn = MAX( vkarmn2 / (LOG(zu/z0t)*LOG(zu/z0t)) , Cx_min )
+      IF(PRESENT(Cen)) Cen = MAX( vkarmn2 / (LOG(zu/z0q)*LOG(zu/z0q)) , Cx_min )
 
       IF( l_use_cs .AND. PRESENT(pdT_cs) ) pdT_cs = dT_cs
@@ -418,29 +402,26 @@
       !
       INTEGER  ::   ji, jj    ! dummy loop indices
-      REAL(wp) :: zzeta, zx, ztmp, psi_unst, psi_stab, stab
-      !!----------------------------------------------------------------------------------
+      REAL(wp) :: zta, zx2, zx, ztmp, zpsi_unst, zpsi_stab, zstab, zc
+      !!----------------------------------------------------------------------------------
+      zc = 5._wp/0.35_wp
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zzeta = MIN( pzeta(ji,jj) , 5._wp ) !! Very stable conditions (L positif and big!):
-      !
-      ! Unstable (Paulson 1970):
-      !   eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
-      zx = SQRT(ABS(1._wp - 16._wp*zzeta))
-      ztmp = 1._wp + SQRT(zx)
-      ztmp = ztmp*ztmp
-      psi_unst = LOG( 0.125_wp*ztmp*(1._wp + zx) )   &
-         &       -2._wp*ATAN( SQRT(zx) ) + 0.5_wp*rpi
-      !
-      ! Unstable:
-      ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
-      psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) &
-         &       - zzeta - 2._wp/3._wp*5._wp/0.35_wp
-      !
-      ! Combining:
-      stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
-      !
-      psi_m_ecmwf(ji,jj) = (1._wp - stab) * psi_unst & ! (zzeta < 0) Unstable
-         &                +      stab  * psi_stab      ! (zzeta > 0) Stable
-      !
+            !
+            zta = MIN( pzeta(ji,jj) , 5._wp ) !! Very stable conditions (L positif and big!):
+
+            ! *** Unstable (Paulson 1970)    [eq.3.20, Chap.3, p.33, IFS doc - Cy31r1] :
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 - 16z)^0.5
+            zx  = SQRT(zx2)                          ! (1 - 16z)^0.25
+            ztmp = 1._wp + zx
+            zpsi_unst = LOG( 0.125_wp*ztmp*ztmp*(1._wp + zx2) ) - 2._wp*ATAN( zx ) + 0.5_wp*rpi
+
+            ! *** Stable                   [eq.3.22, Chap.3, p.33, IFS doc - Cy31r1] :
+            zpsi_stab = -2._wp/3._wp*(zta - zc)*EXP(-0.35_wp*zta) &
+               &       - zta - 2._wp/3._wp*zc
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_m_ecmwf(ji,jj) =         zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &              + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
       END_2D
    END FUNCTION psi_m_ecmwf
@@ -462,27 +443,27 @@
       !
       INTEGER  ::   ji, jj     ! dummy loop indices
-      REAL(wp) ::  zzeta, zx, psi_unst, psi_stab, stab
-      !!----------------------------------------------------------------------------------
+      REAL(wp) ::  zta, zx2, zpsi_unst, zpsi_stab, zstab, zc
+      !!----------------------------------------------------------------------------------
+      zc = 5._wp/0.35_wp
       !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      !
-      zzeta = MIN(pzeta(ji,jj) , 5._wp)   ! Very stable conditions (L positif and big!):
-      !
-      zx  = ABS(1._wp - 16._wp*zzeta)**.25        ! this is actually (1/phi_m)**2  !!!
-      !                                     ! eq.3.19, Chap.3, p.33, IFS doc - Cy31r1
-      ! Unstable (Paulson 1970) :
-      psi_unst = 2._wp*LOG(0.5_wp*(1._wp + zx*zx))   ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
-      !
-      ! Stable:
-      psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) & ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
-         &       - ABS(1._wp + 2._wp/3._wp*zzeta)**1.5_wp - 2._wp/3._wp*5._wp/0.35_wp + 1._wp
-      ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution...
-      !
-      stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
-      !
-      !
-      psi_h_ecmwf(ji,jj) = (1._wp - stab) * psi_unst &   ! (zzeta < 0) Unstable
-         &                +    stab    * psi_stab        ! (zzeta > 0) Stable
-      !
+            !
+            zta = MIN(pzeta(ji,jj) , 5._wp)   ! Very stable conditions (L positif and big!):
+            !
+            ! *** Unstable (Paulson 1970)   [eq.3.20, Chap.3, p.33, IFS doc - Cy31r1] :
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 -16z)^0.5
+            zpsi_unst = 2._wp*LOG( 0.5_wp*(1._wp + zx2) )
+            !
+            ! *** Stable [eq.3.22, Chap.3, p.33, IFS doc - Cy31r1] :
+            zpsi_stab = -2._wp/3._wp*(zta - zc)*EXP(-0.35_wp*zta) &
+               &       - ABS(1._wp + 2._wp/3._wp*zta)**1.5_wp - 2._wp/3._wp*zc + 1._wp
+            !
+            ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution...
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_h_ecmwf(ji,jj) =         zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &              + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
       END_2D
    END FUNCTION psi_h_ecmwf
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_an05.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_an05.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_an05.F90	(revision 14072)
@@ -0,0 +1,390 @@
+MODULE sbcblk_algo_ice_an05
+   !!======================================================================
+   !!                   ***  MODULE  sbcblk_algo_ice_an05  ***
+   !!       Computes turbulent components of surface fluxes over sea-ice
+   !!
+   !!   Andreas, E.L., Jordan, R.E. & Makshtas, A.P. Parameterizing turbulent exchange over sea ice: the ice station weddell results.
+   !!   Boundary-Layer Meteorology 114, 439–460 (2005). https://doi.org/10.1007/s10546-004-1414-7
+   !!
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (usually 2m) to zu (usually 10m) if needed
+   !!   * the "effective" bulk wind speed at zu: Ub (including gustiness contribution in unstable conditions)
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!       Routine turb_ice_an05 maintained and developed in AeroBulk
+   !!                     (https://github.com/brodeau/aerobulk/)
+   !!
+   !!            Author: Laurent Brodeau, Summer 2020
+   !!
+   !!----------------------------------------------------------------------
+   USE par_kind, ONLY: wp
+   USE par_oce,  ONLY: jpi, jpj, Nis0, Nie0, Njs0, Nje0, nn_hls, ntsi, ntsj, ntei, ntej
+   USE lib_mpp,  ONLY: ctl_stop         ! distribued memory computing library
+   USE phycst          ! physical constants
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC :: turb_ice_an05
+
+   INTEGER , PARAMETER ::   nbit = 8        ! number of itterations
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_ice_an05( zt, zu, Ts_i, t_zt, qs_i, q_zt, U_zu,        &
+      &                      Cd_i, Ch_i, Ce_i, t_zu_i, q_zu_i,            &
+      &                      CdN, ChN, CeN, xz0, xu_star, xL, xUN10 )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_ice_an05  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to:
+      !!   Andreas, E.L., Jordan, R.E. & Makshtas, A.P. Parameterizing turbulent exchange over sea ice: the ice station weddell results.
+      !!   Boundary-Layer Meteorology 114, 439–460 (2005). https://doi.org/10.1007/s10546-004-1414-7
+      !!
+      !!           If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!           Returns the effective bulk wind speed at zu to be used in the bulk formulas
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (usually 10m)                     [m]
+      !!    *  Ts_i  : surface temperature of sea-ice                         [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  qs_i  : saturation specific humidity at temp. Ts_i over ice    [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!    *  U_zu : scalar wind speed at zu                                 [m/s]
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd_i   : drag coefficient over sea-ice
+      !!    *  Ch_i   : sensible heat coefficient over sea-ice
+      !!    *  Ce_i   : sublimation coefficient over sea-ice
+      !!    *  t_zu_i : pot. air temp. adjusted at zu over sea-ice             [K]
+      !!    *  q_zu_i : spec. hum. of air adjusted at zu over sea-ice          [kg/kg]
+      !!
+      !! OPTIONAL OUTPUT:
+      !! ----------------
+      !!    * CdN     : neutral-stability drag coefficient
+      !!    * ChN     : neutral-stability sensible heat coefficient
+      !!    * CeN     : neutral-stability evaporation coefficient
+      !!    * xz0     : return the aerodynamic roughness length (integration constant for wind stress) [m]
+      !!    * xu_star : return u* the friction velocity                    [m/s]
+      !!    * xL      : return the Obukhov length                          [m]
+      !!    * xUN10   : neutral wind speed at 10m                          [m/s]
+      !!
+      !! ** Author: L. Brodeau, January 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in )                     :: zt    ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in )                     :: zu    ! height for U_zu                             [m]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: Ts_i  ! ice surface temperature                [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: t_zt  ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: qs_i  ! sat. spec. hum. at ice/air interface    [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt  ! spec. air humidity at zt               [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: U_zu  ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Cd_i  ! drag coefficient over sea-ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ch_i  ! transfert coefficient for heat over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ce_i  ! transfert coefficient for sublimation over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: t_zu_i ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: q_zu_i ! spec. humidity adjusted at zu           [kg/kg]
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CdN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: ChN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CeN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xz0  ! Aerodynamic roughness length   [m]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xu_star  ! u*, friction velocity
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xL  ! zeta (zu/L)
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xUN10  ! Neutral wind at zu
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: Ubzu
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztmp0, ztmp1, ztmp2      ! temporary stuff
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: z0, dt_zu, dq_zu
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: u_star, t_star, q_star
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: znu_a                    !: Nu_air = kinematic viscosity of air
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: zeta_u, zeta_t           ! stability parameter at height zu
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: z0tq
+      !!
+      INTEGER :: jit
+      LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      !!
+      LOGICAL :: lreturn_cdn=.FALSE., lreturn_chn=.FALSE., lreturn_cen=.FALSE.
+      LOGICAL :: lreturn_z0=.FALSE., lreturn_ustar=.FALSE., lreturn_L=.FALSE., lreturn_UN10=.FALSE.
+      !!
+      CHARACTER(len=40), PARAMETER :: crtnm = 'turb_ice_an05@sbcblk_algo_ice_an05.f90'
+      !!----------------------------------------------------------------------------------
+      ALLOCATE (  Ubzu(jpi,jpj), u_star(jpi,jpj),  t_star(jpi,jpj),  q_star(jpi,jpj),  &
+         &      zeta_u(jpi,jpj),  dt_zu(jpi,jpj),   dq_zu(jpi,jpj),  &
+         &       znu_a(jpi,jpj),  ztmp1(jpi,jpj),   ztmp2(jpi,jpj),  &
+         &          z0(jpi,jpj),   z0tq(jpi,jpj,2), ztmp0(jpi,jpj)   )
+
+      lreturn_cdn   = PRESENT(CdN)
+      lreturn_chn   = PRESENT(ChN)
+      lreturn_cen   = PRESENT(CeN)
+      lreturn_z0    = PRESENT(xz0)
+      lreturn_ustar = PRESENT(xu_star)
+      lreturn_L     = PRESENT(xL)
+      lreturn_UN10  = PRESENT(xUN10)
+
+      l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp )
+      IF( .NOT. l_zt_equal_zu )  ALLOCATE( zeta_t(jpi,jpj) )
+
+      !! Scalar wind speed cannot be below 0.2 m/s
+      Ubzu = MAX( U_zu, wspd_thrshld_ice )
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu_i = MAX( t_zt ,   100._wp )   ! who knows what's given on masked-continental regions...
+      q_zu_i = MAX( q_zt , 0.1e-6_wp )   !               "
+
+      !! Air-Ice differences (and we don't want it to be 0!)
+      dt_zu = t_zu_i - Ts_i ;   dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6_wp), dt_zu )
+      dq_zu = q_zu_i - qs_i ;   dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9_wp), dq_zu )
+
+      znu_a = visc_air(t_zu_i) ! Air viscosity (m^2/s) at zt given from temperature in (K)
+
+      !! Very crude first guesses of z0:
+      z0 = 8.0E-4_wp
+
+      !! Crude first guess of turbulent scales
+      u_star = 0.035_wp*Ubzu*LOG( 10._wp/z0 )/LOG( zu/z0 )
+      z0 = rough_leng_m( u_star , znu_a )
+
+      DO jit = 1, 2
+         u_star = MAX ( Ubzu*vkarmn/(LOG(zu) - LOG(z0)) , 1.E-9 )
+         z0 = rough_leng_m( u_star , znu_a )
+      END DO
+
+      z0tq = rough_leng_tq( z0, u_star , znu_a )
+      t_star = dt_zu*vkarmn/(LOG(zu/z0tq(:,:,1)))
+      q_star = dq_zu*vkarmn/(LOG(zu/z0tq(:,:,2)))
+      
+      
+      !! ITERATION BLOCK
+      DO jit = 1, nbit
+
+         !!Inverse of Obukov length (1/L) :
+         ztmp0 = One_on_L(t_zu_i, q_zu_i, u_star, t_star, q_star)  ! 1/L == 1/[Obukhov length]
+         ztmp0 = SIGN( MIN(ABS(ztmp0),200._wp), ztmp0 ) ! (prevents FPE from stupid values from masked region later on...)
+
+         !! Stability parameters "zeta" :
+         zeta_u = zu*ztmp0
+         zeta_u = SIGN( MIN(ABS(zeta_u),50.0_wp), zeta_u )
+         IF( .NOT. l_zt_equal_zu ) THEN
+            zeta_t = zt*ztmp0
+            zeta_t = SIGN( MIN(ABS(zeta_t),50.0_wp), zeta_t )
+         END IF
+
+         !! Roughness lengthes z0, z0t, & z0q :
+         z0   = rough_leng_m (     u_star , znu_a )
+         z0tq = rough_leng_tq( z0, u_star , znu_a )
+
+         !! Turbulent scales at zu :
+         ztmp0   = psi_h_ice(zeta_u)
+         t_star =      dt_zu*vkarmn/(LOG(zu) - LOG(z0tq(:,:,1)) - ztmp0)
+         q_star =      dq_zu*vkarmn/(LOG(zu) - LOG(z0tq(:,:,2)) - ztmp0)
+         u_star = MAX( Ubzu*vkarmn/(LOG(zu) - LOG(z0(:,:)) - psi_m_ice(zeta_u)) , 1.E-9 )
+
+         IF( .NOT. l_zt_equal_zu ) THEN
+            !! Re-updating temperature and humidity at zu if zt /= zu :
+            ztmp1 = LOG(zt/zu) + ztmp0 - psi_h_ice(zeta_t)
+            t_zu_i = t_zt - t_star/vkarmn*ztmp1
+            q_zu_i = q_zt - q_star/vkarmn*ztmp1
+            dt_zu = t_zu_i - Ts_i ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6_wp), dt_zu )
+            dq_zu = q_zu_i - qs_i ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9_wp), dq_zu )
+         END IF
+
+      END DO !DO jit = 1, nbit
+
+      ! compute transfer coefficients at zu :
+      ztmp0 = u_star/Ubzu
+      Cd_i   = ztmp0*ztmp0
+      Ch_i   = ztmp0*t_star/dt_zu
+      Ce_i   = ztmp0*q_star/dq_zu
+
+      IF( lreturn_cdn .OR. lreturn_chn .OR. lreturn_cen ) ztmp0 = 1._wp/LOG( zu/z0(:,:) )
+      IF( lreturn_cdn )   CdN = vkarmn2*ztmp0*ztmp0
+      IF( lreturn_chn )   ChN = vkarmn2*ztmp0/LOG(zu/z0tq(:,:,1))
+      IF( lreturn_cen )   CeN = vkarmn2*ztmp0/LOG(zu/z0tq(:,:,2))
+
+      IF( lreturn_z0 )    xz0     = z0
+      IF( lreturn_ustar ) xu_star = u_star
+      IF( lreturn_L )     xL      = 1./One_on_L(t_zu_i, q_zu_i, u_star, t_star, q_star)
+      IF( lreturn_UN10 )  xUN10   = u_star/vkarmn*LOG(10./z0)
+
+      DEALLOCATE ( Ubzu, u_star, t_star, q_star, zeta_u, dt_zu, dq_zu, z0, z0tq, znu_a, ztmp0, ztmp1, ztmp2 )
+      IF( .NOT. l_zt_equal_zu ) DEALLOCATE( zeta_t )
+
+   END SUBROUTINE turb_ice_an05
+
+
+
+   FUNCTION rough_leng_m( pus , pnua )
+      !!----------------------------------------------------------------------------------
+      !! Computes the roughness length of sea-ice according to Andreas et al. 2005, (eq. 19)
+      !!
+      !! Author: L. Brodeau, January 2020 / AeroBulk  (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: rough_leng_m      ! roughness length over sea-ice [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pus   ! u* = friction velocity    [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pnua  ! kinematic viscosity of air [m^2/s]
+      !!
+      INTEGER  :: ji, jj    ! dummy loop indices
+      REAL(wp) :: zus, zz
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            zus = MAX( pus(ji,jj) , 1.E-9_wp )
+
+            zz = (zus - 0.18_wp) / 0.1_wp
+
+            rough_leng_m(ji,jj) = 0.135*pnua(ji,jj)/zus + 0.035*zus*zus/grav*( 5.*EXP(-zz*zz) + 1._wp ) ! Eq.(19) Andreas et al., 2005
+      END_2D
+      !!
+   END FUNCTION rough_leng_m
+
+   FUNCTION rough_leng_tq( pz0, pus , pnua )
+      !!----------------------------------------------------------------------------------
+      !! Computes the roughness length of sea-ice according to Andreas et al. 2005, (eq. 22)
+      !!    => which still relies on Andreas 1987 !
+      !!
+      !! Author: L. Brodeau, January 2020 / AeroBulk  (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj,2)           :: rough_leng_tq     ! temp.,hum. roughness lengthes over sea-ice [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0   ! roughness length            [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pus   ! u* = friction velocity    [m/s]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pnua  ! kinematic viscosity of air [m^2/s]
+      !!
+      INTEGER  :: ji, jj    ! dummy loop indices
+      REAL(wp) :: zz0, zus, zre, zsmoot, ztrans, zrough
+      REAL(wp) :: zb0, zb1, zb2, zlog, zlog2, zlog_z0s_on_z0
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            zz0 = pz0(ji,jj)
+            zus = MAX( pus(ji,jj) , 1.E-9_wp )
+            zre = MAX( zus*zz0/pnua(ji,jj) , 0._wp ) ! Roughness Reynolds number
+
+            !! *** TABLE 1 of Andreas et al. 2005 ***
+            !! Smooth flow condition (R* <= 0.135):
+            zsmoot = 0.5_wp + SIGN( 0.5_wp, (0.135_wp   - zre) ) ! zre <= 0.135: zsmoot==1 ; otherwize: zsmoot==0
+            !! Transition (0.135 < R* < 2.5):
+            ztrans = 0.5_wp + SIGN( 0.5_wp, (2.49999_wp - zre) ) - zsmoot
+            !! Rough ( R* > 2.5):
+            zrough = 0.5_wp + SIGN( 0.5_wp, (zre - 2.5_wp) )
+
+            IF( (zsmoot+ztrans+zrough > 1.001_wp).OR.(zsmoot+ztrans+zrough < 0.999_wp) ) &
+               CALL ctl_stop( ' rough_leng_tq@mod_blk_ice_an05.f90 => something wrong with zsmoot, ztrans, zrough!' )
+
+            zlog  = LOG(zre)
+            zlog2 = zlog*zlog
+
+            !! z0t:
+            zb0 = zsmoot*1.25_wp + ztrans*0.149_wp + zrough*0.317_wp
+            zb1 =                - ztrans*0.550_wp - zrough*0.565_wp
+            zb2 =                                  - zrough*0.183_wp
+            zlog_z0s_on_z0 = zb0 + zb1*zlog + zb2*zlog2
+            rough_leng_tq(ji,jj,1) = zz0 * EXP( zlog_z0s_on_z0 )
+
+            !! z0q:
+            zb0 = zsmoot*1.61_wp + ztrans*0.351_wp + zrough*0.396_wp
+            zb1 =                - ztrans*0.628_wp - zrough*0.512_wp
+            zb2 =                                  - zrough*0.180_wp
+            zlog = LOG(zre)
+            zlog_z0s_on_z0 = zb0 + zb1*zlog + zb2*zlog2
+            rough_leng_tq(ji,jj,2) = zz0 * EXP( zlog_z0s_on_z0 )
+
+      END_2D
+      !!
+   END FUNCTION rough_leng_tq
+
+
+
+   FUNCTION psi_m_ice( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! ** Purpose: compute the universal profile stability function for momentum
+      !!
+      !!
+      !!     Andreas et al 2005 == Jordan et al. 1999
+      !!
+      !!     Psi:
+      !!     Unstable => Paulson 1970
+      !!     Stable   => Holtslag & De Bruin 1988
+      !!
+      !!             pzeta : stability paramenter, z/L where z is altitude
+      !!                     measurement and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zta, zx, zpsi_u, zpsi_s, zstab
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )            !
+            zta = pzeta(ji,jj)
+            !
+            ! Unstable stratification:
+            zx = ABS(1._wp - 16._wp*zta)**.25              !  (16 here, not 15!)
+
+            zpsi_u =      LOG( (1._wp + zx*zx)/2. ) &  ! Eq.(30) Jordan et al. 1999
+               &     + 2.*LOG( (1._wp + zx       )/2. ) &
+               &    - 2.*ATAN( zx ) + 0.5*rpi
+
+            ! Stable stratification:
+            zpsi_s = - ( 0.7_wp*zta + 0.75_wp*(zta - 14.3_wp)*EXP( -0.35*zta) + 10.7_wp )  ! Eq.(33) Jordan et al. 1999
+
+            !! Combine:
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            psi_m_ice(ji,jj) = (1._wp - zstab) * zpsi_u   & ! Unstable (zta < 0)
+               &                   + zstab     * zpsi_s     ! Stable (zta > 0)
+            !
+      END_2D
+   END FUNCTION psi_m_ice
+
+
+   FUNCTION psi_h_ice( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! ** Purpose: compute the universal profile stability function for
+      !!             temperature and humidity
+      !!
+      !!
+      !!     Andreas et al 2005 == Jordan et al. 1999
+      !!
+      !!     Psi:
+      !!     Unstable => Paulson 1970
+      !!     Stable   => Holtslag & De Bruin 1988
+      !!
+      !!             pzeta : stability paramenter, z/L where z is altitude
+      !!                     measurement and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zta, zx, zpsi_u, zpsi_s, zstab
+      !!----------------------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )            !
+            zta = pzeta(ji,jj)
+            !
+            ! Unstable stratification:
+            zx = ABS(1._wp - 16._wp*zta)**.25              !  (16 here, not 15!)
+
+            zpsi_u =   2.*LOG( (1._wp + zx*zx)/2. )  ! Eq.(31) Jordan et al. 1999
+
+            ! Stable stratification (identical to Psi_m!):
+            zpsi_s = - ( 0.7_wp*zta + 0.75_wp*(zta - 14.3_wp)*EXP( -0.35*zta) + 10.7_wp )  ! Eq.(33) Jordan et al. 1999
+
+            !! Combine:
+            zstab = 0.5 + SIGN(0.5_wp, zta)
+            psi_h_ice(ji,jj) = (1._wp - zstab) * zpsi_u   & ! Unstable (zta < 0)
+               &                   + zstab     * zpsi_s     ! Stable (zta > 0)
+            !
+      END_2D
+   END FUNCTION psi_h_ice
+
+   !!======================================================================
+END MODULE sbcblk_algo_ice_an05
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90	(revision 14072)
@@ -0,0 +1,300 @@
+! AeroBulk / 2020 / L. Brodeau
+!
+!   When using AeroBulk to produce scientific work, please acknowledge with the following citation:
+!
+!   Brodeau, L., B. Barnier, S. Gulev, and C. Woods, 2016: Climatologically
+!   significant effects of some approximations in the bulk parameterizations of
+!   turbulent air-sea fluxes. J. Phys. Oceanogr., doi:10.1175/JPO-D-16-0169.1.
+!
+!
+MODULE sbcblk_algo_ice_cdn
+   !!====================================================================================
+   !!            Author: Laurent Brodeau, January 2020
+   !!====================================================================================
+   USE par_kind, ONLY: wp
+   USE par_oce,  ONLY: jpi, jpj, Nis0, Nie0, Njs0, Nje0, nn_hls, ntsi, ntsj, ntei, ntej
+   USE phycst          ! physical constants
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC :: CdN10_f_LU12, CdN_f_LU12_eq36, CdN10_f_LU13, CdN_f_LG15, CdN_f_LG15_light
+
+   REAL(wp), PARAMETER :: rCe_0    = 2.23E-3_wp !LOLO: this one can be more accurate when sea-ice data => Lupkes et al (2013), Eq.(1)
+   REAL(wp), PARAMETER :: rNu_0    = 1._wp
+   REAL(wp), PARAMETER :: rMu_0    = 1._wp
+   REAL(wp), PARAMETER :: rbeta_0  = 1.4_wp     ! (Eq.47) MIZ
+
+   REAL(wp), PARAMETER :: rhmin_0 = 0.286_wp  ! Eq.(25)
+   REAL(wp), PARAMETER :: rhmax_0 = 0.534_wp  ! Eq.(25)
+   REAL(wp), PARAMETER :: rDmin_0 =   8._wp      ! Eq.(27)
+   REAL(wp), PARAMETER :: rDmax_0 = 300._wp      ! Eq.(27)
+   REAL(wp), PARAMETER :: rz0_w_0 = 3.27E-4   ! fixed roughness length over water (paragraph below Eq.36)
+
+   !!============================================================
+   REAL(wp), PARAMETER ::   rce10_i_0 = 3.46e-3_wp ! (Eq.48) MIZ
+
+   REAL(wp), PARAMETER ::   ralpha_0  = 0.2_wp     ! (Eq.12) (ECHAM6 value)
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+CONTAINS
+
+
+   FUNCTION CdN10_f_LU12( pfrice, pz0w,  pSc, phf, pDi  )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  CdN10_f_LU12  ***
+      !!
+      !!        GENERAL FORM OF EQUATION 22 of Lupkes et al. 2012
+      !!        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      !!
+      !! ** Purpose :    Computes the "form" contribution of the neutral air-ice
+      !!                 drag referenced at 10m to make it dependent on edges at
+      !!                 leads, melt ponds and flows (to be added to the "skin"
+      !!                 contribution. After some
+      !!                 approximations, this can be resumed to a dependency on
+      !!                 ice concentration.
+      !!
+      !! ** References : Lupkes et al. JGR 2012 (theory)
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)                       :: CdN10_f_LU12  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pz0w   ! roughness length over water  [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: phf    ! mean freeboard of floes    [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
+      !!----------------------------------------------------------------------
+      LOGICAL :: l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
+      REAL(wp) :: ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------
+      l_known_Sc    = PRESENT(pSc)
+      l_known_hf    = PRESENT(phf)
+      l_known_Di    = PRESENT(pDi)
+
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            
+            zfri = pfrice(ji,jj)
+            zfrw = (1._wp - zfri)
+
+            IF(l_known_Sc) THEN
+               zSc = pSc(ji,jj)
+            ELSE
+               !! Sc parameterized in terms of A (ice fraction):
+               zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
+            END IF
+
+            IF(l_known_hf) THEN
+               zhf = phf(ji,jj)
+            ELSE
+               !! hf parameterized in terms of A (ice fraction):
+               zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
+            END IF
+
+            IF(l_known_Di) THEN
+               zDi = pDi(ji,jj)
+            ELSE
+               !! Di parameterized in terms of A (ice fraction):
+               ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
+               zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
+            END IF
+
+            ztmp  = 1._wp/pz0w(ji,jj)
+            zrlog = LOG(zhf*ztmp) / LOG(10._wp*ztmp)
+
+            CdN10_f_LU12(:,:) = 0.5_wp* 0.3_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(22)
+            !!                   1/2      Ce
+
+      END_2D
+   END FUNCTION CdN10_f_LU12
+
+   
+   FUNCTION CdN_f_LU12_eq36( pzu, pfrice )
+      REAL(wp), DIMENSION(jpi,jpj)             :: CdN_f_LU12_eq36 ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in) :: pzu    ! reference height                       [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      !!----------------------------------------------------------------------
+      REAL(wp) :: ztmp, zrlog, zfri, zhf, zDi
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------
+      !zhf   = 0.28   ! h_fc
+      zhf   = 0.41   ! h_fc
+      zDi   = rDmin_0
+
+      ztmp  = 1._wp/rz0_w_0
+      zrlog = LOG(zhf*ztmp) / LOG(pzu*ztmp)
+
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+            zfri = pfrice(ji,jj)
+
+            CdN_f_LU12_eq36(:,:) = 0.5_wp* 0.3_wp * zrlog*zrlog * zhf/zDi  * (1._wp - zfri)**rBeta_0 ! Eq.(35) & (36)
+            !!                        1/2      Ce
+      END_2D
+   END FUNCTION CdN_f_LU12_eq36
+
+
+
+
+   FUNCTION CdN10_f_LU13( pfrice )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  CdN10_f_LU13  ***
+      !!
+      !! ** Purpose :    Computes the "form" contribution of the neutral air-ice
+      !!                 drag referenced at 10m to make it dependent on edges at
+      !!                 leads, melt ponds and flows (to be added to the "skin"
+      !!                 contribution. After some
+      !!                 approximations, this can be resumed to a dependency on
+      !!                 ice concentration.
+      !!
+      !! ** Method :     The parameterization is taken from Lupkes et al. (2012) eq.(50)
+      !!                 with the highest level of approximation: level4, eq.(59)
+      !!                 The generic drag over a cell partly covered by ice can be re-written as follows:
+      !!
+      !!                 Cd = Cdw * (1-A) + Cdi * A + Ce * (1-A)**(nu+1/(10*beta)) * A**mu
+      !!
+      !!                    Ce = 2.23e-3       , as suggested by Lupkes (eq. 59)
+      !!                    nu = mu = beta = 1 , as suggested by Lupkes (eq. 59)
+      !!                    A is the concentration of ice minus melt ponds (if any)
+      !!
+      !!                 This new drag has a parabolic shape (as a function of A) starting at
+      !!                 Cdw(say 1.5e-3) for A=0, reaching 1.97e-3 for A~0.5
+      !!                 and going down to Cdi(say 1.4e-3) for A=1
+      !!
+      !!                 It is theoretically applicable to all ice conditions (not only MIZ)
+      !!                 => see Lupkes et al (2013)
+      !!
+      !! ** References : Lupkes et al. JGR 2012 (theory)
+      !!                 Lupkes et al. GRL 2013 (application to GCM)
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)              :: CdN10_f_LU13  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pfrice           ! ice concentration [fraction]  => at_i_b
+
+      !!----------------------------------------------------------------------
+      REAL(wp)            ::   zcoef
+      !!----------------------------------------------------------------------
+      zcoef = rNu_0 + 1._wp / ( 10._wp * rBeta_0 )
+
+      !! We are not an AGCM, we are an OGCM!!! => we drop term "(1 - A)*Cd_w"
+      !!  => so we keep only the last rhs terms of Eq.(1) of Lupkes et al, 2013 that we divide by "A":
+      !! (we multiply Cd_i_s and Cd_i_f by A later, when applying ocean-ice partitioning...
+
+      CdN10_f_LU13(:,:) = rCe_0 * pfrice(:,:)**(rMu_0 - 1._wp) * (1._wp - pfrice(:,:))**zcoef
+      !! => seems okay for winter 100% sea-ice as second rhs term vanishes as pfrice == 1....
+
+   END FUNCTION CdN10_f_LU13
+
+
+   FUNCTION CdN_f_LG15( pzu, pfrice, pz0i,  pSc, phf, pDi  )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  CdN_f_LG15  ***
+      !!
+      !!        GENERAL FORM OF EQUATION 21 of Lupkes & Gryanik (2015)
+      !!        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      !!
+      !! ** Purpose :    Computes the "form" contribution of the neutral air-ice
+      !!                 drag referenced at 10m to make it dependent on edges at
+      !!                 leads, melt ponds and flows (to be added to the "skin"
+      !!                 contribution. After some
+      !!                 approximations, this can be resumed to a dependency on
+      !!                 ice concentration.
+      !!
+      !! ** References : Lupkes & Gryanik (2015)
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)                       :: CdN_f_LG15  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in )          :: pzu    ! reference height                       [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pz0i   ! roughness length over ICE  [m] (in LU12, it's over water ???)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: phf    ! mean freeboard of floes    [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
+      !!----------------------------------------------------------------------
+      LOGICAL :: l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
+      REAL(wp) :: ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------
+      l_known_Sc    = PRESENT(pSc)
+      l_known_hf    = PRESENT(phf)
+      l_known_Di    = PRESENT(pDi)
+
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+            zfri = pfrice(ji,jj)
+            zfrw = (1._wp - zfri)
+
+            IF(l_known_Sc) THEN
+               zSc = pSc(ji,jj)
+            ELSE
+               !! Sc parameterized in terms of A (ice fraction):
+               zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
+            END IF
+
+            IF(l_known_hf) THEN
+               zhf = phf(ji,jj)
+            ELSE
+               !! hf parameterized in terms of A (ice fraction):
+               zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
+            END IF
+
+            IF(l_known_Di) THEN
+               zDi = pDi(ji,jj)
+            ELSE
+               !! Di parameterized in terms of A (ice fraction):
+               ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
+               zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
+            END IF
+
+            ztmp  = 1._wp/pz0i(ji,jj)
+            zrlog = LOG(zhf*ztmp/2.718_wp) / LOG(pzu*ztmp)  !LOLO: adding number "e" !!!
+
+            CdN_f_LG15(:,:) = 0.5_wp* 0.4_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(21) Lukes & Gryanik (2015)
+            !!                   1/2      Ce
+
+      END_2D
+   END FUNCTION CdN_f_LG15
+
+
+
+   FUNCTION CdN_f_LG15_light( pzu, pfrice, pz0w )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  CdN_f_LG15_light  ***
+      !!
+      !! ** Purpose :    Computes the "form" contribution of the neutral air-ice
+      !!                 drag referenced at 10m to make it dependent on edges at
+      !!                 leads, melt ponds and flows (to be added to the "skin"
+      !!                 contribution. After some
+      !!                 approximations, this can be resumed to a dependency on
+      !!                 ice concentration.
+      !!
+      !! ** References : Lupkes & Gryanik (2015)
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: CdN_f_LG15_light  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in) :: pzu    ! reference height [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pfrice ! ice concentration [fraction]  => at_i_b
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0w   ! roughness length over water  [m]
+      !!----------------------------------------------------------------------
+      REAL(wp) :: ztmp, zrlog, zfri
+      INTEGER  :: ji, jj
+      !!----------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+            zfri = pfrice(ji,jj)
+
+            ztmp = 1._wp / pz0w(ji,jj)
+            zrlog = LOG( 10._wp * ztmp ) / LOG( pzu * ztmp ) ! part of (Eq.46)
+
+            CdN_f_LG15_light(:,:) = rce10_i_0 *zrlog*zrlog * zfri * (1._wp - zfri)**rbeta_0  ! (Eq.46)  [ index 1 is for ice, 2 for water ]
+
+      END_2D
+   END FUNCTION CdN_f_LG15_light
+
+
+
+   !!======================================================================
+END MODULE sbcblk_algo_ice_cdn
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lg15.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lg15.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lg15.F90	(revision 14072)
@@ -0,0 +1,289 @@
+MODULE sbcblk_algo_ice_lg15
+   !!======================================================================
+   !!                   ***  MODULE  sbcblk_algo_ice_lg15  ***
+   !!       Computes turbulent components of surface fluxes over sea-ice
+   !!
+   !!
+   !!  Lüpkes, C., and Gryanik, V. M. ( 2015), A stability‐dependent parametrization
+   !!  of transfer coefficients for momentum and heat over polar sea ice to be used in climate models,
+   !!  J. Geophys. Res. Atmos., 120, 552– 581, doi:10.1002/2014JD022418.
+   !!
+   !!       => Despite the fact that the sea-ice concentration (frice) must be provided,
+   !!          only transfer coefficients, and air temp. + hum. height adjustement
+   !!          over ice are returned/performed.
+   !!        ==> 'frice' is only here to estimate the form drag caused by sea-ice...
+   !!
+   !!       Routine turb_ice_lg15 maintained and developed in AeroBulk
+   !!                     (https://github.com/brodeau/aerobulk/)
+   !!
+   !!            Author: Laurent Brodeau, Summer 2020
+   !!
+   !!----------------------------------------------------------------------
+   USE par_kind, ONLY: wp
+   USE par_oce,  ONLY: jpi, jpj
+   USE phycst          ! physical constants
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
+   USE sbcblk_algo_ice_cdn
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC :: turb_ice_lg15
+
+   REAL(wp), PARAMETER ::   ralpha_0  = 0.2_wp     ! (Eq.12) (ECHAM6 value)
+
+   !! To be namelist parameters in NEMO:
+   REAL(wp), PARAMETER :: rz0_i_s_0  = 0.69e-3_wp  !           Eq. 43 [m]
+   REAL(wp), PARAMETER :: rz0_i_f_0  = 4.54e-4_wp  ! bottom p.562 MIZ [m]
+
+   LOGICAL,  PARAMETER :: l_add_form_drag = .TRUE.
+   LOGICAL,  PARAMETER :: l_use_pond_info = .FALSE.
+   LOGICAL,  PARAMETER :: l_dbg_print     = .FALSE.
+
+   INTEGER , PARAMETER ::   nbit = 8        ! number of itterations
+
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_ice_lg15( zt, zu, Ts_i, t_zt, qs_i, q_zt, U_zu, frice, &
+      &                      Cd_i, Ch_i, Ce_i, t_zu_i, q_zu_i,            &
+      &                      CdN, ChN, CeN, xz0, xu_star, xL, xUN10 )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_ice_lg15  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to:
+      !!            Lüpkes, C., and Gryanik, V. M. ( 2015), A stability‐dependent
+      !!            parametrization of transfer coefficients for momentum and heat
+      !!            over polar sea ice to be used in climate models,
+      !!            J. Geophys. Res. Atmos., 120, 552– 581, doi:10.1002/2014JD022418.
+      !!
+      !!           If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!           Returns the effective bulk wind speed at zu to be used in the bulk formulas
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (usually 10m)                     [m]
+      !!    *  Ts_i  : surface temperature of sea-ice                         [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  qs_i  : saturation specific humidity at temp. Ts_i over ice    [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!    *  U_zu : scalar wind speed at zu                                 [m/s]
+      !!    * frice : sea-ice concentration        (fraction)
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd_i   : drag coefficient over sea-ice
+      !!    *  Ch_i   : sensible heat coefficient over sea-ice
+      !!    *  Ce_i   : sublimation coefficient over sea-ice
+      !!    *  t_zu_i : pot. air temp. adjusted at zu over sea-ice             [K]
+      !!    *  q_zu_i : spec. hum. of air adjusted at zu over sea-ice          [kg/kg]
+      !!
+      !! OPTIONAL OUTPUT:
+      !! ----------------
+      !!    * CdN     : neutral-stability drag coefficient
+      !!    * ChN     : neutral-stability sensible heat coefficient
+      !!    * CeN     : neutral-stability evaporation coefficient
+      !!    * xz0     : return the aerodynamic roughness length (integration constant for wind stress) [m]
+      !!    * xu_star : return u* the friction velocity                    [m/s]
+      !!    * xL      : return the Obukhov length                          [m]
+      !!    * xUN10   : neutral wind speed at 10m                          [m/s]
+      !!
+      !! ** Author: L. Brodeau, January 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in )                     :: zt    ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in )                     :: zu    ! height for U_zu                             [m]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: Ts_i  ! ice surface temperature                [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: t_zt  ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: qs_i  ! sat. spec. hum. at ice/air interface    [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt  ! spec. air humidity at zt               [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: U_zu  ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: frice ! sea-ice concentration        (fraction)
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Cd_i  ! drag coefficient over sea-ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ch_i  ! transfert coefficient for heat over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ce_i  ! transfert coefficient for sublimation over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: t_zu_i ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: q_zu_i ! spec. humidity adjusted at zu           [kg/kg]
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CdN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: ChN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CeN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xz0  ! Aerodynamic roughness length   [m]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xu_star  ! u*, friction velocity
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xL  ! zeta (zu/L)
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xUN10  ! Neutral wind at zu
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: Ubzu
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztmp1, ztmp2      ! temporary stuff
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: dt_zu, dq_zu
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: zz0_s, zz0_f, RiB ! third dimensions (size=2):
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: zCdN_s, zChN_s, zCdN_f, zChN_f
+      !!
+      INTEGER :: jit
+      LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      !!
+      LOGICAL :: lreturn_cdn=.FALSE., lreturn_chn=.FALSE., lreturn_cen=.FALSE.
+      LOGICAL :: lreturn_z0=.FALSE., lreturn_ustar=.FALSE., lreturn_L=.FALSE., lreturn_UN10=.FALSE.
+      !!
+      CHARACTER(len=40), PARAMETER :: crtnm = 'turb_ice_lg15@sbcblk_algo_ice_lg15.f90'
+      !!----------------------------------------------------------------------------------
+      ALLOCATE ( Ubzu(jpi,jpj) )
+      ALLOCATE ( ztmp1(jpi,jpj),  ztmp2(jpi,jpj) )
+      ALLOCATE ( dt_zu(jpi,jpj),  dq_zu(jpi,jpj) )
+      ALLOCATE ( zz0_s(jpi,jpj),  zz0_f(jpi,jpj),    RiB(jpi,jpj), &
+         &      zCdN_s(jpi,jpj), zChN_s(jpi,jpj), zCdN_f(jpi,jpj), zChN_f(jpi,jpj) )
+
+      lreturn_cdn   = PRESENT(CdN)
+      lreturn_chn   = PRESENT(ChN)
+      lreturn_cen   = PRESENT(CeN)
+      lreturn_z0    = PRESENT(xz0)
+      lreturn_ustar = PRESENT(xu_star)
+      lreturn_L     = PRESENT(xL)
+      lreturn_UN10  = PRESENT(xUN10)
+
+      l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp )
+
+      !! Scalar wind speed cannot be below 0.2 m/s
+      Ubzu = MAX( U_zu, wspd_thrshld_ice )
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu_i = MAX( t_zt ,   100._wp )   ! who knows what's given on masked-continental regions...
+      q_zu_i = MAX( q_zt , 0.1e-6_wp )   !               "
+
+      !! Air-Ice & Air-Sea differences (and we don't want them to be 0!)
+      dt_zu = t_zu_i - Ts_i ;   dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6_wp), dt_zu )
+      dq_zu = q_zu_i - qs_i ;   dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9_wp), dq_zu )
+
+      !! Very crude first guess:
+      Cd_i(:,:) = 1.4e-3_wp
+      Ch_i(:,:) = 1.4e-3_wp
+      Ce_i(:,:) = 1.4e-3_wp
+      
+      !! For skin drag :
+      zz0_s(:,:)  = rz0_i_s_0        !#LB/RFI! ! Room for improvement. We use the same z0_skin everywhere (= rz0_i_s_0)...
+      zCdN_s(:,:) = Cd_from_z0( zu, zz0_s(:,:) )
+      zChN_s(:,:) = vkarmn2 / ( LOG( zu / zz0_s(:,:) ) * LOG( zu / (ralpha_0*zz0_s(:,:)) ) )     ! (Eq.11,12)  [ "" ]
+      
+      !! For form drag in MIZ:
+      zz0_f(:,:)  = 0._wp
+      zCdN_f(:,:) = 0._wp
+      zChN_f(:,:) = 0._wp
+      IF ( l_add_form_drag ) THEN
+         zz0_f(:,:)  = rz0_i_f_0        !#LB/RFI! ! Room for improvement. We use the same z0_form everywhere !!!
+         zCdN_f(:,:) = CdN_f_LG15_light( zu, frice(:,:), zz0_f(:,:) )
+         zChN_f(:,:) = zCdN_f(:,:)/( 1._wp + LOG(1._wp/ralpha_0)/vkarmn*SQRT(zCdN_f(:,:)) ) ! (Eq.60,61)   [ "" ]
+      END IF
+
+      !! Some other first guess values, needed to compute wind at zt:
+      Cd_i(:,:) = zCdN_s(:,:) + zCdN_f(:,:)
+      Ch_i(:,:) = zChN_s(:,:) + zChN_f(:,:)
+      RiB(:,:) = Ri_bulk( zt, Ts_i(:,:), t_zt(:,:), qs_i(:,:), q_zt(:,:), Ubzu(:,:) )  ! over ice (index=1)
+
+
+      !! ITERATION BLOCK
+      DO jit = 1, nbit
+
+         IF(l_dbg_print) PRINT *, 'LOLO: LOOP #', INT(jit,1)
+         IF(l_dbg_print) PRINT *, 'LOLO: theta_zu, Ts_i, Ubzu =', REAL(t_zu_i(:,:),4), REAL(Ts_i(:,:),4), REAL(Ubzu(:,:),4)
+         IF(l_dbg_print) PRINT *, 'LOLO:     q_zu =', REAL(q_zu_i(:,:),4)
+         IF(l_dbg_print) PRINT *, 'LOLO:  CdN_s, zCdN_f   =', REAL(zCdN_s(:,:),4), REAL(zCdN_f(:,:),4)
+
+
+         !! Bulk Richardson Number
+         !! ======================
+         !! PROBLEM: when computed at z=zu, with adjusted theta and q, it is numerically unstable in some rare events (unstable)
+         !!          => fix: compute RiB at zt, with ajusted wind at zt... => seems to be more stable
+         IF( .NOT. l_zt_equal_zu ) THEN
+            ! U_zt = U_zu + u_star/vkarmn*(LOG(zt/zu) + psi_m_coare(zu/L) - psi_m_coare(zt/L))
+            ztmp1(:,:) = zCdN_s(:,:) + zCdN_f(:,:)    ! total neutral drag coeff!
+            ztmp2(:,:) = zz0_s(:,:) + zz0_f(:,:)      ! total roughness length z0
+            ztmp1 = LOG(zt/zu) + f_h_louis( zu, RiB(:,:), ztmp1(:,:), ztmp2(:,:) ) &
+               &               - f_h_louis( zt, RiB(:,:), ztmp1(:,:), ztmp2(:,:) )
+            ztmp2(:,:) = MAX( Ubzu(:,:) + (SQRT(Cd_i(:,:))*Ubzu)*ztmp1 , wspd_thrshld_ice ) ! wind at zt ( SQRT(Cd_i(:,:))*Ubzu == u* !)
+            ztmp2(:,:) = MIN( ztmp2(:,:) , Ubzu(:,:) )
+            IF(l_dbg_print) PRINT *, 'LOLO: ADJUSTED WIND AT ZT =', ztmp2
+         ELSE
+            ztmp2(:,:) = Ubzu(:,:)
+         END IF
+         RiB(:,:) = Ri_bulk( zt, Ts_i(:,:), t_zt(:,:), qs_i(:,:), q_zt(:,:), ztmp2(:,:) )  ! over ice (index=1)
+         IF(l_dbg_print) PRINT *, 'LOLO: RiB_zt =', RiB(:,:)
+
+
+         ! Momentum and Heat transfer coefficients WITHOUT FORM DRAG / (Eq.6) and (Eq.10):
+         Cd_i(:,:) = zCdN_s(:,:) * f_m_louis( zu, RiB(:,:), zCdN_s(:,:), zz0_s(:,:) ) ! (Eq.6)
+         Ch_i(:,:) = zChN_s(:,:) * f_h_louis( zu, RiB(:,:), zCdN_s(:,:), zz0_s(:,:) ) ! (Eq.10) / LOLO: why "zCdN_s" (ztmp1) and not "zChn" ???
+         IF(l_dbg_print) PRINT *, 'LOLO: f_m_louis_s =', f_m_louis( zu, RiB(:,:), zCdN_s(:,:), zz0_s(:,:) )
+         IF(l_dbg_print) PRINT *, 'LOLO: f_h_louis_s =', f_h_louis( zu, RiB(:,:), zCdN_s(:,:), zz0_s(:,:) )
+         IF(l_dbg_print) PRINT *, 'LOLO: Cd / skin only / ice   =', REAL(Cd_i(:,:),4)
+
+         
+         IF ( l_add_form_drag ) THEN
+            !! Form-drag-related NEUTRAL momentum and Heat transfer coefficients:
+            !!   MIZ:
+            Cd_i(:,:) = Cd_i(:,:) + zCdN_f(:,:) * f_m_louis( zu, RiB(:,:), zCdN_f(:,:), zz0_f(:,:) ) ! (Eq.6)
+            Ch_i(:,:) = Ch_i(:,:) + zChN_f(:,:) * f_h_louis( zu, RiB(:,:), zCdN_f(:,:), zz0_f(:,:) ) ! (Eq.10) / LOLO: why "zCdN_f" and not "zChn" ???
+            IF(l_dbg_print) PRINT *, 'LOLO: f_m_louis_f =', f_m_louis( zu, RiB(:,:), zCdN_f(:,:), zz0_f(:,:) )
+            IF(l_dbg_print) PRINT *, 'LOLO: f_h_louis_f =', f_h_louis( zu, RiB(:,:), zCdN_f(:,:), zz0_f(:,:) )
+
+            IF(l_dbg_print) PRINT *, 'LOLO: Cd / form only / ice   =', REAL(zCdN_f(:,:) * f_m_louis( zu, RiB(:,:), zCdN_f(:,:), zz0_f(:,:) ),4)
+
+         END IF
+
+         IF(l_dbg_print) PRINT *, 'LOLO: Cd, Ch / TOTAL / ice   =', REAL(Cd_i(:,:),4), REAL(Ch_i(:,:),4)
+
+
+         !! Adjusting temperature and humidity from zt to zu:
+         IF( .NOT. l_zt_equal_zu ) THEN
+
+            !! Over ice:
+            ztmp1(:,:) = zCdN_s(:,:) + zCdN_f(:,:)    ! total neutral drag coeff!
+            ztmp2(:,:) = zz0_s(:,:) + zz0_f(:,:)      ! total roughness length z0
+            ztmp1 = LOG(zt/zu) + f_h_louis( zu, RiB(:,:), ztmp1(:,:), ztmp2(:,:) ) &
+               &               - f_h_louis( zt, RiB(:,:), ztmp1(:,:), ztmp2(:,:) )
+            ztmp2 = 1._wp/SQRT(Cd_i(:,:))
+
+            t_zu_i(:,:) = t_zt - (Ch_i(:,:) * dt_zu(:,:) * ztmp2) / vkarmn * ztmp1   ! t_star = Ch * dt_zu / SQRT(Cd)
+            q_zu_i(:,:) = q_zt - (Ch_i(:,:) * dq_zu(:,:) * ztmp2) / vkarmn * ztmp1   ! q_star = Ce * dq_zu / SQRT(Cd)
+            q_zu_i(:,:) = MAX(0._wp, q_zu_i(:,:))
+
+            dt_zu(:,:) = t_zu_i(:,:) - Ts_i
+            dq_zu(:,:) = q_zu_i(:,:) - qs_i
+
+            dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6_wp), dt_zu )
+            dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9_wp), dq_zu )
+         END IF
+
+         IF(l_dbg_print) PRINT *, ''!LOLO
+
+      END DO !DO jit = 1, nbit
+
+      Ce_i(:,:)   =  Ch_i(:,:)
+
+      IF( lreturn_cdn )   CdN = zCdN_s(:,:)+zCdN_f(:,:)
+      IF( lreturn_chn )   ChN = zChN_s(:,:)+zChN_f(:,:)
+      IF( lreturn_cen )   CeN = zChN_s(:,:)+zChN_f(:,:)
+
+      IF( lreturn_z0 ) xz0   = z0_from_Cd( zu, zCdN_s(:,:)+zCdN_f(:,:) )
+
+      IF( lreturn_ustar ) xu_star = SQRT(Cd_i) * Ubzu
+
+      IF( lreturn_L ) THEN
+         ztmp1 = SQRT(Cd_i)
+         xL    = 1./One_on_L( t_zu_i, q_zu_i, ztmp1*Ubzu, Ch_i*dt_zu(:,:)/ztmp1, Ce_i*dq_zu(:,:)/ztmp1 )
+      END IF
+
+      IF( lreturn_UN10 ) THEN
+         ztmp1 = zCdN_s(:,:) + zCdN_f(:,:)  ! => CdN
+         xUN10 = SQRT(Cd_i) * Ubzu/vkarmn * LOG( 10._wp / z0_from_Cd(zu, ztmp1) )
+      END IF
+
+      DEALLOCATE ( Ubzu )
+      DEALLOCATE ( ztmp1, ztmp2 )
+      DEALLOCATE ( dt_zu, dq_zu )
+      DEALLOCATE ( zz0_s, zz0_f, RiB, zCdN_s, zChN_s, zCdN_f, zChN_f )
+
+   END SUBROUTINE turb_ice_lg15
+
+   !!======================================================================
+END MODULE sbcblk_algo_ice_lg15
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lu12.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lu12.F90	(revision 14072)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_lu12.F90	(revision 14072)
@@ -0,0 +1,185 @@
+MODULE sbcblk_algo_ice_lu12
+   !!======================================================================
+   !!                   ***  MODULE  sbcblk_algo_ice_lu12  ***
+   !!       Computes turbulent components of surface fluxes over sea-ice
+   !!
+   !!  Lüpkes, C., Gryanik, V. M., Hartmann, J., and Andreas, E. L. ( 2012), A parametrization, based on sea ice morphology,
+   !!  of the neutral atmospheric drag coefficients for weather prediction and climate models, J. Geophys. Res., 117, D13112,
+   !!  doi:10.1029/2012JD017630.
+   !!
+   !!       => Despite the fact that the sea-ice concentration (frice) must be provided,
+   !!          only transfer coefficients, and air temp. + hum. height adjustement
+   !!          over ice are returned/performed.
+   !!        ==> 'frice' is only here to estimate the form drag caused by sea-ice...
+   !!
+   !!       Routine turb_ice_lu12 maintained and developed in AeroBulk
+   !!                     (https://github.com/brodeau/aerobulk/)
+   !!
+   !!            Author: Laurent Brodeau, Summer 2020
+   !!
+   !!----------------------------------------------------------------------
+   USE par_kind, ONLY: wp
+   USE par_oce,  ONLY: jpi, jpj
+   USE phycst          ! physical constants
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
+   USE sbcblk_algo_ice_cdn
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC :: turb_ice_lu12
+
+   REAL(wp), PARAMETER :: rz0_i_s_0  = 0.69e-3_wp  ! Eq.(43) of Lupkes & Gryanik (2015) [m] => to estimate CdN10 for skin drag!
+   REAL(wp), PARAMETER :: rz0_i_f_0  = 4.54e-4_wp  ! bottom p.562 MIZ [m] (LG15)   
+
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_ice_lu12( zt, zu, Ts_i, t_zt, qs_i, q_zt, U_zu, frice, &
+      &                      Cd_i, Ch_i, Ce_i, t_zu_i, q_zu_i,            &
+      &                      CdN, ChN, CeN, xz0, xu_star, xL, xUN10 )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_ice_lu12  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to:
+      !!                Lüpkes, C., Gryanik, V. M., Hartmann, J., and Andreas, E. L. ( 2012),
+      !!                A parametrization, based on sea ice morphology, of the neutral
+      !!                atmospheric drag coefficients for weather prediction and climate models,
+      !!                J. Geophys. Res., 117, D13112, doi:10.1029/2012JD017630.
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (usually 10m)                     [m]
+      !!    *  Ts_i  : surface temperature of sea-ice                         [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  qs_i  : saturation specific humidity at temp. Ts_i over ice    [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!    *  U_zu : scalar wind speed at zu                                 [m/s]
+      !!    * frice : sea-ice concentration        (fraction)
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd_i   : drag coefficient over sea-ice
+      !!    *  Ch_i   : sensible heat coefficient over sea-ice
+      !!    *  Ce_i   : sublimation coefficient over sea-ice
+      !!    *  t_zu_i : pot. air temp. adjusted at zu over sea-ice             [K]
+      !!    *  q_zu_i : spec. hum. of air adjusted at zu over sea-ice          [kg/kg]
+      !!
+      !! OPTIONAL OUTPUT:
+      !! ----------------
+      !!    * CdN     : neutral-stability drag coefficient
+      !!    * ChN     : neutral-stability sensible heat coefficient
+      !!    * CeN     : neutral-stability evaporation coefficient
+      !!    * xz0     : return the aerodynamic roughness length (integration constant for wind stress) [m]
+      !!    * xu_star : return u* the friction velocity                    [m/s]
+      !!    * xL      : return the Obukhov length                          [m]
+      !!    * xUN10   : neutral wind speed at 10m                          [m/s]
+      !!
+      !! ** Author: L. Brodeau, January 2020 / AeroBulk (https://github.com/brodeau/aerobulk/)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in )                     :: zt    ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in )                     :: zu    ! height for U_zu                             [m]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: Ts_i  ! ice surface temperature                [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: t_zt  ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: qs_i  ! sat. spec. hum. at ice/air interface    [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt  ! spec. air humidity at zt               [kg/kg]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: U_zu  ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: frice ! sea-ice concentration        (fraction)
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Cd_i  ! drag coefficient over sea-ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ch_i  ! transfert coefficient for heat over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: Ce_i  ! transfert coefficient for sublimation over ice
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: t_zu_i ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) :: q_zu_i ! spec. humidity adjusted at zu           [kg/kg]
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CdN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: ChN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: CeN
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xz0  ! Aerodynamic roughness length   [m]
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xu_star  ! u*, friction velocity
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xL  ! zeta (zu/L)
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj), OPTIONAL :: xUN10  ! Neutral wind at zu
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: dt_zu, dq_zu, z0
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: Ubzu
+      !!
+      LOGICAL :: lreturn_cdn=.FALSE., lreturn_chn=.FALSE., lreturn_cen=.FALSE.
+      LOGICAL :: lreturn_z0=.FALSE., lreturn_ustar=.FALSE., lreturn_L=.FALSE., lreturn_UN10=.FALSE.
+      !!
+      CHARACTER(len=40), PARAMETER :: crtnm = 'turb_ice_lu12@sbcblk_algo_ice_lu12.f90'
+      !!----------------------------------------------------------------------------------
+      ALLOCATE ( Ubzu(jpi,jpj) )
+      ALLOCATE ( dt_zu(jpi,jpj), dq_zu(jpi,jpj), z0(jpi,jpj) )
+
+      lreturn_cdn   = PRESENT(CdN)
+      lreturn_chn   = PRESENT(ChN)
+      lreturn_cen   = PRESENT(CeN)
+      lreturn_z0    = PRESENT(xz0)
+      lreturn_ustar = PRESENT(xu_star)
+      lreturn_L     = PRESENT(xL)
+      lreturn_UN10  = PRESENT(xUN10)
+
+      !! Scalar wind speed cannot be below 0.2 m/s
+      Ubzu = MAX( U_zu, wspd_thrshld_ice )
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu_i = MAX( t_zt ,   100._wp )   ! who knows what's given on masked-continental regions...
+      q_zu_i = MAX( q_zt , 0.1e-6_wp )   !               "
+
+      !! Air-Ice & Air-Sea differences (and we don't want them to be 0!)
+      dt_zu = t_zu_i - Ts_i ;   dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6_wp), dt_zu )
+      dq_zu = q_zu_i - qs_i ;   dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9_wp), dq_zu )
+
+      !! To estimate CDN10_skin:
+      !!  we use the method that comes in LG15, i.e. by starting from a default roughness length z0 for skin drag:
+
+      Ce_i(:,:) = rz0_i_s_0 !! temporary array to contain roughness length for skin drag !
+
+
+      !! Method #1:
+      !Cd_i(:,:) = Cd_from_z0( zu, Ce_i(:,:) )  + CdN10_f_LU13( frice(:,:) )
+      !IF( lreturn_cdfrm ) CdN_frm = CdN10_f_LU13( frice(:,:) )
+      !PRINT *, 'LOLO: estimate of Cd_f_i method #1 =>', CdN10_f_LU13( frice(:,:) ); PRINT *, ''
+
+      !! Method #2:
+      !! We need an estimate of z0 over water:
+      !z0_w(:,:) = z0_from_Cd( zu, CD_N10_NCAR(Ubzu) )
+      !!PRINT *, 'LOLO: estimate of z0_w =>', z0_w
+      !Cd_i(:,:)   = Cd_from_z0( zu, Ce_i(:,:) )  + CdN10_f_LU12( frice(:,:), z0_w(:,:) )
+      !IF( lreturn_cdfrm ) CdN_frm =  CdN10_f_LU12( frice(:,:), z0_w(:,:) )
+      !!          N10 skin drag                     N10 form drag
+
+      !! Method #3:
+      !Cd_i(:,:)   = Cd_from_z0( zu, Ce_i(:,:) ) + CdN10_f_LU12_eq36( frice(:,:) )
+      !IF( lreturn_cdfrm ) CdN_frm = CdN10_f_LU12_eq36( frice(:,:) )
+      !PRINT *, 'LOLO: estimate of Cd_f_i method #2 =>', CdN10_f_LU12( frice(:,:), z0_w(:,:) )
+
+      !! Method #4:
+      !! using eq.21 of LG15 instead:
+      z0(:,:) = rz0_i_f_0
+      !Cd_i(:,:)   = Cd_from_z0( zu, Ce_i(:,:) )  + CdN_f_LG15( zu, frice(:,:), z0(:,:) ) / frice(:,:)
+      Cd_i(:,:)   = Cd_from_z0( zu, Ce_i(:,:) )  + CdN_f_LG15( zu, frice(:,:), z0(:,:) ) !/ frice(:,:)
+      !IF( lreturn_cdfrm ) CdN_frm = CdN_f_LG15( zu, frice(:,:), z0(:,:) )
+
+
+      Ch_i(:,:) = Cd_i(:,:)
+      Ce_i(:,:) = Cd_i(:,:)
+
+      IF( lreturn_cdn )   CdN = Cd_i(:,:)
+      IF( lreturn_chn )   ChN = Ch_i(:,:)
+      IF( lreturn_cen )   CeN = Ce_i(:,:)
+
+      IF( lreturn_z0 )    xz0     = z0_from_Cd( zu, Cd_i )
+      IF( lreturn_ustar ) xu_star = SQRT(Cd_i)*Ubzu
+      IF( lreturn_L )     xL      = 1./One_on_L(t_zu_i, q_zu_i, SQRT(Cd_i)*Ubzu, &
+         &                          Cd_i/SQRT(Cd_i)*dt_zu, Cd_i/SQRT(Cd_i)*dq_zu)
+      IF( lreturn_UN10 )  xUN10   = SQRT(Cd_i)*Ubzu/vkarmn * LOG( 10._wp / z0_from_Cd( zu, Cd_i ) )
+
+      DEALLOCATE ( dt_zu, dq_zu, z0 )
+      DEALLOCATE ( Ubzu )
+
+   END SUBROUTINE turb_ice_lu12
+
+   !!======================================================================
+END MODULE sbcblk_algo_ice_lu12
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ncar.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ncar.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_algo_ncar.F90	(revision 14072)
@@ -5,5 +5,5 @@
    !!   * bulk transfer coefficients C_D, C_E and C_H
    !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
-   !!   * the effective bulk wind speed at 10m U_blk
+   !!   * the effective bulk wind speed at 10m Ubzu
    !!   => all these are used in bulk formulas in sbcblk.F90
    !!
@@ -16,4 +16,5 @@
    !!=====================================================================
    !! History :  3.6  !  2016-02  (L.Brodeau) successor of old turb_ncar of former sbcblk_core.F90
+   !!            4.2  !  2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
 
@@ -23,20 +24,9 @@
    !!                   returns the effective bulk wind speed at 10m
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
+   USE sbc_oce, ONLY: ln_cdgw
+   USE sbcwave, ONLY: cdn_wave ! wave module
    USE phycst          ! physical constants
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbcwave, ONLY   :  cdn_wave ! wave module
-#if defined key_si3 || defined key_cice
-   USE sbc_ice         ! Surface boundary condition: ice fields
-#endif
-   !
-   USE iom             ! I/O manager library
-   USE lib_mpp         ! distribued memory computing library
-   USE in_out_manager  ! I/O manager
-   USE prtctl          ! Print control
-   USE lib_fortran     ! to use key_nosignedzero
-
-   USE sbcblk_phy      ! all thermodynamics functions, rho_air, q_sat, etc... !LB
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
 
    IMPLICIT NONE
@@ -45,5 +35,4 @@
    PUBLIC :: TURB_NCAR   ! called by sbcblk.F90
 
-   INTEGER , PARAMETER ::   nb_itt = 5        ! number of itterations
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -52,7 +41,7 @@
 CONTAINS
 
-   SUBROUTINE turb_ncar( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
-      &                  Cd, Ch, Ce, t_zu, q_zu, U_blk,      &
-      &                  Cdn, Chn, Cen                       )
+   SUBROUTINE turb_ncar(    zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
+      &                     Cd, Ch, Ce, t_zu, q_zu, Ubzu,       &
+      &                     nb_iter, CdN, ChN, CeN               )
       !!----------------------------------------------------------------------------------
       !!                      ***  ROUTINE  turb_ncar  ***
@@ -61,6 +50,5 @@
       !!                fluxes according to Large & Yeager (2004) and Large & Yeager (2008)
       !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
-      !!                Returns the effective bulk wind speed at 10m to be used in the bulk formulas
-      !!
+      !!                Returns the effective bulk wind speed at zu to be used in the bulk formulas
       !!
       !! INPUT :
@@ -82,6 +70,11 @@
       !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
       !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
-      !!    *  U_blk  : bulk wind speed at zu                                 [m/s]
-      !!
+      !!    *  Ubzu   : bulk wind speed at zu                                 [m/s]
+      !!
+      !! OPTIONAL OUTPUT:
+      !! ----------------
+      !!    * CdN      : neutral-stability drag coefficient
+      !!    * ChN      : neutral-stability sensible heat coefficient
+      !!    * CeN      : neutral-stability evaporation coefficient
       !!
       !! ** Author: L. Brodeau, June 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
@@ -99,141 +92,146 @@
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind speed at zu                     [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cdn, Chn, Cen ! neutral transfer coefficients
-      !
-      INTEGER :: j_itt
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ubzu    ! bulk wind speed at zu                     [m/s]
+      !
+      INTEGER , INTENT(in   ), OPTIONAL                     :: nb_iter  ! number of iterations
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CdN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   ChN
+      REAL(wp), INTENT(  out), OPTIONAL, DIMENSION(jpi,jpj) ::   CeN
+      !
+      INTEGER :: nbit, jit                    ! iterations...
       LOGICAL :: l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
       !
-      REAL(wp), DIMENSION(jpi,jpj) ::   Cx_n10        ! 10m neutral latent/sensible coefficient
-      REAL(wp), DIMENSION(jpi,jpj) ::   sqrt_Cd_n10   ! root square of Cd_n10
+      REAL(wp), DIMENSION(jpi,jpj) ::   zCdN, zCeN, zChN        ! 10m neutral latent/sensible coefficient
+      REAL(wp), DIMENSION(jpi,jpj) ::   zsqrt_Cd, zsqrt_CdN   ! root square of Cd and Cd_neutral
       REAL(wp), DIMENSION(jpi,jpj) ::   zeta_u        ! stability parameter at height zu
-      REAL(wp), DIMENSION(jpi,jpj) ::   zpsi_h_u
       REAL(wp), DIMENSION(jpi,jpj) ::   ztmp0, ztmp1, ztmp2
-      REAL(wp), DIMENSION(jpi,jpj) ::   stab          ! stability test integer
-      !!----------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------------------
+      nbit = nb_iter0
+      IF( PRESENT(nb_iter) ) nbit = nb_iter
+
       l_zt_equal_zu = ( ABS(zu - zt) < 0.01_wp ) ! testing "zu == zt" is risky with double precision
 
-      U_blk = MAX( 0.5_wp , U_zu )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
+      Ubzu = MAX( 0.5_wp , U_zu )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
 
       !! First guess of stability:
       ztmp0 = virt_temp(t_zt, q_zt) - virt_temp(sst, ssq) ! air-sea difference of virtual pot. temp. at zt
-      stab  = 0.5_wp + sign(0.5_wp,ztmp0)                           ! stab = 1 if dTv > 0  => STABLE, 0 if unstable
+      ztmp1 = 0.5_wp + SIGN(0.5_wp,ztmp0)                 ! ztmp1 = 1 if dTv > 0  => STABLE, 0 if unstable
 
       !! Neutral coefficients at 10m:
       IF( ln_cdgw ) THEN      ! wave drag case
          cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) )
-         ztmp0   (:,:) = cdn_wave(:,:)
+         zCdN   (:,:) = cdn_wave(:,:)
       ELSE
-      ztmp0 = cd_neutral_10m( U_blk )
+      zCdN = cd_n10_ncar( Ubzu )
       ENDIF
 
-      sqrt_Cd_n10 = SQRT( ztmp0 )
+      zsqrt_CdN = SQRT( zCdN )
 
       !! Initializing transf. coeff. with their first guess neutral equivalents :
-      Cd = ztmp0
-      Ce = 1.e-3_wp*( 34.6_wp * sqrt_Cd_n10 )
-      Ch = 1.e-3_wp*sqrt_Cd_n10*(18._wp*stab + 32.7_wp*(1._wp - stab))
-      stab = sqrt_Cd_n10   ! Temporaty array !!! stab == SQRT(Cd)
- 
+      Cd = zCdN
+      Ce = ce_n10_ncar( zsqrt_CdN )
+      Ch = ch_n10_ncar( zsqrt_CdN , ztmp1 )   ! ztmp1 is stability (1/0)
+      zsqrt_Cd = zsqrt_CdN
+
       IF( ln_cdgw ) THEN
-	Cen = Ce
-	Chn = Ch
+         zCeN = Ce
+         zChN = Ch
       ENDIF
 
-      !! First guess of temperature and humidity at height zu:
+      !! Initializing values at z_u with z_t values:
       t_zu = MAX( t_zt ,  180._wp )   ! who knows what's given on masked-continental regions...
       q_zu = MAX( q_zt , 1.e-6_wp )   !               "
 
+
       !! ITERATION BLOCK
-      DO j_itt = 1, nb_itt
+      DO jit = 1, nbit
          !
          ztmp1 = t_zu - sst   ! Updating air/sea differences
          ztmp2 = q_zu - ssq
 
-         ! Updating turbulent scales :   (L&Y 2004 eq. (7))
-         ztmp0 = stab*U_blk       ! u*       (stab == SQRT(Cd))
-         ztmp1 = Ch/stab*ztmp1    ! theta*   (stab == SQRT(Cd))
-         ztmp2 = Ce/stab*ztmp2    ! q*       (stab == SQRT(Cd))
-
-         ! Estimate the inverse of Monin-Obukov length (1/L) at height zu:
+         ! Updating turbulent scales :   (L&Y 2004 Eq. (7))
+         ztmp0 = zsqrt_Cd*Ubzu       ! u*
+         ztmp1 = Ch/zsqrt_Cd*ztmp1    ! theta*
+         ztmp2 = Ce/zsqrt_Cd*ztmp2    ! q*
+
+         ! Estimate the inverse of Obukov length (1/L) at height zu:
          ztmp0 = One_on_L( t_zu, q_zu, ztmp0, ztmp1, ztmp2 )
-         
+
          !! Stability parameters :
          zeta_u   = zu*ztmp0
-         zeta_u = sign( min(abs(zeta_u),10._wp), zeta_u )
-         zpsi_h_u = psi_h( zeta_u )
-
-         !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c))
+         zeta_u   = sign( min(abs(zeta_u),10._wp), zeta_u )
+
+         !! Shifting temperature and humidity at zu (L&Y 2004 Eq. (9b-9c))
          IF( .NOT. l_zt_equal_zu ) THEN
-            !! Array 'stab' is free for the moment so using it to store 'zeta_t'
-            stab = zt*ztmp0
-            stab = SIGN( MIN(ABS(stab),10._wp), stab )  ! Temporaty array stab == zeta_t !!!
-            stab = LOG(zt/zu) + zpsi_h_u - psi_h(stab)                   ! stab just used as temp array again!
-            t_zu = t_zt - ztmp1/vkarmn*stab    ! ztmp1 is still theta*  L&Y 2004 eq.(9b)
-            q_zu = q_zt - ztmp2/vkarmn*stab    ! ztmp2 is still q*      L&Y 2004 eq.(9c)
-            q_zu = max(0._wp, q_zu)
-         ENDIF
-
-         ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)...
+            ztmp0 = zt*ztmp0 ! zeta_t !
+            ztmp0 = SIGN( MIN(ABS(ztmp0),10._wp), ztmp0 )  ! Temporaty array ztmp0 == zeta_t !!!
+            ztmp0 = LOG(zt/zu) + psi_h_ncar(zeta_u) - psi_h_ncar(ztmp0)                   ! ztmp0 just used as temp array again!
+            t_zu = t_zt - ztmp1/vkarmn*ztmp0    ! ztmp1 is still theta*  L&Y 2004 Eq. (9b)
+            !!
+            q_zu = q_zt - ztmp2/vkarmn*ztmp0    ! ztmp2 is still q*      L&Y 2004 Eq. (9c)
+            q_zu = MAX(0._wp, q_zu)
+         END IF
+
+         ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 Eq. 9a)...
          !   In very rare low-wind conditions, the old way of estimating the
          !   neutral wind speed at 10m leads to a negative value that causes the code
          !   to crash. To prevent this a threshold of 0.25m/s is imposed.
-         ztmp2 = psi_m(zeta_u)
+         ztmp2 = psi_m_ncar(zeta_u)
          IF( ln_cdgw ) THEN      ! surface wave case
-            stab = vkarmn / ( vkarmn / sqrt_Cd_n10 - ztmp2 )  ! (stab == SQRT(Cd))
-            Cd   = stab * stab
-            ztmp0 = (LOG(zu/10._wp) - zpsi_h_u) / vkarmn / sqrt_Cd_n10
-            ztmp2 = stab / sqrt_Cd_n10   ! (stab == SQRT(Cd))
-            ztmp1 = 1._wp + Chn * ztmp0     
-            Ch    = Chn * ztmp2 / ztmp1  ! L&Y 2004 eq. (10b)
-            ztmp1 = 1._wp + Cen * ztmp0
-            Ce    = Cen * ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
+            zsqrt_Cd = vkarmn / ( vkarmn / zsqrt_CdN - ztmp2 )
+            Cd   = zsqrt_Cd * zsqrt_Cd
+            ztmp0 = (LOG(zu/10._wp) - psi_h_ncar(zeta_u)) / vkarmn / zsqrt_CdN
+            ztmp2 = zsqrt_Cd / zsqrt_CdN
+            ztmp1 = 1._wp + zChN * ztmp0
+            Ch    = zChN * ztmp2 / ztmp1  ! L&Y 2004 eq. (10b)
+            ztmp1 = 1._wp + zCeN * ztmp0
+            Ce    = zCeN * ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
 
          ELSE
-         ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)...
-         !   In very rare low-wind conditions, the old way of estimating the
-         !   neutral wind speed at 10m leads to a negative value that causes the code
-         !   to crash. To prevent this a threshold of 0.25m/s is imposed.
-         ztmp0 = MAX( 0.25_wp , U_blk/(1._wp + sqrt_Cd_n10/vkarmn*(LOG(zu/10._wp) - ztmp2)) ) ! U_n10 (ztmp2 == psi_m(zeta_u))
-         ztmp0 = cd_neutral_10m(ztmp0)                                               ! Cd_n10
-         Cdn(:,:) = ztmp0
-         sqrt_Cd_n10 = sqrt(ztmp0)
-
-         stab    = 0.5_wp + sign(0.5_wp,zeta_u)                        ! update stability
-         Cx_n10  = 1.e-3_wp*sqrt_Cd_n10*(18._wp*stab + 32.7_wp*(1._wp - stab))  ! L&Y 2004 eq. (6c-6d)    (Cx_n10 == Ch_n10)
-         Chn(:,:) = Cx_n10
+         ztmp0 = MAX( 0.25_wp , UN10_from_CD(zu, Ubzu, Cd, ppsi=ztmp2) ) ! U_n10 (ztmp2 == psi_m_ncar(zeta_u))
+
+         zCdN = cd_n10_ncar(ztmp0)
+         zsqrt_CdN = sqrt(zCdN)
 
          !! Update of transfer coefficients:
-         ztmp1 = 1._wp + sqrt_Cd_n10/vkarmn*(LOG(zu/10._wp) - ztmp2)   ! L&Y 2004 eq. (10a) (ztmp2 == psi_m(zeta_u))
-         Cd      = ztmp0 / ( ztmp1*ztmp1 )
-         stab = SQRT( Cd ) ! Temporary array !!! (stab == SQRT(Cd))
-
-         ztmp0 = (LOG(zu/10._wp) - zpsi_h_u) / vkarmn / sqrt_Cd_n10
-         ztmp2 = stab / sqrt_Cd_n10   ! (stab == SQRT(Cd))
-         ztmp1 = 1._wp + Cx_n10*ztmp0    ! (Cx_n10 == Ch_n10)
-         Ch  = Cx_n10*ztmp2 / ztmp1   ! L&Y 2004 eq. (10b)
-
-         Cx_n10  = 1.e-3_wp * (34.6_wp * sqrt_Cd_n10)  ! L&Y 2004 eq. (6b)    ! Cx_n10 == Ce_n10
-         Cen(:,:) = Cx_n10
-         ztmp1 = 1._wp + Cx_n10*ztmp0
-         Ce  = Cx_n10*ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
+
+         !! C_D
+         ztmp1  = 1._wp + zsqrt_CdN/vkarmn*(LOG(zu/10._wp) - ztmp2)   ! L&Y 2004 Eq. (10a) (ztmp2 == psi_m(zeta_u))
+         Cd     = MAX( zCdN / ( ztmp1*ztmp1 ), Cx_min )
+
+         !! C_H and C_E
+         zsqrt_Cd = SQRT( Cd )
+         ztmp0 = ( LOG(zu/10._wp) - psi_h_ncar(zeta_u) ) / vkarmn / zsqrt_CdN
+         ztmp2 = zsqrt_Cd / zsqrt_CdN
+
+         ztmp1 = 0.5_wp + SIGN(0.5_wp,zeta_u)                                ! update stability
+         zChN  = 1.e-3_wp * zsqrt_CdN*(18._wp*ztmp1 + 32.7_wp*(1._wp - ztmp1))  ! L&Y 2004 eq. (6c-6d)
+         zCeN  = 1.e-3_wp * (34.6_wp * zsqrt_CdN)                             ! L&Y 2004 eq. (6b)
+
+         Ch    = MAX( zChN*ztmp2 / ( 1._wp + zChN*ztmp0 ) , Cx_min ) ! L&Y 2004 eq. (10b)
+         Ce    = MAX( zCeN*ztmp2 / ( 1._wp + zCeN*ztmp0 ) , Cx_min ) ! L&Y 2004 eq. (10c)
+
          ENDIF
 
-      END DO !DO j_itt = 1, nb_itt
+      END DO !DO jit = 1, nbit
+
+      IF(PRESENT(CdN)) CdN(:,:) = zCdN(:,:)
+      IF(PRESENT(CeN)) CeN(:,:) = zCeN(:,:)
+      IF(PRESENT(ChN)) ChN(:,:) = zChN(:,:)
 
    END SUBROUTINE turb_ncar
 
 
-   FUNCTION cd_neutral_10m( pw10 )
-      !!----------------------------------------------------------------------------------      
+   FUNCTION cd_n10_ncar( pw10 )
+      !!----------------------------------------------------------------------------------
       !! Estimate of the neutral drag coefficient at 10m as a function
       !! of neutral wind  speed at 10m
       !!
-      !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b)
+      !! Origin: Large & Yeager 2008, Eq. (11)
       !!
       !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
       !!----------------------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pw10           ! scalar wind speed at 10m (m/s)
-      REAL(wp), DIMENSION(jpi,jpj)             :: cd_neutral_10m
+      REAL(wp), DIMENSION(jpi,jpj)             :: cd_n10_ncar
       !
       INTEGER  ::     ji, jj     ! dummy loop indices
@@ -242,27 +240,60 @@
       !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         !
-         zw  = pw10(ji,jj)
-         zw6 = zw*zw*zw
-         zw6 = zw6*zw6
-         !
-         ! When wind speed > 33 m/s => Cyclone conditions => special treatment
-         zgt33 = 0.5_wp + SIGN( 0.5_wp, (zw - 33._wp) )   ! If pw10 < 33. => 0, else => 1
-         !
-         cd_neutral_10m(ji,jj) = 1.e-3_wp * ( &
-            &       (1._wp - zgt33)*( 2.7_wp/zw + 0.142_wp + zw/13.09_wp - 3.14807E-10_wp*zw6) & ! wind <  33 m/s
-            &      +    zgt33   *      2.34_wp )                                                 ! wind >= 33 m/s
-         !
-         cd_neutral_10m(ji,jj) = MAX(cd_neutral_10m(ji,jj), 1.E-6_wp)
-         !
+            !
+            zw  = pw10(ji,jj)
+            zw6 = zw*zw*zw
+            zw6 = zw6*zw6
+            !
+            ! When wind speed > 33 m/s => Cyclone conditions => special treatment
+            zgt33 = 0.5_wp + SIGN( 0.5_wp, (zw - 33._wp) )   ! If pw10 < 33. => 0, else => 1
+            !
+            cd_n10_ncar(ji,jj) = 1.e-3_wp * ( &
+               &       (1._wp - zgt33)*( 2.7_wp/zw + 0.142_wp + zw/13.09_wp - 3.14807E-10_wp*zw6) & ! wind <  33 m/s
+               &      +    zgt33   *      2.34_wp )                                                 ! wind >= 33 m/s
+            !
+            cd_n10_ncar(ji,jj) = MAX( cd_n10_ncar(ji,jj), Cx_min )
+            !
       END_2D
       !
-   END FUNCTION cd_neutral_10m
-
-
-   FUNCTION psi_m( pzeta )
+   END FUNCTION cd_n10_ncar
+
+
+   FUNCTION ch_n10_ncar( psqrtcdn10 , pstab )
+      !!----------------------------------------------------------------------------------
+      !! Estimate of the neutral heat transfer coefficient at 10m      !!
+      !! Origin: Large & Yeager 2008, Eq. (9) and (12)
+
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: ch_n10_ncar
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: psqrtcdn10 ! sqrt( CdN10 )
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pstab      ! stable ABL => 1 / unstable ABL => 0
+      !!----------------------------------------------------------------------------------
+      IF( ANY(pstab < -0.00001) .OR. ANY(pstab >  1.00001) ) THEN
+         PRINT *, 'ERROR: ch_n10_ncar@mod_blk_ncar.f90: pstab ='
+         PRINT *, pstab
+         STOP
+      END IF
+      !
+      ch_n10_ncar = MAX( 1.e-3_wp * psqrtcdn10*( 18._wp*pstab + 32.7_wp*(1._wp - pstab) )  , Cx_min )   ! Eq. (9) & (12) Large & Yeager, 2008
+      !
+   END FUNCTION ch_n10_ncar
+
+   FUNCTION ce_n10_ncar( psqrtcdn10 )
+      !!----------------------------------------------------------------------------------
+      !! Estimate of the neutral heat transfer coefficient at 10m      !!
+      !! Origin: Large & Yeager 2008, Eq. (9) and (13)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: ce_n10_ncar
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: psqrtcdn10 ! sqrt( CdN10 )
+      !!----------------------------------------------------------------------------------
+      ce_n10_ncar = MAX( 1.e-3_wp * ( 34.6_wp * psqrtcdn10 ) , Cx_min )
+      !
+   END FUNCTION ce_n10_ncar
+
+
+   FUNCTION psi_m_ncar( pzeta )
       !!----------------------------------------------------------------------------------
       !! Universal profile stability function for momentum
-      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
+      !!    !! Psis, L&Y 2004, Eq. (8c), (8d), (8e)
       !!
       !! pzeta : stability paramenter, z/L where z is altitude measurement
@@ -271,28 +302,36 @@
       !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
       !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) :: psi_m
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_ncar
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
       !
       INTEGER  ::   ji, jj    ! dummy loop indices
-      REAL(wp) :: zx2, zx, zstab   ! local scalars
+      REAL(wp) :: zta, zx2, zx, zpsi_unst, zpsi_stab,  zstab   ! local scalars
       !!----------------------------------------------------------------------------------
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) )
-         zx2 = MAX( zx2 , 1._wp )
-         zx  = SQRT( zx2 )
-         zstab = 0.5_wp + SIGN( 0.5_wp , pzeta(ji,jj) )
-         !
-         psi_m(ji,jj) =        zstab  * (-5._wp*pzeta(ji,jj))       &          ! Stable
-            &          + (1._wp - zstab) * (2._wp*LOG((1._wp + zx)*0.5_wp)   &          ! Unstable
-            &               + LOG((1._wp + zx2)*0.5_wp) - 2._wp*ATAN(zx) + rpi*0.5_wp)  !    "
-         !
+            zta = pzeta(ji,jj)
+            !
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 - 16z)^0.5
+            zx2 = MAX( zx2 , 1._wp )
+            zx  = SQRT(zx2)                          ! (1 - 16z)^0.25
+            zpsi_unst = 2._wp*LOG( (1._wp + zx )*0.5_wp )   &
+               &            + LOG( (1._wp + zx2)*0.5_wp )   &
+               &          - 2._wp*ATAN(zx) + rpi*0.5_wp
+            !
+            zpsi_stab = -5._wp*zta
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_m_ncar(ji,jj) =          zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &              + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
+            !
       END_2D
-   END FUNCTION psi_m
-
-
-   FUNCTION psi_h( pzeta )
+   END FUNCTION psi_m_ncar
+
+
+   FUNCTION psi_h_ncar( pzeta )
       !!----------------------------------------------------------------------------------
       !! Universal profile stability function for temperature and humidity
-      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
+      !!    !! Psis, L&Y 2004, Eq. (8c), (8d), (8e)
       !!
       !! pzeta : stability paramenter, z/L where z is altitude measurement
@@ -301,21 +340,28 @@
       !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
       !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj) :: psi_h
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_ncar
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
       !
       INTEGER  ::   ji, jj     ! dummy loop indices
-      REAL(wp) :: zx2, zstab  ! local scalars
+      REAL(wp) :: zta, zx2, zpsi_unst, zpsi_stab, zstab  ! local scalars
       !!----------------------------------------------------------------------------------
       !
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) )
-         zx2 = MAX( zx2 , 1._wp )
-         zstab = 0.5_wp + SIGN( 0.5_wp , pzeta(ji,jj) )
-         !
-         psi_h(ji,jj) =         zstab  * (-5._wp*pzeta(ji,jj))        &  ! Stable
-            &           + (1._wp - zstab) * (2._wp*LOG( (1._wp + zx2)*0.5_wp ))   ! Unstable
-         !
+            !
+            zta = pzeta(ji,jj)
+            !
+            zx2 = SQRT( ABS(1._wp - 16._wp*zta) )  ! (1 -16z)^0.5
+            zx2 = MAX( zx2 , 1._wp )
+            zpsi_unst = 2._wp*LOG( 0.5_wp*(1._wp + zx2) )
+            !
+            zpsi_stab = -5._wp*zta
+            !
+            zstab = 0.5_wp + SIGN(0.5_wp, zta) ! zta > 0 => zstab = 1
+            !
+            psi_h_ncar(ji,jj) =          zstab  * zpsi_stab &  ! (zta > 0) Stable
+               &              + (1._wp - zstab) * zpsi_unst    ! (zta < 0) Unstable
+            !
       END_2D
-   END FUNCTION psi_h
+   END FUNCTION psi_h_ncar
 
    !!======================================================================
Index: MO/trunk/src/OCE/SBC/sbcblk_phy.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_phy.F90	(revision 14071)
+++ 	(revision )
@@ -1,669 +1,0 @@
-MODULE sbcblk_phy
-   !!======================================================================
-   !!                       ***  MODULE  sbcblk_phy  ***
-   !! A set of functions to compute air themodynamics parameters
-   !!                     needed by Aerodynamic Bulk Formulas
-   !!=====================================================================
-   !!            4.0  !  2019 L. Brodeau from AeroBulk package (https://github.com/brodeau/aerobulk/)
-   !!----------------------------------------------------------------------
-
-   !!   virt_temp     : virtual (aka sensible) temperature (potential or absolute)
-   !!   rho_air       : density of (moist) air (depends on T_air, q_air and SLP
-   !!   visc_air      : kinematic viscosity (aka Nu_air) of air from temperature
-   !!   L_vap         : latent heat of vaporization of water as a function of temperature
-   !!   cp_air        : specific heat of (moist) air (depends spec. hum. q_air)
-   !!   gamma_moist   : adiabatic lapse-rate of moist air
-   !!   One_on_L      : 1. / ( Monin-Obukhov length )
-   !!   Ri_bulk       : bulk Richardson number aka BRN
-   !!   q_sat         : saturation humidity as a function of SLP and temperature
-   !!   q_air_rh      : specific humidity as a function of RH (fraction, not %), t_air and SLP
-
-   USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !!  (mainly removed from sbcblk.F90)
-   REAL(wp), PARAMETER, PUBLIC :: rCp_dry = 1005.0_wp   !: Specic heat of dry air, constant pressure      [J/K/kg]
-   REAL(wp), PARAMETER, PUBLIC :: rCp_vap = 1860.0_wp   !: Specic heat of water vapor, constant pressure  [J/K/kg]
-   REAL(wp), PARAMETER, PUBLIC :: R_dry   = 287.05_wp   !: Specific gas constant for dry air              [J/K/kg]
-   REAL(wp), PARAMETER, PUBLIC :: R_vap   = 461.495_wp  !: Specific gas constant for water vapor          [J/K/kg]
-   REAL(wp), PARAMETER, PUBLIC :: reps0   = R_dry/R_vap !: ratio of gas constant for dry air and water vapor => ~ 0.622
-   REAL(wp), PARAMETER, PUBLIC :: rctv0   = R_vap/R_dry - 1._wp  !: for virtual temperature (== (1-eps)/eps) => ~ 0.608
-   REAL(wp), PARAMETER, PUBLIC :: rCp_air = 1000.5_wp   !: specific heat of air (only used for ice fluxes now...)
-   REAL(wp), PARAMETER, PUBLIC :: rCd_ice = 1.4e-3_wp   !: transfer coefficient over ice
-   REAL(wp), PARAMETER, PUBLIC :: albo    = 0.066_wp    !: ocean albedo assumed to be constant
-   !
-   REAL(wp), PARAMETER, PUBLIC :: rho0_a  = 1.2_wp      !: Approx. of density of air                       [kg/m^3]
-   REAL(wp), PARAMETER, PUBLIC :: rho0_w  = 1025._wp    !: Density of sea-water  (ECMWF->1025)             [kg/m^3]
-   REAL(wp), PARAMETER, PUBLIC :: radrw = rho0_a/rho0_w !: Density ratio
-   REAL(wp), PARAMETER, PUBLIC :: sq_radrw = SQRT(rho0_a/rho0_w)
-   REAL(wp), PARAMETER, PUBLIC :: rCp0_w  = 4190._wp    !: Specific heat capacity of seawater (ECMWF 4190) [J/K/kg]
-   REAL(wp), PARAMETER, PUBLIC :: rnu0_w  = 1.e-6_wp    !: kinetic viscosity of water                      [m^2/s]
-   REAL(wp), PARAMETER, PUBLIC :: rk0_w   = 0.6_wp      !: thermal conductivity of water (at 20C)          [W/m/K]
-   !
-   REAL(wp), PARAMETER, PUBLIC :: emiss_w = 1._wp       !: Surface emissivity (black-body long-wave radiation) of sea-water []
-   !                                                    !: Theoretically close to 0.97! Yet, taken equal as 1 to account for
-   !                                                    !: the small fraction of downwelling longwave reflected at the
-   !                                                    !: surface (Lind & Katsaros, 1986)
-   REAL(wp), PARAMETER, PUBLIC :: rdct_qsat_salt = 0.98_wp  !: reduction factor on specific humidity at saturation (q_sat(T_s)) due to salt
-   REAL(wp), PARAMETER, PUBLIC :: rtt0 = 273.16_wp        !: triple point of temperature    [K]
-   !
-   REAL(wp), PARAMETER, PUBLIC :: rcst_cs = -16._wp*9.80665_wp*rho0_w*rCp0_w*rnu0_w*rnu0_w*rnu0_w/(rk0_w*rk0_w) !: for cool-skin parameterizations... (grav = 9.80665_wp)
-   !                              => see eq.(14) in Fairall et al. 1996   (eq.(6) of Zeng aand Beljaars is WRONG! (typo?)
-
-
-   INTERFACE gamma_moist
-      MODULE PROCEDURE gamma_moist_vctr, gamma_moist_sclr
-   END INTERFACE gamma_moist
-
-   INTERFACE e_sat
-      MODULE PROCEDURE e_sat_vctr, e_sat_sclr
-   END INTERFACE e_sat
-
-   INTERFACE L_vap
-      MODULE PROCEDURE L_vap_vctr, L_vap_sclr
-   END INTERFACE L_vap
-
-   INTERFACE rho_air
-      MODULE PROCEDURE rho_air_vctr, rho_air_sclr
-   END INTERFACE rho_air
-
-   INTERFACE cp_air
-      MODULE PROCEDURE cp_air_vctr, cp_air_sclr
-   END INTERFACE cp_air
-
-   INTERFACE alpha_sw
-      MODULE PROCEDURE alpha_sw_vctr, alpha_sw_sclr
-   END INTERFACE alpha_sw
-
-   INTERFACE bulk_formula
-      MODULE PROCEDURE bulk_formula_vctr, bulk_formula_sclr
-   END INTERFACE bulk_formula
-
-
-
-   PUBLIC virt_temp
-   PUBLIC rho_air
-   PUBLIC visc_air
-   PUBLIC L_vap
-   PUBLIC cp_air
-   PUBLIC gamma_moist
-   PUBLIC One_on_L
-   PUBLIC Ri_bulk
-   PUBLIC q_sat
-   PUBLIC q_air_rh
-   !:
-   PUBLIC update_qnsol_tau
-   PUBLIC alpha_sw
-   PUBLIC bulk_formula
-
-   !! * Substitutions
-#  include "do_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: sbcblk.F90 10535 2019-01-16 17:36:47Z clem $
-   !! Software governed by the CeCILL license (see ./LICENSE)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   FUNCTION virt_temp( pta, pqa )
-      !!------------------------------------------------------------------------
-      !!
-      !! Compute the (absolute/potential) virtual temperature, knowing the
-      !! (absolute/potential) temperature and specific humidity
-      !!
-      !! If input temperature is absolute then output vitual temperature is absolute
-      !! If input temperature is potential then output vitual temperature is potential
-      !!
-      !! Author: L. Brodeau, June 2019 / AeroBulk
-      !!         (https://github.com/brodeau/aerobulk/)
-      !!------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             :: virt_temp         !: 1./(Monin Obukhov length) [m^-1]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta,  &  !: absolute or potetntial air temperature [K]
-         &                                        pqa      !: specific humidity of air   [kg/kg]
-      !!-------------------------------------------------------------------
-      !
-      virt_temp(:,:) = pta(:,:) * (1._wp + rctv0*pqa(:,:))
-      !!
-      !! This is exactly the same sing that:
-      !! virt_temp = pta * ( pwa + reps0) / (reps0*(1.+pwa))
-      !! with wpa (mixing ration) defined as : pwa = pqa/(1.-pqa)
-      !
-   END FUNCTION virt_temp
-
-   FUNCTION rho_air_vctr( ptak, pqa, pslp )
-      !!-------------------------------------------------------------------------------
-      !!                           ***  FUNCTION rho_air_vctr  ***
-      !!
-      !! ** Purpose : compute density of (moist) air using the eq. of state of the atmosphere
-      !!
-      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!-------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak      ! air temperature             [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa       ! air specific humidity   [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pslp      ! pressure in                [Pa]
-      REAL(wp), DIMENSION(jpi,jpj)             ::   rho_air_vctr   ! density of moist air   [kg/m^3]
-      !!-------------------------------------------------------------------------------
-      rho_air_vctr = MAX( pslp / (R_dry*ptak * ( 1._wp + rctv0*pqa )) , 0.8_wp )
-   END FUNCTION rho_air_vctr
-
-   FUNCTION rho_air_sclr( ptak, pqa, pslp )
-      !!-------------------------------------------------------------------------------
-      !!                           ***  FUNCTION rho_air_sclr  ***
-      !!
-      !! ** Purpose : compute density of (moist) air using the eq. of state of the atmosphere
-      !!
-      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!-------------------------------------------------------------------------------
-      REAL(wp), INTENT(in) :: ptak           ! air temperature             [K]
-      REAL(wp), INTENT(in) :: pqa            ! air specific humidity   [kg/kg]
-      REAL(wp), INTENT(in) :: pslp           ! pressure in                [Pa]
-      REAL(wp)             :: rho_air_sclr   ! density of moist air   [kg/m^3]
-      !!-------------------------------------------------------------------------------
-      rho_air_sclr = MAX( pslp / (R_dry*ptak * ( 1._wp + rctv0*pqa )) , 0.8_wp )
-   END FUNCTION rho_air_sclr
-
-
-
-   FUNCTION visc_air(ptak)
-      !!----------------------------------------------------------------------------------
-      !! Air kinetic viscosity (m^2/s) given from temperature in degrees...
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             ::   visc_air   !
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak       ! air temperature in (K)
-      !
-      INTEGER  ::   ji, jj      ! dummy loop indices
-      REAL(wp) ::   ztc, ztc2   ! local scalar
-      !!----------------------------------------------------------------------------------
-      !
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         ztc  = ptak(ji,jj) - rt0   ! air temp, in deg. C
-         ztc2 = ztc*ztc
-         visc_air(ji,jj) = 1.326e-5*(1. + 6.542E-3*ztc + 8.301e-6*ztc2 - 4.84e-9*ztc2*ztc)
-      END_2D
-      !
-   END FUNCTION visc_air
-
-   FUNCTION L_vap_vctr( psst )
-      !!---------------------------------------------------------------------------------
-      !!                           ***  FUNCTION L_vap_vctr  ***
-      !!
-      !! ** Purpose : Compute the latent heat of vaporization of water from temperature
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             ::   L_vap_vctr   ! latent heat of vaporization   [J/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   psst   ! water temperature                [K]
-      !!----------------------------------------------------------------------------------
-      !
-      L_vap_vctr = (  2.501_wp - 0.00237_wp * ( psst(:,:) - rt0)  ) * 1.e6_wp
-      !
-   END FUNCTION L_vap_vctr
-
-   FUNCTION L_vap_sclr( psst )
-      !!---------------------------------------------------------------------------------
-      !!                           ***  FUNCTION L_vap_sclr  ***
-      !!
-      !! ** Purpose : Compute the latent heat of vaporization of water from temperature
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp)             ::   L_vap_sclr   ! latent heat of vaporization   [J/kg]
-      REAL(wp), INTENT(in) ::   psst         ! water temperature                [K]
-      !!----------------------------------------------------------------------------------
-      !
-      L_vap_sclr = (  2.501_wp - 0.00237_wp * ( psst - rt0)  ) * 1.e6_wp
-      !
-   END FUNCTION L_vap_sclr
-
-
-   FUNCTION cp_air_vctr( pqa )
-      !!-------------------------------------------------------------------------------
-      !!                           ***  FUNCTION cp_air_vctr  ***
-      !!
-      !! ** Purpose : Compute specific heat (Cp) of moist air
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!-------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa      ! air specific humidity         [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj)             ::   cp_air_vctr   ! specific heat of moist air   [J/K/kg]
-      !!-------------------------------------------------------------------------------
-      cp_air_vctr = rCp_dry + rCp_vap * pqa
-   END FUNCTION cp_air_vctr
-
-   FUNCTION cp_air_sclr( pqa )
-      !!-------------------------------------------------------------------------------
-      !!                           ***  FUNCTION cp_air_sclr  ***
-      !!
-      !! ** Purpose : Compute specific heat (Cp) of moist air
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!-------------------------------------------------------------------------------
-      REAL(wp), INTENT(in) :: pqa           ! air specific humidity         [kg/kg]
-      REAL(wp)             :: cp_air_sclr   ! specific heat of moist air   [J/K/kg]
-      !!-------------------------------------------------------------------------------
-      cp_air_sclr = rCp_dry + rCp_vap * pqa
-   END FUNCTION cp_air_sclr
-
-
-
-
-
-   FUNCTION gamma_moist_vctr( ptak, pqa )
-      !!----------------------------------------------------------------------------------
-      !!                           ***  FUNCTION gamma_moist_vctr  ***
-      !!
-      !! ** Purpose : Compute the moist adiabatic lapse-rate.
-      !!     => http://glossary.ametsoc.org/wiki/Moist-adiabatic_lapse_rate
-      !!     => http://www.geog.ucsb.edu/~joel/g266_s10/lecture_notes/chapt03/oh10_3_01/oh10_3_01.html
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak          ! air temperature       [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa           ! specific humidity [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj)             ::   gamma_moist_vctr   ! moist adiabatic lapse-rate
-      !
-      INTEGER  ::   ji, jj         ! dummy loop indices
-      !!----------------------------------------------------------------------------------
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         gamma_moist_vctr(ji,jj) = gamma_moist_sclr( ptak(ji,jj), pqa(ji,jj) )
-      END_2D
-   END FUNCTION gamma_moist_vctr
-
-   FUNCTION gamma_moist_sclr( ptak, pqa )
-      !!----------------------------------------------------------------------------------
-      !! ** Purpose : Compute the moist adiabatic lapse-rate.
-      !!     => http://glossary.ametsoc.org/wiki/Moist-adiabatic_lapse_rate
-      !!     => http://www.geog.ucsb.edu/~joel/g266_s10/lecture_notes/chapt03/oh10_3_01/oh10_3_01.html
-      !!
-      !! ** Author: L. Brodeau, June 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp)             :: gamma_moist_sclr
-      REAL(wp), INTENT(in) :: ptak, pqa ! air temperature (K) and specific humidity (kg/kg)
-      !
-      REAL(wp) :: zta, zqa, zwa, ziRT        ! local scalar
-      !!----------------------------------------------------------------------------------
-      zta = MAX( ptak,  180._wp) ! prevents screw-up over masked regions where field == 0.
-      zqa = MAX( pqa,  1.E-6_wp) !    "                   "                     "
-      !!
-      zwa = zqa / (1._wp - zqa)   ! w is mixing ratio w = q/(1-q) | q = w/(1+w)
-      ziRT = 1._wp / (R_dry*zta)    ! 1/RT
-      gamma_moist_sclr = grav * ( 1._wp + rLevap*zwa*ziRT ) / ( rCp_dry + rLevap*rLevap*zwa*reps0*ziRT/zta )
-      !!
-   END FUNCTION gamma_moist_sclr
-
-   FUNCTION One_on_L( ptha, pqa, pus, pts, pqs )
-      !!------------------------------------------------------------------------
-      !!
-      !! Evaluates the 1./(Monin Obukhov length) from air temperature and
-      !!  specific humidity, and frictional scales u*, t* and q*
-      !!
-      !! Author: L. Brodeau, June 2016 / AeroBulk
-      !!         (https://github.com/brodeau/aerobulk/)
-      !!------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             :: One_on_L         !: 1./(Monin Obukhov length) [m^-1]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha,  &  !: average potetntial air temperature [K]
-         &                                        pqa,   &  !: average specific humidity of air   [kg/kg]
-         &                                      pus, pts, pqs   !: frictional velocity, temperature and humidity
-      !
-      INTEGER  ::   ji, jj         ! dummy loop indices
-      REAL(wp) ::     zqa          ! local scalar
-      !!-------------------------------------------------------------------
-      !
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         !
-         zqa = (1._wp + rctv0*pqa(ji,jj))
-         !
-         ! The main concern is to know whether, the vertical turbulent flux of virtual temperature, < u' theta_v' > is estimated with:
-         !  a/  -u* [ theta* (1 + 0.61 q) + 0.61 theta q* ] => this is the one that seems correct! chose this one!
-         !                      or
-         !  b/  -u* [ theta*              + 0.61 theta q* ]
-         !
-         One_on_L(ji,jj) = grav*vkarmn*( pts(ji,jj)*zqa + rctv0*ptha(ji,jj)*pqs(ji,jj) ) &
-            &               / MAX( pus(ji,jj)*pus(ji,jj)*ptha(ji,jj)*zqa , 1.E-9_wp )
-         !
-      END_2D
-      !
-      One_on_L = SIGN( MIN(ABS(One_on_L),200._wp), One_on_L ) ! (prevent FPE from stupid values over masked regions...)
-      !
-   END FUNCTION One_on_L
-
-   FUNCTION Ri_bulk( pz, psst, ptha, pssq, pqa, pub )
-      !!----------------------------------------------------------------------------------
-      !! Bulk Richardson number according to "wide-spread equation"...
-      !!
-      !! ** Author: L. Brodeau, June 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             :: Ri_bulk
-      REAL(wp)                    , INTENT(in) :: pz    ! height above the sea (aka "delta z")  [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: psst  ! SST                                   [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha  ! pot. air temp. at height "pz"         [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pssq  ! 0.98*q_sat(SST)                   [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pqa   ! air spec. hum. at height "pz"     [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pub   ! bulk wind speed                     [m/s]
-      !
-      INTEGER  ::   ji, jj                                ! dummy loop indices
-      REAL(wp) ::   zqa, zta, zgamma, zdth_v, ztv, zsstv  ! local scalars
-      !!-------------------------------------------------------------------
-      !
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         !
-         zqa = 0.5_wp*(pqa(ji,jj)+pssq(ji,jj))                                        ! ~ mean q within the layer...
-         zta = 0.5_wp*( psst(ji,jj) + ptha(ji,jj) - gamma_moist(ptha(ji,jj),zqa)*pz ) ! ~ mean absolute temperature of air within the layer
-         zta = 0.5_wp*( psst(ji,jj) + ptha(ji,jj) - gamma_moist(zta,        zqa)*pz ) ! ~ mean absolute temperature of air within the layer
-         zgamma =  gamma_moist(zta, zqa)                                              ! Adiabatic lapse-rate for moist air within the layer
-         !
-         zsstv = psst(ji,jj)*(1._wp + rctv0*pssq(ji,jj)) ! absolute==potential virtual SST (absolute==potential because z=0!)
-         !
-         zdth_v = ptha(ji,jj)*(1._wp + rctv0*pqa(ji,jj)) - zsstv ! air-sea delta of "virtual potential temperature"
-         !
-         ztv = 0.5_wp*( zsstv + (ptha(ji,jj) - zgamma*pz)*(1._wp + rctv0*pqa(ji,jj)) )  ! ~ mean absolute virtual temp. within the layer
-         !
-         Ri_bulk(ji,jj) = grav*zdth_v*pz / ( ztv*pub(ji,jj)*pub(ji,jj) )                            ! the usual definition of Ri_bulk
-         !
-      END_2D
-   END FUNCTION Ri_bulk
-
-
-   FUNCTION e_sat_vctr(ptak)
-      !!**************************************************
-      !! ptak:     air temperature [K]
-      !! e_sat:  water vapor at saturation [Pa]
-      !!
-      !! Recommended by WMO
-      !!
-      !! Goff, J. A., 1957: Saturation pressure of water on the new kelvin
-      !! temperature scale. Transactions of the American society of heating
-      !! and ventilating engineers, 347–354.
-      !!
-      !! rt0 should be 273.16 (triple point of water) and not 273.15 like here
-      !!**************************************************
-
-      REAL(wp), DIMENSION(jpi,jpj)             :: e_sat_vctr !: vapour pressure at saturation  [Pa]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak    !: temperature (K)
-
-      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztmp
-
-      ALLOCATE ( ztmp(jpi,jpj) )
-
-      ztmp(:,:) = rtt0/ptak(:,:)
-
-      e_sat_vctr = 100.*( 10.**(10.79574*(1. - ztmp) - 5.028*LOG10(ptak/rtt0)         &
-         &       + 1.50475*10.**(-4)*(1. - 10.**(-8.2969*(ptak/rtt0 - 1.)) )   &
-         &       + 0.42873*10.**(-3)*(10.**(4.76955*(1. - ztmp)) - 1.) + 0.78614) )
-
-      DEALLOCATE ( ztmp )
-
-   END FUNCTION e_sat_vctr
-
-
-   FUNCTION e_sat_sclr( ptak )
-      !!----------------------------------------------------------------------------------
-      !!                   ***  FUNCTION e_sat_sclr  ***
-      !!                  < SCALAR argument version >
-      !! ** Purpose : water vapor at saturation in [Pa]
-      !!              Based on accurate estimate by Goff, 1957
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!
-      !!    Note: what rt0 should be here, is 273.16 (triple point of water) and not 273.15 like here
-      !!----------------------------------------------------------------------------------
-      REAL(wp), INTENT(in) ::   ptak    ! air temperature                  [K]
-      REAL(wp)             ::   e_sat_sclr   ! water vapor at saturation   [kg/kg]
-      !
-      REAL(wp) ::   zta, ztmp   ! local scalar
-      !!----------------------------------------------------------------------------------
-      !
-      zta = MAX( ptak , 180._wp )   ! air temp., prevents fpe0 errors dute to unrealistically low values over masked regions...
-      ztmp = rt0 / zta
-      !
-      ! Vapour pressure at saturation [Pa] : WMO, (Goff, 1957)
-      e_sat_sclr = 100.*( 10.**( 10.79574*(1. - ztmp) - 5.028*LOG10(zta/rt0)        &
-         &    + 1.50475*10.**(-4)*(1. - 10.**(-8.2969*(zta/rt0 - 1.)) )  &
-         &    + 0.42873*10.**(-3)*(10.**(4.76955*(1. - ztmp)) - 1.) + 0.78614) )
-      !
-   END FUNCTION e_sat_sclr
-
-
-   FUNCTION q_sat( ptak, pslp )
-      !!----------------------------------------------------------------------------------
-      !!                           ***  FUNCTION q_sat  ***
-      !!
-      !! ** Purpose : Specific humidity at saturation in [kg/kg]
-      !!              Based on accurate estimate of "e_sat"
-      !!              aka saturation water vapor (Goff, 1957)
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak    ! air temperature                       [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pslp    ! sea level atmospheric pressure       [Pa]
-      REAL(wp), DIMENSION(jpi,jpj)             ::   q_sat   ! Specific humidity at saturation   [kg/kg]
-      !
-      INTEGER  ::   ji, jj         ! dummy loop indices
-      REAL(wp) ::   ze_sat   ! local scalar
-      !!----------------------------------------------------------------------------------
-      !
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         !
-         ze_sat =  e_sat_sclr( ptak(ji,jj) )
-         !
-         q_sat(ji,jj) = reps0 * ze_sat/( pslp(ji,jj) - (1._wp - reps0)*ze_sat )
-         !
-      END_2D
-      !
-   END FUNCTION q_sat
-
-   FUNCTION q_air_rh(prha, ptak, pslp)
-      !!----------------------------------------------------------------------------------
-      !! Specific humidity of air out of Relative Humidity
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             :: q_air_rh
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: prha        !: relative humidity      [fraction, not %!!!]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak        !: air temperature        [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pslp        !: atmospheric pressure   [Pa]
-      !
-      INTEGER  ::   ji, jj      ! dummy loop indices
-      REAL(wp) ::   ze      ! local scalar
-      !!----------------------------------------------------------------------------------
-      !
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         ze = prha(ji,jj)*e_sat_sclr(ptak(ji,jj))
-         q_air_rh(ji,jj) = ze*reps0/(pslp(ji,jj) - (1. - reps0)*ze)
-      END_2D
-      !
-   END FUNCTION q_air_rh
-
-
-   SUBROUTINE UPDATE_QNSOL_TAU( pzu, pTs, pqs, pTa, pqa, pust, ptst, pqst, pwnd, pUb, pslp, prlw, &
-      &                         pQns, pTau,  &
-      &                         Qlat)
-      !!----------------------------------------------------------------------------------
-      !! Purpose: returns the non-solar heat flux to the ocean aka "Qlat + Qsen + Qlw"
-      !!          and the module of the wind stress => pTau = Tau
-      !! ** Author: L. Brodeau, Sept. 2019 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pust ! u*
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: ptst ! t*
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqst ! q*
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pslp ! sea-level atmospheric pressure [Pa]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: prlw ! downwelling longwave radiative flux [W/m^2]
-      !
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQns ! non-solar heat flux to the ocean aka "Qlat + Qsen + Qlw" [W/m^2]]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pTau ! module of the wind stress [N/m^2]
-      !
-      REAL(wp), DIMENSION(jpi,jpj), OPTIONAL, INTENT(out) :: Qlat
-      !
-      REAL(wp) :: zdt, zdq, zCd, zCh, zCe, zTs2, zz0, &
-         &        zQlat, zQsen, zQlw
-      INTEGER  ::   ji, jj     ! dummy loop indices
-      !!----------------------------------------------------------------------------------
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-
-         zdt = pTa(ji,jj) - pTs(ji,jj) ;  zdt = SIGN( MAX(ABS(zdt),1.E-6_wp), zdt )
-         zdq = pqa(ji,jj) - pqs(ji,jj) ;  zdq = SIGN( MAX(ABS(zdq),1.E-9_wp), zdq )
-         zz0 = pust(ji,jj)/pUb(ji,jj)
-         zCd = zz0*zz0
-         zCh = zz0*ptst(ji,jj)/zdt
-         zCe = zz0*pqst(ji,jj)/zdq
-
-         CALL BULK_FORMULA_SCLR( pzu, pTs(ji,jj), pqs(ji,jj), pTa(ji,jj), pqa(ji,jj), &
-            &                    zCd, zCh, zCe,                                       &
-            &                    pwnd(ji,jj), pUb(ji,jj), pslp(ji,jj),                &
-            &                    pTau(ji,jj), zQsen, zQlat )
-         
-         zTs2  = pTs(ji,jj)*pTs(ji,jj)
-         zQlw  = emiss_w*(prlw(ji,jj) - stefan*zTs2*zTs2) ! Net longwave flux
-
-         pQns(ji,jj) = zQlat + zQsen + zQlw
-
-         IF( PRESENT(Qlat) ) Qlat(ji,jj) = zQlat
-      END_2D
-   END SUBROUTINE UPDATE_QNSOL_TAU
-
-
-   SUBROUTINE BULK_FORMULA_SCLR( pzu, pTs, pqs, pTa, pqa, &
-      &                          pCd, pCh, pCe,           &
-      &                          pwnd, pUb, pslp,         &
-      &                          pTau, pQsen, pQlat,      &
-      &                          pEvap, prhoa, pfact_evap )
-      !!----------------------------------------------------------------------------------
-      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
-      REAL(wp), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
-      REAL(wp), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
-      REAL(wp), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
-      REAL(wp), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
-      REAL(wp), INTENT(in)  :: pCd
-      REAL(wp), INTENT(in)  :: pCh
-      REAL(wp), INTENT(in)  :: pCe
-      REAL(wp), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
-      REAL(wp), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
-      REAL(wp), INTENT(in)  :: pslp ! sea-level atmospheric pressure [Pa]
-      !!
-      REAL(wp), INTENT(out) :: pTau  ! module of the wind stress [N/m^2]
-      REAL(wp), INTENT(out) :: pQsen !  [W/m^2]
-      REAL(wp), INTENT(out) :: pQlat !  [W/m^2]
-      !!
-      REAL(wp), INTENT(out), OPTIONAL :: pEvap ! Evaporation [kg/m^2/s]
-      REAL(wp), INTENT(out), OPTIONAL :: prhoa ! Air density at z=pzu [kg/m^3]
-      REAL(wp), INTENT(in) , OPTIONAL :: pfact_evap  ! ABOMINATION: corrective factor for evaporation (doing this against my will! /laurent)
-      !!
-      REAL(wp) :: ztaa, zgamma, zrho, zUrho, zevap, zfact_evap
-      INTEGER  :: jq
-      !!----------------------------------------------------------------------------------
-      zfact_evap = 1._wp
-      IF( PRESENT(pfact_evap) ) zfact_evap = pfact_evap
-      
-      !! Need ztaa, absolute temperature at pzu (formula to estimate rho_air needs absolute temperature, not the potential temperature "pTa")
-      ztaa = pTa ! first guess...
-      DO jq = 1, 4
-         zgamma = gamma_moist( 0.5*(ztaa+pTs) , pqa )  !LOLO: why not "0.5*(pqs+pqa)" rather then "pqa" ???
-         ztaa = pTa - zgamma*pzu   ! Absolute temp. is slightly colder...
-      END DO
-      zrho = rho_air(ztaa, pqa, pslp)
-      zrho = rho_air(ztaa, pqa, pslp-zrho*grav*pzu) ! taking into account that we are pzu m above the sea level where SLP is given!
-
-      zUrho = pUb*MAX(zrho, 1._wp)     ! rho*U10
-
-      pTau = zUrho * pCd * pwnd ! Wind stress module
-
-      zevap = zUrho * pCe * (pqa - pqs)
-      pQsen = zUrho * pCh * (pTa - pTs) * cp_air(pqa)
-      pQlat = L_vap(pTs) * zevap
-
-      IF( PRESENT(pEvap) ) pEvap = - zfact_evap * zevap
-      IF( PRESENT(prhoa) ) prhoa = zrho
-
-   END SUBROUTINE BULK_FORMULA_SCLR
-
-   SUBROUTINE BULK_FORMULA_VCTR( pzu, pTs, pqs, pTa, pqa, &
-      &                          pCd, pCh, pCe,           &
-      &                          pwnd, pUb, pslp,         &
-      &                          pTau, pQsen, pQlat,      & 
-      &                          pEvap, prhoa, pfact_evap )      
-      !!----------------------------------------------------------------------------------
-      REAL(wp),                     INTENT(in)  :: pzu  ! height above the sea-level where all this takes place (normally 10m)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTs  ! water temperature at the air-sea interface [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqs  ! satur. spec. hum. at T=pTs   [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pTa  ! potential air temperature at z=pzu [K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pqa  ! specific humidity at z=pzu [kg/kg]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCd
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCh
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pCe
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pwnd ! wind speed module at z=pzu [m/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pUb  ! bulk wind speed at z=pzu (inc. pot. effect of gustiness etc) [m/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pslp ! sea-level atmospheric pressure [Pa]
-      !!
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pTau  ! module of the wind stress [N/m^2]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQsen !  [W/m^2]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: pQlat !  [W/m^2]
-      !!
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out), OPTIONAL :: pEvap ! Evaporation [kg/m^2/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out), OPTIONAL :: prhoa ! Air density at z=pzu [kg/m^3]
-      REAL(wp),                     INTENT(in) , OPTIONAL :: pfact_evap  ! ABOMINATION: corrective factor for evaporation (doing this against my will! /laurent)
-      !!
-      REAL(wp) :: ztaa, zgamma, zrho, zUrho, zevap, zfact_evap
-      INTEGER  :: ji, jj
-      !!----------------------------------------------------------------------------------
-      zfact_evap = 1._wp
-      IF( PRESENT(pfact_evap) ) zfact_evap = pfact_evap
-
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-
-         CALL BULK_FORMULA_SCLR( pzu, pTs(ji,jj), pqs(ji,jj), pTa(ji,jj), pqa(ji,jj), &
-            &                    pCd(ji,jj), pCh(ji,jj), pCe(ji,jj),                  &
-            &                    pwnd(ji,jj), pUb(ji,jj), pslp(ji,jj),                &
-            &                    pTau(ji,jj), pQsen(ji,jj), pQlat(ji,jj),             &
-            &                    pEvap=zevap, prhoa=zrho, pfact_evap=zfact_evap       )
-
-         IF( PRESENT(pEvap) ) pEvap(ji,jj) = zevap
-         IF( PRESENT(prhoa) ) prhoa(ji,jj) = zrho
-   
-      END_2D
-   END SUBROUTINE BULK_FORMULA_VCTR
-
-
-   FUNCTION alpha_sw_vctr( psst )
-      !!---------------------------------------------------------------------------------
-      !!                           ***  FUNCTION alpha_sw_vctr  ***
-      !!
-      !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (i.e. P =~ 101000 Pa)
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             ::   alpha_sw_vctr   ! thermal expansion coefficient of sea-water [1/K]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   psst   ! water temperature                [K]
-      !!----------------------------------------------------------------------------------
-      alpha_sw_vctr = 2.1e-5_wp * MAX(psst(:,:)-rt0 + 3.2_wp, 0._wp)**0.79
-   END FUNCTION alpha_sw_vctr
-
-   FUNCTION alpha_sw_sclr( psst )
-      !!---------------------------------------------------------------------------------
-      !!                           ***  FUNCTION alpha_sw_sclr  ***
-      !!
-      !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (i.e. P =~ 101000 Pa)
-      !!
-      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/)
-      !!----------------------------------------------------------------------------------
-      REAL(wp)             ::   alpha_sw_sclr   ! thermal expansion coefficient of sea-water [1/K]
-      REAL(wp), INTENT(in) ::   psst   ! sea-water temperature                   [K]
-      !!----------------------------------------------------------------------------------
-      alpha_sw_sclr = 2.1e-5_wp * MAX(psst-rt0 + 3.2_wp, 0._wp)**0.79
-   END FUNCTION alpha_sw_sclr
-
-
-
-   !!======================================================================
-END MODULE sbcblk_phy
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_skin_coare.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_skin_coare.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_skin_coare.F90	(revision 14072)
@@ -13,5 +13,5 @@
    !! ** Author: L. Brodeau, November 2019 / AeroBulk (https://github.com/brodeau/aerobulk)
    !!----------------------------------------------------------------------
-   !! History :  4.x  !  2019-11  (L.Brodeau)   Original code
+   !! History :  4.0  !  2019-11  (L.Brodeau)   Original code
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
@@ -20,5 +20,5 @@
    USE sbc_oce         ! Surface boundary condition: ocean fields
 
-   USE sbcblk_phy      ! misc. functions for marine ABL physics (rho_air, q_sat, bulk_formula, etc)
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
 
    USE sbcdcy          !#LB: to know hour of dawn and dusk: rdawn_dcy and rdusk_dcy (needed in WL_COARE)
Index: /NEMO/trunk/src/OCE/SBC/sbcblk_skin_ecmwf.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcblk_skin_ecmwf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcblk_skin_ecmwf.F90	(revision 14072)
@@ -28,5 +28,6 @@
    !! ** Author: L. Brodeau, November 2019 / AeroBulk (https://github.com/brodeau/aerobulk)
    !!----------------------------------------------------------------------
-   !! History :  4.x  !  2019-11  (L.Brodeau)   Original code
+   !! History :  4.0  ! 2019-11  (L.Brodeau)   Original code
+   !!            4.2  ! 2020-12  (L. Brodeau) Introduction of various air-ice bulk parameterizations + improvements
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
@@ -35,5 +36,5 @@
    USE sbc_oce         ! Surface boundary condition: ocean fields
 
-   USE sbcblk_phy      ! misc. functions for marine ABL physics (rho_air, q_sat, bulk_formula, etc)
+   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer
 
    USE lib_mpp         ! distribued memory computing library
@@ -160,8 +161,8 @@
       REAL(wp) :: zalfa     !: thermal expansion coefficient of sea-water [1/K]
       REAL(wp) :: zdTwl_b, zdTwl_n  !: temp. diff. between "almost surface (right below viscous layer) and bottom of WL
-      REAL(wp) :: zfr, zeta 
-      REAL(wp) :: zusw, zusw2 
-      REAL(wp) :: zLa, zfLa 
-      REAL(wp) :: flg, zwf, zQabs 
+      REAL(wp) :: zfr, zeta
+      REAL(wp) :: zusw, zusw2
+      REAL(wp) :: zLa, zfLa
+      REAL(wp) :: flg, zwf, zQabs
       REAL(wp) :: ZA, ZB, zL1, zL2
       REAL(wp) :: zcst0, zcst1, zcst2, zcst3
Index: /NEMO/trunk/src/OCE/SBC/sbccpl.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbccpl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbccpl.F90	(revision 14072)
@@ -33,8 +33,8 @@
 #endif
    USE cpl_oasis3     ! OASIS3 coupling
-   USE geo2ocean      ! 
+   USE geo2ocean      !
    USE oce     , ONLY : ts, uu, vv, ssh, fraqsr_1lev
-   USE ocealb         ! 
-   USE eosbn2         ! 
+   USE ocealb         !
+   USE eosbn2         !
    USE sbcrnf  , ONLY : l_rnfcpl
 #if defined key_cice
@@ -50,7 +50,9 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
 
-#if defined key_oasis3 
-   USE mod_oasis, ONLY : OASIS_Sent, OASIS_ToRest, OASIS_SentOut, OASIS_ToRestOut 
-#endif 
+#if defined key_oasis3
+   USE mod_oasis, ONLY : OASIS_Sent, OASIS_ToRest, OASIS_SentOut, OASIS_ToRestOut
+#endif
+
+   USE sbc_phy, ONLY : pp_cldf
 
    IMPLICIT NONE
@@ -65,18 +67,18 @@
 
    INTEGER, PARAMETER ::   jpr_otx1   =  1   ! 3 atmosphere-ocean stress components on grid 1
-   INTEGER, PARAMETER ::   jpr_oty1   =  2   ! 
-   INTEGER, PARAMETER ::   jpr_otz1   =  3   ! 
+   INTEGER, PARAMETER ::   jpr_oty1   =  2   !
+   INTEGER, PARAMETER ::   jpr_otz1   =  3   !
    INTEGER, PARAMETER ::   jpr_otx2   =  4   ! 3 atmosphere-ocean stress components on grid 2
-   INTEGER, PARAMETER ::   jpr_oty2   =  5   ! 
-   INTEGER, PARAMETER ::   jpr_otz2   =  6   ! 
+   INTEGER, PARAMETER ::   jpr_oty2   =  5   !
+   INTEGER, PARAMETER ::   jpr_otz2   =  6   !
    INTEGER, PARAMETER ::   jpr_itx1   =  7   ! 3 atmosphere-ice   stress components on grid 1
-   INTEGER, PARAMETER ::   jpr_ity1   =  8   ! 
-   INTEGER, PARAMETER ::   jpr_itz1   =  9   ! 
+   INTEGER, PARAMETER ::   jpr_ity1   =  8   !
+   INTEGER, PARAMETER ::   jpr_itz1   =  9   !
    INTEGER, PARAMETER ::   jpr_itx2   = 10   ! 3 atmosphere-ice   stress components on grid 2
-   INTEGER, PARAMETER ::   jpr_ity2   = 11   ! 
-   INTEGER, PARAMETER ::   jpr_itz2   = 12   ! 
+   INTEGER, PARAMETER ::   jpr_ity2   = 11   !
+   INTEGER, PARAMETER ::   jpr_itz2   = 12   !
    INTEGER, PARAMETER ::   jpr_qsroce = 13   ! Qsr above the ocean
    INTEGER, PARAMETER ::   jpr_qsrice = 14   ! Qsr above the ice
-   INTEGER, PARAMETER ::   jpr_qsrmix = 15 
+   INTEGER, PARAMETER ::   jpr_qsrmix = 15
    INTEGER, PARAMETER ::   jpr_qnsoce = 16   ! Qns above the ocean
    INTEGER, PARAMETER ::   jpr_qnsice = 17   ! Qns above the ice
@@ -103,8 +105,8 @@
    INTEGER, PARAMETER ::   jpr_ocy1   = 38   !
    INTEGER, PARAMETER ::   jpr_ssh    = 39   ! sea surface height
-   INTEGER, PARAMETER ::   jpr_fice   = 40   ! ice fraction          
-   INTEGER, PARAMETER ::   jpr_e3t1st = 41   ! first T level thickness 
+   INTEGER, PARAMETER ::   jpr_fice   = 40   ! ice fraction
+   INTEGER, PARAMETER ::   jpr_e3t1st = 41   ! first T level thickness
    INTEGER, PARAMETER ::   jpr_fraqsr = 42   ! fraction of solar net radiation absorbed in the first ocean level
-   INTEGER, PARAMETER ::   jpr_mslp   = 43   ! mean sea level pressure 
+   INTEGER, PARAMETER ::   jpr_mslp   = 43   ! mean sea level pressure
    !**  surface wave coupling  **
    INTEGER, PARAMETER ::   jpr_hsig   = 44   ! Hsig
@@ -128,5 +130,5 @@
    INTEGER, PARAMETER ::   jpr_ts_ice = 62   ! Sea ice surface temp
 
-   INTEGER, PARAMETER ::   jprcv      = 62   ! total number of fields received  
+   INTEGER, PARAMETER ::   jprcv      = 62   ! total number of fields received
 
    INTEGER, PARAMETER ::   jps_fice   =  1   ! ice fraction sent to the atmosphere
@@ -152,5 +154,5 @@
    INTEGER, PARAMETER ::   jps_sflx   = 21   ! salt flux
    INTEGER, PARAMETER ::   jps_otx1   = 22   ! 2 atmosphere-ocean stress components on grid 1
-   INTEGER, PARAMETER ::   jps_oty1   = 23   ! 
+   INTEGER, PARAMETER ::   jps_oty1   = 23   !
    INTEGER, PARAMETER ::   jps_rnf    = 24   ! runoffs
    INTEGER, PARAMETER ::   jps_taum   = 25   ! wind stress module
@@ -158,8 +160,8 @@
    INTEGER, PARAMETER ::   jps_e3t1st = 27   ! first level depth (vvl)
    INTEGER, PARAMETER ::   jps_fraqsr = 28   ! fraction of solar net radiation absorbed in the first ocean level
-   INTEGER, PARAMETER ::   jps_ficet  = 29   ! total ice fraction  
-   INTEGER, PARAMETER ::   jps_ocxw   = 30   ! currents on grid 1  
+   INTEGER, PARAMETER ::   jps_ficet  = 29   ! total ice fraction
+   INTEGER, PARAMETER ::   jps_ocxw   = 30   ! currents on grid 1
    INTEGER, PARAMETER ::   jps_ocyw   = 31   ! currents on grid 2
-   INTEGER, PARAMETER ::   jps_wlev   = 32   ! water level 
+   INTEGER, PARAMETER ::   jps_wlev   = 32   ! water level
    INTEGER, PARAMETER ::   jps_fice1  = 33   ! first-order ice concentration (for semi-implicit coupling of atmos-ice fluxes)
    INTEGER, PARAMETER ::   jps_a_p    = 34   ! meltpond area fraction
@@ -169,16 +171,16 @@
    INTEGER, PARAMETER ::   jps_ttilyr = 38   ! sea ice top layer temp
 
-   INTEGER, PARAMETER ::   jpsnd      = 38   ! total number of fields sent 
-
-#if ! defined key_oasis3 
-   ! Dummy variables to enable compilation when oasis3 is not being used 
-   INTEGER                    ::   OASIS_Sent        = -1 
-   INTEGER                    ::   OASIS_SentOut     = -1 
-   INTEGER                    ::   OASIS_ToRest      = -1 
-   INTEGER                    ::   OASIS_ToRestOut   = -1 
-#endif 
+   INTEGER, PARAMETER ::   jpsnd      = 38   ! total number of fields sent
+
+#if ! defined key_oasis3
+   ! Dummy variables to enable compilation when oasis3 is not being used
+   INTEGER                    ::   OASIS_Sent        = -1
+   INTEGER                    ::   OASIS_SentOut     = -1
+   INTEGER                    ::   OASIS_ToRest      = -1
+   INTEGER                    ::   OASIS_ToRestOut   = -1
+#endif
 
    !                                  !!** namelist namsbc_cpl **
-   TYPE ::   FLD_C                     !   
+   TYPE ::   FLD_C                     !
       CHARACTER(len = 32) ::   cldes      ! desciption of the coupling strategy
       CHARACTER(len = 32) ::   clcat      ! multiple ice categories strategy
@@ -187,5 +189,5 @@
       CHARACTER(len = 32) ::   clvgrd     ! grids on which is located the vector fields
    END TYPE FLD_C
-   !                                   ! Send to the atmosphere  
+   !                                   ! Send to the atmosphere
    TYPE(FLD_C) ::   sn_snd_temp  , sn_snd_alb , sn_snd_thick, sn_snd_crt   , sn_snd_co2,  &
       &             sn_snd_thick1, sn_snd_cond, sn_snd_mpnd , sn_snd_sstfrz, sn_snd_ttilyr
@@ -194,7 +196,7 @@
       &             sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf, sn_rcv_ts_ice
    TYPE(FLD_C) ::   sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2, sn_rcv_mslp, sn_rcv_icb, sn_rcv_isf
-   !                                   ! Send to waves 
-   TYPE(FLD_C) ::   sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev 
-   !                                   ! Received from waves 
+   !                                   ! Send to waves
+   TYPE(FLD_C) ::   sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev
+   !                                   ! Received from waves
    TYPE(FLD_C) ::   sn_rcv_hsig, sn_rcv_phioc, sn_rcv_sdrfx, sn_rcv_sdrfy, sn_rcv_wper, sn_rcv_wnum, &
       &             sn_rcv_wstrf, sn_rcv_wdrag, sn_rcv_charn, sn_rcv_taw, sn_rcv_bhd, sn_rcv_tusd, sn_rcv_tvsd
@@ -203,8 +205,8 @@
    LOGICAL     ::   ln_usecplmask         !  use a coupling mask file to merge data received from several models
                                           !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel)
-   LOGICAL     ::   ln_scale_ice_flux     !  use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration) 
-
-   TYPE ::   DYNARR     
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3   
+   LOGICAL     ::   ln_scale_ice_flux     !  use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration)
+
+   TYPE ::   DYNARR
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3
    END TYPE DYNARR
 
@@ -216,6 +218,6 @@
 #endif
 
-   REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure[N/m2] 
-   REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rho0) 
+   REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure[N/m2]
+   REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rho0)
 
    INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   nrcvinfo           ! OASIS info argument
@@ -230,5 +232,5 @@
    !!----------------------------------------------------------------------
 CONTAINS
-  
+
    INTEGER FUNCTION sbc_cpl_alloc()
       !!----------------------------------------------------------------------
@@ -240,5 +242,5 @@
       !
       ALLOCATE( alb_oce_mix(jpi,jpj), nrcvinfo(jprcv),  STAT=ierr(1) )
-      
+
 #if ! defined key_si3 && ! defined key_cice
       ALLOCATE( a_i(jpi,jpj,1) , STAT=ierr(2) )  ! used in sbcice_if.F90 (done here as there is no sbc_ice_if_init)
@@ -258,5 +260,5 @@
 
 
-   SUBROUTINE sbc_cpl_init( k_ice )     
+   SUBROUTINE sbc_cpl_init( k_ice )
       !!----------------------------------------------------------------------
       !!             ***  ROUTINE sbc_cpl_init  ***
@@ -265,5 +267,5 @@
       !!                the atmospheric component
       !!
-      !! ** Method  : * Read namsbc_cpl namelist 
+      !! ** Method  : * Read namsbc_cpl namelist
       !!              * define the receive interface
       !!              * define the send    interface
@@ -277,12 +279,12 @@
       !!
       NAMELIST/namsbc_cpl/  nn_cplmodel  , ln_usecplmask, nn_cats_cpl , ln_scale_ice_flux,             &
-         &                  sn_snd_temp  , sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2   ,  & 
-         &                  sn_snd_ttilyr, sn_snd_cond  , sn_snd_mpnd , sn_snd_sstfrz, sn_snd_thick1,  & 
-         &                  sn_snd_ifrac , sn_snd_crtw  , sn_snd_wlev , sn_rcv_hsig  , sn_rcv_phioc ,  & 
-         &                  sn_rcv_w10m  , sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr   ,  & 
+         &                  sn_snd_temp  , sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2   ,  &
+         &                  sn_snd_ttilyr, sn_snd_cond  , sn_snd_mpnd , sn_snd_sstfrz, sn_snd_thick1,  &
+         &                  sn_snd_ifrac , sn_snd_crtw  , sn_snd_wlev , sn_rcv_hsig  , sn_rcv_phioc ,  &
+         &                  sn_rcv_w10m  , sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr   ,  &
          &                  sn_rcv_sdrfx , sn_rcv_sdrfy , sn_rcv_wper , sn_rcv_wnum  , sn_rcv_wstrf ,  &
          &                  sn_rcv_charn , sn_rcv_taw   , sn_rcv_bhd  , sn_rcv_tusd  , sn_rcv_tvsd,    &
          &                  sn_rcv_wdrag , sn_rcv_qns   , sn_rcv_emp  , sn_rcv_rnf   , sn_rcv_cal  ,   &
-         &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_icb  , sn_rcv_isf   , sn_rcv_ts_ice 
+         &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_icb  , sn_rcv_isf   , sn_rcv_ts_ice
 
       !!---------------------------------------------------------------------
@@ -328,12 +330,12 @@
          WRITE(numout,*)'      Sea ice surface skin temperature= ', TRIM(sn_rcv_ts_ice%cldes), ' (', TRIM(sn_rcv_ts_ice%clcat), ')'
          WRITE(numout,*)'      surface waves:'
-         WRITE(numout,*)'      significant wave heigth         = ', TRIM(sn_rcv_hsig%cldes  ), ' (', TRIM(sn_rcv_hsig%clcat  ), ')' 
-         WRITE(numout,*)'      wave to oce energy flux         = ', TRIM(sn_rcv_phioc%cldes ), ' (', TRIM(sn_rcv_phioc%clcat ), ')' 
-         WRITE(numout,*)'      Surface Stokes drift grid u     = ', TRIM(sn_rcv_sdrfx%cldes ), ' (', TRIM(sn_rcv_sdrfx%clcat ), ')' 
-         WRITE(numout,*)'      Surface Stokes drift grid v     = ', TRIM(sn_rcv_sdrfy%cldes ), ' (', TRIM(sn_rcv_sdrfy%clcat ), ')' 
-         WRITE(numout,*)'      Mean wave period                = ', TRIM(sn_rcv_wper%cldes  ), ' (', TRIM(sn_rcv_wper%clcat  ), ')' 
-         WRITE(numout,*)'      Mean wave number                = ', TRIM(sn_rcv_wnum%cldes  ), ' (', TRIM(sn_rcv_wnum%clcat  ), ')' 
+         WRITE(numout,*)'      significant wave heigth         = ', TRIM(sn_rcv_hsig%cldes  ), ' (', TRIM(sn_rcv_hsig%clcat  ), ')'
+         WRITE(numout,*)'      wave to oce energy flux         = ', TRIM(sn_rcv_phioc%cldes ), ' (', TRIM(sn_rcv_phioc%clcat ), ')'
+         WRITE(numout,*)'      Surface Stokes drift grid u     = ', TRIM(sn_rcv_sdrfx%cldes ), ' (', TRIM(sn_rcv_sdrfx%clcat ), ')'
+         WRITE(numout,*)'      Surface Stokes drift grid v     = ', TRIM(sn_rcv_sdrfy%cldes ), ' (', TRIM(sn_rcv_sdrfy%clcat ), ')'
+         WRITE(numout,*)'      Mean wave period                = ', TRIM(sn_rcv_wper%cldes  ), ' (', TRIM(sn_rcv_wper%clcat  ), ')'
+         WRITE(numout,*)'      Mean wave number                = ', TRIM(sn_rcv_wnum%cldes  ), ' (', TRIM(sn_rcv_wnum%clcat  ), ')'
          WRITE(numout,*)'      Stress frac adsorbed by waves   = ', TRIM(sn_rcv_wstrf%cldes ), ' (', TRIM(sn_rcv_wstrf%clcat ), ')'
-         WRITE(numout,*)'      Neutral surf drag coefficient   = ', TRIM(sn_rcv_wdrag%cldes ), ' (', TRIM(sn_rcv_wdrag%clcat ), ')' 
+         WRITE(numout,*)'      Neutral surf drag coefficient   = ', TRIM(sn_rcv_wdrag%cldes ), ' (', TRIM(sn_rcv_wdrag%clcat ), ')'
          WRITE(numout,*)'      Charnock coefficient            = ', TRIM(sn_rcv_charn%cldes ), ' (', TRIM(sn_rcv_charn%clcat ), ')'
          WRITE(numout,*)'  sent fields (multiple ice categories)'
@@ -342,7 +344,7 @@
          WRITE(numout,*)'      albedo                          = ', TRIM(sn_snd_alb%cldes   ), ' (', TRIM(sn_snd_alb%clcat   ), ')'
          WRITE(numout,*)'      ice/snow thickness              = ', TRIM(sn_snd_thick%cldes ), ' (', TRIM(sn_snd_thick%clcat ), ')'
-         WRITE(numout,*)'      total ice fraction              = ', TRIM(sn_snd_ifrac%cldes ), ' (', TRIM(sn_snd_ifrac%clcat ), ')' 
+         WRITE(numout,*)'      total ice fraction              = ', TRIM(sn_snd_ifrac%cldes ), ' (', TRIM(sn_snd_ifrac%clcat ), ')'
          WRITE(numout,*)'      surface current                 = ', TRIM(sn_snd_crt%cldes   ), ' (', TRIM(sn_snd_crt%clcat   ), ')'
-         WRITE(numout,*)'                      - referential   = ', sn_snd_crt%clvref 
+         WRITE(numout,*)'                      - referential   = ', sn_snd_crt%clvref
          WRITE(numout,*)'                      - orientation   = ', sn_snd_crt%clvor
          WRITE(numout,*)'                      - mesh          = ', sn_snd_crt%clvgrd
@@ -351,10 +353,10 @@
          WRITE(numout,*)'      meltponds fraction and depth    = ', TRIM(sn_snd_mpnd%cldes  ), ' (', TRIM(sn_snd_mpnd%clcat  ), ')'
          WRITE(numout,*)'      sea surface freezing temp       = ', TRIM(sn_snd_sstfrz%cldes), ' (', TRIM(sn_snd_sstfrz%clcat), ')'
-         WRITE(numout,*)'      water level                     = ', TRIM(sn_snd_wlev%cldes  ), ' (', TRIM(sn_snd_wlev%clcat  ), ')' 
-         WRITE(numout,*)'      mean sea level pressure         = ', TRIM(sn_rcv_mslp%cldes  ), ' (', TRIM(sn_rcv_mslp%clcat  ), ')' 
-         WRITE(numout,*)'      surface current to waves        = ', TRIM(sn_snd_crtw%cldes  ), ' (', TRIM(sn_snd_crtw%clcat  ), ')' 
-         WRITE(numout,*)'                      - referential   = ', sn_snd_crtw%clvref 
-         WRITE(numout,*)'                      - orientation   = ', sn_snd_crtw%clvor 
-         WRITE(numout,*)'                      - mesh          = ', sn_snd_crtw%clvgrd 
+         WRITE(numout,*)'      water level                     = ', TRIM(sn_snd_wlev%cldes  ), ' (', TRIM(sn_snd_wlev%clcat  ), ')'
+         WRITE(numout,*)'      mean sea level pressure         = ', TRIM(sn_rcv_mslp%cldes  ), ' (', TRIM(sn_rcv_mslp%clcat  ), ')'
+         WRITE(numout,*)'      surface current to waves        = ', TRIM(sn_snd_crtw%cldes  ), ' (', TRIM(sn_snd_crtw%clcat  ), ')'
+         WRITE(numout,*)'                      - referential   = ', sn_snd_crtw%clvref
+         WRITE(numout,*)'                      - orientation   = ', sn_snd_crtw%clvor
+         WRITE(numout,*)'                      - mesh          = ', sn_snd_crtw%clvgrd
       ENDIF
       IF( lwp .AND. ln_wave) THEN                        ! control print
@@ -380,9 +382,9 @@
       !                                   ! allocate sbccpl arrays
       IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
-     
+
       ! ================================ !
       !   Define the receive interface   !
       ! ================================ !
-      nrcvinfo(:) = OASIS_idle   ! needed by nrcvinfo(jpr_otx1) if we do not receive ocean stress 
+      nrcvinfo(:) = OASIS_idle   ! needed by nrcvinfo(jpr_otx1) if we do not receive ocean stress
 
       ! for each field: define the OASIS name                              (srcv(:)%clname)
@@ -394,21 +396,21 @@
 
       !                                                      ! ------------------------- !
-      !                                                      ! ice and ocean wind stress !   
-      !                                                      ! ------------------------- !
-      !                                                           ! Name 
+      !                                                      ! ice and ocean wind stress !
+      !                                                      ! ------------------------- !
+      !                                                           ! Name
       srcv(jpr_otx1)%clname = 'O_OTaux1'      ! 1st ocean component on grid ONE (T or U)
-      srcv(jpr_oty1)%clname = 'O_OTauy1'      ! 2nd   -      -         -     - 
-      srcv(jpr_otz1)%clname = 'O_OTauz1'      ! 3rd   -      -         -     - 
+      srcv(jpr_oty1)%clname = 'O_OTauy1'      ! 2nd   -      -         -     -
+      srcv(jpr_otz1)%clname = 'O_OTauz1'      ! 3rd   -      -         -     -
       srcv(jpr_otx2)%clname = 'O_OTaux2'      ! 1st ocean component on grid TWO (V)
-      srcv(jpr_oty2)%clname = 'O_OTauy2'      ! 2nd   -      -         -     - 
-      srcv(jpr_otz2)%clname = 'O_OTauz2'      ! 3rd   -      -         -     - 
+      srcv(jpr_oty2)%clname = 'O_OTauy2'      ! 2nd   -      -         -     -
+      srcv(jpr_otz2)%clname = 'O_OTauz2'      ! 3rd   -      -         -     -
       !
       srcv(jpr_itx1)%clname = 'O_ITaux1'      ! 1st  ice  component on grid ONE (T, F, I or U)
-      srcv(jpr_ity1)%clname = 'O_ITauy1'      ! 2nd   -      -         -     - 
-      srcv(jpr_itz1)%clname = 'O_ITauz1'      ! 3rd   -      -         -     - 
+      srcv(jpr_ity1)%clname = 'O_ITauy1'      ! 2nd   -      -         -     -
+      srcv(jpr_itz1)%clname = 'O_ITauz1'      ! 3rd   -      -         -     -
       srcv(jpr_itx2)%clname = 'O_ITaux2'      ! 1st  ice  component on grid TWO (V)
-      srcv(jpr_ity2)%clname = 'O_ITauy2'      ! 2nd   -      -         -     - 
-      srcv(jpr_itz2)%clname = 'O_ITauz2'      ! 3rd   -      -         -     - 
-      ! 
+      srcv(jpr_ity2)%clname = 'O_ITauy2'      ! 2nd   -      -         -     -
+      srcv(jpr_itz2)%clname = 'O_ITauz2'      ! 3rd   -      -         -     -
+      !
       ! Vectors: change of sign at north fold ONLY if on the local grid
       IF(       TRIM( sn_rcv_tau%cldes ) == 'oce only' .OR. TRIM( sn_rcv_tau%cldes ) == 'oce and ice'  &
@@ -416,12 +418,12 @@
       !
       IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' )   srcv(jpr_otx1:jpr_itz2)%nsgn = -1.
-      
+
       !                                                           ! Set grid and action
       SELECT CASE( TRIM( sn_rcv_tau%clvgrd ) )      !  'T', 'U,V', 'U,V,I', 'U,V,F', 'T,I', 'T,F', or 'T,U,V'
-      CASE( 'T' ) 
+      CASE( 'T' )
          srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point
-         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1 
-         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 
-      CASE( 'U,V' ) 
+         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1
+         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1
+      CASE( 'U,V' )
          srcv(jpr_otx1:jpr_otz1)%clgrid  = 'U'        ! oce components given at U-point
          srcv(jpr_otx2:jpr_otz2)%clgrid  = 'V'        !           and           V-point
@@ -447,14 +449,14 @@
          srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2
          srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 only
-      CASE( 'T,I' ) 
+      CASE( 'T,I' )
          srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point
          srcv(jpr_itx1:jpr_itz1)%clgrid  = 'I'        ! ice components given at I-point
-         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1 
-         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 
-      CASE( 'T,F' ) 
+         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1
+         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1
+      CASE( 'T,F' )
          srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point
          srcv(jpr_itx1:jpr_itz1)%clgrid  = 'F'        ! ice components given at F-point
-         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1 
-         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 
+         srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1
+         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1
       CASE( 'T,U,V' )
          srcv(jpr_otx1:jpr_otz1)%clgrid  = 'T'        ! oce components given at T-point
@@ -463,14 +465,14 @@
          srcv(jpr_otx1:jpr_otz1)%laction = .TRUE.     ! receive oce components on grid 1 only
          srcv(jpr_itx1:jpr_itz2)%laction = .TRUE.     ! receive ice components on grid 1 & 2
-      CASE default   
+      CASE default
          CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_tau%clvgrd' )
       END SELECT
       !
       IF( TRIM( sn_rcv_tau%clvref ) == 'spherical' )   &           ! spherical: 3rd component not received
-         &     srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE. 
+         &     srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE.
       !
       IF( TRIM( sn_rcv_tau%clvor  ) == 'local grid' ) THEN        ! already on local grid -> no need of the second grid
-            srcv(jpr_otx2:jpr_otz2)%laction = .FALSE. 
-            srcv(jpr_itx2:jpr_itz2)%laction = .FALSE. 
+            srcv(jpr_otx2:jpr_otz2)%laction = .FALSE.
+            srcv(jpr_itx2:jpr_itz2)%laction = .FALSE.
             srcv(jpr_oty1)%clgrid = srcv(jpr_oty2)%clgrid   ! not needed but cleaner...
             srcv(jpr_ity1)%clgrid = srcv(jpr_ity2)%clgrid   ! not needed but cleaner...
@@ -488,15 +490,15 @@
       !                                                      ! ------------------------- !
       ! we suppose that atmosphere modele do not make the difference between precipiration (liquide or solid)
-      ! over ice of free ocean within the same atmospheric cell.cd 
+      ! over ice of free ocean within the same atmospheric cell.cd
       srcv(jpr_rain)%clname = 'OTotRain'      ! Rain = liquid precipitation
       srcv(jpr_snow)%clname = 'OTotSnow'      ! Snow = solid precipitation
       srcv(jpr_tevp)%clname = 'OTotEvap'      ! total evaporation (over oce + ice sublimation)
       srcv(jpr_ievp)%clname = 'OIceEvap'      ! evaporation over ice = sublimation
-      srcv(jpr_sbpr)%clname = 'OSubMPre'      ! sublimation - liquid precipitation - solid precipitation 
+      srcv(jpr_sbpr)%clname = 'OSubMPre'      ! sublimation - liquid precipitation - solid precipitation
       srcv(jpr_semp)%clname = 'OISubMSn'      ! ice solid water budget = sublimation - solid precipitation
       srcv(jpr_oemp)%clname = 'OOEvaMPr'      ! ocean water budget = ocean Evap - ocean precip
       SELECT CASE( TRIM( sn_rcv_emp%cldes ) )
       CASE( 'none'          )       ! nothing to do
-      CASE( 'oce only'      )   ;   srcv(jpr_oemp)%laction = .TRUE. 
+      CASE( 'oce only'      )   ;   srcv(jpr_oemp)%laction = .TRUE.
       CASE( 'conservative'  )
          srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
@@ -507,5 +509,5 @@
       !
       !                                                      ! ------------------------- !
-      !                                                      !     Runoffs & Calving     !   
+      !                                                      !     Runoffs & Calving     !
       !                                                      ! ------------------------- !
       srcv(jpr_rnf   )%clname = 'O_Runoff'
@@ -540,5 +542,5 @@
       CASE( 'conservative'  )   ;   srcv( (/jpr_qnsice, jpr_qnsmix/) )%laction = .TRUE.
       CASE( 'oce and ice'   )   ;   srcv( (/jpr_qnsice, jpr_qnsoce/) )%laction = .TRUE.
-      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qnsmix   )%laction = .TRUE. 
+      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qnsmix   )%laction = .TRUE.
       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qns%cldes' )
       END SELECT
@@ -557,5 +559,5 @@
       CASE( 'conservative'  )   ;   srcv( (/jpr_qsrice, jpr_qsrmix/) )%laction = .TRUE.
       CASE( 'oce and ice'   )   ;   srcv( (/jpr_qsrice, jpr_qsroce/) )%laction = .TRUE.
-      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qsrmix   )%laction = .TRUE. 
+      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qsrmix   )%laction = .TRUE.
       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qsr%cldes' )
       END SELECT
@@ -566,5 +568,5 @@
       !                                                      !   non solar sensitivity   !   d(Qns)/d(T)
       !                                                      ! ------------------------- !
-      srcv(jpr_dqnsdt)%clname = 'O_dQnsdT'   
+      srcv(jpr_dqnsdt)%clname = 'O_dQnsdT'
       IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE.
       !
@@ -574,10 +576,10 @@
       !
       !                                                      ! ------------------------- !
-      !                                                      !      10m wind module      !   
-      !                                                      ! ------------------------- !
-      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(sn_rcv_w10m%cldes  ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE. 
-      !
-      !                                                      ! ------------------------- !
-      !                                                      !   wind stress module      !   
+      !                                                      !      10m wind module      !
+      !                                                      ! ------------------------- !
+      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(sn_rcv_w10m%cldes  ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !   wind stress module      !
       !                                                      ! ------------------------- !
       srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(sn_rcv_taumod%cldes) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE.
@@ -586,5 +588,5 @@
       !                                                      !      Atmospheric CO2      !
       !                                                      ! ------------------------- !
-      srcv(jpr_co2 )%clname = 'O_AtmCO2'   
+      srcv(jpr_co2 )%clname = 'O_AtmCO2'
       IF( TRIM(sn_rcv_co2%cldes   ) == 'coupled' )  THEN
          srcv(jpr_co2 )%laction = .TRUE.
@@ -595,11 +597,11 @@
       ENDIF
       !
-      !                                                      ! ------------------------- ! 
-      !                                                      ! Mean Sea Level Pressure   ! 
-      !                                                      ! ------------------------- ! 
-      srcv(jpr_mslp)%clname = 'O_MSLP'     ;   IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' )    srcv(jpr_mslp)%laction = .TRUE. 
-      !
-      !                                                      ! ------------------------- !
-      !                                                      !  ice topmelt and botmelt  !   
+      !                                                      ! ------------------------- !
+      !                                                      ! Mean Sea Level Pressure   !
+      !                                                      ! ------------------------- !
+      srcv(jpr_mslp)%clname = 'O_MSLP'     ;   IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' )    srcv(jpr_mslp)%laction = .TRUE.
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !  ice topmelt and botmelt  !
       !                                                      ! ------------------------- !
       srcv(jpr_topm )%clname = 'OTopMlt'
@@ -614,5 +616,5 @@
       ENDIF
       !                                                      ! ------------------------- !
-      !                                                      !    ice skin temperature   !   
+      !                                                      !    ice skin temperature   !
       !                                                      ! ------------------------- !
       srcv(jpr_ts_ice)%clname = 'OTsfIce'    ! needed by Met Office
@@ -622,12 +624,12 @@
 
 #if defined key_si3
-      IF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN 
+      IF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN
          IF( .NOT.srcv(jpr_ts_ice)%laction )  &
-            &   CALL ctl_stop( 'sbc_cpl_init: srcv(jpr_ts_ice)%laction should be set to true when ln_cndflx=T' )     
+            &   CALL ctl_stop( 'sbc_cpl_init: srcv(jpr_ts_ice)%laction should be set to true when ln_cndflx=T' )
       ENDIF
 #endif
       !                                                      ! ------------------------- !
-      !                                                      !      Wave breaking        !    
-      !                                                      ! ------------------------- ! 
+      !                                                      !      Wave breaking        !
+      !                                                      ! ------------------------- !
       srcv(jpr_hsig)%clname  = 'O_Hsigwa'    ! significant wave height
       IF( TRIM(sn_rcv_hsig%cldes  ) == 'coupled' )  THEN
@@ -704,5 +706,5 @@
       !
       !                                                      ! ------------------------------- !
-      !                                                      !   OPA-SAS coupling - rcv by opa !   
+      !                                                      !   OPA-SAS coupling - rcv by opa !
       !                                                      ! ------------------------------- !
       srcv(jpr_sflx)%clname = 'O_SFLX'
@@ -740,5 +742,5 @@
       ENDIF
       !                                                      ! -------------------------------- !
-      !                                                      !   OPA-SAS coupling - rcv by sas  !   
+      !                                                      !   OPA-SAS coupling - rcv by sas  !
       !                                                      ! -------------------------------- !
       srcv(jpr_toce  )%clname = 'I_SSTSST'
@@ -747,6 +749,6 @@
       srcv(jpr_ocy1  )%clname = 'I_OCury1'
       srcv(jpr_ssh   )%clname = 'I_SSHght'
-      srcv(jpr_e3t1st)%clname = 'I_E3T1st'   
-      srcv(jpr_fraqsr)%clname = 'I_FraQsr'   
+      srcv(jpr_e3t1st)%clname = 'I_E3T1st'
+      srcv(jpr_fraqsr)%clname = 'I_FraQsr'
       !
       IF( nn_components == jp_iam_sas ) THEN
@@ -778,13 +780,13 @@
             ENDIF
             WRITE(numout,*)'               sea surface temperature (Celsius) '
-            WRITE(numout,*)'               sea surface salinity ' 
-            WRITE(numout,*)'               surface currents ' 
-            WRITE(numout,*)'               sea surface height ' 
-            WRITE(numout,*)'               thickness of first ocean T level '        
+            WRITE(numout,*)'               sea surface salinity '
+            WRITE(numout,*)'               surface currents '
+            WRITE(numout,*)'               sea surface height '
+            WRITE(numout,*)'               thickness of first ocean T level '
             WRITE(numout,*)'               fraction of solar net radiation absorbed in the first ocean level'
             WRITE(numout,*)
          ENDIF
       ENDIF
-      
+
       ! =================================================== !
       ! Allocate all parts of frcv used for received fields !
@@ -812,8 +814,8 @@
       !                 define send or not from the namelist parameters (ssnd(:)%laction)
       !                 define the north fold type of lbc               (ssnd(:)%nsgn)
-      
+
       ! default definitions of nsnd
       ssnd(:)%laction = .FALSE.   ;   ssnd(:)%clgrid = 'T'   ;   ssnd(:)%nsgn = 1.  ; ssnd(:)%nct = 1
-         
+
       !                                                      ! ------------------------- !
       !                                                      !    Surface temperature    !
@@ -832,9 +834,9 @@
       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_temp%cldes' )
       END SELECT
-           
+
       !                                                      ! ------------------------- !
       !                                                      !          Albedo           !
       !                                                      ! ------------------------- !
-      ssnd(jps_albice)%clname = 'O_AlbIce' 
+      ssnd(jps_albice)%clname = 'O_AlbIce'
       ssnd(jps_albmix)%clname = 'O_AlbMix'
       SELECT CASE( TRIM( sn_snd_alb%cldes ) )
@@ -847,5 +849,5 @@
       ! Need to calculate oceanic albedo if
       !     1. sending mixed oce-ice albedo or
-      !     2. receiving mixed oce-ice solar radiation 
+      !     2. receiving mixed oce-ice solar radiation
       IF( TRIM ( sn_snd_alb%cldes ) == 'mixed oce-ice' .OR. TRIM ( sn_rcv_qsr%cldes ) == 'mixed oce-ice' ) THEN
          CALL oce_alb( zaos, zacs )
@@ -854,8 +856,8 @@
       ENDIF
       !                                                      ! ------------------------- !
-      !                                                      !  Ice fraction & Thickness ! 
+      !                                                      !  Ice fraction & Thickness !
       !                                                      ! ------------------------- !
       ssnd(jps_fice)%clname  = 'OIceFrc'
-      ssnd(jps_ficet)%clname = 'OIceFrcT' 
+      ssnd(jps_ficet)%clname = 'OIceFrcT'
       ssnd(jps_hice)%clname  = 'OIceTck'
       ssnd(jps_a_p)%clname   = 'OPndFrc'
@@ -870,15 +872,15 @@
          IF( TRIM( sn_snd_thick1%clcat ) == 'yes' ) ssnd(jps_fice1)%nct = nn_cats_cpl
       ENDIF
-      
-      IF(TRIM( sn_snd_ifrac%cldes )  == 'coupled') ssnd(jps_ficet)%laction = .TRUE. 
+
+      IF(TRIM( sn_snd_ifrac%cldes )  == 'coupled') ssnd(jps_ficet)%laction = .TRUE.
 
       SELECT CASE ( TRIM( sn_snd_thick%cldes ) )
       CASE( 'none'         )       ! nothing to do
-      CASE( 'ice and snow' ) 
+      CASE( 'ice and snow' )
          ssnd(jps_hice:jps_hsnw)%laction = .TRUE.
          IF( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN
             ssnd(jps_hice:jps_hsnw)%nct = nn_cats_cpl
          ENDIF
-      CASE ( 'weighted ice and snow' ) 
+      CASE ( 'weighted ice and snow' )
          ssnd(jps_hice:jps_hsnw)%laction = .TRUE.
          IF( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_hice:jps_hsnw)%nct = nn_cats_cpl
@@ -890,35 +892,35 @@
        a_i_last_couple(:,:,:) = 0._wp
 #endif
-      !                                                      ! ------------------------- ! 
-      !                                                      !      Ice Meltponds        ! 
-      !                                                      ! ------------------------- ! 
+      !                                                      ! ------------------------- !
+      !                                                      !      Ice Meltponds        !
+      !                                                      ! ------------------------- !
       ! Needed by Met Office
-      ssnd(jps_a_p)%clname  = 'OPndFrc'    
-      ssnd(jps_ht_p)%clname = 'OPndTck'    
-      SELECT CASE ( TRIM( sn_snd_mpnd%cldes ) ) 
-      CASE ( 'none' ) 
-         ssnd(jps_a_p)%laction  = .FALSE. 
-         ssnd(jps_ht_p)%laction = .FALSE. 
-      CASE ( 'ice only' )  
-         ssnd(jps_a_p)%laction  = .TRUE. 
-         ssnd(jps_ht_p)%laction = .TRUE. 
-         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN 
-            ssnd(jps_a_p)%nct  = nn_cats_cpl 
-            ssnd(jps_ht_p)%nct = nn_cats_cpl 
-         ELSE 
-            IF( nn_cats_cpl > 1 ) THEN 
-               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_mpnd%cldes if not exchanging category fields' ) 
-            ENDIF 
-         ENDIF 
-      CASE ( 'weighted ice' )  
-         ssnd(jps_a_p)%laction  = .TRUE. 
-         ssnd(jps_ht_p)%laction = .TRUE. 
-         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN 
-            ssnd(jps_a_p)%nct  = nn_cats_cpl  
-            ssnd(jps_ht_p)%nct = nn_cats_cpl  
-         ENDIF 
-      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_mpnd%cldes; '//sn_snd_mpnd%cldes ) 
-      END SELECT 
- 
+      ssnd(jps_a_p)%clname  = 'OPndFrc'
+      ssnd(jps_ht_p)%clname = 'OPndTck'
+      SELECT CASE ( TRIM( sn_snd_mpnd%cldes ) )
+      CASE ( 'none' )
+         ssnd(jps_a_p)%laction  = .FALSE.
+         ssnd(jps_ht_p)%laction = .FALSE.
+      CASE ( 'ice only' )
+         ssnd(jps_a_p)%laction  = .TRUE.
+         ssnd(jps_ht_p)%laction = .TRUE.
+         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN
+            ssnd(jps_a_p)%nct  = nn_cats_cpl
+            ssnd(jps_ht_p)%nct = nn_cats_cpl
+         ELSE
+            IF( nn_cats_cpl > 1 ) THEN
+               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_mpnd%cldes if not exchanging category fields' )
+            ENDIF
+         ENDIF
+      CASE ( 'weighted ice' )
+         ssnd(jps_a_p)%laction  = .TRUE.
+         ssnd(jps_ht_p)%laction = .TRUE.
+         IF( TRIM( sn_snd_mpnd%clcat ) == 'yes' ) THEN
+            ssnd(jps_a_p)%nct  = nn_cats_cpl
+            ssnd(jps_ht_p)%nct = nn_cats_cpl
+         ENDIF
+      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_mpnd%cldes; '//sn_snd_mpnd%cldes )
+      END SELECT
+
       !                                                      ! ------------------------- !
       !                                                      !      Surface current      !
@@ -928,6 +930,6 @@
       ssnd(jps_ocy1)%clname = 'O_OCury1'   ;   ssnd(jps_ivy1)%clname = 'O_IVely1'
       ssnd(jps_ocz1)%clname = 'O_OCurz1'   ;   ssnd(jps_ivz1)%clname = 'O_IVelz1'
-      ssnd(jps_ocxw)%clname = 'O_OCurxw' 
-      ssnd(jps_ocyw)%clname = 'O_OCuryw' 
+      ssnd(jps_ocxw)%clname = 'O_OCurxw'
+      ssnd(jps_ocyw)%clname = 'O_OCuryw'
       !
       ssnd(jps_ocx1:jps_ivz1)%nsgn = -1.   ! vectors: change of the sign at the north fold
@@ -935,9 +937,9 @@
       IF( sn_snd_crt%clvgrd == 'U,V' ) THEN
          ssnd(jps_ocx1)%clgrid = 'U' ; ssnd(jps_ocy1)%clgrid = 'V'
-      ELSE IF( sn_snd_crt%clvgrd /= 'T' ) THEN  
+      ELSE IF( sn_snd_crt%clvgrd /= 'T' ) THEN
          CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T' )
       ENDIF
       ssnd(jps_ocx1:jps_ivz1)%laction = .TRUE.   ! default: all are send
-      IF( TRIM( sn_snd_crt%clvref ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE. 
+      IF( TRIM( sn_snd_crt%clvref ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE.
       IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) ssnd(jps_ocx1:jps_ivz1)%nsgn = 1.
       SELECT CASE( TRIM( sn_snd_crt%cldes ) )
@@ -949,19 +951,19 @@
       END SELECT
 
-      ssnd(jps_ocxw:jps_ocyw)%nsgn = -1.   ! vectors: change of the sign at the north fold 
-        
-      IF( sn_snd_crtw%clvgrd == 'U,V' ) THEN 
-         ssnd(jps_ocxw)%clgrid = 'U' ; ssnd(jps_ocyw)%clgrid = 'V' 
-      ELSE IF( sn_snd_crtw%clvgrd /= 'T' ) THEN 
-         CALL ctl_stop( 'sn_snd_crtw%clvgrd must be equal to T' ) 
-      ENDIF 
-      IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) ssnd(jps_ocxw:jps_ocyw)%nsgn = 1. 
-      SELECT CASE( TRIM( sn_snd_crtw%cldes ) ) 
-         CASE( 'none'                 )   ; ssnd(jps_ocxw:jps_ocyw)%laction = .FALSE. 
-         CASE( 'oce only'             )   ; ssnd(jps_ocxw:jps_ocyw)%laction = .TRUE. 
-         CASE( 'weighted oce and ice' )   !   nothing to do 
-         CASE( 'mixed oce-ice'        )   ; ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 
-         CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_crtw%cldes' ) 
-      END SELECT 
+      ssnd(jps_ocxw:jps_ocyw)%nsgn = -1.   ! vectors: change of the sign at the north fold
+
+      IF( sn_snd_crtw%clvgrd == 'U,V' ) THEN
+         ssnd(jps_ocxw)%clgrid = 'U' ; ssnd(jps_ocyw)%clgrid = 'V'
+      ELSE IF( sn_snd_crtw%clvgrd /= 'T' ) THEN
+         CALL ctl_stop( 'sn_snd_crtw%clvgrd must be equal to T' )
+      ENDIF
+      IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) ssnd(jps_ocxw:jps_ocyw)%nsgn = 1.
+      SELECT CASE( TRIM( sn_snd_crtw%cldes ) )
+         CASE( 'none'                 )   ; ssnd(jps_ocxw:jps_ocyw)%laction = .FALSE.
+         CASE( 'oce only'             )   ; ssnd(jps_ocxw:jps_ocyw)%laction = .TRUE.
+         CASE( 'weighted oce and ice' )   !   nothing to do
+         CASE( 'mixed oce-ice'        )   ; ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE.
+         CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_crtw%cldes' )
+      END SELECT
 
       !                                                      ! ------------------------- !
@@ -969,66 +971,66 @@
       !                                                      ! ------------------------- !
       ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(sn_snd_co2%cldes) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE.
-      ! 
-      !                                                      ! ------------------------- ! 
-      !                                                      ! Sea surface freezing temp ! 
-      !                                                      ! ------------------------- ! 
+      !
+      !                                                      ! ------------------------- !
+      !                                                      ! Sea surface freezing temp !
+      !                                                      ! ------------------------- !
       ! needed by Met Office
-      ssnd(jps_sstfrz)%clname = 'O_SSTFrz' ; IF( TRIM(sn_snd_sstfrz%cldes) == 'coupled' )  ssnd(jps_sstfrz)%laction = .TRUE. 
-      ! 
-      !                                                      ! ------------------------- ! 
-      !                                                      !    Ice conductivity       ! 
-      !                                                      ! ------------------------- ! 
+      ssnd(jps_sstfrz)%clname = 'O_SSTFrz' ; IF( TRIM(sn_snd_sstfrz%cldes) == 'coupled' )  ssnd(jps_sstfrz)%laction = .TRUE.
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !    Ice conductivity       !
+      !                                                      ! ------------------------- !
       ! needed by Met Office
-      ! Note that ultimately we will move to passing an ocean effective conductivity as well so there 
-      ! will be some changes to the parts of the code which currently relate only to ice conductivity 
-      ssnd(jps_ttilyr )%clname = 'O_TtiLyr' 
-      SELECT CASE ( TRIM( sn_snd_ttilyr%cldes ) ) 
-      CASE ( 'none' ) 
-         ssnd(jps_ttilyr)%laction = .FALSE. 
-      CASE ( 'ice only' ) 
-         ssnd(jps_ttilyr)%laction = .TRUE. 
-         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) THEN 
-            ssnd(jps_ttilyr)%nct = nn_cats_cpl 
-         ELSE 
-            IF( nn_cats_cpl > 1 ) THEN 
-               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_ttilyr%cldes if not exchanging category fields' ) 
-            ENDIF 
-         ENDIF 
-      CASE ( 'weighted ice' ) 
-         ssnd(jps_ttilyr)%laction = .TRUE. 
-         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) ssnd(jps_ttilyr)%nct = nn_cats_cpl 
-      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_ttilyr%cldes;'//sn_snd_ttilyr%cldes ) 
-      END SELECT 
-
-      ssnd(jps_kice )%clname = 'OIceKn' 
-      SELECT CASE ( TRIM( sn_snd_cond%cldes ) ) 
-      CASE ( 'none' ) 
-         ssnd(jps_kice)%laction = .FALSE. 
-      CASE ( 'ice only' ) 
-         ssnd(jps_kice)%laction = .TRUE. 
-         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) THEN 
-            ssnd(jps_kice)%nct = nn_cats_cpl 
-         ELSE 
-            IF( nn_cats_cpl > 1 ) THEN 
-               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_cond%cldes if not exchanging category fields' ) 
-            ENDIF 
-         ENDIF 
-      CASE ( 'weighted ice' ) 
-         ssnd(jps_kice)%laction = .TRUE. 
-         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) ssnd(jps_kice)%nct = nn_cats_cpl 
-      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_cond%cldes;'//sn_snd_cond%cldes ) 
-      END SELECT 
-      ! 
-      !                                                      ! ------------------------- ! 
-      !                                                      !     Sea surface height    ! 
-      !                                                      ! ------------------------- ! 
-      ssnd(jps_wlev)%clname = 'O_Wlevel' ;  IF( TRIM(sn_snd_wlev%cldes) == 'coupled' )   ssnd(jps_wlev)%laction = .TRUE. 
+      ! Note that ultimately we will move to passing an ocean effective conductivity as well so there
+      ! will be some changes to the parts of the code which currently relate only to ice conductivity
+      ssnd(jps_ttilyr )%clname = 'O_TtiLyr'
+      SELECT CASE ( TRIM( sn_snd_ttilyr%cldes ) )
+      CASE ( 'none' )
+         ssnd(jps_ttilyr)%laction = .FALSE.
+      CASE ( 'ice only' )
+         ssnd(jps_ttilyr)%laction = .TRUE.
+         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) THEN
+            ssnd(jps_ttilyr)%nct = nn_cats_cpl
+         ELSE
+            IF( nn_cats_cpl > 1 ) THEN
+               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_ttilyr%cldes if not exchanging category fields' )
+            ENDIF
+         ENDIF
+      CASE ( 'weighted ice' )
+         ssnd(jps_ttilyr)%laction = .TRUE.
+         IF( TRIM( sn_snd_ttilyr%clcat ) == 'yes' ) ssnd(jps_ttilyr)%nct = nn_cats_cpl
+      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_ttilyr%cldes;'//sn_snd_ttilyr%cldes )
+      END SELECT
+
+      ssnd(jps_kice )%clname = 'OIceKn'
+      SELECT CASE ( TRIM( sn_snd_cond%cldes ) )
+      CASE ( 'none' )
+         ssnd(jps_kice)%laction = .FALSE.
+      CASE ( 'ice only' )
+         ssnd(jps_kice)%laction = .TRUE.
+         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) THEN
+            ssnd(jps_kice)%nct = nn_cats_cpl
+         ELSE
+            IF( nn_cats_cpl > 1 ) THEN
+               CALL ctl_stop( 'sbc_cpl_init: use weighted ice option for sn_snd_cond%cldes if not exchanging category fields' )
+            ENDIF
+         ENDIF
+      CASE ( 'weighted ice' )
+         ssnd(jps_kice)%laction = .TRUE.
+         IF( TRIM( sn_snd_cond%clcat ) == 'yes' ) ssnd(jps_kice)%nct = nn_cats_cpl
+      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_cond%cldes;'//sn_snd_cond%cldes )
+      END SELECT
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !     Sea surface height    !
+      !                                                      ! ------------------------- !
+      ssnd(jps_wlev)%clname = 'O_Wlevel' ;  IF( TRIM(sn_snd_wlev%cldes) == 'coupled' )   ssnd(jps_wlev)%laction = .TRUE.
 
       !                                                      ! ------------------------------- !
-      !                                                      !   OPA-SAS coupling - snd by opa !   
+      !                                                      !   OPA-SAS coupling - snd by opa !
       !                                                      ! ------------------------------- !
-      ssnd(jps_ssh   )%clname = 'O_SSHght' 
-      ssnd(jps_soce  )%clname = 'O_SSSal' 
-      ssnd(jps_e3t1st)%clname = 'O_E3T1st'   
+      ssnd(jps_ssh   )%clname = 'O_SSHght'
+      ssnd(jps_soce  )%clname = 'O_SSSal'
+      ssnd(jps_e3t1st)%clname = 'O_E3T1st'
       ssnd(jps_fraqsr)%clname = 'O_FraQsr'
       !
@@ -1048,8 +1050,8 @@
             WRITE(numout,*)'  sent fields to SAS component '
             WRITE(numout,*)'               sea surface temperature (T before, Celsius) '
-            WRITE(numout,*)'               sea surface salinity ' 
-            WRITE(numout,*)'               surface currents U,V on local grid and spherical coordinates' 
-            WRITE(numout,*)'               sea surface height ' 
-            WRITE(numout,*)'               thickness of first ocean T level '        
+            WRITE(numout,*)'               sea surface salinity '
+            WRITE(numout,*)'               surface currents U,V on local grid and spherical coordinates'
+            WRITE(numout,*)'               sea surface height '
+            WRITE(numout,*)'               thickness of first ocean T level '
             WRITE(numout,*)'               fraction of solar net radiation absorbed in the first ocean level'
             WRITE(numout,*)
@@ -1057,15 +1059,15 @@
       ENDIF
       !                                                      ! ------------------------------- !
-      !                                                      !   OPA-SAS coupling - snd by sas !   
+      !                                                      !   OPA-SAS coupling - snd by sas !
       !                                                      ! ------------------------------- !
-      ssnd(jps_sflx  )%clname = 'I_SFLX'     
+      ssnd(jps_sflx  )%clname = 'I_SFLX'
       ssnd(jps_fice2 )%clname = 'IIceFrc'
-      ssnd(jps_qsroce)%clname = 'I_QsrOce'   
-      ssnd(jps_qnsoce)%clname = 'I_QnsOce'   
-      ssnd(jps_oemp  )%clname = 'IOEvaMPr' 
-      ssnd(jps_otx1  )%clname = 'I_OTaux1'   
-      ssnd(jps_oty1  )%clname = 'I_OTauy1'   
-      ssnd(jps_rnf   )%clname = 'I_Runoff'   
-      ssnd(jps_taum  )%clname = 'I_TauMod'   
+      ssnd(jps_qsroce)%clname = 'I_QsrOce'
+      ssnd(jps_qnsoce)%clname = 'I_QnsOce'
+      ssnd(jps_oemp  )%clname = 'IOEvaMPr'
+      ssnd(jps_otx1  )%clname = 'I_OTaux1'
+      ssnd(jps_oty1  )%clname = 'I_OTauy1'
+      ssnd(jps_rnf   )%clname = 'I_Runoff'
+      ssnd(jps_taum  )%clname = 'I_TauMod'
       !
       IF( nn_components == jp_iam_sas ) THEN
@@ -1102,6 +1104,6 @@
       ! ================================ !
       CALL cpl_define(jprcv, jpsnd, nn_cplmodel)
-      
-      IF(ln_usecplmask) THEN 
+
+      IF(ln_usecplmask) THEN
          xcplmask(:,:,:) = 0.
          CALL iom_open( 'cplmask', inum )
@@ -1118,5 +1120,5 @@
 
 
-   SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice, Kbb, Kmm )     
+   SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice, Kbb, Kmm )
       !!----------------------------------------------------------------------
       !!             ***  ROUTINE sbc_cpl_rcv  ***
@@ -1132,6 +1134,6 @@
       !!
       !!                  - transform the received ocean stress vector from the received
-      !!                 referential and grid into an atmosphere-ocean stress in 
-      !!                 the (i,j) ocean referencial and at the ocean velocity point. 
+      !!                 referential and grid into an atmosphere-ocean stress in
+      !!                 the (i,j) ocean referencial and at the ocean velocity point.
       !!                    The received stress are :
       !!                     - defined by 3 components (if cartesian coordinate)
@@ -1141,19 +1143,19 @@
       !!                     - given at U- and V-point, resp.   if received on 2 grids
       !!                            or at T-point               if received on 1 grid
-      !!                    Therefore and if necessary, they are successively 
-      !!                  processed in order to obtain them 
-      !!                     first  as  2 components on the sphere 
+      !!                    Therefore and if necessary, they are successively
+      !!                  processed in order to obtain them
+      !!                     first  as  2 components on the sphere
       !!                     second as  2 components oriented along the local grid
-      !!                     third  as  2 components on the U,V grid 
+      !!                     third  as  2 components on the U,V grid
       !!
-      !!              --> 
+      !!              -->
       !!
-      !!              - In 'ocean only' case, non solar and solar ocean heat fluxes 
-      !!             and total ocean freshwater fluxes  
+      !!              - In 'ocean only' case, non solar and solar ocean heat fluxes
+      !!             and total ocean freshwater fluxes
       !!
-      !! ** Method  :   receive all fields from the atmosphere and transform 
-      !!              them into ocean surface boundary condition fields 
+      !! ** Method  :   receive all fields from the atmosphere and transform
+      !!              them into ocean surface boundary condition fields
       !!
-      !! ** Action  :   update  utau, vtau   ocean stress at U,V grid 
+      !! ** Action  :   update  utau, vtau   ocean stress at U,V grid
       !!                        taum         wind stress module at T-point
       !!                        wndm         wind speed  module at T-point over free ocean or leads in presence of sea-ice
@@ -1166,5 +1168,5 @@
       !
       INTEGER, INTENT(in) ::   kt          ! ocean model time step index
-      INTEGER, INTENT(in) ::   k_fsbc      ! frequency of sbc (-> ice model) computation 
+      INTEGER, INTENT(in) ::   k_fsbc      ! frequency of sbc (-> ice model) computation
       INTEGER, INTENT(in) ::   k_ice       ! ice management in the sbc (=0/1/2/3)
       INTEGER, INTENT(in) ::   Kbb, Kmm    ! ocean model time level indices
@@ -1173,5 +1175,5 @@
       INTEGER  ::   ji, jj, jn             ! dummy loop indices
       INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdt did not change since nit000)
-      REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars     
+      REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars
       REAL(wp) ::   zcoef                  ! temporary scalar
       REAL(wp) ::   zrhoa  = 1.22          ! Air density kg/m3
@@ -1188,5 +1190,5 @@
 
          IF( ncpl_qsr_freq /= 0) ncpl_qsr_freq = 86400 / ncpl_qsr_freq ! used by top
-         
+
          IF ( ln_wave .AND. nn_components == 0 ) THEN
             ncpl_qsr_freq = 1;
@@ -1231,14 +1233,14 @@
             IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid
                !                                                       ! (geographical to local grid -> rotate the components)
-               CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )   
+               CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )
                IF( srcv(jpr_otx2)%laction ) THEN
-                  CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )   
+                  CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )
                ELSE
-                  CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )  
+                  CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )
                ENDIF
                frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid
                frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid
             ENDIF
-            !                              
+            !
             IF( srcv(jpr_otx1)%clgrid == 'T' ) THEN
                DO_2D( 0, 0, 0, 0 )                                        ! T ==> (U,V)
@@ -1255,5 +1257,5 @@
       ELSE                                                   !   No dynamical coupling   !
          !                                                   ! ========================= !
-         frcv(jpr_otx1)%z3(:,:,1) = 0.e0                               ! here simply set to zero 
+         frcv(jpr_otx1)%z3(:,:,1) = 0.e0                               ! here simply set to zero
          frcv(jpr_oty1)%z3(:,:,1) = 0.e0                               ! an external read in a file can be added instead
          llnewtx = .TRUE.
@@ -1263,5 +1265,5 @@
       !                                                      !    wind stress module     !   (taum)
       !                                                      ! ========================= !
-      IF( .NOT. srcv(jpr_taum)%laction ) THEN                    ! compute wind stress module from its components if not received 
+      IF( .NOT. srcv(jpr_taum)%laction ) THEN                    ! compute wind stress module from its components if not received
          ! => need to be done only when otx1 was changed
          IF( llnewtx ) THEN
@@ -1279,5 +1281,5 @@
          llnewtau = nrcvinfo(jpr_taum) == OASIS_Rcv
          ! Stress module can be negative when received (interpolation problem)
-         IF( llnewtau ) THEN 
+         IF( llnewtau ) THEN
             frcv(jpr_taum)%z3(:,:,1) = MAX( 0._wp, frcv(jpr_taum)%z3(:,:,1) )
          ENDIF
@@ -1287,8 +1289,8 @@
       !                                                      !      10 m wind speed      !   (wndm)
       !                                                      ! ========================= !
-      IF( .NOT. srcv(jpr_w10m)%laction ) THEN                    ! compute wind spreed from wind stress module if not received  
+      IF( .NOT. srcv(jpr_w10m)%laction ) THEN                    ! compute wind spreed from wind stress module if not received
          ! => need to be done only when taumod was changed
-         IF( llnewtau ) THEN 
-            zcoef = 1. / ( zrhoa * zcdrag ) 
+         IF( llnewtau ) THEN
+            zcoef = 1. / ( zrhoa * zcdrag )
             DO_2D( 1, 1, 1, 1 )
                frcv(jpr_w10m)%z3(ji,jj,1) = SQRT( frcv(jpr_taum)%z3(ji,jj,1) * zcoef )
@@ -1310,5 +1312,5 @@
       !                                                      ! ========================= !
       ! u(v)tau and taum will be modified by ice model
-      ! -> need to be reset before each call of the ice/fsbc      
+      ! -> need to be reset before each call of the ice/fsbc
       IF( MOD( kt-1, k_fsbc ) == 0 ) THEN
          !
@@ -1325,5 +1327,5 @@
          ENDIF
          CALL iom_put( "taum_oce", taum )   ! output wind stress module
-         !  
+         !
       ENDIF
 
@@ -1333,41 +1335,41 @@
       IF( srcv(jpr_co2)%laction )   atm_co2(:,:) = frcv(jpr_co2)%z3(:,:,1)
       !
-      !                                                      ! ========================= ! 
-      !                                                      ! Mean Sea Level Pressure   !   (taum) 
-      !                                                      ! ========================= ! 
-      IF( srcv(jpr_mslp)%laction ) THEN                    ! UKMO SHELF effect of atmospheric pressure on SSH 
-          IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields 
-
-          r1_grau = 1.e0 / (grav * rho0)               !* constant for optimization 
-          ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rpref ) * r1_grau    ! equivalent ssh (inverse barometer) 
-          apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1)                         !atmospheric pressure 
-    
-          IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:)  ! correct this later (read from restart if possible) 
-      ENDIF 
+      !                                                      ! ========================= !
+      !                                                      ! Mean Sea Level Pressure   !   (taum)
+      !                                                      ! ========================= !
+      IF( srcv(jpr_mslp)%laction ) THEN                    ! UKMO SHELF effect of atmospheric pressure on SSH
+          IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields
+
+          r1_grau = 1.e0 / (grav * rho0)               !* constant for optimization
+          ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rpref ) * r1_grau    ! equivalent ssh (inverse barometer)
+          apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1)                         !atmospheric pressure
+
+          IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:)  ! correct this later (read from restart if possible)
+      ENDIF
       !
       IF( ln_sdw ) THEN  ! Stokes Drift correction activated
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      !       Stokes drift u      !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
          IF( srcv(jpr_sdrftx)%laction ) ut0sd(:,:) = frcv(jpr_sdrftx)%z3(:,:,1)
       !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      !       Stokes drift v      !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
          IF( srcv(jpr_sdrfty)%laction ) vt0sd(:,:) = frcv(jpr_sdrfty)%z3(:,:,1)
       !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      !      Wave mean period     !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
          IF( srcv(jpr_wper)%laction ) wmp(:,:) = frcv(jpr_wper)%z3(:,:,1)
       !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      !  Significant wave height  !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
          IF( srcv(jpr_hsig)%laction ) hsw(:,:) = frcv(jpr_hsig)%z3(:,:,1)
-      ! 
-      !                                                      ! ========================= ! 
+      !
+      !                                                      ! ========================= !
       !                                                      !    Vertical mixing Qiao   !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
          IF( srcv(jpr_wnum)%laction .AND. ln_zdfswm ) wnum(:,:) = frcv(jpr_wnum)%z3(:,:,1)
 
@@ -1378,12 +1380,12 @@
          ENDIF
       ENDIF
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      ! Stress adsorbed by waves  !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       IF( srcv(jpr_wstrf)%laction .AND. ln_tauoc )  tauoc_wave(:,:) = frcv(jpr_wstrf)%z3(:,:,1)
       !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       !                                                      !   Wave drag coefficient   !
-      !                                                      ! ========================= ! 
+      !                                                      ! ========================= !
       IF( srcv(jpr_wdrag)%laction .AND. ln_cdgw )   cdn_wave(:,:) = frcv(jpr_wdrag)%z3(:,:,1)
       !
@@ -1404,5 +1406,5 @@
       IF( srcv(jpr_twox)%laction .AND. ln_taw )     twox(:,:) = frcv(jpr_twox)%z3(:,:,1)
       IF( srcv(jpr_twoy)%laction .AND. ln_taw )     twoy(:,:) = frcv(jpr_twoy)%z3(:,:,1)
-      !                                                      
+      !
       !                                                      ! ========================= !
       !                                                      !    wave TKE flux at sfc   !
@@ -1434,5 +1436,5 @@
          CALL iom_put( 'sss_m', sss_m )
       ENDIF
-      !                                               
+      !
       !                                                      ! ================== !
       !                                                      !        SST         !
@@ -1480,5 +1482,5 @@
          CALL iom_put( 'frq_m', frq_m )
       ENDIF
-      
+
       !                                                      ! ========================= !
       IF( k_ice <= 1 .AND. MOD( kt-1, k_fsbc ) == 0 ) THEN   !  heat & freshwater fluxes ! (Ocean only case)
@@ -1502,6 +1504,6 @@
          IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1)
          IF( srcv(jpr_cal)%laction )     zemp(:,:) = zemp(:,:) - frcv(jpr_cal)%z3(:,:,1)
- 
-         IF( srcv(jpr_icb)%laction )  THEN 
+
+         IF( srcv(jpr_icb)%laction )  THEN
              fwficb(:,:) = frcv(jpr_icb)%z3(:,:,1)
              rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runfofs
@@ -1510,7 +1512,7 @@
          ! ice shelf fwf
          IF( srcv(jpr_isf)%laction )  THEN
-            fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)  
+            fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)
          END IF
-        
+
          IF( ln_mixcpl ) THEN   ;   emp(:,:) = emp(:,:) * xcplmask(:,:,0) + zemp(:,:) * zmsk(:,:)
          ELSE                   ;   emp(:,:) =                              zemp(:,:)
@@ -1554,16 +1556,16 @@
       !
    END SUBROUTINE sbc_cpl_rcv
-   
-
-   SUBROUTINE sbc_cpl_ice_tau( p_taui, p_tauj )     
+
+
+   SUBROUTINE sbc_cpl_ice_tau( p_taui, p_tauj )
       !!----------------------------------------------------------------------
       !!             ***  ROUTINE sbc_cpl_ice_tau  ***
       !!
-      !! ** Purpose :   provide the stress over sea-ice in coupled mode 
+      !! ** Purpose :   provide the stress over sea-ice in coupled mode
       !!
       !! ** Method  :   transform the received stress from the atmosphere into
       !!             an atmosphere-ice stress in the (i,j) ocean referencial
       !!             and at the velocity point of the sea-ice model:
-      !!                'C'-grid : i- (j-) components given at U- (V-) point 
+      !!                'C'-grid : i- (j-) components given at U- (V-) point
       !!
       !!                The received stress are :
@@ -1574,14 +1576,14 @@
       !!                 - given at U- and V-point, resp.   if received on 2 grids
       !!                        or at a same point (T or I) if received on 1 grid
-      !!                Therefore and if necessary, they are successively 
-      !!             processed in order to obtain them 
-      !!                 first  as  2 components on the sphere 
+      !!                Therefore and if necessary, they are successively
+      !!             processed in order to obtain them
+      !!                 first  as  2 components on the sphere
       !!                 second as  2 components oriented along the local grid
-      !!                 third  as  2 components on the ice grid point 
+      !!                 third  as  2 components on the ice grid point
       !!
-      !!                Except in 'oce and ice' case, only one vector stress field 
+      !!                Except in 'oce and ice' case, only one vector stress field
       !!             is received. It has already been processed in sbc_cpl_rcv
       !!             so that it is now defined as (i,j) components given at U-
-      !!             and V-points, respectively.  
+      !!             and V-points, respectively.
       !!
       !! ** Action  :   return ptau_i, ptau_j, the stress over the ice
@@ -1593,8 +1595,8 @@
       INTEGER ::   itx      ! index of taux over ice
       REAL(wp)                     ::   zztmp1, zztmp2
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty 
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty
       !!----------------------------------------------------------------------
       !
-      IF( srcv(jpr_itx1)%laction ) THEN   ;   itx =  jpr_itx1   
+      IF( srcv(jpr_itx1)%laction ) THEN   ;   itx =  jpr_itx1
       ELSE                                ;   itx =  jpr_otx1
       ENDIF
@@ -1605,5 +1607,5 @@
          IF( srcv(jpr_itx1)%laction ) THEN                      !   ice stress received   !
             !                                                   ! ======================= !
-            !  
+            !
             IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN            ! 2 components on the sphere
                !                                                       ! (cartesian to spherical -> 3 to 2 components)
@@ -1624,9 +1626,9 @@
             IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid
                !                                                       ! (geographical to local grid -> rotate the components)
-               CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->i', ztx )   
+               CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->i', ztx )
                IF( srcv(jpr_itx2)%laction ) THEN
-                  CALL rot_rep( frcv(jpr_itx2)%z3(:,:,1), frcv(jpr_ity2)%z3(:,:,1), srcv(jpr_itx2)%clgrid, 'en->j', zty )   
+                  CALL rot_rep( frcv(jpr_itx2)%z3(:,:,1), frcv(jpr_ity2)%z3(:,:,1), srcv(jpr_itx2)%clgrid, 'en->j', zty )
                ELSE
-                  CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->j', zty )  
+                  CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->j', zty )
                ENDIF
                frcv(jpr_itx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid
@@ -1643,5 +1645,5 @@
          !                                                      !     put on ice grid     !
          !                                                      ! ======================= !
-         !    
+         !
          !                                                  j+1   j     -----V---F
          ! ice stress on ice velocity point                              !       |
@@ -1658,5 +1660,5 @@
          CASE( 'T' )
             DO_2D( 0, 0, 0, 0 )                    ! T ==> (U,V)
-               ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology 
+               ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology
                zztmp1 = 0.5_wp * ( 2. - umask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji+1,jj  ,1) )
                zztmp2 = 0.5_wp * ( 2. - vmask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji  ,jj+1,1) )
@@ -1666,9 +1668,9 @@
             CALL lbc_lnk_multi( 'sbccpl', p_taui, 'U',  -1., p_tauj, 'V',  -1. )
          END SELECT
-         
+
       ENDIF
       !
    END SUBROUTINE sbc_cpl_ice_tau
-   
+
 
    SUBROUTINE sbc_cpl_ice_flx( picefr, palbi, psst, pist, phs, phi )
@@ -1679,14 +1681,14 @@
       !!
       !! ** Method  :   transform the fields received from the atmosphere into
-      !!             surface heat and fresh water boundary condition for the 
+      !!             surface heat and fresh water boundary condition for the
       !!             ice-ocean system. The following fields are provided:
-      !!               * total non solar, solar and freshwater fluxes (qns_tot, 
+      !!               * total non solar, solar and freshwater fluxes (qns_tot,
       !!             qsr_tot and emp_tot) (total means weighted ice-ocean flux)
       !!             NB: emp_tot include runoffs and calving.
       !!               * fluxes over ice (qns_ice, qsr_ice, emp_ice) where
       !!             emp_ice = sublimation - solid precipitation as liquid
-      !!             precipitation are re-routed directly to the ocean and 
+      !!             precipitation are re-routed directly to the ocean and
       !!             calving directly enter the ocean (runoffs are read but included in trasbc.F90)
-      !!               * solid precipitation (sprecip), used to add to qns_tot 
+      !!               * solid precipitation (sprecip), used to add to qns_tot
       !!             the heat lost associated to melting solid precipitation
       !!             over the ocean fraction.
@@ -1720,9 +1722,9 @@
       !!                   emp_ice           ice sublimation - solid precipitation over the ice
       !!                   dqns_ice          d(non-solar heat flux)/d(Temperature) over the ice
-      !!                   sprecip           solid precipitation over the ocean  
+      !!                   sprecip           solid precipitation over the ocean
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in)   , DIMENSION(:,:)             ::   picefr     ! ice fraction                [0 to 1]
       !                                                   !!           ! optional arguments, used only in 'mixed oce-ice' case or for Met-Office coupling
-      REAL(wp), INTENT(in)   , DIMENSION(:,:,:), OPTIONAL ::   palbi      ! all skies ice albedo 
+      REAL(wp), INTENT(in)   , DIMENSION(:,:,:), OPTIONAL ::   palbi      ! all skies ice albedo
       REAL(wp), INTENT(in)   , DIMENSION(:,:  ), OPTIONAL ::   psst       ! sea surface temperature     [Celsius]
       REAL(wp), INTENT(inout), DIMENSION(:,:,:), OPTIONAL ::   pist       ! ice surface temperature     [Kelvin] => inout for Met-Office
@@ -1761,5 +1763,5 @@
          zsprecip(:,:) = frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_semp)%z3(:,:,1)
          ztprecip(:,:) = frcv(jpr_semp)%z3(:,:,1) - frcv(jpr_sbpr)%z3(:,:,1) + zsprecip(:,:)
-      CASE( 'none'      )       ! Not available as for now: needs additional coding below when computing zevap_oce 
+      CASE( 'none'      )       ! Not available as for now: needs additional coding below when computing zevap_oce
       !                         ! since fields received are not defined with none option
          CALL ctl_stop( 'STOP', 'sbccpl/sbc_cpl_ice_flx: some fields are not defined. Change sn_rcv_emp value in namelist namsbc_cpl' )
@@ -1808,5 +1810,5 @@
       ! zsnw = snow fraction over ice after wind blowing (=picefr if no blowing)
       zsnw(:,:) = 0._wp   ;   CALL ice_var_snwblow( ziceld, zsnw )
-      
+
       ! --- evaporation minus precipitation corrected (because of wind blowing on snow) --- !
       zemp_ice(:,:) = zemp_ice(:,:) + zsprecip(:,:) * ( picefr(:,:) - zsnw(:,:) )  ! emp_ice = A * sublimation - zsnw * sprecip
@@ -1819,5 +1821,5 @@
       ! therefore, sublimation is not redistributed over the ice categories when no subgrid scale fluxes are provided by atm.
       zdevap_ice(:,:) = 0._wp
-      
+
       ! --- Continental fluxes --- !
       IF( srcv(jpr_rnf)%laction ) THEN   ! runoffs (included in emp later on)
@@ -1833,5 +1835,5 @@
       ENDIF
       IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting)
-        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)  
+        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)
       ENDIF
 
@@ -1849,5 +1851,5 @@
          emp_tot (:,:)   = zemp_tot (:,:)
          emp_ice (:,:)   = zemp_ice (:,:)
-         emp_oce (:,:)   = zemp_oce (:,:)     
+         emp_oce (:,:)   = zemp_oce (:,:)
          sprecip (:,:)   = zsprecip (:,:)
          tprecip (:,:)   = ztprecip (:,:)
@@ -1896,5 +1898,5 @@
       IF( iom_use('snowpre') )       CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow
       IF( iom_use('precip') )        CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation
-      IF( iom_use('rain') )          CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation 
+      IF( iom_use('rain') )          CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation
       IF( iom_use('snow_ao_cea') )   CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average)
       IF( iom_use('snow_ai_cea') )   CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average)
@@ -1912,5 +1914,5 @@
          ! For Met Office sea ice non-solar fluxes are already delt with by JULES so setting to zero
          ! here so the only flux is the ocean only one.
-         zqns_ice(:,:,:) = 0._wp 
+         zqns_ice(:,:,:) = 0._wp
       CASE( 'conservative' )     ! the required fields are directly provided
          zqns_tot(:,:) = frcv(jpr_qnsmix)%z3(:,:,1)
@@ -1926,5 +1928,5 @@
          IF( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN
             DO jl=1,jpl
-               zqns_tot(:,:   ) = zqns_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qnsice)%z3(:,:,jl)   
+               zqns_tot(:,:   ) = zqns_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qnsice)%z3(:,:,jl)
                zqns_ice(:,:,jl) = frcv(jpr_qnsice)%z3(:,:,jl)
             ENDDO
@@ -1952,5 +1954,5 @@
          ENDIF
       END SELECT
-      !                                     
+      !
       ! --- calving (removed from qns_tot) --- !
       IF( srcv(jpr_cal)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) * rLfus  ! remove latent heat of calving
@@ -1959,5 +1961,5 @@
       IF( srcv(jpr_icb)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_icb)%z3(:,:,1) * rLfus  ! remove latent heat of iceberg melting
 
-#if defined key_si3      
+#if defined key_si3
       ! --- non solar flux over ocean --- !
       !         note: ziceld cannot be = 0 since we limit the ice concentration to amax
@@ -1970,5 +1972,5 @@
       ENDWHERE
       ! Heat content per unit mass of rain (J/kg)
-      zcptrain(:,:) = rcp * ( SUM( (tn_ice(:,:,:) - rt0) * a_i(:,:,:), dim=3 ) + sst_m(:,:) * ziceld(:,:) ) 
+      zcptrain(:,:) = rcp * ( SUM( (tn_ice(:,:,:) - rt0) * a_i(:,:,:), dim=3 ) + sst_m(:,:) * ziceld(:,:) )
 
       ! --- enthalpy of snow precip over ice in J/m3 (to be used in 1D-thermo) --- !
@@ -1987,9 +1989,9 @@
 !!    zqemp_ice(:,:) = -   frcv(jpr_ievp)%z3(:,:,1)        * picefr(:,:)      *   zcptsnw (:,:)   &        ! ice evap
 !!       &             +   zsprecip(:,:)                   * zsnw             * zqprec_ice(:,:) * r1_rhos  ! solid precip over ice
-      
+
       ! --- total non solar flux (including evap/precip) --- !
       zqns_tot(:,:) = zqns_tot(:,:) + zqemp_ice(:,:) + zqemp_oce(:,:)
 
-      ! --- in case both coupled/forced are active, we must mix values --- ! 
+      ! --- in case both coupled/forced are active, we must mix values --- !
       IF( ln_mixcpl ) THEN
          qns_tot(:,:) = qns_tot(:,:) * xcplmask(:,:,0) + zqns_tot(:,:)* zmsk(:,:)
@@ -2015,10 +2017,10 @@
       zcptsnw (:,:) = zcptn(:,:)
       zcptrain(:,:) = zcptn(:,:)
-      
+
       ! clem: this formulation is certainly wrong... but better than it was...
       zqns_tot(:,:) = zqns_tot(:,:)                             &          ! zqns_tot update over free ocean with:
          &          - (  ziceld(:,:) * zsprecip(:,:) * rLfus )  &          ! remove the latent heat flux of solid precip. melting
          &          - (  zemp_tot(:,:)                          &          ! remove the heat content of mass flux (assumed to be at SST)
-         &             - zemp_ice(:,:) ) * zcptn(:,:) 
+         &             - zemp_ice(:,:) ) * zcptn(:,:)
 
      IF( ln_mixcpl ) THEN
@@ -2045,5 +2047,5 @@
       IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) &
            &                                                              * ( 1._wp - zsnw(:,:) )                  )               ! heat flux from snow (over ocean)
-      IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) & 
+      IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea', sprecip(:,:) * ( zcptsnw(:,:) - rLfus ) &
            &                                                              *           zsnw(:,:)                    )               ! heat flux from snow (over ice)
       ! note: hflx for runoff and iceshelf are done in sbcrnf and sbcisf resp.
@@ -2071,5 +2073,5 @@
          IF( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN
             DO jl = 1, jpl
-               zqsr_tot(:,:   ) = zqsr_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qsrice)%z3(:,:,jl)   
+               zqsr_tot(:,:   ) = zqsr_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qsrice)%z3(:,:,jl)
                zqsr_ice(:,:,jl) = frcv(jpr_qsrice)%z3(:,:,jl)
             END DO
@@ -2098,5 +2100,5 @@
             END DO
          ENDIF
-      CASE( 'none'      )       ! Not available as for now: needs additional coding  
+      CASE( 'none'      )       ! Not available as for now: needs additional coding
       !                         ! since fields received, here zqsr_tot,  are not defined with none option
          CALL ctl_stop( 'STOP', 'sbccpl/sbc_cpl_ice_flx: some fields are not defined. Change sn_rcv_qsr value in namelist namsbc_cpl' )
@@ -2142,8 +2144,8 @@
             ENDDO
          ENDIF
-      CASE( 'none' ) 
+      CASE( 'none' )
          zdqns_ice(:,:,:) = 0._wp
       END SELECT
-      
+
       IF( ln_mixcpl ) THEN
          DO jl=1,jpl
@@ -2154,5 +2156,5 @@
       ENDIF
 
-#if defined key_si3      
+#if defined key_si3
       !                                                      ! ========================= !
       SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) )             !  ice topmelt and botmelt  !
@@ -2186,10 +2188,10 @@
             ztri(:,:) = 0.18 * ( 1.0 - cloud_fra(:,:) ) + 0.35 * cloud_fra(:,:)  ! surface transmission when hi>10cm
             DO jl = 1, jpl
-               WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )       ! linear decrease from hi=0 to 10cm  
+               WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )       ! linear decrease from hi=0 to 10cm
                   zqtr_ice_top(:,:,jl) = zqsr_ice(:,:,jl) * ( ztri(:,:) + ( 1._wp - ztri(:,:) ) * ( 1._wp - phi(:,:,jl) * 10._wp ) )
                ELSEWHERE( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) >= 0.1_wp )       ! constant (ztri) when hi>10cm
                   zqtr_ice_top(:,:,jl) = zqsr_ice(:,:,jl) * ztri(:,:)
                ELSEWHERE                                                           ! zero when hs>0
-                  zqtr_ice_top(:,:,jl) = 0._wp 
+                  zqtr_ice_top(:,:,jl) = 0._wp
                END WHERE
             ENDDO
@@ -2200,5 +2202,5 @@
             zqtr_ice_top(:,:,:) = 0.3_wp * zqsr_ice(:,:,:)
          ENDIF
-         !     
+         !
       ELSEIF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN      !==  conduction flux as surface forcing  ==!
          !
@@ -2220,6 +2222,6 @@
       !                                                      ! ================== !
       ! needed by Met Office
-      IF( srcv(jpr_ts_ice)%laction ) THEN 
-         WHERE    ( frcv(jpr_ts_ice)%z3(:,:,:) > 0.0  )   ;   ztsu(:,:,:) =   0. + rt0 
+      IF( srcv(jpr_ts_ice)%laction ) THEN
+         WHERE    ( frcv(jpr_ts_ice)%z3(:,:,:) > 0.0  )   ;   ztsu(:,:,:) =   0. + rt0
          ELSEWHERE( frcv(jpr_ts_ice)%z3(:,:,:) < -60. )   ;   ztsu(:,:,:) = -60. + rt0
          ELSEWHERE                                        ;   ztsu(:,:,:) = frcv(jpr_ts_ice)%z3(:,:,:) + rt0
@@ -2239,6 +2241,6 @@
       !
    END SUBROUTINE sbc_cpl_ice_flx
-   
-   
+
+
    SUBROUTINE sbc_cpl_snd( kt, Kbb, Kmm )
       !!----------------------------------------------------------------------
@@ -2257,5 +2259,5 @@
       REAL(wp) ::   zumax, zvmax
       REAL(wp), DIMENSION(jpi,jpj)     ::   zfr_l, ztmp1, ztmp2, zotx1, zoty1, zotz1, zitx1, zity1, zitz1
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztmp3, ztmp4   
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztmp3, ztmp4
       !!----------------------------------------------------------------------
       !
@@ -2268,9 +2270,9 @@
       !                                                      ! ------------------------- !
       IF( ssnd(jps_toce)%laction .OR. ssnd(jps_tice)%laction .OR. ssnd(jps_tmix)%laction ) THEN
-         
+
          IF( nn_components == jp_iam_opa ) THEN
             ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)   ! send temperature as it is (potential or conservative) -> use of l_useCT on the received part
          ELSE
-            ! we must send the surface potential temperature 
+            ! we must send the surface potential temperature
             IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( ts(:,:,1,jp_tem,Kmm), ts(:,:,1,jp_sal,Kmm) )
             ELSE                   ;   ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)
@@ -2281,5 +2283,5 @@
             CASE( 'oce and ice'          )   ;   ztmp1(:,:) =   ztmp1(:,:) + rt0
                SELECT CASE( sn_snd_temp%clcat )
-               CASE( 'yes' )   
+               CASE( 'yes' )
                   ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl)
                CASE( 'no' )
@@ -2291,7 +2293,7 @@
                CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' )
                END SELECT
-            CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:)   
+            CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:)
                SELECT CASE( sn_snd_temp%clcat )
-               CASE( 'yes' )   
+               CASE( 'yes' )
                   ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl)
                CASE( 'no' )
@@ -2302,17 +2304,17 @@
                CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' )
                END SELECT
-            CASE( 'oce and weighted ice')    ;   ztmp1(:,:) =   ts(:,:,1,jp_tem,Kmm) + rt0  
-               SELECT CASE( sn_snd_temp%clcat ) 
-               CASE( 'yes' )    
-                  ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
-               CASE( 'no' ) 
-                  ztmp3(:,:,:) = 0.0 
-                  DO jl=1,jpl 
-                     ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl) 
-                  ENDDO 
-               CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 
-               END SELECT 
-            CASE( 'mixed oce-ice'        )   
-               ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:) 
+            CASE( 'oce and weighted ice')    ;   ztmp1(:,:) =   ts(:,:,1,jp_tem,Kmm) + rt0
+               SELECT CASE( sn_snd_temp%clcat )
+               CASE( 'yes' )
+                  ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl)
+               CASE( 'no' )
+                  ztmp3(:,:,:) = 0.0
+                  DO jl=1,jpl
+                     ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl)
+                  ENDDO
+               CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' )
+               END SELECT
+            CASE( 'mixed oce-ice'        )
+               ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:)
                DO jl=1,jpl
                   ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl)
@@ -2334,5 +2336,5 @@
          SELECT CASE( sn_snd_ttilyr%cldes)
          CASE ('weighted ice')
-            ztmp3(:,:,1:jpl) = t1_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
+            ztmp3(:,:,1:jpl) = t1_ice(:,:,1:jpl) * a_i(:,:,1:jpl)
          CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_ttilyr%cldes' )
          END SELECT
@@ -2343,9 +2345,9 @@
       !                                                      !           Albedo          !
       !                                                      ! ------------------------- !
-      IF( ssnd(jps_albice)%laction ) THEN                         ! ice 
+      IF( ssnd(jps_albice)%laction ) THEN                         ! ice
           SELECT CASE( sn_snd_alb%cldes )
           CASE( 'ice' )
              SELECT CASE( sn_snd_alb%clcat )
-             CASE( 'yes' )   
+             CASE( 'yes' )
                 ztmp3(:,:,1:jpl) = alb_ice(:,:,1:jpl)
              CASE( 'no' )
@@ -2359,5 +2361,5 @@
           CASE( 'weighted ice' )   ;
              SELECT CASE( sn_snd_alb%clcat )
-             CASE( 'yes' )   
+             CASE( 'yes' )
                 ztmp3(:,:,1:jpl) =  alb_ice(:,:,1:jpl) * a_i(:,:,1:jpl)
              CASE( 'no' )
@@ -2373,8 +2375,8 @@
 
          SELECT CASE( sn_snd_alb%clcat )
-            CASE( 'yes' )   
+            CASE( 'yes' )
                CALL cpl_snd( jps_albice, isec, ztmp3, info )      !-> MV this has never been checked in coupled mode
-            CASE( 'no'  )   
-               CALL cpl_snd( jps_albice, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
+            CASE( 'no'  )
+               CALL cpl_snd( jps_albice, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info )
          END SELECT
       ENDIF
@@ -2388,5 +2390,5 @@
       ENDIF
       !                                                      ! ------------------------- !
-      !                                                      !  Ice fraction & Thickness ! 
+      !                                                      !  Ice fraction & Thickness !
       !                                                      ! ------------------------- !
       ! Send ice fraction field to atmosphere
@@ -2401,10 +2403,10 @@
 
 #if defined key_si3 || defined key_cice
-      ! If this coupling was successful then save ice fraction for use between coupling points. 
-      ! This is needed for some calculations where the ice fraction at the last coupling point 
-      ! is needed. 
-      IF(  info == OASIS_Sent    .OR. info == OASIS_ToRest .OR. & 
-         & info == OASIS_SentOut .OR. info == OASIS_ToRestOut ) THEN 
-         IF ( sn_snd_thick%clcat == 'yes' ) THEN 
+      ! If this coupling was successful then save ice fraction for use between coupling points.
+      ! This is needed for some calculations where the ice fraction at the last coupling point
+      ! is needed.
+      IF(  info == OASIS_Sent    .OR. info == OASIS_ToRest .OR. &
+         & info == OASIS_SentOut .OR. info == OASIS_ToRestOut ) THEN
+         IF ( sn_snd_thick%clcat == 'yes' ) THEN
            a_i_last_couple(:,:,1:jpl) = a_i(:,:,1:jpl)
          ENDIF
@@ -2420,5 +2422,5 @@
          CALL cpl_snd( jps_fice1, isec, ztmp3, info )
       ENDIF
-      
+
       ! Send ice fraction field to OPA (sent by SAS in SAS-OPA coupling)
       IF( ssnd(jps_fice2)%laction ) THEN
@@ -2427,11 +2429,11 @@
       ENDIF
 
-      ! Send ice and snow thickness field 
-      IF( ssnd(jps_hice)%laction .OR. ssnd(jps_hsnw)%laction ) THEN 
+      ! Send ice and snow thickness field
+      IF( ssnd(jps_hice)%laction .OR. ssnd(jps_hsnw)%laction ) THEN
          SELECT CASE( sn_snd_thick%cldes)
          CASE( 'none'                  )       ! nothing to do
-         CASE( 'weighted ice and snow' )   
+         CASE( 'weighted ice and snow' )
             SELECT CASE( sn_snd_thick%clcat )
-            CASE( 'yes' )   
+            CASE( 'yes' )
                ztmp3(:,:,1:jpl) =  h_i(:,:,1:jpl) * a_i(:,:,1:jpl)
                ztmp4(:,:,1:jpl) =  h_s(:,:,1:jpl) * a_i(:,:,1:jpl)
@@ -2444,5 +2446,5 @@
             CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' )
             END SELECT
-         CASE( 'ice and snow'         )   
+         CASE( 'ice and snow'         )
             SELECT CASE( sn_snd_thick%clcat )
             CASE( 'yes' )
@@ -2467,58 +2469,58 @@
 #if defined key_si3
       !                                                      ! ------------------------- !
-      !                                                      !      Ice melt ponds       ! 
-      !                                                      ! ------------------------- !
-      ! needed by Met Office: 1) fraction of ponded ice 2) local/actual pond depth 
-      IF( ssnd(jps_a_p)%laction .OR. ssnd(jps_ht_p)%laction ) THEN 
-         SELECT CASE( sn_snd_mpnd%cldes)  
-         CASE( 'ice only' )  
-            SELECT CASE( sn_snd_mpnd%clcat )  
-            CASE( 'yes' )  
+      !                                                      !      Ice melt ponds       !
+      !                                                      ! ------------------------- !
+      ! needed by Met Office: 1) fraction of ponded ice 2) local/actual pond depth
+      IF( ssnd(jps_a_p)%laction .OR. ssnd(jps_ht_p)%laction ) THEN
+         SELECT CASE( sn_snd_mpnd%cldes)
+         CASE( 'ice only' )
+            SELECT CASE( sn_snd_mpnd%clcat )
+            CASE( 'yes' )
                ztmp3(:,:,1:jpl) =  a_ip_eff(:,:,1:jpl)
-               ztmp4(:,:,1:jpl) =  h_ip(:,:,1:jpl)  
-            CASE( 'no' )  
-               ztmp3(:,:,:) = 0.0  
-               ztmp4(:,:,:) = 0.0  
-               DO jl=1,jpl  
+               ztmp4(:,:,1:jpl) =  h_ip(:,:,1:jpl)
+            CASE( 'no' )
+               ztmp3(:,:,:) = 0.0
+               ztmp4(:,:,:) = 0.0
+               DO jl=1,jpl
                  ztmp3(:,:,1) = ztmp3(:,:,1) + a_ip_frac(:,:,jpl)
                  ztmp4(:,:,1) = ztmp4(:,:,1) + h_ip(:,:,jpl)
-               ENDDO  
-            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%clcat' )  
-            END SELECT  
-         CASE default      ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%cldes' )     
-         END SELECT  
-         IF( ssnd(jps_a_p)%laction  )   CALL cpl_snd( jps_a_p , isec, ztmp3, info )     
-         IF( ssnd(jps_ht_p)%laction )   CALL cpl_snd( jps_ht_p, isec, ztmp4, info )     
-      ENDIF 
-      ! 
-      !                                                      ! ------------------------- !
-      !                                                      !     Ice conductivity      ! 
+               ENDDO
+            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%clcat' )
+            END SELECT
+         CASE default      ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%cldes' )
+         END SELECT
+         IF( ssnd(jps_a_p)%laction  )   CALL cpl_snd( jps_a_p , isec, ztmp3, info )
+         IF( ssnd(jps_ht_p)%laction )   CALL cpl_snd( jps_ht_p, isec, ztmp4, info )
+      ENDIF
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !     Ice conductivity      !
       !                                                      ! ------------------------- !
       ! needed by Met Office
-      IF( ssnd(jps_kice)%laction ) THEN 
-         SELECT CASE( sn_snd_cond%cldes) 
-         CASE( 'weighted ice' )    
-            SELECT CASE( sn_snd_cond%clcat ) 
-            CASE( 'yes' )    
-	       ztmp3(:,:,1:jpl) =  cnd_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
-            CASE( 'no' ) 
-               ztmp3(:,:,:) = 0.0 
-               DO jl=1,jpl 
-                 ztmp3(:,:,1) = ztmp3(:,:,1) + cnd_ice(:,:,jl) * a_i(:,:,jl) 
-               ENDDO 
-            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_cond%clcat' ) 
-            END SELECT 
-         CASE( 'ice only' )    
-           ztmp3(:,:,1:jpl) = cnd_ice(:,:,1:jpl) 
-         CASE default      ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_cond%cldes' )     
-         END SELECT 
-         IF( ssnd(jps_kice)%laction )   CALL cpl_snd( jps_kice, isec, ztmp3, info ) 
-      ENDIF 
+      IF( ssnd(jps_kice)%laction ) THEN
+         SELECT CASE( sn_snd_cond%cldes)
+         CASE( 'weighted ice' )
+            SELECT CASE( sn_snd_cond%clcat )
+            CASE( 'yes' )
+	       ztmp3(:,:,1:jpl) =  cnd_ice(:,:,1:jpl) * a_i(:,:,1:jpl)
+            CASE( 'no' )
+               ztmp3(:,:,:) = 0.0
+               DO jl=1,jpl
+                 ztmp3(:,:,1) = ztmp3(:,:,1) + cnd_ice(:,:,jl) * a_i(:,:,jl)
+               ENDDO
+            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_cond%clcat' )
+            END SELECT
+         CASE( 'ice only' )
+           ztmp3(:,:,1:jpl) = cnd_ice(:,:,1:jpl)
+         CASE default      ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_cond%cldes' )
+         END SELECT
+         IF( ssnd(jps_kice)%laction )   CALL cpl_snd( jps_kice, isec, ztmp3, info )
+      ENDIF
 #endif
 
       !                                                      ! ------------------------- !
-      !                                                      !  CO2 flux from PISCES     ! 
-      !                                                      ! ------------------------- !
-      IF( ssnd(jps_co2)%laction .AND. l_co2cpl )   THEN 
+      !                                                      !  CO2 flux from PISCES     !
+      !                                                      ! ------------------------- !
+      IF( ssnd(jps_co2)%laction .AND. l_co2cpl )   THEN
          ztmp1(:,:) = oce_co2(:,:) * 1000.  ! conversion in molC/m2/s
          CALL cpl_snd( jps_co2, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ) , info )
@@ -2528,5 +2530,5 @@
       IF( ssnd(jps_ocx1)%laction ) THEN                      !      Surface current      !
          !                                                   ! ------------------------- !
-         !    
+         !
          !                                                  j+1   j     -----V---F
          ! surface velocity always sent from T point                     !       |
@@ -2538,16 +2540,16 @@
          !                                                               i      i+1 (for I)
          IF( nn_components == jp_iam_opa ) THEN
-            zotx1(:,:) = uu(:,:,1,Kmm)  
-            zoty1(:,:) = vv(:,:,1,Kmm)  
-         ELSE        
+            zotx1(:,:) = uu(:,:,1,Kmm)
+            zoty1(:,:) = vv(:,:,1,Kmm)
+         ELSE
             SELECT CASE( TRIM( sn_snd_crt%cldes ) )
             CASE( 'oce only'             )      ! C-grid ==> T
                DO_2D( 0, 0, 0, 0 )
                   zotx1(ji,jj) = 0.5 * ( uu(ji,jj,1,Kmm) + uu(ji-1,jj  ,1,Kmm) )
-                  zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji  ,jj-1,1,Kmm) ) 
+                  zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji  ,jj-1,1,Kmm) )
                END_2D
-            CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T  
+            CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T
                DO_2D( 0, 0, 0, 0 )
-                  zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)  
+                  zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)
                   zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)
                   zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  )     + u_ice(ji-1,jj    )     ) *  fr_i(ji,jj)
@@ -2570,12 +2572,12 @@
          IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components
             !                                                                     ! Ocean component
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component 
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component 
-            zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components 
+            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component
+            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component
+            zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components
             zoty1(:,:) = ztmp2(:,:)
             IF( ssnd(jps_ivx1)%laction ) THEN                                     ! Ice component
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component 
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component 
-               zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components 
+               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component
+               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component
+               zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components
                zity1(:,:) = ztmp2(:,:)
             ENDIF
@@ -2602,95 +2604,95 @@
          IF( ssnd(jps_ivy1)%laction )   CALL cpl_snd( jps_ivy1, isec, RESHAPE ( zity1, (/jpi,jpj,1/) ), info )   ! ice   y current 1st grid
          IF( ssnd(jps_ivz1)%laction )   CALL cpl_snd( jps_ivz1, isec, RESHAPE ( zitz1, (/jpi,jpj,1/) ), info )   ! ice   z current 1st grid
-         ! 
-      ENDIF
-      !
-      !                                                      ! ------------------------- ! 
-      !                                                      !  Surface current to waves ! 
-      !                                                      ! ------------------------- ! 
-      IF( ssnd(jps_ocxw)%laction .OR. ssnd(jps_ocyw)%laction ) THEN 
-          !     
-          !                                                  j+1  j     -----V---F 
-          ! surface velocity always sent from T point                    !       | 
-          !                                                       j      |   T   U 
-          !                                                              |       | 
-          !                                                   j   j-1   -I-------| 
-          !                                               (for I)        |       | 
-          !                                                             i-1  i   i 
-          !                                                              i      i+1 (for I) 
-          SELECT CASE( TRIM( sn_snd_crtw%cldes ) ) 
-          CASE( 'oce only'             )      ! C-grid ==> T 
+         !
+      ENDIF
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !  Surface current to waves !
+      !                                                      ! ------------------------- !
+      IF( ssnd(jps_ocxw)%laction .OR. ssnd(jps_ocyw)%laction ) THEN
+          !
+          !                                                  j+1  j     -----V---F
+          ! surface velocity always sent from T point                    !       |
+          !                                                       j      |   T   U
+          !                                                              |       |
+          !                                                   j   j-1   -I-------|
+          !                                               (for I)        |       |
+          !                                                             i-1  i   i
+          !                                                              i      i+1 (for I)
+          SELECT CASE( TRIM( sn_snd_crtw%cldes ) )
+          CASE( 'oce only'             )      ! C-grid ==> T
              DO_2D( 0, 0, 0, 0 )
-                zotx1(ji,jj) = 0.5 * ( uu(ji,jj,1,Kmm) + uu(ji-1,jj  ,1,Kmm) ) 
-                zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji , jj-1,1,Kmm) )  
+                zotx1(ji,jj) = 0.5 * ( uu(ji,jj,1,Kmm) + uu(ji-1,jj  ,1,Kmm) )
+                zoty1(ji,jj) = 0.5 * ( vv(ji,jj,1,Kmm) + vv(ji , jj-1,1,Kmm) )
              END_2D
-          CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T   
+          CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T
              DO_2D( 0, 0, 0, 0 )
-                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   
-                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj) 
-                zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj) 
-                zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj) 
+                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)
+                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)
+                zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)
+                zity1(ji,jj) = 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)
              END_2D
-             CALL lbc_lnk_multi( 'sbccpl', zitx1, 'T', -1.0_wp,  zity1, 'T', -1.0_wp ) 
-          CASE( 'mixed oce-ice'        )      ! Ocean and Ice on C-grid ==> T  
+             CALL lbc_lnk_multi( 'sbccpl', zitx1, 'T', -1.0_wp,  zity1, 'T', -1.0_wp )
+          CASE( 'mixed oce-ice'        )      ! Ocean and Ice on C-grid ==> T
              DO_2D( 0, 0, 0, 0 )
-                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   & 
-                   &         + 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj) 
-                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)   & 
-                   &         + 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj) 
+                zotx1(ji,jj) = 0.5 * ( uu   (ji,jj,1,Kmm) + uu   (ji-1,jj  ,1,Kmm) ) * zfr_l(ji,jj)   &
+                   &         + 0.5 * ( u_ice(ji,jj  ) + u_ice(ji-1,jj    ) ) *  fr_i(ji,jj)
+                zoty1(ji,jj) = 0.5 * ( vv   (ji,jj,1,Kmm) + vv   (ji  ,jj-1,1,Kmm) ) * zfr_l(ji,jj)   &
+                   &         + 0.5 * ( v_ice(ji,jj  ) + v_ice(ji  ,jj-1  ) ) *  fr_i(ji,jj)
              END_2D
           END SELECT
-         CALL lbc_lnk_multi( 'sbccpl', zotx1, ssnd(jps_ocxw)%clgrid, -1.0_wp, zoty1, ssnd(jps_ocyw)%clgrid, -1.0_wp ) 
-         ! 
-         ! 
-         IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components 
-         !                                                                        ! Ocean component 
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->e', ztmp1 )       ! 1st component  
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->n', ztmp2 )       ! 2nd component  
-            zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components  
-            zoty1(:,:) = ztmp2(:,:)  
-            IF( ssnd(jps_ivx1)%laction ) THEN                                     ! Ice component 
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component  
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component  
-               zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components  
-               zity1(:,:) = ztmp2(:,:) 
-            ENDIF 
-         ENDIF 
-         ! 
-!         ! spherical coordinates to cartesian -> 2 components to 3 components 
-!         IF( TRIM( sn_snd_crtw%clvref ) == 'cartesian' ) THEN 
-!            ztmp1(:,:) = zotx1(:,:)                     ! ocean currents 
-!            ztmp2(:,:) = zoty1(:,:) 
-!            CALL oce2geo ( ztmp1, ztmp2, 'T', zotx1, zoty1, zotz1 ) 
-!            ! 
-!            IF( ssnd(jps_ivx1)%laction ) THEN           ! ice velocities 
-!               ztmp1(:,:) = zitx1(:,:) 
-!               ztmp1(:,:) = zity1(:,:) 
-!               CALL oce2geo ( ztmp1, ztmp2, 'T', zitx1, zity1, zitz1 ) 
-!            ENDIF 
-!         ENDIF 
-         ! 
-         IF( ssnd(jps_ocxw)%laction )   CALL cpl_snd( jps_ocxw, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info )   ! ocean x current 1st grid 
-         IF( ssnd(jps_ocyw)%laction )   CALL cpl_snd( jps_ocyw, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info )   ! ocean y current 1st grid 
-         !  
-      ENDIF 
-      ! 
-      IF( ssnd(jps_ficet)%laction ) THEN 
-         CALL cpl_snd( jps_ficet, isec, RESHAPE ( fr_i, (/jpi,jpj,1/) ), info ) 
-      ENDIF 
-      !                                                      ! ------------------------- ! 
-      !                                                      !   Water levels to waves   ! 
-      !                                                      ! ------------------------- ! 
-      IF( ssnd(jps_wlev)%laction ) THEN 
-         IF( ln_apr_dyn ) THEN  
-            IF( kt /= nit000 ) THEN  
-               ztmp1(:,:) = ssh(:,:,Kbb) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )  
-            ELSE  
-               ztmp1(:,:) = ssh(:,:,Kbb)  
-            ENDIF  
-         ELSE  
-            ztmp1(:,:) = ssh(:,:,Kmm)  
-         ENDIF  
-         CALL cpl_snd( jps_wlev  , isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
-      ENDIF 
+         CALL lbc_lnk_multi( 'sbccpl', zotx1, ssnd(jps_ocxw)%clgrid, -1.0_wp, zoty1, ssnd(jps_ocyw)%clgrid, -1.0_wp )
+         !
+         !
+         IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components
+         !                                                                        ! Ocean component
+            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->e', ztmp1 )       ! 1st component
+            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->n', ztmp2 )       ! 2nd component
+            zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components
+            zoty1(:,:) = ztmp2(:,:)
+            IF( ssnd(jps_ivx1)%laction ) THEN                                     ! Ice component
+               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component
+               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component
+               zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components
+               zity1(:,:) = ztmp2(:,:)
+            ENDIF
+         ENDIF
+         !
+!         ! spherical coordinates to cartesian -> 2 components to 3 components
+!         IF( TRIM( sn_snd_crtw%clvref ) == 'cartesian' ) THEN
+!            ztmp1(:,:) = zotx1(:,:)                     ! ocean currents
+!            ztmp2(:,:) = zoty1(:,:)
+!            CALL oce2geo ( ztmp1, ztmp2, 'T', zotx1, zoty1, zotz1 )
+!            !
+!            IF( ssnd(jps_ivx1)%laction ) THEN           ! ice velocities
+!               ztmp1(:,:) = zitx1(:,:)
+!               ztmp1(:,:) = zity1(:,:)
+!               CALL oce2geo ( ztmp1, ztmp2, 'T', zitx1, zity1, zitz1 )
+!            ENDIF
+!         ENDIF
+         !
+         IF( ssnd(jps_ocxw)%laction )   CALL cpl_snd( jps_ocxw, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info )   ! ocean x current 1st grid
+         IF( ssnd(jps_ocyw)%laction )   CALL cpl_snd( jps_ocyw, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info )   ! ocean y current 1st grid
+         !
+      ENDIF
+      !
+      IF( ssnd(jps_ficet)%laction ) THEN
+         CALL cpl_snd( jps_ficet, isec, RESHAPE ( fr_i, (/jpi,jpj,1/) ), info )
+      ENDIF
+      !                                                      ! ------------------------- !
+      !                                                      !   Water levels to waves   !
+      !                                                      ! ------------------------- !
+      IF( ssnd(jps_wlev)%laction ) THEN
+         IF( ln_apr_dyn ) THEN
+            IF( kt /= nit000 ) THEN
+               ztmp1(:,:) = ssh(:,:,Kbb) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )
+            ELSE
+               ztmp1(:,:) = ssh(:,:,Kbb)
+            ENDIF
+         ELSE
+            ztmp1(:,:) = ssh(:,:,Kmm)
+         ENDIF
+         CALL cpl_snd( jps_wlev  , isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info )
+      ENDIF
       !
       !  Fields sent by OPA to SAS when doing OPA<->SAS coupling
@@ -2709,5 +2711,5 @@
          CALL cpl_snd( jps_soce  , isec, RESHAPE ( ts(:,:,1,jp_sal,Kmm), (/jpi,jpj,1/) ), info )
       ENDIF
-      !                                                        ! first T level thickness 
+      !                                                        ! first T level thickness
       IF( ssnd(jps_e3t1st )%laction )  THEN
          CALL cpl_snd( jps_e3t1st, isec, RESHAPE ( e3t(:,:,1,Kmm)   , (/jpi,jpj,1/) ), info )
@@ -2731,5 +2733,5 @@
 #if defined key_si3
       !                                                      ! ------------------------- !
-      !                                                      ! Sea surface freezing temp ! 
+      !                                                      ! Sea surface freezing temp !
       !                                                      ! ------------------------- !
       ! needed by Met Office
@@ -2740,5 +2742,5 @@
       !
    END SUBROUTINE sbc_cpl_snd
-   
+
    !!======================================================================
 END MODULE sbccpl
Index: /NEMO/trunk/src/OCE/SBC/sbcflx.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcflx.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcflx.F90	(revision 14072)
@@ -35,5 +35,5 @@
    INTEGER , PARAMETER ::   jp_emp  = 5   ! index of evaporation-precipation file
  !!INTEGER , PARAMETER ::   jp_sfx  = 6   ! index of salt flux flux
-   INTEGER , PARAMETER ::   jpfld   = 5 !! 6 ! maximum number of files to read 
+   INTEGER , PARAMETER ::   jpfld   = 5 !! 6 ! maximum number of files to read
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read)
 
@@ -50,7 +50,7 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE sbc_flx  ***
-      !!                   
+      !!
       !! ** Purpose :   provide at each time step the surface ocean fluxes
-      !!                (momentum, heat, freshwater and runoff) 
+      !!                (momentum, heat, freshwater and runoff)
       !!
       !! ** Method  : - READ each fluxes in NetCDF files:
@@ -91,5 +91,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN                ! First call kt=nit000  
+      IF( kt == nit000 ) THEN                ! First call kt=nit000
          ! set file information
          READ  ( numnam_ref, namsbc_flx, IOSTAT = ios, ERR = 901)
@@ -98,18 +98,18 @@
          READ  ( numnam_cfg, namsbc_flx, IOSTAT = ios, ERR = 902 )
 902      IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_flx in configuration namelist' )
-         IF(lwm) WRITE ( numond, namsbc_flx ) 
+         IF(lwm) WRITE ( numond, namsbc_flx )
          !
          !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing?
          IF( ln_dm2dc .AND. sn_qsr%freqh /= 24. )   &
-            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) 
+            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' )
          !
          !                                         ! store namelist information in an array
          slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau
-         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr 
+         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr
          slf_i(jp_emp ) = sn_emp !! ;   slf_i(jp_sfx ) = sn_sfx
          !
          ALLOCATE( sf(jpfld), STAT=ierror )        ! set sf structure
-         IF( ierror > 0 ) THEN   
-            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN  
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN
          ENDIF
          DO ji= 1, jpfld
@@ -123,5 +123,5 @@
 
       CALL fld_read( kt, nn_fsbc, sf )                            ! input fields provided at the current time-step
-     
+
       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                        ! update ocean fluxes at each SBC frequency
 
@@ -138,5 +138,5 @@
             qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) ) * tmask(ji,jj,1)
             emp (ji,jj) =   sf(jp_emp )%fnow(ji,jj,1)                              * tmask(ji,jj,1)
-            !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1)                              * tmask(ji,jj,1) 
+            !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1)                              * tmask(ji,jj,1)
          END_2D
          !                                                        ! add to qns the heat due to e-p
@@ -144,10 +144,10 @@
          !!qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp        ! mass flux is at SST
          !
-         ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x) 
+         ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x)
          CALL lbc_lnk_multi( 'sbcflx', utau, 'U', -1._wp, vtau, 'V', -1._wp, &
             &                           qns, 'T',  1._wp, emp , 'T',  1._wp, qsr, 'T', 1._wp ) !! sfx, 'T', 1._wp  )
          !
          IF( nitend-nit000 <= 100 .AND. lwp ) THEN                ! control print (if less than 100 time-step asked)
-            WRITE(numout,*) 
+            WRITE(numout,*)
             WRITE(numout,*) '        read daily momentum, heat and freshwater fluxes OK'
             DO jf = 1, jpfld
@@ -155,5 +155,5 @@
                IF( jf == jp_qtot .OR. jf == jp_qsr  )   zfact =     0.1
                IF( jf == jp_emp                     )   zfact = 86400.
-               WRITE(numout,*) 
+               WRITE(numout,*)
                WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar), ' * ', zfact
             END DO
@@ -166,5 +166,5 @@
       DO_2D( 0, 0, 0, 0 )
          ztx = ( utau(ji-1,jj  ) + utau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( umask(ji-1,jj  ,1), umask(ji,jj,1) ) )
-         zty = ( vtau(ji  ,jj-1) + vtau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( vmask(ji  ,jj-1,1), vmask(ji,jj,1) ) ) 
+         zty = ( vtau(ji  ,jj-1) + vtau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( vmask(ji  ,jj-1,1), vmask(ji,jj,1) ) )
          zmod = 0.5_wp * SQRT( ztx * ztx + zty * zty ) * tmask(ji,jj,1)
          taum(ji,jj) = zmod
Index: /NEMO/trunk/src/OCE/SBC/sbcmod.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcmod.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcmod.F90	(revision 14072)
@@ -16,5 +16,5 @@
    !!            4.0  ! 2016-06  (L. Brodeau) new general bulk formulation
    !!            4.0  ! 2019-03  (F. Lemarié & G. Samson)  add ABL compatibility (ln_abl=TRUE)
-   !!            4.2  ! 2020-12  (G. Madec, E. Clementi) modified wave forcing and coupling  
+   !!            4.2  ! 2020-12  (G. Madec, E. Clementi) modified wave forcing and coupling
    !!----------------------------------------------------------------------
 
@@ -28,4 +28,5 @@
    USE closea         ! closed seas
    USE phycst         ! physical constants
+   USE sbc_phy, ONLY : pp_cldf
    USE sbc_oce        ! Surface boundary condition: ocean fields
    USE trc_oce        ! shared ocean-passive tracers variables
@@ -46,5 +47,5 @@
    USE sbcssr         ! surface boundary condition: sea surface restoring
    USE sbcrnf         ! surface boundary condition: runoffs
-   USE sbcapr         ! surface boundary condition: atmo pressure 
+   USE sbcapr         ! surface boundary condition: atmo pressure
    USE sbcfwb         ! surface boundary condition: freshwater budget
    USE icbstp         ! Icebergs
@@ -139,5 +140,5 @@
          WRITE(numout,*) '         ocean-atmosphere coupled formulation       ln_cpl        = ', ln_cpl
          WRITE(numout,*) '         mixed forced-coupled     formulation       ln_mixcpl     = ', ln_mixcpl
-!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist 
+!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist
          WRITE(numout,*) '         OASIS coupling (with atm or sas)           lk_oasis      = ', lk_oasis
          WRITE(numout,*) '         components of your executable              nn_components = ', nn_components
@@ -162,5 +163,5 @@
       !                       !**  check option consistency
       !
-      IF(lwp) WRITE(numout,*)       !* Single / Multi - executable (NEMO / OPA+SAS) 
+      IF(lwp) WRITE(numout,*)       !* Single / Multi - executable (NEMO / OPA+SAS)
       SELECT CASE( nn_components )
       CASE( jp_iam_nemo )
@@ -194,5 +195,5 @@
       SELECT CASE( nn_ice )
       CASE( 0 )                        !- no ice in the domain
-      CASE( 1 )                        !- Ice-cover climatology ("Ice-if" model)  
+      CASE( 1 )                        !- Ice-cover climatology ("Ice-if" model)
       CASE( 2 )                        !- SI3  ice model
          IF( .NOT.( ln_blk .OR. ln_cpl .OR. ln_abl .OR. ln_usr ) )   &
@@ -202,5 +203,5 @@
             &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model requires ln_blk or ln_cpl or ln_abl or ln_usr = T' )
          IF( lk_agrif                                )   &
-            &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model not currently available with AGRIF' ) 
+            &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model not currently available with AGRIF' )
       CASE DEFAULT                     !- not supported
       END SELECT
@@ -217,5 +218,5 @@
       !
       IF( sbc_ssr_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_ssr arrays' )
-      IF( .NOT.ln_ssr ) THEN               !* Initialize qrp and erp if no restoring 
+      IF( .NOT.ln_ssr ) THEN               !* Initialize qrp and erp if no restoring
          qrp(:,:) = 0._wp
          erp(:,:) = 0._wp
@@ -306,5 +307,5 @@
          &   CALL ctl_warn( 'sbc_init : diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' )
       !
-   
+
       !                       !**  associated modules : initialization
       !
@@ -378,5 +379,5 @@
       !
       REAL(wp) ::     zthscl        ! wd  tanh scale
-      REAL(wp), DIMENSION(jpi,jpj) ::  zwdht, zwght  ! wd dep over wd limit, wgt  
+      REAL(wp), DIMENSION(jpi,jpj) ::  zwdht, zwght  ! wd dep over wd limit, wgt
 
       !!---------------------------------------------------------------------
@@ -408,9 +409,9 @@
       !
       !                                            !==  sbc formulation  ==!
-      !                                                   
+      !
       !
       SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition
       !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx)
-      CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt, Kbb )                        ! user defined formulation 
+      CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt, Kbb )                        ! user defined formulation
       CASE( jp_flx     )   ;   CALL sbc_flx       ( kt )                             ! flux formulation
       CASE( jp_blk     )
@@ -476,6 +477,6 @@
       IF( ln_icebergs    )   THEN
                                      CALL icb_stp( kt, Kmm )           ! compute icebergs
-         ! Icebergs do not melt over the haloes. 
-         ! So emp values over the haloes are no more consistent with the inner domain values. 
+         ! Icebergs do not melt over the haloes.
+         ! So emp values over the haloes are no more consistent with the inner domain values.
          ! A lbc_lnk is therefore needed to ensure reproducibility and restartability.
          ! see ticket #2113 for discussion about this lbc_lnk.
@@ -491,5 +492,5 @@
       ! Special treatment of freshwater fluxes over closed seas in the model domain
       ! Should not be run if ln_diurnal_only
-      IF( l_sbc_clo      )   CALL sbc_clo( kt )   
+      IF( l_sbc_clo      )   CALL sbc_clo( kt )
 
 !!$!RBbug do not understand why see ticket 667
@@ -497,5 +498,5 @@
 !!$      CALL lbc_lnk( 'sbcmod', emp, 'T', 1.0_wp )
       IF( ll_wd ) THEN     ! If near WAD point limit the flux for now
-         zthscl = atanh(rn_wd_sbcfra)                     ! taper frac default is .999 
+         zthscl = atanh(rn_wd_sbcfra)                     ! taper frac default is .999
          zwdht(:,:) = ssh(:,:,Kmm) + ht_0(:,:) - rn_wdmin1   ! do this calc of water
                                                      ! depth above wd limit once
Index: /NEMO/trunk/src/OCE/SBC/sbcrnf.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcrnf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcrnf.F90	(revision 14072)
@@ -34,5 +34,5 @@
    PUBLIC   sbc_rnf_alloc ! called in sbcmod module
    PUBLIC   sbc_rnf_init  ! called in sbcmod module
-   
+
    !                                                !!* namsbc_rnf namelist *
    CHARACTER(len=100)         ::   cn_dir            !: Root directory for location of rnf files
@@ -58,16 +58,16 @@
    LOGICAL , PUBLIC ::   l_rnfcpl = .false.   !: runoffs recieved from oasis
    INTEGER , PUBLIC ::   nkrnf = 0            !: nb of levels over which Kz is increased at river mouths
-   
+
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rnfmsk              !: river mouth mask (hori.)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   rnfmsk_z            !: river mouth mask (vert.)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   h_rnf               !: depth of runoff in m
    INTEGER,  PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nk_rnf              !: depth of runoff in model levels
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rnf_tsc_b, rnf_tsc  !: before and now T & S runoff contents   [K.m/s & PSU.m/s]   
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rnf_tsc_b, rnf_tsc  !: before and now T & S runoff contents   [K.m/s & PSU.m/s]
 
    TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_rnf       ! structure: river runoff (file information, fields read)
    TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_i_rnf     ! structure: iceberg flux (file information, fields read)
-   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     ! structure: river runoff salinity (file information, fields read)  
-   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)  
- 
+   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     ! structure: river runoff salinity (file information, fields read)
+   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -247,6 +247,6 @@
       INTEGER           ::   ios           ! Local integer output status for namelist read
       INTEGER           ::   nbrec         ! temporary integer
-      REAL(wp)          ::   zacoef  
-      REAL(wp), DIMENSION(jpi,jpj,2) :: zrnfcl    
+      REAL(wp)          ::   zacoef
+      REAL(wp), DIMENSION(jpi,jpj,2) :: zrnfcl
       !!
       NAMELIST/namsbc_rnf/ cn_dir            , ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, ln_rnf_icb,   &
@@ -259,5 +259,5 @@
       IF( sbc_rnf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_rnf_alloc : unable to allocate arrays' )
       !
-      IF( .NOT. ln_rnf ) THEN                      ! no specific treatment in vicinity of river mouths 
+      IF( .NOT. ln_rnf ) THEN                      ! no specific treatment in vicinity of river mouths
          ln_rnf_mouth  = .FALSE.                   ! default definition needed for example by sbc_ssr or by tra_adv_muscl
          nkrnf         = 0
@@ -295,5 +295,5 @@
       !                                   ! ==================
       !
-      IF( .NOT. l_rnfcpl ) THEN                    
+      IF( .NOT. l_rnfcpl ) THEN
          ALLOCATE( sf_rnf(1), STAT=ierror )         ! Create sf_rnf structure (runoff inflow)
          IF(lwp) WRITE(numout,*)
@@ -350,6 +350,6 @@
          IF(lwp) WRITE(numout,*) '   ==>>>   runoffs depth read in a file'
          rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname )
-         IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year 
-            IF( sn_dep_rnf%clftyp == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month 
+         IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year
+            IF( sn_dep_rnf%clftyp == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month
          ENDIF
          CALL iom_open ( rn_dep_file, inum )                             ! open file
Index: /NEMO/trunk/src/OCE/SBC/sbcssm.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcssm.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcssm.F90	(revision 14072)
@@ -10,5 +10,5 @@
 
    !!----------------------------------------------------------------------
-   !!   sbc_ssm       : calculate sea surface mean currents, temperature,  
+   !!   sbc_ssm       : calculate sea surface mean currents, temperature,
    !!                   and salinity over nn_fsbc time-step
    !!----------------------------------------------------------------------
@@ -31,5 +31,5 @@
 
    LOGICAL, SAVE ::   l_ssm_mean = .FALSE.   ! keep track of whether means have been read from restart file
-   
+
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
@@ -43,9 +43,9 @@
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE sbc_oce  ***
-      !!                     
+      !!
       !! ** Purpose :   provide ocean surface variable to sea-surface boundary
-      !!                condition computation 
-      !!                
-      !! ** Method  :   compute mean surface velocity (2 components at U and 
+      !!                condition computation
+      !!
+      !! ** Method  :   compute mean surface velocity (2 components at U and
       !!      V-points) [m/s], temperature [Celsius] and salinity [psu] over
       !!      the periode (kt - nn_fsbc) to kt
@@ -199,5 +199,5 @@
          !
       ELSE
-         !               
+         !
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields'
@@ -221,7 +221,7 @@
             !
             IF( zf_sbc /= REAL( nn_fsbc, wp ) ) THEN      ! nn_fsbc has changed between 2 runs
-               IF(lwp) WRITE(numout,*) '   restart with a change in the frequency of mean from ', zf_sbc, ' to ', nn_fsbc 
-               zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc 
-               ssu_m(:,:) = zcoef * ssu_m(:,:) 
+               IF(lwp) WRITE(numout,*) '   restart with a change in the frequency of mean from ', zf_sbc, ' to ', nn_fsbc
+               zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc
+               ssu_m(:,:) = zcoef * ssu_m(:,:)
                ssv_m(:,:) = zcoef * ssv_m(:,:)
                sst_m(:,:) = zcoef * sst_m(:,:)
@@ -251,5 +251,5 @@
       ENDIF
       !
-      IF( .NOT. ln_traqsr )   fraqsr_1lev(:,:) = 1._wp   ! default definition: qsr 100% in the fisrt level 
+      IF( .NOT. ln_traqsr )   fraqsr_1lev(:,:) = 1._wp   ! default definition: qsr 100% in the fisrt level
       !
    END SUBROUTINE sbc_ssm_init
Index: /NEMO/trunk/src/OCE/SBC/sbcwave.F90
===================================================================
--- /NEMO/trunk/src/OCE/SBC/sbcwave.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/SBC/sbcwave.F90	(revision 14072)
@@ -2,12 +2,12 @@
    !!======================================================================
    !!                       ***  MODULE  sbcwave  ***
-   !! Wave module 
+   !! Wave module
    !!======================================================================
-   !! History :  3.3  !  2011-09  (M. Adani)  Original code: Drag Coefficient 
-   !!         :  3.4  !  2012-10  (M. Adani)  Stokes Drift 
+   !! History :  3.3  !  2011-09  (M. Adani)  Original code: Drag Coefficient
+   !!         :  3.4  !  2012-10  (M. Adani)  Stokes Drift
    !!            3.6  !  2014-09  (E. Clementi,P. Oddo) New Stokes Drift Computation
    !!             -   !  2016-12  (G. Madec, E. Clementi) update Stoke drift computation
    !!                                                    + add sbc_wave_ini routine
-   !!            4.2  !  2020-12  (G. Madec, E. Clementi) updates, new Stoke drift computation 
+   !!            4.2  !  2020-12  (G. Madec, E. Clementi) updates, new Stoke drift computation
    !!                                                    according to Couvelard et al.,2019
    !!----------------------------------------------------------------------
@@ -16,5 +16,5 @@
    !!   sbc_stokes    : calculate 3D Stokes-drift velocities
    !!   sbc_wave      : wave data from wave model: forced (netcdf files) or coupled mode
-   !!   sbc_wave_init : initialisation fo surface waves 
+   !!   sbc_wave_init : initialisation fo surface waves
    !!----------------------------------------------------------------------
    USE phycst         ! physical constants
@@ -36,5 +36,5 @@
    PUBLIC   sbc_wave        ! routine called in sbcmod
    PUBLIC   sbc_wave_init   ! routine called in sbcmod
-   
+
    ! Variables checking if the wave parameters are coupled (if not, they are read from file)
    LOGICAL, PUBLIC ::   cpl_hsig          = .FALSE.
@@ -113,5 +113,5 @@
       INTEGER, INTENT(in) :: Kmm ! ocean time level index
       INTEGER  ::   jj, ji, jk   ! dummy loop argument
-      INTEGER  ::   ik           ! local integer 
+      INTEGER  ::   ik           ! local integer
       REAL(wp) ::  ztransp, zfac, ztemp, zsp0, zsqrt, zbreiv16_w
       REAL(wp) ::  zdep_u, zdep_v, zkh_u, zkh_v, zda_u, zda_v, sdtrp
@@ -143,6 +143,6 @@
             IF( cpl_tusd .AND. cpl_tvsd ) THEN  !stokes transport is provided in coupled mode
                sdtrp      = SQRT( tusd(ji,jj)*tusd(ji,jj) + tvsd(ji,jj)*tvsd(ji,jj) )  !<-- norm of Surface Stokes drift transport
-            ELSE 
-               ! Stokes drift transport estimated from Hs and Tmean 
+            ELSE
+               ! Stokes drift transport estimated from Hs and Tmean
                sdtrp      = 2.0_wp * rpi / 16.0_wp *                             &
                    &        hsw(ji,jj)*hsw(ji,jj) / MAX( wmp(ji,jj), 0.0000001_wp )
@@ -240,5 +240,5 @@
       !                       !==  Horizontal divergence of barotropic Stokes transport  ==!
       div_sd(:,:) = 0._wp
-      DO jk = 1, jpkm1                                 ! 
+      DO jk = 1, jpkm1                                 !
         div_sd(:,:) = div_sd(:,:) + ze3divh(:,:,jk)
       END DO
@@ -300,5 +300,5 @@
       ENDIF
 
-      IF( ln_sdw .AND. .NOT. cpl_sdrftx)  THEN       !==  Computation of the 3d Stokes Drift  ==! 
+      IF( ln_sdw .AND. .NOT. cpl_sdrftx)  THEN       !==  Computation of the 3d Stokes Drift  ==!
          !
          IF( jpfld > 0 ) THEN                            ! Read from file only if the field is not coupled
@@ -329,5 +329,5 @@
       !!              - create the structure used to read required wave fields
       !!                (its size depends on namelist options)
-      !! ** action  
+      !! ** action
       !!---------------------------------------------------------------------
       INTEGER ::   ierror, ios   ! local integer
@@ -487,5 +487,5 @@
                jp_wmp = jpfld
             ENDIF
-            ! 2. Read from file only the non-coupled fields 
+            ! 2. Read from file only the non-coupled fields
             IF( jpfld > 0 ) THEN
                ALLOCATE( slf_i(jpfld) )
Index: /NEMO/trunk/src/OCE/TRA/eosbn2.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/eosbn2.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/eosbn2.F90	(revision 14072)
@@ -31,5 +31,5 @@
    !!   bn2           : compute the Brunt-Vaisala frequency
    !!   eos_pt_from_ct: compute the potential temperature from the Conservative Temperature
-   !!   eos_rab       : generic interface of in situ thermal/haline expansion ratio 
+   !!   eos_rab       : generic interface of in situ thermal/haline expansion ratio
    !!   eos_rab_3d    : compute in situ thermal/haline expansion ratio
    !!   eos_rab_2d    : compute in situ thermal/haline expansion ratio for 2d fields
@@ -46,5 +46,5 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
    USE prtctl         ! Print control
    USE lbclnk         ! ocean lateral boundary conditions
@@ -63,5 +63,5 @@
    END INTERFACE
    !
-   INTERFACE eos_fzp 
+   INTERFACE eos_fzp
       MODULE PROCEDURE eos_fzp_2d, eos_fzp_0d
    END INTERFACE
@@ -89,15 +89,15 @@
 
    !                               !!!  simplified eos coefficients (default value: Vallis 2006)
-   REAL(wp) ::   rn_a0      = 1.6550e-1_wp     ! thermal expansion coeff. 
-   REAL(wp) ::   rn_b0      = 7.6554e-1_wp     ! saline  expansion coeff. 
-   REAL(wp) ::   rn_lambda1 = 5.9520e-2_wp     ! cabbeling coeff. in T^2        
-   REAL(wp) ::   rn_lambda2 = 5.4914e-4_wp     ! cabbeling coeff. in S^2        
-   REAL(wp) ::   rn_mu1     = 1.4970e-4_wp     ! thermobaric coeff. in T  
-   REAL(wp) ::   rn_mu2     = 1.1090e-5_wp     ! thermobaric coeff. in S  
-   REAL(wp) ::   rn_nu      = 2.4341e-3_wp     ! cabbeling coeff. in theta*salt  
-   
+   REAL(wp) ::   rn_a0      = 1.6550e-1_wp     ! thermal expansion coeff.
+   REAL(wp) ::   rn_b0      = 7.6554e-1_wp     ! saline  expansion coeff.
+   REAL(wp) ::   rn_lambda1 = 5.9520e-2_wp     ! cabbeling coeff. in T^2
+   REAL(wp) ::   rn_lambda2 = 5.4914e-4_wp     ! cabbeling coeff. in S^2
+   REAL(wp) ::   rn_mu1     = 1.4970e-4_wp     ! thermobaric coeff. in T
+   REAL(wp) ::   rn_mu2     = 1.1090e-5_wp     ! thermobaric coeff. in S
+   REAL(wp) ::   rn_nu      = 2.4341e-3_wp     ! cabbeling coeff. in theta*salt
+
    ! TEOS10/EOS80 parameters
    REAL(wp) ::   r1_S0, r1_T0, r1_Z0, rdeltaS
-   
+
    ! EOS parameters
    REAL(wp) ::   EOS000 , EOS100 , EOS200 , EOS300 , EOS400 , EOS500 , EOS600
@@ -117,6 +117,6 @@
    REAL(wp) ::   EOS022
    REAL(wp) ::   EOS003 , EOS103
-   REAL(wp) ::   EOS013 
-   
+   REAL(wp) ::   EOS013
+
    ! ALPHA parameters
    REAL(wp) ::   ALP000 , ALP100 , ALP200 , ALP300 , ALP400 , ALP500
@@ -133,5 +133,5 @@
    REAL(wp) ::   ALP012
    REAL(wp) ::   ALP003
-   
+
    ! BETA parameters
    REAL(wp) ::   BET000 , BET100 , BET200 , BET300 , BET400 , BET500
@@ -160,5 +160,5 @@
    REAL(wp) ::   PEN002 , PEN102
    REAL(wp) ::   PEN012
-   
+
    ! ALPHA_PEN parameters
    REAL(wp) ::   APE000 , APE100 , APE200 , APE300
@@ -295,5 +295,5 @@
                &  + rn_b0 * ( 1._wp - 0.5_wp*rn_lambda2*zs - rn_mu2*zh ) * zs   &
                &  - rn_nu * zt * zs
-               !                                 
+               !
             prd(ji,jj,jk) = zn * r1_rho0 * ztm                ! density anomaly (masked)
          END_3D
@@ -448,5 +448,5 @@
             END_3D
          ENDIF
-         
+
       CASE( np_seos )                !==  simplified EOS  ==!
          !
@@ -997,5 +997,5 @@
       !!                  ***  ROUTINE bn2  ***
       !!
-      !! ** Purpose :   Compute the local Brunt-Vaisala frequency at the 
+      !! ** Purpose :   Compute the local Brunt-Vaisala frequency at the
       !!                time-step of the input arguments
       !!
@@ -1004,5 +1004,5 @@
       !!      N.B. N^2 is set one for all to zero at jk=1 in istate module.
       !!
-      !! ** Action  :   pn2 : square of the brunt-vaisala frequency at w-point 
+      !! ** Action  :   pn2 : square of the brunt-vaisala frequency at w-point
       !!
       !!----------------------------------------------------------------------
@@ -1021,7 +1021,7 @@
       DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 2, jpkm1 )      ! interior points only (2=< jk =< jpkm1 ); surface and bottom value set to zero one for all in istate.F90
          zrw =   ( gdepw(ji,jj,jk  ,Kmm) - gdept(ji,jj,jk,Kmm) )   &
-            &  / ( gdept(ji,jj,jk-1,Kmm) - gdept(ji,jj,jk,Kmm) ) 
-            !
-         zaw = pab(ji,jj,jk,jp_tem) * (1. - zrw) + pab(ji,jj,jk-1,jp_tem) * zrw 
+            &  / ( gdept(ji,jj,jk-1,Kmm) - gdept(ji,jj,jk,Kmm) )
+            !
+         zaw = pab(ji,jj,jk,jp_tem) * (1. - zrw) + pab(ji,jj,jk-1,jp_tem) * zrw
          zbw = pab(ji,jj,jk,jp_sal) * (1. - zrw) + pab(ji,jj,jk-1,jp_sal) * zrw
          !
@@ -1151,5 +1151,5 @@
          CALL ctl_stop( 'eos_fzp_2d:', ctmp1 )
          !
-      END SELECT      
+      END SELECT
       !
   END SUBROUTINE eos_fzp_2d_t
@@ -1208,8 +1208,8 @@
       !! ** Purpose :   Calculates nonlinear anomalies of alpha_PE, beta_PE and PE at T-points
       !!
-      !! ** Method  :   PE is defined analytically as the vertical 
+      !! ** Method  :   PE is defined analytically as the vertical
       !!                   primitive of EOS times -g integrated between 0 and z>0.
       !!                pen is the nonlinear bsq-PE anomaly: pen = ( PE - rho0 gz ) / rho0 gz - rd
-      !!                                                      = 1/z * /int_0^z rd dz - rd 
+      !!                                                      = 1/z * /int_0^z rd dz - rd
       !!                                where rd is the density anomaly (see eos_rhd function)
       !!                ab_pe are partial derivatives of PE anomaly with respect to T and S:
@@ -1275,5 +1275,5 @@
                !
             zn  = ( zn2 * zh + zn1 ) * zh + zn0
-            !                              
+            !
             pab_pe(ji,jj,jk,jp_tem) = zn * zh * r1_rho0 * ztm
             !
@@ -1290,5 +1290,5 @@
                !
             zn  = ( zn2 * zh + zn1 ) * zh + zn0
-            !                              
+            !
             pab_pe(ji,jj,jk,jp_sal) = zn / zs * zh * r1_rho0 * ztm
             !
@@ -1370,5 +1370,5 @@
          IF(lwp) WRITE(numout,*) '   ==>>>   use of TEOS-10 equation of state (cons. temp. and abs. salinity)'
          !
-         l_useCT = .TRUE.                          ! model temperature is Conservative temperature 
+         l_useCT = .TRUE.                          ! model temperature is Conservative temperature
          !
          rdeltaS = 32._wp
@@ -1751,5 +1751,5 @@
 
          r1_S0  = 0.875_wp/35.16504_wp   ! Used to convert CT in potential temperature when using bulk formulae (eos_pt_from_ct)
-         
+
          IF(lwp) THEN
             WRITE(numout,*)
@@ -1775,8 +1775,8 @@
       END SELECT
       !
-      rho0_rcp    = rho0 * rcp 
+      rho0_rcp    = rho0 * rcp
       r1_rho0     = 1._wp / rho0
       r1_rcp      = 1._wp / rcp
-      r1_rho0_rcp = 1._wp / rho0_rcp 
+      r1_rho0_rcp = 1._wp / rho0_rcp
       !
       IF(lwp) THEN
Index: /NEMO/trunk/src/OCE/TRA/traadv.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv.F90	(revision 14072)
@@ -2,10 +2,10 @@
    !!==============================================================================
    !!                       ***  MODULE  traadv  ***
-   !! Ocean active tracers:  advection trend 
+   !! Ocean active tracers:  advection trend
    !!==============================================================================
    !! History :  2.0  !  2005-11  (G. Madec)  Original code
    !!            3.3  !  2010-09  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport
    !!            3.6  !  2011-06  (G. Madec)  Addition of Mixed Layer Eddy parameterisation
-   !!            3.7  !  2014-05  (G. Madec)  Add 2nd/4th order cases for CEN and FCT schemes 
+   !!            3.7  !  2014-05  (G. Madec)  Add 2nd/4th order cases for CEN and FCT schemes
    !!             -   !  2014-12  (G. Madec) suppression of cross land advection option
    !!            3.6  !  2015-06  (E. Clementi) Addition of Stokes drift in case of wave coupling
@@ -34,6 +34,6 @@
    USE ldfslp         ! Lateral diffusion: slopes of neutral surfaces
    USE trd_oce        ! trends: ocean variables
-   USE trdtra         ! trends manager: tracers 
-   USE diaptr         ! Poleward heat transport 
+   USE trdtra         ! trends manager: tracers
+   USE diaptr         ! Poleward heat transport
    !
    USE in_out_manager ! I/O manager
@@ -195,13 +195,13 @@
          CASE ( np_MUS )                                 ! MUSCL
             ! NOTE: [tiling-comms-merge] I added this lbc_lnk as it did not validate against the trunk when using ln_zco
-            IF (nn_hls.EQ.2) THEN 
+            IF (nn_hls.EQ.2) THEN
                 CALL lbc_lnk( 'traadv', pts(:,:,:,:,Kbb), 'T', 1.)
 #if defined key_loop_fusion
-                CALL tra_adv_mus_lf ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+                CALL tra_adv_mus_lf ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups )
 #else
-                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups )
 #endif
             ELSE
-                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups )
             END IF
          CASE ( np_UBS )                                 ! UBS
@@ -248,6 +248,6 @@
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_init  ***
-      !!                
-      !! ** Purpose :   Control the consistency between namelist options for 
+      !!
+      !! ** Purpose :   Control the consistency between namelist options for
       !!              tracer advection schemes and set nadv
       !!----------------------------------------------------------------------
@@ -290,5 +290,5 @@
       !
       !                                !==  Parameter control & set nadv ==!
-      ioptio = 0                       
+      ioptio = 0
       IF( ln_traadv_OFF ) THEN   ;   ioptio = ioptio + 1   ;   nadv = np_NO_adv   ;   ENDIF
       IF( ln_traadv_cen ) THEN   ;   ioptio = ioptio + 1   ;   nadv = np_CEN      ;   ENDIF
@@ -319,5 +319,5 @@
       ENDIF
       !
-      !                                !==  Print the choice  ==!  
+      !                                !==  Print the choice  ==!
       IF(lwp) THEN
          WRITE(numout,*)
Index: /NEMO/trunk/src/OCE/TRA/traadv_cen.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv_cen.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv_cen.F90	(revision 14072)
@@ -13,7 +13,7 @@
    USE dom_oce        ! ocean space and time domain
    USE eosbn2         ! equation of state
-   USE traadv_fct     ! acces to routine interp_4th_cpt 
+   USE traadv_fct     ! acces to routine interp_4th_cpt
    USE trd_oce        ! trends: ocean variables
-   USE trdtra         ! trends manager: tracers 
+   USE trdtra         ! trends manager: tracers
    USE diaptr         ! poleward transport diagnostics
    USE diaar5         ! AR5 diagnostics
@@ -28,5 +28,5 @@
 
    PUBLIC   tra_adv_cen   ! called by traadv.F90
-   
+
    REAL(wp) ::   r1_6 = 1._wp / 6._wp   ! =1/6
 
@@ -46,13 +46,13 @@
 
    SUBROUTINE tra_adv_cen( kt, kit000, cdtype, pU, pV, pW,     &
-      &                    Kmm, pt, kjpt, Krhs, kn_cen_h, kn_cen_v ) 
+      &                    Kmm, pt, kjpt, Krhs, kn_cen_h, kn_cen_v )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_cen  ***
-      !!                 
+      !!
       !! ** Purpose :   Compute the now trend due to the advection of tracers
       !!      and add it to the general trend of passive tracer equations.
       !!
       !! ** Method  :   The advection is evaluated by a 2nd or 4th order scheme
-      !!               using now fields (leap-frog scheme). 
+      !!               using now fields (leap-frog scheme).
       !!       kn_cen_h = 2  ==>> 2nd order centered scheme on the horizontal
       !!                = 4  ==>> 4th order    -        -       -      -
@@ -98,5 +98,5 @@
       ENDIF
       !
-      !                    
+      !
       zwz(:,:, 1 ) = 0._wp       ! surface & bottom vertical flux set to zero for all tracers
       zwz(:,:,jpk) = 0._wp
@@ -155,5 +155,5 @@
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
                DO_2D( 1, 1, 1, 1 )
-                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kmm) 
+                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kmm)
                END_2D
             ELSE                                   ! no ice-shelf cavities (only ocean surface)
@@ -163,5 +163,5 @@
             ENDIF
          ENDIF
-         !               
+         !
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )   !--  Divergence of advective fluxes  --!
             pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs)    &
@@ -185,5 +185,5 @@
       !
    END SUBROUTINE tra_adv_cen
-   
+
    !!======================================================================
 END MODULE traadv_cen
Index: /NEMO/trunk/src/OCE/TRA/traadv_fct.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv_fct.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv_fct.F90	(revision 14072)
@@ -10,5 +10,5 @@
    !!  tra_adv_fct    : update the tracer trend with a 3D advective trends using a 2nd or 4th order FCT scheme
    !!                   with sub-time-stepping in the vertical direction
-   !!  nonosc         : compute monotonic tracer fluxes by a non-oscillatory algorithm 
+   !!  nonosc         : compute monotonic tracer fluxes by a non-oscillatory algorithm
    !!  interp_4th_cpt : 4th order compact scheme for the vertical component of the advection
    !!----------------------------------------------------------------------
@@ -24,8 +24,8 @@
    !
    USE in_out_manager ! I/O manager
-   USE iom            ! 
+   USE iom            !
    USE lib_mpp        ! MPP library
-   USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lbclnk         ! ocean lateral boundary condition (or mpp link)
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
    IMPLICIT NONE
@@ -60,5 +60,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_fct  ***
-      !! 
+      !!
       !! **  Purpose :   Compute the now trend due to total advection of tracers
       !!               and add it to the general trend of tracer equations
@@ -66,6 +66,6 @@
       !! **  Method  : - 2nd or 4th FCT scheme on the horizontal direction
       !!               (choice through the value of kn_fct)
-      !!               - on the vertical the 4th order is a compact scheme 
-      !!               - corrected flux (monotonic correction) 
+      !!               - on the vertical the 4th order is a compact scheme
+      !!               - corrected flux (monotonic correction)
       !!
       !! ** Action : - update pt(:,:,:,:,Krhs)  with the now advective tracer trends
@@ -154,5 +154,5 @@
          !
          !        !==  upstream advection with initial mass fluxes & intermediate update  ==!
-         !                    !* upstream tracer flux in the i and j direction 
+         !                    !* upstream tracer flux in the i and j direction
          DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
             ! upstream scheme
@@ -173,5 +173,5 @@
             IF( ln_isfcav ) THEN                        ! top of the ice-shelf cavities and at the ocean surface
                DO_2D( 1, 1, 1, 1 )
-                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface 
+                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface
                END_2D
             ELSE                                        ! no cavities: only at the ocean surface
@@ -181,5 +181,5 @@
             ENDIF
          ENDIF
-         !               
+         !
          DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )   !* trend and after field with monotonic scheme
             !                               ! total intermediate advective trends
@@ -193,5 +193,5 @@
                &                                  / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
          END_3D
-         
+
          IF ( ll_zAimp ) THEN
             CALL tridia_solver( zwdia, zwsup, zwinf, zwi, zwi , 0 )
@@ -215,5 +215,5 @@
          END IF
          !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( l_ptr )   zptry(:,:,:) = zwy(:,:,:) 
+         IF( l_ptr )   zptry(:,:,:) = zwy(:,:,:)
          !
          !        !==  anti-diffusive flux : high order minus low order  ==!
@@ -268,5 +268,5 @@
                zC4t_u =  zC2t_u + r1_6 * ( ztu(ji-1,jj  ,jk) - ztu(ji+1,jj  ,jk) )
                zC4t_v =  zC2t_v + r1_6 * ( ztv(ji  ,jj-1,jk) - ztv(ji  ,jj+1,jk) )
-               !                                                  ! C4 minus upstream advective fluxes 
+               !                                                  ! C4 minus upstream advective fluxes
                zwx(ji,jj,jk) =  0.5_wp * pU(ji,jj,jk) * zC4t_u - zwx(ji,jj,jk)
                zwy(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * zC4t_v - zwy(ji,jj,jk)
@@ -275,5 +275,5 @@
             !
          END SELECT
-         !                      
+         !
          SELECT CASE( kn_fct_v )    !* vertical anti-diffusive fluxes (w-masked interior values)
          !
@@ -384,5 +384,5 @@
          DEALLOCATE( ztrdx, ztrdy, ztrdz )
       ENDIF
-      IF( l_ptr ) THEN 
+      IF( l_ptr ) THEN
          DEALLOCATE( zptry )
       ENDIF
@@ -394,7 +394,7 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE nonosc  ***
-      !!     
-      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
-      !!       scheme and the before field by a nonoscillatory algorithm 
+      !!
+      !! **  Purpose :   compute monotonic tracer fluxes from the upstream
+      !!       scheme and the before field by a nonoscillatory algorithm
       !!
       !! **  Method  :   ... ???
@@ -492,5 +492,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE interp_4th_cpt_org  ***
-      !! 
+      !!
       !! **  Purpose :   Compute the interpolation of tracer at w-point
       !!
@@ -503,5 +503,5 @@
       REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwd, zwi, zws, zwrm, zwt
       !!----------------------------------------------------------------------
-      
+
       DO_3D( 1, 1, 1, 1, 3, jpkm1 )       !==  build the three diagonal matrix  ==!
          zwd (ji,jj,jk) = 4._wp
@@ -514,5 +514,5 @@
             zwi (ji,jj,jk) = 0._wp
             zws (ji,jj,jk) = 0._wp
-            zwrm(ji,jj,jk) = 0.5 * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) )    
+            zwrm(ji,jj,jk) = 0.5 * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) )
          ENDIF
       END_3D
@@ -538,5 +538,5 @@
       END_2D
       DO_3D( 1, 1, 1, 1, 3, jpkm1 )
-         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)             
+         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)
       END_3D
 
@@ -547,12 +547,12 @@
          pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk)
       END_3D
-      !    
+      !
    END SUBROUTINE interp_4th_cpt_org
-   
+
 
    SUBROUTINE interp_4th_cpt( pt_in, pt_out )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE interp_4th_cpt  ***
-      !! 
+      !!
       !! **  Purpose :   Compute the interpolation of tracer at w-point
       !!
@@ -582,5 +582,5 @@
 !      CASE( np_CEN2 )   ! 2nd order centered  at top & bottom
 !      END SELECT
-!!gm  
+!!gm
       !
       IF ( ln_isfcav ) THEN            ! set level two values which may not be set in ISF case
@@ -600,5 +600,5 @@
          zwi (ji,jj,ikb) = 0._wp
          zws (ji,jj,ikb) = 0._wp
-         zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,ikb-1) + pt_in(ji,jj,ikb) )            
+         zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,ikb-1) + pt_in(ji,jj,ikb) )
       END_2D
       !
@@ -616,5 +616,5 @@
       END_2D
       DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 3, jpkm1 )
-         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)             
+         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)
       END_3D
 
@@ -625,5 +625,5 @@
          pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk)
       END_3D
-      !    
+      !
    END SUBROUTINE interp_4th_cpt
 
@@ -632,9 +632,9 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tridia_solver  ***
-      !! 
+      !!
       !! **  Purpose :   solve a symmetric 3diagonal system
       !!
       !! **  Method  :   solve M.t_out = RHS(t)  where M is a tri diagonal matrix ( jpk*jpk )
-      !!     
+      !!
       !!             ( D_1 U_1  0   0   0  )( t_1 )   ( RHS_1 )
       !!             ( L_2 D_2 U_2  0   0  )( t_2 )   ( RHS_2 )
@@ -642,7 +642,7 @@
       !!             (        ...          )( ... )   ( ...  )
       !!             (  0   0   0  L_k D_k )( t_k )   ( RHS_k )
-      !!     
+      !!
       !!        M is decomposed in the product of an upper and lower triangular matrix.
-      !!        The tri-diagonals matrix is given as input 3D arrays:   pD, pU, pL 
+      !!        The tri-diagonals matrix is given as input 3D arrays:   pD, pU, pL
       !!        (i.e. the Diagonal, the Upper diagonal, and the Lower diagonal).
       !!        The solution is pta.
@@ -672,5 +672,5 @@
       END_2D
       DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, kstart+1, jpkm1 )
-         pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)             
+         pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)
       END_3D
 
Index: /NEMO/trunk/src/OCE/TRA/traadv_mus.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv_mus.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv_mus.F90	(revision 14072)
@@ -29,6 +29,6 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distribued memory computing
-   USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lbclnk         ! ocean lateral boundary condition (or mpp link)
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
    IMPLICIT NONE
@@ -36,9 +36,9 @@
 
    PUBLIC   tra_adv_mus   ! routine called by traadv.F90
-   
+
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   upsmsk   !: mixed upstream/centered scheme near some straits
    !                                                           !  and in closed seas (orca 2 and 1 configurations)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xind     !: mixed upstream/centered index
-   
+
    LOGICAL  ::   l_trd   ! flag to compute trends
    LOGICAL  ::   l_ptr   ! flag to compute poleward transport
@@ -50,5 +50,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -65,5 +65,5 @@
       !!
       !! ** Method  : MUSCL scheme plus centered scheme at ocean boundaries
-      !!              ld_msc_ups=T : 
+      !!              ld_msc_ups=T :
       !!
       !! ** Action : - update pt(:,:,:,:,Krhs)  with the now advective tracer trends
@@ -134,5 +134,5 @@
          !                                !-- first guess of the slopes
          zwx(:,:,jpk) = 0._wp                   ! bottom values
-         zwy(:,:,jpk) = 0._wp  
+         zwy(:,:,jpk) = 0._wp
          DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
             zwx(ji,jj,jk) = umask(ji,jj,jk) * ( pt(ji+1,jj,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
@@ -188,5 +188,5 @@
             CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, zwy, pV, pt(:,:,:,jn,Kbb) )
          END IF
-         !                                 ! "Poleward" heat and salt transports 
+         !                                 ! "Poleward" heat and salt transports
          IF( l_ptr )  CALL dia_ptr_hst( jn, 'adv', zwy(:,:,:) )
          !                                 !  heat transport
Index: /NEMO/trunk/src/OCE/TRA/traadv_qck.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv_qck.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv_qck.F90	(revision 14072)
@@ -19,5 +19,5 @@
    USE trc_oce         ! share passive tracers/Ocean variables
    USE trd_oce         ! trends: ocean variables
-   USE trdtra          ! trends manager: tracers 
+   USE trdtra          ! trends manager: tracers
    USE diaptr          ! poleward transport diagnostics
    USE iom
@@ -26,5 +26,5 @@
    USE lib_mpp         ! distribued memory computing
    USE lbclnk          ! ocean lateral boundary condition (or mpp link)
-   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
    IMPLICIT NONE
@@ -112,6 +112,6 @@
       !
       !        ! horizontal fluxes are computed with the QUICKEST + ULTIMATE scheme
-      CALL tra_adv_qck_i( kt, cdtype, p2dt, pU, Kbb, Kmm, pt, kjpt, Krhs ) 
-      CALL tra_adv_qck_j( kt, cdtype, p2dt, pV, Kbb, Kmm, pt, kjpt, Krhs ) 
+      CALL tra_adv_qck_i( kt, cdtype, p2dt, pU, Kbb, Kmm, pt, kjpt, Krhs )
+      CALL tra_adv_qck_j( kt, cdtype, p2dt, pV, Kbb, Kmm, pt, kjpt, Krhs )
 
       !        ! vertical fluxes are computed with the 2nd order centered scheme
@@ -142,6 +142,6 @@
       DO jn = 1, kjpt                                            ! tracer loop
          !                                                       ! ===========
-         zfu(:,:,:) = 0._wp     ;   zfc(:,:,:) = 0._wp 
-         zfd(:,:,:) = 0._wp     ;   zwx(:,:,:) = 0._wp   
+         zfu(:,:,:) = 0._wp     ;   zfc(:,:,:) = 0._wp
+         zfd(:,:,:) = 0._wp     ;   zwx(:,:,:) = 0._wp
          !
 !!gm why not using a SHIFT instruction...
@@ -151,15 +151,15 @@
          END_3D
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions
-         
+
          !
          ! Horizontal advective fluxes
          ! ---------------------------
          DO_3D( 0, 0, nn_hls-1, 0, 1, jpkm1 )
-            zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
-            zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji+1,jj,jk)  ! FU in the x-direction for T 
+            zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
+            zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji+1,jj,jk)  ! FU in the x-direction for T
          END_3D
          !
          DO_3D( 0, 0, nn_hls-1, 0, 1, jpkm1 )
-            zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
+            zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
             zdx = ( zdir * e1t(ji,jj) + ( 1. - zdir ) * e1t(ji+1,jj) ) * e2u(ji,jj) * e3u(ji,jj,jk,Kmm)
             zwx(ji,jj,jk)  = ABS( pU(ji,jj,jk) ) * p2dt / zdx    ! (0<zc_cfl<1 : Courant number on x-direction)
@@ -167,5 +167,5 @@
             zfd(ji,jj,jk)  = zdir * pt(ji+1,jj,jk,jn,Kbb) + ( 1. - zdir ) * pt(ji  ,jj,jk,jn,Kbb)  ! FD in the x-direction for T
          END_3D
-         !--- Lateral boundary conditions 
+         !--- Lateral boundary conditions
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp,  zwx(:,:,:), 'T', 1.0_wp )
 
@@ -227,9 +227,9 @@
       DO jn = 1, kjpt                                            ! tracer loop
          !                                                       ! ===========
-         zfu(:,:,:) = 0.0     ;   zfc(:,:,:) = 0.0  
-         zfd(:,:,:) = 0.0     ;   zwy(:,:,:) = 0.0     
-         !                                                  
-         DO jk = 1, jpkm1                                
-            !                                             
+         zfu(:,:,:) = 0.0     ;   zfc(:,:,:) = 0.0
+         zfd(:,:,:) = 0.0     ;   zwy(:,:,:) = 0.0
+         !
+         DO jk = 1, jpkm1
+            !
             !--- Computation of the ustream and downstream value of the tracer and the mask
             DO_2D( nn_hls-1, nn_hls-1, 0, 0 )
@@ -241,5 +241,5 @@
          END DO
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions
-         
+
          !
          ! Horizontal advective fluxes
@@ -247,10 +247,10 @@
          !
          DO_3D( nn_hls-1, 0, 0, 0, 1, jpkm1 )
-            zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
-            zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji,jj+1,jk)  ! FU in the x-direction for T 
+            zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
+            zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji,jj+1,jk)  ! FU in the x-direction for T
          END_3D
          !
          DO_3D( nn_hls-1, 0, 0, 0, 1, jpkm1 )
-            zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
+            zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
             zdx = ( zdir * e2t(ji,jj) + ( 1. - zdir ) * e2t(ji,jj+1) ) * e1v(ji,jj) * e3v(ji,jj,jk,Kmm)
             zwy(ji,jj,jk)  = ABS( pV(ji,jj,jk) ) * p2dt / zdx    ! (0<zc_cfl<1 : Courant number on x-direction)
@@ -259,5 +259,5 @@
          END_3D
 
-         !--- Lateral boundary conditions 
+         !--- Lateral boundary conditions
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp, zwy(:,:,:), 'T', 1.0_wp )
 
@@ -328,5 +328,5 @@
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
                DO_2D( 0, 0, 0, 0 )
-                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kmm)   ! linear free surface 
+                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kmm)   ! linear free surface
                END_2D
             ELSE                                   ! no ocean cavities (only ocean surface)
@@ -354,5 +354,5 @@
       !! ** Purpose :  Computation of advective flux with Quickest scheme
       !!
-      !! ** Method :   
+      !! ** Method :
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pfu   ! second upwind point
@@ -361,6 +361,6 @@
       REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   puc   ! input as Courant number ; output as flux
       !!
-      INTEGER  ::  ji, jj, jk               ! dummy loop indices 
-      REAL(wp) ::  zcoef1, zcoef2, zcoef3   ! local scalars          
+      INTEGER  ::  ji, jj, jk               ! dummy loop indices
+      REAL(wp) ::  zcoef1, zcoef2, zcoef3   ! local scalars
       REAL(wp) ::  zc, zcurv, zfho          !   -      -
       !----------------------------------------------------------------------
@@ -372,5 +372,5 @@
          zcoef2 = 0.5 * zc * ( pfd(ji,jj,jk) - pfc(ji,jj,jk) )
          zcoef3 = ( 1. - ( zc * zc ) ) * r1_6 * zcurv
-         zfho   = zcoef1 - zcoef2 - zcoef3              !  phi_f QUICKEST 
+         zfho   = zcoef1 - zcoef2 - zcoef3              !  phi_f QUICKEST
          !
          zcoef1 = pfd(ji,jj,jk) - pfu(ji,jj,jk)
@@ -378,13 +378,13 @@
          zcoef3 = ABS( zcurv )
          IF( zcoef3 >= zcoef2 ) THEN
-            zfho = pfc(ji,jj,jk) 
+            zfho = pfc(ji,jj,jk)
          ELSE
             zcoef3 = pfu(ji,jj,jk) + ( ( pfc(ji,jj,jk) - pfu(ji,jj,jk) ) / MAX( zc, 1.e-9 ) )    ! phi_REF
             IF( zcoef1 >= 0. ) THEN
-               zfho = MAX( pfc(ji,jj,jk), zfho ) 
-               zfho = MIN( zfho, MIN( zcoef3, pfd(ji,jj,jk) ) ) 
+               zfho = MAX( pfc(ji,jj,jk), zfho )
+               zfho = MIN( zfho, MIN( zcoef3, pfd(ji,jj,jk) ) )
             ELSE
-               zfho = MIN( pfc(ji,jj,jk), zfho ) 
-               zfho = MAX( zfho, MAX( zcoef3, pfd(ji,jj,jk) ) ) 
+               zfho = MIN( pfc(ji,jj,jk), zfho )
+               zfho = MAX( zfho, MAX( zcoef3, pfd(ji,jj,jk) ) )
             ENDIF
          ENDIF
Index: /NEMO/trunk/src/OCE/TRA/traadv_ubs.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traadv_ubs.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traadv_ubs.F90	(revision 14072)
@@ -10,5 +10,5 @@
    !!----------------------------------------------------------------------
    !!   tra_adv_ubs : update the tracer trend with the horizontal
-   !!                 advection trends using a third order biaised scheme  
+   !!                 advection trends using a third order biaised scheme
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and active tracers
@@ -16,6 +16,6 @@
    USE trc_oce        ! share passive tracers/Ocean variables
    USE trd_oce        ! trends: ocean variables
-   USE traadv_fct      ! acces to routine interp_4th_cpt 
-   USE trdtra         ! trends manager: tracers 
+   USE traadv_fct      ! acces to routine interp_4th_cpt
+   USE trdtra         ! trends manager: tracers
    USE diaptr         ! poleward transport diagnostics
    USE diaar5         ! AR5 diagnostics
@@ -25,5 +25,5 @@
    USE lib_mpp        ! massively parallel library
    USE lbclnk         ! ocean lateral boundary condition (or mpp link)
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
    IMPLICIT NONE
@@ -51,5 +51,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_ubs  ***
-      !!                 
+      !!
       !! ** Purpose :   Compute the now trend due to the advection of tracers
       !!      and add it to the general trend of passive tracer equations.
@@ -60,20 +60,20 @@
       !!      For example the i-component of the advective fluxes are given by :
       !!                !  e2u e3u un ( mi(Tn) - zltu(i  ) )   if un(i) >= 0
-      !!          ztu = !  or 
+      !!          ztu = !  or
       !!                !  e2u e3u un ( mi(Tn) - zltu(i+1) )   if un(i) < 0
       !!      where zltu is the second derivative of the before temperature field:
       !!          zltu = 1/e3t di[ e2u e3u / e1u di[Tb] ]
-      !!        This results in a dissipatively dominant (i.e. hyper-diffusive) 
-      !!      truncation error. The overall performance of the advection scheme 
-      !!      is similar to that reported in (Farrow and Stevens, 1995). 
+      !!        This results in a dissipatively dominant (i.e. hyper-diffusive)
+      !!      truncation error. The overall performance of the advection scheme
+      !!      is similar to that reported in (Farrow and Stevens, 1995).
       !!        For stability reasons, the first term of the fluxes which corresponds
-      !!      to a second order centered scheme is evaluated using the now velocity 
-      !!      (centered in time) while the second term which is the diffusive part 
-      !!      of the scheme, is evaluated using the before velocity (forward in time). 
+      !!      to a second order centered scheme is evaluated using the now velocity
+      !!      (centered in time) while the second term which is the diffusive part
+      !!      of the scheme, is evaluated using the before velocity (forward in time).
       !!      Note that UBS is not positive. Do not use it on passive tracers.
       !!                On the vertical, the advection is evaluated using a FCT scheme,
-      !!      as the UBS have been found to be too diffusive. 
-      !!                kn_ubs_v argument controles whether the FCT is based on 
-      !!      a 2nd order centrered scheme (kn_ubs_v=2) or on a 4th order compact 
+      !!      as the UBS have been found to be too diffusive.
+      !!                kn_ubs_v argument controles whether the FCT is based on
+      !!      a 2nd order centrered scheme (kn_ubs_v=2) or on a 4th order compact
       !!      scheme (kn_ubs_v=4).
       !!
@@ -82,5 +82,5 @@
       !!             - poleward advective heat and salt transport (ln_diaptr=T)
       !!
-      !! Reference : Shchepetkin, A. F., J. C. McWilliams, 2005, Ocean Modelling, 9, 347-404. 
+      !! Reference : Shchepetkin, A. F., J. C. McWilliams, 2005, Ocean Modelling, 9, 347-404.
       !!             Farrow, D.E., Stevens, D.P., 1995, J. Phys. Ocean. 25, 1731�1741.
       !!----------------------------------------------------------------------
@@ -125,5 +125,5 @@
       DO jn = 1, kjpt                                            ! tracer loop
          !                                                       ! ===========
-         !                                              
+         !
          DO jk = 1, jpkm1                !==  horizontal laplacian of before tracer ==!
             DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )                   ! First derivative (masked gradient)
@@ -138,8 +138,8 @@
                zltv(ji,jj,jk) = (  ztv(ji,jj,jk) - ztv(ji,jj-1,jk)  ) * zcoef
             END_2D
-            !                                    
-         END DO         
+            !
+         END DO
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_ubs', zltu, 'T', 1.0_wp, zltv, 'T', 1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
-         !    
+         !
          DO_3D( 1, 0, 1, 0, 1, jpkm1 )   !==  Horizontal advective fluxes  ==!     (UBS)
             zfp_ui = pU(ji,jj,jk) + ABS( pU(ji,jj,jk) )        ! upstream transport (x2)
@@ -166,5 +166,5 @@
                   &                * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
             END_2D
-            !                                             
+            !
          END DO
          !
@@ -177,5 +177,5 @@
              CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, ztv, pV, pt(:,:,:,jn,Kmm) )
          END IF
-         !     
+         !
          !                                ! "Poleward" heat and salt transports (contribution of upstream fluxes)
          IF( l_ptr )  CALL dia_ptr_hst( jn, 'adv', ztv(:,:,:) )
@@ -188,6 +188,6 @@
          SELECT CASE( kn_ubs_v )       ! select the vertical advection scheme
          !
-         CASE(  2  )                   ! 2nd order FCT 
-            !         
+         CASE(  2  )                   ! 2nd order FCT
+            !
             IF( l_trd ) THEN
                DO_3D( 0, 0, 0, 0, 1, jpkm1 )
@@ -205,5 +205,5 @@
                IF( ln_isfcav ) THEN                   ! top of the ice-shelf cavities and at the ocean surface
                   DO_2D( 1, 1, 1, 1 )
-                     ztw(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface 
+                     ztw(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface
                   END_2D
                ELSE                                   ! no cavities: only at the ocean surface
@@ -217,5 +217,5 @@
                ztak = - ( ztw(ji,jj,jk) - ztw(ji,jj,jk+1) )    &
                   &     * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
-               pt(ji,jj,jk,jn,Krhs) =   pt(ji,jj,jk,jn,Krhs) +  ztak 
+               pt(ji,jj,jk,jn,Krhs) =   pt(ji,jj,jk,jn,Krhs) +  ztak
                zti(ji,jj,jk)    = ( pt(ji,jj,jk,jn,Kbb) + p2dt * ( ztak + zltu(ji,jj,jk) ) ) * tmask(ji,jj,jk)
             END_3D
@@ -266,7 +266,7 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE nonosc_z  ***
-      !!     
-      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
-      !!       scheme and the before field by a nonoscillatory algorithm 
+      !!
+      !! **  Purpose :   compute monotonic tracer fluxes from the upstream
+      !!       scheme and the before field by a nonoscillatory algorithm
       !!
       !! **  Method  :   ... ???
Index: /NEMO/trunk/src/OCE/TRA/traatf.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traatf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traatf.F90	(revision 14072)
@@ -26,5 +26,5 @@
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers variables
-   USE dom_oce         ! ocean space and time domain variables 
+   USE dom_oce         ! ocean space and time domain variables
    USE sbc_oce         ! surface boundary condition: ocean
    USE sbcrnf          ! river runoffs
@@ -33,5 +33,5 @@
    USE domvvl          ! variable volume
    USE trd_oce         ! trends: ocean variables
-   USE trdtra          ! trends manager: tracers 
+   USE trdtra          ! trends manager: tracers
    USE traqsr          ! penetrative solar radiation (needed for nksr)
    USE phycst          ! physical constant
@@ -70,14 +70,14 @@
       !!                   ***  ROUTINE traatf  ***
       !!
-      !! ** Purpose :   Apply the boundary condition on the after temperature  
+      !! ** Purpose :   Apply the boundary condition on the after temperature
       !!             and salinity fields and add the Asselin time filter on now fields.
-      !! 
-      !! ** Method  :   At this stage of the computation, ta and sa are the 
+      !!
+      !! ** Method  :   At this stage of the computation, ta and sa are the
       !!             after temperature and salinity as the time stepping has
       !!             been performed in trazdf_imp or trazdf_exp module.
       !!
-      !!              - Apply lateral boundary conditions on (ta,sa) 
-      !!             at the local domain   boundaries through lbc_lnk call, 
-      !!             at the one-way open boundaries (ln_bdy=T), 
+      !!              - Apply lateral boundary conditions on (ta,sa)
+      !!             at the local domain   boundaries through lbc_lnk call,
+      !!             at the one-way open boundaries (ln_bdy=T),
       !!             at the AGRIF zoom   boundaries (lk_agrif=T)
       !!
@@ -89,5 +89,5 @@
       INTEGER                                  , INTENT(in   ) :: kt             ! ocean time-step index
       INTEGER                                  , INTENT(in   ) :: Kbb, Kmm, Kaa  ! time level indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers 
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers
       !!
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
@@ -105,5 +105,5 @@
 
       ! Update after tracer on domain lateral boundaries
-      ! 
+      !
 #if defined key_agrif
       CALL Agrif_tra                     ! AGRIF zoom boundaries
@@ -113,15 +113,15 @@
       !
       IF( ln_bdy )   CALL bdy_tra( kt, Kbb, pts, Kaa )  ! BDY open boundaries
- 
+
       ! trends computation initialisation
-      IF( l_trdtra )   THEN                    
+      IF( l_trdtra )   THEN
          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
          ztrdt(:,:,:) = 0._wp
          ztrds(:,:,:) = 0._wp
-         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend 
+         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend
             CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt )
             CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds )
          ENDIF
-         ! total trend for the non-time-filtered variables. 
+         ! total trend for the non-time-filtered variables.
          zfact = 1.0 / rn_Dt
          ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms
@@ -133,12 +133,12 @@
          CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds )
          IF( ln_linssh ) THEN       ! linear sea surface height only
-            ! Store now fields before applying the Asselin filter 
+            ! Store now fields before applying the Asselin filter
             ! in order to calculate Asselin filter trend later.
-            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm) 
+            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm)
             ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm)
          ENDIF
       ENDIF
 
-      IF( l_1st_euler ) THEN       ! Euler time-stepping 
+      IF( l_1st_euler ) THEN       ! Euler time-stepping
          !
          IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl
@@ -152,13 +152,13 @@
       ELSE                                            ! Leap-Frog + Asselin filter time stepping
          !
-         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface 
+         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface
          ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rn_Dt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface
          ENDIF
          !
-         CALL lbc_lnk_multi( 'traatf',  pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp ) 
-
-      ENDIF     
-      !
-      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt     
+         CALL lbc_lnk_multi( 'traatf',  pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp )
+
+      ENDIF
+      !
+      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt
          DO jk = 1, jpkm1
             ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * r1_Dt
@@ -184,5 +184,5 @@
       !!
       !! ** Purpose :   fixed volume: apply the Asselin time filter to the "now" field
-      !! 
+      !!
       !! ** Method  : - Apply a Asselin time filter on now fields.
       !!
@@ -209,5 +209,5 @@
          !
          DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
-            ztn = pt(ji,jj,jk,jn,Kmm)                                    
+            ztn = pt(ji,jj,jk,jn,Kmm)
             ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
             !
@@ -224,6 +224,6 @@
       !!                   ***  ROUTINE tra_atf_vvl  ***
       !!
-      !! ** Purpose :   Time varying volume: apply the Asselin time filter  
-      !! 
+      !! ** Purpose :   Time varying volume: apply the Asselin time filter
+      !!
       !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields.
       !!             pt(Kmm)  = ( e3t_Kmm*pt(Kmm) + rn_atfp*[ e3t_Kbb*pt(Kbb) - 2 e3t_Kmm*pt(Kmm) + e3t_Kaa*pt(Kaa) ] )
@@ -255,5 +255,5 @@
       ENDIF
       !
-      IF( cdtype == 'TRA' )  THEN   
+      IF( cdtype == 'TRA' )  THEN
          ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration
          ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs
@@ -261,6 +261,6 @@
       ELSE                          ! passive tracers case
          ll_traqsr  = .FALSE.          ! NO solar penetration
-         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?  
-         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ?? 
+         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?
+         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ??
       ENDIF
       !
@@ -272,5 +272,5 @@
       zfact1 = rn_atfp * p2dt
       zfact2 = zfact1 * r1_rho0
-      DO jn = 1, kjpt      
+      DO jn = 1, kjpt
          DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             ze3t_b = e3t(ji,jj,jk,Kbb)
@@ -289,7 +289,7 @@
             !
             ! Add asselin correction on scale factors:
-            zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) ) 
-            ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) ) 
-            IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) ) 
+            zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) )
+            ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) )
+            IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) )
             IF ( ll_isf ) THEN
                IF ( ln_isfcav_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) )
@@ -297,15 +297,15 @@
             ENDIF
             !
-            IF( jk == mikt(ji,jj) ) THEN           ! first level 
+            IF( jk == mikt(ji,jj) ) THEN           ! first level
                ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) )
             ENDIF
             !
             ! solar penetration (temperature only)
-            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            & 
-               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) ) 
+            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &
+               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )
                !
             !
             IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          &
-               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) & 
+               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &
                &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj)
 
@@ -321,5 +321,5 @@
                         &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj)
                   END IF
-                  ! level partially include in Losch_2008 ice shelf boundary layer 
+                  ! level partially include in Losch_2008 ice shelf boundary layer
                   IF ( jk == misfkb_cav(ji,jj) ) THEN
                      ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  &
@@ -335,5 +335,5 @@
                             &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj)
                   END IF
-                  ! level partially include in Losch_2008 ice shelf boundary layer 
+                  ! level partially include in Losch_2008 ice shelf boundary layer
                   IF ( jk == misfkb_par(ji,jj) ) THEN
                      ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
@@ -364,9 +364,9 @@
             !
          END_3D
-         ! 
+         !
       END DO
       !
       IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
-         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN 
+         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN
             CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) )
             CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) )
Index: /NEMO/trunk/src/OCE/TRA/traatf_qco.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traatf_qco.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traatf_qco.F90	(revision 14072)
@@ -100,5 +100,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~'
       ENDIF
-!!st  Update after tracer on domain lateral boundaries as been removed outside 
+!!st  Update after tracer on domain lateral boundaries as been removed outside
 
       ! trends computation initialisation
Index: /NEMO/trunk/src/OCE/TRA/trabbc.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/trabbc.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/trabbc.F90	(revision 14072)
@@ -12,5 +12,5 @@
 
    !!----------------------------------------------------------------------
-   !!   tra_bbc       : update the tracer trend at ocean bottom 
+   !!   tra_bbc       : update the tracer trend at ocean bottom
    !!   tra_bbc_init  : initialization of geothermal heat flux trend
    !!----------------------------------------------------------------------
@@ -19,8 +19,8 @@
    USE phycst         ! physical constants
    USE trd_oce        ! trends: ocean variables
-   USE trdtra         ! trends manager: tracers 
+   USE trdtra         ! trends manager: tracers
    !
    USE in_out_manager ! I/O manager
-   USE iom            ! xIOS 
+   USE iom            ! xIOS
    USE fldread        ! read input fields
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
@@ -43,5 +43,5 @@
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_qgh   ! structure of input qgh (file informations, fields read)
- 
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -58,9 +58,9 @@
       !!                  ***  ROUTINE tra_bbc  ***
       !!
-      !! ** Purpose :   Compute the bottom boundary contition on temperature 
-      !!              associated with geothermal heating and add it to the 
+      !! ** Purpose :   Compute the bottom boundary contition on temperature
+      !!              associated with geothermal heating and add it to the
       !!              general trend of temperature equations.
       !!
-      !! ** Method  :   The geothermal heat flux set to its constant value of 
+      !! ** Method  :   The geothermal heat flux set to its constant value of
       !!              86.4 mW/m2 (Stein and Stein 1992, Huang 1999).
       !!       The temperature trend associated to this heat flux through the
@@ -135,5 +135,5 @@
       CHARACTER(len=256) ::   cn_dir    ! Root directory for location of ssr files
       !!
-      NAMELIST/nambbc/ln_trabbc, nn_geoflx, rn_geoflx_cst, sn_qgh, cn_dir 
+      NAMELIST/nambbc/ln_trabbc, nn_geoflx, rn_geoflx_cst, sn_qgh, cn_dir
       !!----------------------------------------------------------------------
       !
Index: /NEMO/trunk/src/OCE/TRA/trabbl.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/trabbl.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/trabbl.F90	(revision 14072)
@@ -31,10 +31,10 @@
    USE trdtra         ! trends: active tracers
    !
-   USE iom            ! IOM library               
+   USE iom            ! IOM library
    USE in_out_manager ! I/O manager
    USE lbclnk         ! ocean lateral boundary conditions
    USE prtctl         ! Print control
    USE timing         ! Timing
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
    IMPLICIT NONE
@@ -200,5 +200,5 @@
             zptb(ji,jj) = pt(ji,jj,ik,jn)                ! bottom before T and S
          END_2D
-         !               
+         !
          DO_2D( 0, 0, 0, 0 )                               ! Compute the trend
             ik = mbkt(ji,jj)                            ! bottom T-level index
@@ -399,5 +399,5 @@
                za = zab(ji+1,jj,jp_tem) + zab(ji,jj,jp_tem)               ! 2*(alpha,beta) at u-point
                zb = zab(ji+1,jj,jp_sal) + zab(ji,jj,jp_sal)
-               !                                                          ! 2*masked bottom density gradient 
+               !                                                          ! 2*masked bottom density gradient
                zgdrho = (  za * ( zts(ji+1,jj,jp_tem) - zts(ji,jj,jp_tem) )    &
                          - zb * ( zts(ji+1,jj,jp_sal) - zts(ji,jj,jp_sal) )  ) * umask(ji,jj,1)
@@ -523,6 +523,6 @@
       END_2D
       ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk
-      zmbku(:,:) = REAL( mbku_d(:,:), wp )   ;     zmbkv(:,:) = REAL( mbkv_d(:,:), wp )  
-      CALL lbc_lnk_multi( 'trabbl', zmbku,'U',1.0_wp, zmbkv,'V',1.0_wp) 
+      zmbku(:,:) = REAL( mbku_d(:,:), wp )   ;     zmbkv(:,:) = REAL( mbkv_d(:,:), wp )
+      CALL lbc_lnk_multi( 'trabbl', zmbku,'U',1.0_wp, zmbkv,'V',1.0_wp)
       mbku_d(:,:) = MAX( INT( zmbku(:,:) ), 1 ) ;  mbkv_d(:,:) = MAX( NINT( zmbkv(:,:) ), 1 )
       !
Index: /NEMO/trunk/src/OCE/TRA/tradmp.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/tradmp.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/tradmp.F90	(revision 14072)
@@ -11,5 +11,5 @@
    !!  NEMO      1.0  ! 2002-08  (G. Madec, E. Durand)  free form + modules
    !!            3.2  ! 2009-08  (G. Madec, C. Talandier)  DOCTOR norm for namelist parameter
-   !!            3.3  ! 2010-06  (C. Ethe, G. Madec) merge TRA-TRC 
+   !!            3.3  ! 2010-06  (C. Ethe, G. Madec) merge TRA-TRC
    !!            3.4  ! 2011-04  (G. Madec, C. Ethe) Merge of dtatem and dtasal + suppression of CPP keys
    !!            3.6  ! 2015-06  (T. Graham)  read restoring coefficient in a file
@@ -26,5 +26,5 @@
    USE c1d            ! 1D vertical configuration
    USE trd_oce        ! trends: ocean variables
-   USE trdtra         ! trends manager: tracers 
+   USE trdtra         ! trends manager: tracers
    USE zdf_oce        ! ocean: vertical physics
    USE phycst         ! physical constants
@@ -55,5 +55,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -75,10 +75,10 @@
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE tra_dmp  ***
-      !!                  
+      !!
       !! ** Purpose :   Compute the tracer trend due to a newtonian damping
       !!      of the tracer field towards given data field and add it to the
       !!      general tracer trends.
       !!
-      !! ** Method  :   Newtonian damping towards t_dta and s_dta computed 
+      !! ** Method  :   Newtonian damping towards t_dta and s_dta computed
       !!      and add to the general tracer trends:
       !!                     ta = ta + resto * (t_dta - tb)
@@ -158,10 +158,10 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_dmp_init  ***
-      !! 
-      !! ** Purpose :   Initialization for the newtonian damping 
+      !!
+      !! ** Purpose :   Initialization for the newtonian damping
       !!
       !! ** Method  :   read the namtra_dmp namelist and check the parameters
       !!----------------------------------------------------------------------
-      INTEGER ::   ios, imask   ! local integers 
+      INTEGER ::   ios, imask   ! local integers
       !
       NAMELIST/namtra_dmp/ ln_tradmp, nn_zdmp, cn_resto
Index: /NEMO/trunk/src/OCE/TRA/traisf.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traisf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traisf.F90	(revision 14072)
@@ -35,5 +35,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_isf  ***
-      !!                   
+      !!
       !! ** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc)
       !!
@@ -65,5 +65,5 @@
          !
          ! Dynamical stability at start up after change in under ice shelf cavity geometry is achieve by correcting the divergence.
-         ! This is achieved by applying a volume flux in order to keep the horizontal divergence after remapping 
+         ! This is achieved by applying a volume flux in order to keep the horizontal divergence after remapping
          ! the same as at the end of the latest time step. So correction need to be apply at nit000 (euler time step) and
          ! half of it at nit000+1 (leap frog time step).
@@ -95,5 +95,5 @@
       !! *** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc) for cav or par case
       !!
-      !! *** Action :: Update pts(:,:,:,:,Krhs) with the surface boundary condition trend 
+      !! *** Action :: Update pts(:,:,:,:,Krhs) with the surface boundary condition trend
       !!
       !!----------------------------------------------------------------------
@@ -104,5 +104,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc , ptsc_b
       !!----------------------------------------------------------------------
-      INTEGER                      :: ji,jj,jk  ! loop index   
+      INTEGER                      :: ji,jj,jk  ! loop index
       INTEGER                      :: ikt, ikb  ! top and bottom level of the tbl
       REAL(wp), DIMENSION(A2D(nn_hls))     :: ztc       ! total ice shelf tracer trend
@@ -125,5 +125,5 @@
          END DO
          !
-         ! level partially include in ice shelf boundary layer 
+         ! level partially include in ice shelf boundary layer
          pts(ji,jj,ikb,jp_tem) = pts(ji,jj,ikb,jp_tem) + ztc(ji,jj) * pfrac(ji,jj)
          !
@@ -136,5 +136,5 @@
       !!                  ***  ROUTINE tra_isf_cpl  ***
       !!
-      !! *** Action :: Update pts(:,:,:,:,Krhs) with the ice shelf coupling trend 
+      !! *** Action :: Update pts(:,:,:,:,Krhs) with the ice shelf coupling trend
       !!
       !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/OCE/TRA/traldf.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traldf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traldf.F90	(revision 14072)
@@ -2,8 +2,8 @@
    !!======================================================================
    !!                       ***  MODULE  traldf  ***
-   !! Ocean Active tracers : lateral diffusive trends 
+   !! Ocean Active tracers : lateral diffusive trends
    !!=====================================================================
    !! History :  9.0  ! 2005-11  (G. Madec)  Original code
-   !!  NEMO      3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA 
+   !!  NEMO      3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA
    !!            3.7  ! 2013-12  (G. Madec) remove the optional computation from T & S anomaly profiles and traldf_bilapg
    !!             -   ! 2013-12  (F. Lemarie, G. Madec)  triad operator (Griffies) + Method of Stabilizing Correction
@@ -37,10 +37,10 @@
    PRIVATE
 
-   PUBLIC   tra_ldf        ! called by step.F90 
-   PUBLIC   tra_ldf_init   ! called by nemogcm.F90 
+   PUBLIC   tra_ldf        ! called by step.F90
+   PUBLIC   tra_ldf_init   ! called by nemogcm.F90
 
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -50,5 +50,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf  ***
-      !! 
+      !!
       !! ** Purpose :   compute the lateral ocean tracer physics.
       !!----------------------------------------------------------------------
@@ -120,10 +120,10 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf_init  ***
-      !! 
+      !!
       !! ** Purpose :   Choice of the operator for the lateral tracer diffusion
       !!
       !! ** Method  :   set nldf_tra from the namtra_ldf logicals
       !!----------------------------------------------------------------------
-      INTEGER ::   ioptio, ierr   ! temporary integers 
+      INTEGER ::   ioptio, ierr   ! temporary integers
       !!----------------------------------------------------------------------
       !
Index: /NEMO/trunk/src/OCE/TRA/traldf_iso.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traldf_iso.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traldf_iso.F90	(revision 14072)
@@ -15,5 +15,5 @@
    !!----------------------------------------------------------------------
    !!   tra_ldf_iso   : update the tracer trend with the horizontal component of a iso-neutral laplacian operator
-   !!                   and with the vertical part of the isopycnal or geopotential s-coord. operator 
+   !!                   and with the vertical part of the isopycnal or geopotential s-coord. operator
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and active tracers
@@ -79,9 +79,9 @@
       !!                  ***  ROUTINE tra_ldf_iso  ***
       !!
-      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive 
-      !!      trend for a laplacian tensor (ezxcept the dz[ dz[.] ] term) and 
+      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive
+      !!      trend for a laplacian tensor (ezxcept the dz[ dz[.] ] term) and
       !!      add it to the general trend of tracer equation.
       !!
-      !! ** Method  :   The horizontal component of the lateral diffusive trends 
+      !! ** Method  :   The horizontal component of the lateral diffusive trends
       !!      is provided by a 2nd order operator rotated along neural or geopo-
       !!      tential surfaces to which an eddy induced advection can be added
@@ -94,5 +94,5 @@
       !!
       !!      2nd part :  horizontal fluxes of the lateral mixing operator
-      !!      ========    
+      !!      ========
       !!         zftu =  pahu e2u*e3u/e1u di[ tb ]
       !!               - pahu e2u*uslp    dk[ mi(mk(tb)) ]
@@ -165,5 +165,5 @@
       ELSE                    ;   zsign = -1._wp
       ENDIF
-         
+
       !!----------------------------------------------------------------------
       !!   0 - calculate  ah_wslp2 and akz
@@ -223,7 +223,7 @@
       DO jn = 1, kjpt                                            ! tracer loop
          !                                                       ! ===========
-         !                                               
-         !!----------------------------------------------------------------------
-         !!   I - masked horizontal derivative 
+         !
+         !!----------------------------------------------------------------------
+         !!   I - masked horizontal derivative
          !!----------------------------------------------------------------------
 !!gm : bug.... why (x,:,:)?   (1,jpj,:) and (jpi,1,:) should be sufficient....
@@ -232,5 +232,5 @@
          !!end
 
-         ! Horizontal tracer gradient 
+         ! Horizontal tracer gradient
          DO_3D( 1, 0, 1, 0, 1, jpkm1 )
             zdit(ji,jj,jk) = ( pt(ji+1,jj  ,jk,jn) - pt(ji,jj,jk,jn) ) * umask(ji,jj,jk)
@@ -239,11 +239,11 @@
          IF( ln_zps ) THEN      ! botton and surface ocean correction of the horizontal gradient
             DO_2D( 1, 0, 1, 0 )           ! bottom correction (partial bottom cell)
-               zdit(ji,jj,mbku(ji,jj)) = pgu(ji,jj,jn)          
+               zdit(ji,jj,mbku(ji,jj)) = pgu(ji,jj,jn)
                zdjt(ji,jj,mbkv(ji,jj)) = pgv(ji,jj,jn)
             END_2D
             IF( ln_isfcav ) THEN      ! first wet level beneath a cavity
                DO_2D( 1, 0, 1, 0 )
-                  IF( miku(ji,jj) > 1 )   zdit(ji,jj,miku(ji,jj)) = pgui(ji,jj,jn)          
-                  IF( mikv(ji,jj) > 1 )   zdjt(ji,jj,mikv(ji,jj)) = pgvi(ji,jj,jn)     
+                  IF( miku(ji,jj) > 1 )   zdit(ji,jj,miku(ji,jj)) = pgui(ji,jj,jn)
+                  IF( mikv(ji,jj) > 1 )   zdjt(ji,jj,mikv(ji,jj)) = pgvi(ji,jj,jn)
                END_2D
             ENDIF
@@ -283,5 +283,5 @@
                zftv(ji,jj,jk) = (  zabe2 * zdjt(ji,jj,jk)   &
                   &               + zcof2 * (  zdkt (ji,jj+1) + zdk1t(ji,jj)      &
-                  &                          + zdk1t(ji,jj+1) + zdkt (ji,jj)  )  ) * vmask(ji,jj,jk)                  
+                  &                          + zdk1t(ji,jj+1) + zdkt (ji,jj)  )  ) * vmask(ji,jj,jk)
             END_2D
             !
@@ -291,5 +291,5 @@
                   &                                              * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
             END_2D
-         END DO                                        !   End of slab  
+         END DO                                        !   End of slab
 
          !!----------------------------------------------------------------------
@@ -301,5 +301,5 @@
          !                          ! Surface and bottom vertical fluxes set to zero
          ztfw(:,:, 1 ) = 0._wp      ;      ztfw(:,:,jpk) = 0._wp
-         
+
          DO_3D( 0, 0, 0, 0, 2, jpkm1 )    ! interior (2=<jk=<jpk-1)
             !
@@ -330,5 +330,5 @@
             END_3D
             !
-         ELSE                                   ! bilaplacian 
+         ELSE                                   ! bilaplacian
             SELECT CASE( kpass )
             CASE(  1  )                            ! 1st pass : eddy coef = ah_wslp2
@@ -346,5 +346,5 @@
             END SELECT
          ENDIF
-         !         
+         !
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )    !==  Divergence of vertical fluxes added to pta  ==!
             pt_rhs(ji,jj,jk,jn) = pt_rhs(ji,jj,jk,jn) + zsign * (  ztfw (ji,jj,jk) - ztfw(ji,jj,jk+1)  ) * r1_e1e2t(ji,jj)   &
Index: /NEMO/trunk/src/OCE/TRA/traldf_lap_blp.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traldf_lap_blp.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traldf_lap_blp.F90	(revision 14072)
@@ -4,5 +4,5 @@
    !! Ocean tracers:  lateral diffusivity trend  (laplacian and bilaplacian)
    !!==============================================================================
-   !! History :  3.7  ! 2014-01  (G. Madec, S. Masson)  Original code, re-entrant laplacian 
+   !! History :  3.7  ! 2014-01  (G. Madec, S. Masson)  Original code, re-entrant laplacian
    !!----------------------------------------------------------------------
 
@@ -74,10 +74,10 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf_lap  ***
-      !!                   
-      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive 
+      !!
+      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive
       !!      trend and add it to the general trend of tracer equation.
       !!
       !! ** Method  :   Second order diffusive operator evaluated using before
-      !!      fields (forward time scheme). The horizontal diffusive trends of 
+      !!      fields (forward time scheme). The horizontal diffusive trends of
       !!      the tracer is given by:
       !!          difft = 1/(e1e2t*e3t) {  di-1[ pahu e2u*e3u/e1u di(tb) ]
@@ -86,5 +86,5 @@
       !!          pt_rhs = pt_rhs + difft
       !!
-      !! ** Action  : - Update pt_rhs arrays with the before iso-level 
+      !! ** Action  : - Update pt_rhs arrays with the before iso-level
       !!                harmonic mixing trend.
       !!----------------------------------------------------------------------
@@ -139,6 +139,6 @@
       !                             ! =========== !
       DO jn = 1, kjpt               ! tracer loop !
-         !                          ! =========== !    
-         !                               
+         !                          ! =========== !
+         !
          DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )            !== First derivative (gradient)  ==!
             ztu(ji,jj,jk) = zaheeu(ji,jj,jk) * ( pt(ji+1,jj  ,jk,jn) - pt(ji,jj,jk,jn) )
@@ -152,6 +152,6 @@
             IF( ln_isfcav ) THEN                             ! top in ocean cavities only
                DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )
-                  IF( miku(ji,jj) > 1 )   ztu(ji,jj,miku(ji,jj)) = zaheeu(ji,jj,miku(ji,jj)) * pgui(ji,jj,jn) 
-                  IF( mikv(ji,jj) > 1 )   ztv(ji,jj,mikv(ji,jj)) = zaheev(ji,jj,mikv(ji,jj)) * pgvi(ji,jj,jn) 
+                  IF( miku(ji,jj) > 1 )   ztu(ji,jj,miku(ji,jj)) = zaheeu(ji,jj,miku(ji,jj)) * pgui(ji,jj,jn)
+                  IF( mikv(ji,jj) > 1 )   ztv(ji,jj,mikv(ji,jj)) = zaheev(ji,jj,mikv(ji,jj)) * pgvi(ji,jj,jn)
                END_2D
             ENDIF
@@ -177,5 +177,5 @@
       !
    END SUBROUTINE tra_ldf_lap_t
-   
+
 
    SUBROUTINE tra_ldf_blp( kt, Kmm, kit000, cdtype, pahu, pahv  ,             &
@@ -184,6 +184,6 @@
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE tra_ldf_blp  ***
-      !!                    
-      !! ** Purpose :   Compute the before lateral tracer diffusive 
+      !!
+      !! ** Purpose :   Compute the before lateral tracer diffusive
       !!      trend and add it to the general trend of tracer equation.
       !!
@@ -238,7 +238,7 @@
       ! NOTE: [tiling-comms-merge] Needed for both nn_hls as tra_ldf_iso and tra_ldf_triad have not yet been adjusted to work with nn_hls = 2. In the zps case the lbc_lnk in zps_hde handles this, but in the zco case zlap always needs this lbc_lnk. I did try adjusting the bounds in tra_ldf_iso and tra_ldf_triad so this lbc_lnk was only needed for nn_hls = 1, but this was not correct and I did not have time to figure out why
       CALL lbc_lnk( 'traldf_lap_blp', zlap(:,:,:,:) , 'T', 1.0_wp )     ! Lateral boundary conditions (unchanged sign)
-      !                                               ! Partial top/bottom cell: GRADh( zlap )  
+      !                                               ! Partial top/bottom cell: GRADh( zlap )
       IF( ln_isfcav .AND. ln_zps ) THEN   ;   CALL zps_hde_isf( kt, Kmm, kjpt, zlap, zglu, zglv, zgui, zgvi )  ! both top & bottom
-      ELSEIF(             ln_zps ) THEN   ;   CALL zps_hde    ( kt, Kmm, kjpt, zlap, zglu, zglv )              ! only bottom 
+      ELSEIF(             ln_zps ) THEN   ;   CALL zps_hde    ( kt, Kmm, kjpt, zlap, zglu, zglv )              ! only bottom
       ENDIF
       !
Index: /NEMO/trunk/src/OCE/TRA/traldf_triad.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traldf_triad.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traldf_triad.F90	(revision 14072)
@@ -145,5 +145,5 @@
       ELSE                    ;   zsign = -1._wp
       ENDIF
-      !    
+      !
       !!----------------------------------------------------------------------
       !!   0 - calculate  ah_wslp2, akz, and optionally zpsi_uw, zpsi_vw
@@ -175,5 +175,5 @@
          END DO
          !
-         DO jp = 0, 1                            ! j-k triads 
+         DO jp = 0, 1                            ! j-k triads
             DO kp = 0, 1
                DO_3D( 0, 0, 0, 0, 1, jpkm1 )
@@ -264,6 +264,6 @@
             IF( ln_isfcav ) THEN                   ! top level (ocean cavities only)
                DO_2D( 1, 0, 1, 0 )
-                  IF( miku(ji,jj)  > 1 )   zdit(ji,jj,miku(ji,jj) ) = pgui(ji,jj,jn) 
-                  IF( mikv(ji,jj)  > 1 )   zdjt(ji,jj,mikv(ji,jj) ) = pgvi(ji,jj,jn) 
+                  IF( miku(ji,jj)  > 1 )   zdit(ji,jj,miku(ji,jj) ) = pgui(ji,jj,jn)
+                  IF( mikv(ji,jj)  > 1 )   zdjt(ji,jj,mikv(ji,jj) ) = pgvi(ji,jj,jn)
                END_2D
             ENDIF
@@ -392,5 +392,5 @@
                   &                            * (  pt(ji,jj,jk-1,jn) - pt(ji,jj,jk,jn) )
             END_3D
-         ELSE                                   ! bilaplacian 
+         ELSE                                   ! bilaplacian
             SELECT CASE( kpass )
             CASE(  1  )                            ! 1st pass : eddy coef = ah_wslp2
@@ -405,5 +405,5 @@
                      &                               + akz     (ji,jj,jk) * ( pt2(ji,jj,jk-1,jn) - pt2(ji,jj,jk,jn) )   )
                END_3D
-            END SELECT 
+            END SELECT
          ENDIF
          !
Index: /NEMO/trunk/src/OCE/TRA/tranpc.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/tranpc.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/tranpc.F90	(revision 14072)
@@ -97,7 +97,7 @@
          IF( l_LB_debug ) THEN
             ! Location of 1 known convection site to follow what's happening in the water column
-            ilc1 = 45 ;  jlc1 = 3 ; !  ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the  water column...           
+            ilc1 = 45 ;  jlc1 = 3 ; !  ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the  water column...
             nncpu = 1  ;            ! the CPU domain contains the convection spot
-            klc1 =  mbkt(ilc1,jlc1) ! bottom of the ocean for debug point...          
+            klc1 =  mbkt(ilc1,jlc1) ! bottom of the ocean for debug point...
          ENDIF
          !
@@ -116,11 +116,11 @@
             !
             IF( tmask(ji,jj,2) == 1 ) THEN      ! At least 2 ocean points
-               !                                     ! consider one ocean column 
+               !                                     ! consider one ocean column
                zvts(:,jp_tem) = pts(ji,jj,:,jp_tem,Kaa)      ! temperature
                zvts(:,jp_sal) = pts(ji,jj,:,jp_sal,Kaa)      ! salinity
                !
-               zvab(:,jp_tem)  = zab(ji,jj,:,jp_tem)     ! Alpha 
-               zvab(:,jp_sal)  = zab(ji,jj,:,jp_sal)     ! Beta  
-               zvn2(:)         = zn2(ji,jj,:)            ! N^2 
+               zvab(:,jp_tem)  = zab(ji,jj,:,jp_tem)     ! Alpha
+               zvab(:,jp_sal)  = zab(ji,jj,:,jp_sal)     ! Beta
+               zvn2(:)         = zn2(ji,jj,:)            ! N^2
                !
                IF( l_LB_debug ) THEN                  !LB debug:
@@ -128,5 +128,5 @@
                   IF( ( ji == ilc1 ).AND.( jj == jlc1 ) ) lp_monitor_point = .TRUE.
                   ! writing only if on CPU domain where conv region is:
-                  lp_monitor_point = (narea == nncpu).AND.lp_monitor_point                      
+                  lp_monitor_point = (narea == nncpu).AND.lp_monitor_point
                ENDIF                                  !LB debug  end
                !
@@ -140,5 +140,5 @@
                   !
                   jiter = jiter + 1
-                  ! 
+                  !
                   IF( jiter >= 400 ) EXIT
                   !
@@ -155,5 +155,5 @@
                         ilayer = ilayer + 1    ! yet another instable portion of the water column found....
                         !
-                        IF( lp_monitor_point ) THEN 
+                        IF( lp_monitor_point ) THEN
                            WRITE(numout,*)
                            IF( ilayer == 1 .AND. jiter == 1 ) THEN   ! first time a column is spoted with an instability
@@ -195,5 +195,5 @@
                         zsum_beta = 0._wp
                         zsum_z    = 0._wp
-                                                 
+
                         DO jk = ikup, ikbot      ! Inside the instable (and overlying neutral) portion of the column
                            !
@@ -204,10 +204,10 @@
                            zsum_beta = zsum_beta + zvab(jk,jp_sal)*zdz
                            zsum_z    = zsum_z    + zdz
-                           !                              
+                           !
                            IF( jk == ikbot ) EXIT ! avoid array-index overshoot in case ikbot = jpk, cause we're calling jk+1 next line
                            !! EXIT when we have reached the last layer that is instable (N2<0) or neutral (N2=0):
                            IF( zvn2(jk+1) > zn2_zero ) EXIT
                         END DO
-                       
+
                         ikdown = jk ! for the current unstable layer, ikdown is the deepest point with a negative or neutral N2
                         IF( ikup == ikdown )   CALL ctl_stop( 'tra_npc :  PROBLEM #2')
@@ -235,13 +235,13 @@
                            zvab(jk,jp_sal) = zbeta
                         END DO
-                        
-                        
+
+
                         !! Updating N2 in the relvant portion of the water column
                         !! Temperature, Salinity, Alpha and Beta have been homogenized in the unstable portion
                         !! => Need to re-compute N2! will use Alpha and Beta!
-                        
+
                         ikup   = MAX(2,ikup)         ! ikup can never be 1 !
                         ik_low = MIN(ikdown+1,ikbot) ! we must go 1 point deeper than ikdown!
-                        
+
                         DO jk = ikup, ik_low              ! we must go 1 point deeper than ikdown!
 
@@ -263,7 +263,7 @@
 
                         END DO
-                     
+
                         ikp = MIN(ikdown+1,ikbot)
-                        
+
 
                      ENDIF  !IF( zvn2(ikp) < 0. )
@@ -275,7 +275,7 @@
 
                   IF( ikp /= ikbot )   CALL ctl_stop( 'tra_npc :  PROBLEM #3')
-                 
+
                   ! ******* At this stage ikp == ikbot ! *******
-                 
+
                   IF( ilayer > 0 ) THEN      !! least an unstable layer has been found
                      !
Index: /NEMO/trunk/src/OCE/TRA/traqsr.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/traqsr.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/traqsr.F90	(revision 14072)
@@ -9,13 +9,13 @@
    !!   NEMO     1.0  !  2002-06  (G. Madec)  F90: Free form and module
    !!             -   !  2005-11  (G. Madec) zco, zps, sco coordinate
-   !!            3.2  !  2009-04  (G. Madec & NEMO team) 
-   !!            3.6  !  2012-05  (C. Rousset) store attenuation coef for use in ice model 
+   !!            3.2  !  2009-04  (G. Madec & NEMO team)
+   !!            3.6  !  2012-05  (C. Rousset) store attenuation coef for use in ice model
    !!            3.6  !  2015-12  (O. Aumont, J. Jouanno, C. Ethe) use vertical profile of chlorophyll
-   !!            3.7  !  2015-11  (G. Madec, A. Coward)  remove optimisation for fix volume 
+   !!            3.7  !  2015-11  (G. Madec, A. Coward)  remove optimisation for fix volume
    !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !!   tra_qsr       : temperature trend due to the penetration of solar radiation 
-   !!   tra_qsr_init  : initialization of the qsr penetration 
+   !!   tra_qsr       : temperature trend due to the penetration of solar radiation
+   !!   tra_qsr_init  : initialization of the qsr penetration
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and active tracers
@@ -45,5 +45,5 @@
    !                                 !!* Namelist namtra_qsr: penetrative solar radiation
    LOGICAL , PUBLIC ::   ln_traqsr    !: light absorption (qsr) flag
-   LOGICAL , PUBLIC ::   ln_qsr_rgb   !: Red-Green-Blue light absorption flag  
+   LOGICAL , PUBLIC ::   ln_qsr_rgb   !: Red-Green-Blue light absorption flag
    LOGICAL , PUBLIC ::   ln_qsr_2bd   !: 2 band         light absorption flag
    LOGICAL , PUBLIC ::   ln_qsr_bio   !: bio-model      light absorption flag
@@ -54,5 +54,5 @@
    !
    INTEGER , PUBLIC ::   nksr         !: levels below which the light cannot penetrate (depth larger than 391 m)
- 
+
    INTEGER, PARAMETER ::   np_RGB  = 1   ! R-G-B     light penetration with constant Chlorophyll
    INTEGER, PARAMETER ::   np_RGBc = 2   ! R-G-B     light penetration with Chlorophyll data
@@ -88,11 +88,11 @@
       !!      Considering the 2 wavebands case:
       !!         I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) )
-      !!         The temperature trend associated with the solar radiation penetration 
+      !!         The temperature trend associated with the solar radiation penetration
       !!         is given by : zta = 1/e3t dk[ I ] / (rho0*Cp)
       !!         At the bottom, boudary condition for the radiation is no flux :
       !!      all heat which has not been absorbed in the above levels is put
       !!      in the last ocean level.
-      !!         The computation is only done down to the level where 
-      !!      I(k) < 1.e-15 W/m2 (i.e. over the top nksr levels) . 
+      !!         The computation is only done down to the level where
+      !!      I(k) < 1.e-15 W/m2 (i.e. over the top nksr levels) .
       !!
       !! ** Action  : - update ta with the penetrative solar radiation trend
@@ -193,14 +193,14 @@
             DO_2D( isj, iej, isi, iei )
                        ! zlogc = log(zchl)
-               zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) )     
+               zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) )
                        ! zc1 : log(zCze)  = log (1.12  * zchl**0.803)
-               zc1   = 0.113328685307 + 0.803 * zlogc                         
+               zc1   = 0.113328685307 + 0.803 * zlogc
                        ! zc2 : log(zCtot) = log(40.6  * zchl**0.459)
-               zc2   = 3.703768066608 + 0.459 * zlogc                           
+               zc2   = 3.703768066608 + 0.459 * zlogc
                        ! zc3 : log(zze)   = log(568.2 * zCtot**(-0.746))
-               zc3   = 6.34247346942  - 0.746 * zc2                           
+               zc3   = 6.34247346942  - 0.746 * zc2
                        ! IF( log(zze) > log(102.) ) log(zze) = log(200.0 * zCtot**(-0.293))
-               IF( zc3 > 4.62497281328 ) zc3 = 5.298317366548 - 0.293 * zc2        
-               !   
+               IF( zc3 > 4.62497281328 ) zc3 = 5.298317366548 - 0.293 * zc2
+               !
                ze0(ji,jj) = zlogc                                                 ! ze0 = log(zchl)
                ze1(ji,jj) = EXP( zc1 )                                            ! ze1 = zCze
@@ -208,5 +208,5 @@
                ze3(ji,jj) = EXP( - zc3 )                                          ! ze3 = 1/zze
             END_2D
-            
+
 !
             DO_3D( isj, iej, isi, iei, 1, nksr + 1 )
@@ -230,5 +230,5 @@
          ELSE                                !* constant chlorophyll
             zchl = 0.05
-            ! NB. make sure constant value is such that: 
+            ! NB. make sure constant value is such that:
             zchl = MIN( 10. , MAX( 0.03, zchl ) )
             ! Convert chlorophyll value to attenuation coefficient look-up table index
@@ -245,5 +245,5 @@
             ze2(ji,jj) = zcoef  * qsr(ji,jj)
             ze3(ji,jj) = zcoef  * qsr(ji,jj)
-            ! store the surface SW radiation; re-use the surface ztmp3d array 
+            ! store the surface SW radiation; re-use the surface ztmp3d array
             ! since the surface attenuation coefficient is not used
             ztmp3d(ji,jj,1) =       qsr(ji,jj)
@@ -269,5 +269,5 @@
          END_3D
          !
-         DEALLOCATE( ze0 , ze1 , ze2 , ze3 , ztmp3d ) 
+         DEALLOCATE( ze0 , ze1 , ze2 , ze3 , ztmp3d )
          !
       CASE( np_2BD  )            !==  2-bands fluxes  ==!
@@ -278,5 +278,5 @@
             zc0 = zz0 * EXP( -gdepw(ji,jj,jk  ,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk  ,Kmm)*xsi1r )
             zc1 = zz0 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi1r )
-            qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0 * wmask(ji,jj,jk) - zc1 * wmask(ji,jj,jk+1) ) 
+            qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0 * wmask(ji,jj,jk) - zc1 * wmask(ji,jj,jk+1) )
          END_3D
          !
@@ -341,5 +341,5 @@
       !!      from two length scale of penetration (rn_si0,rn_si1) and a ratio
       !!      (rn_abs). These parameters are read in the namtra_qsr namelist. The
-      !!      default values correspond to clear water (type I in Jerlov' 
+      !!      default values correspond to clear water (type I in Jerlov'
       !!      (1968) classification.
       !!         called by tra_qsr at the first timestep (nit000)
@@ -391,5 +391,5 @@
          &                               ' 2 bands, 3 RGB bands or bio-model light penetration' )
       !
-      IF( ln_qsr_rgb .AND. nn_chldta == 0 )   nqsr = np_RGB 
+      IF( ln_qsr_rgb .AND. nn_chldta == 0 )   nqsr = np_RGB
       IF( ln_qsr_rgb .AND. nn_chldta == 1 )   nqsr = np_RGBc
       IF( ln_qsr_2bd                      )   nqsr = np_2BD
@@ -401,11 +401,11 @@
       !
       SELECT CASE( nqsr )
-      !                               
+      !
       CASE( np_RGB , np_RGBc )         !==  Red-Green-Blue light penetration  ==!
-         !                             
+         !
          IF(lwp)   WRITE(numout,*) '   ==>>>   R-G-B   light penetration '
          !
          CALL trc_oce_rgb( rkrgb )                 ! tabulated attenuation coef.
-         !                                   
+         !
          nksr = trc_oce_ext_lev( r_si2, 33._wp )   ! level of light extinction
          !
@@ -441,5 +441,5 @@
          !
          CALL trc_oce_rgb( rkrgb )                 ! tabulated attenuation coef.
-         !                                   
+         !
          nksr = trc_oce_ext_lev( r_si2, 33._wp )   ! level of light extinction
          !
Index: /NEMO/trunk/src/OCE/TRA/trasbc.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/trasbc.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/trasbc.F90	(revision 14072)
@@ -9,5 +9,5 @@
    !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps
    !!             -   !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC
-   !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing 
+   !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing
    !!            4.1  !  2019-09  (P. Mathiot) isf moved in traisf
    !!----------------------------------------------------------------------
@@ -21,10 +21,10 @@
    USE phycst         ! physical constant
    USE eosbn2         ! Equation Of State
-   USE sbcmod         ! ln_rnf  
-   USE sbcrnf         ! River runoff  
+   USE sbcmod         ! ln_rnf
+   USE sbcrnf         ! River runoff
    USE traqsr         ! solar radiation penetration
    USE trd_oce        ! trends: ocean variables
-   USE trdtra         ! trends manager: tracers 
-#if defined key_asminc   
+   USE trdtra         ! trends manager: tracers
+#if defined key_asminc
    USE asminc         ! Assimilation increment
 #endif
@@ -54,12 +54,12 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_sbc  ***
-      !!                   
+      !!
       !! ** Purpose :   Compute the tracer surface boundary condition trend of
       !!      (flux through the interface, concentration/dilution effect)
       !!      and add it to the general trend of tracer equations.
       !!
-      !! ** Method :   The (air+ice)-sea flux has two components: 
-      !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface); 
-      !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice. 
+      !! ** Method :   The (air+ice)-sea flux has two components:
+      !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface);
+      !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice.
       !!               The input forcing fields (emp, rnf, sfx) contain Fext+Fwe,
       !!             they are simply added to the tracer trend (ts(Krhs)).
@@ -69,5 +69,5 @@
       !!             concentration/dilution effect associated with water exchanges.
       !!
-      !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend 
+      !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend
       !!              - send trends to trdtra module for further diagnostics(l_trdtra=T)
       !!----------------------------------------------------------------------
@@ -143,5 +143,5 @@
          sbc_tsc(ji,jj,jp_sal) = r1_rho0     * sfx(ji,jj)   ! salt flux due to freezing/melting
       END_2D
-      IF( ln_linssh ) THEN                !* linear free surface  
+      IF( ln_linssh ) THEN                !* linear free surface
          DO_2D( isj, iej, isi, iei )                    !==>> add concentration/dilution effect due to constant volume cell
             sbc_tsc(ji,jj,jp_tem) = sbc_tsc(ji,jj,jp_tem) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_tem,Kmm)
@@ -161,5 +161,5 @@
          END_2D
       END DO
-      !                  
+      !
       IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
          IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==!
@@ -173,5 +173,5 @@
       !----------------------------------------
       !
-      IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff 
+      IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff
          zfact = 0.5_wp
          DO_2D( 0, 0, 0, 0 )
@@ -182,5 +182,5 @@
                                         &                      +  ( rnf_tsc_b(ji,jj,jp_tem) + rnf_tsc(ji,jj,jp_tem) ) * zdep
                   IF( ln_rnf_sal )   pts(ji,jj,jk,jp_sal,Krhs) = pts(ji,jj,jk,jp_sal,Krhs)                                  &
-                                        &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep 
+                                        &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep
                END DO
             ENDIF
@@ -201,5 +201,5 @@
       IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation
       	 !
-         IF( ln_linssh ) THEN 
+         IF( ln_linssh ) THEN
             DO_2D( 0, 0, 0, 0 )
                ztim = ssh_iau(ji,jj) / e3t(ji,jj,1,Kmm)
Index: /NEMO/trunk/src/OCE/TRA/trazdf.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/trazdf.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/trazdf.F90	(revision 14072)
@@ -17,8 +17,8 @@
    USE phycst         ! physical constant
    USE zdf_oce        ! ocean vertical physics variables
-   USE zdfmfc         ! Mass FLux Convection 
+   USE zdfmfc         ! Mass FLux Convection
    USE sbc_oce        ! surface boundary condition: ocean
    USE ldftra         ! lateral diffusion: eddy diffusivity
-   USE ldfslp         ! lateral diffusion: iso-neutral slope 
+   USE ldfslp         ! lateral diffusion: iso-neutral slope
    USE trd_oce        ! trends: ocean variables
    USE trdtra         ! trends: tracer trend manager
@@ -77,5 +77,5 @@
       !
       !                                      !* compute lateral mixing trend and add it to the general trend
-      CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts ) 
+      CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts )
 
 !!gm WHY here !   and I don't like that !
@@ -113,13 +113,13 @@
    END SUBROUTINE tra_zdf
 
- 
-   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt ) 
+
+   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_zdf_imp  ***
       !!
       !! ** Purpose :   Compute the after tracer through a implicit computation
-      !!     of the vertical tracer diffusion (including the vertical component 
-      !!     of lateral mixing (only for 2nd order operator, for fourth order 
-      !!     it is already computed and add to the general trend in traldf) 
+      !!     of the vertical tracer diffusion (including the vertical component
+      !!     of lateral mixing (only for 2nd order operator, for fourth order
+      !!     it is already computed and add to the general trend in traldf)
       !!
       !! ** Method  :  The vertical diffusion of a tracer ,t , is given by:
@@ -169,8 +169,8 @@
             zwt(:,:,1) = 0._wp
             !
-            IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution 
-               IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator 
+            IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution
+               IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator
                   DO_3D( 0, 0, 0, 0, 2, jpkm1 )
-                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)  
+                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)
                   END_3D
                ELSE                          ! standard or triad iso-neutral operator
@@ -220,5 +220,5 @@
             !   The solution will be in the 4d array pta.
             !   The 3d array zwt is used as a work space array.
-            !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then 
+            !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then
             !   used as a work space array: its value is modified.
             !
@@ -230,6 +230,6 @@
             END_3D
             !
-         ENDIF 
-         !         
+         ENDIF
+         !
          ! Modification of rhs to add MF scheme
          IF ( ln_zdfmfc ) THEN
@@ -239,5 +239,5 @@
          DO_2D( 0, 0, 0, 0 )         !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1
             pt(ji,jj,1,jn,Kaa) =        e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb)    &
-               &               + p2dt * e3t(ji,jj,1,Kmm) * pt(ji,jj,1,jn,Krhs) 
+               &               + p2dt * e3t(ji,jj,1,Kmm) * pt(ji,jj,1,jn,Krhs)
          END_2D
          DO_3D( 0, 0, 0, 0, 2, jpkm1 )
Index: /NEMO/trunk/src/OCE/TRA/zpshde.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRA/zpshde.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRA/zpshde.F90	(revision 14072)
@@ -7,8 +7,8 @@
    !!   NEMO     1.0  !  2002-08  (G. Madec E. Durand)  Optimization and Free form
    !!             -   !  2004-03  (C. Ethe)  adapted for passive tracers
-   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA 
+   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA
    !!            3.6  !  2014-11  (P. Mathiot) Add zps_hde_isf (needed to open a cavity)
    !!======================================================================
-   
+
    !!----------------------------------------------------------------------
    !!   zps_hde      :  Horizontal DErivative of T, S and rd at the last
@@ -66,19 +66,19 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE zps_hde  ***
-      !!                    
+      !!
       !! ** Purpose :   Compute the horizontal derivative of T, S and rho
       !!      at u- and v-points with a linear interpolation for z-coordinate
       !!      with partial steps.
       !!
-      !! ** Method  :   In z-coord with partial steps, scale factors on last 
-      !!      levels are different for each grid point, so that T, S and rd 
+      !! ** Method  :   In z-coord with partial steps, scale factors on last
+      !!      levels are different for each grid point, so that T, S and rd
       !!      points are not at the same depth as in z-coord. To have horizontal
-      !!      gradients again, we interpolate T and S at the good depth : 
-      !!      Linear interpolation of T, S   
+      !!      gradients again, we interpolate T and S at the good depth :
+      !!      Linear interpolation of T, S
       !!         Computation of di(tb) and dj(tb) by vertical interpolation:
       !!          di(t) = t~ - t(i,j,k) or t(i+1,j,k) - t~
       !!          dj(t) = t~ - t(i,j,k) or t(i,j+1,k) - t~
       !!         This formulation computes the two cases:
-      !!                 CASE 1                   CASE 2  
+      !!                 CASE 1                   CASE 2
       !!         k-1  ___ ___________   k-1   ___ ___________
       !!                    Ti  T~                  T~  Ti+1
@@ -87,5 +87,5 @@
       !!                  |   |____                ____|   |
       !!              ___ |   |   |           ___  |   |   |
-      !!                  
+      !!
       !!      case 1->   e3w(i+1,:,:,Kmm) >= e3w(i,:,:,Kmm) ( and e3w(:,j+1,:,Kmm) >= e3w(:,j,:,Kmm) ) then
       !!          t~ = t(i+1,j  ,k) + (e3w(i+1,j,k,Kmm) - e3w(i,j,k,Kmm)) * dk(Ti+1)/e3w(i+1,j,k,Kmm)
@@ -95,5 +95,5 @@
       !!          t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i+1,j,k,Kmm)) * dk(Ti)/e3w(i,j,k,Kmm)
       !!        ( t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i,j+1,k,Kmm)) * dk(Tj)/e3w(i,j,k,Kmm) )
-      !!          Idem for di(s) and dj(s)          
+      !!          Idem for di(s) and dj(s)
       !!
       !!      For rho, we call eos which will compute rd~(t~,s~) at the right
@@ -175,5 +175,5 @@
       !
       IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
-      !                
+      !
       IF( PRESENT( prd ) ) THEN    !==  horizontal derivative of density anomalies (rd)  ==!    (optional part)
          pgru(:,:) = 0._wp
@@ -192,6 +192,6 @@
          END_2D
          !
-         CALL eos( zti, zhi, zri )        ! interpolated density from zti, ztj 
-         CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj 
+         CALL eos( zti, zhi, zri )        ! interpolated density from zti, ztj
+         CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj
          !
          DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )              ! Gradient of density at the last level
@@ -244,20 +244,20 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE zps_hde_isf  ***
-      !!                    
+      !!
       !! ** Purpose :   Compute the horizontal derivative of T, S and rho
       !!      at u- and v-points with a linear interpolation for z-coordinate
       !!      with partial steps for top (ice shelf) and bottom.
       !!
-      !! ** Method  :   In z-coord with partial steps, scale factors on last 
-      !!      levels are different for each grid point, so that T, S and rd 
+      !! ** Method  :   In z-coord with partial steps, scale factors on last
+      !!      levels are different for each grid point, so that T, S and rd
       !!      points are not at the same depth as in z-coord. To have horizontal
       !!      gradients again, we interpolate T and S at the good depth :
       !!      For the bottom case:
-      !!      Linear interpolation of T, S   
+      !!      Linear interpolation of T, S
       !!         Computation of di(tb) and dj(tb) by vertical interpolation:
       !!          di(t) = t~ - t(i,j,k) or t(i+1,j,k) - t~
       !!          dj(t) = t~ - t(i,j,k) or t(i,j+1,k) - t~
       !!         This formulation computes the two cases:
-      !!                 CASE 1                   CASE 2  
+      !!                 CASE 1                   CASE 2
       !!         k-1  ___ ___________   k-1   ___ ___________
       !!                    Ti  T~                  T~  Ti+1
@@ -266,5 +266,5 @@
       !!                  |   |____                ____|   |
       !!              ___ |   |   |           ___  |   |   |
-      !!                  
+      !!
       !!      case 1->   e3w(i+1,j,k,Kmm) >= e3w(i,j,k,Kmm) ( and e3w(i,j+1,k,Kmm) >= e3w(i,j,k,Kmm) ) then
       !!          t~ = t(i+1,j  ,k) + (e3w(i+1,j  ,k,Kmm) - e3w(i,j,k,Kmm)) * dk(Ti+1)/e3w(i+1,j  ,k,Kmm)
@@ -274,5 +274,5 @@
       !!          t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i+1,j  ,k,Kmm)) * dk(Ti)/e3w(i,j,k,Kmm)
       !!        ( t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i  ,j+1,k,Kmm)) * dk(Tj)/e3w(i,j,k,Kmm) )
-      !!          Idem for di(s) and dj(s)          
+      !!          Idem for di(s) and dj(s)
       !!
       !!      For rho, we call eos which will compute rd~(t~,s~) at the right
@@ -364,5 +364,5 @@
       ! horizontal derivative of density anomalies (rd)
       IF( PRESENT( prd ) ) THEN         ! depth of the partial step level
-         pgru(:,:)=0.0_wp   ; pgrv(:,:)=0.0_wp ; 
+         pgru(:,:)=0.0_wp   ; pgrv(:,:)=0.0_wp ;
          !
          DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
@@ -418,5 +418,5 @@
             ! the only common depth between cells (i,j) and (i,j+1) is gdepw_0
             ze3wu  =  gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm)
-            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 
+            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm)
 
             ! i- direction
@@ -463,5 +463,5 @@
             ikv = mikv(ji,jj)
             ze3wu  =  gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm)
-            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 
+            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm)
             !
             IF( ze3wu >= 0._wp ) THEN   ;   zhi(ji,jj) = gdept(ji  ,jj,iku,Kmm)    ! i-direction: case 1
@@ -475,12 +475,12 @@
          END_2D
          !
-         CALL eos( zti, zhi, zri )        ! interpolated density from zti, ztj 
-         CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj 
-         !
-         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
-            iku = miku(ji,jj) 
-            ikv = mikv(ji,jj) 
+         CALL eos( zti, zhi, zri )        ! interpolated density from zti, ztj
+         CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj
+         !
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+            iku = miku(ji,jj)
+            ikv = mikv(ji,jj)
             ze3wu  =  gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm)
-            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 
+            ze3wv  =  gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm)
 
             IF( ze3wu >= 0._wp ) THEN ; pgrui(ji,jj) = ssumask(ji,jj) * ( zri(ji  ,jj      ) - prd(ji,jj,iku) ) ! i: 1
@@ -494,5 +494,5 @@
          IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgrui, 'U', -1.0_wp , pgrvi, 'V', -1.0_wp )   ! Lateral boundary conditions
          !
-      END IF  
+      END IF
       !
       IF( ln_timing )   CALL timing_stop( 'zps_hde_isf')
Index: /NEMO/trunk/src/OCE/TRD/trdini.F90
===================================================================
--- /NEMO/trunk/src/OCE/TRD/trdini.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/TRD/trdini.F90	(revision 14072)
@@ -17,5 +17,5 @@
    USE trdglo         ! trends: global domain averaged tracers and dynamics
    USE trdmxl         ! trends: mixed layer averaged trends (tracer only)
-   USE trdvor         ! trends: vertical averaged vorticity 
+   USE trdvor         ! trends: vertical averaged vorticity
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
@@ -36,5 +36,5 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE trd_init  ***
-      !! 
+      !!
       !! ** Purpose :   Initialization of trend diagnostics
       !!----------------------------------------------------------------------
@@ -43,5 +43,5 @@
       !!
       NAMELIST/namtrd/ ln_dyn_trd, ln_KE_trd, ln_vor_trd, ln_dyn_mxl,   &
-         &             ln_tra_trd, ln_PE_trd, ln_glo_trd, ln_tra_mxl, nn_trd 
+         &             ln_tra_trd, ln_PE_trd, ln_glo_trd, ln_tra_mxl, nn_trd
       !!----------------------------------------------------------------------
       !
@@ -70,8 +70,8 @@
       ENDIF
       !
-      !                             ! trend extraction flags  
-      l_trdtra = .FALSE.                                                       ! tracers  
+      !                             ! trend extraction flags
+      l_trdtra = .FALSE.                                                       ! tracers
       IF ( ln_tra_trd .OR. ln_PE_trd .OR. ln_tra_mxl .OR.   &
-         & ln_glo_trd                                       )   l_trdtra = .TRUE. 
+         & ln_glo_trd                                       )   l_trdtra = .TRUE.
       !
       l_trddyn = .FALSE.                                                       ! momentum
@@ -80,5 +80,5 @@
       !
 
-!!gm check the stop below      
+!!gm check the stop below
       IF( ln_dyn_mxl )   CALL ctl_stop( 'ML diag on momentum are not yet coded we stop' )
       !
@@ -97,9 +97,9 @@
 
 !!gm  : Potential BUG : 3D output only for vector invariant form!  add a ctl_stop or code the flux form case
-!!gm  : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output... 
+!!gm  : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output...
 
-      !                             ! diagnostic initialization  
+      !                             ! diagnostic initialization
       IF( ln_glo_trd )   CALL trd_glo_init( Kmm )      ! global domain averaged trends
-      IF( ln_tra_mxl )   CALL trd_mxl_init      ! mixed-layer          trends  
+      IF( ln_tra_mxl )   CALL trd_mxl_init      ! mixed-layer          trends
       IF( ln_vor_trd )   CALL trd_vor_init      ! barotropic vorticity trends
       IF( ln_KE_trd  )   CALL trd_ken_init      ! 3D Kinetic    energy trends
Index: /NEMO/trunk/src/OCE/USR/usrdef_nam.F90
===================================================================
--- /NEMO/trunk/src/OCE/USR/usrdef_nam.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/USR/usrdef_nam.F90	(revision 14072)
@@ -12,5 +12,5 @@
    !!----------------------------------------------------------------------
    !!   usr_def_nam   : read user defined namelist and set global domain size
-   !!   usr_def_hgr   : initialize the horizontal mesh 
+   !!   usr_def_hgr   : initialize the horizontal mesh
    !!----------------------------------------------------------------------
    USE dom_oce
@@ -20,5 +20,5 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   
+
    IMPLICIT NONE
    PRIVATE
@@ -32,5 +32,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -40,5 +40,5 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE dom_nam  ***
-      !!                    
+      !!
       !! ** Purpose :   read user defined namelist and define the domain size
       !!
@@ -51,6 +51,6 @@
       CHARACTER(len=*), INTENT(out) ::   cd_cfg          ! configuration name
       INTEGER         , INTENT(out) ::   kk_cfg          ! configuration resolution
-      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes 
-      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c. 
+      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
+      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c.
       !
       INTEGER ::   ios   ! Local integer
Index: /NEMO/trunk/src/OCE/ZDF/zdf_oce.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdf_oce.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdf_oce.F90	(revision 14072)
@@ -41,5 +41,5 @@
    LOGICAL , PUBLIC ::   ln_zdfiwm   !: internal wave-induced mixing flag
    LOGICAL , PUBLIC ::   ln_zdfmfc   !: convection: eddy diffusivity Mass Flux Convection
-   !                             ! coefficients 
+   !                             ! coefficients
    REAL(wp), PUBLIC ::   rn_avm0     !: vertical eddy viscosity (m2/s)
    REAL(wp), PUBLIC ::   rn_avt0     !: vertical eddy diffusivity (m2/s)
@@ -56,5 +56,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -67,5 +67,5 @@
       !
       ALLOCATE( avm (jpi,jpj,jpk) , avm_k(jpi,jpj,jpk) , avs(jpi,jpj,jpk) ,   &
-         &      avt (jpi,jpj,jpk) , avt_k(jpi,jpj,jpk) , en (jpi,jpj,jpk) ,   & 
+         &      avt (jpi,jpj,jpk) , avt_k(jpi,jpj,jpk) , en (jpi,jpj,jpk) ,   &
          &      avmb(jpk)         , avtb(jpk)          , avtb_2d(jpi,jpj) , STAT = zdf_oce_alloc )
          !
Index: /NEMO/trunk/src/OCE/ZDF/zdfgls.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdfgls.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdfgls.F90	(revision 14072)
@@ -2,10 +2,10 @@
    !!======================================================================
    !!                       ***  MODULE  zdfgls  ***
-   !! Ocean physics:  vertical mixing coefficient computed from the gls 
+   !! Ocean physics:  vertical mixing coefficient computed from the gls
    !!                 turbulent closure parameterization
    !!======================================================================
    !! History :  3.0  !  2009-09  (G. Reffray)  Original code
    !!            3.3  !  2010-10  (C. Bricaud)  Add in the reference
-   !!            4.0  !  2017-04  (G. Madec)  remove CPP keys & avm at t-point only 
+   !!            4.0  !  2017-04  (G. Madec)  remove CPP keys & avm at t-point only
    !!             -   !  2017-05  (G. Madec)  add top friction as boundary condition
    !!----------------------------------------------------------------------
@@ -16,5 +16,5 @@
    !!   gls_rst       : read/write gls restart in ocean restart file
    !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and active tracers 
+   USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
    USE domvvl         ! ocean space and time domain : variable volume layer
@@ -64,9 +64,9 @@
    REAL(wp) ::   rn_hsro           ! Minimum surface roughness
    REAL(wp) ::   rn_hsri           ! Ice ocean roughness
-   REAL(wp) ::   rn_frac_hs        ! Fraction of wave height as surface roughness (if nn_z0_met > 1) 
+   REAL(wp) ::   rn_frac_hs        ! Fraction of wave height as surface roughness (if nn_z0_met > 1)
 
    REAL(wp) ::   rcm_sf        =  0.73_wp     ! Shear free turbulence parameters
-   REAL(wp) ::   ra_sf         = -2.0_wp      ! Must be negative -2 < ra_sf < -1 
-   REAL(wp) ::   rl_sf         =  0.2_wp      ! 0 <rl_sf<vkarmn    
+   REAL(wp) ::   ra_sf         = -2.0_wp      ! Must be negative -2 < ra_sf < -1
+   REAL(wp) ::   rl_sf         =  0.2_wp      ! 0 <rl_sf<vkarmn
    REAL(wp) ::   rghmin        = -0.28_wp
    REAL(wp) ::   rgh0          =  0.0329_wp
@@ -75,6 +75,6 @@
    REAL(wp) ::   ra2           =  0.74_wp
    REAL(wp) ::   rb1           = 16.60_wp
-   REAL(wp) ::   rb2           = 10.10_wp         
-   REAL(wp) ::   re2           =  1.33_wp         
+   REAL(wp) ::   rb2           = 10.10_wp
+   REAL(wp) ::   re2           =  1.33_wp
    REAL(wp) ::   rl1           =  0.107_wp
    REAL(wp) ::   rl2           =  0.0032_wp
@@ -146,5 +146,5 @@
       INTEGER  ::   itop, itopp1  !   -       -
       REAL(wp) ::   zesh2, zsigpsi, zcoef, zex1 , zex2  ! local scalars
-      REAL(wp) ::   ztx2, zty2, zup, zdown, zcof, zdir  !   -      - 
+      REAL(wp) ::   ztx2, zty2, zup, zdown, zcof, zdir  !   -      -
       REAL(wp) ::   zratio, zrn2, zflxb, sh     , z_en  !   -      -
       REAL(wp) ::   prod, buoy, diss, zdiss, sm         !   -      -
@@ -153,5 +153,5 @@
       REAL(wp), DIMENSION(jpi,jpj)     ::   zdep
       REAL(wp), DIMENSION(jpi,jpj)     ::   zkar
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zflxs       ! Turbulence fluxed induced by internal waves 
+      REAL(wp), DIMENSION(jpi,jpj)     ::   zflxs       ! Turbulence fluxed induced by internal waves
       REAL(wp), DIMENSION(jpi,jpj)     ::   zhsro       ! Surface roughness (surface waves)
       REAL(wp), DIMENSION(jpi,jpj)     ::   zice_fra    ! Tapering of wave breaking under sea ice
@@ -167,5 +167,5 @@
       ! Preliminary computing
 
-      ustar2_surf(:,:) = 0._wp   ;         psi(:,:,:) = 0._wp   
+      ustar2_surf(:,:) = 0._wp   ;         psi(:,:,:) = 0._wp
       ustar2_top (:,:) = 0._wp   ;   zwall_psi(:,:,:) = 0._wp
       ustar2_bot (:,:) = 0._wp
@@ -177,5 +177,5 @@
       CASE( 3 )   ;   zice_fra(:,:) = MIN( 4._wp * fr_i(:,:) , 1._wp )
       END SELECT
-      
+
       ! Compute surface, top and bottom friction at T-points
       DO_2D( 0, 0, 0, 0 )          !==  surface ocean friction
@@ -184,5 +184,5 @@
       !
       !!gm Rq we may add here r_ke0(_top/_bot) ?  ==>> think about that...
-      !    
+      !
       IF( .NOT.ln_drg_OFF ) THEN     !== top/bottom friction   (explicit before friction)
          DO_2D( 0, 0, 0, 0 )         ! bottom friction (explicit before friction)
@@ -201,7 +201,7 @@
          ENDIF
       ENDIF
-   
+
       SELECT CASE ( nn_z0_met )      !==  Set surface roughness length  ==!
-      CASE ( 0 )                          ! Constant roughness          
+      CASE ( 0 )                          ! Constant roughness
          zhsro(:,:) = rn_hsro
       CASE ( 1 )             ! Standard Charnock formula
@@ -271,5 +271,5 @@
          IF( ln_sigpsi ) THEN
             zsigpsi = MIN( 1._wp, zesh2 / eps(ji,jj,jk) )     ! 0. <= zsigpsi <= 1.
-            zwall_psi(ji,jj,jk) = rsc_psi /   & 
+            zwall_psi(ji,jj,jk) = rsc_psi /   &
                &     (  zsigpsi * rsc_psi + (1._wp-zsigpsi) * rsc_psi0 / MAX( zwall(ji,jj,jk), 1._wp )  )
          ELSE
@@ -286,5 +286,5 @@
             &                 / ( e3t(ji,jj,jk  ,Kmm) * e3w(ji,jj,jk,Kmm) )
          !                                        ! diagonal
-         zdiag(ji,jj,jk) = 1._wp - zd_lw(ji,jj,jk) - zd_up(ji,jj,jk)  + rn_Dt * zdiss * wmask(ji,jj,jk) 
+         zdiag(ji,jj,jk) = 1._wp - zd_lw(ji,jj,jk) - zd_up(ji,jj,jk)  + rn_Dt * zdiss * wmask(ji,jj,jk)
          !                                        ! right hand side in en
          en(ji,jj,jk) = en(ji,jj,jk) + rn_Dt * zesh2 * wmask(ji,jj,jk)
@@ -302,5 +302,5 @@
       SELECT CASE ( nn_bc_surf )
       !
-      CASE ( 0 )             ! Dirichlet boundary condition (set e at k=1 & 2) 
+      CASE ( 0 )             ! Dirichlet boundary condition (set e at k=1 & 2)
       ! First level
       en   (:,:,1) = MAX(  rn_emin , rc02r * ustar2_surf(:,:) * (1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1)**r2_3  )
@@ -308,9 +308,9 @@
       zd_up(:,:,1) = 0._wp
       zdiag(:,:,1) = 1._wp
-      ! 
+      !
       ! One level below
       en   (:,:,2) =  MAX(  rc02r * ustar2_surf(:,:) * (  1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1 * ((zhsro(:,:)+gdepw(:,:,2,Kmm)) &
          &                 / zhsro(:,:) )**(1.5_wp*ra_sf)  )**(2._wp/3._wp) , rn_emin   )
-      zd_lw(:,:,2) = 0._wp 
+      zd_lw(:,:,2) = 0._wp
       zd_up(:,:,2) = 0._wp
       zdiag(:,:,2) = 1._wp
@@ -345,5 +345,5 @@
       SELECT CASE ( nn_bc_bot )
       !
-      CASE ( 0 )             ! Dirichlet 
+      CASE ( 0 )             ! Dirichlet
          !                      ! en(ibot) = u*^2 / Co2 and hmxl_n(ibot) = rn_lmin
          !                      ! Balance between the production and the dissipation terms
@@ -357,6 +357,6 @@
             z_en =  MAX( rc02r * ustar2_bot(ji,jj), rn_emin )
             !
-            ! Dirichlet condition applied at: 
-            !     Bottom level (ibot)      &      Just above it (ibotm1)   
+            ! Dirichlet condition applied at:
+            !     Bottom level (ibot)      &      Just above it (ibotm1)
             zd_lw(ji,jj,ibot) = 0._wp   ;   zd_lw(ji,jj,ibotm1) = 0._wp
             zd_up(ji,jj,ibot) = 0._wp   ;   zd_up(ji,jj,ibotm1) = 0._wp
@@ -373,6 +373,6 @@
                !
  !!gm TO BE VERIFIED !!!
-               ! Dirichlet condition applied at: 
-               !     top level (itop)         &      Just below it (itopp1)   
+               ! Dirichlet condition applied at:
+               !     top level (itop)         &      Just below it (itopp1)
                zd_lw(ji,jj,itop) = 0._wp   ;   zd_lw(ji,jj,itopp1) = 0._wp
                zd_up(ji,jj,itop) = 0._wp   ;   zd_up(ji,jj,itopp1) = 0._wp
@@ -383,5 +383,5 @@
          !
       CASE ( 1 )             ! Neumman boundary condition
-         !                      
+         !
          DO_2D( 0, 0, 0, 0 )
             ibot   = mbkt(ji,jj) + 1      ! k   bottom level of w-point
@@ -391,5 +391,5 @@
             !
             ! Bottom level Dirichlet condition:
-            !     Bottom level (ibot)      &      Just above it (ibotm1)   
+            !     Bottom level (ibot)      &      Just above it (ibotm1)
             !         Dirichlet            !         Neumann
             zd_lw(ji,jj,ibot) = 0._wp   !   ! Remove zd_up from zdiag
@@ -405,5 +405,5 @@
                !
                ! Bottom level Dirichlet condition:
-               !     Bottom level (ibot)      &      Just above it (ibotm1)   
+               !     Bottom level (ibot)      &      Just above it (ibotm1)
                !         Dirichlet            !         Neumann
                zd_lw(ji,jj,itop) = 0._wp   !   ! Remove zd_up from zdiag
@@ -427,5 +427,5 @@
          en(ji,jj,jk) = ( zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) * en(ji,jj,jk+1) ) / zdiag(ji,jj,jk)
       END_3D
-      !                                            ! set the minimum value of tke 
+      !                                            ! set the minimum value of tke
       en(:,:,:) = MAX( en(:,:,:), rn_emin )
 
@@ -455,5 +455,5 @@
       CASE( 3 )               ! generic
          DO_3D( 0, 0, 0, 0, 2, jpkm1 )
-            psi(ji,jj,jk)  = rc02 * eb(ji,jj,jk) * hmxl_b(ji,jj,jk)**rnn 
+            psi(ji,jj,jk)  = rc02 * eb(ji,jj,jk) * hmxl_b(ji,jj,jk)**rnn
          END_3D
          !
@@ -470,5 +470,5 @@
          !
          ! psi / k
-         zratio = psi(ji,jj,jk) / eb(ji,jj,jk) 
+         zratio = psi(ji,jj,jk) / eb(ji,jj,jk)
          !
          ! psi3+ : stable : B=-KhN²<0 => N²>0 if rn2>0 zdir = 1 (stable) otherwise zdir = 0 (unstable)
@@ -490,5 +490,5 @@
          zesh2 = zdir * ( prod + buoy )          + (1._wp - zdir ) * prod                        ! production term
          zdiss = zdir * ( diss / psi(ji,jj,jk) ) + (1._wp - zdir ) * (diss-buoy) / psi(ji,jj,jk) ! dissipation term
-         !                                                        
+         !
          ! building the matrix
          zcof = rfact_psi * zwall_psi(ji,jj,jk) * tmask(ji,jj,jk)
@@ -528,5 +528,5 @@
          zd_up(:,:,2) = 0._wp
          zdiag(:,:,2) = 1._wp
-         ! 
+         !
       CASE ( 1 )             ! Neumann boundary condition on d(psi)/dz
          !
@@ -564,5 +564,5 @@
       SELECT CASE ( nn_bc_bot )     ! bottom boundary
       !
-      CASE ( 0 )             ! Dirichlet 
+      CASE ( 0 )             ! Dirichlet
          !                      ! en(ibot) = u*^2 / Co2 and hmxl_n(ibot) = vkarmn * r_z0_bot
          !                      ! Balance between the production and the dissipation terms
@@ -585,5 +585,5 @@
          !
       CASE ( 1 )             ! Neumman boundary condition
-         !                      
+         !
          DO_2D( 0, 0, 0, 0 )
             ibot   = mbkt(ji,jj) + 1      ! k   bottom level of w-point
@@ -641,5 +641,5 @@
       CASE( 2 )               ! k-w
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-            eps(ji,jj,jk) = rc04 * en(ji,jj,jk) * psi(ji,jj,jk) 
+            eps(ji,jj,jk) = rc04 * en(ji,jj,jk) * psi(ji,jj,jk)
          END_3D
          !
@@ -660,5 +660,5 @@
          eps   (ji,jj,jk)  = MAX( eps(ji,jj,jk), rn_epsmin )
          hmxl_n(ji,jj,jk)  = rc03 * en(ji,jj,jk) * SQRT( en(ji,jj,jk) ) / eps(ji,jj,jk)
-         ! Galperin criterium (NOTE : Not required if the proper value of C3 in stable cases is calculated) 
+         ! Galperin criterium (NOTE : Not required if the proper value of C3 in stable cases is calculated)
          zrn2 = MAX( rn2(ji,jj,jk), rsmall )
          IF( ln_length_lim )   hmxl_n(ji,jj,jk) = MIN(  rn_clim_galp * SQRT( 2._wp * en(ji,jj,jk) / zrn2 ), hmxl_n(ji,jj,jk) )
@@ -720,5 +720,5 @@
 
       ! default value, in case jpk > mbkt(ji,jj)+1. Not needed but avoid a bug when looking for undefined values (-fpe0)
-      zstm(:,:,jpk) = 0.  
+      zstm(:,:,jpk) = 0.
       DO_2D( 0, 0, 0, 0 )             ! update bottom with good values
          zstm(ji,jj,mbkt(ji,jj)+1) = zstm(ji,jj,mbkt(ji,jj))
@@ -756,6 +756,6 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE zdf_gls_init  ***
-      !!                     
-      !! ** Purpose :   Initialization of the vertical eddy diffivity and 
+      !!
+      !! ** Purpose :   Initialization of the vertical eddy diffivity and
       !!              viscosity computed using a GLS turbulent closure scheme
       !!
@@ -983,10 +983,10 @@
          !
       END SELECT
-    
+
       !                                !* Set Schmidt number for psi diffusion in the wave breaking case
       !                                     ! See Eq. (13) of Carniel et al, OM, 30, 225-239, 2009
       !                                     !  or Eq. (17) of Burchard, JPO, 31, 3133-3145, 2001
       IF( ln_sigpsi ) THEN
-         ra_sf = -1.5 ! Set kinetic energy slope, then deduce rsc_psi and rl_sf 
+         ra_sf = -1.5 ! Set kinetic energy slope, then deduce rsc_psi and rl_sf
          ! Verification: retrieve Burchard (2001) results by uncomenting the line below:
          ! Note that the results depend on the value of rn_cm_sf which is constant (=rc0) in his work
@@ -996,5 +996,5 @@
          rsc_psi0 = rsc_psi
       ENDIF
- 
+
       !                                !* Shear free turbulence parameters
       !
@@ -1039,11 +1039,11 @@
       rc04  = rc03 * rc0
       rsbc_tke1 = -3._wp/2._wp*rn_crban*ra_sf*rl_sf                      ! Dirichlet + Wave breaking
-      rsbc_tke2 = rn_Dt * rn_crban / rl_sf                                 ! Neumann + Wave breaking 
+      rsbc_tke2 = rn_Dt * rn_crban / rl_sf                                 ! Neumann + Wave breaking
       zcr = MAX(rsmall, rsbc_tke1**(1./(-ra_sf*3._wp/2._wp))-1._wp )
-      rtrans = 0.2_wp / zcr                                              ! Ad. inverse transition length between log and wave layer 
+      rtrans = 0.2_wp / zcr                                              ! Ad. inverse transition length between log and wave layer
       rsbc_zs1  = rn_charn/grav                                          ! Charnock formula for surface roughness
-      rsbc_zs2  = rn_frac_hs / 0.85_wp / grav * 665._wp                  ! Rascle formula for surface roughness 
+      rsbc_zs2  = rn_frac_hs / 0.85_wp / grav * 665._wp                  ! Rascle formula for surface roughness
       rsbc_psi1 = -0.5_wp * rn_Dt * rc0**(rpp-2._wp*rmm) / rsc_psi
-      rsbc_psi2 = -0.5_wp * rn_Dt * rc0**rpp * rnn * vkarmn**rnn / rsc_psi ! Neumann + NO Wave breaking 
+      rsbc_psi2 = -0.5_wp * rn_Dt * rc0**rpp * rnn * vkarmn**rnn / rsc_psi ! Neumann + NO Wave breaking
       !
       rfact_tke = -0.5_wp / rsc_tke * rn_Dt                                ! Cst used for the Diffusion term of tke
@@ -1054,5 +1054,5 @@
       zwall(:,:,:) = 1._wp * tmask(:,:,:)
 
-      !                                !* read or initialize all required files  
+      !                                !* read or initialize all required files
       CALL gls_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, hmxl_n)
       !
@@ -1063,9 +1063,9 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE gls_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write TKE file (en) in restart file
       !!
       !! ** Method  :   use of IOM library
-      !!                if the restart does not contain TKE, en is either 
+      !!                if the restart does not contain TKE, en is either
       !!                set to rn_emin or recomputed (nn_igls/=0)
       !!----------------------------------------------------------------------
@@ -1081,5 +1081,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise
          !                                   ! ---------------
          IF( ln_rstart ) THEN                   !* Read the restart file
@@ -1094,5 +1094,5 @@
                CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k  )
                CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n )
-            ELSE                        
+            ELSE
                IF(lwp) WRITE(numout,*)
                IF(lwp) WRITE(numout,*) '   ==>>   previous run without GLS scheme, set en and hmxl_n to background values'
Index: /NEMO/trunk/src/OCE/ZDF/zdfosm.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdfosm.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdfosm.F90	(revision 14072)
@@ -146,5 +146,5 @@
    INTEGER :: idebug = 236
    INTEGER :: jdebug = 228
-   
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -309,5 +309,5 @@
       REAL(wp) :: zl_c,zl_l,zl_eps  ! Used to calculate turbulence length scale.
 
-      REAL(wp) :: za_cubic, zb_cubic, zc_cubic, zd_cubic ! coefficients in cubic polynomial specifying diffusivity in pycnocline.  
+      REAL(wp) :: za_cubic, zb_cubic, zc_cubic, zd_cubic ! coefficients in cubic polynomial specifying diffusivity in pycnocline.
       REAL(wp), DIMENSION(jpi,jpj) :: zsc_wth_1,zsc_ws_1 ! Temporary scales used to calculate scalar non-gradient terms.
       REAL(wp), DIMENSION(jpi,jpj) :: zsc_wth_pyc, zsc_ws_pyc ! Scales for pycnocline transport term/
@@ -665,10 +665,10 @@
 !
 !
-! Check to see if lpyc needs to be changed 
+! Check to see if lpyc needs to be changed
 
       CALL zdf_osm_pycnocline_thickness( dh, zdh )
 
       DO_2D( 0, 0, 0, 0 )
-       IF ( zdb_bl(ji,jj) < rn_osm_bl_thresh .or. ibld(ji,jj) + jp_ext(ji,jj) >= mbkt(ji,jj) .or. ibld(ji,jj)-imld(ji,jj) == 1 ) lpyc(ji,jj) = .FALSE. 
+       IF ( zdb_bl(ji,jj) < rn_osm_bl_thresh .or. ibld(ji,jj) + jp_ext(ji,jj) >= mbkt(ji,jj) .or. ibld(ji,jj)-imld(ji,jj) == 1 ) lpyc(ji,jj) = .FALSE.
       END_2D
 
@@ -790,9 +790,9 @@
                 ghams(ji,jj,jk) = ghams(ji,jj,jk) + 0.3 * 0.5 *  zsc_ws_1(ji,jj) * zl_eps * zhml(ji,jj) / ( 0.15 + zznd_ml )
              END DO
-             
+
              IF ( lpyc(ji,jj) ) THEN
                ztau_sc_u(ji,jj) = zhml(ji,jj) / ( zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 )**pthird
                ztau_sc_u(ji,jj) = ztau_sc_u(ji,jj) * ( 1.4 -0.4 / ( 1.0 + EXP( -3.5 * LOG10( -zhol(ji,jj) ) ) )**1.5 )
-               zwth_ent =  -0.003 * ( 0.15 * zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 )**pthird * ( 1.0 - zdh(ji,jj) /zhbl(ji,jj) ) * zdt_ml(ji,jj)                  
+               zwth_ent =  -0.003 * ( 0.15 * zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 )**pthird * ( 1.0 - zdh(ji,jj) /zhbl(ji,jj) ) * zdt_ml(ji,jj)
                zws_ent =  -0.003 * ( 0.15 * zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 )**pthird * ( 1.0 - zdh(ji,jj) /zhbl(ji,jj) ) * zds_ml(ji,jj)
 ! Cubic profile used for buoyancy term
@@ -813,5 +813,5 @@
                zws_pyc_sc_1 = 0.325 * ( zalpha_pyc(ji,jj) * zds_ml(ji,jj) / zdh(ji,jj) + zdsdz_bl_ext(ji,jj) ) * zdelta_pyc**2 / zdh(ji,jj)
 !
-               zzeta_pyc = 0.15 - 0.175 / ( 1.0 + EXP( -3.5 * LOG10( -zhol(ji,jj) ) ) ) 
+               zzeta_pyc = 0.15 - 0.175 / ( 1.0 + EXP( -3.5 * LOG10( -zhol(ji,jj) ) ) )
                DO jk = 2, ibld(ji,jj)
                  zznd_pyc = -( gdepw(ji,jj,jk,Kmm) - zhbl(ji,jj) ) / zdh(ji,jj)
@@ -820,5 +820,5 @@
                  ghams(ji,jj,jk) = ghams(ji,jj,jk) + 0.05 * zws_pyc_sc_1 * EXP( -0.25 * ( zznd_pyc / zzeta_pyc )**2 ) * zdh(ji,jj) / ( zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 )**pthird
                END DO
-            ENDIF ! End of pycnocline                  
+            ENDIF ! End of pycnocline
           ELSE ! lconv test - stable conditions
              DO jk = 2, ibld(ji,jj)
@@ -870,5 +870,5 @@
           zd_cubic = zdh(ji,jj) / zhbl(ji,jj) * zuw0(ji,jj) - ( 2.0 + zdh(ji,jj) /zhml(ji,jj) ) * zuw_bse
           zc_cubic = zuw_bse - zd_cubic
-! need ztau_sc_u to be available. Change to array. 
+! need ztau_sc_u to be available. Change to array.
           DO jk = imld(ji,jj), ibld(ji,jj)
              zznd_pyc = - ( gdepw(ji,jj,jk,Kmm) - zhbl(ji,jj) ) / zdh(ji,jj)
@@ -892,5 +892,5 @@
 
        DO_2D( 1, 0, 1, 0 )
-       
+
          IF ( lconv(ji,jj) ) THEN
            zsc_wth_1(ji,jj) = zwth0(ji,jj) / ( 1.0 - 0.56 * EXP( zhol(ji,jj) ) )
@@ -926,6 +926,6 @@
               DO jk = imld(ji,jj), ibld(ji,jj)
                 zznd_pyc = - ( gdepw(ji,jj,jk,Kmm) - zhbl(ji,jj) ) / zdh(ji,jj)
-                ghamt(ji,jj,jk) = ghamt(ji,jj,jk) + 4.0 * zsc_wth_pyc(ji,jj) * ( 0.48 - EXP( -1.5 * ( zznd_pyc -0.3)**2 ) ) 
-                ghams(ji,jj,jk) = ghams(ji,jj,jk) + 4.0 * zsc_ws_pyc(ji,jj) * ( 0.48 - EXP( -1.5 * ( zznd_pyc -0.3)**2 ) ) 
+                ghamt(ji,jj,jk) = ghamt(ji,jj,jk) + 4.0 * zsc_wth_pyc(ji,jj) * ( 0.48 - EXP( -1.5 * ( zznd_pyc -0.3)**2 ) )
+                ghams(ji,jj,jk) = ghams(ji,jj,jk) + 4.0 * zsc_ws_pyc(ji,jj) * ( 0.48 - EXP( -1.5 * ( zznd_pyc -0.3)**2 ) )
               END DO
            ENDIF
@@ -1136,5 +1136,5 @@
                  END DO
               ELSE
-! Surface transports limited to OSBL.                 
+! Surface transports limited to OSBL.
          ! Viscosity for MLEs
                  DO jk = 1, mld_prof(ji,jj)
@@ -1261,5 +1261,5 @@
      !! ** Purpose : Determines the eddy diffusivity and eddy viscosity profiles in the mixed layer and the pycnocline.
      !!
-     !! ** Method  : 
+     !! ** Method  :
      !!
      !! !!----------------------------------------------------------------------
@@ -1275,12 +1275,12 @@
 !
       REAL(wp) :: zvel_sc_pyc, zvel_sc_ml, zstab_fac
-      
+
       REAL(wp), PARAMETER :: rn_dif_ml = 0.8, rn_vis_ml = 0.375
       REAL(wp), PARAMETER :: rn_dif_pyc = 0.15, rn_vis_pyc = 0.142
       REAL(wp), PARAMETER :: rn_vispyc_shr = 0.15
-      
+
       DO_2D( 0, 0, 0, 0 )
           IF ( lconv(ji,jj) ) THEN
-          
+
             zvel_sc_pyc = ( 0.15 * zvstr(ji,jj)**3 + zwstrc(ji,jj)**3 + 4.25 * zshear(ji,jj) * zhbl(ji,jj) )**pthird
             zvel_sc_ml = ( zvstr(ji,jj)**3 + 0.5 * zwstrc(ji,jj)**3 )**pthird
@@ -1296,9 +1296,9 @@
                 zdifpyc_n_sc(ji,jj) = zdifpyc_n_sc(ji,jj) + rn_vispyc_shr * ( zshear(ji,jj) * zhbl(ji,jj) )**pthird * zhbl(ji,jj)
               ENDIF
-            
+
               zdifpyc_s_sc(ji,jj) = zwb_ent(ji,jj) + 0.0025 * zvel_sc_pyc * ( zhbl(ji,jj) / zdh(ji,jj) - 1.0 ) * ( zb_ml(ji,jj) - zb_bl(ji,jj) )
               zdifpyc_s_sc(ji,jj) = 0.09 * zdifpyc_s_sc(ji,jj) * zstab_fac
               zdifpyc_s_sc(ji,jj) = MAX( zdifpyc_s_sc(ji,jj), -0.5 * zdifpyc_n_sc(ji,jj) )
-              
+
               zvispyc_n_sc(ji,jj) = 0.09 * zvel_sc_pyc * ( 1.0 - zhbl(ji,jj) / zdh(ji,jj) )**2 * ( 0.005 * ( zu_ml(ji,jj)-zu_bl(ji,jj) )**2 + 0.0075 * ( zv_ml(ji,jj)-zv_bl(ji,jj) )**2 ) / zdh(ji,jj)
               zvispyc_n_sc(ji,jj) = rn_vis_pyc * zvel_sc_ml * zdh(ji,jj) + zvispyc_n_sc(ji,jj) * zstab_fac
@@ -1306,5 +1306,5 @@
                 zvispyc_n_sc(ji,jj) = zvispyc_n_sc(ji,jj) + rn_vispyc_shr * ( zshear(ji,jj) * zhbl(ji,jj ) )**pthird * zhbl(ji,jj)
               ENDIF
-             
+
               zvispyc_s_sc(ji,jj) = 0.09 * ( zwb_min(ji,jj) + 0.0025 * zvel_sc_pyc * ( zhbl(ji,jj) / zdh(ji,jj) - 1.0 ) * ( zb_ml(ji,jj) - zb_bl(ji,jj) ) )
               zvispyc_s_sc(ji,jj) = zvispyc_s_sc(ji,jj) * zstab_fac
@@ -1383,7 +1383,7 @@
           !
        END_2D
-       
+
   END SUBROUTINE zdf_osm_diffusivity_viscosity
-  
+
   SUBROUTINE zdf_osm_osbl_state( lconv, lshear, j_ddh, zwb_ent, zwb_min, zshear, zri_i )
 
@@ -1393,10 +1393,10 @@
      !! ** Purpose : Determines the state of the OSBL, stable/unstable, shear/ noshear. Also determines shear production, entrainment buoyancy flux and interfacial Richardson number
      !!
-     !! ** Method  : 
+     !! ** Method  :
      !!
      !! !!----------------------------------------------------------------------
 
      INTEGER, DIMENSION(jpi,jpj) :: j_ddh  ! j_ddh = 0, active shear layer; j_ddh=1, shear layer not active; j_ddh=2 shear production low.
-     
+
      LOGICAL, DIMENSION(jpi,jpj) :: lconv, lshear
 
@@ -1408,5 +1408,5 @@
 
      INTEGER :: jj, ji
-     
+
      REAL(wp), DIMENSION(jpi,jpj) :: zekman
      REAL(wp) :: zri_p, zri_b   ! Richardson numbers
@@ -1416,9 +1416,9 @@
      REAL, PARAMETER :: za_shr = 0.4, zb_shr = 6.5, za_wb_s = 0.1
      REAL, PARAMETER :: rn_ri_thres_a = 0.5, rn_ri_thresh_b = 0.59
-     REAL, PARAMETER :: zalpha_c = 0.2, zalpha_lc = 0.04     
+     REAL, PARAMETER :: zalpha_c = 0.2, zalpha_lc = 0.04
      REAL, PARAMETER :: zalpha_ls = 0.06, zalpha_s = 0.15
      REAL, PARAMETER :: rn_ri_p_thresh = 27.0
      REAL, PARAMETER :: zrot=0._wp  ! dummy rotation rate of surface stress.
-     
+
 ! Determins stability and set flag lconv
      DO_2D( 0, 0, 0, 0 )
@@ -1429,7 +1429,7 @@
        ENDIF
      END_2D
- 
+
      zekman(:,:) = EXP( - 4.0 * ABS( ff_t(:,:) ) * zhbl(:,:) / MAX(zustar(:,:), 1.e-8 ) )
-     
+
      WHERE ( lconv )
        zri_i = zdb_ml * zhml**2 / MAX( ( zvstr**3 + 0.5 * zwstrc**3 )**p2third * zdh, 1.e-12 )
@@ -1437,6 +1437,6 @@
 
      zshear(:,:) = 0._wp
-     j_ddh(:,:) = 1     
- 
+     j_ddh(:,:) = 1
+
      DO_2D( 0, 0, 0, 0 )
       IF ( lconv(ji,jj) ) THEN
@@ -1444,7 +1444,7 @@
            zri_p = MAX (  SQRT( zdb_bl(ji,jj) * zdh(ji,jj) / MAX( zdu_bl(ji,jj)**2 + zdv_bl(ji,jj)**2, 1.e-8) )  *  ( zhbl(ji,jj) / zdh(ji,jj) ) * ( zvstr(ji,jj) / MAX( zustar(ji,jj), 1.e-6 ) )**2 &
                 & / MAX( zekman(ji,jj), 1.e-6 )  , 5._wp )
-         
+
            zri_b = zdb_ml(ji,jj) * zdh(ji,jj) / MAX( zdu_ml(ji,jj)**2 + zdv_ml(ji,jj)**2, 1.e-8 )
-                     
+
            zshear(ji,jj) = za_shr * zekman(ji,jj) * ( MAX( zustar(ji,jj)**2 * zdu_ml(ji,jj) / zhbl(ji,jj), 0._wp ) + zb_shr * MAX( -ff_t(ji,jj) * zustke(ji,jj) * dstokes(ji,jj) * zdv_ml(ji,jj) / zhbl(ji,jj), 0._wp ) )
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1465,6 +1465,6 @@
                zshear(ji,jj) = 0.5 * zshear(ji,jj)
                lshear(ji,jj) = .FALSE.
-             ENDIF 
-           ENDIF                
+             ENDIF
+           ENDIF
          ELSE                ! zdb_bl test, note zshear set to zero
            j_ddh(ji,jj) = 2
@@ -1473,5 +1473,5 @@
        ENDIF
      END_2D
- 
+
 ! Calculate entrainment buoyancy flux due to surface fluxes.
 
@@ -1513,12 +1513,12 @@
              zshear(ji,jj) = zshear(ji,jj) + zshear_u * ( 1.0 - MIN( zri_p / rn_ri_p_thresh, 1.d0 ) )
              zshear(ji,jj) = MIN( zshear(ji,jj), zshear_u )
-             
+
              zwb_shr = -za_wb_s * zshear(ji,jj)
-             
-           ENDIF                
+
+           ENDIF
            zwb_ent(ji,jj) = zwb_ent(ji,jj) + zwb_shr
            zwb_min(ji,jj) = zwb_ent(ji,jj) + zdh(ji,jj) / zhbl(ji,jj) * zwb0(ji,jj)
         ELSE    ! IF ( lconv ) THEN - ENDIF
-! Stable OSBL  - shear production not coded for first attempt.           
+! Stable OSBL  - shear production not coded for first attempt.
         ENDIF  ! lconv
       ELSE  ! lshear
@@ -1532,6 +1532,6 @@
      END_2D
    END SUBROUTINE zdf_osm_osbl_state
-     
-     
+
+
    SUBROUTINE zdf_osm_vertical_average( jnlev_av, jp_ext, zt, zs, zb, zu, zv, zdt, zds, zdb, zdu, zdv )
      !!---------------------------------------------------------------------
@@ -1636,11 +1636,11 @@
      !!  lpyc :: determines whether pycnocline flux-grad relationship needs to be determined
      !!  lflux :: determines whether effects of surface flux extend below the base of the OSBL
-     !!  lmle  :: determines whether the layer with MLE is increasing with time or if base is relaxing towards hbl. 
-     !!
-     !! ** Method  : 
-     !!
-     !! 
+     !!  lmle  :: determines whether the layer with MLE is increasing with time or if base is relaxing towards hbl.
+     !!
+     !! ** Method  :
+     !!
+     !!
      !!----------------------------------------------------------------------
-      
+
 ! Outputs
       LOGICAL,  DIMENSION(jpi,jpj)  :: lpyc, lflux, lmle
@@ -1650,5 +1650,5 @@
       REAL(wp)                      :: zbuoy, ztmp, zpe_mle_layer
       REAL(wp)                      :: zpe_mle_ref, zwb_ent, zdbdz_mle_int
-      
+
       znd_param(:,:) = 0._wp
 
@@ -1674,5 +1674,5 @@
              END DO
 ! Non-dimensional parameter to diagnose the presence of thermocline
-                
+
              znd_param(ji,jj) = ( zpe_mle_layer - zpe_mle_ref ) * ABS( ff_t(ji,jj) ) / ( MAX( zwb_fk(ji,jj), 1.0e-10 ) * zhmle(ji,jj) )
            ENDIF
@@ -1717,5 +1717,5 @@
                   lflux(ji,jj) = .FALSE.
                   lmle(ji,jj) = .FALSE.
-                ENDIF ! zdb_bl < rn_mle_thresh_bl and 
+                ENDIF ! zdb_bl < rn_mle_thresh_bl and
               ENDIF  ! zhmle > 1.2 zhbl
             ELSE
@@ -1724,5 +1724,5 @@
               lmle(ji,jj) = .FALSE.
               IF ( zdb_bl(ji,jj) < rn_osm_bl_thresh ) lpyc(ji,jj) = .FALSE.
-            ENDIF !  -2.0 * zwb_fk(ji,jj) / zwb_ent > 0.5 
+            ENDIF !  -2.0 * zwb_fk(ji,jj) / zwb_ent > 0.5
           ELSE
 ! Stable Boundary Layer
@@ -1928,7 +1928,7 @@
     REAL(wp) :: alpha_bc = 0.5
     REAL, PARAMETER :: a_ddh = 2.5, a_ddh_2 = 3.5 ! also in pycnocline_depth
- 
+
   DO_2D( 0, 0, 0, 0 )
-    
+
     IF ( lshear(ji,jj) ) THEN
        IF ( lconv(ji,jj) ) THEN    ! Convective
@@ -1965,5 +1965,5 @@
 ! Relaxation to dh_ref = zari * hbl
                      zddhdt(ji,jj) = -a_ddh_2 * ( 1.0 - zdh(ji,jj) / ( zari * zhbl(ji,jj) ) ) * zwb_ent(ji,jj) / zdb_bl(ji,jj)
-                     
+
                    ELSE  ! j_ddh == 0
 ! Growing shear layer
@@ -2184,5 +2184,5 @@
              dh(ji,jj) = dh(ji,jj) + zddhdt(ji,jj) * rn_Dt
            ELSE
-! Temporary (probably) Recalculate dh_ref to ensure dh doesn't go negative. Can't do this using zddhdt from calculate_dhdt 
+! Temporary (probably) Recalculate dh_ref to ensure dh doesn't go negative. Can't do this using zddhdt from calculate_dhdt
              IF ( ( zwstrc(ji,jj) / zvstr(ji,jj) )**3 <= 0.5 ) THEN
                zari = MIN( 1.5 * zdb_bl(ji,jj) / ( zhbl(ji,jj) * ( MAX(zdbdz_bl_ext(ji,jj),0._wp) + zdb_bl(ji,jj)**2 / MAX(4.5 * zvstr(ji,jj)**2 , 1.e-12 )) ), 0.2d0 )
@@ -2194,7 +2194,7 @@
              IF ( dh(ji,jj) >= hbl(ji,jj) ) dh(ji,jj) = zari * zhbl(ji,jj)
            ENDIF
-            
+
          ELSE ! lconv
-! Initially shear only for entraining OSBL. Stable code will be needed if extended to stable OSBL 
+! Initially shear only for entraining OSBL. Stable code will be needed if extended to stable OSBL
 
             ztau = hbl(ji,jj) / MAX(zvstr(ji,jj), epsln)
@@ -2216,6 +2216,6 @@
             ! Alan: this hml is never defined or used -- do we need it?
          ENDIF
-          
-      ELSE   ! lshear  
+
+      ELSE   ! lshear
 ! for lshear = .FALSE. calculate ddhdt here
 
@@ -2280,5 +2280,5 @@
          ENDIF       ! IF (lconv)
       ENDIF  ! lshear
- 
+
       hml(ji,jj) = hbl(ji,jj) - dh(ji,jj)
       inhml = MAX( INT( dh(ji,jj) / MAX(e3t(ji,jj,ibld(ji,jj),Kmm), 1.e-3) ) , 1 )
@@ -2378,5 +2378,5 @@
              & + dbdx_mle(ji-1,jj) * dbdx_mle(ji-1,jj) + dbdy_mle(ji,jj-1) * dbdy_mle(ji,jj-1) ) )
       END_2D
-      
+
  END SUBROUTINE zdf_osm_zmld_horizontal_gradients
   SUBROUTINE zdf_osm_mle_parameters( mld_prof, hmle, zhmle, zvel_mle, zdiff_mle )
@@ -2416,8 +2416,8 @@
            jkb = mld_prof(ji,jj)
            jkb1 = MIN(jkb + 1, mbkt(ji,jj))
-!              
+!
            zbuoy = grav * ( zthermal * ts(ji,jj,mld_prof(ji,jj)+2,jp_tem,Kmm) - zbeta * ts(ji,jj,mld_prof(ji,jj)+2,jp_sal,Kmm) )
-           zdb_mle = zb_bl(ji,jj) - zbuoy 
-! Timestep hmle. 
+           zdb_mle = zb_bl(ji,jj) - zbuoy
+! Timestep hmle.
            hmle(ji,jj) = hmle(ji,jj) + zwb0(ji,jj) * rn_Dt / zdb_mle
         ELSE
Index: /NEMO/trunk/src/OCE/ZDF/zdfphy.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdfphy.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdfphy.F90	(revision 14072)
@@ -9,22 +9,22 @@
    !!----------------------------------------------------------------------
    !!   zdf_phy_init  : initialization of all vertical physics packages
-   !!   zdf_phy       : upadate at each time-step the vertical mixing coeff. 
+   !!   zdf_phy       : upadate at each time-step the vertical mixing coeff.
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and tracers variables
-   USE zdf_oce        ! vertical physics: shared variables         
+   USE zdf_oce        ! vertical physics: shared variables
    USE zdfdrg         ! vertical physics: top/bottom drag coef.
    USE zdfsh2         ! vertical physics: shear production term of TKE
-   USE zdfric         ! vertical physics: RIChardson dependent vertical mixing   
+   USE zdfric         ! vertical physics: RIChardson dependent vertical mixing
    USE zdftke         ! vertical physics: TKE vertical mixing
    USE zdfgls         ! vertical physics: GLS vertical mixing
    USE zdfosm         ! vertical physics: OSMOSIS vertical mixing
-   USE zdfddm         ! vertical physics: double diffusion mixing      
-   USE zdfevd         ! vertical physics: convection via enhanced vertical diffusion  
-   USE zdfmfc         ! vertical physics: Mass Flux Convection 
-   USE zdfiwm         ! vertical physics: internal wave-induced mixing  
+   USE zdfddm         ! vertical physics: double diffusion mixing
+   USE zdfevd         ! vertical physics: convection via enhanced vertical diffusion
+   USE zdfmfc         ! vertical physics: Mass Flux Convection
+   USE zdfiwm         ! vertical physics: internal wave-induced mixing
    USE zdfswm         ! vertical physics: surface  wave-induced mixing
    USE zdfmxl         ! vertical physics: mixed layer
    USE tranpc         ! convection: non penetrative adjustment
-   USE trc_oce        ! variables shared between passive tracer & ocean           
+   USE trc_oce        ! variables shared between passive tracer & ocean
    USE sbc_oce        ! surface module (only for nn_isf in the option compatibility test)
    USE sbcrnf         ! surface boundary condition: runoff variables
@@ -46,5 +46,5 @@
    PUBLIC   zdf_phy       ! called by step.F90
 
-   INTEGER ::   nzdf_phy   ! type of vertical closure used 
+   INTEGER ::   nzdf_phy   ! type of vertical closure used
    !                       ! associated indicators
    INTEGER, PARAMETER ::   np_CST = 1   ! Constant Kz
@@ -66,8 +66,8 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE zdf_phy_init  ***
-      !! 
+      !!
       !! ** Purpose :   initializations of the vertical ocean physics
       !!
-      !! ** Method  :   Read namelist namzdf, control logicals 
+      !! ** Method  :   Read namelist namzdf, control logicals
       !!                set horizontal shape and vertical profile of background mixing coef.
       !!----------------------------------------------------------------------
@@ -143,5 +143,5 @@
       IF( nn_avb == 0 ) THEN             ! Define avmb, avtb from namelist parameter
          avmb(:) = rn_avm0
-         avtb(:) = rn_avt0                     
+         avtb(:) = rn_avt0
       ELSE                               ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990)
          avmb(:) = rn_avm0
@@ -150,5 +150,5 @@
       ENDIF
       !                                  ! 2D shape of the avtb
-      avtb_2d(:,:) = 1._wp                   ! uniform 
+      avtb_2d(:,:) = 1._wp                   ! uniform
       !
       IF( nn_havtb == 1 ) THEN               ! decrease avtb by a factor of ten in the equatorial band
@@ -198,5 +198,5 @@
 
       !                          !==  type of vertical turbulent closure  ==!    (set nzdf_phy)
-      ioptio = 0 
+      ioptio = 0
       IF( ln_zdfcst ) THEN   ;   ioptio = ioptio + 1   ;    nzdf_phy = np_CST   ;   ENDIF
       IF( ln_zdfric ) THEN   ;   ioptio = ioptio + 1   ;    nzdf_phy = np_RIC   ;   CALL zdf_ric_init          ;   ENDIF
@@ -236,5 +236,5 @@
       !! ** Purpose :  Update ocean physics at each time-step
       !!
-      !! ** Method  : 
+      !! ** Method  :
       !!
       !! ** Action  :   avm, avt vertical eddy viscosity and diffusivity at w-points
@@ -254,9 +254,9 @@
          !
          !                       !* bottom drag
-         CALL zdf_drg( kt, Kmm, mbkt , r_Cdmin_bot, r_Cdmax_bot,   &   ! <<== in 
+         CALL zdf_drg( kt, Kmm, mbkt , r_Cdmin_bot, r_Cdmax_bot,   &   ! <<== in
             &              r_z0_bot,   r_ke0_bot,    rCd0_bot,   &
             &                                        rCdU_bot  )     ! ==>> out : bottom drag [m/s]
          IF( ln_isfcav ) THEN    !* top drag   (ocean cavities)
-            CALL zdf_drg( kt, Kmm, mikt , r_Cdmin_top, r_Cdmax_top,   &   ! <<== in 
+            CALL zdf_drg( kt, Kmm, mikt , r_Cdmin_top, r_Cdmax_top,   &   ! <<== in
                &              r_z0_top,   r_ke0_top,    rCd0_top,   &
                &                                        rCdU_top  )     ! ==>> out : bottom drag [m/s]
@@ -273,5 +273,5 @@
       ENDIF
 #endif
-      ! 
+      !
       !                       !==  Kz from chosen turbulent closure  ==!   (avm_k, avt_k)
       !
@@ -290,5 +290,5 @@
 !!gm         avm(2:jpim1,2:jpjm1,1:jpkm1) = rn_avm0 * wmask(2:jpim1,2:jpjm1,1:jpkm1)
       END SELECT
-      !  
+      !
       !                          !==  ocean Kz  ==!   (avt, avs, avm)
       !
@@ -312,9 +312,9 @@
       ENDIF
       !
-      !                                         !* wave-induced mixing 
-      IF( ln_zdfswm )   CALL zdf_swm( kt, Kmm, avm, avt, avs )   ! surface  wave (Qiao et al. 2004) 
+      !                                         !* wave-induced mixing
+      IF( ln_zdfswm )   CALL zdf_swm( kt, Kmm, avm, avt, avs )   ! surface  wave (Qiao et al. 2004)
       IF( ln_zdfiwm )   CALL zdf_iwm( kt, Kmm, avm, avt, avs )   ! internal wave (de Lavergne et al 2017)
 
-#if defined key_agrif 
+#if defined key_agrif
       ! interpolation parent grid => child grid for avm_k ( ex : at west border: update column 1 and 2)
       IF( l_zdfsh2 )   CALL Agrif_avm
@@ -340,5 +340,5 @@
          IF( ln_zdftke )   CALL tke_rst( kt, 'WRITE' )
          IF( ln_zdfgls )   CALL gls_rst( kt, 'WRITE' )
-         IF( ln_zdfric )   CALL ric_rst( kt, 'WRITE' ) 
+         IF( ln_zdfric )   CALL ric_rst( kt, 'WRITE' )
          ! NB. OSMOSIS restart (osm_rst) will be called in step.F90 after ww has been updated
       ENDIF
Index: /NEMO/trunk/src/OCE/ZDF/zdfric.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdfric.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdfric.F90	(revision 14072)
@@ -12,5 +12,5 @@
    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
    !!            3.3.1!  2011-09  (P. Oddo) Mixed layer depth parameterization
-   !!            4.0  !  2017-04  (G. Madec)  remove CPP ddm key & avm at t-point only 
+   !!            4.0  !  2017-04  (G. Madec)  remove CPP ddm key & avm at t-point only
    !!----------------------------------------------------------------------
 
@@ -28,5 +28,5 @@
    USE in_out_manager ! I/O manager
    USE iom            ! I/O manager library
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 
 
@@ -43,5 +43,5 @@
    REAL(wp) ::   rn_alp      ! coefficient of the parameterization
    REAL(wp) ::   rn_ekmfc    ! Ekman Factor Coeff
-   REAL(wp) ::   rn_mldmin   ! minimum mixed layer (ML) depth    
+   REAL(wp) ::   rn_mldmin   ! minimum mixed layer (ML) depth
    REAL(wp) ::   rn_mldmax   ! maximum mixed layer depth
    REAL(wp) ::   rn_wtmix    ! Vertical eddy Diff. in the ML
@@ -61,5 +61,5 @@
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE zdf_ric_init  ***
-      !!                    
+      !!
       !! ** Purpose :   Initialization of the vertical eddy diffusivity and
       !!      viscosity coef. for the Richardson number dependent formulation.
@@ -109,10 +109,10 @@
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE zdfric  ***
-      !!                    
+      !!
       !! ** Purpose :   Compute the before eddy viscosity and diffusivity as
       !!                a function of the local richardson number.
       !!
-      !! ** Method  :   Local richardson number dependent formulation of the 
-      !!                vertical eddy viscosity and diffusivity coefficients. 
+      !! ** Method  :   Local richardson number dependent formulation of the
+      !!                vertical eddy viscosity and diffusivity coefficients.
       !!                The eddy coefficients are given by:
       !!                    avm = avm0 + avmb
@@ -122,5 +122,5 @@
       !!                    avm0= rn_avmri / (1 + rn_alp*Ri)**nn_ric
       !!                where ri is the before local Richardson number,
-      !!                rn_avmri is the maximum value reaches by avm and avt 
+      !!                rn_avmri is the maximum value reaches by avm and avt
       !!                and rn_alp, nn_ric are adjustable parameters.
       !!                Typical values : rn_alp=5. and nn_ric=2.
@@ -164,5 +164,5 @@
       END_3D
       !
-!!gm BUG <<<<====  This param can't work at low latitude 
+!!gm BUG <<<<====  This param can't work at low latitude
 !!gm               it provides there much to thick mixed layer ( summer 150m in GYRE configuration !!! )
       !
@@ -188,10 +188,10 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE ric_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write TKE file (en) in restart file
       !!
       !! ** Method  :   use of IOM library
-      !!                if the restart does not contain TKE, en is either 
-      !!                set to rn_emin or recomputed 
+      !!                if the restart does not contain TKE, en is either
+      !!                set to rn_emin or recomputed
       !!----------------------------------------------------------------------
       INTEGER         , INTENT(in) ::   kt     ! ocean time-step
@@ -202,5 +202,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise
          !                                   ! ---------------
          !           !* Read the restart file
Index: /NEMO/trunk/src/OCE/ZDF/zdfsh2.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdfsh2.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdfsh2.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE  zdfsh2  ***
-   !! Ocean physics:  shear production term of TKE 
+   !! Ocean physics:  shear production term of TKE
    !!=====================================================================
    !! History :   -   !  2014-10  (A. Barthelemy, G. Madec)  original code
@@ -36,5 +36,5 @@
 CONTAINS
 
-   SUBROUTINE zdf_sh2( Kbb, Kmm, p_avm, p_sh2  ) 
+   SUBROUTINE zdf_sh2( Kbb, Kmm, p_avm, p_sh2  )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE zdf_sh2  ***
@@ -44,9 +44,9 @@
       !! ** Method  : - a stable discretization of this term is linked to the
       !!                time-space discretization of the vertical diffusion
-      !!                of the OGCM. NEMO uses C-grid, a leap-frog environment 
+      !!                of the OGCM. NEMO uses C-grid, a leap-frog environment
       !!                and an implicit computation of vertical mixing term,
       !!                so the shear production at w-point is given by:
-      !!                   sh2 = mi[   mi(avm) * dk[ub]/e3ub * dk[un]/e3un   ] 
-      !!                       + mj[   mj(avm) * dk[vb]/e3vb * dk[vn]/e3vn   ] 
+      !!                   sh2 = mi[   mi(avm) * dk[ub]/e3ub * dk[un]/e3un   ]
+      !!                       + mj[   mj(avm) * dk[vb]/e3vb * dk[vn]/e3vn   ]
       !!                NB: wet-point only horizontal averaging of shear
       !!
@@ -81,5 +81,5 @@
                zsh2u(ji,jj) = ( p_avm(ji+1,jj,jk) + p_avm(ji,jj,jk) ) &
                   &         * (   uu(ji,jj,jk-1,Kmm) -   uu(ji,jj,jk,Kmm) ) &
-                  &         * (   uu(ji,jj,jk-1,Kbb) -   uu(ji,jj,jk,Kbb) ) & 
+                  &         * (   uu(ji,jj,jk-1,Kbb) -   uu(ji,jj,jk,Kbb) ) &
                   &         / ( e3uw(ji,jj,jk  ,Kmm) * e3uw(ji,jj,jk,Kbb) ) &
                   &         * wumask(ji,jj,jk)
Index: /NEMO/trunk/src/OCE/ZDF/zdftke.F90
===================================================================
--- /NEMO/trunk/src/OCE/ZDF/zdftke.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/ZDF/zdftke.F90	(revision 14072)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE  zdftke  ***
-   !! Ocean physics:  vertical mixing coefficient computed from the tke 
+   !! Ocean physics:  vertical mixing coefficient computed from the tke
    !!                 turbulent closure parameterization
    !!=====================================================================
@@ -22,10 +22,10 @@
    !!             -   !  2008-05  (J.-M. Molines, G. Madec)  2D form of avtb
    !!             -   !  2008-06  (G. Madec)  style + DOCTOR name for namelist parameters
-   !!             -   !  2008-12  (G. Reffray) stable discretization of the production term 
-   !!            3.2  !  2009-06  (G. Madec, S. Masson) TKE restart compatible with key_cpl 
+   !!             -   !  2008-12  (G. Reffray) stable discretization of the production term
+   !!            3.2  !  2009-06  (G. Madec, S. Masson) TKE restart compatible with key_cpl
    !!                 !                                + cleaning of the parameters + bugs correction
    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
    !!            3.6  !  2014-11  (P. Mathiot) add ice shelf capability
-   !!            4.0  !  2017-04  (G. Madec)  remove CPP ddm key & avm at t-point only 
+   !!            4.0  !  2017-04  (G. Madec)  remove CPP ddm key & avm at t-point only
    !!             -   !  2017-05  (G. Madec)  add top/bottom friction as boundary condition
    !!            4.2  !  2020-12  (G. Madec, E. Clementi) add wave coupling
@@ -59,5 +59,5 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE prtctl         ! Print control
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
    USE sbcwave        ! Surface boundary waves
 
@@ -78,5 +78,5 @@
    INTEGER  ::   nn_pdl    ! Prandtl number or not (ratio avt/avm) (=0/1)
    REAL(wp) ::   rn_ediff  ! coefficient for avt: avt=rn_ediff*mxl*sqrt(e)
-   REAL(wp) ::   rn_ediss  ! coefficient of the Kolmogoroff dissipation 
+   REAL(wp) ::   rn_ediss  ! coefficient of the Kolmogoroff dissipation
    REAL(wp) ::   rn_ebb    ! coefficient of the surface input of tke
    REAL(wp) ::   rn_emin   ! minimum value of tke           [m2/s2]
@@ -90,5 +90,5 @@
    LOGICAL  ::   ln_lc     ! Langmuir cells (LC) as a source term of TKE or not
    REAL(wp) ::      rn_lc     ! coef to compute vertical velocity of Langmuir cells
-   INTEGER  ::   nn_eice   ! attenutaion of langmuir & surface wave breaking under ice (=0/1/2/3)   
+   INTEGER  ::   nn_eice   ! attenutaion of langmuir & surface wave breaking under ice (=0/1/2/3)
 
    REAL(wp) ::   ri_cri    ! critic Richardson number (deduced from rn_ediff and rn_ediss values)
@@ -139,10 +139,10 @@
       !!         surface: en = max( rn_emin0, rn_ebb * taum )
       !!         bottom : en = rn_emin
-      !!      The associated critical Richardson number is: ri_cri = 2/(2+rn_ediss/rn_ediff) 
-      !!
-      !!        The now Turbulent kinetic energy is computed using the following 
+      !!      The associated critical Richardson number is: ri_cri = 2/(2+rn_ediss/rn_ediff)
+      !!
+      !!        The now Turbulent kinetic energy is computed using the following
       !!      time stepping: implicit for vertical diffusion term, linearized semi
-      !!      implicit for kolmogoroff dissipation term, and explicit forward for 
-      !!      both buoyancy and shear production terms. Therefore a tridiagonal 
+      !!      implicit for kolmogoroff dissipation term, and explicit forward for
+      !!      both buoyancy and shear production terms. Therefore a tridiagonal
       !!      linear system is solved. Note that buoyancy and shear terms are
       !!      discretized in a energy conserving form (Bruchard 2002).
@@ -152,10 +152,10 @@
       !!
       !!        The now vertical eddy vicosity and diffusivity coefficients are
-      !!      given by: 
+      !!      given by:
       !!              avm = max( avtb, rn_ediff * zmxlm * en^1/2 )
-      !!              avt = max( avmb, pdl * avm                 )  
+      !!              avt = max( avmb, pdl * avm                 )
       !!              eav = max( avmb, avm )
       !!      where pdl, the inverse of the Prandtl number is 1 if nn_pdl=0 and
-      !!      given by an empirical funtion of the localRichardson number if nn_pdl=1 
+      !!      given by an empirical funtion of the localRichardson number if nn_pdl=1
       !!
       !! ** Action  :   compute en (now turbulent kinetic energy)
@@ -193,7 +193,7 @@
       !!                a tridiagonal linear system by a "methode de chasse"
       !!              - increase TKE due to surface and internal wave breaking
-      !!             NB: when sea-ice is present, both LC parameterization 
-      !!                 and TKE penetration are turned off when the ice fraction 
-      !!                 is smaller than 0.25 
+      !!             NB: when sea-ice is present, both LC parameterization
+      !!                 and TKE penetration are turned off when the ice fraction
+      !!                 is smaller than 0.25
       !!
       !! ** Action  : - en : now turbulent kinetic energy)
@@ -223,5 +223,5 @@
       zbbrau  = rn_ebb / rho0       ! Local constant initialisation
       zbbirau = 3.75_wp / rho0
-      zfact1  = -.5_wp * rn_Dt 
+      zfact1  = -.5_wp * rn_Dt
       zfact2  = 1.5_wp * rn_Dt * rn_ediss
       zfact3  = 0.5_wp         * rn_ediss
@@ -244,5 +244,5 @@
          en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) )
          zdiag(ji,jj,1) = 1._wp/en(ji,jj,1)
-         zd_lw(ji,jj,1) = 1._wp  
+         zd_lw(ji,jj,1) = 1._wp
          zd_up(ji,jj,1) = 0._wp
       END_2D
@@ -345,5 +345,5 @@
          END_2D
          DO_3D( 0, 0, 0, 0, 2, jpkm1 )                  !* TKE Langmuir circulation source term added to en
-            IF ( zus3(ji,jj) /= 0._wp ) THEN               
+            IF ( zus3(ji,jj) /= 0._wp ) THEN
                IF ( gdepw(ji,jj,jk,Kmm) - zhlc(ji,jj) < 0 .AND. wmask(ji,jj,jk) /= 0. ) THEN
                   !                                           ! vertical velocity due to LC
@@ -376,5 +376,5 @@
          END_3D
       ENDIF
-      !         
+      !
       DO_3D( 0, 0, 0, 0, 2, jpkm1 )   !* Matrix and right hand side in en
          zcof   = zfact1 * tmask(ji,jj,jk)
@@ -403,5 +403,5 @@
       !
       IF ( cpl_phioc .and. ln_phioc )  THEN
-         SELECT CASE (nn_bc_surf) ! Boundary Condition using surface TKE flux from waves 
+         SELECT CASE (nn_bc_surf) ! Boundary Condition using surface TKE flux from waves
 
          CASE ( 0 ) ! Dirichlet BC
@@ -456,5 +456,5 @@
       !
       IF( nn_etau == 1 ) THEN           !* penetration below the mixed layer (rn_efr fraction)
-         DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
+         DO_3D( 0, 0, 0, 0, 2, jpkm1 )
             en(ji,jj,jk) = en(ji,jj,jk) + rn_efr * en(ji,jj,1) * EXP( -gdepw(ji,jj,jk,Kmm) / htau(ji,jj) )   &
                &                                 * MAX( 0._wp, 1._wp - zice_fra(ji,jj) ) * wmask(ji,jj,jk) * tmask(ji,jj,1)
@@ -470,6 +470,6 @@
             ztx2 = utau(ji-1,jj  ) + utau(ji,jj)
             zty2 = vtau(ji  ,jj-1) + vtau(ji,jj)
-            ztau = 0.5_wp * SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1)    ! module of the mean stress 
-            zdif = taum(ji,jj) - ztau                            ! mean of modulus - modulus of the mean 
+            ztau = 0.5_wp * SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1)    ! module of the mean stress
+            zdif = taum(ji,jj) - ztau                            ! mean of modulus - modulus of the mean
             zdif = rhftau_scl * MAX( 0._wp, zdif + rhftau_add )  ! apply some modifications...
             en(ji,jj,jk) = en(ji,jj,jk) + zbbrau * zdif * EXP( -gdepw(ji,jj,jk,Kmm) / htau(ji,jj) )   &
@@ -487,28 +487,28 @@
       !! ** Purpose :   Compute the vertical eddy viscosity and diffusivity
       !!
-      !! ** Method  :   At this stage, en, the now TKE, is known (computed in 
-      !!              the tke_tke routine). First, the now mixing lenth is 
+      !! ** Method  :   At this stage, en, the now TKE, is known (computed in
+      !!              the tke_tke routine). First, the now mixing lenth is
       !!      computed from en and the strafification (N^2), then the mixings
       !!      coefficients are computed.
       !!              - Mixing length : a first evaluation of the mixing lengh
       !!      scales is:
-      !!                      mxl = sqrt(2*en) / N  
+      !!                      mxl = sqrt(2*en) / N
       !!      where N is the brunt-vaisala frequency, with a minimum value set
       !!      to rmxl_min (rn_mxl0) in the interior (surface) ocean.
-      !!        The mixing and dissipative length scale are bound as follow : 
+      !!        The mixing and dissipative length scale are bound as follow :
       !!         nn_mxl=0 : mxl bounded by the distance to surface and bottom.
       !!                        zmxld = zmxlm = mxl
       !!         nn_mxl=1 : mxl bounded by the e3w and zmxld = zmxlm = mxl
-      !!         nn_mxl=2 : mxl bounded such that the vertical derivative of mxl is 
+      !!         nn_mxl=2 : mxl bounded such that the vertical derivative of mxl is
       !!                    less than 1 (|d/dz(mxl)|<1) and zmxld = zmxlm = mxl
       !!         nn_mxl=3 : mxl is bounded from the surface to the bottom usings
-      !!                    |d/dz(xml)|<1 to obtain lup, and from the bottom to 
-      !!                    the surface to obtain ldown. the resulting length 
+      !!                    |d/dz(xml)|<1 to obtain lup, and from the bottom to
+      !!                    the surface to obtain ldown. the resulting length
       !!                    scales are:
-      !!                        zmxld = sqrt( lup * ldown ) 
+      !!                        zmxld = sqrt( lup * ldown )
       !!                        zmxlm = min ( lup , ldown )
       !!              - Vertical eddy viscosity and diffusivity:
       !!                      avm = max( avtb, rn_ediff * zmxlm * en^1/2 )
-      !!                      avt = max( avmb, pdlr * avm )  
+      !!                      avt = max( avmb, pdlr * avm )
       !!      with pdlr=1 if nn_pdl=0, pdlr=1/pdl=F(Ri) otherwise.
       !!
@@ -534,5 +534,5 @@
       !
       ! initialisation of interior minimum value (avoid a 2d loop with mikt)
-      zmxlm(:,:,:)  = rmxl_min    
+      zmxlm(:,:,:)  = rmxl_min
       zmxld(:,:,:)  = rmxl_min
       !
@@ -543,5 +543,5 @@
          zmxlm(:,:,1)= zcoef * MAX ( 1.6 * hsw(:,:) , 0.02 )        ! surface mixing length = F(wave height)
       ELSE
-      ! 
+      !
          IF( ln_mxl0 ) THEN            ! surface mixing length = F(stress) : l=vkarmn*2.e5*taum/(rho0*g)
          !
@@ -603,5 +603,5 @@
       !                     !* Physical limits for the mixing length
       !
-      zmxld(:,:, 1 ) = zmxlm(:,:,1)   ! surface set to the minimum value 
+      zmxld(:,:, 1 ) = zmxlm(:,:,1)   ! surface set to the minimum value
       zmxld(:,:,jpk) = rmxl_min       ! last level  set to the minimum value
       !
@@ -686,6 +686,6 @@
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE zdf_tke_init  ***
-      !!                     
-      !! ** Purpose :   Initialization of the vertical eddy diffivity and 
+      !!
+      !! ** Purpose :   Initialization of the vertical eddy diffivity and
       !!              viscosity when using a tke turbulent closure scheme
       !!
@@ -707,5 +707,5 @@
          &                 rn_mxl0 , nn_mxlice, rn_mxlice,             &
          &                 nn_pdl  , ln_lc    , rn_lc    ,             &
-         &                 nn_etau , nn_htau  , rn_efr   , nn_eice  ,  &   
+         &                 nn_etau , nn_htau  , rn_efr   , nn_eice  ,  &
          &                 nn_bc_surf, nn_bc_bot, ln_mxhsw
       !!----------------------------------------------------------------------
@@ -760,5 +760,5 @@
          WRITE(numout,*) '          fraction of TKE that penetrates            rn_efr    = ', rn_efr
          WRITE(numout,*) '      langmuir & surface wave breaking under ice  nn_eice = ', nn_eice
-         SELECT CASE( nn_eice ) 
+         SELECT CASE( nn_eice )
          CASE( 0 )   ;   WRITE(numout,*) '   ==>>>   no impact of ice cover on langmuir & surface wave breaking'
          CASE( 1 )   ;   WRITE(numout,*) '   ==>>>   weigthed by 1-TANH( fr_i(:,:) * 10 )'
@@ -767,5 +767,5 @@
          CASE DEFAULT
             CALL ctl_stop( 'zdf_tke_init: wrong value for nn_eice, should be 0,1,2, or 3')
-         END SELECT      
+         END SELECT
          WRITE(numout,*)
          WRITE(numout,*) '   ==>>>   critical Richardson nb with your parameters  ri_cri = ', ri_cri
@@ -796,18 +796,18 @@
          rn_mxl0 = rmxl_min
       ENDIF
-      
-      IF( nn_etau == 2  )   CALL zdf_mxl( nit000, Kmm )      ! Initialization of nmln 
+
+      IF( nn_etau == 2  )   CALL zdf_mxl( nit000, Kmm )      ! Initialization of nmln
 
       !                               !* depth of penetration of surface tke
-      IF( nn_etau /= 0 ) THEN      
+      IF( nn_etau /= 0 ) THEN
          SELECT CASE( nn_htau )             ! Choice of the depth of penetration
          CASE( 0 )                                 ! constant depth penetration (here 10 meters)
             htau(:,:) = 10._wp
          CASE( 1 )                                 ! F(latitude) : 0.5m to 30m poleward of 40 degrees
-            htau(:,:) = MAX(  0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) )   )            
+            htau(:,:) = MAX(  0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) )   )
          END SELECT
       ENDIF
       !                                !* read or initialize all required files
-      CALL tke_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, dissl) 
+      CALL tke_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, dissl)
       !
    END SUBROUTINE zdf_tke_init
@@ -817,10 +817,10 @@
       !!---------------------------------------------------------------------
       !!                   ***  ROUTINE tke_rst  ***
-      !!                     
+      !!
       !! ** Purpose :   Read or write TKE file (en) in restart file
       !!
       !! ** Method  :   use of IOM library
-      !!                if the restart does not contain TKE, en is either 
-      !!                set to rn_emin or recomputed 
+      !!                if the restart does not contain TKE, en is either
+      !!                set to rn_emin or recomputed
       !!----------------------------------------------------------------------
       USE zdf_oce , ONLY : en, avt_k, avm_k   ! ocean vertical physics
@@ -833,5 +833,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise
          !                                   ! ---------------
          IF( ln_rstart ) THEN                   !* Read the restart file
Index: /NEMO/trunk/src/OCE/do_loop_substitute.h90
===================================================================
--- /NEMO/trunk/src/OCE/do_loop_substitute.h90	(revision 14071)
+++ /NEMO/trunk/src/OCE/do_loop_substitute.h90	(revision 14072)
@@ -14,5 +14,5 @@
 !   DO jj = ....                           DO jj = ...
 !      DO ji = ....                           DO ji = ...
-!         .                   OR                 .  
+!         .                   OR                 .
 !         .                                      .
 !     END DO                                  END DO
@@ -25,5 +25,5 @@
 ! Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj)
 !
-! The macro naming convention takes the form: DO_2D( B, T, L, R) where: 
+! The macro naming convention takes the form: DO_2D( B, T, L, R) where:
 !   B is the Bottom offset from the PE's inner domain;
 !   T is the Top    offset from the PE's inner domain;
@@ -32,5 +32,5 @@
 !
 ! So, given an inner domain of 2,jpim1 and 2,jpjm1, a typical example would replace:
-! 
+!
 !   DO jj = 2, jpj
 !      DO ji = 1, jpim1
@@ -46,15 +46,15 @@
 !      .
 !   END_2D
-! 
-! similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments 
-! and are not restricted. This includes the possibility of strides for which an extra set of DO_3DS 
+!
+! similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments
+! and are not restricted. This includes the possibility of strides for which an extra set of DO_3DS
 ! macros are defined.
 !
-! In the following definitions the inner PE domain is defined by start indices of (Nis0, Njs0) and end 
+! In the following definitions the inner PE domain is defined by start indices of (Nis0, Njs0) and end
 ! indices of (Nie0, Nje0) where:
 !
 ! Nis0 =   1 + nn_hls     Njs0 =   1 + nn_hls
 ! Nie0 = jpi - nn_hls     Nje0 = jpj - nn_hls
-! 
+!
 #endif
 
Index: /NEMO/trunk/src/OCE/nemogcm.F90
===================================================================
--- /NEMO/trunk/src/OCE/nemogcm.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/nemogcm.F90	(revision 14072)
@@ -29,5 +29,5 @@
    !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!             -   ! 2011-11  (C. Harris) decomposition changes for running with CICE
-   !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening 
+   !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening
    !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla)
    !!            4.0  ! 2016-10  (G. Madec, S. Flavoni)  domain configuration / user defined interface
@@ -74,5 +74,5 @@
    USE lib_mpp        ! distributed memory computing
    USE mppini         ! shared/distributed memory setting (mpp_init routine)
-   USE lbcnfd  , ONLY : isendto, nsndto  ! Setup of north fold exchanges 
+   USE lbcnfd  , ONLY : isendto, nsndto  ! Setup of north fold exchanges
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
    USE halo_mng       ! Halo manager
@@ -184,5 +184,5 @@
             CALL stp_MLF      ( istp )
 #  else
-            CALL stp        ( istp ) 
+            CALL stp        ( istp )
 #  endif
             istp = istp + 1
@@ -195,5 +195,5 @@
          !
          DO WHILE( istp <= nitend .AND. nstop == 0 )
-            CALL stp_diurnal( istp )   ! time step only the diurnal SST 
+            CALL stp_diurnal( istp )   ! time step only the diurnal SST
             istp = istp + 1
          END DO
@@ -308,5 +308,5 @@
 #ifdef key_agrif
       ELSE
-                  numnul = Agrif_Parent(numnul)   
+                  numnul = Agrif_Parent(numnul)
 #endif
       ENDIF
@@ -373,5 +373,5 @@
 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' )
       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 )
-904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )   
+904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
@@ -396,5 +396,5 @@
 #if defined key_agrif
       Kbb_a = Nbb   ;   Kmm_a = Nnn   ;   Krhs_a = Nrhs   ! agrif_oce module copies of time level indices
-#endif 
+#endif
       !                             !-------------------------------!
       !                             !  NEMO general initialization  !
@@ -416,11 +416,11 @@
 #endif
                            CALL     dom_init( Nbb, Nnn, Naa )   ! Domain
-      IF( ln_crs       )   CALL     crs_init(      Nnn      )   ! coarsened grid: domain initialization 
+      IF( ln_crs       )   CALL     crs_init(      Nnn      )   ! coarsened grid: domain initialization
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
-      
+
                            CALL diurnal_sst_bulk_init       ! diurnal sst
-      IF( ln_diurnal   )   CALL diurnal_sst_coolskin_init   ! cool skin   
-      !                            
+      IF( ln_diurnal   )   CALL diurnal_sst_coolskin_init   ! cool skin
+      !
       IF( ln_diurnal_only ) THEN                    ! diurnal only: a subset of the initialisation routines
          CALL  istate_init( Nbb, Nnn, Naa )         ! ocean initial state (Dynamics and tracers)
@@ -430,5 +430,5 @@
             CALL dia_obs_init( Nnn )                ! Initialize observational data
             CALL dia_obs( nit000 - 1, Nnn )         ! Observation operator for restart
-         ENDIF     
+         ENDIF
          IF( lk_asminc )   CALL asm_inc_init( Nbb, Nnn, Nrhs )   ! Assimilation increments
          !
@@ -439,5 +439,5 @@
                            CALL  istate_init( Nbb, Nnn, Naa )    ! ocean initial state (Dynamics and tracers)
 
-      !                                      ! external forcing 
+      !                                      ! external forcing
                            CALL    tide_init                     ! tidal harmonics
                            CALL     sbc_init( Nbb, Nnn, Naa )    ! surface boundary conditions (including sea-ice)
@@ -446,5 +446,5 @@
       !                                      ! Ocean physics
                            CALL zdf_phy_init( Nnn )    ! Vertical physics
-                                     
+
       !                                         ! Lateral physics
                            CALL ldf_tra_init      ! Lateral ocean tracer physics
@@ -482,5 +482,5 @@
                            CALL sto_par_init    ! Stochastic parametrization
       IF( ln_sto_eos   )   CALL sto_pts_init    ! RRandom T/S fluctuations
-     
+
       !                                      ! Diagnostics
                            CALL     flo_init( Nnn )    ! drifting Floats
@@ -526,8 +526,8 @@
          WRITE(numout,*) '                              sn_cfctl%l_prttrc  = ', sn_cfctl%l_prttrc
          WRITE(numout,*) '                              sn_cfctl%l_oasout  = ', sn_cfctl%l_oasout
-         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin  
-         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax  
-         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr 
-         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr 
+         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin
+         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax
+         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr
+         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr
          WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing
          WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl
@@ -599,5 +599,5 @@
       !!----------------------------------------------------------------------
       !
-      ierr =        oce_alloc    ()    ! ocean 
+      ierr =        oce_alloc    ()    ! ocean
       ierr = ierr + dia_wri_alloc()
       ierr = ierr + dom_oce_alloc()    ! ocean domain
@@ -611,5 +611,5 @@
    END SUBROUTINE nemo_alloc
 
-   
+
    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto )
       !!----------------------------------------------------------------------
Index: /NEMO/trunk/src/OCE/par_oce.F90
===================================================================
--- /NEMO/trunk/src/OCE/par_oce.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/par_oce.F90	(revision 14072)
@@ -22,18 +22,18 @@
    !
    LOGICAL       ::   ln_use_jattr     !: input file read offset
-   !                                   !  Use file global attribute: open_ocean_jstart to determine start j-row 
-   !                                   !  when reading input from those netcdf files that have the 
-   !                                   !  attribute defined. This is designed to enable input files associated 
-   !                                   !  with the extended grids used in the under ice shelf configurations to 
+   !                                   !  Use file global attribute: open_ocean_jstart to determine start j-row
+   !                                   !  when reading input from those netcdf files that have the
+   !                                   !  attribute defined. This is designed to enable input files associated
+   !                                   !  with the extended grids used in the under ice shelf configurations to
    !                                   !  be used without redundant rows when the ice shelves are not in use.
    LOGICAL       ::   ln_closea        !: (=T) special treatment of closed sea
-   ! 
+   !
 
    !!---------------------------------------------------------------------
-   !! Domain Matrix size 
+   !! Domain Matrix size
    !!---------------------------------------------------------------------
    ! configuration name & resolution   (required only in ORCA family case)
    CHARACTER(lc) ::   cn_cfg           !: name of the configuration
-   INTEGER       ::   nn_cfg           !: resolution of the configuration 
+   INTEGER       ::   nn_cfg           !: resolution of the configuration
 
    ! time dimension
@@ -84,9 +84,9 @@
    !!----------------------------------------------------------------------
    !! if we dont use massively parallel computer (parameters jpni=jpnj=1) so jpiglo=jpi and jpjglo=jpj
-   INTEGER, PUBLIC            ::   jpni         !: number of processors following i 
+   INTEGER, PUBLIC            ::   jpni         !: number of processors following i
    INTEGER, PUBLIC            ::   jpnj         !: number of processors following j
    INTEGER, PUBLIC            ::   jpnij        !: nb of local domain = nb of processors ( <= jpni x jpnj )
-   INTEGER, PUBLIC, PARAMETER ::   jpr2di = 0   !: number of columns for extra outer halo 
-   INTEGER, PUBLIC, PARAMETER ::   jpr2dj = 0   !: number of rows    for extra outer halo 
+   INTEGER, PUBLIC, PARAMETER ::   jpr2di = 0   !: number of columns for extra outer halo
+   INTEGER, PUBLIC, PARAMETER ::   jpr2dj = 0   !: number of rows    for extra outer halo
 
    ! halo with and starting/inding DO-loop indices
@@ -101,5 +101,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id$ 
+   !! $Id$
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!======================================================================
Index: /NEMO/trunk/src/OCE/step.F90
===================================================================
--- /NEMO/trunk/src/OCE/step.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/step.F90	(revision 14072)
@@ -27,5 +27,5 @@
    !!            3.6  !  2014-04  (F. Roquet, G. Madec) New equations of state
    !!            3.6  !  2014-10  (E. Clementi, P. Oddo) Add Qiao vertical mixing in case of waves
-   !!            3.7  !  2014-10  (G. Madec)  LDF simplication 
+   !!            3.7  !  2014-10  (G. Madec)  LDF simplication
    !!             -   !  2014-12  (G. Madec) remove KPP scheme
    !!             -   !  2015-11  (J. Chanut) free surface simplification (remove filtered free surface)
@@ -109,12 +109,12 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       !
-      IF( l_1st_euler ) THEN  
+      IF( l_1st_euler ) THEN
          ! start or restart with Euler 1st time-step
-         rDt =  rn_Dt   
+         rDt =  rn_Dt
          r1_Dt = 1._wp / rDt
       ENDIF
       !
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! update I/O and calendar 
+      ! update I/O and calendar
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS)
@@ -149,5 +149,5 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF( ln_tide    )   CALL tide_update( kstp )                     ! update tide potential
-      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib) 
+      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)
       IF( ln_bdy     )   CALL bdy_dta ( kstp, Nnn )                   ! update dynamic & tracer data at open boundaries
       IF( ln_isf     )   CALL isf_stp ( kstp, Nnn )
@@ -184,7 +184,7 @@
             &            CALL zps_hde_isf( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF)
             &                                          rhd, gru , grv , grui, grvi   )       ! of t, s, rd at the first ocean level
-         IF( ln_traldf_triad ) THEN 
+         IF( ln_traldf_triad ) THEN
                          CALL ldf_slp_triad( kstp, Nbb, Nnn )             ! before slope for triad operator
-         ELSE     
+         ELSE
                          CALL ldf_slp     ( kstp, rhd, rn2b, Nbb, Nnn )   ! before slope for standard operator
          ENDIF
@@ -192,5 +192,5 @@
       !                                                                        ! eddy diffusivity coeff.
       IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp, Nbb, Nnn )  !       and/or eiv coeff.
-      IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff. 
+      IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff.
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -199,10 +199,10 @@
 
                             CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )    ! after ssh (includes call to div_hor)
-      IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors 
-                            CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )    ! now cross-level velocity 
+      IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors
+                            CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )    ! now cross-level velocity
       IF( ln_zad_Aimp )     CALL wAimp         ( kstp,      Nnn           )  ! Adaptive-implicit vertical advection partitioning
                             CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation
-                            
-                            
+
+
                          uu(:,:,:,Nrhs) = 0._wp            ! set dynamics trends to zero
                          vv(:,:,:,Nrhs) = 0._wp
@@ -212,5 +212,5 @@
       IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends
 #if defined key_agrif
-      IF(.NOT. Agrif_Root())  & 
+      IF(.NOT. Agrif_Root())  &
                &         CALL Agrif_Sponge_dyn        ! momentum sponge
 #endif
@@ -229,14 +229,14 @@
                             CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )  ! vertical diffusion
       IF( ln_dynspg_ts ) THEN                                                       ! vertical scale factors and vertical velocity need to be updated
-                            CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! now cross-level velocity 
+                            CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! now cross-level velocity
          IF( ln_zad_Aimp )  CALL wAimp      ( kstp,      Nnn )                      ! Adaptive-implicit vertical advection partitioning
       ENDIF
-      
+
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! cool skin
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF ( ln_diurnal )  CALL diurnal_layers( kstp )
-      
+
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! diagnostics and outputs
@@ -252,5 +252,5 @@
       IF( lk_diadetide ) CALL dia_detide( kstp )                ! Weights computation for daily detiding of model diagnostics
       IF( lk_diamlr  )   CALL dia_mlr                           ! Update time used in multiple-linear-regression analysis
-      
+
 #if defined key_top
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -261,5 +261,5 @@
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Active tracers                              
+      ! Active tracers
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       ! Loop over tile domains
@@ -294,5 +294,5 @@
 
                             CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection	==> RHS
-         IF( ln_zdfmfc  )   CALL tra_mfc    ( kstp, Nbb,      ts, Nrhs )  ! Mass Flux Convection 
+         IF( ln_zdfmfc  )   CALL tra_mfc    ( kstp, Nbb,      ts, Nrhs )  ! Mass Flux Convection
          IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS
          IF( lrst_oce .AND. ln_zdfosm ) &
@@ -308,17 +308,17 @@
       ! Set boundary conditions, time filter and swap time levels
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-!!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap 
-!!    (and time filtering) after Agrif update. Then restart would be done after and would contain updated fields. 
-!!    If so: 
+!!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap
+!!    (and time filtering) after Agrif update. Then restart would be done after and would contain updated fields.
+!!    If so:
 !!    (i) no need to call agrif update at initialization time
-!!    (ii) no need to update "before" fields 
+!!    (ii) no need to update "before" fields
 !!
-!!    Apart from creating new tra_swp/dyn_swp routines, this however: 
-!!    (i) makes boundary conditions at initialization time computed from updated fields which is not the case between 
-!!    two restarts => restartability issue. One can circumvent this, maybe, by assuming "interface separation", 
-!!    e.g. a shift of the feedback interface inside child domain. 
+!!    Apart from creating new tra_swp/dyn_swp routines, this however:
+!!    (i) makes boundary conditions at initialization time computed from updated fields which is not the case between
+!!    two restarts => restartability issue. One can circumvent this, maybe, by assuming "interface separation",
+!!    e.g. a shift of the feedback interface inside child domain.
 !!    (ii) requires that all restart outputs of updated variables by agrif (e.g. passive tracers/tke/barotropic arrays) are done at the same
 !!    place.
-!! 
+!!
 !!jc2: dynnxt must be the latest call. e3t(:,:,:,Nbb) are indeed updated in that routine
                          CALL tra_atf       ( kstp, Nbb, Nnn, Naa, ts )                      ! time filtering of "now" tracer arrays
@@ -347,5 +347,5 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! AGRIF recursive integration
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs      ! agrif_oce module copies of time level indices
                          CALL Agrif_Integrate_ChildGrids( stp )       ! allows to finish all the Child Grids before updating
@@ -360,5 +360,5 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! AGRIF update
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN
                          CALL Agrif_update_all( )                  ! Update all components
@@ -370,5 +370,5 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! File manipulation at the end of the first time step
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                         
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF( kstp == nit000 ) THEN                          ! 1st time step only
                                         CALL iom_close( numror )   ! close input  ocean restart file
@@ -386,15 +386,15 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Finalize contextes if end of simulation or error detected
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                         
-      IF( kstp == nitend .OR. nstop > 0 ) THEN 
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      IF( kstp == nitend .OR. nstop > 0 ) THEN
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
+         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) !
       ENDIF
 #endif
       !
       IF( l_1st_euler ) THEN         ! recover Leap-frog timestep
-         rDt = 2._wp * rn_Dt   
+         rDt = 2._wp * rn_Dt
          r1_Dt = 1._wp / rDt
-         l_1st_euler = .FALSE.      
+         l_1st_euler = .FALSE.
       ENDIF
       !
Index: /NEMO/trunk/src/OCE/step_oce.F90
===================================================================
--- /NEMO/trunk/src/OCE/step_oce.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/step_oce.F90	(revision 14072)
@@ -6,5 +6,5 @@
    !!======================================================================
    !! History :   3.3  !  2010-08  (C. Ethe)  Original code - reorganisation of the initial phase
-   !!             3.7  !  2014-01  (G. Madec) LDF simplication 
+   !!             3.7  !  2014-01  (G. Madec) LDF simplication
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers variables
@@ -35,5 +35,5 @@
    USE domvvl          ! variable vertical scale factors  (dom_vvl_sf_nxt routine)
    !                                                      (dom_vvl_sf_swp routine)
-   
+
    USE divhor          ! horizontal divergence            (div_hor routine)
    USE dynadv          ! advection                        (dyn_adv routine)
@@ -60,5 +60,5 @@
 
    USE stopar          ! Stochastic parametrization       (sto_par routine)
-   USE stopts 
+   USE stopts
 
    USE ldfslp          ! iso-neutral slopes               (ldf_slp routine)
@@ -73,6 +73,6 @@
 
    USE diu_layers      ! diurnal SST bulk and coolskin routines
-   USE sbc_oce         ! surface fluxes  
-   
+   USE sbc_oce         ! surface fluxes
+
    USE zpshde          ! partial step: hor. derivative     (zps_hde routine)
 
Index: /NEMO/trunk/src/OCE/timing.F90
===================================================================
--- /NEMO/trunk/src/OCE/timing.F90	(revision 14071)
+++ /NEMO/trunk/src/OCE/timing.F90	(revision 14072)
@@ -3,32 +3,32 @@
    !!                     ***  MODULE  timing  ***
    !!========================================================================
-   !! History : 4.0  ! 2001-05  (R. Benshila)   
+   !! History : 4.0  ! 2001-05  (R. Benshila)
    !!------------------------------------------------------------------------
 
    !!------------------------------------------------------------------------
-   !!   timming_init    : initialize timing process 
+   !!   timming_init    : initialize timing process
    !!   timing_start    : start Timer
    !!   timing_stop     : stop  Timer
    !!   timing_reset    : end timing variable creation
-   !!   timing_finalize : compute stats and write output in calling w*_info 
-   !!   timing_ini_var  : create timing variables 
+   !!   timing_finalize : compute stats and write output in calling w*_info
+   !!   timing_ini_var  : create timing variables
    !!   timing_listing  : print instumented subroutines in ocean.output
    !!   wcurrent_info   : compute and print detailed stats on the current CPU
    !!   wave_info       : compute and print averaged statson all processors
-   !!   wmpi_info       : compute and write global stats  
-   !!   supress         : suppress an element of the timing linked list  
-   !!   insert          : insert an element of the timing linked list  
+   !!   wmpi_info       : compute and write global stats
+   !!   supress         : suppress an element of the timing linked list
+   !!   insert          : insert an element of the timing linked list
    !!------------------------------------------------------------------------
-   USE in_out_manager  ! I/O manager 
+   USE in_out_manager  ! I/O manager
    USE dom_oce         ! ocean domain
-   USE lib_mpp          
-   
+   USE lib_mpp
+
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   timing_init, timing_finalize   ! called in nemogcm module 
-   PUBLIC   timing_reset                   ! called in step module 
-   PUBLIC   timing_start, timing_stop      ! called in each routine to time 
-   
+   PUBLIC   timing_init, timing_finalize   ! called in nemogcm module
+   PUBLIC   timing_reset                   ! called in step module
+   PUBLIC   timing_start, timing_stop      ! called in each routine to time
+
 #if defined key_mpp_mpi
    INCLUDE 'mpif.h'
@@ -41,5 +41,5 @@
       INTEGER :: rank
       REAL(wp)  :: t_cpu, t_clock, tsum_cpu, tsum_clock, tmax_cpu, tmax_clock, tmin_cpu, tmin_clock, tsub_cpu, tsub_clock
-      INTEGER :: ncount, ncount_max, ncount_rate  
+      INTEGER :: ncount, ncount_max, ncount_rate
       INTEGER :: niter
       LOGICAL :: l_tdone
@@ -48,5 +48,5 @@
       TYPE(timer), POINTER :: parent_section => NULL()
    END TYPE timer
-    
+
    TYPE alltimer
       CHARACTER(LEN=20), DIMENSION(:), POINTER :: cname => NULL()
@@ -56,6 +56,6 @@
       TYPE(alltimer), POINTER :: next => NULL()
       TYPE(alltimer), POINTER :: prev => NULL()
-   END TYPE alltimer 
- 
+   END TYPE alltimer
+
    TYPE(timer), POINTER :: s_timer_root => NULL()
    TYPE(timer), POINTER :: s_timer      => NULL()
@@ -66,5 +66,5 @@
    LOGICAL :: l_initdone = .FALSE.
    INTEGER :: nsize
-   
+
    ! Variables for coarse grain timing
    REAL(wp) :: tot_etime, tot_ctime
@@ -76,7 +76,7 @@
    CHARACTER(LEN=10), DIMENSION(2) :: ctime
    CHARACTER(LEN=5)                :: czone
-    
+
    ! From of ouput file (1/proc or one global)   !RB to put in nammpp or namctl
-   LOGICAL :: ln_onefile = .TRUE. 
+   LOGICAL :: ln_onefile = .TRUE.
    LOGICAL :: lwriter
    !!----------------------------------------------------------------------
@@ -96,5 +96,5 @@
        IF(ASSOCIATED(s_timer) ) s_timer_old => s_timer
        !
-      ! Create timing structure at first call of the routine 
+      ! Create timing structure at first call of the routine
        CALL timing_ini_var(cdinfo)
    !   write(*,*) 'after inivar ', s_timer%cname
@@ -102,9 +102,9 @@
       ! ici timing_ini_var a soit retrouve s_timer et fait return soit ajoute un maillon
       ! maintenant on regarde si le call d'avant corrsspond a un parent ou si il est ferme
-      IF( .NOT. s_timer_old%l_tdone ) THEN      
+      IF( .NOT. s_timer_old%l_tdone ) THEN
          s_timer%parent_section => s_timer_old
       ELSE
          s_timer%parent_section => NULL()
-      ENDIF    
+      ENDIF
 
       s_timer%l_tdone = .FALSE.
@@ -112,5 +112,5 @@
       s_timer%t_cpu = 0.
       s_timer%t_clock = 0.
-                  
+
       ! CPU time collection
       CALL CPU_TIME( s_timer%t_cpu  )
@@ -136,5 +136,5 @@
       CHARACTER(len=*), INTENT(in), OPTIONAL :: csection
       !
-      INTEGER  :: ifinal_count, iperiods    
+      INTEGER  :: ifinal_count, iperiods
       REAL(wp) :: zcpu_end, zmpitime,zcpu_raw,zclock_raw
       !
@@ -152,12 +152,12 @@
 !!$      IF(associated(s_timer%parent_section))then
 !!$        write(*,*) s_timer%cname,' <-- ', s_timer%parent_section%cname
-!!$      ENDIF  
+!!$      ENDIF
 
  !     No need to search ... : s_timer has the last value defined in start
  !     s_timer => s_timer_root
- !     DO WHILE( TRIM(s_timer%cname) /= TRIM(cdinfo) ) 
+ !     DO WHILE( TRIM(s_timer%cname) /= TRIM(cdinfo) )
  !        IF( ASSOCIATED(s_timer%next) ) s_timer => s_timer%next
  !     END DO
- 
+
       ! CPU time correction
       zcpu_raw = zcpu_end - s_timer%t_cpu - t_overcpu ! total time including child
@@ -172,31 +172,31 @@
       iperiods = ifinal_count - s_timer%ncount
       IF( ifinal_count < s_timer%ncount )  &
-         iperiods = iperiods + s_timer%ncount_max 
-         zclock_raw = REAL(iperiods) / s_timer%ncount_rate !- t_overclock   
+         iperiods = iperiods + s_timer%ncount_max
+         zclock_raw = REAL(iperiods) / s_timer%ncount_rate !- t_overclock
          s_timer%t_clock  = zclock_raw - s_timer%tsub_clock
 #endif
  !     IF(s_timer%cname==trim('lbc_lnk_2d')) write(*,*) zclock_raw , s_timer%tsub_clock
-      
+
       ! Correction of parent section
       IF( .NOT. PRESENT(csection) ) THEN
          IF ( ASSOCIATED(s_timer%parent_section ) ) THEN
-            s_timer%parent_section%tsub_cpu   = zcpu_raw   + s_timer%parent_section%tsub_cpu 
-            s_timer%parent_section%tsub_clock = zclock_raw + s_timer%parent_section%tsub_clock             
+            s_timer%parent_section%tsub_cpu   = zcpu_raw   + s_timer%parent_section%tsub_cpu
+            s_timer%parent_section%tsub_clock = zclock_raw + s_timer%parent_section%tsub_clock
          ENDIF
       ENDIF
-            
-      ! time diagnostics 
-      s_timer%tsum_clock = s_timer%tsum_clock + s_timer%t_clock 
+
+      ! time diagnostics
+      s_timer%tsum_clock = s_timer%tsum_clock + s_timer%t_clock
       s_timer%tsum_cpu   = s_timer%tsum_cpu   + s_timer%t_cpu
 !RB to use to get min/max during a time integration
 !      IF( .NOT. l_initdone ) THEN
-!         s_timer%tmin_clock = s_timer%t_clock 
-!         s_timer%tmin_cpu   = s_timer%t_cpu 
+!         s_timer%tmin_clock = s_timer%t_clock
+!         s_timer%tmin_cpu   = s_timer%t_cpu
 !      ELSE
-!         s_timer%tmin_clock = MIN( s_timer%tmin_clock, s_timer%t_clock ) 
-!         s_timer%tmin_cpu   = MIN( s_timer%tmin_cpu  , s_timer%t_cpu   ) 
-!      ENDIF   
-!      s_timer%tmax_clock = MAX( s_timer%tmax_clock, s_timer%t_clock ) 
-!      s_timer%tmax_cpu   = MAX( s_timer%tmax_cpu  , s_timer%t_cpu   )  
+!         s_timer%tmin_clock = MIN( s_timer%tmin_clock, s_timer%t_clock )
+!         s_timer%tmin_cpu   = MIN( s_timer%tmin_cpu  , s_timer%t_cpu   )
+!      ENDIF
+!      s_timer%tmax_clock = MAX( s_timer%tmax_clock, s_timer%t_clock )
+!      s_timer%tmax_cpu   = MAX( s_timer%tmax_cpu  , s_timer%t_cpu   )
       !
       s_timer%tsub_clock = 0.
@@ -207,10 +207,10 @@
       ! we come back
       IF ( ASSOCIATED(s_timer%parent_section ) ) s_timer => s_timer%parent_section
-     
+
 !      write(*,*) 'end of stop ', s_timer%cname
 
    END SUBROUTINE timing_stop
- 
- 
+
+
    SUBROUTINE timing_init( clname )
       !!----------------------------------------------------------------------
@@ -235,6 +235,6 @@
          lwriter = .TRUE.
       ENDIF
-      
-      IF( lwriter) THEN      
+
+      IF( lwriter) THEN
          WRITE(numtime,*)
          WRITE(numtime,*) '      CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC - INGV'
@@ -246,11 +246,11 @@
          WRITE(numtime,*)
          WRITE(numtime,*)
-      ENDIF   
-      
+      ENDIF
+
       ! Compute clock function overhead
-#if defined key_mpp_mpi        
+#if defined key_mpp_mpi
       t_overclock = MPI_WTIME()
       t_overclock = MPI_WTIME() - t_overclock
-#else        
+#else
       CALL SYSTEM_CLOCK(COUNT_RATE=ncount_rate, COUNT_MAX=ncount_max)
       CALL SYSTEM_CLOCK(COUNT = istart_count)
@@ -258,5 +258,5 @@
       iperiods = ifinal_count - istart_count
       IF( ifinal_count < istart_count )  &
-          iperiods = iperiods + ncount_max 
+          iperiods = iperiods + ncount_max
       t_overclock = REAL(iperiods) / ncount_rate
 #endif
@@ -265,14 +265,14 @@
       CALL CPU_TIME(zdum)
       CALL CPU_TIME(t_overcpu)
-      
-      ! End overhead omputation  
-      t_overcpu = t_overcpu - zdum        
-      t_overclock = t_overcpu + t_overclock        
+
+      ! End overhead omputation
+      t_overcpu = t_overcpu - zdum
+      t_overclock = t_overcpu + t_overclock
 
       ! Timing on date and time
       CALL DATE_AND_TIME(cdate(1),ctime(1),czone,nvalues)
-    
-      CALL CPU_TIME(t_cpu(1))      
-#if defined key_mpp_mpi        
+
+      CALL CPU_TIME(t_cpu(1))
+#if defined key_mpp_mpi
       ! Start elapsed and CPU time counters
       t_elaps(1) = MPI_WTIME()
@@ -280,5 +280,5 @@
       CALL SYSTEM_CLOCK(COUNT_RATE=ncount_rate, COUNT_MAX=ncount_max)
       CALL SYSTEM_CLOCK(COUNT = ncount)
-#endif                 
+#endif
       !
    END SUBROUTINE timing_init
@@ -288,5 +288,5 @@
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE timing_finalize ***
-      !! ** Purpose :  compute average time 
+      !! ** Purpose :  compute average time
       !!               write timing output file
       !!----------------------------------------------------------------------
@@ -295,5 +295,5 @@
       INTEGER :: ji
       LOGICAL :: ll_ord, ll_averep
-      CHARACTER(len=120) :: clfmt            
+      CHARACTER(len=120) :: clfmt
       REAL(wp), DIMENSION(:), ALLOCATABLE ::   timing_glob
       REAL(wp) ::   zsypd   ! simulated years per day (Balaji 2017)
@@ -301,5 +301,5 @@
 
       ll_averep = .TRUE.
-    
+
       ! total CPU and elapse
       CALL CPU_TIME(t_cpu(2))
@@ -311,13 +311,13 @@
       iperiods = nfinal_count - ncount
       IF( nfinal_count < ncount )  &
-          iperiods = iperiods + ncount_max 
+          iperiods = iperiods + ncount_max
       t_elaps(2) = REAL(iperiods) / ncount_rate - t_overclock
-#endif      
+#endif
 
       ! End of timings on date & time
       CALL DATE_AND_TIME(cdate(2),ctime(2),czone,nvalues)
-       
+
       ! Compute the numer of routines
-      nsize = 0 
+      nsize = 0
       s_timer => s_timer_root
       DO WHILE( ASSOCIATED(s_timer) )
@@ -334,7 +334,7 @@
          IF( lwriter ) WRITE(numtime,*)
          ll_averep = .FALSE.
-      ENDIF   
-
-#if defined key_mpp_mpi      
+      ENDIF
+
+#if defined key_mpp_mpi
       ! in MPI gather some info
       ALLOCATE( all_etime(jpnij), all_ctime(jpnij) )
@@ -349,28 +349,28 @@
 #else
       tot_etime = t_elaps(2)
-      tot_ctime = t_cpu  (2)           
+      tot_ctime = t_cpu  (2)
 #endif
 
       ! write output file
-      IF( lwriter ) WRITE(numtime,*) 
-      IF( lwriter ) WRITE(numtime,*) 
+      IF( lwriter ) WRITE(numtime,*)
+      IF( lwriter ) WRITE(numtime,*)
       IF( lwriter ) WRITE(numtime,*) 'Total timing (sum) :'
       IF( lwriter ) WRITE(numtime,*) '--------------------'
       IF( lwriter ) WRITE(numtime,"('Elapsed Time (s)  CPU Time (s)')")
       IF( lwriter ) WRITE(numtime,'(5x,f12.3,1x,f12.3)')  tot_etime, tot_ctime
-      IF( lwriter ) WRITE(numtime,*) 
+      IF( lwriter ) WRITE(numtime,*)
 #if defined key_mpp_mpi
       IF( ll_averep ) CALL waver_info
       CALL wmpi_info
-#endif      
+#endif
       IF( lwriter ) CALL wcurrent_info
-      
+
       clfmt='(1X,"Timing started on ",2(A2,"/"),A4," at ",2(A2,":"),A2," MET ",A3,":",A2," from GMT")'
-      IF( lwriter ) WRITE(numtime, TRIM(clfmt)) &           
+      IF( lwriter ) WRITE(numtime, TRIM(clfmt)) &
       &       cdate(1)(7:8), cdate(1)(5:6), cdate(1)(1:4),   &
       &       ctime(1)(1:2), ctime(1)(3:4), ctime(1)(5:6),   &
-      &       czone(1:3),    czone(4:5)                     
+      &       czone(1:3),    czone(4:5)
       clfmt='(1X,  "Timing   ended on ",2(A2,"/"),A4," at ",2(A2,":"),A2," MET ",A3,":",A2," from GMT")'
-      IF( lwriter ) WRITE(numtime, TRIM(clfmt)) &           
+      IF( lwriter ) WRITE(numtime, TRIM(clfmt)) &
       &       cdate(2)(7:8), cdate(2)(5:6), cdate(2)(1:4),   &
       &       ctime(2)(1:2), ctime(2)(3:4), ctime(2)(5:6),   &
@@ -402,10 +402,10 @@
       ENDIF
       DEALLOCATE(timing_glob)
-#endif      
-
-      IF( lwriter ) CLOSE(numtime) 
+#endif
+
+      IF( lwriter ) CLOSE(numtime)
       !
    END SUBROUTINE timing_finalize
-   
+
 
    SUBROUTINE wcurrent_info
@@ -415,7 +415,7 @@
       !!----------------------------------------------------------------------
       LOGICAL :: ll_ord
-      CHARACTER(len=2048) :: clfmt            
-   
-      ! reorder the current list by elapse time      
+      CHARACTER(len=2048) :: clfmt
+
+      ! reorder the current list by elapse time
       s_wrk => NULL()
       s_timer => s_timer_root
@@ -425,11 +425,11 @@
          DO WHILE ( ASSOCIATED( s_timer%next ) )
             IF (.NOT. ASSOCIATED(s_timer%next)) EXIT
-            IF ( s_timer%tsum_clock < s_timer%next%tsum_clock ) THEN 
+            IF ( s_timer%tsum_clock < s_timer%next%tsum_clock ) THEN
                ALLOCATE(s_wrk)
                s_wrk = s_timer%next
                CALL insert  (s_timer, s_timer_root, s_wrk)
-               CALL suppress(s_timer%next)            
+               CALL suppress(s_timer%next)
                ll_ord = .FALSE.
-               CYCLE            
+               CYCLE
             ENDIF
             IF( ASSOCIATED(s_timer%next) ) s_timer => s_timer%next
@@ -437,5 +437,5 @@
          IF( ll_ord ) EXIT
       END DO
-            
+
       ! write current info
       WRITE(numtime,*) 'Detailed timing for proc :', narea-1
@@ -443,6 +443,6 @@
       WRITE(numtime,*) 'Section             ',            &
       &   'Elapsed Time (s)  ','Elapsed Time (%)  ',   &
-      &   'CPU Time(s)  ','CPU Time (%)  ','CPU/Elapsed  ','Frequency' 
-      s_timer => s_timer_root  
+      &   'CPU Time(s)  ','CPU Time (%)  ','CPU/Elapsed  ','Frequency'
+      s_timer => s_timer_root
       clfmt = '(1x,a,4x,f12.3,6x,f12.3,x,f12.3,2x,f12.3,6x,f7.3,2x,i9)'
       DO WHILE ( ASSOCIATED(s_timer) )
@@ -455,8 +455,8 @@
       END DO
       WRITE(numtime,*)
-      !                  
+      !
    END SUBROUTINE wcurrent_info
 
-#if defined key_mpp_mpi     
+#if defined key_mpp_mpi
    SUBROUTINE waver_info
       !!----------------------------------------------------------------------
@@ -470,8 +470,8 @@
       INTEGER :: icode
       INTEGER :: ierr
-      LOGICAL :: ll_ord           
-      CHARACTER(len=200) :: clfmt              
-                 
-      ! Initialised the global strucutre   
+      LOGICAL :: ll_ord
+      CHARACTER(len=200) :: clfmt
+
+      ! Initialised the global strucutre
       ALLOCATE(sl_timer_glob_root, Stat=ierr)
       IF(ierr /= 0)THEN
@@ -524,6 +524,6 @@
          sl_timer_ave_root%prev => NULL()
          ALLOCATE(sl_timer_ave)
-         sl_timer_ave => sl_timer_ave_root            
-      ENDIF 
+         sl_timer_ave => sl_timer_ave_root
+      ENDIF
 
       ! Gather info from all processors
@@ -552,9 +552,9 @@
             sl_timer_glob%next%next => NULL()
             sl_timer_glob           => sl_timer_glob%next
-         ENDIF              
+         ENDIF
          s_timer => s_timer%next
-      END DO      
-      
-      IF( narea == 1 ) THEN    
+      END DO
+
+      IF( narea == 1 ) THEN
          ! Compute some stats
          sl_timer_glob => sl_timer_glob_root
@@ -570,13 +570,13 @@
             !
             IF( ASSOCIATED(sl_timer_glob%next) ) THEN
-               ALLOCATE(sl_timer_ave%next)          
+               ALLOCATE(sl_timer_ave%next)
                sl_timer_ave%next%prev => sl_timer_ave
-               sl_timer_ave%next%next => NULL()           
+               sl_timer_ave%next%next => NULL()
                sl_timer_ave           => sl_timer_ave%next
             ENDIF
-            sl_timer_glob => sl_timer_glob%next                                
+            sl_timer_glob => sl_timer_glob%next
          END DO
-      
-         ! reorder the averaged list by CPU time      
+
+         ! reorder the averaged list by CPU time
          s_wrk => NULL()
          sl_timer_ave => sl_timer_ave_root
@@ -588,5 +588,5 @@
                IF( .NOT. ASSOCIATED(sl_timer_ave%next) ) EXIT
 
-               IF ( sl_timer_ave%tsum_clock < sl_timer_ave%next%tsum_clock ) THEN 
+               IF ( sl_timer_ave%tsum_clock < sl_timer_ave%next%tsum_clock ) THEN
                   ALLOCATE(s_wrk)
                   ! Copy data into the new object pointed to by s_wrk
@@ -595,10 +595,10 @@
                   CALL insert  (sl_timer_ave, sl_timer_ave_root, s_wrk)
                   ! Remove the old object from the list
-                  CALL suppress(sl_timer_ave%next)            
+                  CALL suppress(sl_timer_ave%next)
                   ll_ord = .FALSE.
-                  CYCLE            
-               ENDIF           
+                  CYCLE
+               ENDIF
                IF( ASSOCIATED(sl_timer_ave%next) ) sl_timer_ave => sl_timer_ave%next
-            END DO         
+            END DO
             IF( ll_ord ) EXIT
          END DO
@@ -609,10 +609,10 @@
          WRITE(numtime,"('Section',13x,'Elap. Time(s)',2x,'Elap. Time(%)',2x, &
          &   'CPU Time(s)',2x,'CPU Time(%)',2x,'CPU/Elap',1x,   &
-         &   'Max elap(%)',2x,'Min elap(%)',2x,            &           
+         &   'Max elap(%)',2x,'Min elap(%)',2x,            &
          &   'Freq')")
-         sl_timer_ave => sl_timer_ave_root  
+         sl_timer_ave => sl_timer_ave_root
          clfmt = '((A),E15.7,2x,f6.2,5x,f12.2,5x,f6.2,5x,f7.2,2x,f12.2,4x,f6.2,2x,f9.2)'
          DO WHILE ( ASSOCIATED(sl_timer_ave) )
-            IF( sl_timer_ave%tsum_clock > 0. )                                             & 
+            IF( sl_timer_ave%tsum_clock > 0. )                                             &
                WRITE(numtime,TRIM(clfmt))   sl_timer_ave%cname(1:18),                      &
                &   sl_timer_ave%tsum_clock,sl_timer_ave%tsum_clock*100.*jpnij/tot_etime,   &
@@ -630,14 +630,14 @@
       !
       DEALLOCATE(sl_timer_glob_root)
-      !                  
+      !
    END SUBROUTINE waver_info
-  
-  
+
+
    SUBROUTINE wmpi_info
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE wmpi_time  ***
-      !! ** Purpose :   compute and write a summary of MPI infos 
-      !!----------------------------------------------------------------------   
-      !   
+      !! ** Purpose :   compute and write a summary of MPI infos
+      !!----------------------------------------------------------------------
+      !
       INTEGER                            :: idum, icode
       INTEGER, ALLOCATABLE, DIMENSION(:) :: iall_rank
@@ -648,11 +648,11 @@
       CHARACTER(LEN=128), dimension(8) :: cllignes
       CHARACTER(LEN=128)               :: clhline, clstart_date, clfinal_date
-      CHARACTER(LEN=2048)              :: clfmt    
-   
+      CHARACTER(LEN=2048)              :: clfmt
+
       ! Gather all times
       ALLOCATE( zall_ratio(jpnij), iall_rank(jpnij) )
       IF( narea == 1 ) THEN
          iall_rank(:) = (/ (idum,idum=0,jpnij-1) /)
-   
+
          ! Compute elapse user time
          zavg_etime = tot_etime/REAL(jpnij,wp)
@@ -664,5 +664,5 @@
          zmax_ctime = MAXVAL(all_ctime(:))
          zmin_ctime = MINVAL(all_ctime(:))
-   
+
          ! Compute cpu/elapsed ratio
          zall_ratio(:) = all_ctime(:) / all_etime(:)
@@ -670,6 +670,6 @@
          zavg_ratio    = SUM(zall_ratio(:))/REAL(jpnij,wp)
          zmax_ratio    = MAXVAL(zall_ratio(:))
-         zmin_ratio    = MINVAL(zall_ratio(:))   
-   
+         zmin_ratio    = MINVAL(zall_ratio(:))
+
          ! Output Format
          clhline    ='1x,13("-"),"|",18("-"),"|",14("-"),"|",18("-"),/,'
@@ -693,5 +693,5 @@
              zmax_etime,    zmax_ctime,    zmax_ratio,   &
              zavg_etime,    zavg_ctime,    zavg_ratio
-         WRITE(numtime,*)    
+         WRITE(numtime,*)
       END IF
       !
@@ -699,5 +699,5 @@
       !
    END SUBROUTINE wmpi_info
-#endif   
+#endif
 
 
@@ -705,9 +705,9 @@
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE timing_ini_var  ***
-      !! ** Purpose :   create timing structure 
+      !! ** Purpose :   create timing structure
       !!----------------------------------------------------------------------
       CHARACTER(len=*), INTENT(in) :: cdinfo
       LOGICAL :: ll_section
-       
+
       !
       IF( .NOT. ASSOCIATED(s_timer_root) ) THEN
@@ -760,7 +760,7 @@
          ! case of already existing area (typically inside a loop)
    !         write(*,*) 'in ini_var for routine : ', cdinfo
-         DO WHILE( ASSOCIATED(s_timer) ) 
+         DO WHILE( ASSOCIATED(s_timer) )
             IF( TRIM(s_timer%cname) .EQ. TRIM(cdinfo) ) THEN
- !             write(*,*) 'in ini_var for routine : ', cdinfo,' we return'           
+ !             write(*,*) 'in ini_var for routine : ', cdinfo,' we return'
                RETURN ! cdinfo is already in the chain
             ENDIF
@@ -775,13 +775,13 @@
 
     !     write(*,*) 'after search', s_timer%cname
-         ! cdinfo is not part of the chain so we add it with initialisation          
+         ! cdinfo is not part of the chain so we add it with initialisation
           ALLOCATE(s_timer%next)
     !     write(*,*) 'after allocation of next'
-  
+
          s_timer%next%cname       = cdinfo
          s_timer%next%t_cpu      = 0._wp
          s_timer%next%t_clock    = 0._wp
          s_timer%next%tsum_cpu   = 0._wp
-         s_timer%next%tsum_clock = 0._wp  
+         s_timer%next%tsum_clock = 0._wp
          s_timer%next%tmax_cpu   = 0._wp
          s_timer%next%tmax_clock = 0._wp
@@ -799,5 +799,5 @@
          s_timer%next%next => NULL()
          s_timer => s_timer%next
-      ENDIF 
+      ENDIF
       !    write(*,*) 'after allocation'
      !
@@ -808,7 +808,7 @@
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE timing_reset  ***
-      !! ** Purpose :   go to root of timing tree 
-      !!----------------------------------------------------------------------
-      l_initdone = .TRUE. 
+      !! ** Purpose :   go to root of timing tree
+      !!----------------------------------------------------------------------
+      l_initdone = .TRUE.
 !      IF(lwp) WRITE(numout,*)
 !      IF(lwp) WRITE(numout,*) 'timing_reset : instrumented routines for timing'
@@ -821,9 +821,9 @@
 
    RECURSIVE SUBROUTINE timing_list(ptr)
-   
+
       TYPE(timer), POINTER, INTENT(inout) :: ptr
       !
       IF( ASSOCIATED(ptr%next) ) CALL timing_list(ptr%next)
-      IF(lwp) WRITE(numout,*)'   ', ptr%cname   
+      IF(lwp) WRITE(numout,*)'   ', ptr%cname
       !
    END SUBROUTINE timing_list
@@ -837,5 +837,5 @@
       TYPE(timer), POINTER, INTENT(inout) :: sd_current, sd_root, sd_ptr
       !
-     
+
       IF( ASSOCIATED( sd_current, sd_root ) ) THEN
          ! If our current element is the root element then
@@ -852,8 +852,8 @@
       ! to ALLOCATE memory to this pointer will fail.
       sd_ptr => NULL()
-      !    
+      !
    END SUBROUTINE insert
-  
-  
+
+
    SUBROUTINE suppress(sd_ptr)
       !!----------------------------------------------------------------------
@@ -864,7 +864,7 @@
       !
       TYPE(timer), POINTER :: sl_temp
-    
+
       sl_temp => sd_ptr
-      sd_ptr => sd_ptr%next    
+      sd_ptr => sd_ptr%next
       IF ( ASSOCIATED(sl_temp%next) ) sl_temp%next%prev => sl_temp%prev
       DEALLOCATE(sl_temp)
Index: /NEMO/trunk/src/SAS/sbcssm.F90
===================================================================
--- /NEMO/trunk/src/SAS/sbcssm.F90	(revision 14071)
+++ /NEMO/trunk/src/SAS/sbcssm.F90	(revision 14072)
@@ -179,6 +179,9 @@
       TYPE(FLD_N) ::   sn_ssh, sn_e3t, sn_frq
       !!
+      TYPE(FLD_N) ::   sn_ifr, sn_tic, sn_ial
+      !!
       NAMELIST/namsbc_sas/ l_sasread, cn_dir, ln_3d_uve, ln_read_frq,   &
-         &                 sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq
+         &                 sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq, &
+         &                 sn_ifr, sn_tic, sn_ial
       !!----------------------------------------------------------------------
       !
Index: /NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90
===================================================================
--- /NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90	(revision 14071)
+++ /NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90	(revision 14072)
@@ -20,4 +20,5 @@
    USE ice, ONLY       : at_i_b, a_i_b
    USE icethd_dh       ! for CALL ice_thd_snwblow
+   USE sbc_phy, ONLY : pp_cldf
    !
    USE in_out_manager  ! I/O manager
@@ -26,4 +27,5 @@
    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
 
+   
    IMPLICIT NONE
    PRIVATE
Index: /NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90
===================================================================
--- /NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14071)
+++ /NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14072)
@@ -20,4 +20,5 @@
    USE ice, ONLY       : at_i_b, a_i_b
    USE icethd_dh       ! for CALL ice_thd_snwblow
+   USE sbc_phy, ONLY : pp_cldf
    !
    USE in_out_manager  ! I/O manager
Index: /NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90
===================================================================
--- /NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90	(revision 14071)
+++ /NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90	(revision 14072)
@@ -20,4 +20,5 @@
    USE ice, ONLY       : at_i_b, a_i_b, at_i, u_ice, v_ice
    USE icethd_dh       ! for CALL ice_thd_snwblow
+   USE sbc_phy, ONLY : pp_cldf
    !
    USE in_out_manager  ! I/O manager
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-an05_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-an05_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-an05_cfg	(revision 14072)
@@ -0,0 +1,283 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration with ICE, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF-AN05_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 2  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !!   
+   !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+   ln_Cx_ice_cst = .false.    ! use constant ice-air bulk transfer coefficients (value given below)
+      rn_Cd_i  = 1.4e-3       ! sea-ice drag coefficient
+      rn_Ce_i  = 1.4e-3       !    "    sublimation coefficient
+      rn_Ch_i  = 1.4e-3       !    "    sensible heat flux coefficient
+   ln_Cx_ice_AN05  = .true.   !  (Andreas et al. 2005)
+   ln_Cx_ice_LU12  = .false.  !  (Lupkes et al. 2012)
+   ln_Cx_ice_LG15  = .false.  !  (Lupkes & Gryanik 2015)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+   !! Following only needed with STATION_ASF compiled with "sea-ice" support: "key_si3" (ice fraction, ice surface temperature and sea-ice albedo:
+   sn_ifr  = '<SFORC>', 1.         , 'siconc'  ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tic  = '<SFORC>', 1.         , 'istl1'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ial  = '<SFORC>', 1.         , 'ialb'    ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-cstc_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-cstc_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-cstc_cfg	(revision 14072)
@@ -0,0 +1,283 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration with ICE, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF-CSTC_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 2  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !!   
+   !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+   ln_Cx_ice_cst = .true.     ! use constant ice-air bulk transfer coefficients (value given below)
+      rn_Cd_i  = 1.4e-3       ! sea-ice drag coefficient
+      rn_Ce_i  = 1.4e-3       !    "    sublimation coefficient
+      rn_Ch_i  = 1.4e-3       !    "    sensible heat flux coefficient
+   ln_Cx_ice_AN05  = .false.  !  (Andreas et al. 2005)
+   ln_Cx_ice_LU12  = .false.  !  (Lupkes et al. 2012)
+   ln_Cx_ice_LG15  = .false.  !  (Lupkes & Gryanik 2015)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+   !! Following only needed with STATION_ASF compiled with "sea-ice" support: "key_si3" (ice fraction, ice surface temperature and sea-ice albedo:
+   sn_ifr  = '<SFORC>', 1.         , 'siconc'  ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tic  = '<SFORC>', 1.         , 'istl1'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ial  = '<SFORC>', 1.         , 'ialb'    ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lg15_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lg15_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lg15_cfg	(revision 14072)
@@ -0,0 +1,283 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration with ICE, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF-LG15_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 2  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !!   
+   !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+   ln_Cx_ice_cst = .false.    ! use constant ice-air bulk transfer coefficients (value given below)
+      rn_Cd_i  = 1.4e-3       ! sea-ice drag coefficient
+      rn_Ce_i  = 1.4e-3       !    "    sublimation coefficient
+      rn_Ch_i  = 1.4e-3       !    "    sensible heat flux coefficient
+   ln_Cx_ice_AN05  = .false.  !  (Andreas et al. 2005)
+   ln_Cx_ice_LU12  = .false.  !  (Lupkes et al. 2012)
+   ln_Cx_ice_LG15  = .true.   !  (Lupkes & Gryanik 2015)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+   !! Following only needed with STATION_ASF compiled with "sea-ice" support: "key_si3" (ice fraction, ice surface temperature and sea-ice albedo:
+   sn_ifr  = '<SFORC>', 1.         , 'siconc'  ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tic  = '<SFORC>', 1.         , 'istl1'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ial  = '<SFORC>', 1.         , 'ialb'    ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lu12_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lu12_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce+ice/namelist_ecmwf-lu12_cfg	(revision 14072)
@@ -0,0 +1,283 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration with ICE, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF-LU12_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 2  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !!   
+   !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+   ln_Cx_ice_cst = .false.    ! use constant ice-air bulk transfer coefficients (value given below)
+      rn_Cd_i  = 1.4e-3       ! sea-ice drag coefficient
+      rn_Ce_i  = 1.4e-3       !    "    sublimation coefficient
+      rn_Ch_i  = 1.4e-3       !    "    sensible heat flux coefficient
+   ln_Cx_ice_AN05  = .false.  !  (Andreas et al. 2005)
+   ln_Cx_ice_LU12  = .true.   !  (Lupkes et al. 2012)
+   ln_Cx_ice_LG15  = .false.  !  (Lupkes & Gryanik 2015)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+   !! Following only needed with STATION_ASF compiled with "sea-ice" support: "key_si3" (ice fraction, ice surface temperature and sea-ice albedo:
+   sn_ifr  = '<SFORC>', 1.         , 'siconc'  ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tic  = '<SFORC>', 1.         , 'istl1'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ial  = '<SFORC>', 1.         , 'ialb'    ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_andreas_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_andreas_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ANDREAS_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .true.     ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_coare3p6_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_coare3p6_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-COARE3p6_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .true.     ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .true.  !  use the cool-skin parameterization
+      ln_skin_wl   = .true.  !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ecmwf_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ecmwf_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ncar_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/ERA5/oce/namelist_ncar_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, <FORCING> forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [ERA5_NorthGreenland station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-NCAR_<FORCING>'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF
+!-----------------------------------------------------------------------
+   rn_lat1d    =   84. !  Column latitude    [ERA5_NorthGreenland station]
+   rn_lon1d    =  324. !  Column longitude   [ERA5_NorthGreenland station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = '<SFORC>',  1.  ,  'u10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = '<SFORC>',  1.  ,  'v10'    ,   .true.    , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = '<SFORC>',  1.  ,  'ssrd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = '<SFORC>',  1.  ,  'strd'   ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = '<SFORC>',  1.  ,  't2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = '<SFORC>',  1.  ,  'd2m'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = '<SFORC>',  1.  ,  'tp'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = '<SFORC>',  1.  ,  'sf'     ,   .false.   , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = '<SFORC>',  1.  ,  'msl'    ,   .true.    , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = '<SFORC>', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = '<SFORC>', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = '<SFORC>', 1.         , 'sst'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = '<SFORC>', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = '<SFORC>', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, PAPA forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ANDREAS_PAPA'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .true.     ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.5    !  Air temperature & humidity reference height (m) [PAPA station]
+      rn_zu        =  4.     !  Wind vector reference height (m)                [PAPA station]
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, PAPA forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-COARE3p6_PAPA'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .true.     ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.5    !  Air temperature & humidity reference height (m) [PAPA station]
+      rn_zu        =  4.     !  Wind vector reference height (m)                [PAPA station]
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .true.  !  use the cool-skin parameterization
+      ln_skin_wl   = .true.  !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, PAPA forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF_PAPA'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.5    !  Air temperature & humidity reference height (m) [PAPA station]
+      rn_zu        =  4.     !  Wind vector reference height (m)                [PAPA station]
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs = .true.    !  use the cool-skin parameterization
+      ln_skin_wl = .true.    !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg	(revision 14072)
@@ -0,0 +1,269 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!             STATION_ASF configuration, PAPA forcing
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-NCAR_PAPA'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.5    !  Air temperature & humidity reference height (m) [PAPA station]
+      rn_zu        =  4.     !  Wind vector reference height (m)                [PAPA station]
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/analyze_output.py
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/analyze_output.py	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/analyze_output.py	(revision 14072)
@@ -0,0 +1,271 @@
+#!/usr/bin/env python3
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+#######################################################################################
+# This script analyzes the output of STATION_ASF test-case with IDEALIZED forcing
+# in order to test the validity of computed fluxes and bulk transfer coefficient.
+# Beside an explicit standard output message, a result file is spawned:
+#    * SBCBLK.success => the test passed !
+#    * SBCBLK.fail    => the test failed !
+#
+#   Brodeau, 2020
+#
+########################################################################################
+
+import sys
+from os import path as path
+import math
+import numpy as nmp
+from netCDF4 import Dataset
+
+l_t_shift = False  ; # because time interp. is set to FALSE into "&namsbc_blk" of NEMO...
+#                    #  ==> so time array is shifted by 30 minutes but fluxes are the same (persitence of input fields ???)
+
+l_alg = [ 'ECMWF' , 'NCAR' , 'COARE3p0', 'COARE3p6', 'ANDREAS' ]
+nb_alg     =    len(l_alg)
+
+
+# Variables to check:
+l_var_rf = [  'Qsen'   ,   'Qlat'   ,  'Qlw'   ,   'Tau',   'Cd'  ,   'Ce'   ] ; # In forcing file "IDEALIZED/input_output_VALIDATION_IDEALIZED.nc"
+l_var_ot = [ 'qsb_oce' , 'qla_oce'  , 'qlw_oce',  'taum', 'Cd_oce', 'Ce_oce' ] ; # names in the NEMO/STATION_ASF output file (check file_def_oce.xml)
+nb_var  = len(l_var_rf)
+
+dir_figs='.'
+size_fig=(13,8)
+fig_ext='png'
+
+
+rDPI=100.
+
+
+class fclrs:
+    OKGR = '\033[92m'
+    FAIL = '\033[91m'
+    ENDC = '\033[0m'
+
+
+
+# Getting arguments:
+narg = len(sys.argv)
+if not narg in [3,4]:
+    print('Usage: '+sys.argv[0]+' <forcing_+_validation_file> <NEMO-STATION_ASF_output_directory> (<m> for more/debug)'); sys.exit(0)
+cf_rf = sys.argv[1]
+cdir_out = sys.argv[2]
+l_more = False
+if narg==4:
+    l_more = ( sys.argv[3] in ['m','M'] )
+    import matplotlib as mpl
+    mpl.use('Agg')
+    import matplotlib.pyplot as plt
+
+
+
+    
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+# Populating and checking existence of files to be read
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+def chck4f(cf):
+    cmesg = 'ERROR: File '+cf+' does not exist !!!'
+    if not path.exists(cf): print(cmesg) ; sys.exit(0)
+
+print('\n')
+
+# Input forcing/valid file:
+chck4f(cf_rf)
+id_rf = Dataset(cf_rf)
+vt = id_rf.variables['time'][:]
+cunit_t = id_rf.variables['time'].units
+id_rf.close()
+Nt_rf = len(vt)
+vtime_rf = nmp.zeros(Nt_rf); vtime_rf[:]  = vt[:]
+del vt
+print(' *** in forcing/valid file, "time" is in "'+cunit_t+'", Nt = '+str(Nt_rf)+'\n')
+
+
+# STATION_ASF output files (1 file per algorithm):
+cf_nemo = []
+for ja in range(nb_alg):
+    cfi = cdir_out+'/STATION_ASF-'+l_alg[ja]+'_IDEALIZED_1h_20200101_20200105_gridT.nc'
+    chck4f(cfi)
+    cf_nemo.append(cfi)
+print('\n *** NEMO/STATION_ASF output files we are goin to check:')
+for ja in range(nb_alg): print(cf_nemo[ja])
+print('\n')
+#-----------------------------------------------------------------
+
+# Getting time array from the first file:
+id_nm = Dataset(cf_nemo[0])
+vt = id_nm.variables['time_counter'][:]
+cunit_t = id_nm.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"')
+id_nm.close()
+Nt = len(vt)
+vtime_nm = nmp.zeros(Nt); vtime_nm[:]  = vt[:]
+del vt
+
+if Nt != Nt_rf-1: print('ERROR: the two files do not agree in terms of record lengrth: '+Nt_rf-1+' vs '+Nt)
+
+print('\n *** Excellent! We are going to look at surface fluxes under '+str(Nt)+' different scenarios of air-sea stability/wind-speed conditions...\n')
+
+# 30 minute shift, just like NEMO
+vtime = nmp.zeros(Nt)
+if l_t_shift:
+    vtime[:] = 0.5*(vtime_rf[:-1] + vtime_rf[1:])
+else:
+     vtime[:] =     vtime_rf[:-1]
+# Debug:
+#for jt in range(3):
+#    print(' Ref.  , Nemo "', vtime_rf[jt], vtime_nm[jt], vtime[jt])
+#sys.exit(0)
+
+
+
+
+##
+IREPORT = nmp.zeros((nb_alg,nb_var), dtype=int)
+
+
+
+
+# Loop on the fields to control...
+###################################
+
+jv=0
+for cv in l_var_rf:
+    cv_rf_m = cv+'_mean'
+    cv_rf_t = cv+'_tol'
+    cv_nemo = l_var_ot[jv]
+    print('\n\n ==== Checking variable '+cv_nemo+' against '+cv_rf_m+' !')
+
+    F_rf_m = nmp.zeros( Nt )
+    F_rf_t = nmp.zeros( Nt )
+    F_nemo = nmp.zeros((Nt,nb_alg))
+
+    wnd_rf = nmp.zeros( Nt ) ; #DEBUG
+    tzt_rf = nmp.zeros( Nt ) ; #DEBUG
+    qzt_rf = nmp.zeros( Nt ) ; #DEBUG
+    sst_rf = nmp.zeros( Nt ) ; #DEBUG
+    
+    id_rf = Dataset(cf_rf)
+    trf_m   = id_rf.variables[cv_rf_m][:] ; # Nt+1
+    trf_t   = id_rf.variables[cv_rf_t][:] ; # Nt+1
+    trf_wnd = id_rf.variables['wndspd'][:,1,1] ; # DEBUG
+    trf_tzt = id_rf.variables['t_air'][:,1,1] ; # DEBUG
+    trf_qzt = id_rf.variables['rh_air'][:,1,1] ; # DEBUG
+    trf_sst = id_rf.variables['sst'][:,1,1] ; # DEBUG
+    id_rf.close()
+    
+    if l_t_shift:
+        # 30 minute shift, just like NEMO
+        F_rf_m[:] = 0.5 * (trf_m[:-1] + trf_m[1:])
+        F_rf_t[:] = 0.5 * (trf_t[:-1] + trf_t[1:])
+    else:
+        F_rf_m[:] =        trf_m[:-1]
+        F_rf_t[:] =        trf_t[:-1]
+
+        wnd_rf[:] =        trf_wnd[:-1]        
+        tzt_rf[:] =        trf_tzt[:-1]
+        qzt_rf[:] =        trf_qzt[:-1]
+        sst_rf[:] =        trf_sst[:-1]        
+    
+    
+    for ja in range(nb_alg):
+        
+        calgo = l_alg[ja]
+
+        print(' *** '+calgo+' => '+cf_nemo[ja])
+
+        id_nemo = Dataset(cf_nemo[ja])
+        F_nemo[:,ja] = id_nemo.variables[cv_nemo][:,1,1] ; # it's 3x3 spatial domain, taking middle point !
+        id_nemo.close()
+
+
+        if l_more:
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            # How does all this look on on a figure?
+            cfig = l_var_rf[jv]+'_'+calgo+'.'+fig_ext
+            print(' *** will plot '+cfig)
+            fig = plt.figure(num=1, figsize=size_fig, facecolor='w', edgecolor='k')
+            ax1 = plt.axes([0.08, 0.25, 0.9, 0.7])
+            #
+            plt.plot(vtime, F_nemo[:,ja], label='NEMO['+calgo+']', zorder=1)
+            plt.plot(vtime, F_rf_m[:], color='k', label='MEAN REF!', zorder=10)
+            # +- rtol enveloppe:
+            plt.fill_between(vtime, F_rf_m[:]-F_rf_t[:], F_rf_m[:]+F_rf_t[:], alpha=0.2)
+            #
+            ax1.grid(color='k', linestyle='-', linewidth=0.3)
+            plt.legend(loc='best', ncol=1, shadow=True, fancybox=True)
+            plt.savefig(cfig, dpi=int(rDPI), transparent=False)
+            plt.close(1)
+            print('')
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+        # Does the field look okay with respect to reference +- tolerance ?
+
+        l_overshoot_a = nmp.any( F_nemo[:,ja] > F_rf_m[:]+F_rf_t[:] )
+        l_overshoot_b = nmp.any( F_nemo[:,ja] < F_rf_m[:]-F_rf_t[:] )
+
+        if l_overshoot_a: print(fclrs.FAIL+'\n ***** BAD overshoot + for '+calgo+' for variable '+cv+' !!!\n'+fclrs.ENDC )
+            
+        if l_overshoot_b: print(fclrs.FAIL+'\n ***** BAD overshoot - for '+calgo+' for variable '+cv+' !!!'+fclrs.ENDC )
+
+        if l_overshoot_a or l_overshoot_b:
+            print(fclrs.FAIL+'\n ***** TEST NOT PASSED FOR '+calgo+' for variable '+cv+' !!!\n'+fclrs.ENDC )
+        else:
+            # We're all good !
+            IREPORT[ja,jv] = 1
+            if l_more: print(fclrs.OKGR+'\n ***** TEST PASSED FOR '+calgo+' for variable '+cv+' :D !!!\n'+fclrs.ENDC )
+                    
+    jv=jv+1
+
+
+
+l_ok =  nmp.sum(IREPORT[:,:]) == nb_var*nb_alg
+
+
+
+if l_ok:
+    ctxt      = 'PASSED'
+    ccol      = fclrs.OKGR
+    cf_report = 'SBCBLK.success'
+else:
+    ctxt      = 'FAILED'
+    ccol      = fclrs.FAIL
+    cf_report = 'SBCBLK.fail'
+    
+
+print(ccol+'\n\n ############ FINAL REPORT ############\n'+fclrs.ENDC)
+
+f = open(cf_report, 'w')
+
+f.write("### Sanity-check report for SBCBLK generated via 'STATION_ASF/EXP00/sbcblk_sanity_check.sh'\n\n")
+
+for ja in range(nb_alg):
+    calgo = l_alg[ja]
+    
+    if nmp.sum(IREPORT[ja,:]) == nb_var:
+        # Success for this algo
+        cbla = ' ***** Algorithm "'+calgo+'" PASSED sanity check !!!\n\n'
+        print(fclrs.OKGR+cbla+fclrs.ENDC ) ; f.write(cbla)
+    else:
+        # Algo FAILS!
+        cbla = ' ***** Algorithm "'+calgo+'" FAILED sanity check !!!\n'
+        print(fclrs.FAIL+cbla+fclrs.ENDC ) ; f.write(cbla)
+        (idx_fail,) = nmp.where(IREPORT[ja,:]==0)
+        for jv in idx_fail:
+            cbla = '   ==> on variable '+l_var_rf[jv]+' !\n\n'
+            print(fclrs.FAIL+cbla+fclrs.ENDC ) ; f.write(cbla)
+
+# Conclusion:
+clist=''
+for cc in l_var_ot: clist=clist+cc+', '
+cbla = ' Test performed on the following NEMO prognostic variables:\n   ==> '+clist[:-2]+'\n'
+print(ccol+cbla+fclrs.ENDC ) ; f.write(cbla+'\n')
+
+cbla = '    ####################################\n'  +\
+       '    ###   TEST '+ctxt+' FOR SBCBLK !   ###\n'+\
+       '    ####################################\n\n'
+
+print(ccol+cbla+fclrs.ENDC ) ; f.write(cbla)
+
+f.close()
Index: MO/trunk/tests/STATION_ASF/EXPREF/context_nemo.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo.xml	(revision 14071)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<!--
-    ==============================================================================================
-    NEMO context
-    ==============================================================================================
--->
-<context id="nemo">
-  <variable_definition>
-    <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 -->
-    <variable id="ref_year"  type="int"> 1970 </variable>
-    <variable id="ref_month" type="int"> 01 </variable>
-    <variable id="ref_day"   type="int"> 01 </variable>
-  </variable_definition>
-  <!-- -->
-  <!-- Fields definition -->
-  <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
-
-  <!-- Files definition -->
-  <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     -->
-  <!--
-      ============================================================================================================
-      = grid definition = = DO NOT CHANGE =
-      ============================================================================================================
-  -->
-
-  <axis_definition>
-    <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
-    <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
-    <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
-    <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
-    <axis id="nfloat" long_name="Float number"      unit="-"                 />
-    <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
-    <axis id="ncatice" long_name="Ice category"       unit="1"               />
-    <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
-    <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
-  </axis_definition>
-
-  <domain_definition src="./domain_def_nemo.xml"/>
-
-  <grid_definition src="./grid_def_nemo.xml"/>
-
-</context>
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE+ICE.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE+ICE.xml	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE+ICE.xml	(revision 14072)
@@ -0,0 +1,50 @@
+<!--
+    ==============================================================================================
+    NEMO context
+    ==============================================================================================
+-->
+
+
+
+<context id="nemo">
+  <variable_definition>
+    <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 -->
+    <variable id="ref_year"  type="int"> 1970 </variable>
+    <variable id="ref_month" type="int"> 01 </variable>
+    <variable id="ref_day"   type="int"> 01 </variable>
+  </variable_definition>
+
+  <!-- -->
+
+  <!-- Fields definition -->
+  <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+  <field_definition src="./field_def_nemo-ice.xml"/>    <!--  NEMO sea-ice model      -->
+
+  <!-- Files definition -->
+  <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     -->
+  <file_definition src="./file_def_nemo-ice.xml"/>     <!--  NEMO sea-ice model       -->
+
+  
+  <!--
+      ============================================================================================================
+      = grid definition = = DO NOT CHANGE =
+      ============================================================================================================
+  -->
+
+  <axis_definition>
+    <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+    <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+    <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+    <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+    <axis id="nfloat" long_name="Float number"      unit="-"                 />
+    <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+    <axis id="ncatice" long_name="Ice category"       unit="1"               />
+    <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+    <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+  </axis_definition>
+
+  <domain_definition src="./domain_def_nemo.xml"/>
+
+  <grid_definition src="./grid_def_nemo.xml"/>
+
+</context>
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE.xml	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/context_nemo_OCE.xml	(revision 14072)
@@ -0,0 +1,48 @@
+<!--
+    ==============================================================================================
+    NEMO context
+    ==============================================================================================
+-->
+
+
+
+<context id="nemo">
+  <variable_definition>
+    <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 -->
+    <variable id="ref_year"  type="int"> 1970 </variable>
+    <variable id="ref_month" type="int"> 01 </variable>
+    <variable id="ref_day"   type="int"> 01 </variable>
+  </variable_definition>
+
+  <!-- -->
+
+  <!-- Fields definition -->
+  <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+
+  <!-- Files definition -->
+  <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     -->
+
+  
+  <!--
+      ============================================================================================================
+      = grid definition = = DO NOT CHANGE =
+      ============================================================================================================
+  -->
+
+  <axis_definition>
+    <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+    <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+    <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+    <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+    <axis id="nfloat" long_name="Float number"      unit="-"                 />
+    <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+    <axis id="ncatice" long_name="Ice category"       unit="1"               />
+    <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+    <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+  </axis_definition>
+
+  <domain_definition src="./domain_def_nemo.xml"/>
+
+  <grid_definition src="./grid_def_nemo.xml"/>
+
+</context>
Index: MO/trunk/tests/STATION_ASF/EXPREF/domain_def_nemo.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/domain_def_nemo.xml	(revision 14071)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/domain_def_nemo.xml
Index: MO/trunk/tests/STATION_ASF/EXPREF/field_def_nemo-oce.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/field_def_nemo-oce.xml	(revision 14071)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/field_def_nemo-oce.xml
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-ice.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-ice.xml	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-ice.xml	(revision 14072)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+
+<file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+
+
+  <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."> <!-- 1h files -->
+
+    <file id="file21" name_suffix="_icemod" description="ice variables" enabled=".true." compression_level="3" >
+
+      <!-- heat -->
+      <field field_ref="icettop"          name="sittop" />  <!-- surface ice temperature -->
+
+
+      <!-- momentum -->
+      <!--
+          <field field_ref="uice"             name="sivelu"  />
+          <field field_ref="vice"             name="sivelv"  />
+          <field field_ref="icevel"           name="sivelo"  />
+          <field field_ref="utau_ai"          name="utau_ai" />
+          <field field_ref="vtau_ai"          name="vtau_ai" />
+      -->
+      <field field_ref="taum_ice"          name="taum_ice" />
+      <field field_ref="utau_ice"          name="utau_ice" />
+      <field field_ref="vtau_ice"          name="vtau_ice" />
+
+      <!-- heat fluxes -->
+
+      <!--
+          <field field_ref="qt_oce_ai"        name="qt_oce_ai"  />
+          <field field_ref="qtr_ice_top"      name="qtr_ice_top"/>
+          <field field_ref="qtr_ice_bot"      name="qtr_ice_bot"/>
+          <field field_ref="qemp_ice"         name="qemp_ice"   />
+          <field field_ref="albedo"           name="albedo"     />
+      -->
+      <field field_ref="iceconc"         name="iceconc" />
+      <field field_ref="qt_ice"          name="qt_ice"  />
+      <field field_ref="qns_ice"         name="qns_ice" />
+      <field field_ref="qla_ice"         name="qla_ice" />
+      <field field_ref="qsb_ice"         name="qsb_ice" />
+      <field field_ref="qsr_ice"         name="qsr_ice" />
+      <field field_ref="qlw_ice"         name="qlw_ice" />
+      <field field_ref="icealb_cat"      name="alb_ice" />
+      <field field_ref="Cd_ice"          name="Cd_ice"  />
+      <field field_ref="Ce_ice"          name="Ce_ice"  />
+      <field field_ref="Ch_ice"          name="Ch_ice"  />
+    </file>
+
+  </file_group>
+
+  <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+  <file_group id="2h"  output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+  <file_group id="3h"  output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->
+  <file_group id="4h"  output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+  <file_group id="6h"  output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->
+  <file_group id="1d"  output_freq="1d"  output_level="10" enabled=".TRUE."/> <!-- 1d files -->
+  <file_group id="3d"  output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->
+  <file_group id="5d"  output_freq="5d"  output_level="10" enabled=".TRUE."/> <!-- 5d files -->
+  <file_group id="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+  <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+  <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+  <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+</file_definition>
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml	(revision 14072)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
 
-  <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+<file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+
 
   <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."> <!-- 1h files -->
@@ -16,17 +16,19 @@
       <field field_ref="dt_skin"      name="dt_skin"  />
       <!--    -->
-      <field field_ref="qt_oce"       name="qt"   />
-      <field field_ref="qsr_oce"      name="qsr"  />
-      <field field_ref="qns_oce"      name="qns"  />
-      <field field_ref="qla_oce"      name="qla"  />
-      <field field_ref="qsb_oce"      name="qsb"  />
-      <field field_ref="qlw_oce"      name="qlw"  />
-      <field field_ref="qemp_oce"     name="qemp" />
+      <field field_ref="qt_oce"       name="qt_oce"   />
+      <field field_ref="qsr_oce"      name="qsr_oce"  />
+      <field field_ref="qns_oce"      name="qns_oce"  />
+      <field field_ref="qla_oce"      name="qla_oce"  />
+      <field field_ref="qsb_oce"      name="qsb_oce"  />
+      <field field_ref="qlw_oce"      name="qlw_oce"  />
+      <field field_ref="qemp_oce"     name="qemp_oce" />
       <!-- -->
-      <field field_ref="evap_oce"     name="evap" />
+      <field field_ref="evap_oce"     name="evap_oce" />
       <field field_ref="precip"       name="precip" />
-      <field field_ref="empmr"        name="empmr" />
+      <!-- <field field_ref="empmr"   name="empmr" /> -->
       <!-- -->
-      <field field_ref="taum"         name="taum"   />
+      <field field_ref="taum_oce"     name="taum"   />
+      <field field_ref="utau_oce"     name="utau"   />
+      <field field_ref="vtau_oce"     name="vtau"   />
       <field field_ref="wspd"         name="windsp" />
       <!-- -->
@@ -34,4 +36,5 @@
       <field field_ref="Ce_oce"       name="Ce_oce" />
       <field field_ref="Ch_oce"       name="Ch_oce" />
+      <!-- -->
       <field field_ref="theta_zt"     name="theta_zt" />
       <field field_ref="q_zt"         name="q_zt" />
@@ -42,22 +45,15 @@
     </file>
 
-    <file id="file2" name_suffix="_gridU" description="ocean U grid variables" compression_level="3" >
-      <field field_ref="utau"         name="tauuo"    />
-    </file>
-
-    <file id="file3" name_suffix="_gridV" description="ocean V grid variables" compression_level="3" >
-      <field field_ref="vtau"         name="tauvo"    />
-    </file>
-
   </file_group>
 
-  <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
-  <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->
-  <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
-  <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->
-  <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."/> <!-- 1d files -->
-  <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->
-  <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/> <!-- 5d files -->
-  <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+  <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+  <file_group id="2h"  output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+  <file_group id="3h"  output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->
+  <file_group id="4h"  output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+  <file_group id="6h"  output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->
+  <file_group id="1d"  output_freq="1d"  output_level="10" enabled=".TRUE."/> <!-- 1d files -->
+  <file_group id="3d"  output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->
+  <file_group id="5d"  output_freq="5d"  output_level="10" enabled=".TRUE."/> <!-- 5d files -->
+  <file_group id="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
   <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
   <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
Index: MO/trunk/tests/STATION_ASF/EXPREF/grid_def_nemo.xml
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/grid_def_nemo.xml	(revision 14071)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/grid_def_nemo.xml
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/launch_sasf.sh
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 14072)
@@ -5,29 +5,93 @@
 # Script to launch a set of STATION_ASF simulations
 #
+#  Ocean-only version....
+#
 # L. Brodeau, 2020
 #
 ################################################################
 
-# What directory inside "tests" actually contains the compiled "nemo.exe" for STATION_ASF ?
-TC_DIR="STATION_ASF2"
-
-expdir=`basename ${PWD}`; # we expect "EXPREF" or "EXP00" normally...
-
-# NEMOGCM root directory:
-NEMO_ROOT_DIR=`pwd | sed -e "s|/tests/STATION_ASF/${expdir}||g"`
+CONFIG="STATION_ASF" ; # general name of the configuration
+CONFIG_BLD="STATION_ASF2" ; # name of config as build in NEMO... (directory inside "tests" actually contains the compiled test-case?)
+
+# Atmo + SSX forcing to use and sea-ice support?
+#     => FORCING: name of forcing
+#     => i_sea_ice: whether to compute fluxes over sea-ice as well
+#     => SFORC: string sufficient to copy relevant files as in "*${SFORC}*.nc"
+FORCING="PAPA"                 ; i_sea_ice=0 ; SFORC="Station_PAPA_50N-145W"
+#FORCING="ERA5_NorthGreenland" ; i_sea_ice=1 ; SFORC="ERA5_NorthGreenland_surface_84N_-36E_1h" ; # WITH ice/air flux computation
+#FORCING="ERA5_NorthGreenland" ; i_sea_ice=0 ; SFORC="ERA5_NorthGreenland_surface_84N_-36E_1h" ; # "ERA5_arctic" WITHOUT ice/air flux computation
+
+
+# Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists:
+NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick!
 
 # NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe:
-SASF_WRK_DIR="${NEMO_ROOT_DIR}/tests/${TC_DIR}"
+SASF_WRK_DIR="${NEMO_REF_DIR}/tests/${CONFIG_BLD}"
+
+# DATA_IN_DIR => Directory containing sea-surface + atmospheric forcings:
+DATA_IN_DIR="${NEMO_REF_DIR}/tests/${CONFIG}/input_data"
 
 # Directory where to run the simulation:
-PROD_DIR="${HOME}/tmp/STATION_ASF"
-
+PROD_DIR="${HOME}/tmp/${CONFIG}"
+
+# MPI launch command for your system
+# Even though we are running on 1 proc here, NEMO has likely been compiled with MPI,
+# if it's not the case then just leave "MPI_LAUNCH" void...
+MPI_LAUNCH="mpirun -n 1"
 
 ####### End of normal user configurable section #######
-
 #================================================================================
 
-SASF_REF_DIR="${NEMO_ROOT_DIR}/tests/STATION_ASF"
-if [ ! -d ${SASF_REF_DIR} ]; then echo " Mhhh, no EXPREF directory ${SASF_REF_DIR} !"; exit; fi
+iconv_1d=1
+if [ "`which ncks`" = "" ]; then
+    echo
+    echo "WARNING: you do not seem to have NCO installed here... You should!"
+    echo "      => anyway! will do without, but output netCDF files will remaine 3x3 in space :( "
+    echo
+    iconv_1d=0
+    sleep 3
+fi
+
+HERE=`pwd`
+
+echo
+
+# Is the nemo.exe of STATION_ASF compiled with sea-ice support (SI3) ?
+i_si3=0
+FCPP="${SASF_WRK_DIR}/cpp_${CONFIG_BLD}.fcm"
+if [ ! -f ${FCPP} ]; then echo " Mhhh, we could not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi
+ca=`cat ${FCPP} | grep 'key_si3'`
+
+if [ "${ca}" = "" ]; then
+    echo " *** NEMO was NOT compiled with sea-ice support (SI3) !" ; echo
+    if [ ${i_sea_ice} -eq 1 ]; then
+        echo " ===> so you cannot request ice-air flux computation !"
+        echo "     ===> please set i_sea_ice=0 or compile STATION_ASF with CPP key 'key_si3' !"
+        echo ; exit
+    fi
+else
+    echo " *** NEMO was apparently compiled with sea-ice support (SI3) !" ; echo
+    i_si3=1
+fi
+
+# Ok things are a bit different whether we compute fluxes over open ocean only or open ocean + sea-ice
+
+DIR_F=`echo ${FORCING} | cut -d'_' -f1` ; # "ERA5_blabla" => "ERA5" !
+
+if [ ${i_sea_ice} -eq 1 ]; then
+    # OPEN-OCEAN/AIR + SEA-ICE/AIR flux computation
+    #   - simpler if we only use one Open-ocean/air algo (ECMWF)
+    LIST_OA_ALGOS="ECMWF" ;          # list of air-sea algorithms to test
+    LIST_IA_ALGOS="AN05 LG15 LU12 CSTC" ; # list of air-ice algorithms to test
+    DIR_NL=${DIR_F}/oce+ice ; # where to fetch the namelists from...
+else
+    # Only OPEN-OCEAN/AIR flux computation
+    LIST_OA_ALGOS="NCAR ECMWF COARE3p6 ANDREAS"; # list of air-sea algorithms to test
+    LIST_IA_ALGOS=""
+    DIR_NL=${DIR_F}/oce ; # where to fetch the namelists from...
+fi
+if [ ! -d ${DIR_NL} ]; then echo " Mhhh, ${DIR_NL} not found !"; exit; fi
+
+
 
 # NEMO executable to use is:
@@ -35,10 +99,12 @@
 if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi
 
-DATA_IN_DIR="${SASF_REF_DIR}/input_data" ; # Directory containing sea-surface + atmospheric input data
-if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => did not find directory 'input_data' with input forcing..."; exit; fi
-
-SASF_EXPREF=${SASF_REF_DIR}/${expdir}  ; # STATION_ASF EXPREF directory from which to use namelists and XIOS xml files...
-if [ ! -d ${SASF_EXPREF} ]; then echo " Mhhh, no ${expdir} directory ${SASF_EXPREF} !"; exit; fi
-
+SASF_EXPREF=`pwd`  ; # STATION_ASF EXPREF directory from which to use namelists and XIOS xml files...
+
+CFGS_SHARED="${NEMO_REF_DIR}/cfgs/SHARED"
+if [ ! -d ${CFGS_SHARED} ]; then echo "PROBLEM!!! => could not find directory ${CFGS_SHARED} !"; exit; fi
+
+if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => could not find directory 'input_data' with input forcing..."; exit; fi
+
+cdt_cmpl="`\ls -l ${NEMO_EXE} | cut -d' ' -f 6,7,8`"
 
 echo "###########################################################"
@@ -46,7 +112,8 @@
 echo "###########################################################"
 echo
-echo "  * NEMO reference root directory is: ${NEMO_ROOT_DIR}"
+echo "  * NEMO reference root directory is: ${NEMO_REF_DIR}"
 echo "  * STATION_ASF work directory is: ${SASF_WRK_DIR}"
 echo "       ==> NEMO EXE to use: ${NEMO_EXE}"
+echo "           ==> compiled: ${cdt_cmpl} !"
 echo
 echo "  * Input forcing data into: ${DATA_IN_DIR}"
@@ -55,44 +122,112 @@
 echo "       ==> ${SASF_EXPREF}"
 echo
+sleep 2
 
 mkdir -p ${PROD_DIR}
 
 rsync -avP ${NEMO_EXE}          ${PROD_DIR}/
-
-for ff in "context_nemo.xml" "domain_def_nemo.xml" "field_def_nemo-oce.xml" "file_def_nemo-oce.xml" "grid_def_nemo.xml" "iodef.xml" "namelist_ref"; do
+ln -sf      ${NEMO_EXE}          ${PROD_DIR}/nemo.exe.lnk
+
+
+# XIOS xml file
+################
+
+list_xml_ref="field_def_nemo-oce.xml domain_def_nemo.xml grid_def_nemo.xml"
+list_xml_cfg="iodef.xml file_def_nemo-oce.xml"
+fcntxt="context_nemo_OCE.xml"
+if [ ${i_sea_ice} -eq 1 ]; then
+    list_xml_ref+=" field_def_nemo-ice.xml"
+    list_xml_cfg+=" file_def_nemo-ice.xml"
+    fcntxt="context_nemo_OCE+ICE.xml"
+fi
+
+# The "context_nemo.xml" file:
+if [ ! -f ${SASF_EXPREF}/${fcntxt} ]; then echo " Mhhh, ${fcntxt} not found into ${SASF_EXPREF} !"; exit; fi
+rsync -avPL ${SASF_EXPREF}/${fcntxt} ${PROD_DIR}/context_nemo.xml
+
+# All remaining "*.xml" files:
+for ff in ${list_xml_cfg} ; do
     if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi
     rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/
 done
+for ff in ${list_xml_ref} ; do
+    if [ ! -f ${CFGS_SHARED}/${ff} ]; then echo " Mhhh, ${ff} not found into ${CFGS_SHARED} !"; exit; fi
+    rsync -avPL ${CFGS_SHARED}/${ff} ${PROD_DIR}/
+done
+
 
 # Copy forcing to work directory:
-rsync -avP ${DATA_IN_DIR}/Station_PAPA_50N-145W*.nc ${PROD_DIR}/
-
-for CASE in "ECMWF" "COARE3p6" "NCAR" "ECMWF-noskin" "COARE3p6-noskin"; do
-
-    echo ; echo
-    echo "============================="
-    echo " Going for ${CASE} experiment"
-    echo "============================="
-    echo
-
-    scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'`
-
-    rm -f ${PROD_DIR}/namelist_cfg
-    rsync -avPL ${SASF_EXPREF}/namelist_${scase}_cfg ${PROD_DIR}/namelist_cfg
-
-    cd ${PROD_DIR}/
-    echo
-    echo "Launching NEMO !"
-    ./nemo.exe 1>out_nemo.out 2>err_nemo.err
-    echo "Done!"
-    echo
-
-    # Moving output files:
-    mkdir -p output
-    mv -f STATION_ASF-${CASE}_*_grid*.nc output/
+echo ; echo "Forcing files to use:"
+\ls -l ${DATA_IN_DIR}/*${SFORC}*.nc
+echo
+rsync -avPL ${DATA_IN_DIR}/*${SFORC}*.nc ${PROD_DIR}/
+echo; echo
+
+
+if [ "${LIST_IA_ALGOS}" = "" ]; then LIST_IA_ALGOS="none"; fi
+
+echo
+
+for OA_A in ${LIST_OA_ALGOS}; do
+    for IA_A in ${LIST_IA_ALGOS}; do
+
+        echo        
+        CASE="${OA_A}"
+        if [ ${i_sea_ice} -eq 1 ] && [ "${IA_A}" != "none" ]; then CASE="${OA_A}-${IA_A}"; fi
+
+        echo ; echo
+        echo "======================================================================="
+        echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing "
+        echo "======================================================================="
+        echo
+
+        scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'`
+
+        rm -f ${PROD_DIR}/namelist_cfg
+        fnml="${SASF_EXPREF}/${DIR_NL}/namelist_${scase}_cfg"
+        if [ ! -f ${fnml} ]; then echo " Mhhh, test namelist ${fnml} not found !"; exit; fi
+
+        echo "   ===> namelist to use is: ${DIR_NL}/namelist_${scase}_cfg !"; echo
+        
+        # The namelists:
+        #rsync -avPL ${fnml} ${PROD_DIR}/namelist_cfg
+        sed -e "s|<FORCING>|${FORCING}|g" -e "s|<SFORC>|${SFORC}|g" ${fnml} > ${PROD_DIR}/namelist_cfg
+
+        rsync -avPL ${CFGS_SHARED}/namelist_ref                    ${PROD_DIR}/namelist_ref
+        if [ ${i_sea_ice} -eq 1 ]; then
+            rsync -avPL ${SASF_EXPREF}/namelist_ice_cfg ${PROD_DIR}/namelist_ice_cfg
+            rsync -avPL ${CFGS_SHARED}/namelist_ice_ref ${PROD_DIR}/namelist_ice_ref
+        fi
     
-    # Saving logs:
-    mkdir -p ${CASE}_log
-    mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_log/
+        cd ${PROD_DIR}/
+        echo
+        echo "Launching NEMO ! (==> ${MPI_LAUNCH} ./nemo.exe)"
+        ${MPI_LAUNCH} ./nemo.exe 1>out_nemo.out 2>err_nemo.err
+        echo "Done!"
+        echo
+
+        # Moving output files:
+        mkdir -p output
+        mv -f ${CONFIG}-${CASE}_${FORCING}_*_grid*.nc output/
+        if [ ${i_sea_ice} -eq 1 ]; then mv -f ${CONFIG}-${CASE}_${FORCING}_*_icemod.nc output/; fi
+
+        # Saving logs:
+        mkdir -p ${CASE}_${FORCING}_log
+        mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${FORCING}_log/
+
+        if [ ${iconv_1d} -eq 1 ]; then
+        # Making 3x3 to 1 !
+        cd output/
+        list=`\ls ${CONFIG}*${CASE}_${FORCING}_*.nc | grep -v '_restart_'| grep -v '_1p.nc'`
+        for ff in ${list}; do
+            echo
+            fn=`echo ${ff} | sed -e "s|.nc|_1p.nc|g"`
+            CMD="ncks -O -d x,1 -d y,1 ${ff} -o ${fn}"
+            echo " *** ${CMD}"; ${CMD}
+            echo
+        done
+        fi
+
+    done
 
 done
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_cfg	(revision 14071)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link namelist_ecmwf_cfg
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg	(revision 14071)
+++ 	(revision )
@@ -1,289 +1,0 @@
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!             STATION_ASF configuration   
-!!======================================================================
-!!              ***  Domain & Run management namelists  ***           !!
-!!                                                                    !!
-!!   namrun       parameters of the run
-!!   namdom       space and time domain
-!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
-!!   namwad       Wetting and drying                                    (default: OFF)
-!!   namtsd       data: temperature & salinity                          (default: OFF)
-!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
-!!   namc1d       1D configuration options                              ("key_c1d")
-!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
-!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namusr_def    !   STATION_ASF user defined namelist
-!-----------------------------------------------------------------------
-   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
-   !                    ! [PAPA station = 1 m]
-/
-!-----------------------------------------------------------------------
-&namrun        !   parameters of the run
-!-----------------------------------------------------------------------
-   nn_no       =       0   !  Assimilation cycle index
-   cn_exp      =  'STATION_ASF-COARE3p6-noskin'  !  experience name
-   nn_it000    =    1   !  first time step
-!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
-   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
-      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
-      nn_rstctl   = 2      !  restart control ==> activated only if ln_rstart=T
-      !                          !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
-      !                          !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
-      !                          !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-      cn_ocerst_in    = ''   !  suffix of ocean restart name (input)
-      cn_ocerst_indir = ''         !  directory from which to read input ocean restarts
-      cn_ocerst_out   = 'restart_oce'   !  suffix of ocean restart name (output)
-      cn_ocerst_outdir = './'         !  directory in which to write output ocean restarts
-   nn_istate   =       0   !  output the initial state (1) or not (0)
-   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   !!
-!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   !!
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
-   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
-   ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
-   ln_xios_read = .false.  !  use XIOS to read restart file (only for a single file restart)
-   nn_wxios = 0      !  use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
-/
-!-----------------------------------------------------------------------
-&namdom        !   time and space domain / STATION_ASF
-!-----------------------------------------------------------------------
-   rn_Dt      =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
-   ln_meshmask = .false.
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
-/
-!-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
-!-----------------------------------------------------------------------
-   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
-   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
-/
-!-----------------------------------------------------------------------
-&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
-
-   cn_dir      = './'      !  root directory for the U-V data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
-   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
-/
-
-!!======================================================================
-!!            ***  Surface Boundary Condition namelists  ***          !!
-!!                                                                    !!
-!!                           STATION_ASF case                         !!
-!!                                                                    !!
-!!   namsbc          surface boundary condition manager                 (default: NO selection)
-!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
-!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
-!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
-!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
-!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
-!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
-!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
-!!   namberg         iceberg floats                                     (ln_icebergs=T)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
-!-----------------------------------------------------------------------
-   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
-   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-/
-!-----------------------------------------------------------------------
-&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
-!-----------------------------------------------------------------------
-   !                    !  bulk algorithm :
-   ln_NCAR      = .false.   ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .true.    ! "COARE 3.5" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .false.   ! "ECMWF"     algorithm   (IFS cycle 45r1)
-      rn_zqt    =  2.5      !  Air temperature & humidity reference height (m) [PAPA station]
-      rn_zu     =  4.       !  Wind vector reference height (m)                [PAPA station]
-      !
-      ! Skin is ONLY available in ECMWF and COARE algorithms:
-      ln_skin_cs = .false.  !  use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!
-      ln_skin_wl = .false.  !  use the warm-layer        "        => set nn_fsbc=1 and ln_dm2dc=.true.!
-      !
-      ln_humi_sph = .false. !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true.
-      ln_humi_dpt = .false. !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true.
-      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
-   !
-   cn_dir = './'  !  root directory for the bulk data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
-!-----------------------------------------------------------------------
-   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
-      ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
-      ln_read_frq = .false.   !  specify whether we must read frq or not
-
-   cn_dir      = './'     !  root directory for the ocean data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_e3t  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'e3t_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_frq  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'frq_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-/
-!!======================================================================
-!!               ***  Lateral boundary condition  ***                 !!
-!!                                                                    !!
-!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
-!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
-!!   nam_tide      Tidal forcing                                        (default: OFF)
-!!   nambdy        Unstructured open boundaries                         (default: OFF)
-!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
-!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
-!-----------------------------------------------------------------------
-   rn_shlat    =    0.     !  free slip
-/
-!!======================================================================
-!!                ***  Top/Bottom boundary condition  ***             !!
-!!                                                                    !!
-!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
-!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
-!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
-!!   nambbc        bottom temperature boundary condition                (default: OFF)
-!!   nambbl        bottom boundary layer scheme                         (default: OFF)
-!!======================================================================
-!
-!!======================================================================
-!!                        Tracer (T-S) namelists                      !!
-!!                                                                    !!
-!!   nameos        equation of state                                    (default: NO selection)
-!!   namtra_adv    advection scheme                                     (default: NO selection)
-!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
-!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
-!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
-!-----------------------------------------------------------------------
-   ln_eos80    = .true.          !  = Use EOS80
-/
-!!======================================================================
-!!                      ***  Dynamics namelists  ***                  !!
-!!                                                                    !!
-!!   nam_vvl       vertical coordinate options                          (default: z-star)
-!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
-!!   namdyn_vor    advection scheme                                     (default: NO selection)
-!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
-!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
-!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
-!!======================================================================
-!
-!!======================================================================
-!!                     vertical physics namelists                     !!
-!!                                                                    !!
-!!    namzdf        vertical physics manager                            (default: NO selection)
-!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
-!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
-!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
-!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
-!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Diagnostics namelists  ***                   !!
-!!                                                                    !!
-!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
-!!   namhsb       Heat and salt budgets                                 (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
-!!   nam_diadct   transports through some sections                      (default: OFF)
-!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
-!!   nam_dia25h   25h Mean Output                                       (default: OFF)
-!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
-!!======================================================================
-!
-!!======================================================================
-!!               ***  Observation & Assimilation  ***                 !!
-!!                                                                    !!
-!!   namobs       observation and model comparison                      (default: OFF)
-!!   nam_asminc   assimilation increments                               ('key_asminc')
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Miscellaneous namelists  ***                 !!
-!!                                                                    !!
-!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
-!!   namctl            Control prints                                   (default: OFF)
-!!   namsto            Stochastic parametrization of EOS                (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namctl        !   Control prints                                       (default: OFF)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
-!-----------------------------------------------------------------------
-/
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg	(revision 14071)
+++ 	(revision )
@@ -1,289 +1,0 @@
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!             STATION_ASF configuration   
-!!======================================================================
-!!              ***  Domain & Run management namelists  ***           !!
-!!                                                                    !!
-!!   namrun       parameters of the run
-!!   namdom       space and time domain
-!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
-!!   namwad       Wetting and drying                                    (default: OFF)
-!!   namtsd       data: temperature & salinity                          (default: OFF)
-!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
-!!   namc1d       1D configuration options                              ("key_c1d")
-!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
-!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namusr_def    !   STATION_ASF user defined namelist
-!-----------------------------------------------------------------------
-   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
-   !                    ! [PAPA station = 1 m]
-/
-!-----------------------------------------------------------------------
-&namrun        !   parameters of the run
-!-----------------------------------------------------------------------
-   nn_no       =       0   !  Assimilation cycle index
-   cn_exp      =  'STATION_ASF-COARE3p6'  !  experience name
-   nn_it000    =    1   !  first time step
-!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
-   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
-      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
-      nn_rstctl   = 2      !  restart control ==> activated only if ln_rstart=T
-      !                          !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
-      !                          !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
-      !                          !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-      cn_ocerst_in    = ''   !  suffix of ocean restart name (input)
-      cn_ocerst_indir = ''         !  directory from which to read input ocean restarts
-      cn_ocerst_out   = 'restart_oce'   !  suffix of ocean restart name (output)
-      cn_ocerst_outdir = './'         !  directory in which to write output ocean restarts
-   nn_istate   =       0   !  output the initial state (1) or not (0)
-   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   !!
-!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   !!
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
-   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
-   ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
-   ln_xios_read = .false.  !  use XIOS to read restart file (only for a single file restart)
-   nn_wxios = 0      !  use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
-/
-!-----------------------------------------------------------------------
-&namdom        !   time and space domain / STATION_ASF
-!-----------------------------------------------------------------------
-   rn_Dt      =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
-   ln_meshmask = .false.
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
-/
-!-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
-!-----------------------------------------------------------------------
-   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
-   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
-/
-!-----------------------------------------------------------------------
-&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
-
-   cn_dir      = './'      !  root directory for the U-V data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
-   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
-/
-
-!!======================================================================
-!!            ***  Surface Boundary Condition namelists  ***          !!
-!!                                                                    !!
-!!                           STATION_ASF case                         !!
-!!                                                                    !!
-!!   namsbc          surface boundary condition manager                 (default: NO selection)
-!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
-!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
-!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
-!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
-!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
-!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
-!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
-!!   namberg         iceberg floats                                     (ln_icebergs=T)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
-!-----------------------------------------------------------------------
-   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
-   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-/
-!-----------------------------------------------------------------------
-&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
-!-----------------------------------------------------------------------
-   !                    !  bulk algorithm :
-   ln_NCAR      = .false.   ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .true.    ! "COARE 3.5" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .false.   ! "ECMWF"     algorithm   (IFS cycle 45r1)
-      rn_zqt    =  2.5      !  Air temperature & humidity reference height (m) [PAPA station]
-      rn_zu     =  4.       !  Wind vector reference height (m)                [PAPA station]
-      !
-      ! Skin is ONLY available in ECMWF and COARE algorithms:
-      ln_skin_cs = .true.   !  use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!
-      ln_skin_wl = .true.   !  use the warm-layer        "        => set nn_fsbc=1 and ln_dm2dc=.true.!
-      !
-      ln_humi_sph = .false. !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true.
-      ln_humi_dpt = .false. !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true.
-      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
-   !
-   cn_dir = './'  !  root directory for the bulk data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
-!-----------------------------------------------------------------------
-   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
-      ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
-      ln_read_frq = .false.   !  specify whether we must read frq or not
-
-   cn_dir      = './'     !  root directory for the ocean data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_e3t  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'e3t_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_frq  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'frq_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-/
-!!======================================================================
-!!               ***  Lateral boundary condition  ***                 !!
-!!                                                                    !!
-!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
-!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
-!!   nam_tide      Tidal forcing                                        (default: OFF)
-!!   nambdy        Unstructured open boundaries                         (default: OFF)
-!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
-!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
-!-----------------------------------------------------------------------
-   rn_shlat    =    0.     !  free slip
-/
-!!======================================================================
-!!                ***  Top/Bottom boundary condition  ***             !!
-!!                                                                    !!
-!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
-!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
-!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
-!!   nambbc        bottom temperature boundary condition                (default: OFF)
-!!   nambbl        bottom boundary layer scheme                         (default: OFF)
-!!======================================================================
-!
-!!======================================================================
-!!                        Tracer (T-S) namelists                      !!
-!!                                                                    !!
-!!   nameos        equation of state                                    (default: NO selection)
-!!   namtra_adv    advection scheme                                     (default: NO selection)
-!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
-!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
-!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
-!-----------------------------------------------------------------------
-   ln_eos80    = .true.          !  = Use EOS80
-/
-!!======================================================================
-!!                      ***  Dynamics namelists  ***                  !!
-!!                                                                    !!
-!!   nam_vvl       vertical coordinate options                          (default: z-star)
-!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
-!!   namdyn_vor    advection scheme                                     (default: NO selection)
-!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
-!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
-!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
-!!======================================================================
-!
-!!======================================================================
-!!                     vertical physics namelists                     !!
-!!                                                                    !!
-!!    namzdf        vertical physics manager                            (default: NO selection)
-!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
-!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
-!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
-!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
-!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Diagnostics namelists  ***                   !!
-!!                                                                    !!
-!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
-!!   namhsb       Heat and salt budgets                                 (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
-!!   nam_diadct   transports through some sections                      (default: OFF)
-!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
-!!   nam_dia25h   25h Mean Output                                       (default: OFF)
-!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
-!!======================================================================
-!
-!!======================================================================
-!!               ***  Observation & Assimilation  ***                 !!
-!!                                                                    !!
-!!   namobs       observation and model comparison                      (default: OFF)
-!!   nam_asminc   assimilation increments                               ('key_asminc')
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Miscellaneous namelists  ***                 !!
-!!                                                                    !!
-!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
-!!   namctl            Control prints                                   (default: OFF)
-!!   namsto            Stochastic parametrization of EOS                (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namctl        !   Control prints                                       (default: OFF)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
-!-----------------------------------------------------------------------
-/
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg	(revision 14071)
+++ 	(revision )
@@ -1,289 +1,0 @@
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!             STATION_ASF configuration   
-!!======================================================================
-!!              ***  Domain & Run management namelists  ***           !!
-!!                                                                    !!
-!!   namrun       parameters of the run
-!!   namdom       space and time domain
-!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
-!!   namwad       Wetting and drying                                    (default: OFF)
-!!   namtsd       data: temperature & salinity                          (default: OFF)
-!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
-!!   namc1d       1D configuration options                              ("key_c1d")
-!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
-!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namusr_def    !   STATION_ASF user defined namelist
-!-----------------------------------------------------------------------
-   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
-   !                    ! [PAPA station = 1 m]
-/
-!-----------------------------------------------------------------------
-&namrun        !   parameters of the run
-!-----------------------------------------------------------------------
-   nn_no       =       0   !  Assimilation cycle index
-   cn_exp      =  'STATION_ASF-ECMWF-noskin'  !  experience name
-   nn_it000    =    1   !  first time step
-!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
-   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
-      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
-      nn_rstctl   = 2      !  restart control ==> activated only if ln_rstart=T
-      !                          !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
-      !                          !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
-      !                          !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-      cn_ocerst_in    = ''   !  suffix of ocean restart name (input)
-      cn_ocerst_indir = ''         !  directory from which to read input ocean restarts
-      cn_ocerst_out   = 'restart_oce'   !  suffix of ocean restart name (output)
-      cn_ocerst_outdir = './'         !  directory in which to write output ocean restarts
-   nn_istate   =       0   !  output the initial state (1) or not (0)
-   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   !!
-!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   !!
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
-   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
-   ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
-   ln_xios_read = .false.  !  use XIOS to read restart file (only for a single file restart)
-   nn_wxios = 0      !  use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
-/
-!-----------------------------------------------------------------------
-&namdom        !   time and space domain / STATION_ASF
-!-----------------------------------------------------------------------
-   rn_Dt      =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
-   ln_meshmask = .false.
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
-/
-!-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
-!-----------------------------------------------------------------------
-   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
-   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
-/
-!-----------------------------------------------------------------------
-&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
-
-   cn_dir      = './'      !  root directory for the U-V data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
-   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
-/
-
-!!======================================================================
-!!            ***  Surface Boundary Condition namelists  ***          !!
-!!                                                                    !!
-!!                           STATION_ASF case                         !!
-!!                                                                    !!
-!!   namsbc          surface boundary condition manager                 (default: NO selection)
-!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
-!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
-!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
-!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
-!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
-!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
-!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
-!!   namberg         iceberg floats                                     (ln_icebergs=T)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
-!-----------------------------------------------------------------------
-   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
-   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-/
-!-----------------------------------------------------------------------
-&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
-!-----------------------------------------------------------------------
-   !                    !  bulk algorithm :
-   ln_NCAR      = .false.   ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .false.   ! "COARE 3.5" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .true.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
-      rn_zqt    =  2.5      !  Air temperature & humidity reference height (m) [PAPA station]
-      rn_zu     =  4.       !  Wind vector reference height (m)                [PAPA station]
-      !
-      ! Skin is ONLY available in ECMWF and COARE algorithms:
-      ln_skin_cs = .false.  !  use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!
-      ln_skin_wl = .false.  !  use the warm-layer        "        => set nn_fsbc=1 and ln_dm2dc=.true.!
-      !
-      ln_humi_sph = .false. !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true.
-      ln_humi_dpt = .false. !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true.
-      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
-   !
-   cn_dir = './'  !  root directory for the bulk data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
-!-----------------------------------------------------------------------
-   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
-      ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
-      ln_read_frq = .false.   !  specify whether we must read frq or not
-
-   cn_dir      = './'     !  root directory for the ocean data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_e3t  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'e3t_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_frq  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'frq_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-/
-!!======================================================================
-!!               ***  Lateral boundary condition  ***                 !!
-!!                                                                    !!
-!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
-!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
-!!   nam_tide      Tidal forcing                                        (default: OFF)
-!!   nambdy        Unstructured open boundaries                         (default: OFF)
-!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
-!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
-!-----------------------------------------------------------------------
-   rn_shlat    =    0.     !  free slip
-/
-!!======================================================================
-!!                ***  Top/Bottom boundary condition  ***             !!
-!!                                                                    !!
-!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
-!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
-!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
-!!   nambbc        bottom temperature boundary condition                (default: OFF)
-!!   nambbl        bottom boundary layer scheme                         (default: OFF)
-!!======================================================================
-!
-!!======================================================================
-!!                        Tracer (T-S) namelists                      !!
-!!                                                                    !!
-!!   nameos        equation of state                                    (default: NO selection)
-!!   namtra_adv    advection scheme                                     (default: NO selection)
-!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
-!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
-!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
-!-----------------------------------------------------------------------
-   ln_eos80    = .true.          !  = Use EOS80
-/
-!!======================================================================
-!!                      ***  Dynamics namelists  ***                  !!
-!!                                                                    !!
-!!   nam_vvl       vertical coordinate options                          (default: z-star)
-!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
-!!   namdyn_vor    advection scheme                                     (default: NO selection)
-!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
-!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
-!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
-!!======================================================================
-!
-!!======================================================================
-!!                     vertical physics namelists                     !!
-!!                                                                    !!
-!!    namzdf        vertical physics manager                            (default: NO selection)
-!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
-!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
-!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
-!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
-!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Diagnostics namelists  ***                   !!
-!!                                                                    !!
-!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
-!!   namhsb       Heat and salt budgets                                 (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
-!!   nam_diadct   transports through some sections                      (default: OFF)
-!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
-!!   nam_dia25h   25h Mean Output                                       (default: OFF)
-!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
-!!======================================================================
-!
-!!======================================================================
-!!               ***  Observation & Assimilation  ***                 !!
-!!                                                                    !!
-!!   namobs       observation and model comparison                      (default: OFF)
-!!   nam_asminc   assimilation increments                               ('key_asminc')
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Miscellaneous namelists  ***                 !!
-!!                                                                    !!
-!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
-!!   namctl            Control prints                                   (default: OFF)
-!!   namsto            Stochastic parametrization of EOS                (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namctl        !   Control prints                                       (default: OFF)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
-!-----------------------------------------------------------------------
-/
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg	(revision 14071)
+++ 	(revision )
@@ -1,289 +1,0 @@
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!             STATION_ASF configuration   
-!!======================================================================
-!!              ***  Domain & Run management namelists  ***           !!
-!!                                                                    !!
-!!   namrun       parameters of the run
-!!   namdom       space and time domain
-!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
-!!   namwad       Wetting and drying                                    (default: OFF)
-!!   namtsd       data: temperature & salinity                          (default: OFF)
-!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
-!!   namc1d       1D configuration options                              ("key_c1d")
-!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
-!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namusr_def    !   STATION_ASF user defined namelist
-!-----------------------------------------------------------------------
-   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
-   !                    ! [PAPA station = 1 m]
-/
-!-----------------------------------------------------------------------
-&namrun        !   parameters of the run
-!-----------------------------------------------------------------------
-   nn_no       =       0   !  Assimilation cycle index
-   cn_exp      =  'STATION_ASF-ECMWF'  !  experience name
-   nn_it000    =    1   !  first time step
-!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
-   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
-      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
-      nn_rstctl   = 2      !  restart control ==> activated only if ln_rstart=T
-      !                          !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
-      !                          !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
-      !                          !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-      cn_ocerst_in    = ''   !  suffix of ocean restart name (input)
-      cn_ocerst_indir = ''         !  directory from which to read input ocean restarts
-      cn_ocerst_out   = 'restart_oce'   !  suffix of ocean restart name (output)
-      cn_ocerst_outdir = './'         !  directory in which to write output ocean restarts
-   nn_istate   =       0   !  output the initial state (1) or not (0)
-   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   !!
-!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   !!
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
-   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
-   ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
-   ln_xios_read = .false.  !  use XIOS to read restart file (only for a single file restart)
-   nn_wxios = 0      !  use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
-/
-!-----------------------------------------------------------------------
-&namdom        !   time and space domain / STATION_ASF
-!-----------------------------------------------------------------------
-   rn_Dt      =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
-   ln_meshmask = .false.
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
-/
-!-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
-!-----------------------------------------------------------------------
-   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
-   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
-/
-!-----------------------------------------------------------------------
-&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
-
-   cn_dir      = './'      !  root directory for the U-V data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
-   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
-/
-
-!!======================================================================
-!!            ***  Surface Boundary Condition namelists  ***          !!
-!!                                                                    !!
-!!                           STATION_ASF case                         !!
-!!                                                                    !!
-!!   namsbc          surface boundary condition manager                 (default: NO selection)
-!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
-!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
-!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
-!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
-!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
-!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
-!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
-!!   namberg         iceberg floats                                     (ln_icebergs=T)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
-!-----------------------------------------------------------------------
-   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
-   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-/
-!-----------------------------------------------------------------------
-&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
-!-----------------------------------------------------------------------
-   !                    !  bulk algorithm :
-   ln_NCAR      = .false.   ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .false.   ! "COARE 3.5" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .true.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
-      rn_zqt    =  2.5      !  Air temperature & humidity reference height (m) [PAPA station]
-      rn_zu     =  4.       !  Wind vector reference height (m)                [PAPA station]
-      !
-      ! Skin is ONLY available in ECMWF and COARE algorithms:
-      ln_skin_cs = .true.   !  use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!
-      ln_skin_wl = .true.   !  use the warm-layer        "        => set nn_fsbc=1 and ln_dm2dc=.true.!
-      !
-      ln_humi_sph = .false. !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true.
-      ln_humi_dpt = .false. !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true.
-      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
-   !
-   cn_dir = './'  !  root directory for the bulk data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
-!-----------------------------------------------------------------------
-   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
-      ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
-      ln_read_frq = .false.   !  specify whether we must read frq or not
-
-   cn_dir      = './'     !  root directory for the ocean data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_e3t  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'e3t_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_frq  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'frq_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-/
-!!======================================================================
-!!               ***  Lateral boundary condition  ***                 !!
-!!                                                                    !!
-!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
-!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
-!!   nam_tide      Tidal forcing                                        (default: OFF)
-!!   nambdy        Unstructured open boundaries                         (default: OFF)
-!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
-!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
-!-----------------------------------------------------------------------
-   rn_shlat    =    0.     !  free slip
-/
-!!======================================================================
-!!                ***  Top/Bottom boundary condition  ***             !!
-!!                                                                    !!
-!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
-!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
-!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
-!!   nambbc        bottom temperature boundary condition                (default: OFF)
-!!   nambbl        bottom boundary layer scheme                         (default: OFF)
-!!======================================================================
-!
-!!======================================================================
-!!                        Tracer (T-S) namelists                      !!
-!!                                                                    !!
-!!   nameos        equation of state                                    (default: NO selection)
-!!   namtra_adv    advection scheme                                     (default: NO selection)
-!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
-!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
-!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
-!-----------------------------------------------------------------------
-   ln_eos80    = .true.          !  = Use EOS80
-/
-!!======================================================================
-!!                      ***  Dynamics namelists  ***                  !!
-!!                                                                    !!
-!!   nam_vvl       vertical coordinate options                          (default: z-star)
-!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
-!!   namdyn_vor    advection scheme                                     (default: NO selection)
-!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
-!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
-!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
-!!======================================================================
-!
-!!======================================================================
-!!                     vertical physics namelists                     !!
-!!                                                                    !!
-!!    namzdf        vertical physics manager                            (default: NO selection)
-!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
-!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
-!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
-!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
-!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Diagnostics namelists  ***                   !!
-!!                                                                    !!
-!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
-!!   namhsb       Heat and salt budgets                                 (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
-!!   nam_diadct   transports through some sections                      (default: OFF)
-!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
-!!   nam_dia25h   25h Mean Output                                       (default: OFF)
-!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
-!!======================================================================
-!
-!!======================================================================
-!!               ***  Observation & Assimilation  ***                 !!
-!!                                                                    !!
-!!   namobs       observation and model comparison                      (default: OFF)
-!!   nam_asminc   assimilation increments                               ('key_asminc')
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Miscellaneous namelists  ***                 !!
-!!                                                                    !!
-!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
-!!   namctl            Control prints                                   (default: OFF)
-!!   namsto            Stochastic parametrization of EOS                (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namctl        !   Control prints                                       (default: OFF)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
-!-----------------------------------------------------------------------
-/
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ice_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ice_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ice_cfg	(revision 14072)
@@ -0,0 +1,85 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! SI3 configuration namelist: Overwrites SHARED/namelist_ice_ref
+!!              1 - Generic parameters                 (nampar)
+!!              2 - Ice thickness discretization       (namitd)
+!!              3 - Ice dynamics                       (namdyn)
+!!              4 - Ice ridging/rafting                (namdyn_rdgrft)
+!!              5 - Ice rheology                       (namdyn_rhg)
+!!              6 - Ice advection                      (namdyn_adv)
+!!              7 - Ice surface boundary conditions    (namsbc)
+!!              8 - Ice thermodynamics                 (namthd)
+!!              9 - Ice heat diffusion                 (namthd_zdf)
+!!             10 - Ice lateral melting                (namthd_da)
+!!             11 - Ice growth in open water           (namthd_do)
+!!             12 - Ice salinity                       (namthd_sal)
+!!             13 - Ice melt ponds                     (namthd_pnd)
+!!             14 - Ice initialization                 (namini)
+!!             15 - Ice/snow albedos                   (namalb)
+!!             16 - Ice diagnostics                    (namdia)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!------------------------------------------------------------------------------
+&nampar         !   Generic parameters
+!------------------------------------------------------------------------------
+   jpl              =   1             !  number of ice  categories
+/
+!------------------------------------------------------------------------------
+&namitd         !   Ice discretization
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn         !   Ice dynamics
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_rdgrft  !   Ice ridging/rafting
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_rhg     !   Ice rheology
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_adv     !   Ice advection
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namsbc         !   Ice surface boundary conditions
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd         !   Ice thermodynamics
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_zdf     !   Ice heat diffusion
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_da      !   Ice lateral melting
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_do      !   Ice growth in open water
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_sal     !   Ice salinity
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_pnd     !   Melt ponds
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namini         !   Ice initialization
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namalb         !   albedo parameters
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdia         !   Diagnostics
+!------------------------------------------------------------------------------
+/
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_ncar_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ncar_cfg	(revision 14071)
+++ 	(revision )
@@ -1,289 +1,0 @@
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
-!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!             STATION_ASF configuration   
-!!======================================================================
-!!              ***  Domain & Run management namelists  ***           !!
-!!                                                                    !!
-!!   namrun       parameters of the run
-!!   namdom       space and time domain
-!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
-!!   namwad       Wetting and drying                                    (default: OFF)
-!!   namtsd       data: temperature & salinity                          (default: OFF)
-!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
-!!   namc1d       1D configuration options                              ("key_c1d")
-!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
-!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namusr_def    !   STATION_ASF user defined namelist
-!-----------------------------------------------------------------------
-   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
-   !                    ! [PAPA station = 1 m]
-/
-!-----------------------------------------------------------------------
-&namrun        !   parameters of the run
-!-----------------------------------------------------------------------
-   nn_no       =       0   !  Assimilation cycle index
-   cn_exp      =  'STATION_ASF-NCAR'  !  experience name
-   nn_it000    =    1   !  first time step
-!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
-   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
-   nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
-   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
-      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
-      nn_rstctl   = 2      !  restart control ==> activated only if ln_rstart=T
-      !                          !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
-      !                          !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
-      !                          !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-      cn_ocerst_in    = ''   !  suffix of ocean restart name (input)
-      cn_ocerst_indir = ''         !  directory from which to read input ocean restarts
-      cn_ocerst_out   = 'restart_oce'   !  suffix of ocean restart name (output)
-      cn_ocerst_outdir = './'         !  directory in which to write output ocean restarts
-   nn_istate   =       0   !  output the initial state (1) or not (0)
-   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   !!
-!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
-   !!
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
-   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
-   ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
-   ln_xios_read = .false.  !  use XIOS to read restart file (only for a single file restart)
-   nn_wxios = 0      !  use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
-/
-!-----------------------------------------------------------------------
-&namdom        !   time and space domain / STATION_ASF
-!-----------------------------------------------------------------------
-   rn_Dt      =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
-   ln_meshmask = .false.
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
-/
-!-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
-!-----------------------------------------------------------------------
-   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
-   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
-/
-!-----------------------------------------------------------------------
-&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
-!-----------------------------------------------------------------------
-   !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
-
-   cn_dir      = './'      !  root directory for the U-V data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
-   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
-/
-
-!!======================================================================
-!!            ***  Surface Boundary Condition namelists  ***          !!
-!!                                                                    !!
-!!                           STATION_ASF case                         !!
-!!                                                                    !!
-!!   namsbc          surface boundary condition manager                 (default: NO selection)
-!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
-!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
-!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
-!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
-!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
-!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
-!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
-!!   namberg         iceberg floats                                     (ln_icebergs=T)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
-!-----------------------------------------------------------------------
-   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
-   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-/
-!-----------------------------------------------------------------------
-&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
-!-----------------------------------------------------------------------
-   !                    !  bulk algorithm :
-   ln_NCAR      = .true.    ! "NCAR"      algorithm   (Large and Yeager 2008)
-   ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
-   ln_COARE_3p6 = .false.   ! "COARE 3.5" algorithm   (Edson et al. 2013)
-   ln_ECMWF     = .false.   ! "ECMWF"     algorithm   (IFS cycle 31)
-      rn_zqt    =  2.5      !  Air temperature & humidity reference height (m) [PAPA station]
-      rn_zu     =  4.       !  Wind vector reference height (m)                [PAPA station]
-      !
-      ! Skin is ONLY available in ECMWF and COARE algorithms:
-      ln_skin_cs = .false.  !  use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!
-      ln_skin_wl = .false.  !  use the warm-layer        "        => set nn_fsbc=1 and ln_dm2dc=.true.!
-      !
-      ln_humi_sph = .false. !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true.
-      ln_humi_dpt = .false. !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true.
-      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
-   !
-   cn_dir = './'  !  root directory for the bulk data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'u_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_wndj     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'v_air',    .true.     , .false. , 'yearly'  , ''   ,''   , ''
-   sn_qsr      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_sw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_qlw      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rad_lw',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_tair     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 't_air',    .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_humi     = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'rh_air',   .true.     , .false. , 'yearly'  , ''  , ''   , ''
-   sn_prec     = 'Station_PAPA_50N-145W_precip_daily', 24., 'precip',   .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_snow     = 'Station_PAPA_50N-145W_precip_daily', 24., 'snow',     .false.    , .false. , 'yearly'  , ''  , ''   , ''
-   sn_slp      = 'Station_PAPA_50N-145W_atm_hourly',  1.  , 'slp',      .true.     , .false. , 'yearly'  , ''  , ''   , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
-!-----------------------------------------------------------------------
-   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
-      ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
-      ln_read_frq = .false.   !  specify whether we must read frq or not
-
-   cn_dir      = './'     !  root directory for the ocean data location
-   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
-   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
-   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
-   sn_usp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssu'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_vsp  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssv'     ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_tem  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sst',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_sal  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'sss',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_ssh  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'ssh',        .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_e3t  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'e3t_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-   sn_frq  = 'Station_PAPA_50N-145W_oce_hourly', 1.         , 'frq_m'   ,   .true.    , .false. , 'yearly'  ,    ''            ,    ''    ,    ''
-/
-!!======================================================================
-!!               ***  Lateral boundary condition  ***                 !!
-!!                                                                    !!
-!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
-!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
-!!   nam_tide      Tidal forcing                                        (default: OFF)
-!!   nambdy        Unstructured open boundaries                         (default: OFF)
-!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
-!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
-!-----------------------------------------------------------------------
-   rn_shlat    =    0.     !  free slip
-/
-!!======================================================================
-!!                ***  Top/Bottom boundary condition  ***             !!
-!!                                                                    !!
-!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
-!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
-!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
-!!   nambbc        bottom temperature boundary condition                (default: OFF)
-!!   nambbl        bottom boundary layer scheme                         (default: OFF)
-!!======================================================================
-!
-!!======================================================================
-!!                        Tracer (T-S) namelists                      !!
-!!                                                                    !!
-!!   nameos        equation of state                                    (default: NO selection)
-!!   namtra_adv    advection scheme                                     (default: NO selection)
-!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
-!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
-!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
-!-----------------------------------------------------------------------
-   ln_eos80    = .true.          !  = Use EOS80
-/
-!!======================================================================
-!!                      ***  Dynamics namelists  ***                  !!
-!!                                                                    !!
-!!   nam_vvl       vertical coordinate options                          (default: z-star)
-!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
-!!   namdyn_vor    advection scheme                                     (default: NO selection)
-!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
-!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
-!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
-!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
-!!======================================================================
-!
-!!======================================================================
-!!                     vertical physics namelists                     !!
-!!                                                                    !!
-!!    namzdf        vertical physics manager                            (default: NO selection)
-!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
-!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
-!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
-!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
-!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Diagnostics namelists  ***                   !!
-!!                                                                    !!
-!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
-!!   namhsb       Heat and salt budgets                                 (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namdiu       Cool skin and warm layer models                       (default: OFF)
-!!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
-!!   nam_diadct   transports through some sections                      (default: OFF)
-!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
-!!   nam_dia25h   25h Mean Output                                       (default: OFF)
-!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
-!!======================================================================
-!
-!!======================================================================
-!!               ***  Observation & Assimilation  ***                 !!
-!!                                                                    !!
-!!   namobs       observation and model comparison                      (default: OFF)
-!!   nam_asminc   assimilation increments                               ('key_asminc')
-!!======================================================================
-!
-!!======================================================================
-!!                  ***  Miscellaneous namelists  ***                 !!
-!!                                                                    !!
-!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
-!!   namctl            Control prints                                   (default: OFF)
-!!   namsto            Stochastic parametrization of EOS                (default: OFF)
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namctl        !   Control prints                                       (default: OFF)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
-!-----------------------------------------------------------------------
-/
Index: MO/trunk/tests/STATION_ASF/EXPREF/namelist_ref
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/namelist_ref	(revision 14071)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/namelist_ref
Index: MO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf.py
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf.py	(revision 14071)
+++ 	(revision )
@@ -1,242 +1,0 @@
-#!/usr/bin/env python3
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-
-# Post-diagnostic of STATION_ASF /  L. Brodeau, 2020
-
-import sys
-from os import path as path
-import math
-import numpy as nmp
-from netCDF4 import Dataset
-import matplotlib as mpl
-mpl.use('Agg')
-import matplotlib.pyplot as plt
-import matplotlib.dates as mdates
-
-cy1     = '2018' ; # First year
-cy2     = '2018' ; # Last year
-
-dir_figs='.'
-size_fig=(13,7)
-fig_ext='png'
-
-clr_red = '#AD0000'
-clr_sat = '#ffed00'
-clr_mod = '#008ab8'
-
-rDPI=200.
-
-L_ALGOS = [ 'COARE3p6' , 'ECMWF'   , 'NCAR' ]
-l_xtrns = [ '-noskin'  , '-noskin' ,  ''    ] ; # string to add to algo name (L_ALGOS) to get version without skin params turned on
-l_color = [  '#ffed00' , '#008ab8' , '0.4'  ] ; # colors to differentiate algos on the plot
-l_width = [     3      ,    2      ,  1     ] ; # line-width to differentiate algos on the plot
-l_style = [    '-'     ,   '-'     , '--'   ] ; # line-style
-
-L_VNEM  = [   'qla'     ,     'qsb'     ,     'qt'     ,   'qlw'     ,  'taum'     ,    'dt_skin'         ]
-L_VARO  = [   'Qlat'    ,    'Qsen'     ,     'Qnet'   ,   'Qlw'     ,  'Tau'      ,    'dT_skin'         ] ; # name of variable on figure
-L_VARL  = [ r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$|\tau|$' , r'$\Delta T_{skin}$' ] ; # name of variable in latex mode
-L_VUNT  = [ r'$W/m^2$'  , r'$W/m^2$'    , r'$W/m^2$'   , r'$W/m^2$'  , r'$N/m^2$'  ,      'K'             ]
-L_VMAX  = [     75.     ,     75.       ,    800.      ,     25.     ,    1.2      ,       0.7            ]
-L_VMIN  = [   -250.     ,   -125.       ,   -400.      ,   -150.     ,    0.       ,      -0.7            ]
-L_ANOM  = [   True      ,    True       ,    True      ,    True     ,   True      ,      False           ]
-
-#L_VNEM  = [   'qlw'      ]
-#L_VARO  = [   'Qlw'      ] ; # name of variable on figure
-#L_VARL  = [ r'$Q_{lw}$'  ] ; # name of variable in latex mode
-#L_VUNT  = [ r'$W/m^2$'   ]
-#L_VMAX  = [     25.      ]
-#L_VMIN  = [   -150.      ]
-#L_ANOM  = [    True      ]
-
-
-
-nb_algos = len(L_ALGOS) ; print(nb_algos)
-
-# Getting arguments:
-narg = len(sys.argv)
-if narg != 2:
-    print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0)
-cdir_data = sys.argv[1]
-
-
-
-# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-# Populating and checking existence of files to be read
-# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-def chck4f(cf):
-    cmesg = 'ERROR: File '+cf+' does not exist !!!'
-    if not path.exists(cf): print(cmesg); sys.exit(0)
-
-###cf_in = nmp.empty((), dtype="S10")
-cf_in = [] ; cf_in_ns = []
-for ja in range(nb_algos):
-    cfi = cdir_data+'/output/'+'STATION_ASF-'+L_ALGOS[ja]+'_1h_'+cy1+'0101_'+cy2+'1231_gridT.nc'
-    chck4f(cfi)
-    cf_in.append(cfi)
-# Same but without skin params:
-for ja in range(nb_algos):
-    cfi = cdir_data+'/output/'+'STATION_ASF-'+L_ALGOS[ja]+l_xtrns[ja]+'_1h_'+cy1+'0101_'+cy2+'1231_gridT.nc'
-    chck4f(cfi)
-    cf_in_ns.append(cfi)
-print('Files we are goin to use:')
-for ja in range(nb_algos): print(cf_in[ja])
-print('   --- same without cool-skin/warm-layer:')
-for ja in range(nb_algos): print(cf_in_ns[ja])
-#-----------------------------------------------------------------
-
-
-# Getting time array from the first file:
-id_in = Dataset(cf_in[0])
-vt = id_in.variables['time_counter'][:]
-cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"')
-id_in.close()
-nbr = len(vt)
-
-
-
-
-vtime = nmp.zeros(nbr)
-
-vt = vt + 1036800. + 30.*60. # BUG!??? don't get why false in epoch to date conversion, and yet ncview gets it right!
-for jt in range(nbr): vtime[jt] = mdates.epoch2num(vt[jt])
-
-ii=nbr/300
-ib=max(ii-ii%10,1)
-xticks_d=int(30*ib)
-
-font_inf = { 'fontname':'Open Sans', 'fontweight':'normal', 'fontsize':14 }
-
-nb_var = len(L_VNEM)
-
-xF  = nmp.zeros((nbr,nb_algos))
-xFa = nmp.zeros((nbr,nb_algos))
-
-
-for ctest in ['skin','noskin']:
-
-    for jv in range(nb_var):
-        print('\n *** Treating variable: '+L_VARO[jv]+' ('+ctest+') !')
-
-        for ja in range(nb_algos):
-            #
-            if ctest == 'skin':   id_in = Dataset(cf_in[ja])
-            if ctest == 'noskin': id_in = Dataset(cf_in_ns[ja])
-            xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain!
-            if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name
-            id_in.close()
-
-        fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k')
-
-        ax1 = plt.axes([0.07, 0.22, 0.9, 0.75])
-
-        ax1.set_xticks(vtime[::xticks_d])
-        ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
-        plt.xticks(rotation='60')
-
-        for ja in range(nb_algos):
-            plt.plot(vtime, xF[:,ja], '-', color=l_color[ja], linestyle=l_style[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja)
-
-        ax1.set_ylim(L_VMIN[jv], L_VMAX[jv]) ; ax1.set_xlim(vtime[0],vtime[nbr-1])
-        plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
-
-        ax1.grid(color='k', linestyle='-', linewidth=0.3)
-        plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True)
-        ax1.annotate(cvar_lnm+' ('+ctest+')', xy=(0.3, 0.97), xycoords='axes fraction',  bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf)
-        plt.savefig(L_VARO[jv]+'_'+ctest+'.'+fig_ext, dpi=int(rDPI), transparent=False)
-        plt.close(jv)
-
-
-
-        if L_ANOM[jv]:
-
-            for ja in range(nb_algos): xFa[:,ja] = xF[:,ja] - nmp.mean(xF,axis=1)
-
-            if nmp.sum(xFa[:,:]) == 0.0:
-                print('     Well! Seems that for variable '+L_VARO[jv]+', choice of algo has no impact a all!')
-                print('          ==> skipping anomaly plot...')
-
-            else:
-
-                # Want a symetric y-range that makes sense for the anomaly we're looking at:
-                rmax = nmp.max(xFa) ; rmin = nmp.min(xFa)
-                rmax = max( abs(rmax) , abs(rmin) )
-                romagn = math.floor(math.log(rmax, 10)) ; # order of magnitude of the anomaly  we're dealing with
-                rmlt = 10.**(int(romagn)) / 2.
-                yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax)
-
-                fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k')
-                ax1 = plt.axes([0.07, 0.22, 0.9, 0.75])
-
-                ax1.set_xticks(vtime[::xticks_d])
-                ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
-                plt.xticks(rotation='60')
-
-                for ja in range(nb_algos):
-                    plt.plot(vtime, xFa[:,ja], '-', color=l_color[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja)
-
-                ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[nbr-1])
-                plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
-                ax1.grid(color='k', linestyle='-', linewidth=0.3)
-                plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True)
-                ax1.annotate('Anomaly of '+cvar_lnm+' ('+ctest+')', xy=(0.3, 0.97), xycoords='axes fraction',  bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf)
-                plt.savefig(L_VARO[jv]+'_'+ctest+'_anomaly.'+fig_ext, dpi=int(rDPI), transparent=False)
-                plt.close(10+jv)
-
-
-
-
-# Difference skin vs noskin:
-xFns = nmp.zeros((nbr,nb_algos))
-
-for jv in range(nb_var-1):
-    print('\n *** Treating variable: '+L_VARO[jv]+' ('+ctest+') !')
-
-    for ja in range(nb_algos-1):
-        id_in = Dataset(cf_in[ja])
-        xF[:,ja]   = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain!
-        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name
-        id_in.close()
-        #
-        id_in = Dataset(cf_in_ns[ja])
-        xFns[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain!
-        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name
-        id_in.close()
-
-        xFa[:,ja] = xF[:,ja] - xFns[:,ja]  ; # difference!
-
-
-    # Want a symetric y-range that makes sense for the anomaly we're looking at:
-    rmax = nmp.max(xFa) ; rmin = nmp.min(xFa)
-    rmax = max( abs(rmax) , abs(rmin) )
-    romagn = math.floor(math.log(rmax, 10)) ; # order of magnitude of the anomaly  we're dealing with
-    rmlt = 10.**(int(romagn)) / 2.
-    yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax)
-
-    
-    for ja in range(nb_algos-1):
-
-        calgo = L_ALGOS[ja]
-
-        if nmp.sum(xFa[:,ja]) == 0.0:
-            print('     Well! Seems that for variable '+L_VARO[jv]+', and algo '+calgo+', skin param has no impact')
-            print('          ==> skipping difference plot...')
-
-        else:
-
-            fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k')
-            ax1 = plt.axes([0.07, 0.22, 0.9, 0.75])
-
-            ax1.set_xticks(vtime[::xticks_d])
-            ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
-            plt.xticks(rotation='60')
-
-            plt.plot(vtime, xFa[:,ja], '-', color=l_color[ja], linestyle=l_style[ja], linewidth=l_width[ja], label=None, zorder=10+ja)
-
-            ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[nbr-1])
-            plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
-
-            ax1.grid(color='k', linestyle='-', linewidth=0.3)
-            #plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True)
-            ax1.annotate(cvar_lnm+' ('+ctest+')', xy=(0.3, 0.97), xycoords='axes fraction',  bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf)
-            plt.savefig('diff_skin-noskin_'+L_VARO[jv]+'_'+calgo+'_'+ctest+'.'+fig_ext, dpi=int(rDPI), transparent=False)
-            plt.close(jv)
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py	(revision 14072)
@@ -0,0 +1,279 @@
+#!/usr/bin/env python3
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+##########################################################################################
+# Post-diagnostic of STATION_ASF for air-ice fluxes (over sea-ice)
+#
+#  L. Brodeau, 2020
+##########################################################################################
+
+import sys
+from os import path, listdir
+import argparse as ap
+from math import floor, ceil, copysign, log
+import numpy as nmp
+from netCDF4 import Dataset,num2date
+import matplotlib as mpl
+mpl.use('Agg')
+import matplotlib.pyplot as plt
+import matplotlib.dates as mdates
+
+dir_figs='.'
+size_fig=(13,8.5)
+size_fig0=(12,10)
+
+clr_red = '#AD0000'
+clr_mod = '#008ab8'
+
+rDPI=100.
+
+#ffed00: yellow ON
+#E8A727: ornage
+
+l_color = [ '0.3' , '#E8A727', '0.1'  , '#008ab8'  ] ; # colors to differentiate algos on the plot
+l_width = [   2   ,    2     ,  1.5   ,    2       ] ; # line-width to differentiate algos on the plot
+l_style = [  '-'  ,    '-'   , '--'   ,   '-'      ] ; # line-style
+
+
+# Variables to compare between algorithms
+############################################
+crealm = 'sea-ice'
+L_VNEM = [   'Cd_ice',   'Ch_ice',   'qla_ice' ,   'qsb_ice'   ,  'qt_ice'    ,  'qlw_ice'  ,  'qsr_ice'  , 'taum_ice'  ]
+L_VARO = [     'Cd'  ,     'Ch'  ,   'Qlat'    ,    'Qsen'     ,   'Qnet'     ,   'Qlw'     ,    'Qsw'    ,  'Tau'      ]
+L_VARL = [ r'$C_{D}$', r'$C_{H}$', r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$Q_{sw}$' , r'$|\tau|$' ]
+L_VUNT = [     ''    ,     ''    , r'$W/m^2$'  , r'$W/m^2$'    , r'$W/m^2$'   , r'$W/m^2$'  , r'$W/m^2$'  , r'$N/m^2$'  ]
+L_BASE = [    0.0005 ,    0.0005 ,      5.     ,     5.        ,     5.       ,    5.       ,     5.      ,    0.05     ]
+L_PREC = [     3     ,     3     ,      0     ,      0        ,      0      ,      0        ,     0       ,     2       ]
+L_ANOM = [   False   ,   False   ,   True      ,    True       ,    True      ,    True     ,    True     ,   True      ]
+L_MAXT = [  10000.   ,     10000.,  10000.   ,  10000.      ,  10000.    ,  10000.      , 10000.     ,      1.5    ]
+L_MINT = [    0.001  ,     0.001 , -10000.   , -10000.      , -10000.    , -10000.      ,-10000.     ,   -10000.   ]
+
+
+# About STATION_ASF output files to read:
+cpref = 'STATION_ASF-'          ; np = len(cpref)
+csuff = '_icemod.nc'            ; ns = len(csuff)
+cclnd = '_1h_YYYY0101_YYYY1231' ; nc = len(cclnd)
+
+
+################## ARGUMENT PARSING / USAGE ################################################################################################
+parser = ap.ArgumentParser(description='Generate pixel maps of a given scalar.')
+#
+requiredNamed = parser.add_argument_group('required arguments')
+requiredNamed.add_argument('-d', '--dirout' , required=True,                 help='Path to (production) directory where STATION_ASF was run')
+requiredNamed.add_argument('-f', '--forcing', required=True, default="PAPA", help='Name of forcing (ex: PAPA, ERA5_arctic')
+#
+parser.add_argument('-C', '--conf',   default="STATION_ASF",  help='specify NEMO config (ex: STATION_ASF)')
+parser.add_argument('-s', '--ystart', default="2018",         help='specify first year of experiment (ex: 2018)')
+parser.add_argument('-e', '--yend',   default="2018",         help='specify last  year of experiment (ex: 2018)')
+#
+parser.add_argument('-t', '--itype',   default="png",         help='specify the type of image you want to create (ex: png, svg, etc.)')
+#parser.add_argument('-l', '--lev' , type=int, default=0,    help='specify the level to use if 3D field (default: 0 => 2D)')
+#parser.add_argument('-I', '--ice' , action='store_true',    help='draw sea-ice concentration layer onto the field')
+#
+args = parser.parse_args()
+#
+cdir_data = args.dirout
+cforcing  = args.forcing
+#
+CONF      = args.conf
+cy1       = args.ystart
+cy2       = args.yend
+#
+fig_ext   = args.itype
+#jk    = args.lev
+#lshow_ice = args.ice
+#
+#print(''); print(' *** cdir_data = ', cdir_data); print(' *** cforcing  = ', cforcing)
+#print(' *** CONF = ', CONF); print(' *** cy1 = ', cy1); print(' *** cy2 = ', cy2)
+###############################################################################################################################################
+
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+# Populating and checking existence of files to be read
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+dir_out = cdir_data+'/output'
+ldir = listdir(dir_out)
+cf_in    = []
+list_exp = []
+list_ext = [] ; # for title
+list_frc = []
+for fn in ldir:
+    fpn = dir_out+'/'+fn
+    if path.isfile(fpn):
+        if fn[:np]==cpref and fn[-ns:]==csuff and cforcing in fn:
+            print('\n file: '+fn)
+            clab = fn[np:-nc-ns]
+            [ cexp, cfrc ] = str.split(clab, '_', 1)
+            cexp = cexp.split('-')[1] ; # removing air-sea algo name...
+            cext = cexp
+            if   cexp == "LG15":
+                cext ="Lüpkes & Gryanik, 2015"
+            elif cexp == "LU12":
+                cext ="Lüpkes et al., 2012"
+            elif cexp == "AN05":
+                cext ="Andreas et al., 2005"
+            elif cexp == "CSTC":
+                cext ="Constant coefficients"
+            print('  ===> Experiment = '+cexp+' ('+cext+'), Forcing = '+cfrc)
+            list_exp.append(cexp)
+            list_ext.append(cext)
+            list_frc.append(cfrc)
+            cf_in.append(fpn)
+nbf = len( set(list_frc) )
+
+
+
+if nbf == 0:
+    print('PROBLEM: we found no files corresponding to a forcing!')
+    sys.exit(0)
+print("list_frc =>",list_frc)
+if not nbf == 1:
+    print('PROBLEM: we found files for more that one forcing: ', set(list_frc))
+    sys.exit(0)
+
+nb_exp = len(list_exp)
+
+
+print('\n\nThere are '+str(nb_exp)+' experiments to compare:')
+for ja in range(nb_exp): print('  * '+list_exp[ja]+'\n'+'     ==> '+cf_in[ja]+'\n')
+
+if nb_exp > len(l_color):
+    print('PROBLEM: the max number of experiments for comparison is '+str(len(l_color))+' for now...')
+    sys.exit(0)
+
+
+#-----------------------------------------------------------------
+
+
+def round_bounds( x1, x2,  base=5, prec=3 ):
+    rmin =  base * round( floor(float(x1)/base), prec )
+    rmax =  base * round(  ceil(float(x2)/base), prec )
+    return rmin, rmax
+
+
+# Getting time array from the first file:
+id_in = Dataset(cf_in[0])
+vt = id_in.variables['time_counter'][:]
+cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"')
+id_in.close()
+Nt = len(vt)
+
+vtime = num2date(vt, units=cunit_t) ; # something human!
+vtime = vtime.astype(dtype='datetime64[D]')
+
+ii=Nt/300
+ib=max(ii-ii%10,1)
+xticks_d=int(30*ib)
+
+rat = 100./float(rDPI)
+params = { 'font.family':'Open Sans',
+           'font.size':       int(15.*rat),
+           'legend.fontsize': int(15.*rat),
+           'xtick.labelsize': int(15.*rat),
+           'ytick.labelsize': int(15.*rat),
+           'axes.labelsize':  int(16.*rat)
+}
+mpl.rcParams.update(params)
+font_inf = { 'fontname':'Open Sans', 'fontweight':'normal', 'fontsize':18.*rat }
+font_x   = { 'fontname':'Open Sans', 'fontweight':'normal', 'fontsize':15.*rat }
+
+
+# Now we compare output variables from bulk algorithms between them:
+
+nb_var = len(L_VNEM)
+
+xF  = nmp.zeros((Nt,nb_exp))
+xFa = nmp.zeros((Nt,nb_exp))
+
+
+for jv in range(nb_var):
+    print('\n *** Treating variable: '+L_VARO[jv]+' !')
+
+    for ja in range(nb_exp):
+        #
+        id_in = Dataset(cf_in[ja])
+        xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1]  ; # only the center point of the 3x3 spatial domain!
+        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name
+        id_in.close()
+        #
+        id_toolarge, = nmp.where( xF[:,ja] > L_MAXT[jv] ) # 
+        xF[id_toolarge,ja] = L_MAXT[jv]
+        id_toosmall, = nmp.where( xF[:,ja] < L_MINT[jv] ) ; #print("id_toosmall =", id_toosmall)
+        xF[id_toosmall,ja] = L_MINT[jv]
+
+    idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 )
+
+    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k')
+    ax1 = plt.axes([0.083, 0.23, 0.9, 0.7])
+    ax1.set_xticks(vtime[::xticks_d])
+    ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
+    plt.xticks(rotation='60', **font_x)
+
+    for ja in range(nb_exp):
+        fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] )
+        plt.plot(vtime, fplot, '-', color=l_color[ja], \
+                 linestyle=l_style[ja], linewidth=l_width[ja], label=list_ext[ja], alpha=0.6 ) #zorder=10+ja)
+
+    fmin, fmax = round_bounds( nmp.min(xF[idx_okay]) , nmp.max(xF[idx_okay]), base=L_BASE[jv], prec=L_PREC[jv])
+    ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1])
+    plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
+
+    ax1.grid(color='k', linestyle='-', linewidth=0.3)
+    plt.legend(loc='best', ncol=1, shadow=True, fancybox=True)
+    ax1.annotate(cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \
+                 ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \
+                 zorder=50, **font_inf)
+    plt.savefig(L_VARO[jv]+'_'+cforcing+'_'+crealm+'.'+fig_ext, dpi=int(rDPI), transparent=False)
+    plt.close(jv)
+    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+
+    def symetric_range( pmin, pmax ):
+        # Returns a symetric f-range that makes sense for the anomaly of "f" we're looking at...
+        from math import floor, copysign, log, ceil
+        zmax = max( abs(pmax) , abs(pmin) )
+        romagn = floor(log(zmax, 10)) ; # order of magnitude of the anomaly  we're dealing with
+        rmlt = 10.**(int(romagn)) / 2.
+        frng = copysign( ceil(abs(zmax)/rmlt)*rmlt , zmax)
+        return frng
+
+
+    if L_ANOM[jv]:
+
+        for ja in range(nb_exp): xFa[:,ja] = xF[:,ja] - nmp.mean(xF,axis=1)
+
+        if nmp.sum(nmp.abs(xFa[:,:])) == 0.0:
+            print('     Well! Seems that for variable '+L_VARO[jv]+', choice of algo has no impact a all!')
+            print('          ==> skipping anomaly plot...')
+
+        else:
+
+            yrng = symetric_range( nmp.min(xFa) , nmp.max(xFa) )
+
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k')
+            ax1 = plt.axes([0.09, 0.23, 0.9, 0.7])
+            ax1.set_xticks(vtime[::xticks_d])
+            ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
+            plt.xticks(rotation='60', **font_x)
+
+            for ja in range(nb_exp):
+                fplot = nmp.ma.masked_where( xFa[:,ja]==0., xFa[:,ja] )
+                plt.plot(vtime, fplot, '-', color=l_color[ja], \
+                         linewidth=l_width[ja], label=list_exp[ja], alpha=0.6) #, zorder=10+ja)
+
+            ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[Nt-1])
+            plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
+            ax1.grid(color='k', linestyle='-', linewidth=0.3)
+            plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True)
+            ax1.annotate('Anomaly of '+cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \
+                         ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \
+                         zorder=50, **font_inf)
+            plt.savefig(L_VARO[jv]+'_'+cforcing+'_anomaly_'+crealm+'.'+fig_ext, dpi=int(rDPI), transparent=False)
+            plt.close(10+jv)
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_OCE.py
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_OCE.py	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf_OCE.py	(revision 14072)
@@ -0,0 +1,312 @@
+#!/usr/bin/env python3
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+##########################################################################################
+# Post-diagnostic of STATION_ASF for air-sea fluxes (over open ocean)
+#
+#  L. Brodeau, 2020
+##########################################################################################
+
+import sys
+from os import path, listdir
+import argparse as ap
+from math import floor, ceil, copysign, log
+import numpy as nmp
+from netCDF4 import Dataset,num2date
+import matplotlib as mpl
+mpl.use('Agg')
+import matplotlib.pyplot as plt
+import matplotlib.dates as mdates
+
+dir_figs='.'
+size_fig=(13,8.5)
+size_fig0=(12,10)
+
+clr_red = '#AD0000'
+clr_mod = '#008ab8'
+
+rDPI=100.
+
+#l_color = [ '0.85'    ,  '#ffed00' , '#008ab8' , '0.4'  ] ; # colors to differentiate algos on the plot
+#l_width = [  4        ,     3      ,    2      ,  1     ] ; # line-width to differentiate algos on the plot
+#l_style = [ '-'       ,    '-'     ,   '-'     , '--'   ] ; # line-style
+
+#ffed00: yellow ON
+#E8A727: ornage
+
+l_color = [ '0.3' , '#E8A727', '0.1'  , '#008ab8'  ] ; # colors to differentiate algos on the plot
+l_width = [   2   ,    2     ,  1.5   ,    2       ] ; # line-width to differentiate algos on the plot
+l_style = [  '-'  ,    '-'   , '--'   ,   '-'      ] ; # line-style
+
+
+# Variables to compare between algorithms
+############################################
+crealm = 'open-ocean'
+L_VNEM = [   'Cd_oce'  ,   'Ce_oce'  ,   'qla_oce' , 'qsb_oce'     ,     'qt_oce' ,   'qlw_oce' ,  'taum'     ,    'dt_skin'         ]
+L_VARO = [     'Cd'    ,     'Ce'    ,   'Qlat'    ,    'Qsen'     ,     'Qnet'   ,   'Qlw'     ,  'Tau'      ,    'dT_skin'         ] ; # name of variable on figure
+L_VARL = [ r'$C_{D}$'  , r'$C_{E}$'  , r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$|\tau|$' , r'$\Delta T_{skin}$' ] ; # name of variable in latex mode
+L_VUNT = [     ''      ,     ''      , r'$W/m^2$'  , r'$W/m^2$'    , r'$W/m^2$'   , r'$W/m^2$'  , r'$N/m^2$'  ,      'K'             ]
+L_BASE = [    0.0005   ,    0.0005   ,      5.     ,      5.       ,       5      ,      5.     ,    0.05      ,       0.05           ]
+L_PREC = [      3      ,      3      ,      0      ,      0        ,       0      ,      0      ,     2       ,        3             ]
+L_ANOM = [   False     ,   False     ,   True      ,    True       ,    True      ,    True     ,   True      ,      False           ]
+L_MAXT = [  10000.   ,     10000.,  10000.   ,  10000.      ,  10000.    ,  10000.      , 10000.     ,      1.5    ]
+L_MINT = [    0.001  ,     0.001 , -10000.   , -10000.      , -10000.    , -10000.      ,-10000.     ,   -10000.   ]
+
+# About STATION_ASF output files to read:
+cpref = 'STATION_ASF-'          ; np = len(cpref)
+csuff = '_gridT.nc'             ; ns = len(csuff)
+cclnd = '_1h_YYYY0101_YYYY1231' ; nc = len(cclnd)
+
+
+################## ARGUMENT PARSING / USAGE ################################################################################################
+parser = ap.ArgumentParser(description='Generate pixel maps of a given scalar.')
+#
+requiredNamed = parser.add_argument_group('required arguments')
+requiredNamed.add_argument('-d', '--dirout' , required=True,                 help='Path to (production) directory where STATION_ASF was run')
+requiredNamed.add_argument('-f', '--forcing', required=True, default="PAPA", help='Name of forcing (ex: PAPA, ERA5_arctic')
+#
+parser.add_argument('-C', '--conf',   default="STATION_ASF",  help='specify NEMO config (ex: STATION_ASF)')
+parser.add_argument('-s', '--ystart', default="2018",         help='specify first year of experiment (ex: 2018)')
+parser.add_argument('-e', '--yend',   default="2018",         help='specify last  year of experiment (ex: 2018)')
+#
+parser.add_argument('-t', '--itype',   default="png",         help='specify the type of image you want to create (ex: png, svg, etc.)')
+#parser.add_argument('-l', '--lev' , type=int, default=0,    help='specify the level to use if 3D field (default: 0 => 2D)')
+#parser.add_argument('-I', '--ice' , action='store_true',    help='draw sea-ice concentration layer onto the field')
+#
+args = parser.parse_args()
+#
+cdir_data = args.dirout
+cforcing  = args.forcing
+#
+CONF      = args.conf
+cy1       = args.ystart
+cy2       = args.yend
+#
+fig_ext   = args.itype
+#jk    = args.lev
+#lshow_ice = args.ice
+#
+#print(''); print(' *** cdir_data = ', cdir_data); print(' *** cforcing  = ', cforcing)
+#print(' *** CONF = ', CONF); print(' *** cy1 = ', cy1); print(' *** cy2 = ', cy2)
+###############################################################################################################################################
+
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+# Populating and checking existence of files to be read
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+dir_out = cdir_data+'/output'
+ldir = listdir(dir_out)
+
+cf_in    = []
+list_exp = []
+list_frc = []
+for fn in ldir:
+    fpn = dir_out+'/'+fn
+    if path.isfile(dir_out+'/'+fn):
+        if fn[:np]==cpref and fn[-ns:]==csuff and cforcing in fn:
+            print('\n file: '+fn)
+            clab = fn[np:-nc-ns]
+            [ cexp, cfrc ] = str.split(clab, '_', 1)
+            print('  ===> Experiment = '+cexp+', Forcing = '+cfrc)
+            list_exp.append(cexp)
+            list_frc.append(cfrc)
+            cf_in.append(fpn)
+nbf = len( set(list_frc) )
+if not nbf == 1:
+    print('PROBLEM: we found files for more that one forcing: ', set(list_frc))
+    sys.exit(0)
+
+nb_exp = len(list_exp)
+
+
+print('\n\nThere are '+str(nb_exp)+' experiments to compare:')
+for ja in range(nb_exp): print('  * '+list_exp[ja]+'\n'+'     ==> '+cf_in[ja]+'\n')
+
+if nb_exp > len(l_color):
+    print('PROBLEM: the max number of experiments for comparison is '+str(len(l_color))+' for now...')
+    sys.exit(0)
+
+
+#-----------------------------------------------------------------
+
+
+def round_bounds( x1, x2,  base=5, prec=3 ):
+    rmin =  base * round( floor(float(x1)/base), prec )
+    rmax =  base * round(  ceil(float(x2)/base), prec )
+    return rmin, rmax
+
+
+# Getting time array from the first file:
+id_in = Dataset(cf_in[0])
+vt = id_in.variables['time_counter'][:]
+cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"')
+id_in.close()
+Nt = len(vt)
+
+vtime = num2date(vt, units=cunit_t) ; # something human!
+vtime = vtime.astype(dtype='datetime64[D]')
+
+ii=Nt/300
+ib=max(ii-ii%10,1)
+xticks_d=int(30*ib)
+
+rat = 100./float(rDPI)
+params = { 'font.family':'Open Sans',
+           'font.size':       int(15.*rat),
+           'legend.fontsize': int(15.*rat),
+           'xtick.labelsize': int(15.*rat),
+           'ytick.labelsize': int(15.*rat),
+           'axes.labelsize':  int(16.*rat)
+}
+mpl.rcParams.update(params)
+font_inf = { 'fontname':'Open Sans', 'fontweight':'normal', 'fontsize':18.*rat }
+font_x   = { 'fontname':'Open Sans', 'fontweight':'normal', 'fontsize':15.*rat }
+
+
+
+
+
+# First for each algorithm we compare some input vs out put variables:
+
+# t_skin
+vtemp_in = [ 'sst'           ,               'theta_zu'               ,               'theta_zt'               ,     't_skin'       ]
+vtemp_lb = [ 'SST (bulk SST)', r'$\theta_{zu}$ (pot. air temp. at zu)', r'$\theta_{zt}$ (pot. air temp. at zt)', 'Skin temperature' ]
+vtemp_cl = [  'k'            ,                clr_mod                 ,                'purple'                ,      clr_red       ]
+vtemp_lw = [   3             ,                   1.3                  ,                   1.3                  ,         0.7        ]
+vtemp_ls = [     '-'         ,                   '-'                  ,                   '--'                 ,         '-'        ]
+ntemp = len(vtemp_in)
+
+xxx = nmp.zeros((Nt,ntemp))
+
+for ja in range(nb_exp):
+    #
+    # Temperatures...
+    id_in = Dataset(cf_in[ja])
+    for jv in range(ntemp):
+        xxx[:,jv] = id_in.variables[vtemp_in[jv]][:,1,1] # only the center point of the 3x3 spatial domain!
+    id_in.close()
+
+    fig = plt.figure(num = 1, figsize=size_fig0, facecolor='w', edgecolor='k')
+    ax1 = plt.axes([0.07, 0.2, 0.9, 0.75])
+    ax1.set_xticks(vtime[::xticks_d])
+    ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
+    plt.xticks(rotation='60', **font_x)
+
+    for jv in range(ntemp):
+        plt.plot(vtime, xxx[:,jv], '-', color=vtemp_cl[jv], linestyle=vtemp_ls[jv], linewidth=vtemp_lw[jv], label=vtemp_lb[jv], zorder=10)
+
+    idx_okay = nmp.where( nmp.abs(xxx) < 1.e+10 )
+    fmin, fmax = round_bounds( nmp.min(xxx[idx_okay]) , nmp.max(xxx[idx_okay]), base=5, prec=0 )
+    ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1])
+    plt.ylabel(r'Temperature [$^{\circ}$C]')
+
+    ax1.grid(color='k', linestyle='-', linewidth=0.3)
+    plt.legend(loc='best', ncol=1, shadow=True, fancybox=True)
+    ax1.annotate('Algo: '+list_exp[ja]+', station: '+cforcing, xy=(0.5, 1.), xycoords='axes fraction', ha='center',  bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf)
+    plt.savefig('01_temperatures_'+list_exp[ja]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False)
+    plt.close(1)
+
+
+del xxx
+
+
+
+# Now we compare output variables from bulk algorithms between them:
+
+nb_var = len(L_VNEM)
+
+xF  = nmp.zeros((Nt,nb_exp))
+xFa = nmp.zeros((Nt,nb_exp))
+
+
+for jv in range(nb_var):
+    print('\n *** Treating variable: '+L_VARO[jv]+' !')
+
+    for ja in range(nb_exp):
+        #
+        id_in = Dataset(cf_in[ja])
+        xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1]  ; # only the center point of the 3x3 spatial domain!
+        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name
+        id_in.close()
+        #
+        id_toolarge, = nmp.where( xF[:,ja] > L_MAXT[jv] ) # 
+        xF[id_toolarge,ja] = L_MAXT[jv]
+        id_toosmall, = nmp.where( xF[:,ja] < L_MINT[jv] ) ; #print("id_toosmall =", id_toosmall)
+        xF[id_toosmall,ja] = L_MINT[jv]
+
+    idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 )
+
+    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k')
+    ax1 = plt.axes([0.083, 0.23, 0.9, 0.7])
+    ax1.set_xticks(vtime[::xticks_d])
+    ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
+    plt.xticks(rotation='60', **font_x)
+
+    for ja in range(nb_exp):
+        fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] )
+        plt.plot(vtime, fplot, '-', color=l_color[ja], \
+                 linestyle=l_style[ja], linewidth=l_width[ja], label=list_exp[ja], alpha=0.6 ) #zorder=10+ja)
+
+    fmin, fmax = round_bounds( nmp.min(xF[idx_okay]) , nmp.max(xF[idx_okay]), base=L_BASE[jv], prec=L_PREC[jv])
+    ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1])
+    plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
+
+    ax1.grid(color='k', linestyle='-', linewidth=0.3)
+    plt.legend(loc='best', ncol=1, shadow=True, fancybox=True)
+    ax1.annotate(cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \
+                 ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \
+                 zorder=50, **font_inf)
+    plt.savefig(L_VARO[jv]+'_'+cforcing+'_'+crealm+'.'+fig_ext, dpi=int(rDPI), transparent=False)
+    plt.close(jv)
+    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+
+    def symetric_range( pmin, pmax ):
+        # Returns a symetric f-range that makes sense for the anomaly of "f" we're looking at...
+        from math import floor, copysign, log, ceil
+        zmax = max( abs(pmax) , abs(pmin) )
+        romagn = floor(log(zmax, 10)) ; # order of magnitude of the anomaly  we're dealing with
+        rmlt = 10.**(int(romagn)) / 2.
+        frng = copysign( ceil(abs(zmax)/rmlt)*rmlt , zmax)
+        return frng
+
+
+    if L_ANOM[jv]:
+
+        for ja in range(nb_exp): xFa[:,ja] = xF[:,ja] - nmp.mean(xF,axis=1)
+
+        if nmp.sum(nmp.abs(xFa[:,:])) == 0.0:
+            print('     Well! Seems that for variable '+L_VARO[jv]+', choice of algo has no impact a all!')
+            print('          ==> skipping anomaly plot...')
+
+        else:
+
+            yrng = symetric_range( nmp.min(xFa) , nmp.max(xFa) )
+
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k')
+            ax1 = plt.axes([0.09, 0.23, 0.9, 0.7])
+            ax1.set_xticks(vtime[::xticks_d])
+            ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
+            plt.xticks(rotation='60', **font_x)
+
+            for ja in range(nb_exp):
+                fplot = nmp.ma.masked_where( xFa[:,ja]==0., xFa[:,ja] )
+                plt.plot(vtime, fplot, '-', color=l_color[ja], \
+                         linewidth=l_width[ja], label=list_exp[ja], alpha=0.6) #, zorder=10+ja)
+
+            ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[Nt-1])
+            plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']')
+            ax1.grid(color='k', linestyle='-', linewidth=0.3)
+            plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True)
+            ax1.annotate('Anomaly of '+cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \
+                         ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \
+                         zorder=50, **font_inf)
+            plt.savefig(L_VARO[jv]+'_'+cforcing+'_anomaly_'+crealm+'.'+fig_ext, dpi=int(rDPI), transparent=False)
+            plt.close(10+jv)
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: MO/trunk/tests/STATION_ASF/MY_SRC/README.md
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/README.md	(revision 14071)
+++ 	(revision )
@@ -1,13 +1,0 @@
-## Welcome to ```STATION_ASF```, a NEMO setup which mimics an off-shore station dedicated to the measure of Air-Sea Fluxes (ASF).
-
-
-
-### Important namelist parameters
-
-* ```rn_dept1@namusr_def:``` depth (m) at which the prescribed SST is taken (i.e. depth of first T-point); important due to impact on warm-layer estimate, the deeper, the more pronounced!
-
-* ```rn_lat1d,rn_lon1d@namc1d:``` fixed coordinates of the location of the station (buoy, platform, etc).
-
-* ```namsbc_blk:``` to be filled carefully, just as for "C1D", the prescribed surface ATMOSPHERIC state (files) are time series of shape 3x3 in space
-
-* ```namsbc_sas:``` to be filled carefully, just as for "C1D", the prescribed surface OCEAN state (files) are time series of shape 3x3 in space
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/diawri.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/diawri.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/diawri.F90	(revision 14072)
@@ -387,13 +387,15 @@
       CALL iom_rstput( 0, 0, inum, 'sozotaux', utau              )    ! i-wind stress
       CALL iom_rstput( 0, 0, inum, 'sometauy', vtau              )    ! j-wind stress
-
+      !
+      CALL iom_close( inum )
+      !
 #if defined key_si3
       IF( nn_ice == 2 ) THEN   ! condition needed in case agrif + ice-model but no-ice in child grid
+         CALL iom_open( TRIM(cdfile_name)//'_ice', inum, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' )
          CALL ice_wri_state( inum )
-      ENDIF
+         CALL iom_close( inum )
+      ENDIF
+      !
 #endif
-      !
-      CALL iom_close( inum )
-      !
    END SUBROUTINE dia_wri_state
 
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/icesbc.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/icesbc.F90	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/icesbc.F90	(revision 14072)
@@ -0,0 +1,343 @@
+MODULE icesbc
+   !!======================================================================
+   !!                       ***  MODULE  icesbc  ***
+   !! Sea-Ice :   air-ice sbc fields
+   !!=====================================================================
+   !! History :  4.0  !  2017-08  (C. Rousset)       Original code
+   !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
+   !!----------------------------------------------------------------------
+#if defined key_si3
+   !!----------------------------------------------------------------------
+   !!   'key_si3' :                                     SI3 sea-ice model
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE ice            ! sea-ice: variables
+   USE sbc_oce        ! Surface boundary condition: ocean fields
+   USE sbc_ice        ! Surface boundary condition: ice   fields
+   USE usrdef_sbc     ! Surface boundary condition: user defined
+   USE sbcblk         ! Surface boundary condition: bulk
+   USE sbccpl         ! Surface boundary condition: coupled interface
+   USE icealb, ONLY : rn_alb_oce         ! sea-ice: albedo !#LB
+   !
+   USE in_out_manager ! I/O manager
+   USE iom            ! I/O manager library
+   USE lib_mpp        ! MPP library
+   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
+   USE lbclnk         ! lateral boundary conditions (or mpp links)
+   USE timing         ! Timing
+   USE fldread        !!GS: needed by agrif
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ice_sbc_tau   ! called by icestp.F90
+   PUBLIC ice_sbc_flx   ! called by icestp.F90
+   PUBLIC ice_sbc_init  ! called by icestp.F90
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
+   !! $Id: icesbc.F90 13472 2020-09-16 13:05:19Z smasson $
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_sbc_tau  ***
+      !!
+      !! ** Purpose : provide surface boundary condition for sea ice (momentum)
+      !!
+      !! ** Action  : It provides the following fields:
+      !!              utau_ice, vtau_ice : surface ice stress (U- & V-points) [N/m2]
+      !!-------------------------------------------------------------------
+      INTEGER                     , INTENT(in   ) ::   kt                   ! ocean time step
+      INTEGER                     , INTENT(in   ) ::   ksbc                 ! type of sbc flux
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   utau_ice, vtau_ice   ! air-ice stress   [N/m2]
+      !!
+      INTEGER  ::   ji, jj                 ! dummy loop index
+      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice
+      !!-------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start('ice_sbc')
+      !
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*)'ice_sbc_tau: Surface boundary condition for sea ice (momentum)'
+         WRITE(numout,*)'~~~~~~~~~~~~~~~'
+      ENDIF
+      !
+      SELECT CASE( ksbc )
+         !
+      CASE( jp_usr     )
+         CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation
+         !
+      CASE( jp_blk     )
+         CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   &
+            &                                      theta_air_zt(:,:), q_air_zt(:,:),   &   ! #LB: known from "sbc_oce" module...
+            &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs
+            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs
+         !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod
+      CASE( jp_purecpl )
+         CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation
+      END SELECT
+      !
+      IF( ln_mixcpl) THEN                                                        ! Case of a mixed Bulk/Coupled formulation
+         CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice )
+         DO_2D( 0, 0, 0, 0 )
+         utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
+         vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
+         END_2D
+         CALL lbc_lnk_multi( 'icesbc', utau_ice, 'U', -1.0_wp, vtau_ice, 'V', -1.0_wp )
+      ENDIF
+      !
+      IF( ln_timing )   CALL timing_stop('ice_sbc')
+      !
+   END SUBROUTINE ice_sbc_tau
+
+
+   SUBROUTINE ice_sbc_flx( kt, ksbc )
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_sbc_flx  ***
+      !!
+      !! ** Purpose : provide surface boundary condition for sea ice (flux)
+      !!
+      !! ** Action  : It provides the following fields used in sea ice model:
+      !!                emp_oce , emp_ice                        = E-P over ocean and sea ice                    [Kg/m2/s]
+      !!                sprecip                                  = solid precipitation                           [Kg/m2/s]
+      !!                evap_ice                                 = sublimation                                   [Kg/m2/s]
+      !!                qsr_tot , qns_tot                        = solar & non solar heat flux (total)           [W/m2]
+      !!                qsr_ice , qns_ice                        = solar & non solar heat flux over ice          [W/m2]
+      !!                dqns_ice                                 = non solar  heat sensistivity                  [W/m2]
+      !!                qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2]
+      !!            + some fields that are not used outside this module:
+      !!                qla_ice                                  = latent heat flux over ice                     [W/m2]
+      !!                dqla_ice                                 = latent heat sensistivity                      [W/m2]
+      !!                tprecip                                  = total  precipitation                          [Kg/m2/s]
+      !!                alb_ice                                  = albedo above sea ice
+      !!-------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt     ! ocean time step
+      INTEGER, INTENT(in) ::   ksbc   ! flux formulation (user defined, bulk or Pure Coupled)
+      !
+      INTEGER  ::   ji, jj, jl      ! dummy loop index
+      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace
+      !!--------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start('ice_sbc_flx')
+
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*)'ice_sbc_flx: Surface boundary condition for sea ice (flux)'
+         WRITE(numout,*)'~~~~~~~~~~~~~~~'
+      ENDIF
+
+      ! get missing value from xml
+      CALL iom_miss_val( "icetemp", zmiss_val )
+
+      ! --- ice albedo --- !
+      !#LB:CALL ice_alb( t_su, h_i, h_s, ln_pnd_alb, a_ip_eff, h_ip, cloud_fra, alb_ice )
+
+      !
+      SELECT CASE( ksbc )   !== fluxes over sea ice ==!
+         !
+      CASE( jp_usr )              !--- user defined formulation
+         CALL usrdef_sbc_ice_flx( kt, h_s, h_i )
+         !
+      CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation
+         CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, &
+            &                theta_air_zt(:,:), q_air_zt(:,:),    &   ! #LB: known from "sbc_oce" module...
+            &                sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), &
+            &                sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )
+         !
+         IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i )
+         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
+         !                        !    compute conduction flux and surface temperature (as in Jules surface module)
+         IF( ln_cndflx .AND. .NOT.ln_cndemulate ) &
+            &                     CALL blk_ice_qcn    ( ln_virtual_itd, t_su, t_bo, h_s, h_i )
+      CASE ( jp_purecpl )         !--- coupled formulation
+         CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i )
+         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
+      END SELECT
+
+      !--- output ice albedo and surface albedo ---!
+      IF( iom_use('icealb') .OR. iom_use('albedo') ) THEN
+
+         ALLOCATE( zalb(jpi,jpj), zmsk00(jpi,jpj) )
+
+         WHERE( at_i_b < 1.e-03 )
+            zmsk00(:,:) = 0._wp
+            zalb  (:,:) = rn_alb_oce
+         ELSEWHERE
+            zmsk00(:,:) = 1._wp
+            zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b
+         END WHERE
+         ! ice albedo
+         CALL iom_put( 'icealb' , zalb * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )
+         ! ice+ocean albedo
+         zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b )
+         CALL iom_put( 'albedo' , zalb )
+
+         DEALLOCATE( zalb, zmsk00 )
+
+      ENDIF
+      !
+      IF( ln_timing )   CALL timing_stop('ice_sbc_flx')
+      !
+   END SUBROUTINE ice_sbc_flx
+
+
+   SUBROUTINE ice_flx_dist( ptn_ice, palb_ice, pqns_ice, pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_flxdist )
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_flx_dist  ***
+      !!
+      !! ** Purpose :   update the ice surface boundary condition by averaging
+      !!              and/or redistributing fluxes on ice categories
+      !!
+      !! ** Method  :   average then redistribute
+      !!
+      !! ** Action  :   depends on k_flxdist
+      !!                = -1  Do nothing (needs N(cat) fluxes)
+      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice
+      !!                =  1  Average N(cat) fluxes then redistribute over the N(cat) ice
+      !!                                                 using T-ice and albedo sensitivity
+      !!                =  2  Redistribute a single flux over categories
+      !!-------------------------------------------------------------------
+      INTEGER                   , INTENT(in   ) ::   k_flxdist  ! redistributor
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb_ice   ! ice albedo
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqns_ice   ! non solar flux
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqsr_ice   ! net solar flux
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdqn_ice   ! non solar flux sensitivity
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pevap_ice  ! sublimation
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdevap_ice ! sublimation sensitivity
+      !
+      INTEGER  ::   jl      ! dummy loop index
+      !
+      REAL(wp), DIMENSION(jpi,jpj) ::   z1_at_i   ! inverse of concentration
+      !
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qsr_m   ! Mean solar heat flux over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qns_m   ! Mean non solar heat flux over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_evap_m  ! Mean sublimation over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_dqn_m   ! Mean d(qns)/dT over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_devap_m ! Mean d(evap)/dT over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zalb_m    ! Mean albedo over all categories
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   ztem_m    ! Mean temperature over all categories
+      !!----------------------------------------------------------------------
+      !
+      WHERE ( at_i (:,:) > 0._wp )
+         z1_at_i(:,:) = 1._wp / at_i (:,:)
+      ELSEWHERE
+         z1_at_i(:,:) = 0._wp
+      END WHERE
+
+      SELECT CASE( k_flxdist )       !==  averaged on all ice categories  ==!
+         !
+      CASE( 0 , 1 )
+         !
+         ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) )
+         !
+         z_qns_m  (:,:) = SUM( a_i(:,:,:) * pqns_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
+         z_qsr_m  (:,:) = SUM( a_i(:,:,:) * pqsr_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
+         z_dqn_m  (:,:) = SUM( a_i(:,:,:) * pdqn_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
+         z_evap_m (:,:) = SUM( a_i(:,:,:) * pevap_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
+         z_devap_m(:,:) = SUM( a_i(:,:,:) * pdevap_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
+         DO jl = 1, jpl
+            pqns_ice  (:,:,jl) = z_qns_m (:,:)
+            pqsr_ice  (:,:,jl) = z_qsr_m (:,:)
+            pdqn_ice  (:,:,jl) = z_dqn_m  (:,:)
+            pevap_ice (:,:,jl) = z_evap_m(:,:)
+            pdevap_ice(:,:,jl) = z_devap_m(:,:)
+         END DO
+         !
+         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m )
+         !
+      END SELECT
+      !
+      SELECT CASE( k_flxdist )       !==  redistribution on all ice categories  ==!
+         !
+      CASE( 1 , 2 )
+         !
+         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) )
+         !
+         zalb_m(:,:) = SUM( a_i(:,:,:) * palb_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
+         ztem_m(:,:) = SUM( a_i(:,:,:) * ptn_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
+         DO jl = 1, jpl
+            pqns_ice (:,:,jl) = pqns_ice (:,:,jl) + pdqn_ice  (:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
+            pevap_ice(:,:,jl) = pevap_ice(:,:,jl) + pdevap_ice(:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
+            pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) )
+         END DO
+         !
+         DEALLOCATE( zalb_m, ztem_m )
+         !
+      END SELECT
+      !
+   END SUBROUTINE ice_flx_dist
+
+
+   SUBROUTINE ice_sbc_init
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_sbc_init  ***
+      !!
+      !! ** Purpose :   Physical constants and parameters linked to the ice dynamics
+      !!
+      !! ** Method  :   Read the namsbc namelist and check the ice-dynamic
+      !!              parameter values called at the first timestep (nit000)
+      !!
+      !! ** input   :   Namelist namsbc
+      !!-------------------------------------------------------------------
+      INTEGER ::   ios, ioptio   ! Local integer
+      !!
+      NAMELIST/namsbc/ rn_cio, nn_snwfra, rn_snwblow, nn_flxdist, ln_cndflx, ln_cndemulate, nn_qtrice
+      !!-------------------------------------------------------------------
+      !
+      READ  ( numnam_ice_ref, namsbc, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in reference namelist' )
+      READ  ( numnam_ice_cfg, namsbc, IOSTAT = ios, ERR = 902 )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc in configuration namelist' )
+      IF(lwm) WRITE( numoni, namsbc )
+      !
+      IF(lwp) THEN                     ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) 'ice_sbc_init: ice parameters for ice dynamics '
+         WRITE(numout,*) '~~~~~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namsbc:'
+         WRITE(numout,*) '      drag coefficient for oceanic stress                       rn_cio        = ', rn_cio
+         WRITE(numout,*) '      fraction of ice covered by snow (options 0,1,2)           nn_snwfra     = ', nn_snwfra
+         WRITE(numout,*) '      coefficient for ice-lead partition of snowfall            rn_snwblow    = ', rn_snwblow
+         WRITE(numout,*) '      Multicategory heat flux formulation                       nn_flxdist    = ', nn_flxdist
+         WRITE(numout,*) '      Use conduction flux as surface condition                  ln_cndflx     = ', ln_cndflx
+         WRITE(numout,*) '         emulate conduction flux                                ln_cndemulate = ', ln_cndemulate
+         WRITE(numout,*) '      solar flux transmitted thru the surface scattering layer  nn_qtrice     = ', nn_qtrice
+         WRITE(numout,*) '         = 0  Grenfell and Maykut 1977'
+         WRITE(numout,*) '         = 1  Lebrun 2019'
+      ENDIF
+      !
+      IF(lwp) WRITE(numout,*)
+      SELECT CASE( nn_flxdist )         ! SI3 Multi-category heat flux formulation
+      CASE( -1  )
+         IF(lwp) WRITE(numout,*) '   SI3: use per-category fluxes (nn_flxdist = -1) '
+      CASE(  0  )
+         IF(lwp) WRITE(numout,*) '   SI3: use average per-category fluxes (nn_flxdist = 0) '
+      CASE(  1  )
+         IF(lwp) WRITE(numout,*) '   SI3: use average then redistribute per-category fluxes (nn_flxdist = 1) '
+         IF( ln_cpl )         CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in coupled mode must be /=1' )
+      CASE(  2  )
+         IF(lwp) WRITE(numout,*) '   SI3: Redistribute a single flux over categories (nn_flxdist = 2) '
+         IF( .NOT. ln_cpl )   CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in forced mode must be /=2' )
+      CASE DEFAULT
+         CALL ctl_stop( 'ice_thd_init: SI3 option, nn_flxdist, should be between -1 and 2' )
+      END SELECT
+      !
+   END SUBROUTINE ice_sbc_init
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option :         Empty module         NO SI3 sea-ice model
+   !!----------------------------------------------------------------------
+#endif
+
+   !!======================================================================
+END MODULE icesbc
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/icestp.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/icestp.F90	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/icestp.F90	(revision 14072)
@@ -0,0 +1,317 @@
+MODULE icestp
+   !!======================================================================
+   !!                       ***  MODULE  icestp  ***
+   !! sea ice : Master routine for all the sea ice model
+   !!=====================================================================
+   !!
+   !! The sea ice model SI3 (Sea Ice modelling Integrated Initiative),
+   !!                        aka Sea Ice cube for its nickname
+   !!
+   !!    is originally based on LIM3, developed in Louvain-la-Neuve by:
+   !!       * Martin Vancoppenolle (UCL-ASTR, Belgium)
+   !!       * Sylvain Bouillon (UCL-ASTR, Belgium)
+   !!       * Miguel Angel Morales Maqueda (NOC-L, UK)
+   !!      thanks to valuable earlier work by
+   !!       * Thierry Fichefet
+   !!       * Hugues Goosse
+   !!      thanks also to the following persons who contributed
+   !!       * Gurvan Madec, Claude Talandier, Christian Ethe (LOCEAN, France)
+   !!       * Xavier Fettweis (UCL-ASTR), Ralph Timmermann (AWI, Germany)
+   !!       * Bill Lipscomb (LANL), Cecilia Bitz (UWa) and Elisabeth Hunke (LANL), USA.
+   !!
+   !! SI3 has been made possible by a handful of persons who met as working group
+   !!      (from France, Belgium, UK and Italy)
+   !!    * Clement Rousset, Martin Vancoppenolle & Gurvan Madec (LOCEAN, France)
+   !!    * Matthieu Chevalier & David Salas (Meteo France, France)
+   !!    * Gilles Garric (Mercator Ocean, France)
+   !!    * Thierry Fichefet & Francois Massonnet (UCL, Belgium)
+   !!    * Ed Blockley & Jeff Ridley (Met Office, UK)
+   !!    * Danny Feltham & David Schroeder (CPOM, UK)
+   !!    * Yevgeny Aksenov (NOC, UK)
+   !!    * Paul Holland (BAS, UK)
+   !!    * Dorotea Iovino (CMCC, Italy)
+   !!======================================================================
+   !! History :  4.0  !  2018     (C. Rousset)      Original code SI3
+   !!----------------------------------------------------------------------
+#if defined key_si3
+   !!----------------------------------------------------------------------
+   !!   'key_si3'                                       SI3 sea-ice model
+   !!----------------------------------------------------------------------
+   !!   ice_stp       : sea-ice model time-stepping and update ocean SBC over ice-covered area
+   !!   ice_init      : initialize sea-ice
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE c1d            ! 1D vertical configuration
+   USE ice            ! sea-ice: variables
+   USE ice1D          ! sea-ice: thermodynamical 1D variables
+   !
+   USE phycst         ! Define parameters for the routines
+   USE eosbn2         ! equation of state
+   USE sbc_oce        ! Surface boundary condition: ocean fields
+   USE sbc_ice        ! Surface boundary condition: ice   fields
+   !
+   USE icesbc         ! sea-ice: Surface boundary conditions
+   USE iceupdate      ! sea-ice: sea surface boundary condition update
+   USE icewri         ! sea-ice: outputs
+   !
+   !
+   USE in_out_manager ! I/O manager
+   USE iom            ! I/O manager library
+   USE lib_mpp        ! MPP library
+   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
+   USE timing         ! Timing
+   USE prtctl         ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   ice_stp    ! called by sbcmod.F90
+   PUBLIC   ice_init   ! called by sbcmod.F90
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
+   !! $Id: icestp.F90 13655 2020-10-21 14:15:13Z laurent $
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE ice_stp( kt, Kbb, Kmm, ksbc )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_stp  ***
+      !!
+      !! ** Purpose :   sea-ice model time-stepping and update ocean surface
+      !!              boundary condition over ice-covered area
+      !!
+      !! ** Method  :   ice model time stepping
+      !!              - call the ice dynamics routine
+      !!              - call the ice advection/diffusion routine
+      !!              - call the ice thermodynamics routine
+      !!              - call the routine that computes mass and
+      !!                heat fluxes at the ice/ocean interface
+      !!              - save the outputs
+      !!              - save the outputs for restart when necessary
+      !!
+      !! ** Action  : - time evolution of the LIM sea-ice model
+      !!              - update all sbc variables below sea-ice:
+      !!                utau, vtau, taum, wndm, qns , qsr, emp , sfx
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt       ! ocean time step
+      INTEGER, INTENT(in) ::   Kbb, Kmm ! ocean time level indices
+      INTEGER, INTENT(in) ::   ksbc     ! flux formulation (user defined, bulk, or Pure Coupled)
+      !
+      INTEGER ::   jl   ! dummy loop index
+      !!----------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start('ice_stp')
+      !
+      !                                      !-----------------------!
+      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN   ! --- Ice time step --- !
+         !                                   !-----------------------!
+         !
+         kt_ice = kt                              ! -- Ice model time step
+         !
+         u_oce(:,:) = ssu_m(:,:)                  ! -- mean surface ocean current
+         v_oce(:,:) = ssv_m(:,:)
+         !
+         CALL eos_fzp( sss_m(:,:) , t_bo(:,:) )   ! -- freezing temperature [Kelvin] (set to rt0 over land)
+         t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) )
+         !
+         !
+         !------------------------------------------------!
+         ! --- Dynamical coupling with the atmosphere --- !
+         !------------------------------------------------!
+         ! It provides the following fields used in sea ice model:
+         !    utau_ice, vtau_ice = surface ice stress [N/m2]
+         !------------------------------------------------!
+                                        CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )
+         !
+         !------------------------------------------------------!
+         ! --- Thermodynamical coupling with the atmosphere --- !
+         !------------------------------------------------------!
+         ! It provides the following fields used in sea ice model:
+         !    emp_oce , emp_ice    = E-P over ocean and sea ice                    [Kg/m2/s]
+         !    sprecip              = solid precipitation                           [Kg/m2/s]
+         !    evap_ice             = sublimation                                   [Kg/m2/s]
+         !    qsr_tot , qns_tot    = solar & non solar heat flux (total)           [W/m2]
+         !    qsr_ice , qns_ice    = solar & non solar heat flux over ice          [W/m2]
+         !    dqns_ice             = non solar  heat sensistivity                  [W/m2]
+         !    qemp_oce, qemp_ice,  = sensible heat (associated with evap & precip) [W/m2]
+         !    qprec_ice, qevap_ice
+         !------------------------------------------------------!
+                                        CALL ice_sbc_flx( kt, ksbc )
+         !----------------------------!
+         ! --- ice thermodynamics --- !
+         !----------------------------!
+
+         fr_i  (:,:)   = at_i(:,:) !#LB...
+
+         !!#LB: lines stolen from "ice_update_flx()@iceupdate.F90"
+         !!=============================================================
+
+         ! --- case we bypass ice thermodynamics --- !
+         !IF( .NOT. ln_icethd ) THEN   ! we suppose ice is impermeable => ocean is isolated from atmosphere
+         qt_atm_oi  (:,:)   = ( 1._wp - at_i_b(:,:) ) * ( qns_oce(:,:) + qsr_oce(:,:) ) + qemp_oce(:,:)
+         qt_oce_ai  (:,:)   = ( 1._wp - at_i_b(:,:) ) *   qns_oce(:,:)                  + qemp_oce(:,:)
+         emp_ice    (:,:)   = 0._wp
+         qemp_ice   (:,:)   = 0._wp
+         qevap_ice  (:,:,:) = 0._wp
+         !ENDIF
+
+         ! output all fluxes
+         !------------------
+
+         ! --- mass fluxes [kg/m2/s] --- !
+         IF( iom_use('emp_oce'    ) )   CALL iom_put( 'emp_oce', emp_oce )   ! emp over ocean (taking into account the snow blown away from the ice)
+         IF( iom_use('emp_ice'    ) )   CALL iom_put( 'emp_ice', emp_ice )   ! emp over ice   (taking into account the snow blown away from the ice)
+         ! --- heat fluxes [W/m2] --- !
+         IF( iom_use('qsr_oce'    ) )   CALL iom_put( 'qsr_oce'    , qsr_oce * ( 1._wp - at_i_b )                               )   !     solar flux at ocean surface
+         IF( iom_use('qns_oce'    ) )   CALL iom_put( 'qns_oce'    , qns_oce * ( 1._wp - at_i_b ) + qemp_oce                    )   ! non-solar flux at ocean surface
+         IF( iom_use('qns_ice'    ) )   CALL iom_put( 'qns_ice'    , SUM( qns_ice * a_i_b, dim=3 ) + qemp_ice                   )   ! non-solar flux at ice surface
+         IF( iom_use('qsr_ice'    ) )   CALL iom_put( 'qsr_ice'    , SUM( qsr_ice * a_i_b, dim=3 )                              )
+         IF( iom_use('qt_oce'     ) )   CALL iom_put( 'qt_oce'     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce )
+         IF( iom_use('qt_ice'     ) )   CALL iom_put( 'qt_ice'     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice )
+         IF( iom_use('qemp_oce'   ) )   CALL iom_put( 'qemp_oce'   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean
+         IF( iom_use('qemp_ice'   ) )   CALL iom_put( 'qemp_ice'   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice
+
+
+         !!=============================================================
+
+         !
+                                        CALL ice_wri( kt )            ! -- Ice outputs
+         !
+         !IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file
+         !
+         !IF( ln_icectl )                CALL ice_ctl( kt )            ! -- Control checks
+         !
+      ENDIF   ! End sea-ice time step only
+
+      !-------------------------!
+      ! --- Ocean time step --- !
+      !-------------------------!
+      !
+      IF( ln_timing )   CALL timing_stop('ice_stp')
+      !
+   END SUBROUTINE ice_stp
+
+
+   SUBROUTINE ice_init( Kbb, Kmm, Kaa )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_init  ***
+      !!
+      !! ** purpose :   Initialize sea-ice parameters
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa
+      !
+      INTEGER ::   ierr
+      !!----------------------------------------------------------------------
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~'
+      !
+      !                                ! Load the reference and configuration namelist files and open namelist output file
+      CALL load_nml( numnam_ice_ref, 'namelist_ice_ref',    numout, lwm )
+      CALL load_nml( numnam_ice_cfg, 'namelist_ice_cfg',    numout, lwm )
+      IF(lwm) CALL ctl_opn( numoni , 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )
+      !
+      CALL par_init                ! set some ice run parameters
+      !
+      !                                ! Allocate the ice arrays (sbc_ice already allocated in sbc_init)
+      ierr =        ice_alloc        ()      ! ice variables
+      ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions
+      ierr = ierr + ice1D_alloc      ()      ! thermodynamics
+      !
+      CALL mpp_sum( 'icestp', ierr )
+      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'ice_init : unable to allocate ice arrays')
+      !
+      !
+      CALL ice_sbc_init                ! set ice-ocean and ice-atm. coupling parameters
+      !
+      fr_i  (:,:)   = at_i(:,:)        ! initialisation of sea-ice fraction
+      !
+      IF( ln_rstart )   CALL iom_close( numrir )  ! close input ice restart file
+      !
+   END SUBROUTINE ice_init
+
+
+   SUBROUTINE par_init
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE par_init ***
+      !!
+      !! ** Purpose :   Definition generic parameters for ice model
+      !!
+      !! ** Method  :   Read namelist and check the parameter
+      !!                values called at the first timestep (nit000)
+      !!
+      !! ** input   :   Namelist nampar
+      !!-------------------------------------------------------------------
+      INTEGER  ::   ios                 ! Local integer
+      !!
+      NAMELIST/nampar/ jpl, nlay_i, nlay_s, ln_virtual_itd, ln_icedyn, ln_icethd, rn_amax_n, rn_amax_s,  &
+         &             cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir
+      !!-------------------------------------------------------------------
+      !
+      READ  ( numnam_ice_ref, nampar, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampar in reference namelist' )
+      READ  ( numnam_ice_cfg, nampar, IOSTAT = ios, ERR = 902 )
+902   IF( ios > 0 )   CALL ctl_nam ( ios , 'nampar in configuration namelist' )
+      IF(lwm) WRITE( numoni, nampar )
+      !
+      IF(lwp) THEN                  ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) '   par_init: ice parameters shared among all the routines'
+         WRITE(numout,*) '   ~~~~~~~~'
+         WRITE(numout,*) '      Namelist nampar: '
+         WRITE(numout,*) '         number of ice  categories                           jpl       = ', jpl
+         WRITE(numout,*) '         number of ice  layers                               nlay_i    = ', nlay_i
+         WRITE(numout,*) '         number of snow layers                               nlay_s    = ', nlay_s
+         WRITE(numout,*) '         virtual ITD param for jpl=1 (T) or not (F)     ln_virtual_itd = ', ln_virtual_itd
+         WRITE(numout,*) '         Ice dynamics       (T) or not (F)                   ln_icedyn = ', ln_icedyn
+         WRITE(numout,*) '         Ice thermodynamics (T) or not (F)                   ln_icethd = ', ln_icethd
+         WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n
+         WRITE(numout,*) '         maximum ice concentration for SH                              = ', rn_amax_s
+      ENDIF
+      !                                        !--- change max ice concentration for roundoff errors
+      rn_amax_n = MIN( rn_amax_n, 1._wp - epsi10 )
+      rn_amax_s = MIN( rn_amax_s, 1._wp - epsi10 )
+      !                                        !--- check consistency
+      IF ( jpl > 1 .AND. ln_virtual_itd ) THEN
+         ln_virtual_itd = .FALSE.
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '   ln_virtual_itd forced to false as jpl>1, no need with multiple categories to emulate them'
+      ENDIF
+      !
+      IF( ln_cpl .AND. nn_cats_cpl /= 1 .AND. nn_cats_cpl /= jpl ) THEN
+         CALL ctl_stop( 'STOP', 'par_init: in coupled mode, nn_cats_cpl should be either 1 or jpl' )
+      ENDIF
+      !
+      rDt_ice   = REAL(nn_fsbc) * rn_Dt          !--- sea-ice timestep and its inverse
+      r1_Dt_ice = 1._wp / rDt_ice
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '      ice timestep rDt_ice = nn_fsbc*rn_Dt = ', rDt_ice
+      !
+      r1_nlay_i = 1._wp / REAL( nlay_i, wp )   !--- inverse of nlay_i and nlay_s
+      r1_nlay_s = 1._wp / REAL( nlay_s, wp )
+      !
+   END SUBROUTINE par_init
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option           Dummy module         NO SI3 sea-ice model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE ice_stp ( kt, ksbc )     ! Dummy routine
+      INTEGER, INTENT(in) ::   kt, ksbc
+      WRITE(*,*) 'ice_stp: You should not have seen this print! error?', kt
+   END SUBROUTINE ice_stp
+   SUBROUTINE ice_init                 ! Dummy routine
+   END SUBROUTINE ice_init
+#endif
+
+   !!======================================================================
+END MODULE icestp
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 14072)
@@ -30,5 +30,4 @@
    USE step_c1d       ! Time stepping loop for the 1D configuration
    !
-   USE prtctl         ! Print control
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distributed memory computing
@@ -47,7 +46,12 @@
    CHARACTER(lc) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
 
+#if defined key_mpp_mpi
+   ! need MPI_Wtime
+   INCLUDE 'mpif.h'
+#endif
+
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: nemogcm.F90 12489 2020-02-28 15:55:11Z davestorkey $
+   !! $Id: nemogcm.F90 13286 2020-07-09 15:48:29Z smasson $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -110,5 +114,5 @@
       !
 #if defined key_iomput
-                                    CALL xios_finalize  ! end mpp communications with xios
+      CALL xios_finalize  ! end mpp communications with xios
 #else
       IF( lk_mpp )                  CALL mppstop      ! end mpp communications
@@ -146,9 +150,9 @@
 #if defined key_iomput
       IF( Agrif_Root() ) THEN
-            CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios
+         CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios
       ENDIF
       CALL mpp_start( ilocal_comm )
 #else
-         CALL mpp_start( )
+      CALL mpp_start( )
 #endif
       !
@@ -163,16 +167,15 @@
       IF( lwm )   CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
       ! open reference and configuration namelist files
-                  CALL load_nml( numnam_ref,        'namelist_ref',                                           -1, lwm )
-                  CALL load_nml( numnam_cfg,        'namelist_cfg',                                           -1, lwm )
+      CALL load_nml( numnam_ref,        'namelist_ref',                                           -1, lwm )
+      CALL load_nml( numnam_cfg,        'namelist_cfg',                                           -1, lwm )
       IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
       ! open /dev/null file to be able to supress output write easily
       IF( Agrif_Root() ) THEN
-                  CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
+         CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
 #ifdef key_agrif
       ELSE
-                  numnul = Agrif_Parent(numnul)   
-#endif
-      ENDIF
-      !
+         numnul = Agrif_Parent(numnul)
+#endif
+      ENDIF
       !                             !--------------------!
       !                             ! Open listing units !  -> need sn_cfctl from namctl to define lwp
@@ -215,4 +218,12 @@
          WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
          WRITE(numout,*)
+
+         ! Print the working precision to ocean.output
+         IF (wp == dp) THEN
+            WRITE(numout,*) "Working precision = double-precision"
+         ELSE
+            WRITE(numout,*) "Working precision = single-precision"
+         ENDIF
+         WRITE(numout,*)
          !
          WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA
@@ -229,5 +240,5 @@
 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' )
       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 )
-904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )   
+904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
@@ -263,13 +274,19 @@
                            CALL     eos_init        ! Equation of state
       IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
-      !
-      
+
                            CALL  istate_init( Nbb, Nnn, Naa )    ! ocean initial state (Dynamics and tracers)
 
-      !                                      ! external forcing 
+      !                                      ! external forcing
                            CALL     sbc_init( Nbb, Nnn, Naa )    ! surface boundary conditions (including sea-ice)
+
+      !#LB:
+#if defined key_si3
+      IF(lwp) WRITE(numout,*) 'LOLO: nemo_init@nemogcm.F90: shape of fr_i ==>', SIZE(fr_i,1), SIZE(fr_i,2)
+      fr_i(:,:) = 0._wp
+#endif
+      !#LB.
 
       !
@@ -302,8 +319,8 @@
          WRITE(numout,*) '                              sn_cfctl%l_prttrc  = ', sn_cfctl%l_prttrc
          WRITE(numout,*) '                              sn_cfctl%l_oasout  = ', sn_cfctl%l_oasout
-         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin  
-         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax  
-         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr 
-         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr 
+         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin
+         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax
+         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr
+         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr
          WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing
          WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl
@@ -366,5 +383,5 @@
       !!----------------------------------------------------------------------
       !
-      ierr =        oce_alloc    ()    ! ocean 
+      ierr =        oce_alloc    ()    ! ocean
       ierr = ierr + dia_wri_alloc()
       ierr = ierr + dom_oce_alloc()    ! ocean domain
@@ -375,5 +392,5 @@
    END SUBROUTINE nemo_alloc
 
-   
+
    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto )
       !!----------------------------------------------------------------------
@@ -399,3 +416,2 @@
    !!======================================================================
 END MODULE nemogcm
-
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/sbcssm.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/sbcssm.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/sbcssm.F90	(revision 14072)
@@ -19,4 +19,9 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    !
+#if defined key_si3
+   USE ice            !#LB: we need to fill the "tm_su"   array!
+   USE sbc_ice        !#LB: we need to fill the "alb_ice" array!
+#endif
+   !
    USE in_out_manager ! I/O manager
    USE iom            ! I/O library
@@ -48,4 +53,9 @@
    INTEGER     ::   jf_e3t         ! index of first T level thickness
    INTEGER     ::   jf_frq         ! index of fraction of qsr absorbed in the 1st T level
+#if defined key_si3
+   INTEGER     ::   jf_ifr         ! index of sea-ice concentration !#LB
+   INTEGER     ::   jf_tic         ! index of sea-ice surface temperature !#LB
+   INTEGER     ::   jf_ial         ! index of sea-ice surface albedo !#LB
+#endif
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ssm_3d  ! structure of input fields (file information, fields read)
@@ -54,5 +64,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/SAS 4.0 , NEMO Consortium (2018)
-   !! $Id: sbcssm.F90 12615 2020-03-26 15:18:49Z laurent $
+   !! $Id: sbcssm.F90 13286 2020-07-09 15:48:29Z smasson $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -73,5 +83,5 @@
       ! (not needed for SAS but needed to keep a consistent interface in sbcmod.F90)
       !
-      INTEGER  ::   ji, jj     ! dummy loop indices
+      INTEGER  ::   ji, jj, jl ! dummy loop indices
       REAL(wp) ::   ztinta     ! ratio applied to after  records when doing time interpolation
       REAL(wp) ::   ztintb     ! ratio applied to before records when doing time interpolation
@@ -84,30 +94,29 @@
          IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d )      !==   read data at kt time step   ==!
          !
-         IF( ln_3d_uve ) THEN
-            IF( .NOT. ln_linssh ) THEN
-               e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor
-            ELSE
-               e3t_m(:,:) = e3t_0(:,:,1)                                 ! vertical scale factor
-            ENDIF
-            ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
-            ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity
-         ELSE
-            IF( .NOT. ln_linssh ) THEN
-               e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor
-            ELSE
-               e3t_m(:,:) = e3t_0(:,:,1)                                 ! vertical scale factor
-            ENDIF
-            ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
-            ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity
-         ENDIF
-         !
+         e3t_m(:,:) = e3t_0(:,:,1)                                 ! vertical scale factor
+         ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
+         ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity
+         !
+         !#LB:
+#if defined key_si3
+         !IF(lwp) WRITE(numout,*) 'LOLO: sbc_ssm()@sbcssm.F90 => fill "tm_su" and other fields at kt =', kt
+         !IF(lwp) WRITE(numout,*) 'LOLO: sbc_ssm()@sbcssm.F90 => shape of at_i ==>', SIZE(at_i,1), SIZE(at_i,2)
+         at_i (:,:) = sf_ssm_2d(jf_ifr)%fnow(:,:,1) * tmask(:,:,1)    ! sea-ice concentration [fraction]
+         tm_su(:,:) = sf_ssm_2d(jf_tic)%fnow(:,:,1) * tmask(:,:,1)    ! sea-ice surface temperature, read in [K] !#LB
+         sst_m(:,:) = sf_ssm_2d(jf_ial)%fnow(:,:,1) * tmask(:,:,1)    ! !!!sst_m AS TEMPORARY ARRAY !!! sea-ice albedo [fraction]
+         DO jl = 1, jpl
+            !IF(lwp) WRITE(numout,*) 'LOLO: sbc_ssm()@sbcssm.F90 => fill "t_su" for ice cat =', jl
+            a_i    (:,:,jl) = at_i (:,:)
+            a_i_b  (:,:,jl) = at_i (:,:)
+            t_su   (:,:,jl) = tm_su(:,:)
+            alb_ice(:,:,jl) = sst_m(:,:)
+         END DO
+         !IF(lwp) WRITE(numout,*) ''
+#endif
+         !#LB.
          sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1)    ! temperature
          sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1)    ! salinity
          ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height
-         IF( ln_read_frq ) THEN
-            frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! solar penetration
-         ELSE
-            frq_m(:,:) = 1._wp
-         ENDIF
+         frq_m(:,:) = 1._wp
       ELSE
          sss_m(:,:) = 35._wp                             ! =35. to obtain a physical value for the freezing point
@@ -116,5 +125,4 @@
          ssv_m(:,:) = 0._wp
          ssh_m(:,:) = 0._wp
-         IF( .NOT. ln_linssh ) e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D
          frq_m(:,:) = 1._wp                              !              - -
          ssh  (:,:,Kmm) = 0._wp                              !              - -
@@ -136,6 +144,4 @@
          CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m   - : ', mask1=vmask   )
          CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m   - : ', mask1=tmask   )
-         IF( .NOT.ln_linssh )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask   )
-         IF( ln_read_frq    )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask   )
       ENDIF
       !
@@ -146,6 +152,4 @@
          CALL iom_put( 'sss_m', sss_m )
          CALL iom_put( 'ssh_m', ssh_m )
-         IF( .NOT.ln_linssh )   CALL iom_put( 'e3t_m', e3t_m )
-         IF( ln_read_frq    )   CALL iom_put( 'frq_m', frq_m )
       ENDIF
       !
@@ -175,6 +179,9 @@
       TYPE(FLD_N) ::   sn_ssh, sn_e3t, sn_frq
       !!
+      TYPE(FLD_N) ::   sn_ifr, sn_tic, sn_ial
+      !!
       NAMELIST/namsbc_sas/ l_sasread, cn_dir, ln_3d_uve, ln_read_frq,   &
-         &                 sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq
+         &                 sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq, &
+         &                 sn_ifr, sn_tic, sn_ial
       !!----------------------------------------------------------------------
       !
@@ -196,6 +203,4 @@
          WRITE(numout,*) '   Namelist namsbc_sas'
          WRITE(numout,*) '      Initialisation using an input file                                 l_sasread   = ', l_sasread
-         WRITE(numout,*) '      Are we supplying a 3D u,v and e3 field                             ln_3d_uve   = ', ln_3d_uve
-         WRITE(numout,*) '      Are we reading frq (fraction of qsr absorbed in the 1st T level)   ln_read_frq = ', ln_read_frq
       ENDIF
       !
@@ -218,4 +223,8 @@
          IF( lwp ) WRITE(numout,*) '         ==>>>   No freshwater budget adjustment needed with StandAlone Surface scheme'
          nn_fwb = 0
+      ENDIF
+      IF( ln_closea ) THEN
+         IF( lwp ) WRITE(numout,*) '         ==>>>   No closed seas adjustment needed with StandAlone Surface scheme'
+         ln_closea = .false.
       ENDIF
 
@@ -230,18 +239,32 @@
          !! and the rest of the logic should still work
          !
-         jf_tem = 1   ;   jf_ssh = 3   ! default 2D fields index
-         jf_sal = 2   ;   jf_frq = 4   !
-         !
-         IF( ln_3d_uve ) THEN
-            jf_usp = 1   ;   jf_vsp = 2   ;   jf_e3t = 3     ! define 3D fields index
-            nfld_3d  = 2 + COUNT( (/.NOT.ln_linssh/) )       ! number of 3D fields to read
-            nfld_2d  = 3 + COUNT( (/ln_read_frq/) )          ! number of 2D fields to read
-         ELSE
-            jf_usp = 4   ;   jf_e3t = 6                      ! update 2D fields index
-            jf_vsp = 5   ;   jf_frq = 6 + COUNT( (/.NOT.ln_linssh/) )
-            !
-            nfld_3d  = 0                                     ! no 3D fields to read
-            nfld_2d  = 5 + COUNT( (/.NOT.ln_linssh/) ) + COUNT( (/ln_read_frq/) )    ! number of 2D fields to read
-         ENDIF
+         !#LB:
+         jf_tem = 1
+         jf_sal = 2
+         jf_ssh = 3
+         jf_usp = 4
+         jf_vsp = 5
+         !
+         nfld_3d  = 0
+         nfld_2d  = 5
+         !
+#if defined key_si3
+         jf_ifr = jf_vsp + 1
+         jf_tic = jf_vsp + 2
+         jf_ial = jf_vsp + 3
+         nfld_2d = nfld_2d + 3
+
+         !IF(lwp) WRITE(numout,*) 'LOLO: nfld_2d =', nfld_2d
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_tem =', jf_tem
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_sal =', jf_sal
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_ssh =', jf_ssh
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_usp =', jf_usp
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_vsp =', jf_vsp
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_ifr =', jf_ifr
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_tic =', jf_tic
+         !IF(lwp) WRITE(numout,*) 'LOLO: jf_ial =', jf_ial
+         !IF(lwp) WRITE(numout,*) ''
+#endif
+         !#LB.
          !
          IF( nfld_3d > 0 ) THEN
@@ -252,5 +275,4 @@
             slf_3d(jf_usp) = sn_usp
             slf_3d(jf_vsp) = sn_vsp
-            IF( .NOT.ln_linssh )   slf_3d(jf_e3t) = sn_e3t
          ENDIF
          !
@@ -261,10 +283,12 @@
             ENDIF
             slf_2d(jf_tem) = sn_tem   ;   slf_2d(jf_sal) = sn_sal   ;   slf_2d(jf_ssh) = sn_ssh
-            IF( ln_read_frq )   slf_2d(jf_frq) = sn_frq
-            IF( .NOT. ln_3d_uve ) THEN
-               slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp
-               IF( .NOT.ln_linssh )   slf_2d(jf_e3t) = sn_e3t
-            ENDIF
+            slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp
          ENDIF
+         !
+#if defined key_si3
+         slf_2d(jf_ifr) = sn_ifr   !#LB
+         slf_2d(jf_tic) = sn_tic   !#LB
+         slf_2d(jf_ial) = sn_ial   !#LB
+#endif
          !
          ierr1 = 0    ! default definition if slf_?d(ifpr)%ln_tint = .false.
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/step_c1d.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/step_c1d.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/step_c1d.F90	(revision 14072)
@@ -7,5 +7,5 @@
    !!             3.0  !  2008-04  (G. Madec)  redo the adaptation to include SBC
    !!             4.1  !  2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme
-   !!             4.1  !  2019-12  (L. Brodeau) STATION_ASF test-case
+   !!             4.x  !  2020-11  (L. Brodeau) STATION_ASF test-case
    !!----------------------------------------------------------------------
 #if defined key_c1d
@@ -22,9 +22,9 @@
    PRIVATE
 
-   PUBLIC stp_c1d   ! called by nemogcm.F90
+   PUBLIC stp_c1d      ! called by nemogcm.F90
 
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: step_c1d.F90 12377 2020-02-12 14:39:06Z acc $
+   !! $Id: step_c1d.F90 13802 2020-11-17 09:21:55Z gsamson $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -51,21 +51,18 @@
       !
       INTEGER ::   jk       ! dummy loop indice
-      INTEGER ::   indic    ! error indicator if < 0
       !! ---------------------------------------------------------------------
-
-      indic = 0                ! reset to no error condition
       IF( kstp == nit000 )   CALL iom_init( "nemo")   ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
       IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
-      CALL iom_setkt( kstp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp
+                             CALL iom_setkt( kstp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Update data, open boundaries, surface boundary condition (including sea-ice)
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      CALL sbc    ( kstp, Nbb, Nnn )  ! Sea Boundary Condition (including sea-ice)
+                         CALL sbc    ( kstp, Nbb, Nnn )  ! Sea Boundary Condition (including sea-ice)
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! diagnostics and outputs
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      CALL dia_wri( kstp, Nnn )  ! ocean model: outputs
+                         CALL dia_wri( kstp, Nnn )  ! ocean model: outputs
 
       ! Swap time levels
@@ -78,6 +75,5 @@
       ! Control and restarts
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      CALL stp_ctl( kstp, Nnn )
-
+                             CALL stp_ctl( kstp, Nnn )
       IF( kstp == nit000 )   CALL iom_close( numror )          ! close input  ocean restart file
       IF( lrst_oce       )   CALL rst_write( kstp, Nbb, Nnn )  ! write output ocean restart file
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 14072)
@@ -43,5 +43,5 @@
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE stp_ctl  ***
-      !!                     
+      !!
       !! ** Purpose :   Control the run
       !!
@@ -63,5 +63,5 @@
       INTEGER , DIMENSION(4)          ::   iareasum, iareamin, iareamax
       INTEGER , DIMENSION(3,3)        ::   iloc                                  ! min/max loc indices
-      REAL(wp)                        ::   zzz                                   ! local real 
+      REAL(wp)                        ::   zzz                                   ! local real
       REAL(wp), DIMENSION(4)          ::   zmax, zmaxlocal
       LOGICAL                         ::   ll_wrtstp, ll_colruns, ll_wrtruns, ll_0oce
@@ -72,5 +72,5 @@
       !
       ll_wrtstp  = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend )
-      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1 
+      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1
       ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm
       !
@@ -98,5 +98,5 @@
             istatus = NF90_ENDDEF(nrunid)
          ENDIF
-         !    
+         !
       ENDIF
       !
@@ -158,5 +158,5 @@
             IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid)
             ! get global loc on the min/max
-            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F 
+            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F
             CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk, zzz, iloc(1:2,2) )
             CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk, zzz, iloc(1:2,3) )
@@ -194,7 +194,9 @@
          CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file
          !
-         IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
-            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
-            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+         IF( ll_colruns .OR. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
+            IF(lwp) THEN
+               CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            ELSE
+               nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
             ENDIF
          ELSE                                    ! only mpi subdomains with errors are here -> STOP now
@@ -235,11 +237,11 @@
       !!----------------------------------------------------------------------
       WRITE(clkt , '(i9)') kt
-      
+
       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij  ,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9)
-      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
+!!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
       cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum
       WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9)
       cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1
-                                   WRITE(clmax, cl4) kmax-1
+      WRITE(clmax, cl4) kmax-1
       !
       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1      ! how many digits to we need to write jpiglo? (we decide max = 9)
@@ -257,5 +259,5 @@
       ELSE
          WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1      ! how many digits to we need to write jpk? (we decide max = 9)
-         !!! WRITE(clk, '(i'//clfmt//')') kloc(3)               ! this is creating a compilation error with AGRIF
+!!! WRITE(clk, '(i'//clfmt//')') kloc(3)               ! this is creating a compilation error with AGRIF
          cl4 = '(i'//clfmt//')'   ;   WRITE(clk, cl4) kloc(3)   ! this is ok with AGRIF
          WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj),    TRIM(clk), TRIM(clsuff)
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_hgr.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_hgr.F90	(revision 14072)
@@ -12,6 +12,7 @@
 
    !!----------------------------------------------------------------------
-   !!   usr_def_hgr   : initialize the horizontal mesh 
+   !!   usr_def_hgr   : initialize the horizontal mesh
    !!----------------------------------------------------------------------
+   USE dom_oce  , ONLY: nimpp, njmpp       ! ocean space and time domain
    USE c1d      ,  ONLY: rn_lon1d, rn_lat1d ! ocean lon/lat define by namelist
    USE par_oce        ! ocean space and time domain
@@ -21,5 +22,5 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   
+
    IMPLICIT NONE
    PRIVATE
@@ -29,5 +30,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: usrdef_hgr.F90 12489 2020-02-28 15:55:11Z davestorkey $ 
+   !! $Id: usrdef_hgr.F90 13216 2020-07-02 09:25:49Z rblod $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -48,9 +49,9 @@
       !!
       !!                Here STATION_ASF configuration :
-      !!          Rectangular 3x3 domain 
+      !!          Rectangular 3x3 domain
       !!          - Located at 150E-50N
-      !!          - a constant horizontal resolution  
+      !!          - a constant horizontal resolution
       !!
-      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees) 
+      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees)
       !!              - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane)
       !!              - define i- & j-scale factors at t-, u-, v- and f-points (in meters)
@@ -63,5 +64,5 @@
       REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors                             [m]
       REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors                             [m]
-      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise 
+      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise
       REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2]
       !
@@ -77,5 +78,5 @@
       !                       ! longitude
       plamt(:,:) = rn_lon1d
-      plamu(:,:) = rn_lon1d 
+      plamu(:,:) = rn_lon1d
       plamv(:,:) = rn_lon1d
       plamf(:,:) = rn_lon1d
@@ -93,5 +94,5 @@
       pe1f(:,:) = 100.  ;   pe2f(:,:) = 100.
       !
-      !                                         ! NO reduction of grid size in some straits 
+      !                                         ! NO reduction of grid size in some straits
       ke1e2u_v = 0                              !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
       pe1e2u(:,:) = 0._wp                       !    CAUTION: set to zero to avoid error with some compilers that
@@ -100,7 +101,7 @@
       !
       !                       !==  Coriolis parameter  ==!
-      zf0   = 2._wp * omega * SIN( rad * rn_lat1d )      
+      zf0   = 2._wp * omega * SIN( rad * rn_lat1d )
       pff_f(:,:) = zf0
-      pff_t(:,:) = zf0      
+      pff_t(:,:) = zf0
       kff = 1                 !  indicate to skip computing Coriolis parameter afterward
       !
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_nam.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_nam.F90	(revision 14072)
@@ -13,6 +13,7 @@
    !!----------------------------------------------------------------------
    !!   usr_def_nam   : read user defined namelist and set global domain size
-   !!   usr_def_hgr   : initialize the horizontal mesh 
+   !!   usr_def_hgr   : initialize the horizontal mesh
    !!----------------------------------------------------------------------
+   USE dom_oce  , ONLY: nimpp, njmpp       ! ocean space and time domain
    USE par_oce        ! ocean space and time domain
    USE phycst         ! physical constants
@@ -20,5 +21,5 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   
+
    IMPLICIT NONE
    PRIVATE
@@ -31,5 +32,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: usrdef_nam.F90 12377 2020-02-12 14:39:06Z acc $ 
+   !! $Id: usrdef_nam.F90 13216 2020-07-02 09:25:49Z rblod $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -39,5 +40,5 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE dom_nam  ***
-      !!                    
+      !!
       !! ** Purpose :   read user defined namelist and define the domain size
       !!
@@ -50,6 +51,6 @@
       CHARACTER(len=*), INTENT(out) ::   cd_cfg          ! configuration name
       INTEGER         , INTENT(out) ::   kk_cfg          ! configuration resolution
-      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes 
-      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c. 
+      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
+      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c.
       !
       INTEGER ::   ios   ! Local integer
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_zgr.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_zgr.F90	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/usrdef_zgr.F90	(revision 14072)
@@ -13,5 +13,5 @@
    !!----------------------------------------------------------------------
    !!   usr_def_zgr   : user defined vertical coordinate system
-   !!      zgr_z      : reference 1D z-coordinate 
+   !!      zgr_z      : reference 1D z-coordinate
    !!      zgr_top_bot: ocean top and bottom level indices
    !!      zgr_zco    : 3D verticl coordinate in pure z-coordinate case
@@ -31,5 +31,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: usrdef_zgr.F90 12377 2020-02-12 14:39:06Z acc $
+   !! $Id: usrdef_zgr.F90 13226 2020-07-02 14:24:31Z orioltp $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -54,5 +54,5 @@
       REAL(wp), DIMENSION(:,:,:), INTENT(out) ::   pdept, pdepw                ! grid-point depth        [m]
       REAL(wp), DIMENSION(:,:,:), INTENT(out) ::   pe3t , pe3u , pe3v , pe3f   ! vertical scale factors  [m]
-      REAL(wp), DIMENSION(:,:,:), INTENT(out) ::   pe3w , pe3uw, pe3vw         ! i-scale factors 
+      REAL(wp), DIMENSION(:,:,:), INTENT(out) ::   pe3w , pe3uw, pe3vw         ! i-scale factors
       INTEGER , DIMENSION(:,:)  , INTENT(out) ::   k_top, k_bot                ! first & last ocean level
       !!----------------------------------------------------------------------
@@ -85,5 +85,5 @@
       pe3uw(:,:,1) = rn_dept1  ! LB???
       pe3vw(:,:,1) = rn_dept1  ! LB???
-      
+
       !! 2nd level, technically useless (only for the sake of code stability)
       pdept_1d(2) = 3._wp*rn_dept1
Index: /NEMO/trunk/tests/STATION_ASF/README.md
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/README.md	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/README.md	(revision 14072)
@@ -1,21 +1,17 @@
 # *Station Air-Sea Fluxes* demonstration case
 
-Last successful test done with NEMOGCM trunk: `r13263`
+Last successful test done with NEMOGCM branch: `NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice`, revision `13806`
 
 Author: Laurent Brodeau, 2020
 
-NOTE: if working with the trunk of NEMO, you are strongly advised to use the same test-case but on the `NEMO-examples` GitHub depo:
-https://github.com/NEMO-ocean/NEMO-examples/tree/master/STATION_ASF
-
 ## Objectives
 
-```STATION_ASF``` is a demonstration test-case that mimics a (static) in-situ station (buoy, platform) dedicated to the estimation of surface air-sea fluxes by means of *widely-measured* (bulk) meteorological surface parameters.
-
-```STATION_ASF``` has been constructed by merging the *single column* and the *standalone surface module* configurations of NEMO. In short, it can be defined as "SAS meets C1D". As such, the spatial domain of ```STATION_ASF``` is punctual (1D, well actually 3 x 3 as in C1D).
-
-```STATION_ASF``` is therefore a versatile tool, and extremely lightweight in terms of computing requirements, to test the different bulk algorithms and cool-skin/warm-layer parameterization options included in NEMO.
-
-As input ```STATION_ASF``` will require the traditional *bulk* sea surface parameters:
-
+`STATION_ASF` is a demonstration test-case that mimics a (static) in-situ station (buoy, platform) dedicated to the estimation of surface air-sea fluxes by means of *widely-measured* (bulk) meteorological surface parameters.
+
+`STATION_ASF` has been constructed by merging the *single column* and the *standalone surface module* configurations of NEMO. In short, it can be defined as "SAS meets C1D". As such, the spatial domain of `STATION_ASF` is punctual (1D, well actually 3 x 3 as in C1D).
+
+`STATION_ASF` is therefore a versatile tool, and extremely lightweight in terms of computing requirements, to test the different bulk algorithms and cool-skin/warm-layer parameterization options included in NEMO.
+
+As input `STATION_ASF` will require the traditional *bulk* sea surface parameters:
 - Bulk sea surface temperature (SST) at _z<sub>SST</sub>_ meters below the surface
 - Surface current vector
@@ -23,5 +19,4 @@
 
 as well as the usual surface atmospheric state:
-
 - air temperature at _z<sub>t</sub>_ meters above the surface
 - air humidity  at _z<sub>t</sub>_ meters above the surface (specific humidity or relative humidity or dew-point temperature)
@@ -31,5 +26,6 @@
 - Downwelling longwave radiation
 
-### Example of diagnostics from `STATION_ASF`
+
+### Example of diagnostics with `STATION_ASF`
 
 (Generated with script `./EXPREF/plot_station_asf_simple.py`)
@@ -46,5 +42,5 @@
 ## Physical description
 
-### Important namelist parameters specific to STATION_ASF
+### Important namelist parameters specific to `STATION_ASF`
 
 * ```rn_dept1@namusr_def:``` depth (m) at which the prescribed SST is taken (*i.e.* depth of first T-point); important due to impact on warm-layer estimate, the deeper, the more pronounced!
@@ -58,9 +54,93 @@
 
 
-## Input files to test STATION ASF
-
-One full year (2018) of processed hourly data from the PAPA station (buoy) is found into the `input_data` directory.
-These three files are everything you need to play with the set of *namelists* provided for this test-case.
-
+## Testing the sanity of the SBCBLK (bulk atmospheric forcing) interface of NEMO
+
+`STATION_ASF` can be used to perform a sanity test of the SBCBLK interface of
+NEMO.  It will test all the bulk-parameterization algorithms using an idealized
+forcing that includes a wide range of *SSX / surface atmospheric state*
+conditions to detect potential error / inconsistencies.  Both a short report and
+boolean output: *passed* or *failed* is provided as an output.
+
+
+### How is the validation test performed ?
+
+Turbulent fluxes and transfer coefficients computed by NEMO with all different bulk parameterizations (via `STATION_ASF`), in all these idealized possible air-sea meteorological states, must be checked against a *supposedly trustable* reference solution, plus/minus a tolerance range not to deviate from (to allow the deviation from the reference inherent to each tested bulk parameterization). This reference solution, and this tolerance, are constructed independently and outside of NEMO. They are based on the mean, and twice the standard deviation, respectively, across all the members (1 member = 1 bulk parameterizations, N=5). This reference solution and tolerance range, just as the idealized input atmospheric and sea-surface forcings, are provided in the same NetCDF file:
+`STATION_ASF/input_data/input_output_VALIDATION_IDEALIZED.nc`
+
+
+### Performing the sanity test
+
+First compile the `STATION_ASF` test-case as follows (compile with xios-2.5 support → check your ARCH file):
+
+```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4```
+
+(successful compilation generates ```tests/STATION_ASF2/BLD/bin/nemo.exe```
+
+Move to: ```tests/STATION_ASF/SANITY_CHECK/```
+
+There, in script ``sanity_check_SBCBLK.sh``, double check that the variables given a value in the first lines are consistent with your setup (it should).
+
+Launch the script:
+
+    $ ./sanity_check_SBCBLK.sh
+
+
+The report is both interactively shown in the standard output and spawned in the report file:
+
+- `SBCBLK.success` the test passed :)
+- `SBCBLK.fail` the test failed :(
+
+In case of failure, read the rapport to know which algorithm/computed variables did not pass the test... You should also re-run the script `sanity_check_SBCBLK.sh` with the "more" argument:
+
+    $ ./sanity_check_SBCBLK.sh more
+
+ This will generate more output such as figure of time series for the tested variables.
+
+### Dependencies
+
+In order for the python script `analyze_output.py` to work, you need `Python 3` with the following modules:
+- NumPy
+- netCDF4
+- (Matplotlib)
+
+### Example of the report for a successful test
+
+
+    ############ FINAL REPORT ############
+
+     ***** Algorithm "ECMWF" PASSED sanity check !!!
+
+     ***** Algorithm "NCAR" PASSED sanity check !!!
+
+     ***** Algorithm "COARE3p0" PASSED sanity check !!!
+
+     ***** Algorithm "COARE3p6" PASSED sanity check !!!
+
+     ***** Algorithm "ANDREAS" PASSED sanity check !!!
+
+     Test performed on the following NEMO prognostic variables:
+      ==> qsb_oce, qla_oce, qlw_oce, taum, Cd_oce, Ce_oce
+
+       ####################################
+       ###    TEST PASSED FOR SBCBLK !  ###
+       ####################################
+
+
+
+## Playing with `STATION_ASF`
+
+
+### Input forcing files to test STATION ASF
+
+By default, `STATION_ASF` comes with two forcing sets:
+
+* The `PAPA` forcing is an "open-ocean-only" hourly forcing, that corresponds to a real off-shore platform, the PAPA station (North-East Pacific, 50°N, 145°W). Hence the data provided for the PAPA test is actual data measured by the PAPA station.
+
+* The `ERA5_NorthGreenland` forcing simulates a *virtual station* as it is extracted from the ECMWF ERA5 reanalysis right north of Greenland (84°N,36°W). This forcing is also hourly and allows for `STATION_ASF` to be used with sea-ice support as this particular location is ice-covered year-round.
+
+
+#### `PAPA` forcing
+
+One full year (2018) of processed hourly data from the PAPA station (buoy) are found in the 3 following files (found in `tests/STATION_ASF/input_data`):
 - ```Station_PAPA_50N-145W_atm_hourly_y2018.nc```  → contains hourly surface atmospheric state
 - ```Station_PAPA_50N-145W_precip_daily_y2018.nc``` → contains daily precipitation
@@ -69,43 +149,108 @@
 For station PAPA (50.1 N, 144.9 W), air temperature and humidity are measured at 2.5 m, the wind speed at 4 m, and the SST at 1 m below the surface, hence the following namelist parameters are given:
 
-- `&namusr_def`
-  - ```rn_dept1 =    1.  ```
-- `&namc1d`
-  - ```rn_lat1d =  50.1 ```
-  - ```rn_lon1d = 215.1```
-- `&namsbc_blk`
-  - ```rn_zqt   =   2.5```
-  - ```rn_zu    =    4.```
-
-
-
-## Playing with STATION_ASF
+    ...
+    &namusr_def
+        rn_dept1 =    1. 
+    ...
+    &namc1d
+        rn_lat1d =  50.1 
+        rn_lon1d = 215.1
+    ...
+    &namsbc_blk
+        ...
+        rn_zqt = 2.5
+        rn_zu  = 4.
+        ...
+        ln_humi_rlh = .true.  !  humidity in PAPA data is relative humidity  [%]
+        ...
+
+The namelists for the `PAPA` forcing are located into `EXPREF/PAPA/oce/`
+
+
+
+#### `ERA5_NorthGreenland` forcing
+
+The entire forcing is found in one single file: `ERA5_NorthGreenland_surface_84N_-36E_1h_y2018.nc`.
+Since we are dealing with a reanalysis of the ECMWF:
+
+    ...
+    &namusr_def
+        rn_dept1 = 1. ! we assume ECMWF uses a prescribed bulk SST product at the standard depth of 1m...
+    ...
+    &namc1d
+        rn_lat1d =  84. 
+        rn_lon1d = 324.
+    ...
+    &namsbc_blk
+        ...
+        rn_zqt =  2.
+        rn_zu  = 10.
+        ...
+        ln_humi_dpt = .true.  !  humidity in ERA5 is dew-point temperature [K]
+        ...
+
+The namelists for the `ERA5_NorthGreenland` forcing are located into `ERA5/oce+ice/` or `ERA5/oce`, depending whether you want to use sea-ice support or not.
+
+
+
+### Compiling and launching STATION_ASF simulations
 
 First compile the test-case as follows (compile with xios-2.5 support → check your ARCH file):
 
-```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4```
-
-Then you can use the script ``launch_sasf.sh`` found in  ```EXPREF/``` to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script:
-
-- ```NEMO_ROOT_DIR``` : NEMO root directory where to fetch compiled STATION_ASF ```nemo.exe``` + setup (such as ```${NEMO_ROOT_DIR}/tests/STATION_ASF```)
-
-- ```PROD_DIR``` :  Directory where to run the simulation
-
-- ```DATA_IN_DIR``` : Directory containing sea-surface + atmospheric forcings (found here in ```input_data/```)
-
-If everything goes according to plan, ``launch_sasf.sh`` should have generated the 3 following sets of output files into `${PROD_DIR}/output`:
-
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridT.nc
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridV.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridT.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridV.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridT.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridV.nc
+    $ ./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4
+
+Move to `tests/STATION_ASF/EXPREF/`, there, you can use the script ``launch_sasf.sh`` to launch `STATION_ASF` simulations. You need to adapt the following variable to your environment in the script:
+
+- ```CONFIG_BLD``` : the name of the sub-directory of `tests/` in which `STATION_ASF` has been compiled (default: `CONFIG_BLD="STATION_ASF2"`)
+
+- ```FORCING``` : this is where you pick the forcing you want to use, and wether to use sea-ice support or not (only available for `ERA5_NorthGreenland` forcing)
+
+- ```PROD_DIR``` :  Directory in which the simulation will be installed and run
+
+- ```MPI_LAUNCH```: this is where you can adapt how the `nemo.exe` executable is launched on your system (default: `MPI_LAUNCH="mpirun -n 1"`)
+
+
+Now, it's time to launch simulations: 
+
+    $ ./launch_sasf.sh
+
+If everything goes according to plan, ``launch_sasf.sh`` should have generated the 4 following output files into `${PROD_DIR}/output` (example for PAPA forcing, 4 algos tested):
+
+    STATION_ASF-ANDREAS_PAPA_1h_20180101_20181231_gridT.nc
+    STATION_ASF-COARE3p6_PAPA_1h_20180101_20181231_gridT.nc
+    STATION_ASF-ECMWF_PAPA_1h_20180101_20181231_gridT.nc
+    STATION_ASF-NCAR_PAPA_1h_20180101_20181231_gridT.nc
+
+
+#### Post-processing and figures
+
+Use the `plot_station_asf_OCE.py` script (Python 3) to generate a multitude of figures that compares the *open ocean* transfer coefficients and fluxes between the 4 algorithms, in our case with the `PAPA` forcing:
+
+    $ ./plot_station_asf_OCE.py -d <PROD_DIR> -f PAPA
+
+Example of a comparison plot:
+![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Cd_PAPA_open-ocean.svg)
+
+If you have used a forcing with sea-ice support, such as `ERA5_NorthGreenland`, you can do the same for *sea-ice* transfer coefficients and fluxes, which will compare *air-ice* bulk algorithms:
+
+    $ ./plot_station_asf_ICE.py -d <PROD_DIR> -f ERA5_NorthGreenland
+
+Example of a comparison plot:
+![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Cd_ERA5_NorthGreenland_sea-ice.svg)
+Note: when sea-ice support is enabled, typically by using the following `FORCING` configuration in script `launch_sasf.sh`:
+
+    FORCING="ERA5_NorthGreenland" ; i_sea_ice=1 ; SFORC="ERA5_NorthGreenland_surface_84N_-36E_1h"
+    
+the fact that `i_sea_ice=1` trigers the computation of *air-ice* fluxes with different bulk *air-ice* algorithms, over the remaining open-ocean fraction the same *air-sea* algorithm is used: `ECMWF`.
+
+
+-----------------------
+
+#### TO FINISH, BROKEN !!!
+
+Then, you can fire the Jupyter notebook [`station_asf_notebook.ipynb`](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/notebook/station_asf_notebook.ipynb) found into the `notebook` directory! In which you should update `cprod_dir` to the same path as `PROD_DIR` of `launch_sasf.sh`...
 
 ---
 
-*/Laurent, July 2020.*
-
+*/Laurent, November 2020.*
+
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_andreas_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_andreas_cfg	(revision 14072)
@@ -0,0 +1,274 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!
+!!             STATION_ASF configuration, IDEALIZED forcing
+!!                   ==> meant to be used with forcing from file:
+!!                       "input_output_VALIDATION_IDEALIZED.nc"
+!!
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ANDREAS_IDEALIZED'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =       104  !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20200101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    104
+   nn_write    =    104
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .true.     ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'u10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'v10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_sw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_lw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  't_air'  ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rh_air' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'precip' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'snow'   ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'slp'    ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssu'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssv'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sst'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sss',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssh',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p0_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p0_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p0_cfg	(revision 14072)
@@ -0,0 +1,274 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!
+!!             STATION_ASF configuration, IDEALIZED forcing
+!!                   ==> meant to be used with forcing from file:
+!!                       "input_output_VALIDATION_IDEALIZED.nc"
+!!
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-COARE3p0_IDEALIZED'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =       104  !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20200101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    104
+   nn_write    =    104
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                    !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .true.     ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .true.  !  use the cool-skin parameterization
+      ln_skin_wl   = .true.  !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'u10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'v10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_sw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_lw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  't_air'  ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rh_air' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'precip' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'snow'   ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'slp'    ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssu'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssv'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sst'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sss',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssh',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p6_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_coare3p6_cfg	(revision 14072)
@@ -0,0 +1,274 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!
+!!             STATION_ASF configuration, IDEALIZED forcing
+!!                   ==> meant to be used with forcing from file:
+!!                       "input_output_VALIDATION_IDEALIZED.nc"
+!!
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-COARE3p6_IDEALIZED'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =       104  !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20200101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    104
+   nn_write    =    104
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                    !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .true.     ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .true.  !  use the cool-skin parameterization
+      ln_skin_wl   = .true.  !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'u10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'v10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_sw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_lw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  't_air'  ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rh_air' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'precip' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'snow'   ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'slp'    ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssu'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssv'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sst'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sss',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssh',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ecmwf_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ecmwf_cfg	(revision 14072)
@@ -0,0 +1,274 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!
+!!             STATION_ASF configuration, IDEALIZED forcing
+!!                   ==> meant to be used with forcing from file:
+!!                       "input_output_VALIDATION_IDEALIZED.nc"
+!!
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-ECMWF_IDEALIZED'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =       104  !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20200101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    104
+   nn_write    =    104
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                    !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .false.    ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .true.     ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .true.  !  use the cool-skin parameterization
+      ln_skin_wl   = .true.  !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'u10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'v10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_sw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_lw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  't_air'  ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rh_air' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'precip' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'snow'   ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'slp'    ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssu'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssv'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sst'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sss',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssh',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ncar_cfg	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/IDEALIZED/oce/namelist_ncar_cfg	(revision 14072)
@@ -0,0 +1,274 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!!
+!!             STATION_ASF configuration, IDEALIZED forcing
+!!                   ==> meant to be used with forcing from file:
+!!                       "input_output_VALIDATION_IDEALIZED.nc"
+!!
+!!======================================================================
+!!              ***  Domain & Run management namelists  ***           !!
+!!                                                                    !!
+!!   namrun       parameters of the run
+!!   namdom       space and time domain
+!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
+!!   namwad       Wetting and drying                                    (default: OFF)
+!!   namtsd       data: temperature & salinity                          (default: OFF)
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
+!!   namc1d       1D configuration options                              ("key_c1d")
+!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
+!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namusr_def    !   STATION_ASF user defined namelist
+!-----------------------------------------------------------------------
+   rn_dept1    =  1.0   ! depth (m) at which the prescribed SST is taken  == depth of first T point! (IMPORTANT for warm-layer impact, the deeper, the more pronounced!)
+   !                    ! [PAPA station = 1 m]
+/
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp      =  'STATION_ASF-NCAR_IDEALIZED'  !  experience name
+   nn_it000    =    1   !  first time step
+   nn_itend    =       104  !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20200101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
+   !
+   nn_stock    =    104
+   nn_write    =    104
+/
+!-----------------------------------------------------------------------
+&namdom        !   time and space domain / STATION_ASF
+!-----------------------------------------------------------------------
+   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   rn_Dt       =  3600.    !  time step for the dynamics and tracer => frequency of atmospheric forcing
+   ln_meshmask = .false.
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options / STATION_ASF               ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+   rn_lat1d    =      50.1 !  Column latitude    [PAPA station]
+   rn_lon1d    =    215.1  !  Column longitude   [PAPA station]
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+   !                       !  =T read U-V fields for:
+   ln_uvd_init   = .false.       !  ocean initialisation
+   ln_uvd_dyndmp = .false.       !  U-V restoring
+
+   cn_dir      = './'      !  root directory for the U-V data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_ucur     = 'ucurrent'              ,         -1.       ,'u_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Ume'   , ''
+   sn_vcur     = 'vcurrent'              ,         -1.       ,'v_current',   .false.   , .true. , 'monthly' ,  ''              ,  'Vme'   , ''
+/
+
+!!======================================================================
+!!            ***  Surface Boundary Condition namelists  ***          !!
+!!                                                                    !!
+!!                           STATION_ASF test-case                         !!
+!!                                                                    !!
+!!   namsbc          surface boundary condition manager                 (default: NO selection)
+!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
+!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
+!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
+!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
+!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
+!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
+!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
+!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
+!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
+!!   namberg         iceberg floats                                     (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
+!-----------------------------------------------------------------------
+   nn_fsbc     = 1         !!LOLO!  frequency of SBC module call
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+   !
+   nn_ice      = 0  !LOLO  !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
+   !    
+   ln_dm2dc    = .false.   !#lolo  daily mean to diurnal cycle on short wave
+/
+!-----------------------------------------------------------------------
+&namsbc_blk    !   namsbc_blk  generic Bulk formula / STATION_ASF       (ln_blk =T)
+!-----------------------------------------------------------------------
+   !                    !  bulk algorithm :
+   ln_NCAR      = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0 = .false.    ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p6 = .false.    ! "COARE 3.6" algorithm   (Edson et al. 2013)
+   ln_ECMWF     = .false.    ! "ECMWF"     algorithm   (IFS cycle 45r1)
+   ln_ANDREAS   = .false.    ! "ANDREAS"   algorithm   (Andreas et al. 2015)
+      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
+      rn_zu        = 10.     !  Wind vector reference height (m)
+      nn_iter_algo = 20      !  Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+      ln_skin_cs   = .false. !  use the cool-skin parameterization
+      ln_skin_wl   = .false. !  use the warm-layer parameterization
+   !
+   ln_humi_sph = .false. !  humidity "sn_humi" is specific humidity  [kg/kg]
+   ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
+   ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+   !
+   cn_dir      = './'      !  root directory for the bulk data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
+   sn_wndi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'u10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_wndj     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'v10'    ,   .false.   , .true.  , 'yearly'  , ''   ,''   , ''
+   sn_qsr      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_sw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_qlw      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rad_lw' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_tair     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  't_air'  ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_humi     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'rh_air' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_prec     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'precip' ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_snow     = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'snow'   ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+   sn_slp      = 'input_output_VALIDATION_IDEALIZED',  1.  ,  'slp'    ,   .false.   , .true.  , 'yearly'  , ''  , ''   , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface boundary condition / STATION_ASF
+!-----------------------------------------------------------------------
+   l_sasread   = .true.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
+   !
+   cn_dir      = './'      !  root directory for the ocean data location
+   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
+   sn_usp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssu'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_vsp  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssv'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_tem  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sst'     ,   .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_sal  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'sss',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   sn_ssh  = 'input_output_VALIDATION_IDEALIZED', 1.         , 'ssh',        .false.   , .true.  , 'yearly'  ,    ''            ,    ''    ,    ''
+   !!
+/
+!!======================================================================
+!!               ***  Lateral boundary condition  ***                 !!
+!!                                                                    !!
+!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
+!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
+!!   nam_tide      Tidal forcing                                        (default: OFF)
+!!   nambdy        Unstructured open boundaries                         (default: OFF)
+!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
+!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  free slip
+/
+!!======================================================================
+!!                ***  Top/Bottom boundary condition  ***             !!
+!!                                                                    !!
+!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
+!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
+!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
+!!   nambbc        bottom temperature boundary condition                (default: OFF)
+!!   nambbl        bottom boundary layer scheme                         (default: OFF)
+!!======================================================================
+!
+!!======================================================================
+!!                        Tracer (T-S) namelists                      !!
+!!                                                                    !!
+!!   nameos        equation of state                                    (default: NO selection)
+!!   namtra_adv    advection scheme                                     (default: NO selection)
+!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
+!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
+!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
+!-----------------------------------------------------------------------
+   ln_eos80    = .true.         !  = Use EOS80
+/
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
+!!                                                                    !!
+!!   nam_vvl       vertical coordinate options                          (default: z-star)
+!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
+!!   namdyn_vor    advection scheme                                     (default: NO selection)
+!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
+!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
+!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
+!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
+!!======================================================================
+!
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!                                                                    !!
+!!    namzdf        vertical physics manager                            (default: NO selection)
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
+!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Diagnostics namelists  ***                   !!
+!!                                                                    !!
+!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
+!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
+!!   namhsb       Heat and salt budgets                                 (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namdiu       Cool skin and warm layer models                       (default: OFF)
+!!   namflo       float parameters                                      (default: OFF)
+!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
+!!   nam_diadct   transports through some sections                      (default: OFF)
+!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
+!!   nam_dia25h   25h Mean Output                                       (default: OFF)
+!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
+!!======================================================================
+!
+!!======================================================================
+!!               ***  Observation & Assimilation  ***                 !!
+!!                                                                    !!
+!!   namobs       observation and model comparison                      (default: OFF)
+!!   nam_asminc   assimilation increments                               ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***                 !!
+!!                                                                    !!
+!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
+!!   namctl            Control prints                                   (default: OFF)
+!!   namsto            Stochastic parametrization of EOS                (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints                                       (default: OFF)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
+!-----------------------------------------------------------------------
+/
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/analyze_output.py
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/analyze_output.py	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/analyze_output.py	(revision 14072)
@@ -0,0 +1,272 @@
+#!/usr/bin/env python3
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+#######################################################################################
+# This script analyzes the output of STATION_ASF test-case with IDEALIZED forcing
+# in order to test the validity of computed fluxes and bulk transfer coefficient.
+# Beside an explicit standard output message, a result file is spawned:
+#    * SBCBLK.success => the test passed !
+#    * SBCBLK.fail    => the test failed !
+#
+#   Brodeau, 2020
+#
+########################################################################################
+
+import sys
+from os import path as path
+import math
+import numpy as nmp
+from netCDF4 import Dataset
+
+l_t_shift = False  ; # because time interp. is set to FALSE into "&namsbc_blk" of NEMO...
+#                    #  ==> so time array is shifted by 30 minutes but fluxes are the same (persitence of input fields ???)
+
+l_alg = [ 'ECMWF' , 'NCAR' , 'COARE3p0', 'COARE3p6', 'ANDREAS' ]
+nb_alg     =    len(l_alg)
+
+
+# Variables to check:
+l_var_rf = [  'Qsen'   ,   'Qlat'   ,  'Qlw'   ,   'Tau',   'Cd'  ,   'Ce'   ] ; # In forcing file "IDEALIZED/input_output_VALIDATION_IDEALIZED.nc"
+l_var_ot = [ 'qsb_oce' , 'qla_oce'  , 'qlw_oce',  'taum', 'Cd_oce', 'Ce_oce' ] ; # names in the NEMO/STATION_ASF output file (check file_def_oce.xml)
+nb_var  = len(l_var_rf)
+
+dir_figs='.'
+size_fig=(13,8)
+#fig_ext='png'
+fig_ext='svg'
+
+
+rDPI=100.
+
+
+class fclrs:
+    OKGR = '\033[92m'
+    FAIL = '\033[91m'
+    ENDC = '\033[0m'
+
+
+
+# Getting arguments:
+narg = len(sys.argv)
+if not narg in [3,4]:
+    print('Usage: '+sys.argv[0]+' <forcing_+_validation_file> <NEMO-STATION_ASF_output_directory> (<m> for more/debug)'); sys.exit(0)
+cf_rf = sys.argv[1]
+cdir_out = sys.argv[2]
+l_more = False
+if narg==4:
+    l_more = ( sys.argv[3] in ['m','M'] )
+    import matplotlib as mpl
+    mpl.use('Agg')
+    import matplotlib.pyplot as plt
+
+
+
+    
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+# Populating and checking existence of files to be read
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+def chck4f(cf):
+    cmesg = 'ERROR: File '+cf+' does not exist !!!'
+    if not path.exists(cf): print(cmesg) ; sys.exit(0)
+
+print('\n')
+
+# Input forcing/valid file:
+chck4f(cf_rf)
+id_rf = Dataset(cf_rf)
+vt = id_rf.variables['time'][:]
+cunit_t = id_rf.variables['time'].units
+id_rf.close()
+Nt_rf = len(vt)
+vtime_rf = nmp.zeros(Nt_rf); vtime_rf[:]  = vt[:]
+del vt
+print(' *** in forcing/valid file, "time" is in "'+cunit_t+'", Nt = '+str(Nt_rf)+'\n')
+
+
+# STATION_ASF output files (1 file per algorithm):
+cf_nemo = []
+for ja in range(nb_alg):
+    cfi = cdir_out+'/STATION_ASF-'+l_alg[ja]+'_IDEALIZED_1h_20200101_20200105_gridT.nc'
+    chck4f(cfi)
+    cf_nemo.append(cfi)
+print('\n *** NEMO/STATION_ASF output files we are goin to check:')
+for ja in range(nb_alg): print(cf_nemo[ja])
+print('\n')
+#-----------------------------------------------------------------
+
+# Getting time array from the first file:
+id_nm = Dataset(cf_nemo[0])
+vt = id_nm.variables['time_counter'][:]
+cunit_t = id_nm.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"')
+id_nm.close()
+Nt = len(vt)
+vtime_nm = nmp.zeros(Nt); vtime_nm[:]  = vt[:]
+del vt
+
+if Nt != Nt_rf-1: print('ERROR: the two files do not agree in terms of record lengrth: '+Nt_rf-1+' vs '+Nt)
+
+print('\n *** Excellent! We are going to look at surface fluxes under '+str(Nt)+' different scenarios of air-sea stability/wind-speed conditions...\n')
+
+# 30 minute shift, just like NEMO
+vtime = nmp.zeros(Nt)
+if l_t_shift:
+    vtime[:] = 0.5*(vtime_rf[:-1] + vtime_rf[1:])
+else:
+     vtime[:] =     vtime_rf[:-1]
+# Debug:
+#for jt in range(3):
+#    print(' Ref.  , Nemo "', vtime_rf[jt], vtime_nm[jt], vtime[jt])
+#sys.exit(0)
+
+
+
+
+##
+IREPORT = nmp.zeros((nb_alg,nb_var), dtype=int)
+
+
+
+
+# Loop on the fields to control...
+###################################
+
+jv=0
+for cv in l_var_rf:
+    cv_rf_m = cv+'_mean'
+    cv_rf_t = cv+'_tol'
+    cv_nemo = l_var_ot[jv]
+    print('\n\n ==== Checking variable '+cv_nemo+' against '+cv_rf_m+' !')
+
+    F_rf_m = nmp.zeros( Nt )
+    F_rf_t = nmp.zeros( Nt )
+    F_nemo = nmp.zeros((Nt,nb_alg))
+
+    wnd_rf = nmp.zeros( Nt ) ; #DEBUG
+    tzt_rf = nmp.zeros( Nt ) ; #DEBUG
+    qzt_rf = nmp.zeros( Nt ) ; #DEBUG
+    sst_rf = nmp.zeros( Nt ) ; #DEBUG
+    
+    id_rf = Dataset(cf_rf)
+    trf_m   = id_rf.variables[cv_rf_m][:] ; # Nt+1
+    trf_t   = id_rf.variables[cv_rf_t][:] ; # Nt+1
+    trf_wnd = id_rf.variables['wndspd'][:,1,1] ; # DEBUG
+    trf_tzt = id_rf.variables['t_air'][:,1,1] ; # DEBUG
+    trf_qzt = id_rf.variables['rh_air'][:,1,1] ; # DEBUG
+    trf_sst = id_rf.variables['sst'][:,1,1] ; # DEBUG
+    id_rf.close()
+    
+    if l_t_shift:
+        # 30 minute shift, just like NEMO
+        F_rf_m[:] = 0.5 * (trf_m[:-1] + trf_m[1:])
+        F_rf_t[:] = 0.5 * (trf_t[:-1] + trf_t[1:])
+    else:
+        F_rf_m[:] =        trf_m[:-1]
+        F_rf_t[:] =        trf_t[:-1]
+
+        wnd_rf[:] =        trf_wnd[:-1]        
+        tzt_rf[:] =        trf_tzt[:-1]
+        qzt_rf[:] =        trf_qzt[:-1]
+        sst_rf[:] =        trf_sst[:-1]        
+    
+    
+    for ja in range(nb_alg):
+        
+        calgo = l_alg[ja]
+
+        print(' *** '+calgo+' => '+cf_nemo[ja])
+
+        id_nemo = Dataset(cf_nemo[ja])
+        F_nemo[:,ja] = id_nemo.variables[cv_nemo][:,1,1] ; # it's 3x3 spatial domain, taking middle point !
+        id_nemo.close()
+
+
+        if l_more:
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            # How does all this look on on a figure?
+            cfig = l_var_rf[jv]+'_'+calgo+'.'+fig_ext
+            print(' *** will plot '+cfig)
+            fig = plt.figure(num=1, figsize=size_fig, facecolor='w', edgecolor='k')
+            ax1 = plt.axes([0.08, 0.25, 0.9, 0.7])
+            #
+            plt.plot(vtime, F_nemo[:,ja], label='NEMO['+calgo+']', zorder=1)
+            plt.plot(vtime, F_rf_m[:], color='k', label='MEAN REF!', zorder=10)
+            # +- rtol enveloppe:
+            plt.fill_between(vtime, F_rf_m[:]-F_rf_t[:], F_rf_m[:]+F_rf_t[:], alpha=0.2)
+            #
+            ax1.grid(color='k', linestyle='-', linewidth=0.3)
+            plt.legend(loc='best', ncol=1, shadow=True, fancybox=True)
+            plt.savefig(cfig, dpi=int(rDPI), transparent=False)
+            plt.close(1)
+            print('')
+            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+        # Does the field look okay with respect to reference +- tolerance ?
+
+        l_overshoot_a = nmp.any( F_nemo[:,ja] > F_rf_m[:]+F_rf_t[:] )
+        l_overshoot_b = nmp.any( F_nemo[:,ja] < F_rf_m[:]-F_rf_t[:] )
+
+        if l_overshoot_a: print(fclrs.FAIL+'\n ***** BAD overshoot + for '+calgo+' for variable '+cv+' !!!\n'+fclrs.ENDC )
+            
+        if l_overshoot_b: print(fclrs.FAIL+'\n ***** BAD overshoot - for '+calgo+' for variable '+cv+' !!!'+fclrs.ENDC )
+
+        if l_overshoot_a or l_overshoot_b:
+            print(fclrs.FAIL+'\n ***** TEST NOT PASSED FOR '+calgo+' for variable '+cv+' !!!\n'+fclrs.ENDC )
+        else:
+            # We're all good !
+            IREPORT[ja,jv] = 1
+            if l_more: print(fclrs.OKGR+'\n ***** TEST PASSED FOR '+calgo+' for variable '+cv+' :D !!!\n'+fclrs.ENDC )
+                    
+    jv=jv+1
+
+
+
+l_ok =  nmp.sum(IREPORT[:,:]) == nb_var*nb_alg
+
+
+
+if l_ok:
+    ctxt      = 'PASSED'
+    ccol      = fclrs.OKGR
+    cf_report = 'SBCBLK.success'
+else:
+    ctxt      = 'FAILED'
+    ccol      = fclrs.FAIL
+    cf_report = 'SBCBLK.fail'
+    
+
+print(ccol+'\n\n ############ FINAL REPORT ############\n'+fclrs.ENDC)
+
+f = open(cf_report, 'w')
+
+f.write("### Sanity-check report for SBCBLK generated via 'STATION_ASF/EXP00/sbcblk_sanity_check.sh'\n\n")
+
+for ja in range(nb_alg):
+    calgo = l_alg[ja]
+    
+    if nmp.sum(IREPORT[ja,:]) == nb_var:
+        # Success for this algo
+        cbla = ' ***** Algorithm "'+calgo+'" PASSED sanity check !!!\n\n'
+        print(fclrs.OKGR+cbla+fclrs.ENDC ) ; f.write(cbla)
+    else:
+        # Algo FAILS!
+        cbla = ' ***** Algorithm "'+calgo+'" FAILED sanity check !!!\n'
+        print(fclrs.FAIL+cbla+fclrs.ENDC ) ; f.write(cbla)
+        (idx_fail,) = nmp.where(IREPORT[ja,:]==0)
+        for jv in idx_fail:
+            cbla = '   ==> on variable '+l_var_rf[jv]+' !\n\n'
+            print(fclrs.FAIL+cbla+fclrs.ENDC ) ; f.write(cbla)
+
+# Conclusion:
+clist=''
+for cc in l_var_ot: clist=clist+cc+', '
+cbla = ' Test performed on the following NEMO prognostic variables:\n   ==> '+clist[:-2]+'\n'
+print(ccol+cbla+fclrs.ENDC ) ; f.write(cbla+'\n')
+
+cbla = '    ####################################\n'  +\
+       '    ###   TEST '+ctxt+' FOR SBCBLK !   ###\n'+\
+       '    ####################################\n\n'
+
+print(ccol+cbla+fclrs.ENDC ) ; f.write(cbla)
+
+f.close()
Index: /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/sanity_check_SBCBLK.sh
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/sanity_check_SBCBLK.sh	(revision 14072)
+++ /NEMO/trunk/tests/STATION_ASF/SANITY_CHECK/sanity_check_SBCBLK.sh	(revision 14072)
@@ -0,0 +1,204 @@
+#!/bin/bash
+
+################################################################
+#
+# Script to launch a set of STATION_ASF simulations
+#
+#  Ocean-only version....
+#
+# L. Brodeau, 2020
+#
+#
+# Note: the current setup only performs an ocean-only test (no sea-ice),
+#       even though the current script already recongnises if the nemo.exe
+#       has been compiled with "key_si3". For now it will just test the
+#       fluxes over open water.
+#
+################################################################
+
+CONFIG="STATION_ASF" ; # general name of the configuration
+CONFIG_BLD="STATION_ASF2" ; # name of config as build in NEMO... (directory inside "tests" actually contains the compiled test-case?)
+
+# Atmo + SSX forcing to use and sea-ice support?
+FORCING="IDEALIZED" ; i_sea_ice=0 ; SFORC="input_output_VALIDATION_IDEALIZED.nc"
+
+
+# Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists:
+NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick!
+
+# NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe:
+SASF_WRK_DIR="${NEMO_REF_DIR}/tests/${CONFIG_BLD}"
+
+# DATA_IN_DIR => Directory containing sea-surface + atmospheric forcings:
+DATA_IN_DIR="${NEMO_REF_DIR}/tests/${CONFIG}/input_data"
+
+# Directory where to run the simulation:
+PROD_DIR="${HOME}/tmp/${CONFIG}_test"
+
+# MPI launch command for your system
+# Even though we are running on 1 proc here, NEMO has likely been compiled with MPI,
+# if it's not the case then just leave "MPI_LAUNCH" void...
+MPI_LAUNCH="mpirun -n 1"
+
+####### End of normal user configurable section #######
+#================================================================================
+
+
+
+# Should the `analyze_output.py` script provide more output ???
+cmore=""
+if [ "$1" != "" ]; then
+    if [ "$1" = "more" ]; then
+        cmore="m"
+    else
+        echo "Only 'more' is accepted as argument for script `basename $0` !"
+        exit
+    fi
+fi
+
+rm -f SBCBLK.success SBCBLK.fail
+
+HERE=`pwd`
+
+echo
+
+# Is the nemo.exe of STATION_ASF compiled with sea-ice support (SI3) ?
+i_si3=0
+FCPP="${SASF_WRK_DIR}/cpp_${CONFIG_BLD}.fcm"
+if [ ! -f ${FCPP} ]; then echo " Mhhh, we could not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi
+ca=`cat ${FCPP} | grep 'key_si3'`
+
+if [ "${ca}" = "" ]; then
+    echo " *** NEMO was NOT compiled with sea-ice support (SI3) !" ; echo
+    if [ ${i_sea_ice} -eq 1 ]; then
+        echo " ===> so you cannot request ice-air flux computation !"
+        echo "     ===> please set i_sea_ice=0 or compile STATION_ASF with CPP key 'key_si3' !"
+        echo ; exit
+    fi
+else
+    echo " *** NEMO was apparently compiled with sea-ice support (SI3) !" ; echo
+    i_si3=1
+fi
+
+
+DIR_NL=${FORCING}/oce ; # directory where to find the namelists...
+
+# NEMO executable to use is:
+NEMO_EXE="${SASF_WRK_DIR}/BLD/bin/nemo.exe"
+if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi
+
+SASF_EXPREF="${NEMO_REF_DIR}/tests/STATION_ASF/EXPREF" ; # STATION_ASF EXPREF directory from which to fetch and XIOS xml files...
+
+CFGS_SHARED="${NEMO_REF_DIR}/cfgs/SHARED"
+if [ ! -d ${CFGS_SHARED} ]; then echo "PROBLEM!!! => could not find directory ${CFGS_SHARED} !"; exit; fi
+
+if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => could not find directory 'input_data' with input forcing..."; exit; fi
+
+cdt_cmpl="`\ls -l ${NEMO_EXE} | cut -d' ' -f 6,7,8`"
+
+echo "###########################################################"
+echo "#        S T A T I O N   A i r  -  S e a   F l u x        #"
+echo "###########################################################"
+echo
+echo "  * NEMO reference root directory is: ${NEMO_REF_DIR}"
+echo "  * STATION_ASF work directory is: ${SASF_WRK_DIR}"
+echo "       ==> NEMO EXE to use: ${NEMO_EXE}"
+echo "           ==> compiled: ${cdt_cmpl} !"
+echo
+echo "  * Input forcing data into: ${DATA_IN_DIR}"
+echo "  * Production will be done into: ${PROD_DIR}"
+echo "  * Directory in which namelists and xml files are fetched:"
+echo "       ==> ${SASF_EXPREF}"
+echo
+sleep 2
+
+mkdir -p ${PROD_DIR}
+
+rsync -avP ${NEMO_EXE}          ${PROD_DIR}/
+ln -sf     ${NEMO_EXE}          ${PROD_DIR}/nemo.exe.lnk
+
+
+# XIOS xml file
+################
+
+list_xml_ref="field_def_nemo-oce.xml domain_def_nemo.xml grid_def_nemo.xml"
+list_xml_cfg="iodef.xml file_def_nemo-oce.xml"
+fcntxt="context_nemo_OCE.xml"
+if [ ${i_sea_ice} -eq 1 ]; then
+    list_xml_ref+=" field_def_nemo-ice.xml"
+    list_xml_cfg+=" file_def_nemo-ice.xml"
+    fcntxt="context_nemo_OCE+ICE.xml"
+fi
+
+# The "context_nemo.xml" file:
+if [ ! -f ${SASF_EXPREF}/${fcntxt} ]; then echo " Mhhh, ${fcntxt} not found into ${SASF_EXPREF} !"; exit; fi
+rsync -avPL ${SASF_EXPREF}/${fcntxt} ${PROD_DIR}/context_nemo.xml
+
+# All remaining "*.xml" files:
+for ff in ${list_xml_cfg} ; do
+    if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi
+    rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/
+done
+for ff in ${list_xml_ref} ; do
+    if [ ! -f ${CFGS_SHARED}/${ff} ]; then echo " Mhhh, ${ff} not found into ${CFGS_SHARED} !"; exit; fi
+    rsync -avPL ${CFGS_SHARED}/${ff} ${PROD_DIR}/
+done
+
+
+# Copy forcing to work directory:
+echo ; echo "Forcing files to use:"
+\ls -l ${DATA_IN_DIR}/${SFORC}
+echo
+rsync -avP ${DATA_IN_DIR}/${SFORC} ${PROD_DIR}/
+echo; echo
+
+for CASE in "NCAR" "ECMWF" "COARE3p0" "COARE3p6" "ANDREAS"; do
+
+        echo ; echo
+        echo "======================================================================="
+        echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing "
+        echo "======================================================================="
+        echo
+
+        scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'`
+
+        rm -f ${PROD_DIR}/namelist_cfg
+        fnml="${HERE}/${DIR_NL}/namelist_${scase}_cfg"
+        if [ ! -f ${fnml} ]; then echo " Mhhh, test namelist ${fnml} not found !"; exit; fi
+
+        echo "   ===> namelist to use is: ${DIR_NL}/namelist_${scase}_cfg !"; echo
+        
+        # The namelists:
+        rsync -avPL ${HERE}/${DIR_NL}/namelist_${scase}_cfg        ${PROD_DIR}/namelist_cfg
+        rsync -avPL ${CFGS_SHARED}/namelist_ref                    ${PROD_DIR}/namelist_ref
+    
+        cd ${PROD_DIR}/
+        echo
+        echo "Launching NEMO ! (==> ${MPI_LAUNCH} ./nemo.exe)"
+        ${MPI_LAUNCH} ./nemo.exe 1>out_nemo.out 2>err_nemo.err
+        echo "Done!"
+        echo
+
+        # Moving output files:
+        mkdir -p output
+        mv -f ${CONFIG}-${CASE}_${FORCING}_*_grid*.nc output/
+
+        # Saving logs:
+        mkdir -p ${CASE}_${FORCING}_log
+        mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${FORCING}_log/
+
+done
+
+
+
+
+# Now we can compare the results with sanity range!
+
+echo ; echo ; echo
+echo " *** Now time for sanity-check of heat flux and wind stress components ***"
+echo
+
+cd ${HERE}
+python3 ./analyze_output.py ${DATA_IN_DIR}/${SFORC} ${PROD_DIR}/output ${cmore}
+
+
Index: /NEMO/trunk/tests/STATION_ASF/cpp_STATION_ASF.fcm
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/cpp_STATION_ASF.fcm	(revision 14071)
+++ /NEMO/trunk/tests/STATION_ASF/cpp_STATION_ASF.fcm	(revision 14072)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys   key_c1d key_iomput
+ bld::tool::fppkeys   key_si3 key_c1d key_iomput key_mpp_mpi
Index: /NEMO/trunk/tests/demo_cfgs.txt
===================================================================
--- /NEMO/trunk/tests/demo_cfgs.txt	(revision 14071)
+++ /NEMO/trunk/tests/demo_cfgs.txt	(revision 14072)
@@ -10,5 +10,5 @@
 WAD OCE
 BENCH OCE ICE TOP
-STATION_ASF OCE
+STATION_ASF OCE ICE
 CPL_OASIS  OCE TOP ICE NST
 SWG OCE SWE
