diff --git a/cfgs/METO_GO/EXPREF/context_nemo-BASIC.xml b/cfgs/METO_GO/EXPREF/context_nemo-BASIC.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bcea0fc2bb9be1a831ea1218de6f8348cb7a0cfd
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/context_nemo-BASIC.xml
@@ -0,0 +1,46 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-ice.xml"/>   <!--  NEMO ocean sea ice                      -->
+<!--    <field_definition src="./field_def_nemo-bgc.xml"/> -->  <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-oce-BASIC.xml"/>    <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-ice-BASIC.xml"/>     <!--  NEMO ocean sea ice                      -->
+<!--    <file_definition src="./file_def_nemo-bgc.xml"/>  -->   <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="deptht300" axis_ref="deptht" >
+         <zoom_axis begin="0" n="35" />
+      </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="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 id="deptht_surface" axis_ref="deptht" >
+         <zoom_axis begin=" 0 " n=" 1 " />
+      </axis>
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition src="./grid_def_nemo.xml"/>
+
+</context>
diff --git a/cfgs/METO_GO/EXPREF/context_nemo-CMIP6.xml b/cfgs/METO_GO/EXPREF/context_nemo-CMIP6.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ecfe86a0a858639f027aea1798335ab0aa6d8618
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/context_nemo-CMIP6.xml
@@ -0,0 +1,46 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-ice.xml"/>   <!--  NEMO ocean sea ice                      -->
+<!--    <field_definition src="./field_def_nemo-bgc.xml"/>   <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-oce-CMIP6.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-ice-CMIP6.xml"/>     <!--  NEMO ocean sea ice                      -->
+<!--    <file_definition src="./file_def_nemo-bgc.xml"/>     <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="deptht300" axis_ref="deptht" >
+         <zoom_axis begin="0" n="35" />
+      </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="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 id="deptht_surface" axis_ref="deptht" >
+         <zoom_axis begin=" 0 " n=" 1 " />
+      </axis>
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition src="./grid_def_nemo.xml"/>
+
+</context>
diff --git a/cfgs/METO_GO/EXPREF/context_nemo-CUSTOM.xml b/cfgs/METO_GO/EXPREF/context_nemo-CUSTOM.xml
new file mode 100644
index 0000000000000000000000000000000000000000..103043bd6c519d2befe5632d621861e9b0b9a5f6
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/context_nemo-CUSTOM.xml
@@ -0,0 +1,46 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-ice.xml"/>   <!--  NEMO ocean sea ice                      -->
+<!--    <field_definition src="./field_def_nemo-bgc.xml"/>   <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-ice.xml"/>     <!--  NEMO ocean sea ice                      -->
+<!--    <file_definition src="./file_def_nemo-bgc.xml"/>     <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="deptht300" axis_ref="deptht" >
+         <zoom_axis begin="0" n="35" />
+      </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="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 id="deptht_surface" axis_ref="deptht" >
+         <zoom_axis begin=" 0 " n=" 1 " />
+      </axis>
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+
+    <grid_definition src="./grid_def_nemo.xml"/>
+  
+</context>
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-10D.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-10D.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2cfe972bdcc48a5bead1a231f4bd6c6171752aa1
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-10D.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0"?>
+    <!-- $id$ -->
+    
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                      Define your own files for sea ice                                   =
+=                                         put the variables you want...                                    =
+============================================================================================================
+ -->
+    
+ <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+   
+   <file_group id="10d" output_freq="10d"  output_level="10" enabled=".TRUE.">  <!-- 10d files -->   	
+     <file id="file21" name_suffix="_icemod" description="ice variables" enabled=".true." >
+
+       <!-- 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="icethic"          name="sithic" />
+       <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="icevpnd"          name="sivpnd" />
+       <field field_ref="iceepnd"          name="siepnd" />
+       <field field_ref="icevlid"          name="sivlid" />
+       <!-- sst_m is always the potential temperature even when using teos10 -->
+       <field field_ref="sst_m_pot"        name="sst_m_pot"  />
+       <field field_ref="sss_m_abs"        name="sss_m_abs"  />
+       
+       <!-- heat -->
+       <field field_ref="icetemp"          name="sitemp" />
+       <field field_ref="icettop"          name="sittop" />
+       <field field_ref="icetbot"          name="sitbot" />
+       <field field_ref="icetsni"          name="sitsni" />
+
+       <!-- ponds -->
+       <field field_ref="dvpn_mlt"         name="dvpn_mlt" />
+       <field field_ref="dvpn_lid"         name="dvpn_lid" />
+       <field field_ref="dvpn_rnf"         name="dvpn_rnf" />
+       <field field_ref="dvpn_drn"         name="dvpn_drn" />
+       
+       <!-- 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="isig1"            name="isig1"   />
+       <field field_ref="isig2"            name="isig2"   />
+       <field field_ref="isig3"            name="isig3"   />
+       
+       <!-- 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="hfxcndtop"        name="hfxcndtop"  />
+       <field field_ref="hfxcndbot"        name="hfxcndbot"  />
+       <field field_ref="hfxsensib"        name="hfxsensib"  />
+       
+       <!-- salt fluxes -->
+       <field field_ref="sfxice"           name="sfxice" />
+       
+       <!-- mass fluxes -->
+       <field field_ref="vfxice"           name="vfxice" />
+       <field field_ref="vfxsnw"           name="vfxsnw" />
+       
+       <!-- 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="iceapnd_cat"      name="siapncat"/>
+       <field field_ref="icevpnd_cat"      name="sivpncat"/>
+       <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+       <!-- 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"        />
+
+     </file>
+     
+     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." >
+       <!-- 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" />
+     </file>
+     
+   </file_group>
+   
+   <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+   <file_group id="1h"  output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+   <file_group id="2m"  output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+   <file_group id="3m"  output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+   <file_group id="4m"  output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+   <file_group id="6m"  output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+   <file_group id="1y"  output_freq="1y"  output_level="10" enabled=".TRUE."/> <!-- real yearly 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>
+ 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-1M.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-1M.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5fb23347df02d27a97e82d904272ec83d2eebf66
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-1M.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0"?>
+    <!-- $id$ -->
+    
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                      Define your own files for sea ice                                   =
+=                                         put the variables you want...                                    =
+============================================================================================================
+ -->
+    
+ <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+   
+   <file_group id="1m" output_freq="1mo"  output_level="10" enabled=".TRUE.">  <!-- 1m files -->   	
+     <file id="file21" name_suffix="_icemod" description="ice variables" enabled=".true." >
+
+       <!-- 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="icethic"          name="sithic" />
+       <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="icevpnd"          name="sivpnd" />
+       <field field_ref="iceepnd"          name="siepnd" />
+       <field field_ref="icevlid"          name="sivlid" />
+       <!-- sst_m is always the potential temperature even when using teos10 -->
+       <field field_ref="sst_m_pot"        name="sst_m_pot"  />
+       <field field_ref="sss_m_abs"        name="sss_m_abs"  />
+       
+       <!-- heat -->
+       <field field_ref="icetemp"          name="sitemp" />
+       <field field_ref="icettop"          name="sittop" />
+       <field field_ref="icetbot"          name="sitbot" />
+       <field field_ref="icetsni"          name="sitsni" />
+
+       <!-- ponds -->
+       <field field_ref="dvpn_mlt"         name="dvpn_mlt" />
+       <field field_ref="dvpn_lid"         name="dvpn_lid" />
+       <field field_ref="dvpn_rnf"         name="dvpn_rnf" />
+       <field field_ref="dvpn_drn"         name="dvpn_drn" />
+       
+       <!-- 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="isig1"   />
+       <field field_ref="sig2_pnorm"      name="isig2"   />
+       
+       <!-- 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="hfxcndtop"        name="hfxcndtop"  />
+       <field field_ref="hfxcndbot"        name="hfxcndbot"  />
+       <field field_ref="hfxsensib"        name="hfxsensib"  />
+       
+       <!-- salt fluxes -->
+       <field field_ref="sfxice"           name="sfxice" />
+       
+       <!-- mass fluxes -->
+       <field field_ref="vfxice"           name="vfxice" />
+       <field field_ref="vfxsnw"           name="vfxsnw" />
+       
+       <!-- 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="iceapnd_cat"      name="siapncat"/>
+       <field field_ref="icevpnd_cat"      name="sivpncat"/>
+       <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+       <!-- 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"        />
+
+     </file>
+     
+     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." >
+       <!-- 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" />
+     </file>
+     
+   </file_group>
+   
+   <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+   <file_group id="1h"  output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+   <file_group id="2m"  output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+   <file_group id="3m"  output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+   <file_group id="4m"  output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+   <file_group id="6m"  output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+   <file_group id="1y"  output_freq="1y"  output_level="10" enabled=".TRUE."/> <!-- real yearly 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>
+ 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-INVALID_PERIOD.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-INVALID_PERIOD.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5b93a0422c556a6c927d8204244198a7f518e5ca
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-BASIC-INVALID_PERIOD.xml
@@ -0,0 +1,4 @@
+You can't use the standard diagnostic options with the current cycling period.
+Choose the "Custom" option, copy the file_def*.xml files that
+you want to use into the Rose app and adjust the meaning period
+accordingly. 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-10D.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-10D.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2cfe972bdcc48a5bead1a231f4bd6c6171752aa1
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-10D.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0"?>
+    <!-- $id$ -->
+    
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                      Define your own files for sea ice                                   =
+=                                         put the variables you want...                                    =
+============================================================================================================
+ -->
+    
+ <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+   
+   <file_group id="10d" output_freq="10d"  output_level="10" enabled=".TRUE.">  <!-- 10d files -->   	
+     <file id="file21" name_suffix="_icemod" description="ice variables" enabled=".true." >
+
+       <!-- 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="icethic"          name="sithic" />
+       <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="icevpnd"          name="sivpnd" />
+       <field field_ref="iceepnd"          name="siepnd" />
+       <field field_ref="icevlid"          name="sivlid" />
+       <!-- sst_m is always the potential temperature even when using teos10 -->
+       <field field_ref="sst_m_pot"        name="sst_m_pot"  />
+       <field field_ref="sss_m_abs"        name="sss_m_abs"  />
+       
+       <!-- heat -->
+       <field field_ref="icetemp"          name="sitemp" />
+       <field field_ref="icettop"          name="sittop" />
+       <field field_ref="icetbot"          name="sitbot" />
+       <field field_ref="icetsni"          name="sitsni" />
+
+       <!-- ponds -->
+       <field field_ref="dvpn_mlt"         name="dvpn_mlt" />
+       <field field_ref="dvpn_lid"         name="dvpn_lid" />
+       <field field_ref="dvpn_rnf"         name="dvpn_rnf" />
+       <field field_ref="dvpn_drn"         name="dvpn_drn" />
+       
+       <!-- 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="isig1"            name="isig1"   />
+       <field field_ref="isig2"            name="isig2"   />
+       <field field_ref="isig3"            name="isig3"   />
+       
+       <!-- 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="hfxcndtop"        name="hfxcndtop"  />
+       <field field_ref="hfxcndbot"        name="hfxcndbot"  />
+       <field field_ref="hfxsensib"        name="hfxsensib"  />
+       
+       <!-- salt fluxes -->
+       <field field_ref="sfxice"           name="sfxice" />
+       
+       <!-- mass fluxes -->
+       <field field_ref="vfxice"           name="vfxice" />
+       <field field_ref="vfxsnw"           name="vfxsnw" />
+       
+       <!-- 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="iceapnd_cat"      name="siapncat"/>
+       <field field_ref="icevpnd_cat"      name="sivpncat"/>
+       <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+       <!-- 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"        />
+
+     </file>
+     
+     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." >
+       <!-- 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" />
+     </file>
+     
+   </file_group>
+   
+   <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+   <file_group id="1h"  output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+   <file_group id="2m"  output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+   <file_group id="3m"  output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+   <file_group id="4m"  output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+   <file_group id="6m"  output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+   <file_group id="1y"  output_freq="1y"  output_level="10" enabled=".TRUE."/> <!-- real yearly 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>
+ 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-1M.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-1M.xml
new file mode 100644
index 0000000000000000000000000000000000000000..73fb168c25ba033e702eb02c0d86e20963da252f
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-1M.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0"?>
+    <!-- $id$ -->
+    
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                      Define your own files for sea ice                                   =
+=                                         put the variables you want...                                    =
+============================================================================================================
+ -->
+    
+ <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
+   
+   <file_group id="1m" output_freq="1mo"  output_level="10" enabled=".TRUE.">  <!-- 1m files -->   	
+     <file id="file21" name_suffix="_icemod" description="ice variables" enabled=".true." >
+
+       <!-- 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="icethic"          name="sithic" />
+       <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="icevpnd"          name="sivpnd" />
+       <field field_ref="iceepnd"          name="siepnd" />
+       <field field_ref="icevlid"          name="sivlid" />
+       <!-- sst_m is always the potential temperature even when using teos10 -->
+       <field field_ref="sst_m_pot"        name="sst_m_pot"  />
+       <field field_ref="sss_m_abs"        name="sss_m_abs"  />
+       
+       <!-- heat -->
+       <field field_ref="icetemp"          name="sitemp" />
+       <field field_ref="icettop"          name="sittop" />
+       <field field_ref="icetbot"          name="sitbot" />
+       <field field_ref="icetsni"          name="sitsni" />
+
+       <!-- ponds -->
+       <field field_ref="dvpn_mlt"         name="dvpn_mlt" />
+       <field field_ref="dvpn_lid"         name="dvpn_lid" />
+       <field field_ref="dvpn_rnf"         name="dvpn_rnf" />
+       <field field_ref="dvpn_drn"         name="dvpn_drn" />
+       
+       <!-- 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="isig1"            name="isig1"   />
+       <field field_ref="isig2"            name="isig2"   />
+       <field field_ref="isig3"            name="isig3"   />
+       
+       <!-- 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="hfxcndtop"        name="hfxcndtop"  />
+       <field field_ref="hfxcndbot"        name="hfxcndbot"  />
+       <field field_ref="hfxsensib"        name="hfxsensib"  />
+       
+       <!-- salt fluxes -->
+       <field field_ref="sfxice"           name="sfxice" />
+       
+       <!-- mass fluxes -->
+       <field field_ref="vfxice"           name="vfxice" />
+       <field field_ref="vfxsnw"           name="vfxsnw" />
+       
+       <!-- 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="iceapnd_cat"      name="siapncat"/>
+       <field field_ref="icevpnd_cat"      name="sivpncat"/>
+       <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+       <!-- 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"        />
+
+     </file>
+     
+     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." >
+       <!-- 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" />
+     </file>
+     
+   </file_group>
+   
+   <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+   <file_group id="1h"  output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="1m"  output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+   <file_group id="2m"  output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+   <file_group id="3m"  output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+   <file_group id="4m"  output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+   <file_group id="6m"  output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+   <file_group id="1y"  output_freq="1y"  output_level="10" enabled=".TRUE."/> <!-- real yearly 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>
+ 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-INVALID_PERIOD.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-INVALID_PERIOD.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5b93a0422c556a6c927d8204244198a7f518e5ca
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-ice-CMIP6-INVALID_PERIOD.xml
@@ -0,0 +1,4 @@
+You can't use the standard diagnostic options with the current cycling period.
+Choose the "Custom" option, copy the file_def*.xml files that
+you want to use into the Rose app and adjust the meaning period
+accordingly. 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-10D.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-10D.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1008a3c7c732353b58753b3f84a54ad35df7b272
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-10D.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+   
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="10d" output_freq="10d" output_level="10" split_freq="10d" enabled=".TRUE."> <!-- real monthly files -->
+
+        <file id="file8" name_suffix="_grid_T" >
+	  <field field_ref="e3t"          name="thkcello"   />
+          <field field_ref="ssh"          name="zos"        />
+          <field field_ref="ssh2"         name="zossq"      />
+          <field field_ref="sst_con"      name="tos_con"    />
+          <field field_ref="sss_abs"      name="sos_abs"    />
+          <field field_ref="sbt_con"      name="thetaob_con"/>
+          <field field_ref="sbs_abs"      name="sob_abs"    />
+          <field field_ref="toce_con"     name="thetao_con" operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)"   > @toce_con_e3t / @e3t </field>
+          <field field_ref="soce_abs"     name="so_abs"       operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)"    > @soce_abs_e3t / @e3t </field>
+          <field field_ref="mldzint_1"    name="somxzint1"  />
+	  <field field_ref="qt"           name="hfds"       />
+	  <field field_ref="qsr3d"        name="rsdo"       />
+	  <field field_ref="empmr"        name="sowaflup"   />
+          <field field_ref="ice_cover"    name="soicecov"   />
+          <field field_ref="berg_melt"       name="ficeberg"               />
+          <field field_ref="berg_melt_qlat"  name="berg_latent_heat_flux"  />
+	  <field field_ref="emp_oce"      name="soemp_oce"  />
+	  <field field_ref="emp_ice"      name="soemp_ice"  />
+	  <field field_ref="snowpre"      name="snowpre"    />
+	  <field field_ref="precip"       name="soprecip"   />
+	  <field field_ref="fmmflx"       name="fsitherm"   />
+	  <field field_ref="runoffs"      name="friver"     />
+	  <field field_ref="erp"          name="so_erp"     />
+	  <field field_ref="saltflx"      name="sfdsi"      />
+	  <field field_ref="qlatisf"      name="sohflisf"  />
+	  <field field_ref="qhcisf"       name="sohfcisf"   />
+	  <field field_ref="fwfisf"       name="sowflisf"   />
+        </file>
+
+	<file id="file9" name_suffix="_grid_U" description="ocean U grid variables" >
+	  <field field_ref="e3u"          name="thkcello"   />
+          <field field_ref="ssu"          name="sozocrtx"   />
+          <field field_ref="uoce"         name="uo"      operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)"    > @uoce_e3u / @e3u </field>
+          <field field_ref="uoce"         name="u2o" standard_name="square_of_sea_water_x_velocity" long_name="UU"  operation="average" freq_op="10d"  cell_methods="time: mean (thickness weighted)"   > @uoce2_e3u / @e3u </field>
+	  <field field_ref="utau"         name="tauuo"      />
+	</file>
+	
+	<file id="file10" name_suffix="_grid_V" description="ocean V grid variables" >
+	  <field field_ref="e3v"          name="thkcello"  />
+          <field field_ref="ssv"          name="somecrty"  />
+          <field field_ref="voce"         name="vo"      operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)"    > @voce_e3v / @e3v </field>
+          <field field_ref="voce"         name="v2o" standard_name="square_of_sea_water_y_velocity" long_name="VV"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)"    > @voce2_e3v / @e3v </field>
+	  <field field_ref="vtau"         name="tauvo"     />
+	</file>
+	
+	<file id="file11" name_suffix="_grid_W" description="ocean W grid variables" >
+	  <field field_ref="e3w" long_name="W-cell thickness"  />
+	  <field field_ref="woce"         name="wo"            />
+	  <field field_ref="avt"          name="difvho"        />
+	  <field field_ref="avm"          name="difvmo"        />
+	</file>
+
+
+      </file_group>
+
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m 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>
+    
+
+
+
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-1M.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-1M.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5f9de861ec081648afa5fb51e0ef36cdf97bb001
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-1M.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+   
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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="1m" output_freq="1mo" output_level="10" split_freq="1mo" enabled=".TRUE."> <!-- real monthly files -->
+
+        <file id="file8" name_suffix="_grid_T" >
+	  <field field_ref="e3t"          name="thkcello"  />
+          <field field_ref="ssh"          name="zos"       />
+          <field field_ref="ssh2"         name="zossq"     />
+
+          <field field_ref="sst_con"      name="tos_con"    />
+          <field field_ref="sss_abs"      name="sos_abs"    />
+          <field field_ref="sbt_con"      name="thetaob_con"/>
+          <field field_ref="sbs_abs"      name="sob_abs"    />
+          <field field_ref="toce_con"     name="thetao_con" operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"   > @toce_con_e3t / @e3t </field>
+          <field field_ref="soce_abs"     name="so_abs"       operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"   > @soce_abs_e3t / @e3t </field>
+          <field field_ref="mldzint_1"    name="somxzint1"  />
+	  <field field_ref="qt"           name="hfds"       />
+	  <field field_ref="qsr3d"        name="rsdo"       />
+	  <field field_ref="empmr"        name="sowaflup"   />
+          <field field_ref="ice_cover"    name="soicecov"   />
+          <field field_ref="berg_melt"       name="ficeberg"               />
+          <field field_ref="berg_melt_qlat"  name="berg_latent_heat_flux"  />
+	  <field field_ref="emp_oce"      name="soemp_oce"  />
+	  <field field_ref="emp_ice"      name="soemp_ice"  />
+	  <field field_ref="snowpre"      name="snowpre"    />
+	  <field field_ref="precip"       name="soprecip"   />
+	  <field field_ref="fmmflx"       name="fsitherm"   />
+	  <field field_ref="runoffs"      name="friver"     />
+	  <field field_ref="erp"          name="so_erp"     />
+	  <field field_ref="saltflx"      name="sfdsi"      />
+	  <field field_ref="qlatisf_cav"      name="sohflisf"  />
+	  <field field_ref="qhcisf_cav"       name="sohfcisf"   />
+	  <field field_ref="fwfisf_cav"       name="sowflisf"   />
+        </file>
+
+	<file id="file9" name_suffix="_grid_U" description="ocean U grid variables" >
+	  <field field_ref="e3u"          name="thkcello"   />
+          <field field_ref="ssu"          name="sozocrtx"   />
+          <field field_ref="uoce"         name="uo"      operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"   > @uoce_e3u / @e3u </field>
+          <field field_ref="uoce"         name="u2o" standard_name="square_of_sea_water_x_velocity" long_name="UU"  operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"   > @uoce2_e3u / @e3u </field>
+	  <field field_ref="utau"         name="tauuo"      />
+	</file>
+	
+	<file id="file10" name_suffix="_grid_V" description="ocean V grid variables" >
+	  <field field_ref="e3v"          name="thkcello"  />
+          <field field_ref="ssv"          name="somecrty"  />
+          <field field_ref="voce"         name="vo"      operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"   > @voce_e3v / @e3v </field>
+          <field field_ref="voce"         name="v2o" standard_name="square_of_sea_water_y_velocity" long_name="VV"  operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)"   > @voce2_e3v / @e3v </field>
+	  <field field_ref="vtau"         name="tauvo"     />
+	</file>
+	
+	<file id="file11" name_suffix="_grid_W" description="ocean W grid variables" >
+	  <field field_ref="e3w" long_name="W-cell thickness"  />
+	  <field field_ref="woce"         name="wo"            />
+	  <field field_ref="avt"          name="difvho"        />
+	  <field field_ref="avm"          name="difvmo"        />
+	</file>
+
+
+      </file_group>
+
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m 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>
+    
+
+
+
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-INVALID_PERIOD.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-INVALID_PERIOD.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5b93a0422c556a6c927d8204244198a7f518e5ca
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-BASIC-INVALID_PERIOD.xml
@@ -0,0 +1,4 @@
+You can't use the standard diagnostic options with the current cycling period.
+Choose the "Custom" option, copy the file_def*.xml files that
+you want to use into the Rose app and adjust the meaning period
+accordingly. 
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-10D.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-10D.xml
new file mode 100644
index 0000000000000000000000000000000000000000..43a750717ce6c8f0c8872d882417789a8fa14bd0
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-10D.xml
@@ -0,0 +1,339 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+   
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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 id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+          <field field_ref="sst_con"          name="tos_con"   standard_name="sea_surface_conservative_temperature"                                 />
+          <field field_ref="sst2_con"         name="tossq_com"   />
+          <field field_ref="sss_abs"          name="sos_abs"   standard_name="sea_surface_absolute_salinity"                                    />
+          <field field_ref="sss2_abs"         name="sossq_abs" long_name="Square of Sea Surface Absolute Salinity"   standard_name="square_of_sea_surface_absolute_Salinity"   unit="1e-06"     > sss_abs * sss_abs </field >
+          <field field_ref="mldr0_3"     name="mlotst"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T"         />
+	  <field field_ref="ssh"       name="zos"   standard_name="sea_surface_height_above_geoid" long_name="Sea Surface Height Above Geoid"      />
+<!-- TO FIX
+          <field field_ref="20d"          name="t20d"  standard_name="depth_of_isosurface_of_sea_water_potential_temperature" />
+-->
+	</file>
+	
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" enabled=".FALSE." >
+          <field field_ref="ssu"          name="sozocrtx"   standard_name="sea_surface_eastward_sea_water_velocity"                 />
+	  <field field_ref="utau"         name="sozotaux"   standard_name="surface_downward_x_stress" />
+	</file>
+	
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables"  enabled=".FALSE." >
+          <field field_ref="ssv"          name="somecrty"   standard_name="sea_surface_northward_sea_water_velocity"                 />
+	  <field field_ref="vtau"         name="sometauy"   standard_name="surface_downward_y_stress" />
+	</file>
+
+        <file id="file9" name_suffix="_scalar" description="scalar variables"  enabled=".FALSE." >
+          <field field_ref="sshthster"    name="scsshtst"   />
+          <field field_ref="voltot"       name="scvoltot"   />
+        </file>
+
+      </file_group>
+
+      <file_group id="10d" output_freq="10d"  output_level="10" enabled=".TRUE.">  <!-- 10d files -->   
+
+	<file id="file4" name_suffix="_grid_T" description="ocean T grid variables" >
+          <field field_ref="e3t"          name="thkcello"        standard_name="cell_thickness" />
+<!-- Is this dangerous to include rho0 here as a hard coded value -->
+          <field field_ref="e3t"          name="masscello"        standard_name="sea_water_mass_per_unit_area" unit="kg/m2" long_name="Ocean Grid-Cell Mass per area" > @e3t * 1026.0 </field> 
+          <field field_ref="tpt_dep"      name="zfull"        />
+<!-- TO FIX
+          <field field_ref="20d"          name="t20d"  standard_name="depth_of_isosurface_of_sea_water_potential_temperature" />
+-->
+          <field field_ref="toce_con"         name="thetao_con"       operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @toce_con_e3t / @e3t </field>
+<!-- TO FIX
+          <field field_ref="toce_vmean"   name="thetaot"   />
+          <field field_ref="toce_vmean300"   name="thetaot300"   />
+-->
+          <field field_ref="soce_abs"         name="so_abs"     operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @soce_e3t_abs / @e3t </field>
+	  <field field_ref="ssh"       name="zos"   standard_name="sea_surface_height_above_geoid" long_name="Sea Surface Height Above Geoid"      />
+          <field field_ref="ssh2"      name="zossq"  standard_name="square_of_sea_surface_height_above_geoid" long_name="Square of Sea Surface Height Above Geoid"  />
+	  <field field_ref="runoffs"      name="friver"   standard_name="water_flux_into_sea_water_from_rivers"                     />
+	  <field field_ref="qt"           name="hfds"   standard_name="surface_downward_heat_flux_in_sea_water"                     />
+	  <field field_ref="qsr3d"        name="rsdo"   standard_name="downwelling_shortwave_flux_in_sea_water"                     />
+          <field field_ref="mldr0_3"      name="mlotst"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T"         />
+          <field field_ref="mldr0_3"      name="mlotstsq"  long_name="Square of Ocean Mixed Layer Thickness Defined by Sigma T"  standard_name="square_of_ocean_mixed_layer_thickness_defined_by_sigma_theta" > mldr0_3 * mldr0_3 </field>
+          <field field_ref="mldr0_3"      name="mlotstmax"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T" operation="maximum"        />
+          <field field_ref="mldr0_3"      name="mlotstmin"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T" operation="minimum"        />
+          <field field_ref="berg_melt"       name="ficeberg"     standard_name="water_flux_into_sea_water_from_icebergs"      />
+          <field field_ref="berg_melt_qlat"  name="berg_latent_heat_flux"     standard_name="latent_heat_flux_from_icebergs"                                 />
+          <field field_ref="botpres"      name="pbo"                                                                                />
+          <field field_ref="sst_con"          name="tos_con"   standard_name="sea_surface_conservative_temperature"                                 />
+          <field field_ref="sst2_con"          name="tossq_con"   />
+          <field field_ref="sss_abs"          name="sos_abs"   standard_name="sea_surface_absolute_salinity"                                    />
+          <field field_ref="sss2_abs"         name="sossq_abs" long_name="Square of Sea Surface Absolute Salinity"   standard_name="square_of_sea_surface_absolute_Salinity"   unit="1e-06"     > sss_abs * sss_abs </field >
+          <field field_ref="sbt_con"          name="thetaob_con"   standard_name="sea_water_conservative_temperature_at_sea_floor"            />
+          <field field_ref="sbs_abs"          name="sob_abs"   standard_name="sea_water_absolute_salinity_at_sea_floor"                         />
+<!-- TO FIX
+          <field field_ref="rain_ao_cea" name="pr" standard_name="rainfall_flux" long_name="Rainfall Flux" > @rain_ao_cea </field>
+-->
+          <field field_ref="evap_ao_cea" name="evs" standard_name="water_evaporation_flux" long_name="Water Evaporation Flux Where Ice Free Ocean over Sea" />
+          <field field_ref="snow_ao_cea" name="prsn" standard_name="snowfall_flux" long_name="Snowfall Flux" />
+          <field field_ref="hflx_rain_cea" name="hfrainds" long_name="Temperature Flux due to Rain Expressed as Heat Flux In To Sea Water" standard_name="temperature_flux_due_to_rain_expressed_as_heat_flux_into_sea_water" > hflx_rain_cea </field> 
+          <field field_ref="hflx_evap_cea" name="hfevapds" long_name="Temperature Flux due to Evaporation Expressed as Heat Flux Out of Sea Water" standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" />
+          <field field_ref="hflx_rnf_cea" name="hflx_rnf" long_name="Temperature Flux due to Runoff Expressed as Heat Flux into  Sea Water" standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water" > hflx_rnf_cea </field> 
+          <field field_ref="saltflx"      name="sfdsi" standard_name="downward_sea_ice_basal_salt_flux" />
+          <field field_ref="fmmflx"       name="fsitherm"      unit="kg/m2/s"   />
+          <field field_ref = "empmr" >@empmr + @fwfisf </field>
+<!-- TO FIX
+          <field field_ref="Age" name="agessc" />
+-->
+          <field field_ref="tnpeo" />
+          <field field_ref="snowpre" name="snowpre" />
+          <field field_ref="snow_ai_cea" name="snow_ai_cea" />
+	  <field field_ref="empmr"        name="sowaflup"   standard_name="water_flux_out_of_sea_ice_and_sea_water"                 />
+	  <field field_ref="saltflx"      name="sosafldo"   standard_name="salt_flux_into_sea_water"                                />
+          <field field_ref="mldkz5"       name="somixhgt"   standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"   />
+          <field field_ref="mldr10_1"     name="somxl010"   standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"      />
+          <field field_ref="mldzint_1"    name="somxzint1"   standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"      />
+          <field field_ref="ice_cover"    name="soicecov"   standard_name="sea_ice_area_fraction"                                   />
+          <field field_ref="wspd"         name="sowindsp"   standard_name="wind_speed"                                              />          
+          <field field_ref="qlatisf"         name="sohflisf"   standard_name=""                                                        />
+          <field field_ref="qlatisf3d"         name="vohflisf"   standard_name=""                                                        />
+          <field field_ref="qhcisf"         name="sohfcisf"   standard_name=""                                                        />
+          <field field_ref="qhcisf3d"         name="vohfcisf"   standard_name=""                                                        />
+          <field field_ref="fwfisf"       name="sowflisf"   standard_name=""                                                        />
+          <field field_ref="fwfisf3d"     name="vowflisf"   standard_name=""                                                        />
+<!-- TO FIX
+          <field field_ref="ketrd_ldf_vsum"     name="dispkexyfo"   standard_name="Dissipation of kinetic energy by lateral viscosity" grid_ref="vert_sum"/>
+-->
+          <field field_ref="tosmint"       name="opottempmint" />
+          <field field_ref="somint"       name="somint" />
+<!-- TO FIX
+          <field field_ref="toce_e3t_300" name="T300m" />
+          <field field_ref="e3t_300" name="e3t300m" />
+          <field field_ref="toce_e3t_vsum300" name="Tsum300m" />
+          <field field_ref="e3t_vsum300" name="e3t_vsum300m" />
+-->
+          <field field_ref="sbs_abs" name="sob_abs" />
+          <field field_ref="bn2" name="obvfsq" />
+<!-- trend diagnostics-->
+          <field field_ref="ttrd_totad_li"   name="opottempadvect"  unit="W/m2"    />
+          <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  unit="W/m2"    />
+          <field field_ref="ttrd_zdfp_li"    name="opottempdiff"    unit="W/m2"    />
+          <field field_ref="ttrd_evd_li"     name="ttrd_evd_li"                    />
+          <field field_ref="ttrd_qns_li"     name="ttrd_qns_li"                    />
+          <field field_ref="ttrd_qsr_li"     name="rsdoabsorb"      unit="W/m2"    />
+          <field field_ref="ttrd_bbl_li"     name="ttrd_bbl_li"                    />
+          <field field_ref="ttrd_atf_li"     name="ttrd_atf_li"                    />
+          <field field_ref="ttrd_tot_li"     name="opottemptend"    unit="W/m2"    />
+          <field field_ref="strd_totad_li"   name="osaltadvect"     unit="Kg/m2/s" />
+          <field field_ref="strd_iso_li"     name="osaltpmdiff"     unit="kg/m2/s" />
+          <field field_ref="strd_zdfp_li"    name="osaltdiff"       unit="kg/m2/s" />
+          <field field_ref="strd_evd_li"     name="strd_evd_li"                    />
+          <field field_ref="strd_tot_li"     name="osalttend"       unit="kg/m2/s" />
+          <field field_ref="strd_bbl_li"     name="strd_bbl_li"                    />
+          <field field_ref="strd_atf_li"     name="strd_atf_li"                    />
+	</file>
+	
+	<file id="file5" name_suffix="_grid_U" description="ocean U grid variables" >
+          <field field_ref="e3u"          name="thkcello"     standard_name="cell_thickness" />
+          <field field_ref="uoce"         name="uo"     operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @uoce_e3u / @e3u </field>
+	  <field field_ref="utau"         name="tauuo"   standard_name="surface_downward_x_stress"  />
+          <field field_ref="ut"           name="uto" standard_name="product_of_xward_sea_water_velocity_and_temperature" long_name="UT"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @ut_e3u / @e3u </field>
+          <field field_ref="us"           name="uso" standard_name="product_of_xward_sea_water_velocity_and_salinity" long_name="US"    operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @us_e3u / @e3u </field>
+          <field field_ref="uoce"         name="u2o" standard_name="square_of_sea_water_x_velocity" long_name="UU"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @uoce2_e3u / @e3u </field>
+          <!-- available with key_diaar5 -->
+          <field field_ref="u_masstr"     name="umo" /> 
+          <field field_ref="u_masstr_vint"     name="umo_vint" /> 
+          <field field_ref="u_heattr"     name="hfx" > @uadv_heattr + @udiff_heattr </field> 
+          <field field_ref="uadv_heattr"     name="hfx_adv" /> 
+          <field field_ref="udiff_heattr"     name="hfx_diff" /> 
+<!--below here not in CMOR format yet -->
+          <field field_ref="u_salttr"     name="sozosatr" />
+	</file>
+	
+	<file id="file6" name_suffix="_grid_V" description="ocean V grid variables" >
+          <field field_ref="e3v"          name="thkcello"        standard_name="cell_thickness" />
+          <field field_ref="voce"         name="vo"     operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @voce_e3v / @e3v </field>
+	  <field field_ref="vtau"         name="tauvo"   standard_name="surface_downward_y_stress" />
+          <field field_ref="vt"           name="vto" standard_name="product_of_yward_sea_water_velocity_and_temperature" long_name="VT"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @vt_e3v / @e3v </field>
+          <field field_ref="vs"           name="vso" standard_name="product_of_yward_sea_water_velocity_and_salinity" long_name="VS"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @vs_e3v / @e3v </field>
+          <field field_ref="voce"         name="v2o" standard_name="square_of_sea_water_y_velocity" long_name="VV"  operation="average" freq_op="10d" cell_methods="time: mean (thickness weighted)" > @voce2_e3v / @e3v </field>
+          <!-- available with key_diaar5 -->
+          <field field_ref="v_masstr"     name="vmo" /> 
+          <field field_ref="v_heattr"     name="hfy" > @vadv_heattr + @vdiff_heattr </field>
+          <field field_ref="vadv_heattr"     name="hfy_adv" /> 
+          <field field_ref="vdiff_heattr"     name="hfy_diff" /> 
+<!--below here not in CMOR format yet -->
+          <field field_ref="v_salttr"     name="somesatr" />
+	</file>
+	
+	<file id="file7" name_suffix="_grid_W" description="ocean W grid variables" >
+	  <field field_ref="avt"          name="difvho"   standard_name="ocean_vertical_heat_diffusivity"  />
+	  <field field_ref="avs"          name="difvso"   standard_name="ocean_vertical_salt_diffusivity"   />                 
+          <field field_ref="avm"          name="difvmo"   standard_name="ocean_vertical_momentum_diffusivity"               />
+          <field field_ref="avt_evd"      name="avt_evd"  standard_name="enhanced_vertical_heat_diffusivity"               />
+          <field field_ref="av_tmx"       name="diftrto"  standard_name="ocean_vertical_tracer_diffusivity_due_to_tides"               />
+          <field field_ref="w_masstr"     name="wmo" > w_masstr </field>
+	  <field field_ref="woce"         name="wo" standard_name="upward_sea_water_velocity" long_name="W"                  />
+          <field field_ref="woce"         name="w2o" standard_name="square_of_upward_sea_water_velocity" long_name="WW"  operation="average" > woce * woce </field>
+          <field field_ref="wt"           name="wt"         standard_name="product_of_upward_sea_water_velocity_and_temperature" long_name="WT"         />
+          <field field_ref="ws"           name="ws"         standard_name="product_of_upward_sea_water_velocity_and_salinity" long_name="WS"            />
+<!-- TO FIX
+          <field field_ref="wpt_dep"      name="zhalf"        />
+-->
+	</file>
+	
+        <file id="file8" name_suffix="_scalar" description="scalar variables" enabled=".true." >
+          <field field_ref="voltot"       name="scvoltot"   />
+          <field field_ref="temptot"      name="thetaoga" cell_methods="time: mean (volume weighted)"   />
+          <field field_ref="saltot"       name="soga"     cell_methods="time: mean (volume weighted)"   />
+        </file>
+
+        <file id="file10" name_suffix="_diaptr" description="processed diagnostics" >
+          <field field_ref="zomsfglo"     name="zomsfglo"   standard_name="meridional_streamfunction_global"           grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemglo"     name="zotemglo"   standard_name="zonal_mean_temperature_global"              grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfglo"     name="zosrfglo"   standard_name="zonal_mean_surface_global"                  grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalglo"     name="zosalglo"   standard_name="zonal_mean_salinity_global"                 grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfatl"     name="zomsfatl"   standard_name="meridional_streamfunction_atlantic"         grid_ref="gznl_W_3D"       />
+          <field field_ref="zotematl"     name="zotematl"   standard_name="zonal_mean_temperature_atlantic"            grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfatl"     name="zosrfatl"   standard_name="zonal_mean_surface_atlantic"                grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalatl"     name="zosalatl"   standard_name="zonal_mean_salinity_atlantic"               grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfpac"     name="zomsfpac"   standard_name="meridional_streamfunction_pacific"          grid_ref="gznl_W_3D"       />
+          <field field_ref="zotempac"     name="zotempac"   standard_name="zonal_mean_temperature_pacific"             grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfpac"     name="zosrfpac"   standard_name="zonal_mean_surface_pacific"                 grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalpac"     name="zosalpac"   standard_name="zonal_mean_salinity_pacific"                grid_ref="gznl_T_3D"       />
+          <field field_ref="zomsfind"     name="zomsfind"   standard_name="meridional_streamfunction_indian"           grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemind"     name="zotemind"   standard_name="zonal_mean_temperature_indian"              grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfind"     name="zosrfind"   standard_name="zonal_mean_surface_indian"                  grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalind"     name="zosalind"   standard_name="zonal_mean_salinity_indian"                 grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfipc"     name="zomsfipc"   standard_name="meridional_streamfunction_indian_pacific"   grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemipc"     name="zotemipc"   standard_name="zonal_mean_temperature_indian_pacific"      grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfipc"     name="zosrfipc"   standard_name="zonal_mean_surface_indian_pacific"          grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalipc"     name="zosalipc"   standard_name="zonal_mean_salinity_indian_pacific"         grid_ref="gznl_T_3D"       />          
+          <field field_ref="sophtadv"     name="sophtadv"   standard_name="advective_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtadv_atl"    name="sophtadv_atlantic"   standard_name="advective_heat_transport_atlantic"/>
+          <field field_ref="sophtadv_pac"    name="sophtadv_pacific"   standard_name="advective_heat_transport_pacific" />
+          <field field_ref="sophtadv_ind"    name="sophtadv_indian"   standard_name="advective_heat_transport_indian"   />
+          <field field_ref="sophtadv_ipc"    name="sophtadv_ipc"   standard_name="advective_heat_transport_indopacific"  />
+          <field field_ref="sophtbtr"     name="hfovbaro"   standard_name="barotropic_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtbtr_atl"    name="hfovbaro_atlantic"   standard_name="barotropic_heat_transport_atlantic"/>
+          <field field_ref="sophtbtr_pac"    name="hfovbaro_pacific"   standard_name="barotropic_heat_transport_pacific" />
+          <field field_ref="sophtbtr_ind"    name="hfovbaro_indian"   standard_name="barotropic_heat_transport_indian"   />
+          <field field_ref="sophtbtr_ipc"    name="hfovbaro_ipc"   standard_name="barotropic_heat_transport_indopacific"  />
+          <field field_ref="sopstadv"     name="sopstadv"   standard_name="advective_salt_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sopstadv_atl"    name="sopstadv_atlantic"   standard_name="advective_salt_transport_atlantic"/>
+          <field field_ref="sopstadv_pac"    name="sopstadv_pacific"   standard_name="advective_salt_transport_pacific" />
+          <field field_ref="sopstadv_ind"    name="sopstadv_indian"   standard_name="advective_salt_transport_indian"   />
+          <field field_ref="sopstadv_ipc"    name="sopstadv_ipc"   standard_name="advective_salt_transport_indopacific"  />
+          <field field_ref="sopstbtr"     name="sltovbaro"   standard_name="barotropic_salt_transport"     />
+          <field field_ref="sopstbtr_atl"    name="sltovbaro_atlantic"   standard_name="barotropic_salt_transport_atlantic"/>
+          <field field_ref="sopstbtr_pac"    name="sltovbaro_pacific"   standard_name="barotropic_salt_transport_pacific" />
+          <field field_ref="sopstbtr_ind"    name="sltovbaro_indian"   standard_name="barotropic_salt_transport_indian"   />
+          <field field_ref="sopstbtr_ipc"    name="sltovbaro_ipc"   standard_name="barotropic_salt_transport_indopacific"  />
+          <!--The following variables are to be merged into a single variableis with a basin dimenesion in postprocessing  -->
+          <!-- hfbasin -->
+          <field field_ref="sophtadv" name="hfbasin_global" standard_name="northward_ocean_heat_transport" > @sophtadv + @sophtldf </field>
+          <field field_ref="sophtadv" name="hfbasin_atlantic" standard_name="northward_ocean_heat_transport" > @sophtadv_atl + @sophtldf_atl </field>
+          <field field_ref="sophtadv" name="hfbasin_pacific" standard_name="northward_ocean_heat_transport" > @sophtadv_pac + @sophtldf_pac </field>
+          <field field_ref="sophtadv" name="hfbasin_indian" standard_name="northward_ocean_heat_transport" > @sophtadv_ind + @sophtldf_ind </field>
+          <field field_ref="sophtadv" name="hfbasin_indopacific" standard_name="northward_ocean_heat_transport" > @sophtadv_ipc + @sophtldf_ipc </field>
+          <!-- hfbasinpadv -->
+          <field field_ref="sophteiv"     name="hfbasinpadv_global"   standard_name="bolus_heat_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophteiv_atl"    name="hfbasinpadv_atlantic"   standard_name="bolus_heat_transport_atlantic"/>
+          <field field_ref="sophteiv_pac"    name="hfbasinpadv_pacific"   standard_name="bolus_heat_transport_pacific" />
+          <field field_ref="sophteiv_ind"    name="hfbasinpadv_indian"   standard_name="bolus_heat_transport_indian"   />
+          <field field_ref="sophteiv_ipc"    name="hfbasinpadv_indopacific"   standard_name="bolus_heat_transport_indopacific"   />
+          <!-- hfbasinpmadv -->
+          <field field_ref="sophteiv"     name="hfbasinpmadv_global"   standard_name="bolus_heat_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophteiv_atl"    name="hfbasinpmadv_atlantic"   standard_name="bolus_heat_transport_atlantic"/>
+          <field field_ref="sophteiv_pac"    name="hfbasinpmadv_pacific"   standard_name="bolus_heat_transport_pacific" />
+          <field field_ref="sophteiv_ind"    name="hfbasinpmadv_indian"   standard_name="bolus_heat_transport_indian"   />
+          <field field_ref="sophteiv_ipc"    name="hfbasinpmadv_indopacific"   standard_name="bolus_heat_transport_indopacific"   />
+          <!-- hfbasinpmdiff -->
+          <field field_ref="sophtldf"     name="hfbasinpmdiff_global"   standard_name="diffusive_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtldf_atl"    name="hfbasinpmdiff_atlantic"   standard_name="diffusive_transport_atlantic"/>
+          <field field_ref="sophtldf_pac"    name="hfbasinpmdiff_pacific"   standard_name="diffusive_transport_pacific" />
+          <field field_ref="sophtldf_ind"    name="hfbasinpmdiff_indian"   standard_name="diffusive_transport_indian"   />
+          <field field_ref="sophtldf_ipc"    name="hfbasinpmdiff_indopacific"   standard_name="diffusive_transport_indopacific"   />
+          <!-- hfovovrt -->
+          <field field_ref="sophtove"     name="hfovovrt_global"   standard_name="overturning_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtove_atl"    name="hfovovrt_atlantic"   standard_name="overturning_heat_transport_atlantic"/>
+          <field field_ref="sophtove_pac"    name="hfovovrt_pacific"   standard_name="overturning_heat_transport_pacific" />
+          <field field_ref="sophtove_ind"    name="hfovovrt_indian"   standard_name="overturning_heat_transport_indian"   />
+          <field field_ref="sophtove_ipc"    name="hfovovrt_indopacific"   standard_name="overturning_heat_transport_indopacific"   />
+          <!-- hfovgyre IS THIS DONE CORRECTLY? SHOULD WE ALSO SUBTRACT THE BAROTROPIC TERM? The CMIP6 data request says not to so leave it for now-->
+          <field field_ref="sophtove"     name="hfovgyre_global"   standard_name="gyre_heat_transport"         > @sophtadv - @sophtove </field>
+          <field field_ref="sophtove_atl"    name="hfovgyre_atlantic"   standard_name="gyre_heat_transport_atlantic" > @sophtadv_atl - @sophtove_atl </field>
+          <field field_ref="sophtove_pac"    name="hfovgyre_pacific"   standard_name="gyre_heat_transport_pacific"  > @sophtadv_pac - @sophtove_pac </field>
+          <field field_ref="sophtove_ind"    name="hfovgyre_indian"   standard_name="gyre_heat_transport_indian"   > @sophtadv_ind - @sophtove_ind </field>
+          <field field_ref="sophtove_ipc"    name="hfovgyre_indopacific"   standard_name="gyre_heat_transport_indopacific"   > @sophtadv_ipc - @sophtove_ipc </field>
+          <!-- sltbasin -->
+          <field field_ref="sopstadv" name="sltbasin_global" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv + @sopstldf)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_atlantic" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_atl + @sopstldf_atl)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_pacific" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_pac + @sopstldf_pac)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_indian" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_ind + @sopstldf_ind)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_indopacific" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_ipc + @sopstldf_ipc)/1000 </field>
+          <!-- sltbasinpadv -->
+          <field field_ref="sopsteiv"        name="sltbasinpadv_global"   standard_name="bolus_salt_transport"  unit="kg s-1"> @sopsteiv/1000   </field>
+          <field field_ref="sopsteiv_atl"    name="sltbasinpadv_atlantic"   standard_name="bolus_salt_transport_atlantic" unit="kg s-1"> @sopsteiv_atl/1000   </field>
+          <field field_ref="sopsteiv_pac"    name="sltbasinpadv_pacific"   standard_name="bolus_salt_transport_pacific" unit="kg s-1"> @sopsteiv_pac/1000   </field>
+          <field field_ref="sopsteiv_ind"    name="sltbasinpadv_indian"   standard_name="bolus_salt_transport_indian"  unit="kg s-1"> @sopsteiv_ind/1000   </field>
+          <field field_ref="sopsteiv_ipc"    name="sltbasinpadv_indopacific"   standard_name="bolus_salt_transport_indopacific"  unit="kg s-1"> @sopsteiv_ipc/1000   </field>
+          <!-- sltbasinpmadv -->
+          <field field_ref="sopsteiv"        name="sltbasinpmadv_global"   standard_name="bolus_salt_transport"  unit="kg s-1"> @sopsteiv/1000   </field>        
+          <field field_ref="sopsteiv_atl"    name="sltbasinpmadv_atlantic"   standard_name="bolus_salt_transport_atlantic" unit="kg s-1"> @sopsteiv_atl/1000   </field>
+          <field field_ref="sopsteiv_pac"    name="sltbasinpmadv_pacific"   standard_name="bolus_salt_transport_pacific" unit="kg s-1"> @sopsteiv_pac/1000   </field>
+          <field field_ref="sopsteiv_ind"    name="sltbasinpmadv_indian"   standard_name="bolus_salt_transport_indian"  unit="kg s-1"> @sopsteiv_ind/1000   </field>
+          <field field_ref="sopsteiv_ipc"    name="sltbasinpmadv_indopacific"   standard_name="bolus_salt_transport_indopacific"  unit="kg s-1"> @sopsteiv_ipc/1000   </field>
+          <!-- sltbasinpmdiff -->
+          <field field_ref="sopstldf"     name="sltbasinpmdiff_global"   standard_name="diffusive_transport" unit="kg s-1">   @sopstldf/1000   </field>
+          <field field_ref="sopstldf_atl"    name="sltbasinpmdiff_atlantic"   standard_name="diffusive_transport_atlantic" unit="kg s-1"> @sopstldf_atl/1000   </field>
+          <field field_ref="sopstldf_pac"    name="sltbasinpmdiff_pacific"   standard_name="diffusive_transport_pacific" unit="kg s-1"> @sopstldf_pac/1000   </field>
+          <field field_ref="sopstldf_ind"    name="sltbasinpmdiff_indian"   standard_name="diffusive_transport_indian" unit="kg s-1">  @sopstldf_ind/1000   </field>
+          <field field_ref="sopstldf_ipc"    name="sltbasinpmdiff_indopacific"   standard_name="diffusive_transport_indopacific" unit="kg s-1">  @sopstldf_ipc/1000   </field>
+          <!-- sltovovrt -->
+          <field field_ref="sopstove"     name="sltovovrt_global"   standard_name="overturning_salt_transport"  unit="kg s-1">   @sopstove/1000   </field>       
+          <field field_ref="sopstove_atl"    name="sltovovrt_atlantic"   standard_name="overturning_salt_transport_atlantic" unit="kg s-1">   @sopstove_atl/1000   </field>
+          <field field_ref="sopstove_pac"    name="sltovovrt_pacific"   standard_name="overturning_salt_transport_pacific"  unit="kg s-1">   @sopstove_pac/1000   </field>
+          <field field_ref="sopstove_ipc"    name="sltovovrt_indopacific"   standard_name="overturning_salt_transport_indopacific"   unit="kg s-1">   @sopstove_ipc/1000   </field>
+          <!-- sltovgyre IS THIS DONE CORRECTLY? SHOULD WE ALSO SUBTRACT THE BAROTROPIC TERM?-->
+          <field field_ref="sopstove"     name="sltovgyre_global"   standard_name="gyre_salt_transport"    unit="kg s-1" > (@sopstadv - @sopstove)/1000 </field>
+          <field field_ref="sopstove_atl"    name="sltovgyre_atlantic"   standard_name="gyre_salt_transport_atlantic" unit="kg s-1" > (@sopstadv_atl - @sopstove_atl)/1000 </field>
+          <field field_ref="sopstove_pac"    name="sltovgyre_pacific"   standard_name="gyre_salt_transport_pacific" unit="kg s-1"  > (@sopstadv_pac - @sopstove_pac)/1000 </field>
+          <field field_ref="sopstove_ind"    name="sltovgyre_indian"   standard_name="gyre_salt_transport_indian" unit="kg s-1"   > (@sopstadv_ind - @sopstove_ind)/1000 </field>
+          <field field_ref="sopstove_ipc"    name="sltovgyre_indopacific"   standard_name="gyre_salt_transport_ipc" unit="kg s-1"   > (@sopstadv_ipc - @sopstove_ipc)/1000 </field>
+        </file>
+
+      </file_group>
+
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m 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>
+    
+
+
+
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-1M.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-1M.xml
new file mode 100644
index 0000000000000000000000000000000000000000..fc027f11628f43977172b0a9c04ff1b4841b6415
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-1M.xml
@@ -0,0 +1,339 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+   
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h 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 id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+          <field field_ref="sst_con"          name="tos_con"   standard_name="sea_surface_conservative_temperature"                                 />
+          <field field_ref="sst2_con"          name="tossq_con"   />
+          <field field_ref="sss_abs"          name="sos_abs"   standard_name="sea_surface_absolute_salinity"                                    />
+          <field field_ref="sss2_abs"         name="sossq_abs" long_name="Square of Sea Surface Absolute Salinity"   standard_name="square_of_sea_surface_absolute_Salinity"   unit="1e-06"     > sss_abs * sss_abs </field >
+          <field field_ref="mldr0_3"     name="mlotst"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T"         />
+	  <field field_ref="ssh"       name="zos"   standard_name="sea_surface_height_above_geoid" long_name="Sea Surface Height Above Geoid"      />
+<!-- TO FIX
+          <field field_ref="20d"          name="t20d"  standard_name="depth_of_isosurface_of_sea_water_potential_temperature" />
+-->
+	</file>
+	
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" enabled=".FALSE." >
+          <field field_ref="ssu"          name="sozocrtx"   standard_name="sea_surface_eastward_sea_water_velocity"                 />
+	  <field field_ref="utau"         name="sozotaux"   standard_name="surface_downward_x_stress" />
+	</file>
+	
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables"  enabled=".FALSE." >
+          <field field_ref="ssv"          name="somecrty"   standard_name="sea_surface_northward_sea_water_velocity"                 />
+	  <field field_ref="vtau"         name="sometauy"   standard_name="surface_downward_y_stress" />
+	</file>
+
+        <file id="file9" name_suffix="_scalar" description="scalar variables"  enabled=".FALSE." >
+          <field field_ref="sshthster"    name="scsshtst"   />
+          <field field_ref="voltot"       name="scvoltot"   />
+        </file>
+
+      </file_group>
+
+      <file_group id="1m" output_freq="1mo"  output_level="10" enabled=".TRUE.">  <!-- 1mo files -->   
+
+	<file id="file4" name_suffix="_grid_T" description="ocean T grid variables" >
+          <field field_ref="e3t"          name="thkcello"     />
+<!-- Is this dangerous to include rho0 here as a hard coded value -->
+          <field field_ref="e3t"          name="masscello"        standard_name="sea_water_mass_per_unit_area" unit="kg/m2" long_name="Ocean Grid-Cell Mass per area" > @e3t * 1026.0 </field> 
+          <field field_ref="tpt_dep"      name="zfull"        />
+<!-- TO FIX
+          <field field_ref="20d"          name="t20d"  standard_name="depth_of_isosurface_of_sea_water_potential_temperature" />
+-->
+          <field field_ref="toce_con"         name="thetao_con"       operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @toce_e3t_con / @e3t </field>
+<!-- TO FIX
+          <field field_ref="toce_vmean"   name="thetaot"   />
+          <field field_ref="toce_vmean300"   name="thetaot300"   />
+-->
+          <field field_ref="soce_abs"         name="so_abs"     operation="average" freq_op="1mo"   cell_methods="time: mean (thickness weighted)" > @soce_e3t_abs / @e3t </field>
+	  <field field_ref="ssh"       name="zos"   standard_name="sea_surface_height_above_geoid" long_name="Sea Surface Height Above Geoid"      />
+          <field field_ref="ssh2"      name="zossq"  standard_name="square_of_sea_surface_height_above_geoid" long_name="Square of Sea Surface Height Above Geoid"  />
+	  <field field_ref="runoffs"      name="friver"   standard_name="water_flux_into_sea_water_from_rivers"                     />
+	  <field field_ref="qt"           name="hfds"   standard_name="surface_downward_heat_flux_in_sea_water"                     />
+	  <field field_ref="qsr3d"        name="rsdo"   standard_name="downwelling_shortwave_flux_in_sea_water"                     />
+          <field field_ref="mldr0_3"      name="mlotst"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T"         />
+          <field field_ref="mldr0_3"      name="mlotstsq"  long_name="Square of Ocean Mixed Layer Thickness Defined by Sigma T"  standard_name="square_of_ocean_mixed_layer_thickness_defined_by_sigma_theta" > mldr0_3 * mldr0_3 </field>
+          <field field_ref="mldr0_3"      name="mlotstmax"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T" operation="maximum"        />
+          <field field_ref="mldr0_3"      name="mlotstmin"   long_name="Ocean Mixed Layer Thickness Defined by Sigma T" operation="minimum"        />
+          <field field_ref="berg_melt"       name="ficeberg"     standard_name="water_flux_into_sea_water_from_icebergs"      />
+          <field field_ref="berg_melt_qlat"  name="berg_latent_heat_flux"     standard_name="latent_heat_flux_from_icebergs"                                 />
+          <field field_ref="botpres"      name="pbo"                                                                                />
+          <field field_ref="sst_con"          name="tos_con"   standard_name="sea_surface_conservative_temperature"                                 />
+          <field field_ref="sst2_con"          name="tossq_con"   />
+          <field field_ref="sss_abs"          name="sos_abs"   standard_name="sea_surface_absolute_salinity"                                    />
+          <field field_ref="sss2_abs"         name="sossq_abs" long_name="Square of Sea Surface Absolute Salinity"   standard_name="square_of_sea_surface_absolute_Salinity"   unit="1e-06"     > sss_abs * sss_abs </field >
+          <field field_ref="sbt_con"          name="thetaob_con"   standard_name="sea_water_conservative_temperature_at_sea_floor"            />
+          <field field_ref="sbs_abs"          name="sob_abs"   standard_name="sea_water_salinity_at_sea_floor"                         />
+<!-- TO FIX
+          <field field_ref="rain_ao_cea" name="pr" standard_name="rainfall_flux" long_name="Rainfall Flux" > @rain_ao_cea </field>
+-->
+          <field field_ref="evap_ao_cea" name="evs" standard_name="water_evaporation_flux" long_name="Water Evaporation Flux Where Ice Free Ocean over Sea" />
+          <field field_ref="snow_ao_cea" name="prsn" standard_name="snowfall_flux" long_name="Snowfall Flux" />
+          <field field_ref="hflx_rain_cea" name="hfrainds" long_name="Temperature Flux due to Rain Expressed as Heat Flux In To Sea Water" standard_name="temperature_flux_due_to_rain_expressed_as_heat_flux_into_sea_water" > hflx_rain_cea </field> 
+          <field field_ref="hflx_evap_cea" name="hfevapds" long_name="Temperature Flux due to Evaporation Expressed as Heat Flux Out of Sea Water" standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" />
+          <field field_ref="hflx_rnf_cea" name="hflx_rnf" long_name="Temperature Flux due to Runoff Expressed as Heat Flux into  Sea Water" standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water" > hflx_rnf_cea </field> 
+          <field field_ref="saltflx"      name="sfdsi" standard_name="downward_sea_ice_basal_salt_flux" />
+          <field field_ref="fmmflx"       name="fsitherm"      unit="kg/m2/s"   />
+          <field field_ref = "empmr" >@empmr + @fwfisf </field>
+<!-- TO FIX
+          <field field_ref="Age" name="agessc" />
+-->
+          <field field_ref="tnpeo" />
+          <field field_ref="snowpre"     name="snowpre" />
+          <field field_ref="snow_ai_cea" name="snow_ai_cea" />
+	  <field field_ref="empmr"        name="sowaflup"   standard_name="water_flux_out_of_sea_ice_and_sea_water"                 />
+	  <field field_ref="saltflx"      name="sosafldo"   standard_name="salt_flux_into_sea_water"                                />
+          <field field_ref="mldkz5"       name="somixhgt"   standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"   />
+          <field field_ref="mldr10_1"     name="somxl010"   standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"      />
+          <field field_ref="mldzint_1"    name="somxzint1"   standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"      />
+          <field field_ref="ice_cover"    name="soicecov"   standard_name="sea_ice_area_fraction"                                   />
+          <field field_ref="wspd"         name="sowindsp"   standard_name="wind_speed"                                              />          
+          <field field_ref="qlatisf"         name="sohflisf"   standard_name=""                                                        />
+          <field field_ref="qlatisf3d"         name="vohflisf"   standard_name=""                                                        />
+          <field field_ref="qhcisf"         name="sohfcisf"   standard_name=""                                                        />
+          <field field_ref="qhcisf3d"         name="vohfcisf"   standard_name=""                                                        />
+          <field field_ref="fwfisf"       name="sowflisf"   standard_name=""                                                        />
+          <field field_ref="fwfisf3d"     name="vowflisf"   standard_name=""                                                        />
+<!-- TO FIX
+          <field field_ref="ketrd_ldf_vsum"     name="dispkexyfo"   standard_name="Dissipation of kinetic energy by lateral viscosity" grid_ref="vert_sum"/>
+-->
+          <field field_ref="tosmint"       name="opottempmint" />
+          <field field_ref="somint"       name="somint" />
+<!-- TO FIX
+          <field field_ref="toce_e3t_300" name="T300m" />
+          <field field_ref="e3t_300" name="e3t300m" />
+          <field field_ref="toce_e3t_vsum300" name="Tsum300m" />
+          <field field_ref="e3t_vsum300" name="e3t_vsum300m" />
+-->
+          <field field_ref="sbs_abs" name="sob_abs" />
+          <field field_ref="bn2" name="obvfsq" />
+<!-- trend diagnostics-->
+          <field field_ref="ttrd_totad_li"   name="opottempadvect"  unit="W/m2"    />
+          <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  unit="W/m2"    />
+          <field field_ref="ttrd_zdfp_li"    name="opottempdiff"    unit="W/m2"    />
+          <field field_ref="ttrd_evd_li"     name="ttrd_evd_li"                    />
+          <field field_ref="ttrd_qns_li"     name="ttrd_qns_li"                    />
+          <field field_ref="ttrd_qsr_li"     name="rsdoabsorb"      unit="W/m2"    />
+          <field field_ref="ttrd_bbl_li"     name="ttrd_bbl_li"                    />
+          <field field_ref="ttrd_atf_li"     name="ttrd_atf_li"                    />
+          <field field_ref="ttrd_tot_li"     name="opottemptend"    unit="W/m2"    />
+          <field field_ref="strd_totad_li"   name="osaltadvect"     unit="Kg/m2/s" />
+          <field field_ref="strd_iso_li"     name="osaltpmdiff"     unit="kg/m2/s" />
+          <field field_ref="strd_zdfp_li"    name="osaltdiff"       unit="kg/m2/s" />
+          <field field_ref="strd_evd_li"     name="strd_evd_li"                    />
+          <field field_ref="strd_tot_li"     name="osalttend"       unit="kg/m2/s" />
+          <field field_ref="strd_bbl_li"     name="strd_bbl_li"                    />
+          <field field_ref="strd_atf_li"     name="strd_atf_li"                    />
+	</file>
+	
+	<file id="file5" name_suffix="_grid_U" description="ocean U grid variables" >
+          <field field_ref="e3u"          name="thkcello"     standard_name="cell_thickness" />
+          <field field_ref="uoce"         name="uo"     operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)" > @uoce_e3u / @e3u </field>
+	  <field field_ref="utau"         name="tauuo"   standard_name="surface_downward_x_stress"  />
+          <field field_ref="ut"           name="uto" standard_name="product_of_xward_sea_water_velocity_and_temperature" long_name="UT"  operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @ut_e3u / @e3u </field>
+          <field field_ref="us"           name="uso" standard_name="product_of_xward_sea_water_velocity_and_salinity" long_name="US"    operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"> @us_e3u / @e3u </field>
+          <field field_ref="uoce"         name="u2o" standard_name="square_of_sea_water_x_velocity" long_name="UU"  operation="average" freq_op="1mo"  cell_methods="time: mean (thickness weighted)"> @uoce2_e3u / @e3u </field>
+          <!-- available with key_diaar5 -->
+          <field field_ref="u_masstr"     name="umo" /> 
+          <field field_ref="u_masstr_vint"     name="umo_vint" /> 
+          <field field_ref="u_heattr"     name="hfx" > @uadv_heattr + @udiff_heattr </field> 
+          <field field_ref="uadv_heattr"     name="hfx_adv" /> 
+          <field field_ref="udiff_heattr"     name="hfx_diff" /> 
+<!--below here not in CMOR format yet -->
+          <field field_ref="u_salttr"     name="sozosatr" />
+	</file>
+	
+	<file id="file6" name_suffix="_grid_V" description="ocean V grid variables" >
+          <field field_ref="e3v"          name="thkcello"        standard_name="cell_thickness" />
+          <field field_ref="voce"         name="vo"     operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @voce_e3v / @e3v </field>
+	  <field field_ref="vtau"         name="tauvo"   standard_name="surface_downward_y_stress" />
+          <field field_ref="vt"           name="vto" standard_name="product_of_yward_sea_water_velocity_and_temperature" long_name="VT"  operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @vt_e3v / @e3v </field>
+          <field field_ref="vs"           name="vso" standard_name="product_of_yward_sea_water_velocity_and_salinity" long_name="VS"  operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @vs_e3v / @e3v </field>
+          <field field_ref="voce"         name="v2o" standard_name="square_of_sea_water_y_velocity" long_name="VV"  operation="average" freq_op="1mo" cell_methods="time: mean (thickness weighted)" > @voce2_e3v / @e3v </field>
+          <!-- available with key_diaar5 -->
+          <field field_ref="v_masstr"     name="vmo" /> 
+          <field field_ref="v_heattr"     name="hfy" > @vadv_heattr + @vdiff_heattr </field>
+          <field field_ref="vadv_heattr"     name="hfy_adv" /> 
+          <field field_ref="vdiff_heattr"     name="hfy_diff" /> 
+<!--below here not in CMOR format yet -->
+          <field field_ref="v_salttr"     name="somesatr" />
+	</file>
+	
+	<file id="file7" name_suffix="_grid_W" description="ocean W grid variables" >
+	  <field field_ref="avt"          name="difvho"   standard_name="ocean_vertical_heat_diffusivity"  />
+	  <field field_ref="avs"          name="difvso"   standard_name="ocean_vertical_salt_diffusivity"   />                 
+          <field field_ref="avm"          name="difvmo"   standard_name="ocean_vertical_momentum_diffusivity"               />
+          <field field_ref="avt_evd"      name="avt_evd"  standard_name="enhanced_vertical_heat_diffusivity"               />
+          <field field_ref="av_tmx"       name="diftrto"  standard_name="ocean_vertical_tracer_diffusivity_due_to_tides"               />
+          <field field_ref="w_masstr"     name="wmo" > w_masstr </field>
+	  <field field_ref="woce"         name="wo" standard_name="upward_sea_water_velocity" long_name="W"                  />
+          <field field_ref="woce"         name="w2o" standard_name="square_of_upward_sea_water_velocity" long_name="WW"  operation="average" > woce * woce </field>
+          <field field_ref="wt"           name="wt"         standard_name="product_of_upward_sea_water_velocity_and_temperature" long_name="WT"         />
+          <field field_ref="ws"           name="ws"         standard_name="product_of_upward_sea_water_velocity_and_salinity" long_name="WS"            />
+<!-- TO FIX
+          <field field_ref="wpt_dep"      name="zhalf"        />
+-->
+	</file>
+	
+        <file id="file8" name_suffix="_scalar" description="scalar variables" enabled=".true." >
+          <field field_ref="voltot"       name="scvoltot"   />
+          <field field_ref="temptot"      name="thetaoga"   cell_methods="time: mean (volume weighted)"   />
+          <field field_ref="saltot"       name="soga"       cell_methods="time: mean (volume weighted)"   />
+        </file>
+
+        <file id="file10" name_suffix="_diaptr" description="processed diagnostics" >
+          <field field_ref="zomsfglo"     name="zomsfglo"   standard_name="meridional_streamfunction_global"           grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemglo"     name="zotemglo"   standard_name="zonal_mean_temperature_global"              grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfglo"     name="zosrfglo"   standard_name="zonal_mean_surface_global"                  grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalglo"     name="zosalglo"   standard_name="zonal_mean_salinity_global"                 grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfatl"     name="zomsfatl"   standard_name="meridional_streamfunction_atlantic"         grid_ref="gznl_W_3D"       />
+          <field field_ref="zotematl"     name="zotematl"   standard_name="zonal_mean_temperature_atlantic"            grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfatl"     name="zosrfatl"   standard_name="zonal_mean_surface_atlantic"                grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalatl"     name="zosalatl"   standard_name="zonal_mean_salinity_atlantic"               grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfpac"     name="zomsfpac"   standard_name="meridional_streamfunction_pacific"          grid_ref="gznl_W_3D"       />
+          <field field_ref="zotempac"     name="zotempac"   standard_name="zonal_mean_temperature_pacific"             grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfpac"     name="zosrfpac"   standard_name="zonal_mean_surface_pacific"                 grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalpac"     name="zosalpac"   standard_name="zonal_mean_salinity_pacific"                grid_ref="gznl_T_3D"       />
+          <field field_ref="zomsfind"     name="zomsfind"   standard_name="meridional_streamfunction_indian"           grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemind"     name="zotemind"   standard_name="zonal_mean_temperature_indian"              grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfind"     name="zosrfind"   standard_name="zonal_mean_surface_indian"                  grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalind"     name="zosalind"   standard_name="zonal_mean_salinity_indian"                 grid_ref="gznl_T_3D"       />          
+          <field field_ref="zomsfipc"     name="zomsfipc"   standard_name="meridional_streamfunction_indian_pacific"   grid_ref="gznl_W_3D"       />
+          <field field_ref="zotemipc"     name="zotemipc"   standard_name="zonal_mean_temperature_indian_pacific"      grid_ref="gznl_T_3D"       />
+          <field field_ref="zosrfipc"     name="zosrfipc"   standard_name="zonal_mean_surface_indian_pacific"          grid_ref="gznl_T_3D"       />
+          <field field_ref="zosalipc"     name="zosalipc"   standard_name="zonal_mean_salinity_indian_pacific"         grid_ref="gznl_T_3D"       />          
+          <field field_ref="sophtadv"     name="sophtadv"   standard_name="advective_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtadv_atl"    name="sophtadv_atlantic"   standard_name="advective_heat_transport_atlantic"/>
+          <field field_ref="sophtadv_pac"    name="sophtadv_pacific"   standard_name="advective_heat_transport_pacific" />
+          <field field_ref="sophtadv_ind"    name="sophtadv_indian"   standard_name="advective_heat_transport_indian"   />
+          <field field_ref="sophtadv_ipc"    name="sophtadv_ipc"   standard_name="advective_heat_transport_indopacific"  />
+          <field field_ref="sophtbtr"     name="hfovbaro"   standard_name="barotropic_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtbtr_atl"    name="hfovbaro_atlantic"   standard_name="barotropic_heat_transport_atlantic"/>
+          <field field_ref="sophtbtr_pac"    name="hfovbaro_pacific"   standard_name="barotropic_heat_transport_pacific" />
+          <field field_ref="sophtbtr_ind"    name="hfovbaro_indian"   standard_name="barotropic_heat_transport_indian"   />
+          <field field_ref="sophtbtr_ipc"    name="hfovbaro_ipc"   standard_name="barotropic_heat_transport_indopacific"  />
+          <field field_ref="sopstadv"     name="sopstadv"   standard_name="advective_salt_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sopstadv_atl"    name="sopstadv_atlantic"   standard_name="advective_salt_transport_atlantic"/>
+          <field field_ref="sopstadv_pac"    name="sopstadv_pacific"   standard_name="advective_salt_transport_pacific" />
+          <field field_ref="sopstadv_ind"    name="sopstadv_indian"   standard_name="advective_salt_transport_indian"   />
+          <field field_ref="sopstadv_ipc"    name="sopstadv_ipc"   standard_name="advective_salt_transport_indopacific"  />
+          <field field_ref="sopstbtr"     name="sltovbaro"   standard_name="barotropic_salt_transport"     />
+          <field field_ref="sopstbtr_atl"    name="sltovbaro_atlantic"   standard_name="barotropic_salt_transport_atlantic"/>
+          <field field_ref="sopstbtr_pac"    name="sltovbaro_pacific"   standard_name="barotropic_salt_transport_pacific" />
+          <field field_ref="sopstbtr_ind"    name="sltovbaro_indian"   standard_name="barotropic_salt_transport_indian"   />
+          <field field_ref="sopstbtr_ipc"    name="sltovbaro_ipc"   standard_name="barotropic_salt_transport_indopacific"  />
+          <!--The following variables are to be merged into a single variableis with a basin dimenesion in postprocessing  -->
+          <!-- hfbasin -->
+          <field field_ref="sophtadv" name="hfbasin_global" standard_name="northward_ocean_heat_transport" > @sophtadv + @sophtldf </field>
+          <field field_ref="sophtadv" name="hfbasin_atlantic" standard_name="northward_ocean_heat_transport" > @sophtadv_atl + @sophtldf_atl </field>
+          <field field_ref="sophtadv" name="hfbasin_pacific" standard_name="northward_ocean_heat_transport" > @sophtadv_pac + @sophtldf_pac </field>
+          <field field_ref="sophtadv" name="hfbasin_indian" standard_name="northward_ocean_heat_transport" > @sophtadv_ind + @sophtldf_ind </field>
+          <field field_ref="sophtadv" name="hfbasin_indopacific" standard_name="northward_ocean_heat_transport" > @sophtadv_ipc + @sophtldf_ipc </field>
+          <!-- hfbasinpadv -->
+          <field field_ref="sophteiv"     name="hfbasinpadv_global"   standard_name="bolus_heat_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophteiv_atl"    name="hfbasinpadv_atlantic"   standard_name="bolus_heat_transport_atlantic"/>
+          <field field_ref="sophteiv_pac"    name="hfbasinpadv_pacific"   standard_name="bolus_heat_transport_pacific" />
+          <field field_ref="sophteiv_ind"    name="hfbasinpadv_indian"   standard_name="bolus_heat_transport_indian"   />
+          <field field_ref="sophteiv_ipc"    name="hfbasinpadv_indopacific"   standard_name="bolus_heat_transport_indopacific"   />
+          <!-- hfbasinpmadv -->
+          <field field_ref="sophteiv"     name="hfbasinpmadv_global"   standard_name="bolus_heat_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophteiv_atl"    name="hfbasinpmadv_atlantic"   standard_name="bolus_heat_transport_atlantic"/>
+          <field field_ref="sophteiv_pac"    name="hfbasinpmadv_pacific"   standard_name="bolus_heat_transport_pacific" />
+          <field field_ref="sophteiv_ind"    name="hfbasinpmadv_indian"   standard_name="bolus_heat_transport_indian"   />
+          <field field_ref="sophteiv_ipc"    name="hfbasinpmadv_indopacific"   standard_name="bolus_heat_transport_indopacific"   />
+          <!-- hfbasinpmdiff -->
+          <field field_ref="sophtldf"     name="hfbasinpmdiff_global"   standard_name="diffusive_transport"                       grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtldf_atl"    name="hfbasinpmdiff_atlantic"   standard_name="diffusive_transport_atlantic"/>
+          <field field_ref="sophtldf_pac"    name="hfbasinpmdiff_pacific"   standard_name="diffusive_transport_pacific" />
+          <field field_ref="sophtldf_ind"    name="hfbasinpmdiff_indian"   standard_name="diffusive_transport_indian"   />
+          <field field_ref="sophtldf_ipc"    name="hfbasinpmdiff_indopacific"   standard_name="diffusive_transport_indopacific"   />
+          <!-- hfovovrt -->
+          <field field_ref="sophtove"     name="hfovovrt_global"   standard_name="overturning_heat_transport"                   grid_ref="gznl_T_2D"       />
+          <field field_ref="sophtove_atl"    name="hfovovrt_atlantic"   standard_name="overturning_heat_transport_atlantic"/>
+          <field field_ref="sophtove_pac"    name="hfovovrt_pacific"   standard_name="overturning_heat_transport_pacific" />
+          <field field_ref="sophtove_ind"    name="hfovovrt_indian"   standard_name="overturning_heat_transport_indian"   />
+          <field field_ref="sophtove_ipc"    name="hfovovrt_indopacific"   standard_name="overturning_heat_transport_indopacific"   />
+          <!-- hfovgyre IS THIS DONE CORRECTLY? SHOULD WE ALSO SUBTRACT THE BAROTROPIC TERM? The CMIP6 data request says not to so leave it for now-->
+          <field field_ref="sophtove"     name="hfovgyre_global"   standard_name="gyre_heat_transport"         > @sophtadv - @sophtove </field>
+          <field field_ref="sophtove_atl"    name="hfovgyre_atlantic"   standard_name="gyre_heat_transport_atlantic" > @sophtadv_atl - @sophtove_atl </field>
+          <field field_ref="sophtove_pac"    name="hfovgyre_pacific"   standard_name="gyre_heat_transport_pacific"  > @sophtadv_pac - @sophtove_pac </field>
+          <field field_ref="sophtove_ind"    name="hfovgyre_indian"   standard_name="gyre_heat_transport_indian"   > @sophtadv_ind - @sophtove_ind </field>
+          <field field_ref="sophtove_ipc"    name="hfovgyre_indopacific"   standard_name="gyre_heat_transport_indopacific"   > @sophtadv_ipc - @sophtove_ipc </field>
+          <!-- sltbasin -->
+          <field field_ref="sopstadv" name="sltbasin_global" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv + @sopstldf)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_atlantic" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_atl + @sopstldf_atl)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_pacific" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_pac + @sopstldf_pac)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_indian" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_ind + @sopstldf_ind)/1000 </field>
+          <field field_ref="sopstadv" name="sltbasin_indopacific" standard_name="northward_ocean_heat_transport" unit="kg s-1"> (@sopstadv_ipc + @sopstldf_ipc)/1000 </field>
+          <!-- sltbasinpadv -->
+          <field field_ref="sopsteiv"        name="sltbasinpadv_global"   standard_name="bolus_salt_transport"  unit="kg s-1"> @sopsteiv/1000   </field>
+          <field field_ref="sopsteiv_atl"    name="sltbasinpadv_atlantic"   standard_name="bolus_salt_transport_atlantic" unit="kg s-1"> @sopsteiv_atl/1000   </field>
+          <field field_ref="sopsteiv_pac"    name="sltbasinpadv_pacific"   standard_name="bolus_salt_transport_pacific" unit="kg s-1"> @sopsteiv_pac/1000   </field>
+          <field field_ref="sopsteiv_ind"    name="sltbasinpadv_indian"   standard_name="bolus_salt_transport_indian"  unit="kg s-1"> @sopsteiv_ind/1000   </field>
+          <field field_ref="sopsteiv_ipc"    name="sltbasinpadv_indopacific"   standard_name="bolus_salt_transport_indopacific"  unit="kg s-1"> @sopsteiv_ipc/1000   </field>
+          <!-- sltbasinpmadv -->
+          <field field_ref="sopsteiv"        name="sltbasinpmadv_global"   standard_name="bolus_salt_transport"  unit="kg s-1"> @sopsteiv/1000   </field>        
+          <field field_ref="sopsteiv_atl"    name="sltbasinpmadv_atlantic"   standard_name="bolus_salt_transport_atlantic" unit="kg s-1"> @sopsteiv_atl/1000   </field>
+          <field field_ref="sopsteiv_pac"    name="sltbasinpmadv_pacific"   standard_name="bolus_salt_transport_pacific" unit="kg s-1"> @sopsteiv_pac/1000   </field>
+          <field field_ref="sopsteiv_ind"    name="sltbasinpmadv_indian"   standard_name="bolus_salt_transport_indian"  unit="kg s-1"> @sopsteiv_ind/1000   </field>
+          <field field_ref="sopsteiv_ipc"    name="sltbasinpmadv_indopacific"   standard_name="bolus_salt_transport_indopacific"  unit="kg s-1"> @sopsteiv_ipc/1000   </field>
+          <!-- sltbasinpmdiff -->
+          <field field_ref="sopstldf"     name="sltbasinpmdiff_global"   standard_name="diffusive_transport" unit="kg s-1">   @sopstldf/1000   </field>
+          <field field_ref="sopstldf_atl"    name="sltbasinpmdiff_atlantic"   standard_name="diffusive_transport_atlantic" unit="kg s-1"> @sopstldf_atl/1000   </field>
+          <field field_ref="sopstldf_pac"    name="sltbasinpmdiff_pacific"   standard_name="diffusive_transport_pacific" unit="kg s-1"> @sopstldf_pac/1000   </field>
+          <field field_ref="sopstldf_ind"    name="sltbasinpmdiff_indian"   standard_name="diffusive_transport_indian" unit="kg s-1">  @sopstldf_ind/1000   </field>
+          <field field_ref="sopstldf_ipc"    name="sltbasinpmdiff_indopacific"   standard_name="diffusive_transport_indopacific" unit="kg s-1">  @sopstldf_ipc/1000   </field>
+          <!-- sltovovrt -->
+          <field field_ref="sopstove"     name="sltovovrt_global"   standard_name="overturning_salt_transport"  unit="kg s-1">   @sopstove/1000   </field>       
+          <field field_ref="sopstove_atl"    name="sltovovrt_atlantic"   standard_name="overturning_salt_transport_atlantic" unit="kg s-1">   @sopstove_atl/1000   </field>
+          <field field_ref="sopstove_pac"    name="sltovovrt_pacific"   standard_name="overturning_salt_transport_pacific"  unit="kg s-1">   @sopstove_pac/1000   </field>
+          <field field_ref="sopstove_ipc"    name="sltovovrt_indopacific"   standard_name="overturning_salt_transport_indopacific"   unit="kg s-1">   @sopstove_ipc/1000   </field>
+          <!-- sltovgyre IS THIS DONE CORRECTLY? SHOULD WE ALSO SUBTRACT THE BAROTROPIC TERM?-->
+          <field field_ref="sopstove"     name="sltovgyre_global"   standard_name="gyre_salt_transport"    unit="kg s-1" > (@sopstadv - @sopstove)/1000 </field>
+          <field field_ref="sopstove_atl"    name="sltovgyre_atlantic"   standard_name="gyre_salt_transport_atlantic" unit="kg s-1" > (@sopstadv_atl - @sopstove_atl)/1000 </field>
+          <field field_ref="sopstove_pac"    name="sltovgyre_pacific"   standard_name="gyre_salt_transport_pacific" unit="kg s-1"  > (@sopstadv_pac - @sopstove_pac)/1000 </field>
+          <field field_ref="sopstove_ind"    name="sltovgyre_indian"   standard_name="gyre_salt_transport_indian" unit="kg s-1"   > (@sopstadv_ind - @sopstove_ind)/1000 </field>
+          <field field_ref="sopstove_ipc"    name="sltovgyre_indopacific"   standard_name="gyre_salt_transport_ipc" unit="kg s-1"   > (@sopstadv_ipc - @sopstove_ipc)/1000 </field>
+        </file>
+
+      </file_group>
+
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m 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>
+    
+
+
+
diff --git a/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-INVALID_PERIOD.xml b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-INVALID_PERIOD.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5b93a0422c556a6c927d8204244198a7f518e5ca
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/file_def_nemo-oce-CMIP6-INVALID_PERIOD.xml
@@ -0,0 +1,4 @@
+You can't use the standard diagnostic options with the current cycling period.
+Choose the "Custom" option, copy the file_def*.xml files that
+you want to use into the Rose app and adjust the meaning period
+accordingly. 
diff --git a/cfgs/METO_GO/EXPREF/iodef.xml b/cfgs/METO_GO/EXPREF/iodef.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8bfff14b9c8f7e56a255ed6c1c60c6d16b715c8b
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/iodef.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+	
+	  <variable id="info_level"                type="int">-1</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context_nemo.xml"/>       <!--  NEMO       -->
+
+</simulation>
diff --git a/cfgs/METO_GO/EXPREF/iodef_coupled.xml b/cfgs/METO_GO/EXPREF/iodef_coupled.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4b7faea01ccbfb72ed2f857ad3fa8bd9e17d10ed
--- /dev/null
+++ b/cfgs/METO_GO/EXPREF/iodef_coupled.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+	
+	  <variable id="info_level"                type="int">-1</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">true</variable>
+	  <variable id="oasis_codes_id"            type="string" >toyoce</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context_nemo.xml"/>       <!--  NEMO       -->
+
+</simulation>
diff --git a/cfgs/SHARED/domain_def_nemo.xml b/cfgs/SHARED/domain_def_nemo.xml
index c1b78e0830f93b759293b92ed79f0020c4cea69b..539798e02528a5c64cf5acc080676dc80954d4d1 100644
--- a/cfgs/SHARED/domain_def_nemo.xml
+++ b/cfgs/SHARED/domain_def_nemo.xml
@@ -189,12 +189,14 @@
   <domain id="grid_F_inner" long_name="grid F inner"/>
 
   <!--   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>
+  <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 id="znl_T" domain_ref="gznl" > <zoom_domain id="znl_T"/> </domain>
+  <domain id="znl_W" domain_ref="gznl" > <zoom_domain id="znl_W"/> </domain>
 
 
   <!--   other grids   -->
diff --git a/cfgs/SHARED/field_def_nemo-ice.xml b/cfgs/SHARED/field_def_nemo-ice.xml
index 7625935ee388c71b5b9e4e010428c060bf2ef0a6..fbb926994019e48f3c4dc9e5276710a45df5bce8 100644
--- a/cfgs/SHARED/field_def_nemo-ice.xml
+++ b/cfgs/SHARED/field_def_nemo-ice.xml
@@ -50,10 +50,11 @@
       <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" />
+      <field id="iceepnd"      long_name="melt pond effective concentration"                       standard_name="sea_ice_meltpond_effective_concentration"  unit=""  />
+      <field id="dvpn_mlt"     long_name="pond volume tendency due to surface melt"                standard_name="sea_ice_pondvolume_tendency_melt"          unit="cm/d" />
+      <field id="dvpn_lid"     long_name="pond volume tendency due to exchanges with lid"          standard_name="sea_ice_pondvolume_tendency_lids"          unit="cm/d" />
+      <field id="dvpn_rnf"     long_name="pond volume tendency due to runoff"                      standard_name="sea_ice_pondvolume_tendency_runoff"        unit="cm/d" />
+      <field id="dvpn_drn"     long_name="pond volume tendency due to drainage"                    standard_name="sea_ice_pondvolume_tendency_drainage"      unit="cm/d" />
 
       <!-- heat -->
       <field id="icetemp"      long_name="Mean ice temperature"                                                                                              unit="degC" detect_missing_value="true" />
@@ -95,6 +96,10 @@
       <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=""  />
 
+      <field id="isig1"        long_name="1st principal stress component for EVP rhg"                                                                        unit=""     />
+      <field id="isig2"        long_name="2nd principal stress component for EVP rhg"                                                                        unit=""     />
+      <field id="isig3"        long_name="convergence measure for EVP rheology (must be around 1)"                                                           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" />
@@ -188,6 +193,22 @@
       <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_pot"    unit="degC" />
+      
+      <!-- EOS-80 -->
+      <field id="sss_m_pra"    unit="psu"  />
+      <!-- TEOS-10 -->
+      <field id="sss_m_abs"    unit="g/kg"  />
+      <!-- SEOS -->
+      <field id="sss_m_seos"   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" />
 
@@ -398,9 +419,17 @@
       <field field_ref="iceapnd"          name="siapnd" />
       <field field_ref="icehpnd"          name="sihpnd" />
       <field field_ref="icevpnd"          name="sivpnd" />
+      <field field_ref="iceepnd"          name="siepnd" />
       <field field_ref="iceage"           name="siage"  />
-      <field field_ref="sst_m"            name="sst_m"  />
-      <field field_ref="sss_m"            name="sss_m"  />
+      
+      <field id="sst_m_pot"    unit="degC" />
+      
+      <!-- EOS-80 -->
+      <field id="sss_m_pra"    unit="psu"  />
+      <!-- TEOS-10 -->
+      <field id="sss_m_abs"    unit="g/kg"  />
+      <!-- SEOS -->
+      <field id="sss_m_seos"   unit="psu"  />
 
       <!-- heat -->
       <field field_ref="icetemp"          name="sitemp" />
@@ -426,7 +455,7 @@
       <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="sidelt" />
+      <field field_ref="icedlt"           name="sidelta" />
 
       <!-- heat fluxes -->
       <field field_ref="qt_oce_ai"        name="qt_oce_ai"  />
diff --git a/cfgs/SHARED/field_def_nemo-oce.xml b/cfgs/SHARED/field_def_nemo-oce.xml
index 3380c6cbde5fb61c3adabf2937bada0d1f6f8368..abc8301f4133727d6ecf09ae577880b2f071015d 100644
--- a/cfgs/SHARED/field_def_nemo-oce.xml
+++ b/cfgs/SHARED/field_def_nemo-oce.xml
@@ -109,18 +109,30 @@ that are available in the tidal-forcing implementation (see
   <!-- 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="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="volcello"     long_name="Ocean Volume"                   standard_name="ocean_volume"   unit="m3"       grid_ref="grid_T_3D" />
+  
+    <!-- EOS80 -->
+    <field id="toce_pot"         long_name="potential temperature"           standard_name="sea_water_potential_temperature"      unit="degC"     grid_ref="grid_T_3D"/>
+    <field id="toce_pot_e3t"     long_name="potential temperature (thickness weighted)"                                           unit="degC"     grid_ref="grid_T_3D" > toce_pot * e3t </field >
+    <field id="soce_pra"         long_name="practical salinity"              standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/>
+    <field id="soce_pra_e3t"     long_name="practical salinity    (thickness weighted)"                                        unit="1e-3"     grid_ref="grid_T_3D" > soce_pra * e3t </field >
+    <!-- TEOS10 -->
+    <field id="toce_con"         long_name="conservative temperature"        standard_name="sea_water_conservative_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
+    <field id="toce_con_e3t"     long_name="conservative temperature (thickness weighted)"                                        unit="degC"     grid_ref="grid_T_3D" > toce_con * e3t </field >  
+    <field id="soce_abs"         long_name="absolute salinity"               standard_name="sea_water_absolute_salinity"       unit="g/kg"     grid_ref="grid_T_3D"/>
+    <field id="soce_abs_e3t"     long_name="absolute salinity    (thickness weighted)"                                         unit="g/kg"     grid_ref="grid_T_3D" > soce_abs * e3t </field >
+    <!-- SEOS -->
+    <field id="toce_seos"         long_name="temperature"        standard_name="sea_water_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
+    <field id="toce_seos_e3t"     long_name="temperature (thickness weighted)"                                        unit="degC"     grid_ref="grid_T_3D" > toce_seos * e3t </field >
+    <field id="soce_seos"         long_name="salinity"               standard_name="sea_water_salinity"       unit="1e-3"     grid_ref="grid_T_3D"/>
+    <field id="soce_seos_e3t"     long_name="salinity    (thickness weighted)"                                         unit="1e-3"     grid_ref="grid_T_3D" > soce_seos * 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" />
@@ -134,33 +146,78 @@ that are available in the tidal-forcing implementation (see
     <field id="sssgrad2"    long_name="square of module of surface salinity gradient"    unit="1e-6/m2"  grid_ref="grid_T_2D_inner"/>
     <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"  grid_ref="grid_T_2D_inner" />
+    <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"   grid_ref="grid_T_2D_inner" />
-    <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" grid_ref="grid_T_2D_inner" />
-    <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     grid_ref="grid_T_2D_inner" />
-    <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" grid_ref="grid_T_2D_inner" />
-    <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"   grid_ref="grid_T_2D_inner" />
-    <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)" grid_ref="grid_T_2D_inner" />
+    
+       <!-- EOS80 -->
+        <field id="sst_pot"          long_name="sea surface potential temperature"                            standard_name="sea_surface_temperature"             unit="degC"     />
+        <field id="sst2_pot"         long_name="square of sea surface potential temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst_pot * sst_pot </field >
+        <field id="sstmax_pot"       long_name="max of sea surface potential temperature"   field_ref="sst_pot"   operation="maximum"                                                 />
+        <field id="sstmin_pot"       long_name="min of sea surface potential temperature"   field_ref="sst_pot"   operation="minimum"                                                 />
+        <field id="sstgrad_pot"      long_name="module of potential sst gradient"                                                                                 unit="degC/m"  grid_ref="grid_T_2D_inner" />
+        <field id="sstgrad2_pot"     long_name="square of module of potential sst gradient"                                                                       unit="degC2/m2" grid_ref="grid_T_2D_inner" />
+        <field id="sbt_pot"          long_name="sea bottom potential temperature"                                                                                 unit="degC"  grid_ref="grid_T_2D_inner" />
+        <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" grid_ref="grid_T_2D_inner" />
+        <field id="sst_wl_pot"       long_name="Delta potential SST of warm layer"                                                                                unit="degC"     />
+        <field id="sst_cs_pot"       long_name="Delta potential SST of cool skin"                                                                                 unit="degC"     />
+	<field id="temp_3m_pot"      long_name="potential temperature at 3m"                                                                                      unit="degC"     />
+
+        <field id="sss_pra"          long_name="sea surface practical salinity"                               standard_name="sea_surface_practical_salinity"                unit="1e-3"     />
+        <field id="sss2_pra"         long_name="square of sea surface practical salinity"                                                                         unit="1e-6"      > sss_pra * sss_pra </field >
+        <field id="sssmax_pra"       long_name="max of sea surface practical salinity"      field_ref="sss_pra"   operation="maximum"                                                 />
+        <field id="sssmin_pra"       long_name="min of sea surface practical salinity"      field_ref="sss_pra"   operation="minimum"                                                 />
+        <field id="sbs_pra"          long_name="sea bottom practical salinity"                                                                                    unit="0.001"    grid_ref="grid_T_2D_inner" />
+        <field id="somint_pra"       long_name="vertical integral of practical salinity times density"        standard_name="integral_wrt_depth_of_product_of_density_and_practical_salinity"  unit="(kg m2) x (1e-3)" grid_ref="grid_T_2D_inner" /> 
+        
+         <!-- TEOS10 -->
+        <field id="sst_con"          long_name="sea surface conservative temperature"                            standard_name="sea_surface_conservative_temperature"             unit="degC"     />
+        <field id="sst2_con"         long_name="square of sea surface conservative temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst_con * sst_con </field >
+        <field id="sstmax_con"       long_name="max of sea surface conservative temperature"   field_ref="sst_con"   operation="maximum"                                                 />
+        <field id="sstmin_con"       long_name="min of sea surface conservative temperature"   field_ref="sst_con"   operation="minimum"                                                 />
+        <field id="sstgrad_con"      long_name="module of conservative sst gradient"                                                                                 unit="degC/m"  grid_ref="grid_T_2D_inner" />
+        <field id="sstgrad2_con"     long_name="square of module of conservative sst gradient"                                                                       unit="degC2/m2" grid_ref="grid_T_2D_inner" />
+        <field id="sbt_con"          long_name="sea bottom conservative temperature"                                                                                 unit="degC"    grid_ref="grid_T_2D_inner" />
+        <field id="tosmint_con"      long_name="vertical integral of conservative temperature times density"     standard_name="integral_wrt_depth_of_product_of_density_and_conservative_temperature"  unit="(kg m2) degree_C" grid_ref="grid_T_2D_inner" />
+        <field id="sst_wl_con"       long_name="Delta conservative SST of warm layer"                                                                                unit="degC"     />
+        <field id="sst_cs_con"       long_name="Delta conservative SST of cool skin"                                                                                 unit="degC"     />
+	<field id="temp_3m_con"      long_name="conservative temperature at 3m"                                                                                      unit="degC"     />
+
+        <field id="sss_abs"          long_name="sea surface absolute salinity"                               standard_name="sea_surface_absolute_salinity"                unit="g/kg"     />
+        <field id="sss2_abs"         long_name="square of sea surface absolute salinity"                                                                         unit="1e-6"      > sss_abs * sss_abs </field >
+        <field id="sssmax_abs"       long_name="max of sea surface absolute salinity"      field_ref="sss_abs"   operation="maximum"                                                 />
+        <field id="sssmin_abs"       long_name="min of sea surface absolute salinity"      field_ref="sss_abs"   operation="minimum"                                                 />
+        <field id="sbs_abs"          long_name="sea bottom absolute salinity"                                                                                    unit="g/kg"   grid_ref="grid_T_2D_inner" />
+        <field id="somint_abs"       long_name="vertical integral of absolute salinity times density"        standard_name="integral_wrt_depth_of_product_of_density_and_absolute_salinity"  unit="(kg m2) x (1e-3)" grid_ref="grid_T_2D_inner" />
+
+        <!-- SEOS -->
+        <field id="sst_seos"          long_name="sea surface temperature"                            standard_name="sea_surface_temperature"             unit="degC"     />
+        <field id="sst2_seos"         long_name="square of sea surface temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst_seos * sst_seos </field >
+        <field id="sstmax_seos"       long_name="max of sea surface temperature"   field_ref="sst_seos"   operation="maximum"                                                 />
+        <field id="sstmin_seos"       long_name="min of sea surface temperature"   field_ref="sst_seos"   operation="minimum"                                                 />
+        <field id="sstgrad_seos"      long_name="module of sst gradient"                                                                                 unit="degC/m"  grid_ref="grid_T_2D_inner" />
+        <field id="sstgrad2_seos"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" grid_ref="grid_T_2D_inner" />
+        <field id="sbt_seos"          long_name="sea bottom temperature"                                                                                 unit="degC"     grid_ref="grid_T_2D_inner" />
+        <field id="tosmint_seos"      long_name="vertical integral of temperature times density"     standard_name="integral_wrt_depth_of_product_of_density_and_temperature"  unit="(kg m2) degree_C" grid_ref="grid_T_2D_inner" />
+        <field id="sst_wl_seos"       long_name="Delta SST of warm layer"                                                                                unit="degC"     />
+        <field id="sst_cs_seos"       long_name="Delta SST of cool skin"                                                                                 unit="degC"     />
+	<field id="temp_3m_seos"      long_name="temperature at 3m"                                                                                      unit="degC"     />
+
+        <field id="sss_seos"          long_name="sea surface salinity"                               standard_name="sea_surface_salinity"                unit="1e-3"     />
+        <field id="sss2_seos"         long_name="square of sea surface salinity"                                                                         unit="1e-6"      > sss_seos * sss_seos </field >
+        <field id="sssmax_seos"       long_name="max of sea surface salinity"      field_ref="sss_seos"   operation="maximum"                                                 />
+        <field id="sssmin_seos"       long_name="min of sea surface salinity"      field_ref="sss_seos"   operation="minimum"                                                 />
+        <field id="sbs_seos"          long_name="sea bottom salinity"                                                                                    unit="0.001"   grid_ref="grid_T_2D_inner" />
+        <field id="somint_seos"       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)"  grid_ref="grid_T_2D_inner" />
+
 
-    <field id="taubot"       long_name="bottom stress module"   unit="N/m2"   grid_ref="grid_T_2D_inner" />
 
+
+    <field id="taubot"       long_name="bottom stress module"   unit="N/m2"   grid_ref="grid_T_2D_inner" />
+    <field id="htau"         long_name="htau length scale" unit="m"/>
     <!-- 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"     />
@@ -176,16 +233,34 @@ that are available in the tidal-forcing implementation (see
     <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"      grid_ref="grid_T_2D_inner" />
-    <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="PSU*kg/m2"    grid_ref="grid_T_2D_inner" />
-    <field id="salt2c"       long_name="square of Salt content vertically integrated"                                                                                                         unit="PSU2*kg/m2"   grid_ref="grid_T_2D_inner" />
+    <field id="mldzint_1"    long_name="Mixed Layer Depth interpolated"                     standard_name="ocean_mixed_layer_thickness"                                                       unit="m"      grid_ref="grid_T_2D"    />
+    <field id="mldzint_2"    long_name="Mixed Layer Depth interpolated"                     standard_name="ocean_mixed_layer_thickness"                                                       unit="m"      grid_ref="grid_T_2D"    />
+    <field id="mldzint_3"    long_name="Mixed Layer Depth interpolated"                     standard_name="ocean_mixed_layer_thickness"                                                       unit="m"      grid_ref="grid_T_2D"    />
+    <field id="mldzint_4"    long_name="Mixed Layer Depth interpolated"                     standard_name="ocean_mixed_layer_thickness"                                                       unit="m"      grid_ref="grid_T_2D"    />
+    <field id="mldzint_5"    long_name="Mixed Layer Depth interpolated"                     standard_name="ocean_mixed_layer_thickness"                                                       unit="m"      grid_ref="grid_T_2D"    />
+    <field id="mldhtc_1"     long_name="Mixed Layer Depth integrated heat content"          standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"   grid_ref="grid_T_2D"    />
+    <field id="mldhtc_2"     long_name="Mixed Layer Depth integrated heat content"          standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"   grid_ref="grid_T_2D"   />
+    <field id="mldhtc_3"     long_name="Mixed Layer Depth integrated heat content"          standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"   grid_ref="grid_T_2D"    />
+    <field id="mldhtc_4"     long_name="Mixed Layer Depth integrated heat content"          standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"   grid_ref="grid_T_2D"    />
+    <field id="mldhtc_5"     long_name="Mixed Layer Depth integrated heat content"          standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"   grid_ref="grid_T_2D"    />
+    <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"   grid_ref="grid_T_2D_inner" />
+    <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3.m"    grid_ref="grid_T_2D_inner" />
+    <field id="saltc2"       long_name="square of Salt content vertically integrated"                                                                                                         unit="1e-6.m2"   grid_ref="grid_T_2D_inner" />
 
     <!-- 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" />
+    <field id="rhop_e3t"     long_name="potential density (sigma0) thickness weighted"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D"> rhop * e3t </field>
+    <field id="N_2d"         long_name="Depth-mean N"                                                              unit="m/s" />
+    <field id="modslp"       long_name="sqrt( slpi^2 + slpj^2 )"                                                   unit="1"      grid_ref="grid_T_3D" />
+    <field id="RossRad"      long_name="Rossby radius"                                                             unit="m" />
+    <field id="RossRadlim"   long_name="Rossby radius (limited)"                                                   unit="m" />
+    <field id="Tclinic_recip" long_name="recip of baroclinic timescale"                                            unit="s-1" />
+    <field id="RR_GS"        long_name="Rossby radius / min(dx,dy)"                                                unit="1" />
 
     <!-- Energy - horizontal divergence -->
+    <field id="eken"         long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" />
     <field id="sKE"          long_name="surface kinetic energy"  standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_2D_inner" />
     <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" />
 
@@ -263,6 +338,10 @@ that are available in the tidal-forcing implementation (see
     <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water ( from isf to oce )" unit="W/m2"     grid_ref="grid_T_3D" />
     <field id="qconisf"         long_name="Conductive heat flux through the ice shelf ( from isf to oce )"    unit="W/m2"     />
 
+    <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
+    <field id="qhcisf"       long_name="Ice shelf heat content flux"                   unit="W/m2"     />
+    <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  />
+
     <!-- top boundary layer properties -->
     <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"     />
@@ -526,6 +605,15 @@ that are available in the tidal-forcing implementation (see
       <!-- sbcssm variables -->
       <field id="sst_m"    unit="degC" />
       <field id="sss_m"    unit="psu"  />
+
+      <field id="sst_m_pot"    unit="degC" /> 
+      <!-- EOS-80 -->
+      <field id="sss_m_pra"    unit="psu"  />
+      <!-- TEOS-10 -->
+      <field id="sss_m_abs"    unit="g/kg"  />
+      <!-- SEOS -->
+      <field id="sss_m_seos"   unit="psu"  />
+
       <field id="ssu_m"    unit="m/s"  />
       <field id="ssv_m"    unit="m/s"  />
       <field id="ssh_m"    unit="m"    />
@@ -597,8 +685,8 @@ that are available in the tidal-forcing implementation (see
     <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="uoce2_e3u"         long_name="ocean current along i-axis squared (thickness weighted)"                                       unit="m3/s2"      grid_ref="grid_U_3D"  > uoce * uoce * e3u </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"  grid_ref="grid_U_2D_inner" />
     <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             />
@@ -659,6 +747,8 @@ that are available in the tidal-forcing implementation (see
     <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="voce2_e3v"    long_name="ocean current along j-axis squared (thickness weighted)"                                            unit="m3/s2"      grid_ref="grid_V_3D"  > voce * 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"  grid_ref="grid_V_2D_inner" />
     <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             />
@@ -743,6 +833,8 @@ that are available in the tidal-forcing implementation (see
     <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" />
 
+    <!-- av_tmx: available with ln_zdftmx -->
+    <field id="av_tmx"      long_name="vertical diffusivity due to tidal mixing" unit="m2/s" />
 
     <!-- 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"    />
@@ -788,6 +880,31 @@ that are available in the tidal-forcing implementation (see
   <!-- 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"/>
+  
+  
+  <!-- product fields -->
+  <field_group id="diaprod">
+  
+    <field id="ut"           long_name="product_of_sea_water_x_velocity_and_potential_temperature"      unit="degree_C m/s"      grid_ref="grid_U_3D"   />
+    <field id="ut_e3u"       long_name="product_of_sea_water_x_velocity_and_potential_temperature * e3u"  unit="degree_C m2/s"   grid_ref="grid_U_3D" > ut * e3u </field >
+    <field id="us"           long_name="product_of_sea_water_x_velocity_and_salinity"                   unit="PSU m/s"       grid_ref="grid_U_3D"   />
+    <field id="us_e3u"       long_name="product_of_sea_water_x_velocity_and_salinity * e3u"             unit="PSU m2/s"      grid_ref="grid_U_3D" > us * e3u </field >
+    <field id="urhop"        long_name="product_of_sea_water_x_velocity_and_potential_density"          unit="(kg/m3).(m/s)" grid_ref="grid_U_3D"   />
+    <field id="urhop_e3u"    long_name="product_of_sea_water_x_velocity_and_potential_density * e3u"    unit="(kg/m3).(m2/s)"   grid_ref="grid_U_3D" > urhop * e3u </field >
+    <field id="vt"           long_name="product_of_sea_water_y_velocity_and_potential_temperature"      unit="degree_C m/s"      grid_ref="grid_V_3D"   />
+    <field id="vt_e3v"       long_name="product_of_sea_water_y_velocity_and_potential_temperature * e3v"  unit="degree_C m2/s"   grid_ref="grid_V_3D" > vt * e3v </field >
+    <field id="vs"           long_name="product_of_sea_water_y_velocity_and_salinity"                   unit="PSU m/s"       grid_ref="grid_V_3D"   />
+    <field id="vs_e3v"       long_name="product_of_sea_water_y_velocity_and_salinity * e3t"             unit="PSU m2/s"      grid_ref="grid_V_3D" > vs * e3v </field >
+    <field id="vrhop"        long_name="product_of_sea_water_y_velocity_and_potential_density"          unit="(kg/m3).(m/s)" grid_ref="grid_V_3D"   />
+    <field id="vrhop_e3v"    long_name="product_of_sea_water_y_velocity_and_potential_density * e3t"    unit="(kg/m3).(m2/s)"  grid_ref="grid_V_3D" > vrhop * e3v </field >
+    <field id="wt"           long_name="product_of_upward_sea_water_velocity_and_potential_temperature" unit="degree_C m/s"      grid_ref="grid_W_3D"   />
+    <field id="ws"           long_name="product_of_upward_sea_water_velocity_and_salinity"              unit="PSU m/s"       grid_ref="grid_W_3D"   />
+    <field id="wrhop"        long_name="product_of_upward_sea_water_velocity_and_potential_density"     unit="(kg/m3).(m/s)" grid_ref="grid_W_3D"   />
+    <field id="uv"           long_name="product_of_sea_water_x_velocity_and_sea_water_y_velocity"       unit="m2/s2   "      grid_ref="grid_T_3D"   />
+    <field id="uw"           long_name="product_of_upward_sea_water_velocity_and_sea_water_x_velocity"  unit="m2/s2   "      grid_ref="grid_W_3D"   />
+    <field id="vw"           long_name="product_of_upward_sea_water_velocity_and_sea_water_y_velocity"  unit="m2/s2"         grid_ref="grid_W_3D"   />
+  
+  </field_group>
 
   <field_group id="scalar"  grid_ref="grid_scalar"  >
     <!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly -->
@@ -1150,18 +1267,38 @@ that are available in the tidal-forcing implementation (see
   </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"                   />
+
+    <!-- EOS80 -->
+    <field field_ref="toce_pot"     name="thetao_pot"   long_name="sea_water_potential_temperature"  />
+    <field field_ref="soce_pra"     name="so_pra"       long_name="sea_water_practical_salinity"     />
+    <!-- TEOS10 -->
+    <field field_ref="toce_con"     name="thetao_con"   long_name="sea_water_conservative_temperature" />
+    <field field_ref="soce_abs"     name="so_con"       long_name="sea_water_absolute_salinity"      />
+    <!-- SEOS -->
+    <field field_ref="toce_seos"    name="thetao_seos"   long_name="sea_water_temperature"           />
+    <field field_ref="soce_seos"    name="so_seos"       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"                          />
+      <!-- EOS80 -->
+    <field field_ref="sst_pot"          name="tos_pot"      long_name="sea_surface_potential_temperature"                       />
+    <field field_ref="sst2_pot"         name="tossq_pot"    long_name="square_of_sea_surface_potential_temperature"             />
+    <field field_ref="sstgrad_pot"      name="tosgrad_pot"  long_name="module_of_sea_surface_potential_temperature_gradient"    />
+    <field field_ref="sss_pra"          name="sos_pra"      long_name="sea_surface_absolute_salinity"                          />
+    <!-- TEOS10 -->
+    <field field_ref="sst_con"          name="tos_con"      long_name="sea_surface_conservative_temperature"                       />
+    <field field_ref="sst2_con"         name="tossq_con"    long_name="square_of_sea_surface_conservative_temperature"             /> <field field_ref="sstgrad_con"      name="tosgrad_con" long_name="module_of_sea_surface_conservative_temperature_gradient"    />
+    <field field_ref="sss_abs"          name="sos_abs"      long_name="sea_surface_absolute_salinity"                          />
+    <!-- SEOS -->
+    <field field_ref="sst_seos"          name="tos_seos"      long_name="sea_surface_temperature"                       />    
+    <field field_ref="sst2_seos"         name="tossq_seos"    long_name="square_of_sea_surface_temperature"             />
+    <field field_ref="sstgrad_seos"      name="tosgrad_seos"  long_name="module_of_sea_surface_temperature_gradient"    />
+    <field field_ref="sss_seos"          name="sos_seos"      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"           />
@@ -1184,11 +1321,26 @@ that are available in the tidal-forcing implementation (see
   </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"                          />
+  <!-- EOS80 -->
+    <field id="toce_pot"           long_name="sea_water_potential_temperature"                grid_ref="grid_T_3D"      />
+    <field id="soce_pra"           long_name="sea_water_practical_salinity"                   grid_ref="grid_T_3D"      />
+    <field id="sst_pot"            long_name="sea_surface_potential_temperature"              grid_ref="grid_T_2D"      />
+    <field id="sst2_pot"           long_name="square_of_sea_surface_potential_temperature"    grid_ref="grid_T_2D"      />
+    <field id="sss_pra"            long_name="sea_surface_practical_salinity"                 grid_ref="grid_T_2D"      />
+  <!-- TEOS10 -->
+    <field id="toce_con"           long_name="sea_water_conservative_temperature"             grid_ref="grid_T_3D"      />
+    <field id="soce_abs"           long_name="sea_water_absolute_salinity"                    grid_ref="grid_T_3D"      />
+    <field id="sst_con"            long_name="sea_surface_conservative_temperature"           grid_ref="grid_T_2D"   unit="degC"   />                
+    <field id="sst2_con"           long_name="square_of_sea_surface_conservative_temperature" grid_ref="grid_T_2D"      /> 
+    <field id="sss_abs"            long_name="sea_surface_absolute_salinity"                  grid_ref="grid_T_2D"      />
+  <!-- SEOS -->
+    <field id="toce_seos"          long_name="sea_water_temperature"                        grid_ref="grid_T_3D"      />
+    <field id="soce_seos"          long_name="sea_water_salinity"                           grid_ref="grid_T_3D"      />
+    <field id="sst_seos"           long_name="sea_surface_temperature"                      grid_ref="grid_T_2D"      />
+    <field id="sst2_seos"          long_name="square_of_sea_surface_temperature"            grid_ref="grid_T_2D"      />
+    <field id="sss_seos"           long_name="sea_surface_salinity"                         grid_ref="grid_T_2D"      />
+    
+    <field field_ref="rhop"         name="sigma0"   long_name="potential density"                             />
     <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"           />
@@ -1222,6 +1374,30 @@ that are available in the tidal-forcing implementation (see
 
   <!-- TMB diagnostic output -->
   <field_group  id="1h_grid_T_tmb" grid_ref="grid_T_2D" operation="instant">
+
+
+    <!-- EOS80 -->
+    <field id="top_temp_pot"           name="votemper_top_pot"  unit="degC"  />
+    <field id="mid_temp_pot"           name="votemper_mid_pot"  unit="degC"  />
+    <field id="bot_temp_pot"           name="votemper_bot_pot"  unit="degC"  />
+    <field id="top_sal_pra"            name="vosaline_top_pra"  unit="psu"   />
+    <field id="mid_sal_pra"            name="vosaline_mid_pra"  unit="psu"   />
+    <field id="bot_sal_pra"            name="vosaline_bot_pra"  unit="psu"   />
+    <!-- TEOS10 -->
+    <field id="top_temp_con"           name="votemper_top_con"  unit="degC"  />
+    <field id="mid_temp_con"           name="votemper_mid_con"  unit="degC"  />
+    <field id="bot_temp_con"           name="votemper_bot_con"  unit="degC"  />
+    <field id="top_sal_abs"            name="vosaline_top_abs"  unit="g/kg"   />
+    <field id="mid_sal_abs"            name="vosaline_mid_abs"  unit="g/kg"   />
+    <field id="bot_sal_abs"            name="vosaline_bot_abs"  unit="g/kg"   />
+    <!-- SEOS -->
+    <field id="top_temp_seos"           name="votemper_top_seos"  unit="degC"  />
+    <field id="mid_temp_seos"           name="votemper_mid_seos"  unit="degC"  />
+    <field id="bot_temp_seos"           name="votemper_bot_seos"  unit="degC"  />
+    <field id="top_sal_seos"            name="vosaline_top_seos"  unit="psu"   />
+    <field id="mid_sal_seos"            name="vosaline_mid_seos"  unit="psu"   />
+    <field id="bot_sal_seos"            name="vosaline_bot_seos"  unit="psu"   />
+
     <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"  />
@@ -1247,10 +1423,19 @@ that are available in the tidal-forcing implementation (see
 
   <!-- 25h diagnostic output -->
   <field_group id="25h_grid_T" grid_ref="grid_T_3D_inner" 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_inner"      unit="m"    />
+    <field id="tempis25h"         name="insitu temperature 25h mean"       unit="degC" />
+
+    <!-- EOS80 -->
+    <field id="temper25h_pot"     name="potential temperature 25h mean"    unit="degC" />
+    <field id="salin25h_pra"      name="practical salinity 25h mean"       unit="psu"  />
+    <!-- TEOS10 -->
+    <field id="temper25h_con"     name="conservative temperature 25h mean" unit="degC" />
+    <field id="salin25h_abs"      name="absolute salinity 25h mean"        unit="g/kg"  />
+    <!-- SEOS -->
+    <field id="temper25h_seos"    name="temperature 25h mean"              unit="degC" />
+    <field id="salin25h_seos"     name="salinity 25h mean"                 unit="psu"  />
+    
+    <field id="ssh25h"            name="sea surface height 25h mean"       unit="m" grid_ref="grid_T_2D"   />
   </field_group>
 
   <field_group id="25h_grid_U" grid_ref="grid_U_3D_inner" operation="instant" >
diff --git a/cfgs/SHARED/grid_def_nemo.xml b/cfgs/SHARED/grid_def_nemo.xml
index d66b314f3725db6760d6959092b332822086aeb9..d1e35d92ec10468f27d43b2eb183fb1b344278de 100644
--- a/cfgs/SHARED/grid_def_nemo.xml
+++ b/cfgs/SHARED/grid_def_nemo.xml
@@ -418,5 +418,43 @@
       <duplicate_scalar />
     </axis>
   </grid>
+  
+  <grid id="grid_EqT" >
+    <domain id="EqT" />
+  </grid>
+  <!--  -->
+  <grid id="gznl_T_2D">
+    <domain id="ptr" />
+  </grid>
+  <!--  -->
+  <grid id="gznl_T_3D">
+    <domain id="ptr" />
+    <axis axis_ref="deptht" />
+  </grid>
+  <!--  -->
+  <grid id="gznl_W_2D">
+    <domain id="ptr" />
+  </grid>
+  <!--  -->
+  <grid id="gznl_W_3D">
+    <domain id="ptr" />
+    <axis axis_ref="depthw" />
+  </grid>
+  <grid id="vert_sum">
+    <domain id="grid_T"/>
+    <scalar>
+      <reduce_axis operation="sum" />
+    </scalar>
+  </grid>
+  <grid id="zoom_300">
+    <domain id="grid_T" />
+    <axis axis_ref="deptht300"/>
+  </grid>
+  <grid id="zoom_300_sum">
+    <domain id="grid_T" />
+    <scalar>
+      <reduce_axis operation="sum" />
+    </scalar>
+  </grid>
 
 </grid_definition>
diff --git a/cfgs/SHARED/namelist_ice_ref b/cfgs/SHARED/namelist_ice_ref
index 886aa1635ce584109dea8b1285c1c255bfdf105c..20db9b4aa235bbcbc95c330c89696f1564d6afb8 100644
--- a/cfgs/SHARED/namelist_ice_ref
+++ b/cfgs/SHARED/namelist_ice_ref
@@ -24,10 +24,10 @@
    jpl              =   5             !  number of ice  categories
    nlay_i           =   2             !  number of ice  layers
    nlay_s           =   2             !  number of snow layers
-   ln_virtual_itd   =   .false.       !  virtual ITD mono-category parameterization (jpl=1 only)
-                                      !     i.e. enhanced thermal conductivity & virtual thin ice melting
-   ln_icedyn        = .true.          !  ice dynamics (T) or not (F)
-   ln_icethd        = .true.          !  ice thermo   (T) or not (F)
+   ln_virtual_itd   =   .false.,       !  virtual ITD mono-category parameterization (jpl=1 only)
+                                      !     i.e. enhan.false.ced thermal conductivity & virtual thin ice melting
+   ln_icedyn        = .true.,          !  ice dynamics (T) or not (F)
+   ln_icethd        = .true.,          !  ice thermo   (T) or not (F)
    rn_amax_n        =   0.997         !  maximum tolerated ice concentration NH
    rn_amax_s        =   0.997         !  maximum tolerated ice concentration SH
    cn_icerst_in     = "restart_ice"   !  suffix of ice restart name (input)
@@ -38,9 +38,9 @@
 !------------------------------------------------------------------------------
 &namitd         !   Ice discretization
 !------------------------------------------------------------------------------
-   ln_cat_hfn       = .true.          !  ice categories are defined by a function following rn_himean**(-0.05)
+   ln_cat_hfn       = .true.,          !  ice categories are defined by a function following rn_himean**(-0.05)
       rn_himean     =   2.0           !  expected domain-average ice thickness (m)
-   ln_cat_usr       = .false.         !  ice categories are defined by rn_catbnd below (m)
+   ln_cat_usr       = .false.,         !  ice categories are defined by rn_catbnd below (m)
       rn_catbnd     =   0.,0.45,1.1,2.1,3.7,6.0  
    rn_himin         =   0.1           !  minimum ice thickness (m) allowed
    rn_himax         =  99.0           !  maximum ice thickness (m) allowed
@@ -48,14 +48,14 @@
 !------------------------------------------------------------------------------
 &namdyn         !   Ice dynamics
 !------------------------------------------------------------------------------
-   ln_dynALL        = .true.          !  dyn.: full ice dynamics                  (rheology + advection + ridging/rafting + correction)
-   ln_dynRHGADV     = .false.         !  dyn.: no ridge/raft & no corrections     (rheology + advection)
-   ln_dynADV1D      = .false.         !  dyn.: only advection 1D                  (Schar & Smolarkiewicz 1996 test case)
-   ln_dynADV2D      = .false.         !  dyn.: only advection 2D w prescribed vel.(rn_uvice + advection)
+   ln_dynALL        = .true.,          !  dyn.: full ice dynamics                  (rheology + advection + ridging/rafting + correction)
+   ln_dynRHGADV     = .false.,         !  dyn.: no ridge/raft & no corrections     (rheology + advection)
+   ln_dynADV1D      = .false.,         !  dyn.: only advection 1D                  (Schar & Smolarkiewicz 1996 test case)
+   ln_dynADV2D      = .false.,         !  dyn.: only advection 2D w prescribed vel.(rn_uvice + advection)
       rn_uice       =   0.5           !        prescribed ice u-velocity
       rn_vice       =   0.5           !        prescribed ice v-velocity
    rn_ishlat        =   2.            !  lbc : free slip (0) ; partial slip (0-2) ; no slip (2) ; strong slip (>2)
-   ln_landfast_L16  = .false.         !  landfast: parameterization from Lemieux 2016
+   ln_landfast_L16  = .false.,         !  landfast: parameterization from Lemieux 2016
       rn_lf_depfra  =   0.125         !        fraction of ocean depth that ice must reach to initiate landfast
                                       !          recommended range: [0.1 ; 0.25]
       rn_lf_bfr     =  15.            !        maximum bottom stress per unit volume [N/m3]
@@ -72,30 +72,30 @@
 &namdyn_rdgrft  !   Ice ridging/rafting
 !------------------------------------------------------------------------------
           ! -- ice_rdgrft_strength -- !
-   ln_str_H79       = .true.          !  ice strength param.: Hibler_79   => P = pstar*<h>*exp(-c_rhg*A)
+   ln_str_H79       = .true.,          !  ice strength param.: Hibler_79   => P = pstar*<h>*exp(-c_rhg*A)
       rn_pstar      =   2.0e+04       !     ice strength thickness parameter [N/m2]
       rn_crhg       =  20.0           !     ice strength conc. parameter (-)
-   ln_str_R75       = .false.         !  ice strength param.: Rothrock_75 => P = fn of potential energy
+   ln_str_R75       = .false.,         !  ice strength param.: Rothrock_75 => P = fn of potential energy
       rn_pe_rdg     =  17.0           !     coef accouting for frictional dissipation
-   ln_str_CST       = .false.         !  ice strength param.: Constant
+   ln_str_CST       = .false.,         !  ice strength param.: Constant
       rn_str        =   0.0           !     ice strength value
-   ln_str_smooth    = .true.          !  spatial smoothing of the ice strength
+   ln_str_smooth    = .true.,          !  spatial smoothing of the ice strength
                    ! -- ice_rdgrft -- !
-   ln_distf_lin     = .true.          !  redistribution function of ridged ice: linear (Hibler 1980)
-   ln_distf_exp     = .false.         !  redistribution function of ridged ice: exponential => not coded yet
+   ln_distf_lin     = .true.,         !  redistribution function of ridged ice: linear (Hibler, 1980)
+   ln_distf_exp     = .false.,        !  redistribution function of ridged ice: exponential (Lipscomb et al., 2007)
       rn_murdg      =   3.0           !     e-folding scale of ridged ice (m**.5)
    rn_csrdg         =   0.5           !  fraction of shearing energy contributing to ridging
               ! -- ice_rdgrft_prep -- !
-   ln_partf_lin     = .false.         !  Linear ridging participation function (Thorndike et al, 1975)
+   ln_partf_lin     = .false.,         !  Linear ridging participation function (Thorndike et al., 1975)
       rn_gstar      =   0.15          !     fractional area of thin ice being ridged 
-   ln_partf_exp     = .true.          !  Exponential ridging participation function (Lipscomb, 2007)
+   ln_partf_exp     = .true.,          !  Exponential ridging participation function (Lipscomb et al., 2007)
       rn_astar      =   0.03          !     exponential measure of ridging ice fraction [set to 0.05 if hstar=100]
-   ln_ridging       = .true.          !  ridging activated (T) or not (F)
+   ln_ridging       = .true.,          !  ridging activated (T) or not (F)
       rn_hstar      =  25.0           !     determines the maximum thickness of ridged ice [m] (Hibler, 1980)
       rn_porordg    =   0.3           !     porosity of newly ridged ice (Lepparanta et al., 1995)
       rn_fsnwrdg    =   0.5           !     snow volume fraction that survives in ridging
       rn_fpndrdg    =   1.0           !     pond fraction that survives in ridging (small a priori)
-   ln_rafting       = .true.          !  rafting activated (T) or not (F)
+   ln_rafting       = .true.,          !  rafting activated (T) or not (F)
       rn_hraft      =   0.75          !     threshold thickness for rafting [m]
       rn_craft      =   5.0           !     squeezing coefficient used in the rafting function
       rn_fsnwrft    =   0.5           !     snow volume fraction that survives in rafting
@@ -104,9 +104,9 @@
 !------------------------------------------------------------------------------
 &namdyn_rhg     !   Ice rheology
 !------------------------------------------------------------------------------
-   ln_rhg_EVP       = .true.          !  EVP rheology
-   ln_rhg_EAP       = .false.         !  EAP rheology
-      ln_aEVP       = .true.          !     adaptive rheology (Kimmritz et al. 2016 & 2017)
+   ln_rhg_EVP       = .true.,          !  EVP rheology
+   ln_rhg_EAP       = .false.,         !  EAP rheology
+      ln_aEVP       = .true.,          !     adaptive rheology (Kimmritz et al. 2016 & 2017)
       rn_creepl     =   2.0e-9        !     creep limit [1/s]
       rn_ecc        =   2.0           !     eccentricity of the elliptical yield curve          
       nn_nevp       = 100             !     number of EVP subcycles                             
@@ -117,7 +117,7 @@
                                       !     = 1  check at the main time step (output xml: uice_cvg)
                                       !     = 2  check at both main and rheology time steps (additional output: ice_cvg.nc)
                                       !          this option 2 asks a lot of communications between cpu
-   ln_rhg_VP        = .false.         !  VP rheology
+   ln_rhg_VP        = .false.,         !  VP rheology
       nn_vp_nout    = 10              !     number of outer iterations
       nn_vp_ninn    = 1500            !     number of inner iterations
       nn_vp_chkcvg  = 5               !     iteration step for convergence check
@@ -125,8 +125,8 @@
 !------------------------------------------------------------------------------
 &namdyn_adv     !   Ice advection
 !------------------------------------------------------------------------------
-   ln_adv_Pra       = .true.          !  Advection scheme (Prather)
-   ln_adv_UMx       = .false.         !  Advection scheme (Ultimate-Macho)
+   ln_adv_Pra       = .true.,          !  Advection scheme (Prather)
+   ln_adv_UMx       = .false.,         !  Advection scheme (Ultimate-Macho)
       nn_UMx        =   5             !     order of the scheme for UMx (1-5 ; 20=centered 2nd order)
 /
 !------------------------------------------------------------------------------
@@ -144,8 +144,8 @@
                                       !     = 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
-   ln_cndflx        = .false.         !  Use conduction flux as surface boundary conditions (i.e. for Jules coupling)
-      ln_cndemulate = .false.         !     emulate conduction flux (if not provided in the inputs)
+   ln_cndflx        = .false.,         !  Use conduction flux as surface boundary conditions (i.e. for Jules coupling)
+      ln_cndemulate = .false.,         !     emulate conduction flux (if not provided in the inputs)
    nn_qtrice        =   0             !  Solar flux transmitted thru the surface scattering layer:
                                       !     = 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)
@@ -153,26 +153,26 @@
 !------------------------------------------------------------------------------
 &namthd         !   Ice thermodynamics
 !------------------------------------------------------------------------------
-   ln_icedH         = .true.          !  activate ice thickness change from growing/melting (T) or not (F)
-   ln_icedA         = .true.          !  activate lateral melting param. (T) or not (F)
-   ln_icedO         = .true.          !  activate ice growth in open-water (T) or not (F)
-   ln_icedS         = .true.          !  activate brine drainage (T) or not (F)
+   ln_icedH         = .true.,          !  activate ice thickness change from growing/melting (T) or not (F)
+   ln_icedA         = .true.,          !  activate lateral melting param. (T) or not (F)
+   ln_icedO         = .true.,          !  activate ice growth in open-water (T) or not (F)
+   ln_icedS         = .true.,          !  activate brine drainage (T) or not (F)
    !
-   ln_leadhfx       = .true.          !  heat in the leads is used to melt sea-ice before warming the ocean
+   ln_leadhfx       = .true.,          !  heat in the leads is used to melt sea-ice before warming the ocean
 /
 !------------------------------------------------------------------------------
 &namthd_zdf     !   Ice heat diffusion
 !------------------------------------------------------------------------------
-   ln_zdf_BL99      = .true.          !  Heat diffusion follows Bitz and Lipscomb 1999
-   ln_cndi_U64      = .false.         !  sea ice thermal conductivity: k = k0 + beta.S/T            (Untersteiner, 1964)
-   ln_cndi_P07      = .true.          !  sea ice thermal conductivity: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007)
+   ln_zdf_BL99      = .true.,          !  Heat diffusion follows Bitz and Lipscomb 1999
+   ln_cndi_U64      = .false.,         !  sea ice thermal conductivity: k = k0 + beta.S/T            (Untersteiner, 1964)
+   ln_cndi_P07      = .true.,          !  sea ice thermal conductivity: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007)
    rn_cnd_s         =   0.31          !  thermal conductivity of the snow (0.31 W/m/K, Maykut and Untersteiner, 1971)
                                       !     Obs: 0.1-0.5 (Lecomte et al, JAMES 2013)
    rn_kappa_i       =   1.0           !  radiation attenuation coefficient in sea ice                     [1/m]
    rn_kappa_s       =  10.0           !  nn_qtrice = 0: radiation attenuation coefficient in snow         [1/m]
    rn_kappa_smlt    =   7.0           !  nn_qtrice = 1: radiation attenuation coefficient in melting snow [1/m]
    rn_kappa_sdry    =  10.0           !                 radiation attenuation coefficient in dry snow     [1/m]
-   ln_zdf_chkcvg    = .false.         !  check convergence of heat diffusion scheme (outputs: tice_cvgerr, tice_cvgstp)
+   ln_zdf_chkcvg    = .false.,         !  check convergence of heat diffusion scheme (outputs: tice_cvgerr, tice_cvgstp)
 /
 !------------------------------------------------------------------------------
 &namthd_da      !   Ice lateral melting
@@ -189,7 +189,7 @@
 &namthd_do      !   Ice growth in open water
 !------------------------------------------------------------------------------
    rn_hinew         =   0.1           !  thickness for new ice formation in open water (m), must be larger than rn_himin
-   ln_frazil        = .false.         !  Frazil ice parameterization (ice collection as a function of wind)
+   ln_frazil        = .false.,         !  Frazil ice parameterization (ice collection as a function of wind)
       rn_maxfraz    =   1.0           !     maximum fraction of frazil ice collecting at the ice base
       rn_vfraz      =   0.417         !     thresold drift speed for frazil ice collecting at the ice bottom (m/s)
       rn_Cfraz      =   5.0           !     squeezing coefficient for frazil ice collecting at the ice bottom
@@ -212,22 +212,25 @@
 !------------------------------------------------------------------------------
 &namthd_pnd     !   Melt ponds
 !------------------------------------------------------------------------------
-   ln_pnd            = .true.         !  activate melt ponds or not
-      ln_pnd_TOPO    = .false.        !  topographic melt ponds
-      ln_pnd_LEV     = .true.         !  level ice melt ponds
+   ln_pnd            = .true.,         !  activate melt ponds or not
+      ln_pnd_TOPO    = .false.,        !  topographic melt ponds
+      ln_pnd_LEV     = .true.,         !  level ice melt ponds
          rn_apnd_min =   0.15         !     minimum meltwater fraction contributing to pond growth (TOPO and LEV)
          rn_apnd_max =   0.85         !     maximum meltwater fraction contributing to pond growth (TOPO and LEV)
          rn_pnd_flush=   0.1          !     pond flushing efficiency (tuning parameter) (LEV)
-      ln_pnd_CST     = .false.        !  constant  melt ponds
+      ln_pnd_CST     = .false.,        !  constant  melt ponds
          rn_apnd     =   0.2          !     prescribed pond fraction, at Tsu=0 degC
          rn_hpnd     =   0.05         !     prescribed pond depth,    at Tsu=0 degC
-      ln_pnd_lids    = .true.         !  frozen lids on top of the ponds (only for ln_pnd_LEV)
-      ln_pnd_alb     = .true.         !  effect of melt ponds on ice albedo
+      ln_pnd_lids    = .true.,         !  frozen lids on top of the ponds (only for ln_pnd_LEV)
+      ln_pnd_alb     = .true.,         !  effect of melt ponds on ice albedo
+      nn_pnd_brsal   = 0              !  brine salinity formulation 0 = Consistent expression with SI3 
+                                      !                                 (linear liquidus)
+                                      !                             1 = used in GOSI9
 /
 !------------------------------------------------------------------------------
 &namini         !   Ice initialization
 !------------------------------------------------------------------------------
-   ln_iceini        = .true.          !  activate ice initialization (T) or not (F)
+   ln_iceini        = .true.,          !  activate ice initialization (T) or not (F)
    nn_iceini_file   =   0             !     0 = Initialise sea ice based on SSTs
                                       !     1 = Initialise sea ice from single category netcdf file
                                       !     2 = Initialise sea ice from multi category restart file
@@ -280,12 +283,12 @@
 !------------------------------------------------------------------------------
 &namdia         !   Diagnostics
 !------------------------------------------------------------------------------
-   ln_icediachk     = .false.         !  check online heat, mass & salt budgets
+   ln_icediachk     = .false.,         !  check online heat, mass & salt budgets
       !                               !   rate of ice spuriously gained/lost at each time step => rn_icechk=1 <=> 1.e-6 m/hour
       rn_icechk_cel =  1.             !     check at each gridcell          (1.e-06m/h)=> stops the code if violated (and writes a file)
       rn_icechk_glo =  1.e-04         !     check over the entire ice cover (1.e-10m/h)=> only prints warnings
-   ln_icediahsb     = .false.         !  output the heat, mass & salt budgets (T) or not (F)
-   ln_icectl        = .false.         !  ice points output for debug (T or F)
+   ln_icediahsb     = .false.,         !  output the heat, mass & salt budgets (T) or not (F)
+   ln_icectl        = .false.,         !  ice points output for debug (T or F)
       iiceprt       =  10             !     i-index for debug
       jiceprt       =  10             !     j-index for debug
 /
diff --git a/cfgs/SHARED/namelist_ref b/cfgs/SHARED/namelist_ref
index 76946a986c3ad9a3531935be57da0e2f0f61ea79..5dccf858ced5de69e3aefc3250c80e27e1efccd0 100644
--- a/cfgs/SHARED/namelist_ref
+++ b/cfgs/SHARED/namelist_ref
@@ -40,8 +40,8 @@
    nn_date0    =  010101   !  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    =       0   !  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)
+   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    =    0     !  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
@@ -51,7 +51,7 @@
       cn_ocerst_out   = "restart"   !  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)
+   ln_rst_list = .false.,   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
    nn_stock    =       0   !  used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
       !                          !    =  0 force to write restart files only at the end of the run
       !                          !    = -1 do not do any restart
@@ -59,69 +59,70 @@
    nn_write    =       0   !  used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
       !                          !    =  0 force to write output files only at the end of the run
       !                          !    = -1 do not do any output file
-   ln_mskland  = .false.   !  mask land points in NetCDF outputs
-   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
+   ln_mskland  = .false.,   !  mask land points in NetCDF outputs
+   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)
+   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
+   ln_rst_eos = .TRUE.,     ! check if the equation of state used to produce the restart is consistent with model
 /
 !-----------------------------------------------------------------------
 &namdom        !   time and space domain
 !-----------------------------------------------------------------------
-   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time
+   ln_linssh   = .false.,   !  =T  linear free surface  ==>>  model level are fixed in time
    !
    rn_Dt       = 5400.     !  time step for the dynamics and tracer
    rn_atfp     =    0.1    !  asselin time filter parameter
    !
-   ln_crs      = .false.   !  Logical switch for coarsening module      (T => fill namcrs)
-   ln_c1d      = .false.   !  Single column domain (1x1pt)              (T => fill namc1d)
+   ln_crs      = .false.,   !  Logical switch for coarsening module      (T => fill namcrs)
+   ln_c1d      = .false.,   !  Single column domain (1x1pt)              (T => fill namc1d)
    !
-   ln_meshmask = .true.   !  =T create a mesh file
+   ln_meshmask = .true.,   !  =T create a mesh file
 /
 !-----------------------------------------------------------------------
 &namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
 !-----------------------------------------------------------------------
-   ln_read_cfg = .false.     !  (=T) read the domain configuration file
+   ln_read_cfg = .false.,     !  (=T) read the domain configuration file
       !                      !  (=F) user defined configuration           (F => create/check namusr_def)
       cn_domcfg = "domain_cfg"  ! domain configuration filename
       !
-      ln_closea    = .false. !  (=T => fill namclo) 
+      ln_closea    = .false., !  (=T => fill namclo) 
       !                      !  (=F) no control of net precip/evap over closed sea
       !
-   ln_write_cfg = .false.    !  (=T) create the domain configuration file
+   ln_write_cfg = .false.,    !  (=T) create the domain configuration file
       cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
       !
-   ln_use_jattr = .false.    !  use (T) the file attribute: open_ocean_jstart, if present
+   ln_use_jattr = .false.,    !  use (T) the file attribute: open_ocean_jstart, if present
    !                         !  in netcdf input files, as the start j-row for reading
 /
 !-----------------------------------------------------------------------
 &namtile        !   parameters of the tiling
 !-----------------------------------------------------------------------
-   ln_tile = .false.     !  Use tiling (T) or not (F)
+   ln_tile = .false.,     !  Use tiling (T) or not (F)
    nn_ltile_i = 99999    !  Length of tiles in i
    nn_ltile_j = 10       !  Length of tiles in j
 /
 !-----------------------------------------------------------------------
 &namclo        !   parameters of the closed sea (cs) behavior                (default: OFF)
 !-----------------------------------------------------------------------
-   ln_maskcs = .false.        ! (=T) cs are masked ; So, in this case ln_mask_csundef and ln_clo_rnf have no effect.
+   ln_maskcs = .false.,        ! (=T) cs are masked ; So, in this case ln_mask_csundef and ln_clo_rnf have no effect.
       !                       ! (=F => set ln_mask_csundef and ln_clo_rnf) 
       !                       ! cs masks are read and net evap/precip over closed sea spread out depending on domain_cfg.nc masks.
       !                       ! See ln_mask_csundef and ln_clo_rnf for specific option related to this case
       !
-      ln_mask_csundef = .true.   ! (=T) undefined closed seas are masked ; 
+      ln_mask_csundef = .true.,   ! (=T) undefined closed seas are masked ; 
       !                          ! (=F) undefined closed seas are kept and no specific treatment is done for these closed seas
       !
-      ln_clo_rnf = .true.        ! (=T) river mouth specified in domain_cfg.nc masks (rnf and emp case) are added to the runoff mask.
+      ln_clo_rnf = .true.,        ! (=T) river mouth specified in domain_cfg.nc masks (rnf and emp case) are added to the runoff mask.
       !                          !      allow the treatment of closed sea outflow grid-points to be the same as river mouth grid-points
 /
 !-----------------------------------------------------------------------
 &namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF)
 !-----------------------------------------------------------------------
    !                       ! =T  read T-S fields for:
-   ln_tsd_init = .false.         !  ocean initialisation
-   ln_tsd_dmp  = .false.         !  T-S restoring   (see namtra_dmp)
+   ln_tsd_init = .false.,         !  ocean initialisation
+   ln_tsd_dmp  = .false.,         !  T-S restoring   (see namtra_dmp)
 
    cn_dir      = './'      !  root directory for the T-S data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -133,9 +134,9 @@
 !-----------------------------------------------------------------------
 &namwad        !   Wetting and Drying (WaD)                             (default: OFF)
 !-----------------------------------------------------------------------
-   ln_wd_dl    = .false.   !  T/F activation of directional limiter
-   ln_wd_dl_bc = .false.   !  T/F Directional limiter Baroclinic option
-   ln_wd_dl_rmp = .false.  !  T/F Turn on directional limiter ramp
+   ln_wd_dl    = .false.,   !  T/F activation of directional limiter
+   ln_wd_dl_bc = .false.,   !  T/F Directional limiter Baroclinic option
+   ln_wd_dl_rmp = .false.,  !  T/F Turn on directional limiter ramp
    rn_wdmin0   =  0.30     !  depth at which WaD starts
    rn_wdmin1   =  0.2      !  Minimum wet depth on dried cells
    rn_wdmin2   =  0.0001   !  Tolerance of min wet depth on dried cells
@@ -152,11 +153,11 @@
       !                    !  0, coarse grid is binned with preferential treatment of the north fold
       !                    !  1, coarse grid is binned with centering at the equator
       !                    !    Symmetry with nn_facty being odd-numbered. Asymmetry with even-numbered nn_facty.
-   ln_msh_crs  = .false.   ! =T create a mesh & mask file
+   ln_msh_crs  = .false.,   ! =T create a mesh & mask file
    nn_crs_kz   = 0         ! 0, MEAN of volume boxes
       !                    ! 1, MAX of boxes
       !                    ! 2, MIN of boxes
-   ln_crs_wn   = .true.    ! wn coarsened (T) or computed using horizontal divergence ( F )
+   ln_crs_wn   = .true.,    ! wn coarsened (T) or computed using horizontal divergence ( F )
 /
 !-----------------------------------------------------------------------
 &namc1d        !   1D configuration options                             (ln_c1d =T default: PAPA station)
@@ -167,14 +168,14 @@
 !-----------------------------------------------------------------------
 &namc1d_dyndmp !   U & V newtonian damping                              (ln_c1d =T default: OFF)
 !-----------------------------------------------------------------------
-   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F)
+   ln_dyndmp   =  .false.,  !  add a damping term (T) or not (F)
 /
 !-----------------------------------------------------------------------
 &namc1d_uvd    !   data: U & V currents                                 (ln_c1d =T default: OFF)
 !-----------------------------------------------------------------------
    !                       !  =T read U-V fields for:
-   ln_uvd_init   = .false.       !  ocean initialisation
-   ln_uvd_dyndmp = .false.       !  U-V restoring
+   ln_uvd_init   = .false.,       !  ocean initialisation
+   ln_uvd_dyndmp = .false.,       !  U-V restoring
 
    cn_dir      = './'      !  root directory for the U-V data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -208,13 +209,13 @@
    nn_fsbc     = 2         !  frequency of SBC module call
       !                    !  (control sea-ice & iceberg model call)
                      ! Type of air-sea fluxes
-   ln_usr      = .false.   !  user defined formulation                  (T => check usrdef_sbc)
-   ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx )
-   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
-   ln_abl      = .false.   !  ABL  formulation                          (T => fill namsbc_abl )
+   ln_usr      = .false.,   !  user defined formulation                  (T => check usrdef_sbc)
+   ln_flx      = .false.,   !  flux formulation                          (T => fill namsbc_flx )
+   ln_blk      = .false.,   !  Bulk formulation                          (T => fill namsbc_blk )
+   ln_abl      = .false.,   !  ABL  formulation                          (T => fill namsbc_abl )
       !              ! Type of coupling (Ocean/Ice/Atmosphere) :
-   ln_cpl      = .false.   !  atmosphere coupled   formulation          ( requires key_oasis3 )
-   ln_mixcpl   = .false.   !  forced-coupled mixed formulation          ( requires key_oasis3 )
+   ln_cpl      = .false.,   !  atmosphere coupled   formulation          ( requires key_oasis3 )
+   ln_mixcpl   = .false.,   !  forced-coupled mixed formulation          ( requires key_oasis3 )
    nn_components = 0       !  configuration of the opa-sas OASIS coupling
       !                    !  =0 no opa-sas OASIS coupling: default single executable config.
       !                    !  =1 opa-sas OASIS coupling: multi executable config., OCE component
@@ -223,18 +224,18 @@
    nn_ice      = 0         !  =0 no ice boundary condition
       !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
       !                    !  =2 or 3 for SI3 and CICE, respectively
-   ln_ice_embd = .false.   !  =T embedded sea-ice (pressure + mass and salt exchanges)
+   ln_ice_embd = .false.,   !  =T embedded sea-ice (pressure + mass and salt exchanges)
       !                    !  =F levitating ice (no pressure, mass and salt exchanges)
                      ! Misc. options of sbc :
-   ln_traqsr   = .false.   !  Light penetration in the ocean            (T => fill namtra_qsr)
-   ln_dm2dc    = .false.   !  daily mean to diurnal cycle on short wave
-   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
+   ln_traqsr   = .false.,   !  Light penetration in the ocean            (T => fill namtra_qsr)
+   ln_dm2dc    = .false.,   !  daily mean to diurnal cycle on short wave
+   ln_ssr      = .false.,   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
    nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
       !                    !     =1 global mean of e-p-r set to zero at each time step
       !                    !     =2 annual global mean of e-p-r set to zero
-   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
-   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
-   ln_wave     = .false.   !  Activate coupling with wave  (T => fill namsbc_wave)
+   ln_rnf      = .false.,   !  runoffs                                   (T => fill namsbc_rnf)
+   ln_apr_dyn  = .false.,   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
+   ln_wave     = .false.,   !  Activate coupling with wave  (T => fill namsbc_wave)
    nn_lsm      = 0         !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
                            !  =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
 /
@@ -255,37 +256,37 @@
 &namsbc_blk    !   namsbc_blk  generic Bulk formula          (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)
+   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
+      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)
+   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 
    !
-   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.)
+   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)
+   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)
+   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
    !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
@@ -317,13 +318,14 @@
    cn_ablrst_indir  = "."             !  directory to read   input abl restarts
    cn_ablrst_outdir = "."             !  directory to write output abl restarts
 
-   ln_rstart_abl  = .false.
-   ln_hpgls_frc   = .false.
-   ln_geos_winds  = .false.
-   ln_smth_pblh   = .false.
+   ln_rstart_abl  = .false.,
+   ln_hpgls_frc   = .false.,
+   ln_geos_winds  = .false.,
+   ln_smth_pblh   = .false.,
    nn_dyn_restore = 0         ! restoring option for dynamical ABL variables: = 0 no restoring
                               !                                               = 1 equatorial restoring
                               !                                               = 2 global restoring
+   rn_vfac       = 0.
    rn_ldyn_min   =  4.5       ! dynamics nudging magnitude inside the ABL [hour] (~3 rn_Dt)
    rn_ldyn_max   =  1.5       ! dynamics nudging magnitude above  the ABL [hour] (~1 rn_Dt)
    rn_ltra_min   =  4.5       ! tracers  nudging magnitude inside the ABL [hour] (~3 rn_Dt)
@@ -343,9 +345,9 @@
 &namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
 !-----------------------------------------------------------------------
    nn_cplmodel       =     1   !  Maximum number of models to/from which NEMO is potentially sending/receiving data
-   ln_usecplmask     = .false. !  use a coupling mask file to merge data received from several models
+   ln_usecplmask     = .false., !  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)
-   ln_scale_ice_flux = .false. !  use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration)
+   ln_scale_ice_flux = .false., !  use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration)
    nn_cats_cpl       =     5   !  Number of sea ice categories over which coupling is to be carried out (if not 1)
    !_____________!__________________________!____________!_____________!______________________!________!
    !             !        description       !  multiple  !    vector   !       vector         ! vector !
@@ -397,9 +399,9 @@
 !-----------------------------------------------------------------------
 &namsbc_sas    !   Stand-Alone Surface module: ocean data               (SAS_SRC  only)
 !-----------------------------------------------------------------------
-   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
+   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
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -431,13 +433,14 @@
 &namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T)
 !-----------------------------------------------------------------------
    !                       !  type of penetration                        (default: NO selection)
-   ln_qsr_rgb  = .false.      !  RGB light penetration (Red-Green-Blue)
-   ln_qsr_2bd  = .false.      !  2BD light penetration (two bands)
-   ln_qsr_bio  = .false.      !  bio-model light penetration
+   ln_qsr_rgb  = .false.,      !  RGB light penetration (Red-Green-Blue)
+   ln_qsr_2bd  = .false.,      !  2BD light penetration (two bands)
+   ln_qsr_bio  = .false.,      !  bio-model light penetration
    !                       !  RGB & 2BD choices:
    rn_abs      =   0.58       !  RGB & 2BD: fraction absorbed in the very near surface
    rn_si0      =   0.35       !  RGB & 2BD: shortess depth of extinction
    nn_chldta   =      0       !  RGB : Chl data (=1) or cst value (=0)
+   rn_chl_conc =   0.05       !  Chlorophyll concentration (for nn_chldta=0)
    rn_si1      =   23.0       !  2BD : longest depth of extinction
 
    cn_dir      = './'      !  root directory for the chlorophyl data location
@@ -454,7 +457,7 @@
    nn_sssr     =     0     !  add a damping term to the surface freshwater flux (=2)
       !                    !  or to SSS only (=1) or no damping term (=0)
       rn_deds     =  -166.67  !  magnitude of the damping on salinity   [mm/day]
-      ln_sssr_bnd =  .true.   !  flag to bound erp term (associated with nn_sssr=2)
+      ln_sssr_bnd =  .true.,   !  flag to bound erp term (associated with nn_sssr=2)
       rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day]
       nn_sssr_ice =   1       ! control of sea surface restoring under sea-ice
                               ! 0 = no restoration under ice : * (1-icefrac)
@@ -471,15 +474,15 @@
 !-----------------------------------------------------------------------
 &namsbc_rnf    !   runoffs                                              (ln_rnf =T)
 !-----------------------------------------------------------------------
-   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_mouth = .false.,   !  specific treatment at rivers mouths
       rn_hrnf     =  15.e0     !  depth over which enhanced vertical mixing is used    (ln_rnf_mouth=T)
       rn_avt_rnf  =   1.e-3    !  value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
    rn_rfact     =   1.e0    !  multiplicative factor for runoff
-   ln_rnf_depth = .false.   !  read in depth information for runoff
-   ln_rnf_tem   = .false.   !  read in temperature information for runoff
-   ln_rnf_sal   = .false.   !  read in salinity information for runoff
-   ln_rnf_icb   = .false.   !  read iceberg flux
-   ln_rnf_depth_ini = .false.  ! compute depth at initialisation from runoff file
+   ln_rnf_depth = .false.,   !  read in depth information for runoff
+   ln_rnf_tem   = .false.,   !  read in temperature information for runoff
+   ln_rnf_sal   = .false.,   !  read in salinity information for runoff
+   ln_rnf_icb   = .false.,   !  read iceberg flux
+   ln_rnf_depth_ini = .false.,  ! compute depth at initialisation from runoff file
       rn_rnf_max  = 5.735e-4   !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
       rn_dep_max  = 150.       !  depth over which runoffs is spread ( ln_rnf_depth_ini = .true )
       nn_rnf_depth_file = 0    !  create (=1) a runoff depth file or not (=0)
@@ -499,8 +502,8 @@
 &namsbc_apr    !   Atmospheric pressure used as ocean forcing           (ln_apr_dyn =T)
 !-----------------------------------------------------------------------
    rn_pref     = 101000.   !  reference atmospheric pressure   [N/m2]/
-   ln_ref_apr  = .false.   !  ref. pressure: global mean Patm (T) or a constant (F)
-   ln_apr_obc  = .false.   !  inverse barometer added to OBC ssh data
+   ln_ref_apr  = .false.,   !  ref. pressure: global mean Patm (T) or a constant (F)
+   ln_apr_obc  = .false.,   !  inverse barometer added to OBC ssh data
 
    cn_dir = './'        !  root directory for the Patm data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -520,13 +523,13 @@
    !
    ! ---------------- ice shelf melt formulation -------------------------------
    !
-   ln_isf = .false.           ! activate ice shelf module
-      ln_isfdebug = .false.      ! add debug print in ISF code (global min/max/sum of specific variable)
+   ln_isf = .false.,           ! activate ice shelf module
+      ln_isfdebug = .false.,      ! add debug print in ISF code (global min/max/sum of specific variable)
       cn_isfdir   = './'         ! directory for all ice shelf input file
       !
       ! ---------------- cavities opened -------------------------------
       !
-      ln_isfcav_mlt = .false.    ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc)
+      ln_isfcav_mlt = .false.,    ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc)
          cn_isfcav_mlt = '3eq'   ! ice shelf melting formulation (spe/2eq/3eq/oasis)
          !                       ! spe = fwfisf is read from a forcing field ( melt > 0; freezing < 0 )
          !                       ! 2eq = ISOMIP  like: 2 equations formulation (Hunter et al., 2006 for a short description)
@@ -551,7 +554,7 @@
       !
       ! ---------------- cavities parametrised -------------------------------
       !
-      ln_isfpar_mlt = .false.   ! ice shelf melting parametrised
+      ln_isfpar_mlt = .false.,   ! ice shelf melting parametrised
          cn_isfpar_mlt = 'spe'  ! ice shelf melting parametrisation (spe/bg03/oasis)
          !                      ! spe   = fwfisf is read from a forcing field ( melt > 0; freezing < 0 )
          !                      ! bg03  = melt computed using Beckmann and Goosse parametrisation
@@ -578,26 +581,26 @@
       !
       ! ---------------- ice sheet coupling -------------------------------
       !
-      ln_isfcpl = .false.
+      ln_isfcpl = .false.,
          nn_drown       = 10        ! number of iteration of the extrapolation loop (fill the new wet cells)
-         ln_isfcpl_cons = .false.
+         ln_isfcpl_cons = .false.,
 /
 !-----------------------------------------------------------------------
 &namsbc_wave   ! External fields from wave model                        (ln_wave=T)
 !-----------------------------------------------------------------------
-   ln_sdw      = .false.       !  get the 2D Surf Stokes Drift & Compute the 3D stokes drift
-   ln_stcor    = .false.       !  add Stokes Coriolis and tracer advection terms
-   ln_cdgw     = .false.       !  Neutral drag coefficient read from wave model
-   ln_tauoc    = .false.       !  ocean stress is modified by wave induced stress
-   ln_wave_test= .false.       !  Test case with constant wave fields
+   ln_sdw      = .false.,       !  get the 2D Surf Stokes Drift & Compute the 3D stokes drift
+   ln_stcor    = .false.,       !  add Stokes Coriolis and tracer advection terms
+   ln_cdgw     = .false.,       !  Neutral drag coefficient read from wave model
+   ln_tauoc    = .false.,       !  ocean stress is modified by wave induced stress
+   ln_wave_test= .false.,       !  Test case with constant wave fields
 !
-   ln_charn    = .false.       !  Charnock coefficient read from wave model (IFS only)
-   ln_taw      = .false.       !  ocean stress is modified by wave induced stress (coupled mode)
-   ln_phioc    = .false.       !  TKE flux from wave model
-   ln_bern_srfc= .false.       !  wave induced pressure. Bernoulli head J term
-   ln_breivikFV_2016 = .false. !  breivik 2016 vertical stokes profile
-   ln_vortex_force = .false.   !  Vortex Force term 
-   ln_stshear  = .false.       !  include stokes shear in EKE computation
+   ln_charn    = .false.,       !  Charnock coefficient read from wave model (IFS only)
+   ln_taw      = .false.,       !  ocean stress is modified by wave induced stress (coupled mode)
+   ln_phioc    = .false.,       !  TKE flux from wave model
+   ln_bern_srfc= .false.,       !  wave induced pressure. Bernoulli head J term
+   ln_breivikFV_2016 = .false., !  breivik 2016 vertical stokes profile
+   ln_vortex_force = .false.,   !  Vortex Force term 
+   ln_stshear  = .false.,       !  include stokes shear in EKE computation
 !
    cn_dir      = './'      !  root directory for the waves data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -614,7 +617,7 @@
 !-----------------------------------------------------------------------
 &namberg       !   iceberg parameters                                   (default: OFF)
 !-----------------------------------------------------------------------
-   ln_icebergs = .false.      ! activate iceberg floats (force =F with "key_agrif")
+   ln_icebergs = .false.,      ! activate iceberg floats (force =F with "key_agrif")
    !
    !                          ! restart
    cn_icbrst_in     = "restart_icb" !  suffix of iceberg restart name (input)
@@ -623,7 +626,7 @@
    cn_icbrst_outdir = "./"          !  directory from which to read output ocean restarts          
    !
    !                          ! diagnostics:
-   ln_bergdia        = .true.        ! Calculate budgets
+   ln_bergdia        = .true.,        ! Calculate budgets
    nn_verbose_level  = 0             ! Turn on more verbose output if level > 0
    !
    ! nn_verbose_write and nn_sample_rate need to be a multiple of nn_fsbc
@@ -643,18 +646,18 @@
    !
    rn_rho_bergs            = 850.    ! Density of icebergs
    rn_LoW_ratio            = 1.5     ! Initial ratio L/W for newly calved icebergs
-   ln_operator_splitting   = .true.  ! Use first order operator splitting for thermodynamics
+   ln_operator_splitting   = .true.,  ! Use first order operator splitting for thermodynamics
    rn_bits_erosion_fraction = 0.     ! Fraction of erosion melt flux to divert to bergy bits
    rn_sicn_shift           = 0.      ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1)
-   ln_passive_mode         = .false. ! iceberg - ocean decoupling
+   ln_passive_mode         = .false., ! iceberg - ocean decoupling
    nn_test_icebergs        =  10     ! Create test icebergs of this class (-1 = no)
    !                                 ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2)
    rn_test_box             = 108.0,  116.0, -66.0, -58.0
-   ln_use_calving          = .false. ! Use calving data even when nn_test_icebergs > 0
+   ln_use_calving          = .false., ! Use calving data even when nn_test_icebergs > 0
    rn_speed_limit          = 0.      ! CFL speed limit for a berg (safe value is 0.4, see #2581)
    !
-   ln_M2016                = .false. ! use Merino et al. (2016) modification (use of 3d ocean data instead of only sea surface data)
-      ln_icb_grd           = .false. ! ground icb when icb bottom level hit oce bottom level (need ln_M2016 to be activated)
+   ln_M2016                = .false., ! use Merino et al. (2016) modification (use of 3d ocean data instead of only sea surface data)
+      ln_icb_grd           = .false., ! ground icb when icb bottom level hit oce bottom level (need ln_M2016 to be activated)
    !
    cn_dir      = './'      !  root directory for the calving data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -684,16 +687,16 @@
 !-----------------------------------------------------------------------
    !                       !  free slip  !   partial slip  !   no slip   ! strong slip
    rn_shlat    =  -9999.   !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
-   ln_vorlat   = .false.   !  consistency of vorticity boundary condition with analytical Eqs.
+   ln_vorlat   = .false.,   !  consistency of vorticity boundary condition with analytical Eqs.
 /
 !-----------------------------------------------------------------------
 &namagrif      !  AGRIF zoom                                            ("key_agrif")
 !-----------------------------------------------------------------------
-   ln_agrif_2way   = .true.  !  activate two way nesting
-   ln_init_chfrpar = .false. !  initialize child grids from parent
-   ln_vert_remap   = .false. !  use vertical remapping
-   ln_spc_dyn      = .false. !  use 0 as special value for dynamics
-   ln_chk_bathy    = .true.  !  =T  check the parent bathymetry
+   ln_agrif_2way   = .true.,  !  activate two way nesting
+   ln_init_chfrpar = .false., !  initialize child grids from parent
+   ln_vert_remap   = .false., !  use vertical remapping
+   ln_spc_dyn      = .false., !  use 0 as special value for dynamics
+   ln_chk_bathy    = .true.,  !  =T  check the parent bathymetry
    rn_sponge_tra   = 0.002   !  coefficient for tracer   sponge layer []
    rn_sponge_dyn   = 0.002   !  coefficient for dynamics sponge layer []
    rn_trelax_tra   = 0.01    !  inverse of relaxation time (in steps) for tracers []
@@ -702,29 +705,29 @@
 !-----------------------------------------------------------------------
 &nam_tide      !   tide parameters                                      (default: OFF)
 !-----------------------------------------------------------------------
-   ln_tide     = .false.      ! Activate tides
+   ln_tide     = .false.,      ! Activate tides
       nn_tide_var   = 1          !  Variant of tidal parameter set and tide-potential computation
       !                          !     (1: default; 0: compatibility with previous versions)
-      ln_tide_dia   = .false.    !  Enable tidal diagnostic output
-      ln_tide_pot   = .false.               !  use tidal potential forcing
+      ln_tide_dia   = .false.,    !  Enable tidal diagnostic output
+      ln_tide_pot   = .false.,               !  use tidal potential forcing
          rn_tide_gamma = 0.7                   ! Tidal tilt factor
-         ln_scal_load  = .false.               ! Use scalar approximation for
+         ln_scal_load  = .false.,               ! Use scalar approximation for
             rn_scal_load = 0.094               !     load potential
-         ln_read_load  = .false.               ! Or read load potential from file
+         ln_read_load  = .false.,               ! Or read load potential from file
             cn_tide_load = 'tide_LOAD_grid_T.nc'  ! filename for load potential
             !
-      ln_tide_ramp  = .false.               !  Use linear ramp for tides at startup
+      ln_tide_ramp  = .false.,               !  Use linear ramp for tides at startup
          rn_tide_ramp_dt = 0.               !  ramp duration in days
       sn_tide_cnames(1) = 'DUMMY'               !  name of constituent - all tidal components must be set in namelist_cfg
 /
 !-----------------------------------------------------------------------
 &nambdy        !  unstructured open boundaries                          (default: OFF)
 !-----------------------------------------------------------------------
-   ln_bdy         = .false.   !  Use unstructured open boundaries
+   ln_bdy         = .false.,   !  Use unstructured open boundaries
    nb_bdy         = 0         !  number of open boundary sets
-   ln_coords_file = .true.    !  =T : read bdy coordinates from file
+   ln_coords_file = .true.,    !  =T : read bdy coordinates from file
       cn_coords_file = 'coordinates.bdy.nc'  !  bdy coordinates files
-   ln_mask_file   = .false.   !  =T : read mask from file
+   ln_mask_file   = .false.,   !  =T : read mask from file
       cn_mask_file = ''        !  name of mask file (if ln_mask_file=.TRUE.)
    cn_dyn2d    = 'none'       !
    nn_dyn2d_dta   =  0        !  = 0, bdy data are equal to the initial state
@@ -741,20 +744,20 @@
    nn_ice_dta    =  0         !  = 0, bdy data are equal to the initial state
    !                          !  = 1, bdy data are read in 'bdydata   .nc' files
    !
-   ln_tra_dmp    =.false.     !  open boudaries conditions for tracers
-   ln_dyn3d_dmp  =.false.     !  open boundary condition for baroclinic velocities
+   ln_tra_dmp    =.false.,     !  open boudaries conditions for tracers
+   ln_dyn3d_dmp  =.false.,     !  open boundary condition for baroclinic velocities
    rn_time_dmp   =  1.        !  Damping time scale in days
    rn_time_dmp_out = 1.       !  Outflow damping time scale
    nn_rimwidth   = 10         !  width of the relaxation zone
-   ln_vol        = .false.    !  total volume correction (see nn_volctl parameter)
+   ln_vol        = .false.,    !  total volume correction (see nn_volctl parameter)
    nn_volctl     =  1         !  = 0, the total water flux across open boundaries is zero
 /
 !-----------------------------------------------------------------------
 &nambdy_dta    !  open boundaries - external data                       (see nam_bdy)
 !-----------------------------------------------------------------------
-   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+   ln_zinterp  = .false.,      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
    !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk
-   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components
+   ln_full_vel = .false.,      !  T if [uv]3d are "full" velocities and not only its baroclinic components
    !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
    !
    cn_dir      = 'bdydta/'    !  root directory for the BDY data location
@@ -792,7 +795,7 @@
 &nambdy_tide   !  tidal forcing at open boundaries                      (default: OFF)
 !-----------------------------------------------------------------------
    filtide          = 'bdydta/amm12_bdytide_'   !  file name root of tidal forcing files
-   ln_bdytide_2ddta = .false.                   !
+   ln_bdytide_2ddta = .false.,                   !
 /
 
 !!======================================================================
@@ -808,13 +811,13 @@
 !-----------------------------------------------------------------------
 &namdrg        !   top/bottom drag coefficient                          (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_drg_OFF  = .false.   !  free-slip       : Cd = 0                  (F => fill namdrg_bot
-   ln_lin      = .false.   !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top)
-   ln_non_lin  = .false.   !  non-linear  drag: Cd = Cd0 |U|
-   ln_loglayer = .false.   !  logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+   ln_drg_OFF  = .false.,   !  free-slip       : Cd = 0                  (F => fill namdrg_bot
+   ln_lin      = .false.,   !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top)
+   ln_non_lin  = .false.,   !  non-linear  drag: Cd = Cd0 |U|
+   ln_loglayer = .false.,   !  logarithmic drag: Cd = vkarmn/log(z/z0) |U|
    !
-   ln_drgimp   = .true.    !  implicit top/bottom friction flag
-      ln_drgice_imp = .true. ! implicit ice-ocean drag
+   ln_drgimp   = .true.,    !  implicit top/bottom friction flag
+      ln_drgice_imp = .true., ! implicit ice-ocean drag
 /
 !-----------------------------------------------------------------------
 &namdrg_top    !   TOP friction                                         (ln_drg_OFF =F & ln_isfcav=T)
@@ -824,7 +827,7 @@
    rn_Cdmax    =  0.1      !  drag value maximum [-] (logarithmic drag)
    rn_ke0      =  2.5e-3   !  background kinetic energy  [m2/s2] (non-linear cases)
    rn_z0       =  3.0e-3   !  roughness [m] (ln_loglayer=T)
-   ln_boost    = .false.   !  =T regional boost of Cd0 ; =F constant
+   ln_boost    = .false.,   !  =T regional boost of Cd0 ; =F constant
       rn_boost =  50.         !  local boost factor  [-]
 /
 !-----------------------------------------------------------------------
@@ -835,13 +838,13 @@
    rn_Cdmax    =  0.1      !  drag value maximum [-] (logarithmic drag)
    rn_ke0      =  2.5e-3   !  background kinetic energy  [m2/s2] (non-linear cases)
    rn_z0       =  3.e-3    !  roughness [m] (ln_loglayer=T)
-   ln_boost    = .false.   !  =T regional boost of Cd0 ; =F constant
+   ln_boost    = .false.,   !  =T regional boost of Cd0 ; =F constant
       rn_boost =  50.         !  local boost factor  [-]
 /
 !-----------------------------------------------------------------------
 &nambbc        !   bottom temperature boundary condition                (default: OFF)
 !-----------------------------------------------------------------------
-   ln_trabbc   = .false.   !  Apply a geothermal heating at the ocean bottom
+   ln_trabbc   = .false.,   !  Apply a geothermal heating at the ocean bottom
       nn_geoflx     = 2       !  geothermal heat flux: = 1 constant flux
       !                       !                        = 2 read variable flux [mW/m2]
       rn_geoflx_cst = 86.4e-3 !  Constant value of geothermal heat flux       [mW/m2]
@@ -855,7 +858,7 @@
 !-----------------------------------------------------------------------
 &nambbl        !   bottom boundary layer scheme                         (default: OFF)
 !-----------------------------------------------------------------------
-   ln_trabbl   = .false.   !  Bottom Boundary Layer parameterisation flag
+   ln_trabbl   = .false.,   !  Bottom Boundary Layer parameterisation flag
       nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
       nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
       rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s]
@@ -876,9 +879,9 @@
 !-----------------------------------------------------------------------
 &nameos        !   ocean Equation Of Seawater                           (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_teos10   = .false.         !  = Use TEOS-10
-   ln_eos80    = .false.         !  = Use EOS80
-   ln_seos     = .false.         !  = Use S-EOS (simplified Eq.)
+   ln_teos10   = .false.,         !  = Use TEOS-10
+   ln_eos80    = .false.,         !  = Use EOS80
+   ln_seos     = .false.,         !  = Use S-EOS (simplified Eq.)
                                  !
    !                     ! S-EOS coefficients (ln_seos=T):
    !                             !  rd(T,S,Z)*rho0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS
@@ -893,39 +896,39 @@
 !-----------------------------------------------------------------------
 &namtra_adv    !   advection scheme for tracer                          (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_traadv_OFF = .false. !  No tracer advection
-   ln_traadv_cen = .false. !  2nd order centered scheme
+   ln_traadv_OFF = .false., !  No tracer advection
+   ln_traadv_cen = .false., !  2nd order centered scheme
       nn_cen_h   =  4            !  =2/4, horizontal 2nd order CEN / 4th order CEN
       nn_cen_v   =  4            !  =2/4, vertical   2nd order CEN / 4th order COMPACT
-   ln_traadv_fct = .false. !  FCT scheme
+   ln_traadv_fct = .false., !  FCT scheme
       nn_fct_h   =  2            !  =2/4, horizontal 2nd / 4th order
       nn_fct_v   =  2            !  =2/4, vertical   2nd / COMPACT 4th order
-   ln_traadv_mus = .false. !  MUSCL scheme
-      ln_mus_ups = .false.       !  use upstream scheme near river mouths
-   ln_traadv_ubs = .false. !  UBS scheme
+   ln_traadv_mus = .false., !  MUSCL scheme
+      ln_mus_ups = .false.,       !  use upstream scheme near river mouths
+   ln_traadv_ubs = .false., !  UBS scheme
       nn_ubs_v   =  2            !  =2  , vertical 2nd order FCT / COMPACT 4th order
-   ln_traadv_qck = .false. !  QUICKEST scheme
+   ln_traadv_qck = .false., !  QUICKEST scheme
 /
 !-----------------------------------------------------------------------
 &namtra_ldf    !   lateral diffusion scheme for tracers                 (default: NO selection)
 !-----------------------------------------------------------------------
    !                       !  Operator type:
-   ln_traldf_OFF   = .false.   !  No explicit diffusion
-   ln_traldf_lap   = .false.   !    laplacian operator
-   ln_traldf_blp   = .false.   !  bilaplacian operator
+   ln_traldf_OFF   = .false.,   !  No explicit diffusion
+   ln_traldf_lap   = .false.,   !    laplacian operator
+   ln_traldf_blp   = .false.,   !  bilaplacian operator
    !
    !                       !  Direction of action:
-   ln_traldf_lev   = .false.   !  iso-level
-   ln_traldf_hor   = .false.   !  horizontal  (geopotential)
-   ln_traldf_iso   = .false.   !  iso-neutral (standard operator)
-   ln_traldf_triad = .false.   !  iso-neutral (triad    operator)
+   ln_traldf_lev   = .false.,   !  iso-level
+   ln_traldf_hor   = .false.,   !  horizontal  (geopotential)
+   ln_traldf_iso   = .false.,   !  iso-neutral (standard operator)
+   ln_traldf_triad = .false.,   !  iso-neutral (triad    operator)
    !
    !		       	         !  iso-neutral options:
-   ln_traldf_msc   = .false.   !  Method of Stabilizing Correction      (both operators)
+   ln_traldf_msc   = .false.,   !  Method of Stabilizing Correction      (both operators)
    rn_slpmax       =  0.01     !  slope limit                           (both operators)
-   ln_triad_iso    = .false.   !  pure horizontal mixing in ML              (triad only)
+   ln_triad_iso    = .false.,   !  pure horizontal mixing in ML              (triad only)
    rn_sw_triad     = 1         !  =1 switching triad ; =0 all 4 triads used (triad only)
-   ln_botmix_triad = .false.   !  lateral mixing on bottom                  (triad only)
+   ln_botmix_triad = .false.,   !  lateral mixing on bottom                  (triad only)
    !
    !                       !  Coefficients:
    nn_aht_ijk_t    = 0         !  space/time variation of eddy coefficient:
@@ -944,7 +947,7 @@
 !-----------------------------------------------------------------------
 &namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)       (default: OFF)
 !-----------------------------------------------------------------------
-   ln_mle      = .false.   ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+   ln_mle      = .false.,   ! (T) use the Mixed Layer Eddy (MLE) parameterisation
    rn_ce       = 0.06      ! magnitude of the MLE (typical value: 0.06 to 0.08)
    nn_mle      = 1         ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
    rn_lf       = 5.e+3     ! typical scale of mixed layer front (meters)                      (case rn_mle=0)
@@ -957,7 +960,7 @@
 !-----------------------------------------------------------------------
 &namtra_eiv    !   eddy induced velocity param.                         (default: OFF)
 !-----------------------------------------------------------------------
-   ln_ldfeiv   = .false.   ! use eddy induced velocity parameterization
+   ln_ldfeiv   = .false.,   ! use eddy induced velocity parameterization
       !
       !                        !  Coefficients:
       nn_aei_ijk_t    = 0           !  space/time variation of eddy coefficient:
@@ -971,12 +974,12 @@
       rn_Ue        = 0.02           !  lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
       rn_Le        = 200.e+3        !  lateral diffusive length   [m]   (nn_aht_ijk_t= 0, 10)
       !
-      ln_ldfeiv_dia =.false.   ! diagnose eiv stream function and velocities
+      ln_ldfeiv_dia =.false.,   ! diagnose eiv stream function and velocities
 /
 !-----------------------------------------------------------------------
 &namtra_dmp    !   tracer: T & S newtonian damping                      (default: OFF)
 !-----------------------------------------------------------------------
-   ln_tradmp   =  .false.  !  add a damping term (using resto.nc coef.)
+   ln_tradmp   =  .false.,  !  add a damping term (using resto.nc coef.)
       nn_zdmp  =    0         !  vertical shape =0    damping throughout the water column
       !                       !                 =1 no damping in the mixing layer (kz  criteria)
       !                       !                 =2 no damping in the mixed  layer (rho crieria)
@@ -998,16 +1001,16 @@
 !-----------------------------------------------------------------------
 &nam_vvl       !   vertical coordinate options                          (default: z-star)
 !-----------------------------------------------------------------------
-   ln_vvl_zstar  = .true.           !  z-star vertical coordinate
-   ln_vvl_ztilde = .false.          !  z-tilde vertical coordinate: only high frequency variations
-   ln_vvl_layer  = .false.          !  full layer vertical coordinate
-   ln_vvl_ztilde_as_zstar = .false. !  ztilde vertical coordinate emulating zstar
-   ln_vvl_zstar_at_eqtor  = .false. !  ztilde near the equator
+   ln_vvl_zstar  = .true.,           !  z-star vertical coordinate
+   ln_vvl_ztilde = .false.,          !  z-tilde vertical coordinate: only high frequency variations
+   ln_vvl_layer  = .false.,          !  full layer vertical coordinate
+   ln_vvl_ztilde_as_zstar = .false., !  ztilde vertical coordinate emulating zstar
+   ln_vvl_zstar_at_eqtor  = .false., !  ztilde near the equator
    rn_ahe3       =  0.0             !  thickness diffusion coefficient
    rn_rst_e3t    = 30.0             !  ztilde to zstar restoration timescale [days]
    rn_lf_cutoff  =  5.0             !  cutoff frequency for low-pass filter  [days]
    rn_zdef_max   =  0.9             !  maximum fractional e3t deformation
-   ln_vvl_dbg    = .false.          !  debug prints    (T/F)
+   ln_vvl_dbg    = .false.,          !  debug prints    (T/F)
    nn_vvl_interp =  2               !  interpolation method of scale factor anomalies at U/V/F points
                                     !  =0 linear even at the bottom (old)
                                     !  =1 linear with bottom correction
@@ -1016,24 +1019,24 @@
 !-----------------------------------------------------------------------
 &namdyn_adv    !   formulation of the momentum advection                (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_dynadv_OFF = .false. !  linear dynamics (no momentum advection)
-   ln_dynadv_vec = .false. !  vector form - 2nd centered scheme
+   ln_dynadv_OFF = .false., !  linear dynamics (no momentum advection)
+   ln_dynadv_vec = .false., !  vector form - 2nd centered scheme
      nn_dynkeg     = 0        ! grad(KE) scheme: =0   C2  ;  =1   Hollingsworth correction
-   ln_dynadv_cen2 = .false. !  flux form - 2nd order centered scheme
-   ln_dynadv_ubs  = .false. !  flux form - 3rd order UBS  OLD scheme
-   ln_dynadv_up3  = .false. !  flux form - 3rd order UBS  NEW scheme
+   ln_dynadv_cen2 = .false., !  flux form - 2nd order centered scheme
+   ln_dynadv_ubs  = .false., !  flux form - 3rd order UBS  OLD scheme
+   ln_dynadv_up3  = .false., !  flux form - 3rd order UBS  NEW scheme
 /
 !-----------------------------------------------------------------------
 &namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_dynvor_ene = .false. !  energy    conserving scheme
-   ln_dynvor_ens = .false. !  enstrophy conserving scheme
-   ln_dynvor_mix = .false. !  mixed scheme
-   ln_dynvor_enT = .false. !  energy conserving scheme (T-point)
-   ln_dynvor_eeT = .false. !  energy conserving scheme (een using e3t)
-   ln_dynvor_een = .false. !  energy & enstrophy scheme
+   ln_dynvor_ene = .false., !  energy    conserving scheme
+   ln_dynvor_ens = .false., !  enstrophy conserving scheme
+   ln_dynvor_mix = .false., !  mixed scheme
+   ln_dynvor_enT = .false., !  energy conserving scheme (T-point)
+   ln_dynvor_eeT = .false., !  energy conserving scheme (een using e3t)
+   ln_dynvor_een = .false., !  energy & enstrophy scheme
    !
-   ln_dynvor_msk = .false. !  vorticity multiplied by fmask (=T)        ==>>> PLEASE DO NOT ACTIVATE
+   ln_dynvor_msk = .false., !  vorticity multiplied by fmask (=T)        ==>>> PLEASE DO NOT ACTIVATE
    !                       !  (f-point vorticity schemes only)
    !
    nn_e3f_typ = 0          !  type of e3f (EEN, ENE, ENS, MIX only)  =0  e3f = mi(mj(e3t))/4
@@ -1042,26 +1045,26 @@
 !-----------------------------------------------------------------------
 &namdyn_hpg    !   Hydrostatic pressure gradient option                 (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_hpg_zco  = .false.   !  z-coordinate - full steps
-   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
-   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation)
-   ln_hpg_isf  = .false.   !  s-coordinate (sco ) adapted to isf
-   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial)
-      ln_hpg_djc_vnh = .true.  !  hor.  bc type for djc scheme (T=von Neumann, F=linear extrapolation)
-      ln_hpg_djc_vnv = .true.  !  vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
-   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme)
+   ln_hpg_zco  = .false.,   !  z-coordinate - full steps
+   ln_hpg_zps  = .false.,   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .false.,   !  s-coordinate (standard jacobian formulation)
+   ln_hpg_isf  = .false.,   !  s-coordinate (sco ) adapted to isf
+   ln_hpg_djc  = .false.,   !  s-coordinate (Density Jacobian with Cubic polynomial)
+      ln_hpg_djc_vnh = .true.,  !  hor.  bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+      ln_hpg_djc_vnv = .true.,  !  vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+   ln_hpg_prj  = .false.,   !  s-coordinate (Pressure Jacobian scheme)
 /
 !-----------------------------------------------------------------------
 &namdyn_spg    !   surface pressure gradient                            (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_dynspg_exp  = .false.   ! explicit free surface
-   ln_dynspg_ts   = .false.   ! split-explicit free surface
-      ln_bt_fw      = .true.     ! Forward integration of barotropic Eqs.
-      ln_bt_av      = .true.     ! Time filtering of barotropic variables
+   ln_dynspg_exp  = .false.,   ! explicit free surface
+   ln_dynspg_ts   = .false.,   ! split-explicit free surface
+      ln_bt_fw      = .true.,     ! Forward integration of barotropic Eqs.
+      ln_bt_av      = .true.,     ! Time filtering of barotropic variables
          nn_bt_flt     = 1          ! Time filter choice  = 0 None
          !                          !                     = 1 Boxcar over   nn_e sub-steps
          !                          !                     = 2 Boxcar over 2*nn_e  "    "
-      ln_bt_auto    = .true.     ! Number of sub-step defined from:
+      ln_bt_auto    = .true.,     ! Number of sub-step defined from:
          rn_bt_cmax   =  0.8        ! =T : the Maximum Courant Number allowed
          nn_e         = 30          ! =F : the number of sub-step in rn_Dt seconds
       rn_bt_alpha   = 0.         ! Temporal diffusion parameter (if ln_bt_av=F)
@@ -1070,14 +1073,14 @@
 &namdyn_ldf    !   lateral diffusion on momentum                        (default: NO selection)
 !-----------------------------------------------------------------------
    !                       !  Type of the operator :
-   ln_dynldf_OFF = .false.     !  No operator (i.e. no explicit diffusion)
+   ln_dynldf_OFF = .false.,     !  No operator (i.e. no explicit diffusion)
    nn_dynldf_typ = 0           !  =0 div-rot (default)   ;   =1 symmetric
-   ln_dynldf_lap = .false.     !    laplacian operator
-   ln_dynldf_blp = .false.     !  bilaplacian operator
+   ln_dynldf_lap = .false.,     !    laplacian operator
+   ln_dynldf_blp = .false.,     !  bilaplacian operator
    !                       !  Direction of action  :
-   ln_dynldf_lev = .false.     !  iso-level
-   ln_dynldf_hor = .false.     !  horizontal  (geopotential)
-   ln_dynldf_iso = .false.     !  iso-neutral (lap only)
+   ln_dynldf_lev = .false.,     !  iso-level
+   ln_dynldf_hor = .false.,     !  horizontal  (geopotential)
+   ln_dynldf_iso = .false.,     !  iso-neutral (lap only)
    !                       !  Coefficient
    nn_ahm_ijk_t  = 0           !  space/time variation of eddy coefficient :
       !                             !  =-30  read in eddy_viscosity_3D.nc file
@@ -1102,8 +1105,8 @@
 !-----------------------------------------------------------------------
 &namdta_dyn    !   offline ocean input files                            (OFF_SRC only)
 !-----------------------------------------------------------------------
-   ln_dynrnf       =  .false.    !  runoffs option enabled (T) or not (F)
-   ln_dynrnf_depth =  .false.    !  runoffs is spread in vertical (T) or not (F)
+   ln_dynrnf       =  .false.,    !  runoffs option enabled (T) or not (F)
+   ln_dynrnf_depth =  .false.,    !  runoffs is spread in vertical (T) or not (F)
    !
    cn_dir      = './'      !  root directory for the ocean data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -1140,31 +1143,31 @@
 &namzdf        !   vertical physics manager                             (default: NO selection)
 !-----------------------------------------------------------------------
    !                       ! adaptive-implicit vertical advection
-   ln_zad_Aimp = .false.      !  Courant number dependent scheme (Shchepetkin 2015)
+   ln_zad_Aimp = .false.,      !  Courant number dependent scheme (Shchepetkin 2015)
    !
    !                       ! type of vertical closure (required)
-   ln_zdfcst   = .false.      !  constant mixing
-   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
-   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
-   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
-   ln_zdfosm   = .false.      !  OSMOSIS BL closure                     (T =>   fill namzdf_osm)
+   ln_zdfcst   = .false.,      !  constant mixing
+   ln_zdfric   = .false.,      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.,      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.,      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   ln_zdfosm   = .false.,      !  OSMOSIS BL closure                     (T =>   fill namzdf_osm)
    !
    !                       ! convection
-   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfevd   = .false.,      !  enhanced vertical diffusion
       nn_evdm     =    0         ! apply on tracer (=0) or on tracer and momentum (=1)
       rn_evd      =  100.        ! mixing coefficient [m2/s]
-   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   ln_zdfnpc   = .false.,      !  Non-Penetrative Convective algorithm
       nn_npc      =    1         ! frequency of application of npc
       nn_npcp     =  365         ! npc control print frequency
-   ln_zdfmfc   = .false.      !  Mass Flux Convection
+   ln_zdfmfc   = .false.,      !  Mass Flux Convection
    !
-   ln_zdfddm   = .false.   ! double diffusive mixing
+   ln_zdfddm   = .false.,   ! double diffusive mixing
       rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
       rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
    !
    !                       ! gravity wave-driven vertical mixing
-   ln_zdfiwm   = .false.      ! internal wave-induced mixing            (T =>   fill namzdf_iwm)
-   ln_zdfswm   = .false.      ! surface  wave-induced mixing            (T => ln_wave=ln_sdw=T )
+   ln_zdfiwm   = .false.,      ! internal wave-induced mixing            (T =>   fill namzdf_iwm)
+   ln_zdfswm   = .false.,      ! surface  wave-induced mixing            (T => ln_wave=ln_sdw=T )
    !
    !                       ! coefficients
    rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
@@ -1178,7 +1181,7 @@
    rn_avmri    =  100.e-4  !  maximum value of the vertical viscosity
    rn_alp      =    5.     !  coefficient of the parameterization
    nn_ric      =    2      !  coefficient of the parameterization
-   ln_mldw     =  .false.  !  enhanced mixing in the Ekman layer
+   ln_mldw     =  .false.,  !  enhanced mixing in the Ekman layer
       rn_ekmfc    =    0.7    !  Factor in the Ekman depth Equation
       rn_mldmin   =    1.0    !  minimum allowable mixed-layer depth estimate (m)
       rn_mldmax   = 1000.0    !  maximum allowable mixed-layer depth estimate (m)
@@ -1199,7 +1202,7 @@
    !                       !                 = 1 bounded by the local vertical scale factor
    !                       !                 = 2 first vertical derivative of mixing length bounded by 1
    !                       !                 = 3 as =2 with distinct dissipative an mixing length scale
-   ln_mxl0     = .true.    !  surface mixing length scale = F(wind stress) (T) or not (F)
+   ln_mxl0     = .true.,    !  surface mixing length scale = F(wind stress) (T) or not (F)
       nn_mxlice    = 0        ! type of scaling under sea-ice
       !                       !    = 0 no scaling under sea-ice
       !                       !    = 1 scaling with constant sea-ice thickness
@@ -1207,8 +1210,8 @@
       !                       !    = 3 scaling with maximum sea-ice thickness
       rn_mxlice   = 10.       ! max constant ice thickness value when scaling under sea-ice ( nn_mxlice=1)
    rn_mxl0     =   0.04    !  surface  buoyancy lenght scale minimum value
-   ln_mxhsw    = .false.   !  surface mixing length scale = F(wave height)
-   ln_lc       = .true.    !  Langmuir cell parameterisation (Axell 2002)
+   ln_mxhsw    = .false.,   !  surface mixing length scale = F(wave height)
+   ln_lc       = .true.,    !  Langmuir cell parameterisation (Axell 2002)
       rn_lc       =   0.15    !  coef. associated to Langmuir cells
    nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to NIWs
    !                          !        = 0 none ; = 1 add a tke source below the ML
@@ -1218,6 +1221,7 @@
       nn_htau     =   1       !  type of exponential decrease of tke penetration below the ML
       !                       !        = 0  constant 10 m length scale
       !                       !        = 1  0.5m at the equator to 30m poleward of 40 degrees
+      rn_htau_scaling = 1.0   !  scaling factor to apply to depth of TKE penetration
    nn_eice     =   1       !  attenutaion of langmuir & surface wave breaking under ice
    !                       !           = 0 no impact of ice cover on langmuir & surface wave breaking
    !                       !           = 1 weigthed by 1-TANH(10*fr_i)
@@ -1231,9 +1235,9 @@
 !-----------------------------------------------------------------------
    rn_emin       = 1.e-7   !  minimum value of e   [m2/s2]
    rn_epsmin     = 1.e-12  !  minimum value of eps [m2/s3]
-   ln_length_lim = .true.  !  limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+   ln_length_lim = .true.,  !  limit on the dissipation rate under stable stratification (Galperin et al., 1988)
    rn_clim_galp  = 0.267   !  galperin limit
-   ln_sigpsi     = .true.  !  Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+   ln_sigpsi     = .true.,  !  Activate or not Burchard 2001 mods on psi schmidt number in the wb case
    rn_crban      = 100.    !  Craig and Banner 1994 constant for wb tke flux
    rn_charn      = 70000.  !  Charnock constant for wb induced roughness length
    rn_hsro       =  0.02   !  Minimum surface roughness
@@ -1259,18 +1263,18 @@
 !-----------------------------------------------------------------------
 &namzdf_osm    !   OSM vertical diffusion                               (ln_zdfosm =T)
 !-----------------------------------------------------------------------
-   ln_use_osm_la = .false.     !  Use   rn_osm_la
+   ln_use_osm_la = .false.,     !  Use   rn_osm_la
    rn_osm_la     = 0.3         !  Turbulent Langmuir number
    rn_zdfosm_adjust_sd = 1.0   ! Stokes drift reduction factor
    rn_osm_hblfrac = 0.1        ! specify top part of hbl for nn_osm_wave = 3 or 4
    rn_osm_bl_thresh   = 5.e-5      !Threshold buoyancy for deepening of OSBL base
    nn_ave = 0                  ! choice of horizontal averaging on avt, avmu, avmv
-   ln_dia_osm = .true.         ! output OSMOSIS-OBL variables
+   ln_dia_osm = .true.,         ! output OSMOSIS-OBL variables
    rn_osm_hbl0 = 10.           ! initial hbl value
-   ln_kpprimix = .true.        ! Use KPP-style Ri# mixing below BL
+   ln_kpprimix = .true.,        ! Use KPP-style Ri# mixing below BL
    rn_riinfty  = 0.7           ! Highest local Ri_g permitting shear instability
    rn_difri  =  0.005          ! max Ri# diffusivity at Ri_g = 0 (m^2/s)
-   ln_convmix  = .true.        ! Use convective instability mixing below BL
+   ln_convmix  = .true.,        ! Use convective instability mixing below BL
    rn_difconv = 1. !0.01 !1.             ! diffusivity when unstable below BL  (m2/s)
    rn_osm_dstokes     = 5.     !  Depth scale of Stokes drift (m)
    nn_osm_wave = 0             ! Method used to calculate Stokes drift
@@ -1281,8 +1285,8 @@
       !                        !  = 0: No reduction
                                !  = 1: use SD avged over top 10% hbl
                                !  = 2:use surface value of SD fit to slope at rn_osm_hblfrac*hbl below surface
-   ln_zdfosm_ice_shelter = .true.  ! reduce surface SD and depth scale under ice
-   ln_osm_mle = .true.         !  Use integrated FK-OSM model
+   ln_zdfosm_ice_shelter = .true.,  ! reduce surface SD and depth scale under ice
+   ln_osm_mle = .true.,         !  Use integrated FK-OSM model
 /
 !-----------------------------------------------------------------------
 &namosm_mle    !   mixed layer eddy parametrisation (Fox-Kemper)       (default: OFF)
@@ -1295,13 +1299,13 @@
    rn_osm_mle_rho_c    = 0.03      ! delta rho criterion used to calculate MLD for FK
    rn_osm_mle_thresh   = 0.0001    ! delta b criterion used for FK MLE criterion
    rn_osm_mle_tau      = 172800.   ! time scale for FK-OSM (seconds)  (case rn_osm_mle=0)
-   ln_osm_hmle_limit   = .true.    ! If true, limit hmle to rn_osm_hmle_limit*hbl
+   ln_osm_hmle_limit   = .true.,    ! If true, limit hmle to rn_osm_hmle_limit*hbl
    rn_osm_hmle_limit   = 1.5
    /
 !-----------------------------------------------------------------------
 &namzdf_mfc     !   Mass Flux Convection
 !-----------------------------------------------------------------------
-   ln_edmfuv  = .false.        ! Activate on velocity fields (Not available yet)
+   ln_edmfuv  = .false.,        ! Activate on velocity fields (Not available yet)
    rn_cemf    =  1.            ! entrain/detrain coef. (<0 => cte; >0 % depending on dW/dz
    rn_cwmf    = -0.            ! entrain/detrain coef. (<0 => cte; >0 % depending on dW/dz
    rn_cent    = 2.e-5          ! entrain of convective area
@@ -1312,8 +1316,8 @@
 !-----------------------------------------------------------------------
 &namzdf_iwm    !    internal wave-driven mixing parameterization        (ln_zdfiwm =T)
 !-----------------------------------------------------------------------
-   ln_mevar    = .false.    !  variable (T) or constant (F) mixing efficiency
-   ln_tsdiff   = .true.    !  account for differential T/S mixing (T) or not (F)
+   ln_mevar    = .false.,    !  variable (T) or constant (F) mixing efficiency
+   ln_tsdiff   = .true.,    !  account for differential T/S mixing (T) or not (F)
 
    cn_dir      = './'      !  root directory for the iwm data location                                                                           
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
@@ -1342,53 +1346,53 @@
 !-----------------------------------------------------------------------
 &namtrd        !   trend diagnostics                                    (default: OFF)
 !-----------------------------------------------------------------------
-   ln_glo_trd  = .false.   ! (T) global domain averaged diag for T, T^2, KE, and PE
-   ln_dyn_trd  = .false.   ! (T) 3D momentum trend output
-   ln_dyn_mxl  = .false.   ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
-   ln_vor_trd  = .false.   ! (T) 2D barotropic vorticity trends (not coded yet)
-   ln_KE_trd   = .false.   ! (T) 3D Kinetic   Energy     trends
-   ln_PE_trd   = .false.   ! (T) 3D Potential Energy     trends
-   ln_tra_trd  = .false.   ! (T) 3D tracer trend output
-   ln_tra_mxl  = .false.   ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+   ln_glo_trd  = .false.,   ! (T) global domain averaged diag for T, T^2, KE, and PE
+   ln_dyn_trd  = .false.,   ! (T) 3D momentum trend output
+   ln_dyn_mxl  = .false.,   ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+   ln_vor_trd  = .false.,   ! (T) 2D barotropic vorticity trends (not coded yet)
+   ln_KE_trd   = .false.,   ! (T) 3D Kinetic   Energy     trends
+   ln_PE_trd   = .false.,   ! (T) 3D Potential Energy     trends
+   ln_tra_trd  = .false.,   ! (T) 3D tracer trend output
+   ln_tra_mxl  = .false.,   ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
    nn_trd      = 365       !  print frequency (ln_glo_trd=T) (unit=time step)
 /
 !!gm   nn_ctls     =   0       !  control surface type in mixed-layer trends (0,1 or n<jpk)
 !!gm   rn_ucf      =   1.      !  unit conversion factor (=1 -> /seconds ; =86400. -> /day)
 !!gm   cn_trdrst_in      = "restart_mld"   ! suffix of ocean restart name (input)
 !!gm   cn_trdrst_out     = "restart_mld"   ! suffix of ocean restart name (output)
-!!gm   ln_trdmld_restart = .false.         !  restart for ML diagnostics
-!!gm   ln_trdmld_instant = .false.         !  flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm   ln_trdmld_restart = .false.,         !  restart for ML diagnostics
+!!gm   ln_trdmld_instant = .false.,         !  flag to diagnose trends of instantantaneous or mean ML T/S
 !!gm
 !-----------------------------------------------------------------------
 &namhsb        !  Heat and salt budgets                                 (default: OFF)
 !-----------------------------------------------------------------------
-   ln_diahsb   = .false.   !  output the heat and salt budgets (T) or not (F)
+   ln_diahsb   = .false.,   !  output the heat and salt budgets (T) or not (F)
 /
 !-----------------------------------------------------------------------
 &namdiu        !   Cool skin and warm layer models                      (default: OFF)
 !-----------------------------------------------------------------------
-   ln_diurnal      = .false.   !
-   ln_diurnal_only = .false.   !
+   ln_diurnal      = .false.,   !
+   ln_diurnal_only = .false.,   !
 /
 !-----------------------------------------------------------------------
 &namflo        !   float parameters                                     (default: OFF)
 !-----------------------------------------------------------------------
-   ln_floats   = .false.      ! activate floats or not
+   ln_floats   = .false.,      ! activate floats or not
       jpnfl       = 1         !    total number of floats during the run
       jpnnewflo   = 0         !    number of floats for the restart
-      ln_rstflo   = .false.   !    float restart (T) or not (F)
+      ln_rstflo   = .false.,   !    float restart (T) or not (F)
       nn_writefl  =      75   !    frequency of writing in float output file
       nn_stockfl  =    5475   !    frequency of creation of the float restart file
-      ln_argo     = .false.   !    Argo type floats (stay at the surface each 10 days)
-      ln_flork4   = .false.   !    trajectories computed with a 4th order Runge-Kutta (T)
+      ln_argo     = .false.,   !    Argo type floats (stay at the surface each 10 days)
+      ln_flork4   = .false.,   !    trajectories computed with a 4th order Runge-Kutta (T)
       !                       !    or computed with Blanke' scheme (F)
-      ln_ariane   = .true.    !    Input with Ariane tool convention(T)
-      ln_flo_ascii= .true.    !    Output with Ariane tool netcdf convention(F) or ascii file (T)
+      ln_ariane   = .true.,    !    Input with Ariane tool convention(T)
+      ln_flo_ascii= .true.,    !    Output with Ariane tool netcdf convention(F) or ascii file (T)
 /
 !-----------------------------------------------------------------------
 &nam_diadct    !   transports through some sections                     (default: OFF)
 !-----------------------------------------------------------------------
-    ln_diadct  = .false.   ! Calculate transport thru sections or not
+    ln_diadct  = .false.,   ! Calculate transport thru sections or not
        nn_dct     = 15     !  time step frequency for transports computing
        nn_dctwri  = 15     !  time step frequency for transports writing
        nn_secdebug = 112   !      0 : no section to debug
@@ -1398,7 +1402,7 @@
 !-----------------------------------------------------------------------
 &nam_dia25h    !  25h Mean Output                                       (default: OFF)
 !-----------------------------------------------------------------------
-   ln_dia25h   = .false.   ! Choose 25h mean output or not
+   ln_dia25h   = .false.,   ! Choose 25h mean output or not
 /
 !-----------------------------------------------------------------------
 &namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
@@ -1408,7 +1412,7 @@
    nn_nchunks_k =   31      !  number of chunks in k-dimension
    !                       !  setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
    !                       !  is optimal for postprocessing which works exclusively with horizontal slabs
-   ln_nc4zip   = .true.    !  (T) use netcdf4 chunking and compression
+   ln_nc4zip   = .true.,    !  (T) use netcdf4 chunking and compression
    !                       !  (F) ignore chunking information and produce netcdf3-compatible files
 /
 
@@ -1422,29 +1426,29 @@
 !-----------------------------------------------------------------------
 &namobs        !  observation usage switch                              (default: OFF)
 !-----------------------------------------------------------------------
-   ln_diaobs   = .false.             ! Logical switch for the observation operator
+   ln_diaobs   = .false.,             ! Logical switch for the observation operator
    !
-   ln_t3d      = .false.             ! Logical switch for T profile observations
-   ln_s3d      = .false.             ! Logical switch for S profile observations
-   ln_sla      = .false.             ! Logical switch for SLA observations
-   ln_sst      = .false.             ! Logical switch for SST observations
-   ln_sss      = .false.             ! Logical swithc for SSS observations
-   ln_sic      = .false.             ! Logical switch for Sea Ice observations
-   ln_vel3d    = .false.             ! Logical switch for velocity observations
-   ln_altbias  = .false.             ! Logical switch for altimeter bias correction
-   ln_sstbias  = .false.             ! Logical switch for SST bias correction
-   ln_nea      = .false.             ! Logical switch for rejection of observations near land
-   ln_grid_global = .true.           ! Logical switch for global distribution of observations
-   ln_grid_search_lookup = .false.   ! Logical switch for obs grid search w/lookup table
-   ln_ignmis   = .true.              ! Logical switch for ignoring missing files
-   ln_s_at_t   = .false.             ! Logical switch for computing model S at T obs if not there
-   ln_sstnight = .false.             ! Logical switch for calculating night-time average for SST obs
-   ln_bound_reject  = .false.        ! Logical to remove obs near boundaries in LAMs.
-   ln_default_fp_indegs = .true.     ! Logical: T=> averaging footprint is in degrees, F=> in metres
-   ln_sla_fp_indegs = .true.         ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
-   ln_sst_fp_indegs = .true.         ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
-   ln_sss_fp_indegs = .true.         ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
-   ln_sic_fp_indegs = .true.         ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+   ln_t3d      = .false.,             ! Logical switch for T profile observations
+   ln_s3d      = .false.,             ! Logical switch for S profile observations
+   ln_sla      = .false.,             ! Logical switch for SLA observations
+   ln_sst      = .false.,             ! Logical switch for SST observations
+   ln_sss      = .false.,             ! Logical swithc for SSS observations
+   ln_sic      = .false.,             ! Logical switch for Sea Ice observations
+   ln_vel3d    = .false.,             ! Logical switch for velocity observations
+   ln_altbias  = .false.,             ! Logical switch for altimeter bias correction
+   ln_sstbias  = .false.,             ! Logical switch for SST bias correction
+   ln_nea      = .false.,             ! Logical switch for rejection of observations near land
+   ln_grid_global = .true.,           ! Logical switch for global distribution of observations
+   ln_grid_search_lookup = .false.,   ! Logical switch for obs grid search w/lookup table
+   ln_ignmis   = .true.,              ! Logical switch for ignoring missing files
+   ln_s_at_t   = .false.,             ! Logical switch for computing model S at T obs if not there
+   ln_sstnight = .false.,             ! Logical switch for calculating night-time average for SST obs
+   ln_bound_reject  = .false.,        ! Logical to remove obs near boundaries in LAMs.
+   ln_default_fp_indegs = .true.,     ! Logical: T=> averaging footprint is in degrees, F=> in metres
+   ln_sla_fp_indegs = .true.,         ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+   ln_sst_fp_indegs = .true.,         ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+   ln_sss_fp_indegs = .true.,         ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+   ln_sic_fp_indegs = .true.,         ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
 ! All of the *files* variables below are arrays. Use namelist_cfg to add more files
    cn_profbfiles = 'profiles_01.nc'  ! Profile feedback input observation file names
    cn_slafbfiles = 'sla_01.nc'       ! SLA feedback input observation file names
@@ -1482,21 +1486,21 @@
 !-----------------------------------------------------------------------
 &nam_asminc    !   assimilation increments                              ('key_asminc')
 !-----------------------------------------------------------------------
-    ln_bkgwri  = .false.   !  Logical switch for writing out background state
-    ln_trainc  = .false.   !  Logical switch for applying tracer increments
-    ln_dyninc  = .false.   !  Logical switch for applying velocity increments
-    ln_sshinc  = .false.   !  Logical switch for applying SSH increments
-    ln_seaiceinc = .false. !  Logical switch for applying Sea ice concentration increments
-    ln_asmdin  = .false.   !  Logical switch for Direct Initialization (DI)
-    ln_asmiau  = .false.   !  Logical switch for Incremental Analysis Updating (IAU)
+    ln_bkgwri  = .false.,   !  Logical switch for writing out background state
+    ln_trainc  = .false.,   !  Logical switch for applying tracer increments
+    ln_dyninc  = .false.,   !  Logical switch for applying velocity increments
+    ln_sshinc  = .false.,   !  Logical switch for applying SSH increments
+    ln_seaiceinc = .false., !  Logical switch for applying Sea ice concentration increments
+    ln_asmdin  = .false.,   !  Logical switch for Direct Initialization (DI)
+    ln_asmiau  = .false.,   !  Logical switch for Incremental Analysis Updating (IAU)
     nitbkg     = 0         !  Timestep of background in [0,nitend-nit000-1]
     nitdin     = 0         !  Timestep of background for DI in [0,nitend-nit000-1]
     nitiaustr  = 1         !  Timestep of start of IAU interval in [0,nitend-nit000-1]
     nitiaufin  = 15        !  Timestep of end of IAU interval in [0,nitend-nit000-1]
     niaufn     = 0         !  Type of IAU weighting function
-    ln_salfix  = .false.   !  Logical switch for ensuring that the sa > salfixmin
+    ln_salfix  = .false.,   !  Logical switch for ensuring that the sa > salfixmin
     salfixmin  = -9999     !  Minimum salinity after applying the increments
-    ln_temnofreeze=.false. !  Don't allow the temperature to drop below freezing
+    ln_temnofreeze=.false., !  Don't allow the temperature to drop below freezing
     nn_divdmp  = 0         !  Number of iterations of divergence damping operator
 /
 
@@ -1511,9 +1515,9 @@
 !-----------------------------------------------------------------------
 &nammpp        !   Massively Parallel Processing
 !-----------------------------------------------------------------------
-   ln_listonly =  .false.  !  do nothing else than listing the best domain decompositions (with land domains suppression)
+   ln_listonly =  .false.,  !  do nothing else than listing the best domain decompositions (with land domains suppression)
    !                       !  if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
-   ln_nnogather =  .true.  !  activate code to avoid mpi_allgather use at the northfold
+   ln_nnogather =  .true.,  !  activate code to avoid mpi_allgather use at the northfold
    jpni        =   0       !  number of processors following i (set automatically if < 1), see also ln_listonly = T
    jpnj        =   0       !  number of processors following j (set automatically if < 1), see also ln_listonly = T
    nn_hls      =   1       !  halo width (applies to both rows and columns)
@@ -1522,13 +1526,13 @@
 !-----------------------------------------------------------------------
 &namctl        !   Control prints                                       (default: OFF)
 !-----------------------------------------------------------------------
-   sn_cfctl%l_runstat = .TRUE.    ! switches and which areas produce reports with the proc integer settings.
-   sn_cfctl%l_trcstat = .FALSE.   ! The default settings for the proc integers should ensure
-   sn_cfctl%l_oceout  = .FALSE.   ! that  all areas report.
-   sn_cfctl%l_layout  = .FALSE.   !
-   sn_cfctl%l_prtctl  = .FALSE.   !
-   sn_cfctl%l_prttrc  = .FALSE.   !
-   sn_cfctl%l_oasout  = .FALSE.   !
+   sn_cfctl%l_runstat = .TRUE.,    ! switches and which areas produce reports with the proc integer settings.
+   sn_cfctl%l_trcstat = .false.,   ! The default settings for the proc integers should ensure
+   sn_cfctl%l_oceout  = .false.,   ! that  all areas report.
+   sn_cfctl%l_layout  = .false.,   !
+   sn_cfctl%l_prtctl  = .false.,   !
+   sn_cfctl%l_prttrc  = .false.,   !
+   sn_cfctl%l_oasout  = .false.,   !
    sn_cfctl%procmin   = 0         ! Minimum area number for reporting [default:0]
    sn_cfctl%procmax   = 1000000   ! Maximum area number for reporting [default:1000000]
    sn_cfctl%procincr  = 1         ! Increment for optional subsetting of areas [default:1]
@@ -1539,27 +1543,27 @@
    nn_jctle    =    0             !  end   j indice of control
    nn_isplt    =    1             !  number of processors in i-direction
    nn_jsplt    =    1             !  number of processors in j-direction
-   ln_timing   = .false.          !  timing by routine write out in timing.output file
-   ln_diacfl   = .false.          !  CFL diagnostics write out in cfl_diagnostics.ascii
+   ln_timing   = .false.,          !  timing by routine write out in timing.output file
+   ln_diacfl   = .false.,          !  CFL diagnostics write out in cfl_diagnostics.ascii
 /
 !-----------------------------------------------------------------------
 &namsto        ! Stochastic parametrization of EOS                      (default: OFF)
 !-----------------------------------------------------------------------
-   ln_sto_ldf  = .false.   ! stochastic lateral diffusion
+   ln_sto_ldf  = .false.,   ! stochastic lateral diffusion
    rn_ldf_std  =  0.1      ! lateral diffusion standard deviation (in percent)
    rn_ldf_tcor =  1440.    ! lateral diffusion correlation timescale (in timesteps)
-   ln_sto_hpg  = .false.   ! stochastic pressure gradient
+   ln_sto_hpg  = .false.,   ! stochastic pressure gradient
    rn_hpg_std  =  0.1      ! density gradient standard deviation (in percent)
    rn_hpg_tcor =  1440.    ! density gradient correlation timescale (in timesteps)
-   ln_sto_pstar  = .false. ! stochastic ice strength
+   ln_sto_pstar  = .false., ! stochastic ice strength
    rn_pstar_std  =  0.1    ! ice strength standard deviation (in percent)
    rn_pstar_tcor =  1440.  ! ice strength correlation timescale (in timesteps)
    nn_pstar_ord  =  1      ! order of autoregressive processes
    nn_pstar_flt  =  0      ! passes of Laplacian filter
-   ln_sto_trd  = .false.   ! stochastic model trend
+   ln_sto_trd  = .false.,   ! stochastic model trend
    rn_trd_std  =  0.1      ! trend standard deviation (in percent)
    rn_trd_tcor =  1440.    ! trend correlation timescale (in timesteps)
-   ln_sto_eos  = .false.   ! stochastic equation of state
+   ln_sto_eos  = .false.,   ! stochastic equation of state
    nn_sto_eos  = 1         ! number of independent random walks
    rn_eos_stdxy = 1.4       ! random walk horz. standard deviation (in grid points)
    rn_eos_stdz = 0.7       ! random walk vert. standard deviation (in grid points)
@@ -1567,7 +1571,7 @@
    nn_eos_ord  = 1         ! order of autoregressive processes
    nn_eos_flt  = 0         ! passes of Laplacian filter
    rn_eos_lim  = 2.0       ! limitation factor (default = 3.0)
-   ln_sto_trc  = .false.   ! stochastic tracer dynamics
+   ln_sto_trc  = .false.,   ! stochastic tracer dynamics
    nn_sto_trc  = 1         ! number of independent random walks
    rn_trc_stdxy = 1.4      ! random walk horz. standard deviation (in grid points)
    rn_trc_stdz = 0.7       ! random walk vert. standard deviation (in grid points)
@@ -1575,8 +1579,10 @@
    nn_trc_ord  = 1         ! order of autoregressive processes
    nn_trc_flt  = 0         ! passes of Laplacian filter
    rn_trc_lim  = 3.0       ! limitation factor (default = 3.0)
-   ln_rststo   = .false.   ! start from mean parameter (F) or from restart file (T)
-   ln_rstseed  = .true.    ! read seed of RNG from restart file
+   ln_rststo   = .false.,   ! start from mean parameter (F) or from restart file (T)
+   ln_rstseed  = .true.,    ! read seed of RNG from restart file
    cn_storst_in  = "restart_sto" !  suffix of stochastic parameter restart file (input)
    cn_storst_out = "restart_sto" !  suffix of stochastic parameter restart file (output)
 /
+&namzdf_mldzint
+/
diff --git a/src/ICE/ice.F90 b/src/ICE/ice.F90
index 67bce2c4ae0e5ab22daceb6760abbceef7a2ef66..5b0b82ecac7b1221f976e7cdad4d6fbeb722bad9 100644
--- a/src/ICE/ice.F90
+++ b/src/ICE/ice.F90
@@ -241,6 +241,7 @@ MODULE ice
    REAL(wp), PUBLIC ::   rn_hpnd          !: prescribed pond depth    (0<rn_hpnd<1)
    LOGICAL,  PUBLIC ::   ln_pnd_lids      !: Allow ponds to have frozen lids
    LOGICAL , PUBLIC ::   ln_pnd_alb       !: melt ponds affect albedo
+   INTEGER , PUBLIC ::   nn_pnd_brsal     !: brine salinity formulation 0 = Consistent expression with SI3 (linear liquidus) ; 1 = used in GOSI9 
 
    !                                     !!** ice-diagnostics namelist (namdia) **
    LOGICAL , PUBLIC ::   ln_icediachk     !: flag for ice diag (T) or not (F)
diff --git a/src/ICE/icedyn_rdgrft.F90 b/src/ICE/icedyn_rdgrft.F90
index fdb1db47682f7b818f5996a9dc0fd9f632c6db29..a15f18d01c5af53b905a14daef8c631be8cf0aba 100644
--- a/src/ICE/icedyn_rdgrft.F90
+++ b/src/ICE/icedyn_rdgrft.F90
@@ -51,6 +51,7 @@ MODULE icedyn_rdgrft
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   apartf          ! participation function; fraction of ridging/closing associated w/ category n
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hrmin           ! minimum ridge thickness
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hrmax           ! maximum ridge thickness
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hrexp           ! e-folding ridge thickness
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hraft           ! thickness of rafted ice
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hi_hrdg         ! thickness of ridging ice / mean ridge thickness
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   aridge          ! participating ice ridging
@@ -59,7 +60,7 @@ MODULE icedyn_rdgrft
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ze_s_2d
    !
    REAL(wp), PARAMETER ::   hrdg_hi_min = 1.1_wp    ! min ridge thickness multiplier: min(hrdg/hi)
-   REAL(wp), PARAMETER ::   hi_hrft     = 0.5_wp    ! rafting multipliyer: (hi/hraft)
+   REAL(wp), PARAMETER ::   hi_hrft     = 0.5_wp    ! rafting multiplier: (hi/hraft)
    !
    ! ** namelist (namdyn_rdgrft) **
    LOGICAL  ::   ln_str_R75       ! ice strength parameterization: Rothrock 75
@@ -67,13 +68,13 @@ MODULE icedyn_rdgrft
    LOGICAL  ::   ln_str_CST       ! ice strength parameterization: Constant
    REAL(wp) ::   rn_str           !    constant value of ice strength
    LOGICAL  ::   ln_str_smooth    ! ice strength spatial smoothing
-   LOGICAL  ::   ln_distf_lin     ! redistribution of ridged ice: linear (Hibler 1980)
-   LOGICAL  ::   ln_distf_exp     ! redistribution of ridged ice: exponential
+   LOGICAL  ::   ln_distf_lin     ! redistribution of ridged ice: linear (Hibler, 1980)
+   LOGICAL  ::   ln_distf_exp     ! redistribution of ridged ice: exponential (Lipscomb et al., 2007)
    REAL(wp) ::   rn_murdg         !    gives e-folding scale of ridged ice (m^.5)
    REAL(wp) ::   rn_csrdg         ! fraction of shearing energy contributing to ridging
-   LOGICAL  ::   ln_partf_lin     ! participation function linear (Thorndike et al. (1975))
+   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))
+   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
    REAL(wp) ::   rn_hstar         !    thickness that determines the maximal thickness of ridged ice
@@ -99,9 +100,9 @@ CONTAINS
       !!-------------------------------------------------------------------
       !!                ***  ROUTINE ice_dyn_rdgrft_alloc ***
       !!-------------------------------------------------------------------
-      ALLOCATE( closing_net(jpij)  , opning(jpij)      , closing_gross(jpij) ,               &
-         &      apartf(jpij,0:jpl) , hrmin  (jpij,jpl) , hraft(jpij,jpl) , aridge(jpij,jpl), &
-         &      hrmax (jpij,jpl)   , hi_hrdg(jpij,jpl) , araft(jpij,jpl) ,                   &
+      ALLOCATE( closing_net(jpij) , opning(jpij)    , closing_gross(jpij),                   &
+         &      apartf(jpij,0:jpl), hrmin (jpij,jpl), hraft(jpij,jpl)    , aridge(jpij,jpl), &
+         &      hrmax (jpij,jpl)  , hrexp (jpij,jpl), hi_hrdg(jpij,jpl)  , araft(jpij,jpl) , &
          &      ze_i_2d(jpij,nlay_i,jpl), ze_s_2d(jpij,nlay_s,jpl), STAT=ice_dyn_rdgrft_alloc )
 
       CALL mpp_sum ( 'icedyn_rdgrft', ice_dyn_rdgrft_alloc )
@@ -301,8 +302,8 @@ CONTAINS
       !! ** Method  :   Compute the thickness distribution of the ice and open water
       !!                participating in ridging and of the resulting ridges.
       !!-------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:), INTENT(in)           ::   pa_i, pv_i
-      REAL(wp), DIMENSION(:)  , INTENT(in)           ::   pato_i
+      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pa_i, pv_i
+      REAL(wp), DIMENSION(:)  , INTENT(in) ::   pato_i
       REAL(wp), DIMENSION(:)  , INTENT(in), OPTIONAL ::   pclosing_net
       !!
       INTEGER  ::   ji, jl                     ! dummy loop indices
@@ -354,7 +355,7 @@ CONTAINS
       zGsum(1:npti,-1) = 0._wp
       zGsum(1:npti,0 ) = pato_i(1:npti) * z1_asum(1:npti)
       DO jl = 1, jpl
-         zGsum(1:npti,jl) = ( pato_i(1:npti) + SUM( pa_i(1:npti,1:jl), dim=2 ) ) * z1_asum(1:npti)  ! sum(1:jl) is ok (and not jpl)
+         zGsum(1:npti,jl) = ( pato_i(1:npti) + SUM( pa_i(1:npti,1:jl), dim=2 ) ) * z1_asum(1:npti)  ! sum(1:jl) is correct (and not jpl)
       END DO
       !
       IF( ln_partf_lin ) THEN          !--- Linear formulation (Thorndike et al., 1975)
@@ -372,7 +373,7 @@ CONTAINS
             END DO
          END DO
          !
-      ELSEIF( ln_partf_exp ) THEN      !--- Exponential, more stable formulation (Lipscomb et al, 2007)
+      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
@@ -421,8 +422,10 @@ CONTAINS
 
       ! 2) Transfer function
       !-----------------------------------------------------------------
+      ! If assuming ridged ice is uniformly distributed between hrmin and  
+      ! hrmax (ln_distf_lin):
+      !
       ! 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)
@@ -437,9 +440,37 @@ CONTAINS
       ! These modifications have the effect of reducing the ice strength
       ! (relative to the Hibler formulation) when very thick ice is ridging.
       !
-      ! zaksum = net area removed/ total area removed
-      ! where total area removed = area of ice that ridges
-      !         net area removed = total area removed - area of new ridges
+      !-----------------------------------------------------------------
+      ! If assuming ridged ice ITD is a negative exponential 
+      ! (ln_distf_exp) and following CICE implementation: 
+      ! 
+      !  g(h) ~ exp[-(h-hrmin)/hrexp], h >= hrmin 
+      ! 
+      ! where hrmin is the minimum thickness of ridging ice and 
+      ! hrexp is the e-folding thickness.
+      ! 
+      ! Here, assume as above that hrmin = min(2*hi, hi+maxraft).
+      ! That is, the minimum ridge thickness results from rafting,
+      !  unless the ice is thicker than maxraft.
+      !
+      ! Also, assume that hrexp = mu_rdg*sqrt(hi).
+      ! The parameter mu_rdg is tuned to give e-folding scales mostly
+      !  in the range 2-4 m as observed by upward-looking sonar.
+      !
+      ! Values of mu_rdg in the right column give ice strengths
+      !  roughly equal to values of Hstar in the left column
+      !  (within ~10 kN/m for typical ITDs):
+      !
+      !   Hstar     mu_rdg
+      !
+      !     25        3.0
+      !     50        4.0
+      !     75        5.0
+      !    100        6.0
+      !
+      ! zaksum = net area removed/ total area participating
+      ! where total area participating = area of ice that ridges
+      !         net area removed = total area participating - area of new ridges
       !-----------------------------------------------------------------
       zfac = 1._wp / hi_hrft
       zaksum(1:npti) = apartf(1:npti,0)
@@ -449,9 +480,16 @@ CONTAINS
             IF ( apartf(ji,jl) > 0._wp ) THEN
                zhmean         = MAX( SQRT( rn_hstar * zhi(ji,jl) ), zhi(ji,jl) * hrdg_hi_min )
                hrmin  (ji,jl) = MIN( 2._wp * zhi(ji,jl), 0.5_wp * ( zhmean + zhi(ji,jl) ) )
-               hrmax  (ji,jl) = 2._wp * zhmean - hrmin(ji,jl)
                hraft  (ji,jl) = zhi(ji,jl) * zfac
-               hi_hrdg(ji,jl) = zhi(ji,jl) / MAX( zhmean, epsi20 )
+               !
+               IF( ln_distf_lin ) THEN
+                  hrmax  (ji,jl) = 2._wp * zhmean - hrmin(ji,jl)
+                  hi_hrdg(ji,jl) = zhi(ji,jl) / MAX( zhmean, epsi20 )
+               ELSEIF( ln_distf_exp ) THEN
+                  hrexp  (ji,jl) = rn_murdg * SQRT( zhi(ji,jl) )
+                  hi_hrdg(ji,jl) = zhi(ji,jl) / ( hrmin(ji,jl) + hrexp(ji,jl) )
+                  !!clem: set a mini for zhi??
+               ENDIF
                !
                ! Normalization factor : zaksum, ensures mass conservation
                zaksum(ji) = zaksum(ji) + aridge(ji,jl) * ( 1._wp - hi_hrdg(ji,jl) )    &
@@ -459,8 +497,10 @@ CONTAINS
             ELSE
                hrmin  (ji,jl) = 0._wp
                hrmax  (ji,jl) = 0._wp
+               hrexp  (ji,jl) = 0._wp
                hraft  (ji,jl) = 0._wp
                hi_hrdg(ji,jl) = 1._wp
+               !!clem zaksum(ji,jl) = 0._wp
             ENDIF
          END DO
       END DO
@@ -474,7 +514,7 @@ CONTAINS
          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
          !----------------------------------------------------
          ! Reduce the closing rate if more than 100% of any ice category would be removed
@@ -487,7 +527,7 @@ CONTAINS
                ENDIF
             END DO
          END DO
-         
+
          ! 4) correction to opening if excessive open water removal
          !---------------------------------------------------------
          ! Reduce the closing rate if more than 100% of the open water would be removed
@@ -518,6 +558,7 @@ CONTAINS
       !
       INTEGER  ::   ji, jj, jl, jl1, jl2, jk   ! dummy loop indices
       REAL(wp) ::   hL, hR, farea              ! left and right limits of integration and new area going to jl2
+      REAL(wp) ::   expL, expR                 ! exponentials involving hL, hR
       REAL(wp) ::   vsw                        ! vol of water trapped into ridges
       REAL(wp) ::   afrdg, afrft               ! fraction of category area ridged/rafted
       REAL(wp)                  ::   airdg1, oirdg1, aprdg1, virdg1, sirdg1
@@ -699,18 +740,50 @@ CONTAINS
                IF( ll_shift(ji) ) THEN
 
                   ! Compute the fraction of ridged ice area and volume going to thickness category jl2
-                  IF( hrmin(ji,jl1) <= hi_max(jl2) .AND. hrmax(ji,jl1) > hi_max(jl2-1) ) THEN
-                     hL = MAX( hrmin(ji,jl1), hi_max(jl2-1) )
-                     hR = MIN( hrmax(ji,jl1), hi_max(jl2)   )
-                     farea    = ( hR      - hL      ) / ( hrmax(ji,jl1)                 - hrmin(ji,jl1)                 )
-                     fvol(ji) = ( hR * hR - hL * hL ) / ( hrmax(ji,jl1) * hrmax(ji,jl1) - hrmin(ji,jl1) * hrmin(ji,jl1) )
+                  IF( ln_distf_lin ) THEN ! Hibler (1980) linear formulation
                      !
-                     itest_rdg(ji) = 1   ! test for conservation
-                  ELSE
-                     farea    = 0._wp
-                     fvol(ji) = 0._wp
-                  ENDIF
-
+                     IF( hrmin(ji,jl1) <= hi_max(jl2) .AND. hrmax(ji,jl1) > hi_max(jl2-1) ) THEN
+                        hL = MAX( hrmin(ji,jl1), hi_max(jl2-1) )
+                        hR = MIN( hrmax(ji,jl1), hi_max(jl2)   )
+                        farea    = ( hR      - hL      ) / ( hrmax(ji,jl1)                 - hrmin(ji,jl1)                 )
+                        fvol(ji) = ( hR * hR - hL * hL ) / ( hrmax(ji,jl1) * hrmax(ji,jl1) - hrmin(ji,jl1) * hrmin(ji,jl1) )
+                        !
+                        itest_rdg(ji) = 1   ! test for conservation
+                     ELSE
+                        farea    = 0._wp
+                        fvol(ji) = 0._wp
+                     ENDIF
+                     !
+                  ELSEIF( ln_distf_exp ) THEN ! Lipscomb et al. (2007) exponential formulation                      
+                     !
+                     IF( jl2 < jpl ) THEN
+                        !
+                        IF( hrmin(ji,jl1) <= hi_max(jl2) ) THEN
+                           hL       = MAX( hrmin(ji,jl1), hi_max(jl2-1) )
+                           hR       = hi_max(jl2)
+                           expL     = EXP( -( hL - hrmin(ji,jl1) ) / hrexp(ji,jl1) )
+                           expR     = EXP( -( hR - hrmin(ji,jl1) ) / hrexp(ji,jl1) )
+                           farea    = expL - expR
+                           fvol(ji) = ( ( hL + hrexp(ji,jl1) ) * expL  &
+                              - ( hR + hrexp(ji,jl1) ) * expR ) / ( hrmin(ji,jl1) + hrexp(ji,jl1) )
+                        ELSE
+                           farea    = 0._wp
+                           fvol(ji) = 0._wp
+                        END IF
+                        !                 
+                     ELSE             ! jl2 = jpl
+                        !
+                        hL       = MAX( hrmin(ji,jl1), hi_max(jl2-1) )
+                        expL     = EXP(-( hL - hrmin(ji,jl1) ) / hrexp(ji,jl1) )
+                        farea    = expL
+                        fvol(ji) = ( hL + hrexp(ji,jl1) ) * expL / ( hrmin(ji,jl1) + hrexp(ji,jl1) )
+                        !
+                     END IF            ! jl2 < jpl
+                     ! 
+                     itest_rdg(ji) = 1   ! test for conservation => clem: I am not sure about that
+                     !
+                  END IF             ! ridge redistribution
+                     
                   ! Compute the fraction of rafted ice area and volume going to thickness category jl2
                   IF( hraft(ji,jl1) <= hi_max(jl2) .AND. hraft(ji,jl1) >  hi_max(jl2-1) ) THEN
                      zswitch(ji) = 1._wp
@@ -785,18 +858,20 @@ CONTAINS
       !!
       !! ** 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
-      !!              by ridging. Note that only Hibler's formulation is stable and that
-      !!              ice strength has to be smoothed
+      !!              by ridging. Note that ice strength using Hibler's formulation must be
+      !!              smoothed.
       !!----------------------------------------------------------------------
       INTEGER             ::   ji, jj, jl  ! dummy loop indices
       REAL(wp)            ::   z1_3        ! local scalars
       REAL(wp), DIMENSION(jpi,jpj) ::   zmsk, zworka           ! temporary array used here
-      !!clem
-      LOGICAL                   ::   ln_str_R75
-      REAL(wp)                  ::   zhi, zcp, rn_pe_rdg
+      !!
+      LOGICAL             ::   ln_str_R75
+      REAL(wp)            ::   zhi, zcp
+      REAL(wp)            ::   h2rdg                     ! mean value of h^2 for new ridge
+      REAL(wp), PARAMETER ::   zmax_strength = 200.e3_wp ! Richter-Menge and Elder (1998) estimate maximum in Beaufort Sea in wintertime of the order 150 kN/m
       REAL(wp), DIMENSION(jpij) ::   zstrength, zaksum   ! strength in 1D      
       !!----------------------------------------------------------------------
       ! prepare the mask
@@ -809,7 +884,7 @@ CONTAINS
 
       CASE ( np_strr75 )           !== Rothrock(1975)'s method ==!
 
-         ! these 2 param should be defined once for all at the 1st time step
+         ! this should be defined once for all at the 1st time step
          zcp = 0.5_wp * grav * (rho0-rhoi) * rhoi * r1_rho0   ! proport const for PE
          !
          strength(:,:) = 0._wp
@@ -846,16 +921,31 @@ CONTAINS
                DO ji = 1, npti
                   !
                   IF( apartf(ji,jl) > 0._wp ) THEN
+                     !
+                     IF( ln_distf_lin ) THEN       ! Uniform redistribution of ridged ice               
+                        h2rdg = z1_3 * ( hrmax(ji,jl) * hrmax(ji,jl) +     & ! (a**3-b**3)/(a-b) = a*a+ab+b*b
+                           &             hrmin(ji,jl) * hrmin(ji,jl) +     &
+                           &             hrmax(ji,jl) * hrmin(ji,jl) )
+                        !
+                     ELSEIF( ln_distf_exp ) THEN   ! Exponential redistribution of ridged ice
+                        h2rdg =          hrmin(ji,jl) * hrmin(ji,jl)   &
+                           &   + 2._wp * hrmin(ji,jl) * hrexp(ji,jl)   &
+                           &   + 2._wp * hrexp(ji,jl) * hrexp(ji,jl)
+                     END IF
                      !
                      IF( a_i_2d(ji,jl) > epsi10 ) THEN   ;   zhi = v_i_2d(ji,jl) / a_i_2d(ji,jl)
                      ELSE                                ;   zhi = 0._wp
                      ENDIF
-                     zstrength(ji) = zstrength(ji) -         apartf(ji,jl) * zhi * zhi                  ! PE loss from deforming ice
-                     zstrength(ji) = zstrength(ji) + 2._wp * araft (ji,jl) * zhi * zhi                  ! PE gain from rafting ice
-                     zstrength(ji) = zstrength(ji) +         aridge(ji,jl) * hi_hrdg(ji,jl) * z1_3 *  & ! PE gain from ridging ice
-                        &                                   ( hrmax(ji,jl) * hrmax(ji,jl) +           & ! (a**3-b**3)/(a-b) = a*a+ab+b*b
-                        &                                     hrmin(ji,jl) * hrmin(ji,jl) +           &
-                        &                                     hrmax(ji,jl) * hrmin(ji,jl) )
+!!$                     zstrength(ji) = zstrength(ji) -         apartf(ji,jl) * zhi * zhi                  ! PE loss from deforming ice
+!!$                     zstrength(ji) = zstrength(ji) + 2._wp * araft (ji,jl) * zhi * zhi                  ! PE gain from rafting ice
+!!$                     zstrength(ji) = zstrength(ji) +         aridge(ji,jl) * hi_hrdg(ji,jl) * z1_3 *  & ! PE gain from ridging ice
+!!$                        &                                   ( hrmax(ji,jl) * hrmax(ji,jl) +           & ! (a**3-b**3)/(a-b) = a*a+ab+b*b
+!!$                        &                                     hrmin(ji,jl) * hrmin(ji,jl) +           &
+!!$                        &                                     hrmax(ji,jl) * hrmin(ji,jl) )
+                     zstrength(ji) = zstrength(ji) - apartf(ji,jl) * zhi * zhi                  ! PE loss
+                     zstrength(ji) = zstrength(ji) + 2._wp * araft(ji,jl) * zhi * zhi           ! PE gain (rafting)
+                     zstrength(ji) = zstrength(ji) + aridge(ji,jl) * h2rdg *  hi_hrdg(ji,jl)    ! PE gain (ridging)
+                     
                   ENDIF
                   !
                END DO
@@ -863,6 +953,11 @@ CONTAINS
             !
             zstrength(1:npti) = rn_pe_rdg * zcp * zstrength(1:npti) / zaksum(1:npti)
             !
+            ! Enforce a maximum for strength
+            ! Richter-Menge and Elder (1998) estimate maximum in Beaufort Sea in wintertime of the order 150 kN/m
+            WHERE( zstrength(1:npti) > zmax_strength ) ; zstrength(1:npti) = zmax_strength
+            ENDWHERE
+            !
             CALL tab_1d_2d( npti, nptidx(1:npti), zstrength(1:npti), strength )
             !
          ENDIF
@@ -1014,7 +1109,7 @@ CONTAINS
          WRITE(numout,*) '            ice strength value                                 rn_str       = ', rn_str
          WRITE(numout,*) '      spatial smoothing of the strength                        ln_str_smooth= ', ln_str_smooth
          WRITE(numout,*) '      redistribution of ridged ice: linear (Hibler 1980)       ln_distf_lin = ', ln_distf_lin
-         WRITE(numout,*) '      redistribution of ridged ice: exponential                ln_distf_exp = ', ln_distf_exp
+         WRITE(numout,*) '      redistribution of ridged ice: exponential(Lipscomb 2007) ln_distf_exp = ', ln_distf_exp
          WRITE(numout,*) '            e-folding scale of ridged ice                      rn_murdg     = ', rn_murdg
          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
@@ -1039,11 +1134,13 @@ CONTAINS
       IF( ln_str_CST    ) THEN   ;   ioptio = ioptio + 1   ;   nice_str = np_strcst       ;   ENDIF
       IF( ioptio /= 1 )    CALL ctl_stop( 'ice_dyn_rdgrft_init: one and only one ice strength option has to be defined ' )
       !
+      IF ( ( ln_str_H79 .AND. ln_str_R75 ) .OR. ( .NOT.ln_str_H79 .AND. .NOT.ln_str_R75 ) ) THEN
+         CALL ctl_stop( 'ice_dyn_rdgrft_init: choose one and only one ice strength formulation (ln_str_H79 or ln_str_R75)' )
+      ENDIF
+      !
       IF ( ( ln_distf_lin .AND. ln_distf_exp ) .OR. ( .NOT.ln_distf_lin .AND. .NOT.ln_distf_exp ) ) THEN
          CALL ctl_stop( 'ice_dyn_rdgrft_init: choose one and only one redistribution function (ln_distf_lin or ln_distf_exp)' )
       ENDIF
-      !!clem
-      IF( ln_distf_exp ) CALL ctl_stop( 'ice_dyn_rdgrft_init: exponential redistribution function not coded yet (ln_distf_exp)' )
       !
       IF ( ( ln_partf_lin .AND. ln_partf_exp ) .OR. ( .NOT.ln_partf_lin .AND. .NOT.ln_partf_exp ) ) THEN
          CALL ctl_stop( 'ice_dyn_rdgrft_init: choose one and only one participation function (ln_partf_lin or ln_partf_exp)' )
diff --git a/src/ICE/icerst.F90 b/src/ICE/icerst.F90
index 291ff09cad1608b961e586f336fc1ef55096bd66..ebb65f886360ec07175031de86ee3ffadc2553a9 100644
--- a/src/ICE/icerst.F90
+++ b/src/ICE/icerst.F90
@@ -26,6 +26,7 @@ MODULE icerst
    !
    USE in_out_manager ! I/O manager
    USE iom            ! I/O manager library
+   USE ioipsl  , ONLY : ju2ymds                     ! for calendar
    USE lib_mpp        ! MPP library
    USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
 
@@ -51,6 +52,9 @@ CONTAINS
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt       ! number of iteration
       !
+      INTEGER             ::   iyear, imonth, iday
+      REAL (wp)           ::   zsec
+      REAL (wp)           ::   zfjulday
       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
@@ -67,8 +71,15 @@ CONTAINS
          &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) 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 > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
-            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
+            IF ( ln_rstdate ) THEN
+               zfjulday = fjulday + (2*nn_fsbc+1)*rdt / rday
+               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error
+               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )           
+               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday
+            ELSE
+               IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
+               ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
+               ENDIF
             ENDIF
             ! create the file
             clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)
diff --git a/src/ICE/icestp.F90 b/src/ICE/icestp.F90
index 070052dbbaf5a88d32e277c1df600355deeffadd..821a8d0a358c19cea9be89062ef83b438182b262 100644
--- a/src/ICE/icestp.F90
+++ b/src/ICE/icestp.F90
@@ -275,7 +275,7 @@ CONTAINS
          CALL ice_istate( nit000, Kbb, Kmm, Kaa )   ! start from rest or read a file
       ENDIF
       CALL ice_var_glo2eqv
-      CALL ice_var_agg(1)
+      CALL ice_var_agg(2)
       !
       CALL ice_dyn_init                ! set ice dynamics parameters
       !
diff --git a/src/ICE/icethd_dh.F90 b/src/ICE/icethd_dh.F90
index 540e86e749311154a813d7f4bdf5116cfefebc11..9da10cf0c1e19f3d717ad7e6484aa54c9ab02d4c 100644
--- a/src/ICE/icethd_dh.F90
+++ b/src/ICE/icethd_dh.F90
@@ -192,8 +192,8 @@ CONTAINS
 
       ! Snow melting
       ! ------------
-      ! If heat still available (zq_top > 0)
-      ! then all snw precip has been melted and we need to melt more snow
+      ! Melt snow layers, starting with newly fallen snow layer 0 
+      ! and moving downward, until zq_top=0
       DO jk = 0, nlay_s
          DO ji = 1, npti
             IF( zh_s(ji,jk) > 0._wp .AND. zq_top(ji) > 0._wp ) THEN
@@ -216,10 +216,10 @@ CONTAINS
          END DO
       END DO
 
-      ! Snow sublimation
-      !-----------------
-      ! qla_ice is always >=0 (upwards), heat goes to the atmosphere, therefore snow sublimates
-      !    comment: not counted in mass/heat exchange in iceupdate.F90 since this is an exchange with atm. (not ocean)
+      ! Snow sublimation and deposition
+      !--------------------------------
+      ! when evap_ice_1d > 0 (upwards) snow sublimates and snow thickness decreases
+      ! when evap_ice_1d < 0 (downwards) deposition occurs and snow thickness increases
       zdeltah   (1:npti) = 0._wp ! total snow thickness that sublimates, < 0
       zevap_rema(1:npti) = 0._wp
       DO ji = 1, npti
diff --git a/src/ICE/icethd_pnd.F90 b/src/ICE/icethd_pnd.F90
index f0949d8f0a60d34ca08079f06367b099b10f079b..825c4345958e148800c614794f1797be3830f233 100644
--- a/src/ICE/icethd_pnd.F90
+++ b/src/ICE/icethd_pnd.F90
@@ -140,10 +140,10 @@ CONTAINS
       !------------------------------------
       !  Diagnostics
       !------------------------------------
-      CALL iom_put( 'dvpn_mlt', diag_dvpn_mlt ) ! input from melting
-      CALL iom_put( 'dvpn_lid', diag_dvpn_lid ) ! exchanges with lid
-      CALL iom_put( 'dvpn_drn', diag_dvpn_drn ) ! vertical drainage
-      CALL iom_put( 'dvpn_rnf', diag_dvpn_rnf ) ! runoff + overflow
+      IF( iom_use('dvpn_mlt'  ) ) CALL iom_put( 'dvpn_mlt', diag_dvpn_mlt ) ! input from melting
+      IF( iom_use('dvpn_lid'  ) ) CALL iom_put( 'dvpn_lid', diag_dvpn_lid ) ! exchanges with lid
+      IF( iom_use('dvpn_drn'  ) ) CALL iom_put( 'dvpn_drn', diag_dvpn_drn ) ! vertical drainage
+      IF( iom_use('dvpn_rnf'  ) ) CALL iom_put( 'dvpn_rnf', diag_dvpn_rnf ) ! runoff + overflow
       !
       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 )
@@ -544,7 +544,7 @@ CONTAINS
       ! a_ip      -> apond
       ! a_ip_frac -> apnd
 
-      CALL ctl_stop( 'STOP', 'icethd_pnd : topographic melt ponds are still an ongoing work' )
+      !CALL ctl_stop( 'STOP', 'icethd_pnd : topographic melt ponds are still an ongoing work' )
 
       !---------------------------------------------------------------
       ! Initialise
@@ -644,12 +644,6 @@ CONTAINS
                !--------------------------
                ! Pond lid growth and melt
                !--------------------------
-               ! Mean surface temperature
-               zTavg = 0._wp
-               DO jl = 1, jpl
-                  zTavg = zTavg + t_su(ji,jj,jl)*a_i(ji,jj,jl)
-               END DO
-               zTavg = zTavg / a_i(ji,jj,jl) !!! could get a division by zero here
 
                DO jl = 1, jpl-1
 
@@ -1319,7 +1313,9 @@ CONTAINS
        !-----------------------------------------------------------------
        ! brine salinity and liquid fraction
        !-----------------------------------------------------------------
-
+       
+      SELECT CASE( nn_pnd_brsal )
+      CASE( 0 )
        DO k = 1, nlay_i
 
           Sbr    = - Tin(k) / rTmlt ! Consistent expression with SI3 (linear liquidus)
@@ -1328,6 +1324,16 @@ CONTAINS
           phi(k) = salin(k) / Sbr
 
        END DO
+       
+      CASE( 1 )
+       DO k = 1, nlay_i
+       
+          Sbr  = - 18.7 * Tin(k) - 0.519 * Tin(k)**2 - 0.00535 * Tin(k) **3
+          phi(k) = salin(k) / Sbr
+
+       END DO
+       
+      END SELECT
 
        !-----------------------------------------------------------------
        ! permeability
@@ -1354,7 +1360,7 @@ CONTAINS
       NAMELIST/namthd_pnd/  ln_pnd, ln_pnd_LEV , rn_apnd_min, rn_apnd_max, rn_pnd_flush, &
          &                          ln_pnd_CST , rn_apnd, rn_hpnd,         &
          &                          ln_pnd_TOPO,                           &
-         &                          ln_pnd_lids, ln_pnd_alb
+         &                          ln_pnd_lids, ln_pnd_alb, nn_pnd_brsal
       !!-------------------------------------------------------------------
       !
       READ  ( numnam_ice_ref, namthd_pnd, IOSTAT = ios, ERR = 901)
@@ -1379,6 +1385,7 @@ CONTAINS
          WRITE(numout,*) '            Prescribed pond depth                                 rn_hpnd      = ', rn_hpnd
          WRITE(numout,*) '         Frozen lids on top of melt ponds                         ln_pnd_lids  = ', ln_pnd_lids
          WRITE(numout,*) '         Melt ponds affect albedo or not                          ln_pnd_alb   = ', ln_pnd_alb
+         WRITE(numout,*) '         Brine salinity formulation                               nn_pnd_brsal = ', nn_pnd_brsal
       ENDIF
       !
       !                             !== set the choice of ice pond scheme ==!
diff --git a/src/ICE/icethd_zdf_bl99.F90 b/src/ICE/icethd_zdf_bl99.F90
index 493435f3fa75d2c68657ee0978bc7111e9290f76..3f6f9e57bdddb78f4303c495946c390ac5a9624d 100644
--- a/src/ICE/icethd_zdf_bl99.F90
+++ b/src/ICE/icethd_zdf_bl99.F90
@@ -939,7 +939,7 @@ CONTAINS
          ELSE
             cnd_ice_1d(ji) = 2._wp * ztcond_i(ji,0) / zhi_ssl ! cnd_ice is capped by: cond_i/zhi_ssl
          ENDIF
-         t1_ice_1d(ji) = isnow(ji) * t_s_1d(ji,1) + ( 1._wp - isnow(ji) ) * t_i_1d(ji,1)
+         t1_ice_1d(ji) = isnow_comb(ji) * t_s_1d(ji,1) + ( 1._wp - isnow_comb(ji) ) * t_i_1d(ji,1)
       END DO
       !
       IF( k_cnd == np_cnd_EMU ) THEN
diff --git a/src/ICE/icewri.F90 b/src/ICE/icewri.F90
index 078e3b007baf4ff4ea136f0426dccfed9adbf189..131396b92da0d8e60d21232baaea85a13b29cbe6 100644
--- a/src/ICE/icewri.F90
+++ b/src/ICE/icewri.F90
@@ -103,7 +103,7 @@ CONTAINS
       IF( iom_use('icethic' ) )   CALL iom_put( 'icethic', hm_i        * zmsk00 )                                           ! ice thickness
       IF( iom_use('snwthic' ) )   CALL iom_put( 'snwthic', hm_s        * zmsk00 )                                           ! snw thickness
       IF( iom_use('icebrv'  ) )   CALL iom_put( 'icebrv' , bvm_i* 100. * zmsk00 )                                           ! brine volume
-      IF( iom_use('iceage'  ) )   CALL iom_put( 'iceage' , om_i / rday * zmsk15 + zmiss_val * ( 1._wp - zmsk15 ) )          ! ice age
+      IF( iom_use('iceage'  ) )   CALL iom_put( 'iceage' , om_i / rday * zmsk15 )                                           ! ice age
       IF( iom_use('icehnew' ) )   CALL iom_put( 'icehnew', ht_i_new             )                                           ! new ice thickness formed in the leads
       IF( iom_use('snwvolu' ) )   CALL iom_put( 'snwvolu', vt_s        * zmsksn )                                           ! snow volume
       IF( iom_use('icefrb'  ) ) THEN                                                                                        ! Ice freeboard
@@ -118,14 +118,15 @@ CONTAINS
       IF( iom_use('icehlid' ) )   CALL iom_put( 'icehlid', hm_il  * zmsk00      )                                           ! melt pond lid depth
       IF( iom_use('icevlid' ) )   CALL iom_put( 'icevlid', vt_il  * zmsk00      )                                           ! melt pond lid total volume per unit area
       ! salt
-      IF( iom_use('icesalt' ) )   CALL iom_put( 'icesalt', sm_i                 * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) ) ! mean ice salinity
+      IF( iom_use('icesalt' ) )   CALL iom_put( 'icesalt', sm_i                 * zmsk00 )                                  ! mean ice salinity
       IF( iom_use('icesalm' ) )   CALL iom_put( 'icesalm', st_i * rhoi * 1.0e-3 * zmsk00 )                                  ! Mass of salt in sea ice per cell area
+      IF( iom_use('iceepnd' ) )   CALL iom_put( 'iceepnd', SUM( a_ip_eff * a_i, dim=3 ) * zmsk00  )                         ! melt pond total effective fraction per cell area
       ! heat
-      IF( iom_use('icetemp' ) )   CALL iom_put( 'icetemp', ( tm_i  - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! ice mean temperature
-      IF( iom_use('snwtemp' ) )   CALL iom_put( 'snwtemp', ( tm_s  - rt0 ) * zmsksn + zmiss_val * ( 1._wp - zmsksn ) )      ! snw mean temperature
-      IF( iom_use('icettop' ) )   CALL iom_put( 'icettop', ( tm_su - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the ice surface
-      IF( iom_use('icetbot' ) )   CALL iom_put( 'icetbot', ( t_bo  - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the ice bottom
-      IF( iom_use('icetsni' ) )   CALL iom_put( 'icetsni', ( tm_si - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the snow-ice interface
+      IF( iom_use('icetemp' ) )   CALL iom_put( 'icetemp', ( tm_i  - rt0 ) * zmsk00 )                                       ! ice mean temperature
+      IF( iom_use('snwtemp' ) )   CALL iom_put( 'snwtemp', ( tm_s  - rt0 ) * zmsksn )                                       ! snw mean temperature
+      IF( iom_use('icettop' ) )   CALL iom_put( 'icettop', ( tm_su - rt0 ) * zmsk00  )                                      ! temperature at the ice surface
+      IF( iom_use('icetbot' ) )   CALL iom_put( 'icetbot', ( t_bo  - rt0 ) * zmsk00  )                                      ! temperature at the ice bottom
+      IF( iom_use('icetsni' ) )   CALL iom_put( 'icetsni', ( tm_si - rt0 ) * zmsk00  )                                      ! temperature at the snow-ice interface
       IF( iom_use('icehc'   ) )   CALL iom_put( 'icehc'  ,  -et_i          * zmsk00 )                                       ! ice heat content
       IF( iom_use('snwhc'   ) )   CALL iom_put( 'snwhc'  ,  -et_s          * zmsksn )                                       ! snow heat content
       ! momentum
@@ -169,16 +170,16 @@ CONTAINS
       ! --- category-dependent fields --- !
       IF( iom_use('icemask_cat' ) )   CALL iom_put( 'icemask_cat' ,                  zmsk00l                                   ) ! ice mask 0%
       IF( iom_use('iceconc_cat' ) )   CALL iom_put( 'iceconc_cat' , a_i            * zmsk00l                                   ) ! area for categories
-      IF( iom_use('icethic_cat' ) )   CALL iom_put( 'icethic_cat' , h_i            * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! thickness for categories
-      IF( iom_use('snwthic_cat' ) )   CALL iom_put( 'snwthic_cat' , h_s            * zmsksnl + zmiss_val * ( 1._wp - zmsksnl ) ) ! snow depth for categories
-      IF( iom_use('icesalt_cat' ) )   CALL iom_put( 'icesalt_cat' , s_i            * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! salinity for categories
-      IF( iom_use('iceage_cat'  ) )   CALL iom_put( 'iceage_cat'  , o_i / rday     * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! ice age
+      IF( iom_use('icethic_cat' ) )   CALL iom_put( 'icethic_cat' , h_i            * zmsk00l                                   ) ! thickness for categories
+      IF( iom_use('snwthic_cat' ) )   CALL iom_put( 'snwthic_cat' , h_s            * zmsksnl                                   ) ! snow depth for categories
+      IF( iom_use('icesalt_cat' ) )   CALL iom_put( 'icesalt_cat' , s_i            * zmsk00l                                   ) ! salinity for categories
+      IF( iom_use('iceage_cat'  ) )   CALL iom_put( 'iceage_cat'  , o_i / rday     * zmsk00l                                   ) ! ice age
       IF( iom_use('icetemp_cat' ) )   CALL iom_put( 'icetemp_cat' , ( SUM( t_i, dim=3 ) * r1_nlay_i - rt0 ) &
-         &                                                                         * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! ice temperature
+         &                                                                         * zmsk00l                                   ) ! ice temperature
       IF( iom_use('snwtemp_cat' ) )   CALL iom_put( 'snwtemp_cat' , ( SUM( t_s, dim=3 ) * r1_nlay_s - rt0 ) &
-         &                                                                         * zmsksnl + zmiss_val * ( 1._wp - zmsksnl ) ) ! snow temperature
-      IF( iom_use('icettop_cat' ) )   CALL iom_put( 'icettop_cat' , ( t_su - rt0 ) * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! surface temperature
-      IF( iom_use('icebrv_cat'  ) )   CALL iom_put( 'icebrv_cat'  ,   bv_i * 100.  * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! brine volume
+         &                                                                         * zmsksnl                                   ) ! snow temperature
+      IF( iom_use('icettop_cat' ) )   CALL iom_put( 'icettop_cat' , ( t_su - rt0 ) * zmsk00l                                   ) ! surface temperature
+      IF( iom_use('icebrv_cat'  ) )   CALL iom_put( 'icebrv_cat'  ,   bv_i * 100.  * zmsk00l                                   ) ! brine volume
       IF( iom_use('iceapnd_cat' ) )   CALL iom_put( 'iceapnd_cat' ,   a_ip         * zmsk00l                                   ) ! melt pond frac for categories
       IF( iom_use('icevpnd_cat' ) )   CALL iom_put( 'icevpnd_cat' ,   v_ip         * zmsk00l                                   ) ! melt pond volume for categories
       IF( iom_use('icehpnd_cat' ) )   CALL iom_put( 'icehpnd_cat' ,   h_ip         * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! melt pond thickness for categories
diff --git a/src/OCE/DIA/diahth.F90 b/src/OCE/DIA/diahth.F90
index cdb657b234083caeb59fa2a360ea155fcee00902..3f30ed9c1144fe432291e4c2ce7f15bbc5df8498 100644
--- a/src/OCE/DIA/diahth.F90
+++ b/src/OCE/DIA/diahth.F90
@@ -15,6 +15,7 @@ MODULE diahth
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
+   USE zdfmxl, ONLY: zdf_mxl_zint
    !
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
@@ -292,6 +293,9 @@ CONTAINS
          !
       ENDIF
 
+      ! Vertically-interpolated mixed-layer depth diagnostic
+      CALL zdf_mxl_zint( kt, Kmm )
+
       !
       IF( ln_timing )   CALL timing_stop('dia_hth')
       !
diff --git a/src/OCE/DIA/diaprod.F90 b/src/OCE/DIA/diaprod.F90
new file mode 100644
index 0000000000000000000000000000000000000000..0e878cc91192427eb9f6e6f25d201606bd3669b5
--- /dev/null
+++ b/src/OCE/DIA/diaprod.F90
@@ -0,0 +1,218 @@
+MODULE diaprod
+! Requires key_iom_put
+# if defined key_xios
+   !!======================================================================
+   !!                     ***  MODULE  diaprod  ***
+   !! Ocean diagnostics :  write ocean product diagnostics
+   !!=====================================================================
+   !! History :  3.4  ! 2012  (D. Storkey)  Original code
+   !!            4.0  ! 2019  (D. Storkey)
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   dia_prod      : calculate and write out product diagnostics
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers 
+   USE dom_oce         ! ocean space and time domain
+   USE domvvl          ! for thickness weighted diagnostics if key_vvl
+   USE eosbn2          ! equation of state  (eos call)
+   USE phycst          ! physical constants
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE in_out_manager  ! I/O manager
+   USE iom
+   USE ioipsl
+   USE lib_mpp         ! MPP library
+   USE timing          ! preformance summary
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   dia_prod                 ! routines called by step.F90
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.4 , NEMO Consortium (2012)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE dia_prod( kt, Kmm )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE dia_prod  ***
+      !!                   
+      !! ** Purpose :   Write out product diagnostics (uT, vS etc.)
+      !!
+      !! ** Method  :  use iom_put
+      !!               Product diagnostics are not thickness-weighted in this routine.
+      !!               They should be thickness-weighted using XIOS if key_vvl is set. 
+      !!----------------------------------------------------------------------
+      !!
+      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
+      INTEGER, INTENT( in ) ::   Kmm     ! ocean time level index
+      !!
+      INTEGER                      ::   ji, jj, jk              ! dummy loop indices
+      REAL(wp)                     ::   zztmp, zztmpx, zztmpy   ! 
+      !!
+      REAL(wp), POINTER, DIMENSION(:,:)             ::   z2d   ! 2D workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3d   ! 3D workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zrhop    ! potential density
+      !!----------------------------------------------------------------------
+      ! 
+      IF( ln_timing )   CALL timing_start('dia_prod')
+      ! 
+      ALLOCATE( z2d(jpi,jpj), z3d(jpi,jpj,jpk), zrhop(jpi,jpj,jpk) )
+      !
+
+      IF( iom_use("urhop") .OR. iom_use("vrhop") .OR. iom_use("wrhop") &
+#if ! defined key_diaar5
+     &  .OR. iom_use("rhop") &
+#endif
+     & ) THEN
+         CALL eos( ts(:,:,:,:,Kmm), z3d, zrhop )                 ! now in situ and potential density
+         zrhop(:,:,:) = zrhop(:,:,:)-1000.e0         ! reference potential density to 1000 to avoid precision issues in rhop2 calculation
+         zrhop(:,:,jpk) = 0._wp
+#if ! defined key_diaar5
+         CALL iom_put( 'rhop', zrhop )
+#else
+         ! If key_diaar5 set then there is already an iom_put call to output rhop.
+         ! Really should be a standard diagnostics option?
+#endif
+      ENDIF
+
+      IF( iom_use("ut") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = uu(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) )
+         END_3D
+         CALL iom_put( "ut", z3d )                  ! product of temperature and zonal velocity at U points
+      ENDIF
+
+      IF( iom_use("vt") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = vv(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) )
+         END_3D
+         CALL iom_put( "vt", z3d )                  ! product of temperature and meridional velocity at V points
+      ENDIF
+
+      IF( iom_use("wt") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_2D( 0, 0, 0, 0 )
+               z3d(ji,jj,1) = ww(ji,jj,1) * ts(ji,jj,1,jp_tem,Kmm)
+         END_2D
+         
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = ww(ji,jj,jk) * 0.5 * ( ts(ji,jj,jk-1,jp_tem,Kmm) + ts(ji,jj,jk,jp_tem,Kmm) )
+         END_3D
+         CALL iom_put( "wt", z3d )                  ! product of temperature and vertical velocity at W points
+      ENDIF
+
+      IF( iom_use("us") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = uu(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) )
+         END_3D
+         CALL iom_put( "us", z3d )                  ! product of salinity and zonal velocity at U points
+      ENDIF
+
+      IF( iom_use("vs") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = vv(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) )
+         END_3D
+         CALL iom_put( "vs", z3d )                  ! product of salinity and meridional velocity at V points
+      ENDIF
+
+      IF( iom_use("ws") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_2D( 0, 0, 0, 0 )
+               z3d(ji,jj,1) = ww(ji,jj,1) * ts(ji,jj,1,jp_sal,Kmm)
+         END_2D
+         
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = ww(ji,jj,jk) * 0.5 * ( ts(ji,jj,jk-1,jp_sal,Kmm) + ts(ji,jj,jk,jp_sal,Kmm) )
+         END_3D
+         
+         CALL iom_put( "ws", z3d )                  ! product of salinity and vertical velocity at W points
+      ENDIF
+
+      IF( iom_use("uv") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = 0.25 * ( uu(ji-1,jj,jk,Kmm) + uu(ji,jj,jk,Kmm) ) * ( vv(ji,jj-1,jk,Kmm) + vv(ji,jj,jk,Kmm) ) 
+         END_3D
+         CALL iom_put( "uv", z3d )                  ! product of zonal velocity and meridional velocity at T points
+      ENDIF
+
+      IF( iom_use("uw") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_2D( 0, 0, 0, 0 )
+               z3d(ji,jj,1) = 0.5 * ( ww(ji,jj,1) + ww(ji+1,jj,1) ) * uu(ji,jj,1,Kmm) 
+         END_2D
+         
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = 0.25 * ( ww(ji,jj,jk) + ww(ji+1,jj,jk) ) * ( uu(ji,jj,jk-1,Kmm) + uu(ji,jj,jk,Kmm) ) 
+         END_3D
+         CALL iom_put( "uw", z3d )                  ! product of zonal velocity and vertical velocity at UW points
+      ENDIF
+
+      IF( iom_use("vw") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_2D( 0, 0, 0, 0 )
+               z3d(ji,jj,1) = 0.5 * ( ww(ji,jj,1) + ww(ji,jj+1,1) ) * vv(ji,jj,1,Kmm) 
+         END_2D
+         
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = 0.25 * ( ww(ji,jj,jk) + ww(ji,jj+1,jk) ) * ( vv(ji,jj,jk-1,Kmm) + vv(ji,jj,jk,Kmm) ) 
+         END_3D
+         CALL iom_put( "vw", z3d )                  ! product of meriodional velocity and vertical velocity at VW points
+      ENDIF
+
+      IF( iom_use("urhop") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = uu(ji,jj,jk,Kmm) * 0.5 * ( zrhop(ji,jj,jk) + zrhop(ji+1,jj,jk) )
+         END_3D
+         CALL iom_put( "urhop", z3d )                  ! product of density and zonal velocity at U points
+      ENDIF
+
+      IF( iom_use("vrhop") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = vv(ji,jj,jk,Kmm) * 0.5 * ( zrhop(ji,jj,jk) + zrhop(ji,jj+1,jk) )
+         END_3D
+         CALL iom_put( "vrhop", z3d )                  ! product of density and meridional velocity at V points
+      ENDIF
+
+      IF( iom_use("wrhop") ) THEN
+         z3d(:,:,:) = 0.e0 
+         DO_2D( 0, 0, 0, 0 )
+               z3d(ji,jj,1) = ww(ji,jj,1) * zrhop(ji,jj,1)
+         END_2D
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+                  z3d(ji,jj,jk) = ww(ji,jj,jk) * 0.5 * ( zrhop(ji,jj,jk-1) + zrhop(ji,jj,jk) )
+         END_3D
+         CALL iom_put( "wrhop", z3d )                  ! product of density and vertical velocity at W points
+      ENDIF
+
+      !
+      DEALLOCATE( z2d, z3d, zrhop )
+      !
+      IF( ln_timing )   CALL timing_stop('dia_prod')
+      !
+   END SUBROUTINE dia_prod
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option :                                         NO diaprod
+   !!----------------------------------------------------------------------
+   LOGICAL, PUBLIC, PARAMETER :: lk_diaprod = .FALSE.   ! coupled flag
+CONTAINS
+   SUBROUTINE dia_prod( kt , Kmm)   ! Empty routine
+      INTEGER ::   kt, Kmm
+      !WRITE(*,*) 'dia_prod: You should not have seen this print! error?', kt
+   END SUBROUTINE dia_prod
+#endif
+   !!======================================================================
+END MODULE diaprod
diff --git a/src/OCE/DIA/diawri.F90 b/src/OCE/DIA/diawri.F90
index 3d851bd220fbf446f8495c117e4d2d0149b9e6af..9a6c35861a0496cd3cce3a3d9a612358d28e756d 100644
--- a/src/OCE/DIA/diawri.F90
+++ b/src/OCE/DIA/diawri.F90
@@ -46,6 +46,7 @@ MODULE diawri
    USE zdf_oce        ! ocean vertical physics
    USE zdfdrg         ! ocean vertical physics: top/bottom friction
    USE zdfmxl         ! mixed layer
+   USE zdftke  , ONLY: htau
    USE zdfosm         ! mixed layer
    !
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
@@ -53,6 +54,7 @@ MODULE diawri
    USE dia25h         ! 25h Mean output
    USE iom            ! 
    USE ioipsl         ! 
+   USE eosbn2
 
 #if defined key_si3
    USE ice 
@@ -124,9 +126,33 @@ CONTAINS
       REAL(wp)::   ze3
       REAL(wp), DIMENSION(A2D(     0))     ::   z2d   ! 2D workspace
       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   z3d   ! 3D workspace
+      CHARACTER(len=4),SAVE :: ttype , stype           ! temperature and salinity type
       !!----------------------------------------------------------------------
       ! 
       IF( ln_timing )   CALL timing_start('dia_wri')
+      !
+      IF( kt == nit000 ) THEN
+         IF( ln_TEOS10 ) THEN
+            IF ( iom_use("toce_pot") .OR. iom_use("soce_pra") .OR. iom_use("sst_pot") .OR. iom_use("sss_pra") &
+                  & .OR. iom_use("sbt_pot") .OR. iom_use("sbs_pra") .OR. iom_use("sstgrad_pot") .OR. iom_use("sstgrad2_pot") &
+                  & .OR. iom_use("tosmint_pot") .OR. iom_use("somint_pra"))  THEN 
+               CALL ctl_stop( 'diawri: potential temperature and practical salinity not available with ln_TEOS10' )
+            ELSE
+               ttype='con' ; stype='abs'   ! teos-10 using conservative temperature and absolute salinity
+            ENDIF 
+         ELSE IF( ln_EOS80  ) THEN
+            IF ( iom_use("toce_con") .OR. iom_use("soce_abs") .OR. iom_use("sst_con") .OR. iom_use("sss_abs") &
+                  & .OR. iom_use("sbt_con") .OR. iom_use("sbs_abs") .OR. iom_use("sstgrad_con") .OR. iom_use("sstgrad2_con") &
+                  & .OR. iom_use("tosmint_con") .OR. iom_use("somint_abs"))  THEN 
+               CALL ctl_stop( 'diawri: conservative temperature and absolute salinity not available with ln_EOS80' )
+            ELSE
+               ttype='pot' ; stype='pra'   ! eos-80 using potential temperature and practical salinity
+            ENDIF
+         ELSE IF ( ln_SEOS) THEN
+            ttype='seos' ; stype='seos' ! seos using Simplified Equation of state
+         ENDIF
+      ENDIF
+
       ! 
       ! Output the initial state and forcings
       IF( ninist == 1 ) THEN                       
@@ -207,25 +233,25 @@ CONTAINS
 #endif
 
       ! --- tracers T&S --- !      
-      CALL iom_put( "toce", ts(:,:,:,jp_tem,Kmm) )    ! 3D temperature
-      CALL iom_put(  "sst", ts(:,:,1,jp_tem,Kmm) )    ! surface temperature
+      CALL iom_put( "toce_"//ttype, ts(:,:,:,jp_tem,Kmm) )    ! 3D temperature
+      CALL iom_put(  "sst_"//ttype, ts(:,:,1,jp_tem,Kmm) )    ! surface temperature
 
-      IF ( iom_use("sbt") ) THEN
+      IF ( iom_use("sbt_"//ttype) ) THEN
          DO_2D( 0, 0, 0, 0 )
             ikbot = mbkt(ji,jj)
             z2d(ji,jj) = ts(ji,jj,ikbot,jp_tem,Kmm)
          END_2D
-         CALL iom_put( "sbt", z2d )                ! bottom temperature
+         CALL iom_put( "sbt_"//ttype, z2d )                ! bottom temperature
       ENDIF
       
-      CALL iom_put( "soce", ts(:,:,:,jp_sal,Kmm) )    ! 3D salinity
-      CALL iom_put(  "sss", ts(:,:,1,jp_sal,Kmm) )    ! surface salinity
-      IF ( iom_use("sbs") ) THEN
+      CALL iom_put( "soce_"//stype, ts(:,:,:,jp_sal,Kmm) )    ! 3D salinity
+      CALL iom_put(  "sss_"//stype, ts(:,:,1,jp_sal,Kmm) )    ! surface salinity
+      IF ( iom_use("sbs_"//stype) ) THEN
          DO_2D( 0, 0, 0, 0 )
             ikbot = mbkt(ji,jj)
             z2d(ji,jj) = ts(ji,jj,ikbot,jp_sal,Kmm)
          END_2D
-         CALL iom_put( "sbs", z2d )                ! bottom salinity
+         CALL iom_put( "sbs_"//stype, z2d )                ! bottom salinity
       ENDIF
 
       IF( .NOT.lk_SWE )   CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0)
@@ -295,6 +321,7 @@ CONTAINS
       CALL iom_put( "avt" , avt )                  ! T vert. eddy diff. coef.
       CALL iom_put( "avs" , avs )                  ! S vert. eddy diff. coef.
       CALL iom_put( "avm" , avm )                  ! T vert. eddy visc. coef.
+      CALL iom_put( "htau" , htau )                ! htau scaling
 
       IF( iom_use('logavt') )   CALL iom_put( "logavt", LOG( MAX( 1.e-20_wp, avt(:,:,:) ) ) )
       IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) )
@@ -316,7 +343,7 @@ CONTAINS
          ENDIF
       ENDIF
          
-      IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN
+      IF ( iom_use("sstgrad_"//ttype) .OR. iom_use("sstgrad2_"//ttype) ) THEN
          DO_2D( 0, 0, 0, 0 )                       ! sst gradient
             zztmp  = ts(ji,jj,1,jp_tem,Kmm)
             zztmpx = ( ts(ji+1,jj,1,jp_tem,Kmm) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - ts(ji-1,jj  ,1,jp_tem,Kmm) ) * r1_e1u(ji-1,jj)
@@ -324,12 +351,12 @@ CONTAINS
             z2d(ji,jj) = 0.25_wp * ( zztmpx * zztmpx + zztmpy * zztmpy )   &
                &                 * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * vmask(ji,jj-1,1)
          END_2D
-         CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient
-         IF ( iom_use("sstgrad") ) THEN
+         CALL iom_put( "sstgrad2_"//ttype,  z2d )          ! square of module of sst gradient
+         IF ( iom_use("sstgrad_"//ttype) ) THEN
             DO_2D( 0, 0, 0, 0 )
                z2d(ji,jj) = SQRT( z2d(ji,jj) )
             END_2D
-            CALL iom_put( "sstgrad",  z2d )        ! module of sst gradient
+            CALL iom_put( "sstgrad_"//ttype,  z2d )        ! module of sst gradient
          ENDIF
       ENDIF
          
@@ -456,19 +483,28 @@ CONTAINS
 
       ENDIF
 
-      IF( iom_use("tosmint") ) THEN
+      IF( (.NOT.l_ldfeiv_time) .AND. ( iom_use('RossRad')  .OR. iom_use('RossRadlim') &
+            &                     .OR. iom_use('Tclinic_recip') .OR. iom_use('RR_GS')      &
+            &                     .OR. iom_use('aeiu_2d')  .OR. iom_use('aeiv_2d') ) ) THEN
+         CALL ldf_eiv(kt, 75.0, z2d, z3d(:,:,1), Kmm)
+         CALL iom_put('aeiu_2d', z2d)
+         CALL iom_put('aeiv_2d', z3d(:,:,1))
+      ENDIF
+
+
+      IF( iom_use("tosmint_"//ttype) ) THEN
          z2d(:,:) = 0._wp
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )
             z2d(ji,jj) = z2d(ji,jj) + rho0 * e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm)
          END_3D
-         CALL iom_put( "tosmint", z2d )            ! Vertical integral of temperature
+         CALL iom_put( "tosmint_"//ttype, z2d )            ! Vertical integral of temperature
       ENDIF
-      IF( iom_use("somint") ) THEN
+      IF( iom_use("somint_"//stype) ) THEN
          z2d(:,:) = 0._wp
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )
             z2d(ji,jj) = z2d(ji,jj) + rho0 * e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm)
          END_3D
-         CALL iom_put( "somint", z2d )             ! Vertical integral of salinity
+         CALL iom_put( "somint_"//stype, z2d )             ! Vertical integral of salinity
       ENDIF
 
       CALL iom_put( "bn2", rn2 )                   ! Brunt-Vaisala buoyancy frequency (N^2)
diff --git a/src/OCE/DOM/domain.F90 b/src/OCE/DOM/domain.F90
index 7735ad54b8c4df9696fb0b2e8a111a2c54d43748..c37bebcefa6c4b7c73e83158e49bc1ce1deff82d 100644
--- a/src/OCE/DOM/domain.F90
+++ b/src/OCE/DOM/domain.F90
@@ -270,10 +270,10 @@ CONTAINS
       !!----------------------------------------------------------------------
       !
       NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list,                 &
-         &             nn_no   , cn_exp   , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl ,     &
+         &             nn_no   , cn_exp   , cn_ocerst_in, cn_ocerst_out, ln_rstart , ln_rstdate, nn_rstctl ,     &
          &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     &
          &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, ln_1st_euler  , &
-         &             ln_cfmeta, ln_xios_read, nn_wxios
+         &             ln_cfmeta, ln_xios_read, nn_wxios, ln_rst_eos
       NAMELIST/namdom/ ln_linssh, rn_Dt, rn_atfp, ln_crs, ln_c1d, ln_meshmask
       NAMELIST/namtile/ ln_tile, nn_ltile_i, nn_ltile_j
 #if defined key_netcdf4
@@ -377,9 +377,11 @@ CONTAINS
          WRITE(numout,*) '      frequency of output file        nn_write        = ', nn_write
 #endif
          WRITE(numout,*) '      mask land points                ln_mskland      = ', ln_mskland
+         WRITE(numout,*) '      date-stamp restart files        ln_rstdate      = ', ln_rstdate
          WRITE(numout,*) '      additional CF standard metadata ln_cfmeta       = ', ln_cfmeta
          WRITE(numout,*) '      overwrite an existing file      ln_clobber      = ', ln_clobber
          WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz
+         WRITE(numout,*) '      check restart equation of state ln_rst_eos      = ', ln_rst_eos
          IF( TRIM(Agrif_CFixed()) == '0' ) THEN
             WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read
             WRITE(numout,*) '      Write restart using XIOS        nn_wxios   = ', nn_wxios
diff --git a/src/OCE/DOM/dommsk.F90 b/src/OCE/DOM/dommsk.F90
index 362b11e3e48d4bfad0279a14b9b72c8847554aeb..aab6b1e51ae8dcab46b24cadf813e449eba370ca 100644
--- a/src/OCE/DOM/dommsk.F90
+++ b/src/OCE/DOM/dommsk.F90
@@ -33,6 +33,9 @@ MODULE dommsk
    USE iom            ! IOM library
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! Massively Parallel Processing library
+   USE iom             ! For shlat2d
+   USE fldread         ! for sn_shlat2d
+
 
    IMPLICIT NONE
    PRIVATE
@@ -85,7 +88,11 @@ CONTAINS
       INTEGER  ::   iktop, ikbot   !   -       -
       INTEGER  ::   ios, inum
       !!
-      NAMELIST/namlbc/ rn_shlat, ln_vorlat
+      REAL(wp) :: zshlat           !: locally modified shlat for some strait
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zshlat2d
+      LOGICAL                         :: ln_shlat2d
+      CHARACTER(len = 256)            :: cn_shlat2d_file, cn_shlat2d_var  
+      NAMELIST/namlbc/ rn_shlat, ln_vorlat, ln_shlat2d, cn_shlat2d_file, cn_shlat2d_var
       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,             &
@@ -110,12 +117,20 @@ CONTAINS
       ENDIF
       !
       IF(lwp) WRITE(numout,*)
-      IF     (      rn_shlat == 0.               ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  free-slip'
-      ELSEIF (      rn_shlat == 2.               ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  no-slip'
-      ELSEIF ( 0. < rn_shlat .AND. rn_shlat < 2. ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  partial-slip'
-      ELSEIF ( 2. < rn_shlat                     ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  strong-slip'
-      ELSE
-         CALL ctl_stop( 'dom_msk: wrong value for rn_shlat (i.e. a negalive value). We stop.' )
+      IF ( ln_shlat2d ) THEN
+         IF(lwp) WRITE(numout,*) '         READ shlat as a 2D coefficient in a file '
+         ALLOCATE( zshlat2d(jpi,jpj) )
+         CALL iom_open(TRIM(cn_shlat2d_file), inum)
+         CALL iom_get (inum, jpdom_global, TRIM(cn_shlat2d_var), zshlat2d, 1) !
+         CALL iom_close(inum)
+       ELSE
+         IF     (      rn_shlat == 0.               ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  free-slip'
+         ELSEIF (      rn_shlat == 2.               ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  no-slip'
+         ELSEIF ( 0. < rn_shlat .AND. rn_shlat < 2. ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  partial-slip'
+         ELSEIF ( 2. < rn_shlat                     ) THEN   ;   IF(lwp) WRITE(numout,*) '   ==>>>   ocean lateral  strong-slip'
+         ELSE
+            CALL ctl_stop( 'dom_msk: wrong value for rn_shlat (i.e. a negalive value). We stop.' )
+         ENDIF
       ENDIF
 
       !  Ocean/land mask at t-point  (computed from ko_top and ko_bot)
@@ -207,14 +222,26 @@ CONTAINS
 
       ! Lateral boundary conditions on velocity (modify fmask)
       ! ---------------------------------------  
-      IF( rn_shlat /= 0._wp ) THEN      ! Not free-slip lateral boundary condition
+      IF( rn_shlat /= 0._wp .or. ln_shlat2d ) THEN      ! Not free-slip lateral boundary condition
+         !
+         IF (  ln_shlat2d ) THEN
+            DO_3D( 0, 0, 0, 0, 1, jpk )
+               IF( fmask(ji,jj,jk) == 0._wp ) THEN
+                  fmask(ji,jj,jk) = zshlat2d(ji,jj) * MIN( 1._wp , MAX( umask(ji,jj,jk), umask(ji,jj+1,jk), &
+                     &                                           vmask(ji,jj,jk), vmask(ji+1,jj,jk) ) )
+               ENDIF
+            END_3D
+         ELSE
+            DO_3D( 0, 0, 0, 0, 1, jpk )
+               IF( fmask(ji,jj,jk) == 0._wp ) THEN
+                  fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( umask(ji,jj,jk), umask(ji,jj+1,jk), &
+                     &                                           vmask(ji,jj,jk), vmask(ji+1,jj,jk) ) )
+               ENDIF
+            END_3D
+         END IF
+         !
+         IF( ln_shlat2d ) DEALLOCATE( zshlat2d )
          !
-         DO_3D( 0, 0, 0, 0, 1, jpk )
-            IF( fmask(ji,jj,jk) == 0._wp ) THEN
-               fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( umask(ji,jj,jk), umask(ji,jj+1,jk), &
-                  &                                           vmask(ji,jj,jk), vmask(ji+1,jj,jk) ) )
-            ENDIF
-         END_3D
          CALL lbc_lnk( 'dommsk', fmask, 'F', 1._wp )      ! Lateral boundary conditions on fmask
          !
          ! CAUTION : The fmask may be further modified in dyn_vor_init ( dynvor.F90 ) depending on ln_vorlat
@@ -224,7 +251,9 @@ CONTAINS
       ! User defined alteration of fmask (use to reduce ocean transport in specified straits)
       ! -------------------------------- 
       !
-      CALL usr_def_fmask( cn_cfg, nn_cfg, fmask )
+      IF ( .not. ln_shlat2d ) THEN      
+         CALL usr_def_fmask( cn_cfg, nn_cfg, fmask )
+      ENDIF
       !
 #if defined key_agrif
       ! Reset masks defining updated points over parent grids
diff --git a/src/OCE/ICB/icbrst.F90 b/src/OCE/ICB/icbrst.F90
index 092b56e5860f47825f7bb949b252f319f7108633..ed32fed4709b0dc3692dabf85a1f5782c63d5555 100644
--- a/src/OCE/ICB/icbrst.F90
+++ b/src/OCE/ICB/icbrst.F90
@@ -24,6 +24,7 @@ MODULE icbrst
    USE lib_mpp        ! NEMO MPI library, lk_mpp in particular
    USE netcdf         ! netcdf routines for IO
    USE iom
+   USE ioipsl, ONLY : ju2ymds    ! for calendar
    USE icb_oce        ! define iceberg arrays
    USE icbutl         ! iceberg utility routines
 
@@ -190,9 +191,12 @@ CONTAINS
       INTEGER ::   jn   ! dummy loop index
       INTEGER ::   idg  ! number of digits
       INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim
+      INTEGER                ::   iyear, imonth, iday
+      REAL (wp)              ::   zsec
+      REAL (wp)              ::   zfjulday
       CHARACTER(len=256)     :: cl_path
       CHARACTER(len=256)     :: cl_filename
-      CHARACTER(len=8  )     :: cl_kt
+      CHARACTER(LEN=20)      ::   cl_kt     ! ocean time-step deine as a character
       CHARACTER(LEN=12 )     :: clfmt            ! writing format
       TYPE(iceberg), POINTER :: this
       TYPE(point)  , POINTER :: pt
@@ -212,7 +216,16 @@ CONTAINS
          IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/'
          !
          ! file name
-         WRITE(cl_kt, '(i8.8)') kt
+         IF ( ln_rstdate ) THEN
+            zfjulday = fjulday + rdt / rday
+            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error
+            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )           
+            WRITE(cl_kt, '(i4.4,2i2.2)') iyear, imonth, iday
+         ELSE
+            IF( kt > 999999999 ) THEN   ;   WRITE(cl_kt, *       ) kt
+            ELSE                        ;   WRITE(cl_kt, '(i8.8)') kt
+            ENDIF
+         ENDIF
          cl_filename = TRIM(cexper)//"_"//cl_kt//"_"//TRIM(cn_icbrst_out)
          IF( lk_mpp ) THEN
             idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
diff --git a/src/OCE/IOM/in_out_manager.F90 b/src/OCE/IOM/in_out_manager.F90
index 4982db08800080b53a532d0f21db3b40b0242788..35c74a6316f5230e3c24a97b9625f17982fab4d0 100644
--- a/src/OCE/IOM/in_out_manager.F90
+++ b/src/OCE/IOM/in_out_manager.F90
@@ -27,6 +27,7 @@ MODULE in_out_manager
    CHARACTER(lc) ::   cn_ocerst_outdir !: restart output directory
    LOGICAL       ::   ln_rstart        !: start from (F) rest or (T) a restart file
    LOGICAL       ::   ln_rst_list      !: output restarts at list of times (T) or by frequency (F)
+   LOGICAL       ::   ln_rst_eos       !: check equation of state used for the restart is consistent with model
    INTEGER       ::   nn_rstctl        !: control of the time step (0, 1 or 2)
    INTEGER       ::   nn_rstssh   = 0  !: hand made initilization of ssh or not (1/0)
    INTEGER       ::   nn_it000         !: index of the first time step
@@ -39,6 +40,7 @@ MODULE in_out_manager
    INTEGER       ::   nn_stock         !: restart file frequency
    INTEGER, DIMENSION(10) :: nn_stocklist  !: restart dump times
    LOGICAL       ::   ln_mskland       !: mask land points in NetCDF outputs (costly: + ~15%)
+   LOGICAL       ::   ln_rstdate       !: T=> stamp output restart files with date instead of timestep
    LOGICAL       ::   ln_cfmeta        !: output additional data to netCDF files required for compliance with the CF metadata standard
    LOGICAL       ::   ln_clobber       !: clobber (overwrite) an existing file
    INTEGER       ::   nn_chunksz       !: chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
diff --git a/src/OCE/IOM/restart.F90 b/src/OCE/IOM/restart.F90
index 9ae044782e6d0198c4c53e443c2ae30d3d939c53..82f8dafab14bd1fa00dc5e107a876fefeb230524 100644
--- a/src/OCE/IOM/restart.F90
+++ b/src/OCE/IOM/restart.F90
@@ -39,6 +39,7 @@ MODULE restart
    !
    USE in_out_manager ! I/O manager
    USE iom            ! I/O module
+   USE ioipsl, ONLY : ju2ymds    ! for calendar
    USE lib_mpp        ! distribued memory computing library
 
    IMPLICIT NONE
@@ -72,6 +73,9 @@ CONTAINS
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt     ! ocean time-step
       !!
+      INTEGER             ::   iyear, imonth, iday
+      REAL (wp)           ::   zsec
+      REAL (wp)           ::   zfjulday
       CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character
       CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name
       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file
@@ -103,8 +107,16 @@ CONTAINS
       IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) 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
-            ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst
+            
+            IF ( ln_rstdate ) THEN
+               zfjulday = fjulday + rdt / rday
+               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error
+               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )           
+               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday
+            ELSE
+               IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
+               ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst
+               ENDIF
             ENDIF
             ! create the file
             clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out)
@@ -183,6 +195,9 @@ CONTAINS
 #endif
       ENDIF
 
+      CALL iom_rstput( kt, nitrst, numrow, 'neos'    , REAL(neos))   ! equation of state
+      !CALL iom_rstput( kt, nitrst, numrow, 'neos'    , neos      , ktype = jp_i1, ldxios = lwxios)   ! equation of state
+
       IF( ln_diurnal )   CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst )
       IF( kt == nitrst ) THEN
          IF( .NOT.lwxios ) THEN
@@ -267,6 +282,8 @@ CONTAINS
       !!----------------------------------------------------------------------
       INTEGER          , INTENT(in) ::   Kbb, Kmm   ! ocean time level indices
       INTEGER  ::   jk
+      INTEGER  ::   id1 
+      REAL(wp) ::   zeos
       REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   :: zgdept       ! 3D workspace for QCO
       !!----------------------------------------------------------------------
@@ -299,6 +316,18 @@ CONTAINS
       CALL iom_get( numror, jpdom_auto, 'tn', ts(:,:,:,jp_tem,Kmm) )
       CALL iom_get( numror, jpdom_auto, 'sn', ts(:,:,:,jp_sal,Kmm) )
       !
+      
+      IF ( ln_rst_eos ) THEN
+         ! Check equation of state used is consistent with the restart
+         IF( iom_varid( numror, 'neos') == -1 ) THEN
+            CALL ctl_stop( 'restart, rst_read: variable neos not found. STOP check that the equations of state in the restart file and in the namelist nameos are consistent and use ln_rst_eos=F')
+         ELSE
+            CALL iom_get( numror, 'neos'   , zeos )
+            IF ( INT(zeos) /= neos ) CALL ctl_stop( 'restart, rst_read: equation of state used in restart file differs from namelist nameos')
+         ENDIF
+      ENDIF
+      
+      
       IF( l_1st_euler ) THEN        !*  Euler restart   (MLF only)
          IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields set to Kmm values'
          uu(:,:,:  ,Kbb) = uu(:,:,:  ,Kmm)         ! all before fields set to now values
diff --git a/src/OCE/LBC/mppini.F90 b/src/OCE/LBC/mppini.F90
index 537dcf58c5a90d9b7ae10838d0cc57eaee84ca4a..1ba6029bad619a4cafcc79f50dea386a3ae62733 100644
--- a/src/OCE/LBC/mppini.F90
+++ b/src/OCE/LBC/mppini.F90
@@ -333,8 +333,8 @@ CONTAINS
       nimpp = iimppt(ii,ij)
       njmpp = ijmppt(ii,ij)
       !
-      CALL init_doloop    ! set start/end indices of do-loop, depending on the halo width value (nn_hls)
       CALL init_locglo    ! define now functions needed to convert indices from/to global to/from local domains
+      CALL init_doloop    ! set start/end indices of do-loop, depending on the halo width value (nn_hls)
       !
       IF(lwp) THEN
          WRITE(numout,*)
@@ -1409,9 +1409,46 @@ ENDIF
       Njs0 =   1+nn_hls
       Nie0 = jpi-nn_hls
       Nje0 = jpj-nn_hls
+
       !
       Ni_0 = Nie0 - Nis0 + 1
       Nj_0 = Nje0 - Njs0 + 1
+
+      ! Start and end indexes for actual coupling fields on extended grid
+      Nis0_ext = Nis0
+      Nie0_ext = Nie0
+      Njs0_ext = Njs0
+      Nje0_ext = Nje0
+      IF (mig(1) == 1 ) THEN
+         ! Drag start column 1 place to the left/west
+         Nis0_ext=Nis0_ext-1
+      ENDIF
+
+      IF (mig(jpi) == jpiglo ) THEN
+         ! Drag end column 1 place to the right/east
+         Nie0_ext=Nie0_ext+1
+      ENDIF
+
+
+     ! RSRH we don't adjust anything in the N-S (j) direction
+     ! since the content of the N-fold is catared for by populating values 
+     ! using lbc_lnk rather than relying on getting them from the coupler. 
+     ! This is rather confused by the fact that jpjglo has a value BIGGER
+     ! than it did at pre 4.2... e.g. for ORCA1 it's set to 333 instead of 332
+     ! which is rather baffling and confuses some dimensioning calculations
+     ! if we're not very very careful 
+
+
+      ! Set up dimensions for old style coupling exchanges on extended grid
+      Ni_0_ext = Ni_0
+      Nj_0_ext = Nj_0
+      IF (mig(1) == 1 .OR. mig(jpi) == jpiglo ) THEN
+         ! We're at the extreme left or right edge of the grid so need to cater
+         ! for an extra column
+         Ni_0_ext = Ni_0_ext + 1
+      ENDIF
+
+     
       !
       jpkm1 = jpk-1                             !   "           "
       !
diff --git a/src/OCE/LDF/ldftra.F90 b/src/OCE/LDF/ldftra.F90
index 510166d0955b9fd418b04aae9ba2965af7799c4b..b066c4e41148148994d0ed392720a1f6d0a47842 100644
--- a/src/OCE/LDF/ldftra.F90
+++ b/src/OCE/LDF/ldftra.F90
@@ -71,6 +71,8 @@ MODULE ldftra
    INTEGER , PUBLIC ::   nn_aei_ijk_t        !: choice of time/space variation of the eiv coeff.
    REAL(wp), PUBLIC ::      rn_Ue               !: lateral diffusive velocity  [m/s]
    REAL(wp), PUBLIC ::      rn_Le               !: lateral diffusive length    [m]
+   INTEGER,  PUBLIC ::   nn_ldfeiv_shape     !: shape of bounding coefficient (Treguier et al formulation only)
+
 
    !                                  ! Flag to control the type of lateral diffusive operator
    INTEGER, PARAMETER, PUBLIC ::   np_ERROR  =-10   ! error in specification of lateral diffusion
@@ -495,7 +497,8 @@ CONTAINS
       REAL(wp) ::   zah_max, zUfac         !   -   scalar
       !!
       NAMELIST/namtra_eiv/ ln_ldfeiv   , ln_ldfeiv_dia,   &   ! eddy induced velocity (eiv)
-         &                 nn_aei_ijk_t, rn_Ue, rn_Le         ! eiv  coefficient
+         &                 nn_aei_ijk_t, rn_Ue, rn_Le,    &   ! eiv  coefficient
+         &                 nn_ldfeiv_shape
       !!----------------------------------------------------------------------
       !
       IF(lwp) THEN                      ! control print
@@ -588,6 +591,7 @@ CONTAINS
             IF(lwp) WRITE(numout,*) '   ==>>>   eddy induced velocity coef. = F( latitude, longitude, time )'
             IF(lwp) WRITE(numout,*) '                                       = F( growth rate of baroclinic instability )'
             IF(lwp) WRITE(numout,*) '           maximum allowed value: aei0 = ', aei0, ' m2/s'
+            IF(lwp) WRITE(numout,*) '           shape of bounding coefficient : ',nn_ldfeiv_shape
             !
             l_ldfeiv_time = .TRUE.     ! will be calculated by call to ldf_tra routine in step.F90
             !
@@ -636,14 +640,21 @@ CONTAINS
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   paeiu, paeiv   ! eiv coefficient      [m2/s]
       !
       INTEGER  ::   ji, jj, jk    ! dummy loop indices
-      REAL(wp) ::   zfw, ze3w, zn2, z1_f20, zzaei    ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zn, zah, zhw, zRo, zaeiw   ! 2D workspace
+      REAL(wp) ::   zfw, ze3w, zn2, z1_f20, zzaei, z2_3    ! local scalars
+      REAL(wp), DIMENSION(jpi,jpj) ::   zn, zah, zhw, zRo, zRo_lim, zTclinic_recip, zaeiw, zratio   ! 2D workspace
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zmodslp ! 3D workspace 
       !!----------------------------------------------------------------------
       !
       zn (:,:) = 0._wp        ! Local initialization
+      zmodslp(:,:,:) = 0._wp 
       zhw(:,:) = 5._wp
       zah(:,:) = 0._wp
       zRo(:,:) = 0._wp
+      zRo_lim(:,:) = 0._wp
+      zTclinic_recip(:,:) = 0._wp
+      zratio(:,:) = 0._wp
+      zaeiw(:,:) = 0._wp
+
       !                       ! Compute lateral diffusive coefficient at T-point
       IF( ln_traldf_triad ) THEN
          DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpk )
@@ -670,8 +681,9 @@ CONTAINS
             ! 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)
-            zah(ji,jj) = zah(ji,jj) + zn2 * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)   &
-               &                            + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) ) * ze3w
+            zmodslp(ji,jj,jk) =  wslpi(ji,jj,jk) * wslpi(ji,jj,jk)   &
+                     &               + wslpj(ji,jj,jk) * wslpj(ji,jj,jk)
+            zah(ji,jj) = zah(ji,jj) + zn2 * zmodslp(ji,jj,jk) * ze3w
             zhw(ji,jj) = zhw(ji,jj) + ze3w
          END_3D
       ENDIF
@@ -679,17 +691,69 @@ CONTAINS
       DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
          zfw = MAX( ABS( 2. * omega * SIN( rad * gphit(ji,jj) ) ) , 1.e-10 )
          ! Rossby radius at w-point taken betwenn 2 km and  40km
-         zRo(ji,jj) = MAX(  2.e3 , MIN( .4 * zn(ji,jj) / zfw, 40.e3 )  )
+         zRo(ji,jj) = .4 * zn(ji,jj) / zfw
+         zRo_lim(ji,jj) = MAX(  2.e3 , MIN( zRo(ji,jj), 40.e3 )  )
          ! Compute aeiw by multiplying Ro^2 and T^-1
-         zaeiw(ji,jj) = zRo(ji,jj) * zRo(ji,jj) * SQRT( zah(ji,jj) / zhw(ji,jj) ) * tmask(ji,jj,1)
+         zTclinic_recip(ji,jj) = SQRT( MAX(zah(ji,jj),0._wp) / zhw(ji,jj) ) * tmask(ji,jj,1)
+         zaeiw(ji,jj) = zRo_lim(ji,jj) * zRo_lim(ji,jj) * zTclinic_recip(ji,jj) 
       END_2D
-
+      IF( iom_use('N_2d') ) CALL iom_put('N_2d',zn(:,:)/zhw(:,:))
+      IF( iom_use('modslp') ) CALL iom_put('modslp',SQRT(zmodslp(:,:,:)) )
+      CALL iom_put('RossRad',zRo)
+      CALL iom_put('RossRadlim',zRo_lim)
+      CALL iom_put('Tclinic_recip',zTclinic_recip)
       !                                         !==  Bound on eiv coeff.  ==!
       z1_f20 = 1._wp / (  2._wp * omega * sin( rad * 20._wp )  )
-      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
-         zzaei = MIN( 1._wp, ABS( ff_t(ji,jj) * z1_f20 ) ) * zaeiw(ji,jj)     ! tropical decrease
-         zaeiw(ji,jj) = MIN( zzaei , paei0 )                                  ! Max value = paei0
-      END_2D
+      z2_3 = 2._wp/3._wp
+
+      SELECT CASE(nn_ldfeiv_shape)
+         CASE(0) !! Standard shape applied - decrease in tropics and cap.
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               zzaei = MIN( 1._wp, ABS( ff_t(ji,jj) * z1_f20 ) ) * zaeiw(ji,jj)     ! tropical decrease
+               zaeiw(ji,jj) = MIN( zzaei, paei0 )
+            END_2D
+
+         CASE(1) !! Abrupt cut-off on Rossby radius:
+! JD : modifications here to introduce scaling by local rossby radius of deformation vs local grid scale
+! arbitrary decision that GM is de-activated if local rossy radius larger than 2 times local grid scale
+! based on Hallberg (2013)
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               IF ( zRo(ji,jj) >= ( 2._wp * MIN( e1t(ji,jj), e2t(ji,jj) ) ) ) THEN
+! TODO : use a version of zRo that integrates over a few time steps ?
+                   zaeiw(ji,jj) = 0._wp
+               ELSE
+                   zaeiw(ji,jj) = MIN( zaeiw(ji,jj), paei0 )
+               ENDIF
+            END_2D
+         CASE(2) !! Rossby radius ramp type 1:
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               zratio(ji,jj) = zRo(ji,jj)/MIN(e1t(ji,jj),e2t(ji,jj))
+               zaeiw(ji,jj) = MIN( zaeiw(ji,jj), MAX( 0._wp, MIN( 1._wp, z2_3*(2._wp - zratio(ji,jj)) ) ) * paei0 )
+            END_2D
+            CALL iom_put('RR_GS',zratio)
+         CASE(3) !! Rossby radius ramp type 2:
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               zratio(ji,jj) = MIN(e1t(ji,jj),e2t(ji,jj))/zRo(ji,jj)
+               zaeiw(ji,jj) = MIN( zaeiw(ji,jj), MAX( 0._wp, MIN( 1._wp, z2_3*( zratio(ji,jj) - 0.5_wp ) ) ) * paei0 )
+            END_2D
+         CASE(4) !! bathymetry ramp:
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               zaeiw(ji,jj) = MIN( zaeiw(ji,jj), MAX( 0._wp, MIN( 1._wp, 0.001*(ht_0(ji,jj) - 2000._wp) ) ) * paei0 )
+            END_2D
+         CASE(5) !! Rossby radius ramp type 1 applied to Treguier et al coefficient rather than cap:
+                 !! Note the ramp is RR/GS=[2.0,1.0] (not [2.0,0.5] as for cases 2,3) and we ramp up 
+                 !! to 5% of the Treguier et al coefficient, aiming for peak values of around 100m2/s
+                 !! at high latitudes rather than 2000m2/s which is what you get in eORCA025 with an 
+                 !! uncapped coefficient.
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+               zratio(ji,jj) = zRo(ji,jj)/MIN(e1t(ji,jj),e2t(ji,jj))
+               zaeiw(ji,jj) = MAX( 0._wp, MIN( 1._wp, 2._wp - zratio(ji,jj) ) ) * 0.05 * zaeiw(ji,jj)
+               zaeiw(ji,jj) = MIN( zaeiw(ji,jj), paei0 )
+            END_2D
+            CALL iom_put('RR_GS',zratio)
+         CASE DEFAULT
+               CALL ctl_stop('ldf_eiv: Unrecognised option for nn_ldfeiv_shape.')         
+      END SELECT
       IF( nn_hls == 1 )   CALL lbc_lnk( 'ldftra', zaeiw(:,:), 'W', 1.0_wp )   ! lateral boundary condition
       !
       DO_2D( 0, 0, 0, 0 )
diff --git a/src/OCE/SBC/cpl_oasis3.F90 b/src/OCE/SBC/cpl_oasis3.F90
index 111343f970676e1324dc282eda037b93c202c8de..3295238bb6979f42806a4dd195c1edc09dd1d2d2 100644
--- a/src/OCE/SBC/cpl_oasis3.F90
+++ b/src/OCE/SBC/cpl_oasis3.F90
@@ -30,20 +30,37 @@ MODULE cpl_oasis3
    USE xios                         ! I/O server
 #endif
    USE par_oce                      ! ocean parameters
+
+   USE cpl_rnf_1d, ONLY: nn_cpl_river   ! Variables used in 1D river outflow 
+
    USE dom_oce                      ! ocean space and time domain
    USE in_out_manager               ! I/O manager
    USE lbclnk                       ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp
 
    IMPLICIT NONE
    PRIVATE
+#if ! defined key_oasis3
+   ! Dummy interface to oasis_get if not using oasis
+   ! RSRH Is this really needed
+   INTERFACE oasis_get
+      MODULE PROCEDURE oasis_get_1d, oasis_get_2d
+   END INTERFACE
+#endif 
+
+#if ! defined key_mpi_off
+   INCLUDE 'mpif.h'
+#endif
 
    PUBLIC   cpl_init
    PUBLIC   cpl_define
    PUBLIC   cpl_snd
    PUBLIC   cpl_rcv
+   PUBLIC   cpl_rcv_1d
    PUBLIC   cpl_freq
    PUBLIC   cpl_finalize
 
+   INTEGER, PARAMETER         ::   localRoot  = 0
    INTEGER, PUBLIC            ::   OASIS_Rcv  = 1    !: return code if received field
    INTEGER, PUBLIC            ::   OASIS_idle = 0    !: return code if nothing done by oasis
    INTEGER                    ::   ncomp_id          ! id returned by oasis_init_comp
@@ -67,9 +84,13 @@ MODULE cpl_oasis3
    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 ::   nmaxfld=100  ! 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
+   LOGICAL, PARAMETER         ::   ltmp_wapatch = .FALSE.   ! patch to restore wraparound rows in cpl_send, cpl_rcv, cpl_define 
+   LOGICAL, PARAMETER         ::   ltmp_landproc = .TRUE.   ! patch to restrict coupled area to non halo cells
 
    TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information
       LOGICAL               ::   laction   ! To be coupled or not
@@ -79,11 +100,16 @@ MODULE cpl_oasis3
       INTEGER, DIMENSION(nmaxcat,nmaxcpl) ::   nid   ! Id of the field (no more than 9 categories and 9 extrena models)
       INTEGER               ::   nct       ! Number of categories in field
       INTEGER               ::   ncplmodel ! Maximum number of models to/from which this variable may be sent/received
+      INTEGER               ::   dimensions ! Number of dimensions of coupling field 
    END TYPE FLD_CPL
 
    TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC ::   srcv, ssnd   !: Coupling fields
 
    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld   ! Temporary buffer for receiving
+   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld_ext  ! Temporary buffer for receiving with wrap points
+
+   INTEGER :: ishape_ext(4)  ! shape of 2D arrays passed to PSMILe extended for wrap points in weights data
+   INTEGER :: ishape(4)      ! shape of 2D arrays passed to PSMILe 
 
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -103,6 +129,7 @@ CONTAINS
       !!--------------------------------------------------------------------
       CHARACTER(len = *), INTENT(in   ) ::   cd_modname   ! model name as set in namcouple file
       INTEGER           , INTENT(  out) ::   kl_comm      ! local communicator of the model
+      INTEGER                           ::   error
       !!--------------------------------------------------------------------
 
       ! WARNING: No write in numout in this routine
@@ -123,6 +150,7 @@ CONTAINS
       IF( nerror /= OASIS_Ok ) &
          CALL oasis_abort (ncomp_id, 'cpl_init','Failure in oasis_get_localcomm' )
       !
+
    END SUBROUTINE cpl_init
 
 
@@ -138,13 +166,26 @@ CONTAINS
       INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields
       INTEGER, INTENT(in) ::   kcplmodel      ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
       !
-      INTEGER :: id_part
+      INTEGER :: id_part_0d     ! Partition for 0d fields
+      INTEGER :: id_part_rnf_1d ! Partition for 1d river outflow fields
+      INTEGER :: id_part_2d     ! Partition for 2d fields
+      INTEGER :: id_part_2d_ext ! Partition for 2d fields extended for old (pre vn4.2) style remapping weights!
+      INTEGER :: id_part_temp   ! Temperary partition used to choose either 0d or 1d partitions
       INTEGER :: paral(5)       ! OASIS3 box partition
-      INTEGER :: ishape(4)      ! shape of arrays passed to PSMILe
+
+      INTEGER :: paral_ext(5)       ! OASIS3 box partition extended
+      INTEGER :: ishape0d1d(2)  ! Shape of 0D or 1D arrays passed to PSMILe.
+      INTEGER :: var_nodims(2)  ! Number of coupling field dimensions.
+                                ! var_nodims(1) is redundant from OASIS3-MCT vn4.0 onwards
+                                ! but retained for backward compatibility.
+                                ! var_nodims(2) is the number of fields in a bundle
+                                ! or 1 for unbundled fields (bundles are not yet catered for
+                                ! in NEMO hence we default to 1).        
       INTEGER :: ji,jc,jm       ! local loop indicees
       LOGICAL :: llenddef       ! should we call xios_oasis_enddef and oasis_enddef?
       CHARACTER(LEN=64) :: zclname
       CHARACTER(LEN=2) :: cli2
+      INTEGER :: i_offset       ! Used in calculating offset for extended partition.
       !!--------------------------------------------------------------------
 
       IF(lwp) WRITE(numout,*)
@@ -173,10 +214,13 @@ CONTAINS
       ishape(2) = Ni_0
       ishape(3) = 1
       ishape(4) = Nj_0
-      !
+
+      ishape0d1d(1) = 0
+      ishape0d1d(2) = 0       !
+
       ! ... Allocate memory for data exchange
       !
-      ALLOCATE(exfld(Ni_0, Nj_0), stat = nerror)        ! allocate only inner domain (without halos)
+      ALLOCATE(exfld(Ni_0, Nj_0), stat = nerror)                 ! allocate full domain (without halos)
       IF( nerror > 0 ) THEN
          CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld')   ;   RETURN
       ENDIF
@@ -198,7 +242,96 @@ CONTAINS
          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
+
+      ! We still set up the new vn4.2 style box partition for reference, though it doesn't actually get used,
+      ! we can easily swap back to it if we ever manage to successfully generate vn4.2 compatible weights, or introduce 
+      ! RTL controls to distinguish between onl and new style weights.  
+
+      CALL oasis_def_partition ( id_part_2d, paral, nerror, Ni0glo*Nj0glo )   ! global number of points, excluding halos
+
+      ! RSRH Set up 2D box partition for compatibility with existing weights files
+      ! so we DONT HAVE TO GENERATE AND MANAGE MULTIPLE SETS OF WEIGHTS PURLEY BECAUSE OF AN
+      ! ARBITRARY CHANGE IN THE SOURCE CODE!
+
+      ! This is just a hack for global cyclic models for the time being
+      Ni0glo_ext = jpiglo
+      Nj0glo_ext = Nj0glo +1 ! We can't use jpjglo here because for some reason at 4.2 this is bigger
+                             ! than at 4.0.... e.g. for ORCA1 it is 333 when it should only be 332!
+
+      ! RSRH extended shapes for old style dimensioning. Allows backwards compatibility with existing weights files, 
+      ! which the new code DOES NOT, causing headaches not only for users but also for management of weights files. 
+      ishape_ext(:) = ishape(:)
+      IF (mig(1) == 1 .OR. mig(jpi)==jpiglo) THEN
+         ! Extra columns in PEs dealing with wrap points
+         ishape_ext(2) = ishape_ext(2) + 1
+      ENDIF
+
+      ! Workout any extra offset in the i dimension
+      IF (mig(1) == 1 ) THEN
+         i_offset = mig0(nn_hls)
+      ELSE
+         i_offset = mig(nn_hls)
+      ENDIF
+       
+      ALLOCATE(exfld_ext(ishape_ext(2), ishape_ext(4)), stat = nerror)        ! allocate full domain (with wrap pts)
+      IF( nerror > 0 ) THEN
+         CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld_ext')   ;   RETURN
+      ENDIF
+
+
+      ! Now we have the appropriate dimensions, we can set up the partition array for the old-style extended grid
+      paral_ext(1) = 2                                      ! box partitioning
+      paral_ext(2) = (Ni0glo_ext * mjg0(nn_hls)) + i_offset ! NEMO lower left corner global offset, with wrap pts
+      paral_ext(3) = Ni_0_ext                               ! local extent in i, including halos
+      paral_ext(4) = Nj_0_ext                               ! local extent in j, including halos
+      paral_ext(5) = Ni0glo_ext                             ! global extent in x, including halos
+
+      IF( sn_cfctl%l_oasout ) THEN
+         WRITE(numout,*) ' multiexchg: paral_ext (1:5)', paral_ext, jpiglo, jpjglo, Ni0glo_ext, Nj0glo_ext
+         WRITE(numout,*) ' multiexchg: Ni_0_ext, Nj_0_ext i_offset =', Ni_0_ext, Nj_0_ext, i_offset
+         WRITE(numout,*) ' multiexchg: Nis0_ext, Nie0_ext =', Nis0_ext, Nie0_ext
+         WRITE(numout,*) ' multiexchg: Njs0_ext, Nje0_ext =', Njs0_ext, Nje0_ext
+      ENDIF
+
+      ! Define our extended grid
+      CALL oasis_def_partition ( id_part_2d_ext, paral_ext, nerror, Ni0glo_ext*Nj0glo_ext ) 
+  
+      ! OK so now we should have a usable 2d partition for fields defined WITH redundant points. 
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! A special partition is needed for 0D fields
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     
+      paral(1) = 0                                       ! serial partitioning
+      paral(2) = 0   
+      IF ( mpprank == 0) THEN
+         paral(3) = 1                   ! Size of array to couple (scalar)
+      ELSE
+         paral(3) = 0                   ! Dummy size for PE's not involved
+      END IF
+      paral(4) = 0
+      paral(5) = 0
+             
+      CALL oasis_def_partition ( id_part_0d, paral, nerror, 1 )
+
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! Another special partition is needed for 1D river routing fields
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     
+      paral(1) = 0                                       ! serial partitioning
+      paral(2) = 0   
+      IF ( mpprank == 0) THEN
+         paral(3) = nn_cpl_river                   ! Size of array to couple (vector)
+      ELSE
+         paral(3) = 0                   ! Dummy size for PE's not involved
+      END IF
+      paral(4) = 0
+      paral(5) = 0
+
+
+      CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, nn_cpl_river )
+
       !
       ! ... Announce send variables.
       !
@@ -232,14 +365,24 @@ CONTAINS
                   ENDIF
 #endif
                   IF( sn_cfctl%l_oasout ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out
-                  CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   &
-                     &                OASIS_Out          , ishape , OASIS_REAL, nerror )
+
+                  flush(numout)
+
+
+                  IF( sn_cfctl%l_oasout ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out
+                     CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part_2d_ext   , (/ 2, 1 /),   &
+                     &                OASIS_Out           , ishape_ext , OASIS_REAL, nerror )
+
                   IF( nerror /= OASIS_Ok ) THEN
                      WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname)
                      CALL oasis_abort ( ssnd(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' )
                   ENDIF
-                  IF( sn_cfctl%l_oasout .AND. ssnd(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
-                  IF( sn_cfctl%l_oasout .AND. ssnd(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
+                  IF( sn_cfctl%l_oasout .AND. ssnd(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "put variable defined in the namcouple"
+                  IF( sn_cfctl%l_oasout .AND. ssnd(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "put variable NOT defined in the namcouple"
+
+
+
+
                END DO
             END DO
          ENDIF
@@ -276,15 +419,57 @@ CONTAINS
                      zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
                   ENDIF
 #endif
+
                   IF( sn_cfctl%l_oasout ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
-                  CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   &
-                     &                OASIS_In           , ishape , OASIS_REAL, nerror )
+
+                  flush(numout)
+
+                  ! Define 0D (Greenland or Antarctic ice mass) or 1D (river outflow) coupling fields
+                  IF (srcv(ji)%dimensions <= 1) THEN
+                     var_nodims(1) = 1
+                     var_nodims(2) = 1 ! Modify this value to cater for bundled fields.
+                     IF (mpprank == 0) THEN
+	
+                       IF (srcv(ji)%dimensions == 0) THEN
+
+                          ! If 0D then set temporary variables to 0D components
+                          id_part_temp = id_part_0d
+                          ishape0d1d(2) = 1
+                       ELSE
+
+                          ! If 1D then set temporary variables to river outflow components
+                          id_part_temp = id_part_rnf_1d
+                          ishape0d1d(2)= nn_cpl_river
+
+                       END IF
+
+                       CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_temp   , var_nodims,   &
+                                        OASIS_In           , ishape0d1d(1:2) , OASIS_REAL, nerror )
+                    ELSE
+                       ! Dummy call to keep OASIS3-MCT happy.
+                       CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_0d   , var_nodims,   &
+                                        OASIS_In           , ishape0d1d(1:2) , OASIS_REAL, nerror )
+                    END IF
+                  ELSE
+                    ! It's a "normal" 2D (or pseudo 3D) coupling field.
+                    ! ... Set the field dimension and bundle count
+                    var_nodims(1) = 2
+                    var_nodims(2) = 1 ! Modify this value to cater for bundled fields.
+
+                    CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_2d_ext   , var_nodims,   &
+                                        OASIS_In           , ishape_ext , OASIS_REAL, nerror )
+
+                  ENDIF 
+
+
+
                   IF( nerror /= OASIS_Ok ) THEN
                      WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname)
                      CALL oasis_abort ( srcv(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' )
                   ENDIF
-                  IF( sn_cfctl%l_oasout .AND. srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
-                  IF( sn_cfctl%l_oasout .AND. srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
+                  IF( sn_cfctl%l_oasout .AND. srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "get variable defined in the namcouple"
+                  IF( sn_cfctl%l_oasout .AND. srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "get variable NOT defined in the namcouple"
+
 
                END DO
             END DO
@@ -330,13 +515,17 @@ CONTAINS
       INTEGER                                   ::   jc,jm     ! local loop index
       !!--------------------------------------------------------------------
       !
+
       ! snd data to OASIS3
       !
       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 )
+
+               ! The field is "put" directly, using appropriate start/end indexing - i.e. we don't
+               ! copy it to an intermediate buffer. 
+               CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc), kinfo )
 
                IF ( sn_cfctl%l_oasout ) THEN
                   IF ( kinfo == OASIS_Sent     .OR. kinfo == OASIS_ToRest .OR.   &
@@ -346,10 +535,11 @@ CONTAINS
                      WRITE(numout,*) 'oasis_put: ivarid ', ssnd(kid)%nid(jc,jm)
                      WRITE(numout,*) 'oasis_put:  kstep ', kstep
                      WRITE(numout,*) 'oasis_put:   info ', kinfo
-                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(Nis0:Nie0,Njs0:Nje0,jc))
-                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(Nis0:Nie0,Njs0:Nje0,jc))
-                     WRITE(numout,*) '     -     Sum value is ',    SUM(pdata(Nis0:Nie0,Njs0:Nje0,jc))
+                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
+                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
+                     WRITE(numout,*) '     -     Sum value is ',    SUM(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
                      WRITE(numout,*) '****************'
+                     CALL FLUSH(numout)
                   ENDIF
                ENDIF
 
@@ -357,6 +547,7 @@ CONTAINS
 
          ENDDO
       ENDDO
+
       !
     END SUBROUTINE cpl_snd
 
@@ -376,12 +567,14 @@ CONTAINS
       !!
       INTEGER                                   ::   jc,jm     ! local loop index
       LOGICAL                                   ::   llaction, ll_1st
+
       !!--------------------------------------------------------------------
       !
       ! receive local data from OASIS3 on every process
       !
       kinfo = OASIS_idle
       !
+
       DO jc = 1, srcv(kid)%nct
          ll_1st = .TRUE.
 
@@ -389,7 +582,7 @@ CONTAINS
 
             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_ext, kinfo )
 
                llaction =  kinfo == OASIS_Recvd   .OR. kinfo == OASIS_FromRest .OR.   &
                   &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut
@@ -398,14 +591,17 @@ CONTAINS
                   &  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
+                                     ! RSRH, but DO cater for wrap columns when using pre vn 4.2 format remapping weights. 
 
                   kinfo = OASIS_Rcv
                   IF( ll_1st ) THEN
-                     pdata(Nis0:Nie0,Njs0:Nje0,jc) =   exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
+                     pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc) =   exfld_ext(:,:) * pmask(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jm)
+
                      ll_1st = .FALSE.
                   ELSE
-                     pdata(Nis0:Nie0,Njs0:Nje0,jc) = pdata(Nis0:Nie0,Njs0:Nje0,jc)   &
-                        &                                + exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
+
+                     pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc) = pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc)   &
+                        &                                + exfld_ext(:,:) * pmask(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jm)
                   ENDIF
 
                   IF ( sn_cfctl%l_oasout ) THEN
@@ -414,10 +610,11 @@ CONTAINS
                      WRITE(numout,*) 'oasis_get: ivarid '  , srcv(kid)%nid(jc,jm)
                      WRITE(numout,*) 'oasis_get:   kstep', kstep
                      WRITE(numout,*) 'oasis_get:   info ', kinfo
-                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(Nis0:Nie0,Njs0:Nje0,jc))
-                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(Nis0:Nie0,Njs0:Nje0,jc))
-                     WRITE(numout,*) '     -     Sum value is ',    SUM(pdata(Nis0:Nie0,Njs0:Nje0,jc))
+                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
+                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
+                     WRITE(numout,*) '     -     Sum value is ',    SUM(pdata(Nis0_ext:Nie0_ext,Njs0_ext:Nje0_ext,jc))
                      WRITE(numout,*) '****************'
+                     CALL FLUSH(numout)
                   ENDIF
 
                ENDIF
@@ -426,15 +623,127 @@ CONTAINS
 
          ENDDO
 
-         !--- we must call lbc_lnk to fill the halos that where not received.
+         !--- Call lbc_lnk to populate halos of received fields.
          IF( .NOT. ll_1st ) THEN
+
             CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )
+
          ENDIF
 
       ENDDO
       !
    END SUBROUTINE cpl_rcv
 
+  SUBROUTINE cpl_rcv_1d( kid, kstep, pdata, nitems, kinfo )
+      !!---------------------------------------------------------------------
+      !!              ***  ROUTINE cpl_rcv_1d  ***
+      !!
+      !! ** Purpose : - A special version of cpl_rcv to deal exclusively with
+      !! receipt of 0D or 1D fields.
+      !! The fields are recieved into a 1D array buffer which is simply a
+      !! dynamically sized sized array (which may be of size 1)
+      !! of 0 dimensional fields. This allows us to pass miltiple 0D
+      !! fields via a single put/get operation. 
+      !!----------------------------------------------------------------------
+      INTEGER , INTENT(in   ) ::   nitems      ! Number of 0D items to recieve
+                                               ! during this get operation. i.e.
+                                               ! The size of the 1D array in which
+                                               ! 0D items are passed.   
+      INTEGER , INTENT(in   ) ::   kid         ! ID index of the incoming
+                                               ! data. 
+      INTEGER , INTENT(in   ) ::   kstep       ! ocean time-step in seconds
+      REAL(wp), INTENT(inout) ::   pdata(1:nitems) ! The original value(s), 
+                                                   ! unchanged if nothing is
+                                                   ! received
+      INTEGER , INTENT(  out) ::   kinfo       ! OASIS3 info argument
+      !!
+      REAL(wp) ::   recvfld(1:nitems)          ! Local receive field buffer
+      INTEGER  ::   jc,jm     ! local loop index
+      INTEGER  ::   ierr
+      LOGICAL  ::   llaction
+      INTEGER  ::   MPI_WORKING_PRECISION
+      INTEGER  ::   number_to_print
+      !!--------------------------------------------------------------------
+      !
+      ! receive local data from OASIS3 on every process
+      !
+      kinfo = OASIS_idle
+      !
+      ! 0D and 1D fields won't have categories or any other form of "pseudo level"
+      ! so we only cater for a single set of values and thus don't bother
+      ! with a loop over the jc index
+      jc = 1
+
+      DO jm = 1, srcv(kid)%ncplmodel
+
+         IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN
+
+            IF ( ( srcv(kid)%dimensions <= 1) .AND. (mpprank == 0) ) THEN
+                ! Since there is no concept of data decomposition for zero
+                ! dimension fields, they must only be exchanged through the master PE,
+                ! unlike "normal" 2D field cases where every PE is involved.
+ 
+                CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, recvfld, 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
+	                 
+                   kinfo = OASIS_Rcv
+	           pdata(1:nitems) = recvfld(1:nitems)
+            
+                   IF( sn_cfctl%l_oasout ) THEN     
+	                     number_to_print = 10
+	                     IF ( nitems < number_to_print ) number_to_print = nitems
+	                     WRITE(numout,*) '****************'
+	                     WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname
+	                     WRITE(numout,*) 'oasis_get: ivarid '  , srcv(kid)%nid(jc,jm)
+	                     WRITE(numout,*) 'oasis_get:   kstep', kstep
+	                     WRITE(numout,*) 'oasis_get:   info ', kinfo
+	                     WRITE(numout,*) '     - Minimum Value is ', MINVAL(pdata(:))
+	                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:))
+	                     WRITE(numout,*) '     - Start of data is ', pdata(1:number_to_print)
+	                     WRITE(numout,*) '****************'
+                             CALL FLUSH(numout)
+                  ENDIF
+	                 
+               ENDIF
+            ENDIF   
+          ENDIF
+	           
+       ENDDO
+
+#if defined key_mpi_off
+
+       CALL oasis_abort( ncomp_id, "cpl_rcv_1d", "Unable to use mpi_bcast with key_mpi_off in your list of NEMO keys." )
+
+#else
+       ! Set the precision that we want to broadcast using MPI_BCAST
+       SELECT CASE( wp )
+       CASE( sp )
+         MPI_WORKING_PRECISION = MPI_REAL                ! Single precision
+       CASE( dp )
+         MPI_WORKING_PRECISION = MPI_DOUBLE_PRECISION    ! Double precision
+       CASE default
+         CALL oasis_abort( ncomp_id, "cpl_rcv_1d", "Could not find precision for coupling 0d or 1d field" )
+       END SELECT
+
+       ! We have to broadcast (potentially) received values from PE 0 to all
+       ! the others. If no new data has been received we're just
+       ! broadcasting the existing values but there's no more efficient way
+       ! to deal with that w/o NEMO adopting a UM-style test mechanism
+       ! to determine active put/get timesteps.
+       CALL mpi_bcast( pdata, nitems, MPI_WORKING_PRECISION, localRoot, mpi_comm_oce, ierr )
+
+#endif
+	
+        !
+END SUBROUTINE cpl_rcv_1d
+
 
    INTEGER FUNCTION cpl_freq( cdfieldname )
       !!---------------------------------------------------------------------
@@ -500,6 +809,7 @@ CONTAINS
       !!----------------------------------------------------------------------
       !
       DEALLOCATE( exfld )
+      DEALLOCATE( exfld_ext )
       IF(nstop == 0) THEN
          CALL oasis_terminate( nerror )
       ELSE
@@ -543,7 +853,7 @@ CONTAINS
 
    SUBROUTINE oasis_def_var(k1,cd1,k2,k3,k4,k5,k6,k7)
       CHARACTER(*), INTENT(in   ) ::  cd1
-      INTEGER     , INTENT(in   ) ::  k2,k3(2),k4,k5(2,2),k6
+      INTEGER     , INTENT(in   ) ::  k2,k3(2),k4,k5(*),k6
       INTEGER     , INTENT(  out) ::  k1,k7
       k1 = -1 ; k7 = -1
       WRITE(numout,*) 'oasis_def_var: Error you sould not be there...', cd1
@@ -563,13 +873,21 @@ CONTAINS
       WRITE(numout,*) 'oasis_put: Error you sould not be there...'
    END SUBROUTINE oasis_put
 
-   SUBROUTINE oasis_get(k1,k2,p1,k3)
+   SUBROUTINE oasis_get_2d(k1,k2,p1,k3)
       REAL(wp), DIMENSION(:,:), INTENT(  out) ::  p1
       INTEGER                 , INTENT(in   ) ::  k1,k2
       INTEGER                 , INTENT(  out) ::  k3
       p1(1,1) = -1. ; k3 = -1
-      WRITE(numout,*) 'oasis_get: Error you sould not be there...'
-   END SUBROUTINE oasis_get
+      WRITE(numout,*) 'oasis_get_2d: Error you sould not be there...'
+   END SUBROUTINE oasis_get_2d
+
+   SUBROUTINE oasis_get_1d(k1,k2,p1,k3)
+      REAL(wp), DIMENSION(:)  , INTENT(  out) ::  p1
+      INTEGER                 , INTENT(in   ) ::  k1,k2
+      INTEGER                 , INTENT(  out) ::  k3
+      p1(1) = -1. ; k3 = -1
+      WRITE(numout,*) 'oasis_get_1d: Error you sould not be there...'
+   END SUBROUTINE oasis_get_1d
 
    SUBROUTINE oasis_get_freqs(k1,k5,k2,k3,k4)
       INTEGER              , INTENT(in   ) ::  k1,k2
diff --git a/src/OCE/SBC/cpl_rnf_1d.F90 b/src/OCE/SBC/cpl_rnf_1d.F90
new file mode 100644
index 0000000000000000000000000000000000000000..cbcd101cb9ee2395673a6c6a51b494fafd40421d
--- /dev/null
+++ b/src/OCE/SBC/cpl_rnf_1d.F90
@@ -0,0 +1,210 @@
+MODULE cpl_rnf_1d
+   !!======================================================================
+   !!                       ***  MODULE  cpl_rnf_1d  ***
+   !! Ocean forcing:  River runoff passed from the atmosphere using
+   !!                 1D array. One value per river.
+   !!=====================================================================
+   !! History : ?.?  ! 2018-01 (D. Copsey) Initial setup
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   cpl_rnf_1d_init : runoffs initialisation
+   !!---------------------------------------------------------------------- 
+
+#if defined key_oasis3
+   USE mod_oasis                    ! OASIS3-MCT module
+#endif
+   USE timing          ! Timing
+   USE in_out_manager  ! I/O units
+   USE lib_mpp         ! MPP library
+   USE iom
+   USE dom_oce         ! Domain sizes (for grid box area e1e2t)
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE lib_fortran,    ONLY: DDPDD
+   
+   IMPLICIT NONE
+   PRIVATE
+   
+   PUBLIC   cpl_rnf_1d_init     ! routine called in nemo_init
+   PUBLIC   cpl_rnf_1d_to_2d      ! routine called in sbccpl.F90
+   
+   TYPE, PUBLIC ::   RIVERS_DATA     !: Storage for river outflow data
+      INTEGER, ALLOCATABLE, DIMENSION(:,:)    ::   river_number       !: River outflow number
+      REAL(wp), ALLOCATABLE, DIMENSION(:)     ::   river_area         ! 1D array listing areas of each river outflow (m2)
+      COMPLEX(wp), ALLOCATABLE, DIMENSION(:)  ::   river_area_c       ! Comlex version of river_area for use in bit reproducible sums (m2)
+   END TYPE RIVERS_DATA
+   
+   TYPE(RIVERS_DATA), PUBLIC, TARGET :: rivers  !: River data
+   
+   INTEGER, PUBLIC            :: nn_cpl_river   ! Maximum number of rivers being passed through the coupler
+   INTEGER, PUBLIC            :: runoff_id      ! OASIS coupling id used in oasis_get command
+   LOGICAL                    :: ln_print_river_info  ! Diagnostic prints of river coupling information
+   
+CONTAINS
+
+   SUBROUTINE cpl_rnf_1d_init
+      !!----------------------------------------------------------------------
+      !!                    ***  SUBROUTINE cpl_rnf_1d_init  ***
+      !!                     
+      !! ** Purpose : - Read in file for river outflow numbers.
+      !!                Calculate 2D area of river outflow points.
+      !!                Called from nemo_init (nemogcm.F90).
+      !!
+      !!----------------------------------------------------------------------
+      !! namelist variables
+      !!-------------------
+      CHARACTER(len=200)                        ::   file_riv_number             !: Filename for river numbers
+      INTEGER                                   ::   ios                 ! Local integer output status for namelist read
+      INTEGER                                   ::   inum
+      INTEGER                                   ::   ii, jj, rr          !: Loop indices
+      INTEGER                                   ::   max_river
+      REAL(wp), DIMENSION(jpi,jpj)              ::   river_number        ! 2D array containing the river outflow numbers
+      
+      NAMELIST/nam_cpl_rnf_1d/file_riv_number, nn_cpl_river, ln_print_river_info
+      !!----------------------------------------------------------------------
+
+      IF( ln_timing ) CALL timing_start('cpl_rnf_1d_init')
+      
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'cpl_rnf_1d_init : initialization of river runoff coupling'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF(lwp) CALL flush(numout)
+      
+!!      REWIND(numnam_cfg)
+      
+      ! Read the namelist
+      READ  ( numnam_ref, nam_cpl_rnf_1d, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_cpl_rnf_1d in reference namelist' )
+      READ  ( numnam_cfg, nam_cpl_rnf_1d, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_cpl_rnf_1d in configuration namelist' )
+      IF(lwm) WRITE ( numond, nam_cpl_rnf_1d )
+
+      !                                               ! Parameter control and print
+      IF(lwp) WRITE(numout,*) '  '
+      IF(lwp) WRITE(numout,*) '          Namelist nam_cpl_rnf_1d : Coupled runoff using 1D array'
+      IF(lwp) WRITE(numout,*) '             Input file that contains river numbers = ',file_riv_number
+      IF(lwp) WRITE(numout,*) '             Maximum number of rivers to couple = ',nn_cpl_river
+      IF(lwp) WRITE(numout,*) '             Print river information = ',ln_print_river_info
+      IF(lwp) WRITE(numout,*) ' '
+      IF(lwp) CALL flush(numout)
+
+      ! Assign space for river numbers
+      ALLOCATE( rivers%river_number( jpi, jpj ) )
+      
+      ! Read the river numbers from netcdf file
+      CALL iom_open (file_riv_number , inum )
+      CALL iom_get  ( inum, jpdom_global, 'river_number', river_number, cd_type = 'T', psgn = 1._wp)
+      CALL iom_close( inum )
+      
+      ! Convert from a real array to an integer array
+      max_river=0
+      DO ii = 1, jpi
+        DO jj = 1, jpj
+          rivers%river_number(ii,jj) = INT(river_number(ii,jj))
+          IF ( rivers%river_number(ii,jj) > max_river ) THEN
+            max_river = rivers%river_number(ii,jj)
+          END IF
+        END DO
+      END DO
+      
+      ! Print out the largest river number
+      IF ( ln_print_river_info .AND. lwp) THEN
+         WRITE(numout,*) 'Maximum river number in input file = ',max_river
+         CALL flush(numout)
+      END IF
+      
+      ! Get the area of each river outflow
+      ALLOCATE( rivers%river_area( nn_cpl_river ) )
+      ALLOCATE( rivers%river_area_c( nn_cpl_river ) )
+      rivers%river_area_c(:) = CMPLX( 0.e0, 0.e0, wp )
+      DO ii = Nis0, Nie0     
+        DO jj = Njs0, Nje0
+          IF ( tmask_i(ii,jj) > 0.5 ) THEN  ! This makes sure we are not at a duplicated point (at north fold or east-west cyclic point)
+            IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= nn_cpl_river ) THEN
+              ! Add the area of each grid box (e1e2t) into river_area_c using DDPDD which should maintain bit reproducibility (needs to be checked)
+              CALL DDPDD( CMPLX( e1e2t(ii,jj), 0.e0, wp ), rivers%river_area_c(rivers%river_number(ii,jj) ) )
+            END IF
+          END IF
+        END DO
+      END DO
+      
+      ! Use mpp_sum to add together river areas on other processors
+      CALL mpp_sum( 'cpl_rnf_1d', rivers%river_area_c )
+      
+      ! Convert from complex number to real
+      rivers%river_area(:) = REAL(rivers%river_area_c(:),wp)
+      
+      IF ( ln_print_river_info .AND. lwp) THEN
+        WRITE(numout,*) 'Area of rivers 1 to 10 are ',rivers%river_area(1:10)
+        WRITE(numout,*) 'Maximum river area = ',MAXVAL(rivers%river_area)
+        WRITE(numout,*) 'Minimum river area = ',MINVAL(rivers%river_area)
+        WRITE(numout,*) 'Sum of river areas = ',SUM(rivers%river_area)
+        CALL flush(numout)
+      END IF
+
+      IF ( MINVAL(rivers%river_area) <= 0 ) THEN
+         WRITE(numout,*) 'ERROR: There is at least one river with a river outflow area of zero. Please check your file_riv_number file'
+         WRITE(numout,*) 'that all the allocated river numbers are at ocean points as defined by the bathymetry file with no river'
+         WRITE(numout,*) 'numbers within the north fold or wraparound points.'
+         DO rr = 1,nn_cpl_river
+           IF ( rivers%river_area(rr) <= 0 ) THEN
+             WRITE(numout,*) 'The first river with this problem is river number ',rr
+             CALL ctl_stop ( 'STOP', 'ERROR: There is at least one river with a river outflow area of zero. See stdout.')
+           END IF
+         END DO
+      END IF
+      
+   END SUBROUTINE cpl_rnf_1d_init
+   
+   SUBROUTINE cpl_rnf_1d_to_2d( runoff_1d )
+   
+      !!----------------------------------------------------------------------
+      !!                    ***  SUBROUTINE cpl_rnf_1d_to_2d  ***
+      !!                     
+      !! ** Purpose : - Convert river outflow from 1D array (passed from the
+      !!                atmosphere) to the 2D NEMO runoff field.
+      !!                Called from sbc_cpl_ice_flx (sbccpl.F90).
+      !!
+      !!----------------------------------------------------------------------
+      
+      REAL                   , INTENT(in   ) ::   runoff_1d(nn_cpl_river)    ! River runoff. One value per river.
+      
+      INTEGER  ::   ii, jj, rr                 ! Loop indices
+      LOGICAL  ::   found_nan
+            
+      ! Convert the 1D total runoff per river to 2D runoff flux by
+      ! dividing by the area of each runoff zone.
+      DO ii = 1, jpi
+        DO jj = 1, jpj
+          IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= nn_cpl_river .AND. tmask_i(ii,jj) > 0.5 ) THEN
+            rnf(ii,jj) = runoff_1d(rivers%river_number(ii,jj)) / rivers%river_area(rivers%river_number(ii,jj))
+          ELSE
+            rnf(ii,jj) = 0.0
+          END IF
+            
+        END DO
+      END DO
+
+      IF ( ln_print_river_info ) THEN
+        WRITE(numout,*) 'SUM of river runoff on 1D array = ',SUM(runoff_1d)
+        WRITE(numout,*) 'SUM of river runoff on 2D array = ',SUM(rnf)
+        found_nan = .false.
+        DO rr = 1, nn_cpl_river
+          IF (rr <= 10) THEN
+            WRITE(numout,*) 'River number ',rr,' has total runoff=',runoff_1d(rr),' and area=',rivers%river_area(rr),' making runoff flux=',runoff_1d(rr)/rivers%river_area(rr)
+          END IF
+
+          IF (runoff_1d(rr) /= runoff_1d(rr)) THEN
+            IF (.NOT. found_nan) THEN
+              WRITE(numout,*) 'WARNING: NAN found at river number ',rr
+              found_nan = .true.
+            END IF
+          END IF
+
+        END DO
+      END IF     
+
+
+   END SUBROUTINE cpl_rnf_1d_to_2d
+
+END MODULE cpl_rnf_1d
diff --git a/src/OCE/SBC/geo2ocean.F90 b/src/OCE/SBC/geo2ocean.F90
index 182e5e03073cc458a418e34b745b0fef8f355368..8efafce70139e5df3e208404a4a0930a5f98b18c 100644
--- a/src/OCE/SBC/geo2ocean.F90
+++ b/src/OCE/SBC/geo2ocean.F90
@@ -25,6 +25,7 @@ MODULE geo2ocean
    IMPLICIT NONE
    PRIVATE
 
+   PUBLIC   repcmo    ! called in sbccpl
    PUBLIC   rot_rep   ! called in sbccpl, fldread, and cyclone
    PUBLIC   geo2oce   ! called in sbccpl
    PUBLIC   oce2geo   ! called in sbccpl
@@ -50,6 +51,48 @@ MODULE geo2ocean
    !!----------------------------------------------------------------------
 CONTAINS
 
+
+   SUBROUTINE repcmo ( pxu1, pyu1, pxv1, pyv1,   &
+                       px2 , py2 , kchoix  )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE repcmo  ***
+      !!
+      !! ** Purpose :   Change vector componantes from a geographic grid to a
+      !!      stretched coordinates grid.
+      !!
+      !! ** Method  :   Initialization of arrays at the first call.
+      !!
+      !! ** Action  : - px2 : first  componante (defined at u point)
+      !!              - py2 : second componante (defined at v point)
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pxu1, pyu1   ! geographic vector componantes at u-point
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pxv1, pyv1   ! geographic vector componantes at v-point
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   px2          ! i-componante (defined at u-point)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   py2          ! j-componante (defined at v-point)
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( IN ) ::   &
+         kchoix   ! type of transformation
+                  ! = 1 change from geographic to model grid.
+                  ! =-1 change from model to geographic grid
+      !!----------------------------------------------------------------------
+ 
+      SELECT CASE (kchoix)
+      CASE ( 1)
+        ! Change from geographic to stretched coordinate
+        ! ----------------------------------------------
+     
+        CALL rot_rep( pxu1, pyu1, 'U', 'en->i',px2 )
+        CALL rot_rep( pxv1, pyv1, 'V', 'en->j',py2 )
+      CASE (-1)
+        ! Change from stretched to geographic coordinate
+        ! ----------------------------------------------
+     
+        CALL rot_rep( pxu1, pyu1, 'U', 'ij->e',px2 )
+        CALL rot_rep( pxv1, pyv1, 'V', 'ij->n',py2 )
+      END SELECT
+     
+   END SUBROUTINE repcmo	
+
    SUBROUTINE rot_rep ( pxin, pyin, cd_type, cdtodo, prot )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE rot_rep  ***
diff --git a/src/OCE/SBC/sbc_ice.F90 b/src/OCE/SBC/sbc_ice.F90
index acc6adf1fd10939f9a8e0b742f951b1330fbe844..bdfe72a3dedb5c84cfe1d73141c32f2fbb386f8b 100644
--- a/src/OCE/SBC/sbc_ice.F90
+++ b/src/OCE/SBC/sbc_ice.F90
@@ -94,6 +94,7 @@ MODULE sbc_ice
    ! already defined in ice.F90 for SI3
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  h_i, h_s
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i_last_couple   !: Sea ice fraction on categories at the last coupling point
 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tatm_ice       !: air temperature [K]
 #endif
diff --git a/src/OCE/SBC/sbc_oce.F90 b/src/OCE/SBC/sbc_oce.F90
index 17aefe7e1e0717af98655a98952d80b683ef3d61..d51ceed10e71f641411c6fccb673cd3d37f2f5b8 100644
--- a/src/OCE/SBC/sbc_oce.F90
+++ b/src/OCE/SBC/sbc_oce.F90
@@ -131,6 +131,8 @@ MODULE sbc_oce
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   atm_co2           !: atmospheric pCO2                             [ppm]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask          !: coupling mask for ln_mixcpl (warning: allocated in sbccpl)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   cloud_fra         !: cloud cover (fraction of cloud in a gridcell) [-]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   greenland_icesheet_mask
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   antarctica_icesheet_mask 
 
    !!---------------------------------------------------------------------
    !! ABL Vertical Domain size
@@ -153,6 +155,33 @@ MODULE sbc_oce
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   e3t_m     !: mean (nn_fsbc time-step) sea surface layer thickness       [m]
    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 scalars of total ice sheet mass for Greenland and Antarctica,
+   !! passed from atmosphere to be converted to dvol and hence a freshwater
+   !! flux  by using old values. New values are saved in the dump, to become
+   !! old values next coupling timestep. Freshwater fluxes split between
+   !! sub iceshelf melting and iceberg calving, scalled to flux per second
+   !!----------------------------------------------------------------------
+   
+   REAL(wp), PUBLIC  :: greenland_icesheet_mass, greenland_icesheet_mass_rate_of_change, greenland_icesheet_timelapsed
+   REAL(wp), PUBLIC  :: antarctica_icesheet_mass, antarctica_icesheet_mass_rate_of_change, antarctica_icesheet_timelapsed
+
+   ! sbccpl namelist parameters associated with icesheet freshwater input code. Included here rather than in sbccpl.F90 to
+   ! avoid circular dependencies.
+   INTEGER, PUBLIC     ::   nn_coupled_iceshelf_fluxes     ! =0 : total freshwater input from iceberg calving and ice shelf basal melting
+                                                           ! taken from climatologies used (no action in coupling routines).
+                                                           ! =1 :  use rate of change of mass of Greenland and Antarctic icesheets to set the
+                                                           ! combined magnitude of the iceberg calving and iceshelf melting freshwater fluxes.
+                                                           ! =2 :  specify constant freshwater inputs in this namelist to set the combined
+                                                           ! magnitude of iceberg calving and iceshelf melting freshwater fluxes.
+   LOGICAL, PUBLIC     ::   ln_iceshelf_init_atmos         ! If true force ocean to initialise iceshelf masses from atmospheric values rather
+                                                           ! than values in ocean restart (applicable if nn_coupled_iceshelf_fluxes=1).
+   REAL(wp), PUBLIC    ::   rn_greenland_total_fw_flux    ! Constant total rate of freshwater input (kg/s) for Greenland (if nn_coupled_iceshelf_fluxes=2)
+   REAL(wp), PUBLIC    ::   rn_greenland_calving_fraction  ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
+   REAL(wp), PUBLIC    ::   rn_antarctica_total_fw_flux   ! Constant total rate of freshwater input (kg/s) for Antarctica (if nn_coupled_iceshelf_fluxes=2)
+   REAL(wp), PUBLIC    ::   rn_antarctica_calving_fraction ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
+   REAL(wp), PUBLIC    ::   rn_iceshelf_fluxes_tolerance   ! Absolute tolerance for detecting differences in icesheet masses.
+	
    !!----------------------------------------------------------------------
    !!                     Surface atmospheric fields
    !!----------------------------------------------------------------------
@@ -193,6 +222,9 @@ CONTAINS
          &      atm_co2(jpi,jpj) , tsk_m(jpi,jpj) , cloud_fra(jpi,jpj),   &
          &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) ,      &
          &      ssv_m  (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) )
+
+      ALLOCATE( greenland_icesheet_mask(jpi,jpj) , antarctica_icesheet_mask(jpi,jpj) ) 
+
       !
       ALLOCATE( e3t_m(jpi,jpj) , STAT=ierr(5) )
       !
diff --git a/src/OCE/SBC/sbcblk.F90 b/src/OCE/SBC/sbcblk.F90
index 035a25146745544a7d6f187bbb649bfb5ce7176e..3f0b413bc8d9e30e1d86d095d0f675c67ae8a8a9 100644
--- a/src/OCE/SBC/sbcblk.F90
+++ b/src/OCE/SBC/sbcblk.F90
@@ -119,6 +119,7 @@ MODULE sbcblk
    !
    REAL(dp)         ::   rn_pfac   ! multiplication factor for precipitation
    REAL(wp), PUBLIC ::   rn_efac   ! multiplication factor for evaporation
+   REAL(wp)         ::   rn_vfac   ! multiplication factor for ice/ocean velocity in the calculation of wind stress                        !
    REAL(wp)         ::   rn_zqt    ! z(q,t) : height of humidity and temperature measurements
    REAL(wp)         ::   rn_zu     ! z(u)   : height of wind measurements
    !
@@ -220,7 +221,7 @@ CONTAINS
       INTEGER     ::   ipka                                    ! number of levels in the atmospheric variable
       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,                                          &
+         &                 rn_pfac, rn_efac, rn_vfac,                                 &
          &                 ln_crt_fbk, rn_stau_a, rn_stau_b,                          &   ! current feedback
          &                 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,                  &
@@ -414,6 +415,7 @@ CONTAINS
          WRITE(numout,*) '      Wind vector reference height (m)                    rn_zu        = ', rn_zu
          WRITE(numout,*) '      factor applied on precipitation (total & snow)      rn_pfac      = ', rn_pfac
          WRITE(numout,*) '      factor applied on evaporation                       rn_efac      = ', rn_efac
+         WRITE(numout,*) '      factor applied on ocean/ice velocity                rn_vfac      = ', rn_vfac
          WRITE(numout,*) '         (form absolute (=0) to relative winds(=1))'
          WRITE(numout,*) '      use surface current feedback on wind stress         ln_crt_fbk   = ', ln_crt_fbk
          IF(ln_crt_fbk) THEN
@@ -655,9 +657,7 @@ CONTAINS
       INTEGER  ::   ji, jj               ! dummy loop indices
       REAL(wp) ::   zztmp                ! local variable
       REAL(wp) ::   zstmax, zstau
-#if defined key_cyclone
       REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point
-#endif
       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) ::   zcd_oce           ! momentum transfert coefficient over ocean
@@ -683,9 +683,10 @@ CONTAINS
       ! ----------------------------------------------------------------------------- !
 
       ! ... components ( U10m - U_oce ) at T-point (unmasked)
-#if defined key_cyclone
+
       zwnd_i(:,:) = 0._wp
       zwnd_j(:,:) = 0._wp
+#if defined key_cyclone
       CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012)
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
          zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj)
@@ -696,8 +697,14 @@ CONTAINS
 #else
       ! ... scalar wind module at T-point (not masked)
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         wndm(ji,jj) = SQRT(  pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj)  )
+         zwnd_i(ji,jj) = (  pwndi(ji,jj) - rn_vfac * 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  )
+         zwnd_j(ji,jj) = (  pwndj(ji,jj) - rn_vfac * 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  )
       END_2D
+      
+      CALL lbc_lnk( 'sbcblk', zwnd_i, 'T', -1., zwnd_j, 'T', -1. )
+      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
+      wndm(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   &
+         &             + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1)
 #endif
       ! ----------------------------------------------------------------------------- !
       !      I   Solar FLUX                                                           !
@@ -827,8 +834,13 @@ CONTAINS
                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)
+               IF ( rn_vfac > 0._wp ) THEN
+                   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
 #endif
             ELSE
                ztau_i(ji,jj) = 0._wp
@@ -1017,7 +1029,8 @@ CONTAINS
       !
       INTEGER  ::   ji, jj    ! dummy loop indices
       REAL(wp) ::   zootm_su                      ! sea-ice surface mean temperature
-      REAL(wp) ::   zztmp1, zztmp2                ! temporary scalars
+      REAL(wp) ::   zwndi_t , zwndj_t 
+      REAL(wp) ::   zztmp0,zztmp1, zztmp2                ! temporary scalars
       REAL(wp), DIMENSION(jpi,jpj) :: ztmp, zsipt ! temporary array
       !!---------------------------------------------------------------------
       !
@@ -1026,8 +1039,11 @@ CONTAINS
       ! ------------------------------------------------------------ !
       ! 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) )
+         zwndi_t = (  pwndi(ji,jj) - rn_vfac * 0.5 * ( puice(ji-1,jj  ) + puice(ji,jj) )  )
+         zwndj_t = (  pwndj(ji,jj) - rn_vfac * 0.5 * ( pvice(ji  ,jj-1) + pvice(ji,jj) )  )
+         wndm_ice(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t )* tmask(ji,jj,1)
       END_2D
+      CALL lbc_lnk( 'sbcblk', wndm_ice, 'T',  1. )
       !
       ! potential sea-ice surface temperature [K]
       zsipt(:,:) = theta_exner( ptsui(:,:), pslp(:,:) )
@@ -1074,10 +1090,11 @@ CONTAINS
          !    Wind stress relative to nonmoving ice ( U10m )    !
          ! ---------------------------------------------------- !
          ! supress moving ice in wind stress computation as we don't know how to do it properly...
+         zztmp0 = rn_vfac * 0.5_wp
          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)
+            putaui(ji,jj) = zztmp1 * ( pwndi(ji,jj) - zztmp0 * ( puice(ji-1,jj  ) + puice(ji,jj) ) )
+            pvtaui(ji,jj) = zztmp1 * ( pwndj(ji,jj) - zztmp0 * ( pvice(ji  ,jj-1) + pvice(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 !!!
diff --git a/src/OCE/SBC/sbccpl.F90 b/src/OCE/SBC/sbccpl.F90
index fb6f2a2baecd05c04e207912a357031696a3ebcf..98dcb8b78c206b192ffab1cfa3f46b1026e6648f 100644
--- a/src/OCE/SBC/sbccpl.F90
+++ b/src/OCE/SBC/sbccpl.F90
@@ -34,9 +34,17 @@ MODULE sbccpl
    USE cpl_oasis3     ! OASIS3 coupling
    USE geo2ocean      !
    USE oce     , ONLY : ts, uu, vv, ssh, fraqsr_1lev
+#if defined key_medusa
+   USE oce , ONLY: CO2Flux_out_cpl, DMS_out_cpl, chloro_out_cpl,  &
+                        PCO2a_in_cpl, Dust_in_cpl
+#endif
    USE ocealb         !
    USE eosbn2         !
    USE sbcrnf  , ONLY : l_rnfcpl
+   USE cpl_rnf_1d, ONLY: nn_cpl_river, cpl_rnf_1d_init, cpl_rnf_1d_to_2d   ! Variables used in 1D river outflow 
+#if defined key_medusa
+   USE par_trc , ONLY : ln_medusa
+#endif
 #if defined key_cice
    USE ice_domain_size, only: ncat
 #endif
@@ -48,6 +56,7 @@ MODULE sbccpl
    USE iom            ! NetCDF library
    USE lib_mpp        ! distribued memory computing library
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE timing
 
 #if defined key_oasis3
    USE mod_oasis, ONLY : OASIS_Sent, OASIS_ToRest, OASIS_SentOut, OASIS_ToRestOut
@@ -129,8 +138,17 @@ MODULE sbccpl
    INTEGER, PARAMETER ::   jpr_icb    = 61
    INTEGER, PARAMETER ::   jpr_ts_ice = 62   ! Sea ice surface temp
    !!INTEGER, PARAMETER ::   jpr_qtrice = 63   ! Transmitted solar thru sea-ice
-
-   INTEGER, PARAMETER ::   jprcv      = 62   ! total number of fields received
+   INTEGER, PARAMETER ::   jpr_grnm   = 63   ! Greenland ice mass 
+   INTEGER, PARAMETER ::   jpr_antm   = 64   ! Antarctic ice mass 
+   INTEGER, PARAMETER ::   jpr_rnf_1d = 65   ! 1D river runoff 
+   INTEGER, PARAMETER ::   jpr_qtr    = 66   ! Transmitted solar
+#if defined key_medusa
+   INTEGER, PARAMETER ::   jpr_atm_pco2 = 67 ! Incoming atm pCO2 flux
+   INTEGER, PARAMETER ::   jpr_atm_dust = 68 ! Incoming atm aggregate dust
+   INTEGER, PARAMETER ::   jprcv      = 69   ! total number of fields received
+#else
+   INTEGER, PARAMETER ::   jprcv      = 66   ! total number of fields received
+#endif
 
    INTEGER, PARAMETER ::   jps_fice   =  1   ! ice fraction sent to the atmosphere
    INTEGER, PARAMETER ::   jps_toce   =  2   ! ocean temperature
@@ -170,17 +188,24 @@ MODULE sbccpl
    INTEGER, PARAMETER ::   jps_kice   = 36   ! sea ice effective conductivity
    INTEGER, PARAMETER ::   jps_sstfrz = 37   ! sea surface freezing temperature
    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
+#if defined key_medusa
+   INTEGER, PARAMETER ::   jps_bio_co2 = 39    ! MEDUSA air-sea CO2 flux
+   INTEGER, PARAMETER ::   jps_bio_dms = 40    ! MEDUSA DMS surface concentration
+   INTEGER, PARAMETER ::   jps_bio_chloro = 41 ! MEDUSA chlorophyll surface concentration
+
+   INTEGER, PARAMETER ::   jpsnd      = 41   ! total number of fields sent 
+#else
+   INTEGER, PARAMETER ::   jpsnd      = 38   ! total number of fields sent 
 #endif
 
+#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                     !
       CHARACTER(len = 32) ::   cldes      ! desciption of the coupling strategy
@@ -193,20 +218,34 @@ MODULE sbccpl
    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
    !                                   ! Received from the atmosphere
-   TYPE(FLD_C) ::   sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_dqnsdt, sn_rcv_qsr,  &
+#if defined key_medusa
+   TYPE(FLD_C) ::   sn_snd_bio_co2, sn_snd_bio_dms, sn_snd_bio_chloro
+#endif
+   TYPE(FLD_C) ::   sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_tauw, sn_rcv_dqnsdt, sn_rcv_qsr,  &
       &             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
+   TYPE(FLD_C) ::   sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2, sn_rcv_mslp, sn_rcv_icb, sn_rcv_isf,      &
+                    sn_rcv_grnm, sn_rcv_antm
+#if defined key_medusa
+   TYPE(FLD_C) ::   sn_rcv_atm_pco2, sn_rcv_atm_dust
+#endif
+   ! Send to waves 
+   TYPE(FLD_C) ::   sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev 
+
    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
+
+   ! Received from waves 
+   TYPE(FLD_C) ::   sn_rcv_tauwoc, sn_rcv_wfreq
+   ! Transmitted solar
+   TYPE(FLD_C) ::   sn_rcv_qtr
    !                                   ! Other namelist parameters
 !!   TYPE(FLD_C) ::   sn_rcv_qtrice
    INTEGER     ::   nn_cplmodel           ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
    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)
+   LOGICAL     ::   ln_couple_ocean_evap  ! Do we couple total (ocean+sea ice) evaporation (FALSE)
+                                          ! or ocean only evaporation (TRUE)
 
    TYPE ::   DYNARR
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3
@@ -275,22 +314,38 @@ CONTAINS
       REAL(wp), DIMENSION(jpi,jpj) ::   zacs, zaos
       !!
       NAMELIST/namsbc_cpl/  nn_cplmodel  , ln_usecplmask, nn_cats_cpl , ln_scale_ice_flux,             &
+         &                  ln_couple_ocean_evap,                                                      &
          &                  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_qtr   ,  &
          &                  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_qtrice
-         &                  sn_rcv_mslp
+         &                  sn_rcv_mslp, &
+                            sn_rcv_grnm  , sn_rcv_antm  ,                               &
+         &                  nn_coupled_iceshelf_fluxes  , ln_iceshelf_init_atmos ,                     &
+         &                  rn_greenland_total_fw_flux  , rn_greenland_calving_fraction  ,             &
+         &                  rn_antarctica_total_fw_flux , rn_antarctica_calving_fraction ,             &
+#if defined key_medusa
+         &                  rn_iceshelf_fluxes_tolerance,                                              &
+                                                                !  Add MEDUSA related fields to namelist
+                            sn_snd_bio_co2 , sn_snd_bio_dms, sn_snd_bio_chloro,                        &
+         &                  sn_rcv_atm_pco2, sn_rcv_atm_dust
+#else
+         &                  rn_iceshelf_fluxes_tolerance
+#endif
+
 
       !!---------------------------------------------------------------------
       !
       ! ================================ !
       !      Namelist informations       !
       ! ================================ !
-      !
+      ! 
+      IF (ln_timing) CALL timing_start('sbc_cpl_init')
       READ  ( numnam_ref, namsbc_cpl, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc_cpl in reference namelist' )
       !
@@ -307,6 +362,7 @@ CONTAINS
          WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel
          WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask
          WRITE(numout,*)'  ln_scale_ice_flux                   = ', ln_scale_ice_flux
+         WRITE(numout,*)'  ln_couple_ocean_evap                = ', ln_couple_ocean_evap
          WRITE(numout,*)'  nn_cats_cpl                         = ', nn_cats_cpl
          WRITE(numout,*)'  received fields (mutiple ice categogies)'
          WRITE(numout,*)'      10m wind module                 = ', TRIM(sn_rcv_w10m%cldes  ), ' (', TRIM(sn_rcv_w10m%clcat  ), ')'
@@ -321,10 +377,12 @@ CONTAINS
          WRITE(numout,*)'      freshwater budget               = ', TRIM(sn_rcv_emp%cldes   ), ' (', TRIM(sn_rcv_emp%clcat   ), ')'
          WRITE(numout,*)'      runoffs                         = ', TRIM(sn_rcv_rnf%cldes   ), ' (', TRIM(sn_rcv_rnf%clcat   ), ')'
          WRITE(numout,*)'      calving                         = ', TRIM(sn_rcv_cal%cldes   ), ' (', TRIM(sn_rcv_cal%clcat   ), ')'
+         WRITE(numout,*)'      Greenland ice mass              = ', TRIM(sn_rcv_grnm%cldes  ), ' (', TRIM(sn_rcv_grnm%clcat  ), ')' 
+         WRITE(numout,*)'      Antarctica ice mass             = ', TRIM(sn_rcv_antm%cldes  ), ' (', TRIM(sn_rcv_antm%clcat  ), ')' 
          WRITE(numout,*)'      iceberg                         = ', TRIM(sn_rcv_icb%cldes   ), ' (', TRIM(sn_rcv_icb%clcat   ), ')'
          WRITE(numout,*)'      ice shelf                       = ', TRIM(sn_rcv_isf%cldes   ), ' (', TRIM(sn_rcv_isf%clcat   ), ')'
          WRITE(numout,*)'      sea ice heat fluxes             = ', TRIM(sn_rcv_iceflx%cldes), ' (', TRIM(sn_rcv_iceflx%clcat), ')'
-!!       WRITE(numout,*)'      transmitted solar thru sea-ice  = ', TRIM(sn_rcv_qtrice%cldes), ' (', TRIM(sn_rcv_qtrice%clcat), ')'
+         WRITE(numout,*)'      transmitted solar               = ', TRIM(sn_rcv_qtr%cldes   ), ' (', TRIM(sn_rcv_qtr%clcat   ), ')'
          WRITE(numout,*)'      atm co2                         = ', TRIM(sn_rcv_co2%cldes   ), ' (', TRIM(sn_rcv_co2%clcat   ), ')'
          WRITE(numout,*)'      Sea ice surface skin temperature= ', TRIM(sn_rcv_ts_ice%cldes), ' (', TRIM(sn_rcv_ts_ice%clcat), ')'
          WRITE(numout,*)'      surface waves:'
@@ -347,6 +405,11 @@ CONTAINS
          WRITE(numout,*)'                      - referential   = ', sn_snd_crt%clvref
          WRITE(numout,*)'                      - orientation   = ', sn_snd_crt%clvor
          WRITE(numout,*)'                      - mesh          = ', sn_snd_crt%clvgrd
+#if defined key_medusa
+         WRITE(numout,*)'      bio co2 flux                    = ', TRIM(sn_snd_bio_co2%cldes),' (', TRIM(sn_snd_bio_co2%clcat), ')'
+         WRITE(numout,*)'      bio dms flux                    = ', TRIM(sn_snd_bio_dms%cldes),' (', TRIM(sn_snd_bio_dms%clcat), ')'
+         WRITE(numout,*)'      bio dms chlorophyll             = ', TRIM(sn_snd_bio_chloro%cldes), ' (', TRIM(sn_snd_bio_chloro%clcat), ')'
+#endif
          WRITE(numout,*)'      oce co2 flux                    = ', TRIM(sn_snd_co2%cldes   ), ' (', TRIM(sn_snd_co2%clcat   ), ')'
          WRITE(numout,*)'      ice effective conductivity      = ', TRIM(sn_snd_cond%cldes  ), ' (', TRIM(sn_snd_cond%clcat  ), ')'
          WRITE(numout,*)'      meltponds fraction and depth    = ', TRIM(sn_snd_mpnd%cldes  ), ' (', TRIM(sn_snd_mpnd%clcat  ), ')'
@@ -357,6 +420,17 @@ CONTAINS
          WRITE(numout,*)'                      - referential   = ', sn_snd_crtw%clvref
          WRITE(numout,*)'                      - orientation   = ', sn_snd_crtw%clvor
          WRITE(numout,*)'                      - mesh          = ', sn_snd_crtw%clvgrd
+#if defined key_medusa
+         WRITE(numout,*)'      atm pco2                        = ', TRIM(sn_rcv_atm_pco2%cldes),'(', TRIM(sn_rcv_atm_pco2%clcat   ), ')'
+         WRITE(numout,*)'      atm dust                        = ', TRIM(sn_rcv_atm_dust%cldes),'(', TRIM(sn_rcv_atm_dust%clcat),')'
+#endif
+          WRITE(numout,*)'  nn_coupled_iceshelf_fluxes          = ', nn_coupled_iceshelf_fluxes
+         WRITE(numout,*)'  ln_iceshelf_init_atmos              = ', ln_iceshelf_init_atmos
+         WRITE(numout,*)'  rn_greenland_total_fw_flux          = ', rn_greenland_total_fw_flux
+         WRITE(numout,*)'  rn_antarctica_total_fw_flux         = ', rn_antarctica_total_fw_flux
+         WRITE(numout,*)'  rn_greenland_calving_fraction       = ', rn_greenland_calving_fraction
+         WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction
+         WRITE(numout,*)'  rn_iceshelf_fluxes_tolerance        = ', rn_iceshelf_fluxes_tolerance
       ENDIF
       IF( lwp .AND. ln_wave) THEN                        ! control print
       WRITE(numout,*)'      surface waves:'
@@ -391,7 +465,11 @@ CONTAINS
       !                 define the north fold type of lbc                  (srcv(:)%nsgn)
 
       ! default definitions of srcv
-      srcv(:)%laction = .FALSE.   ;   srcv(:)%clgrid = 'T'   ;   srcv(:)%nsgn = 1.   ;   srcv(:)%nct = 1
+      srcv(:)%laction = .FALSE. 
+      srcv(:)%clgrid = 'T' 
+      srcv(:)%nsgn = 1. 
+      srcv(:)%nct = 1 
+      srcv(:)%dimensions = 2 
 
       !                                                      ! ------------------------- !
       !                                                      ! ice and ocean wind stress !
@@ -445,7 +523,11 @@ CONTAINS
          srcv(jpr_otx1:jpr_otz1)%clgrid  = 'U'        ! oce components given at U-point
          srcv(jpr_otx2:jpr_otz2)%clgrid  = 'V'        !           and           V-point
          srcv(jpr_itx1:jpr_itz1)%clgrid  = 'F'        ! ice components given at F-point
-         srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2
+         !srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2
+ 	 ! Currently needed for HadGEM3 - but shouldn't affect anyone else for the moment
+         srcv(jpr_otx1)%laction = .TRUE.
+         srcv(jpr_oty1)%laction = .TRUE.
+         !
          srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 only
       CASE( 'T,I' )
          srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point
@@ -510,15 +592,34 @@ CONTAINS
       !                                                      !     Runoffs & Calving     !
       !                                                      ! ------------------------- !
       srcv(jpr_rnf   )%clname = 'O_Runoff'
-      IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN
-         srcv(jpr_rnf)%laction = .TRUE.
+      srcv(jpr_rnf_1d   )%clname = 'ORunff1D' 
+      IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' .OR. TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN  
+         IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) srcv(jpr_rnf)%laction = .TRUE. 
+         IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 
+            srcv(jpr_rnf_1d)%laction = .TRUE. 
+            srcv(jpr_rnf_1d)%dimensions = 1 ! 1D field passed through coupler 
+         END IF 
          l_rnfcpl              = .TRUE.                      ! -> no need to read runoffs in sbcrnf
          ln_rnf                = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) '   runoffs received from oasis -> force ln_rnf = ', ln_rnf
       ENDIF
       !
-      srcv(jpr_cal)%clname = 'OCalving'   ;  IF( TRIM( sn_rcv_cal%cldes) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE.
+      srcv(jpr_cal   )%clname = 'OCalving'    
+      IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE.      
+ 
+      srcv(jpr_grnm  )%clname = 'OGrnmass'  
+      IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' ) THEN 
+         srcv(jpr_grnm)%laction = .TRUE.  
+         srcv(jpr_grnm)%dimensions = 0 ! Scalar field
+      ENDIF 
+       
+      srcv(jpr_antm  )%clname = 'OAntmass' 
+      IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' ) THEN
+         srcv(jpr_antm)%laction = .TRUE.
+         srcv(jpr_antm)%dimensions = 0 ! Scalar field
+      ENDIF
+
       srcv(jpr_isf)%clname = 'OIcshelf'   ;  IF( TRIM( sn_rcv_isf%cldes) == 'coupled' )   srcv(jpr_isf)%laction = .TRUE.
       srcv(jpr_icb)%clname = 'OIceberg'   ;  IF( TRIM( sn_rcv_icb%cldes) == 'coupled' )   srcv(jpr_icb)%laction = .TRUE.
 
@@ -594,6 +695,22 @@ CONTAINS
          IF(lwp) WRITE(numout,*) '   Atmospheric pco2 received from oasis '
          IF(lwp) WRITE(numout,*)
       ENDIF
+
+#if defined key_medusa   
+      !                                                      ! --------------------------------------- !
+      !                                                      ! Incoming CO2 and DUST fluxes for MEDUSA !
+      !                                                      ! --------------------------------------- !
+      srcv(jpr_atm_pco2)%clname = 'OATMPCO2'
+      IF (TRIM(sn_rcv_atm_pco2%cldes) == 'medusa') THEN
+        srcv(jpr_atm_pco2)%laction = .TRUE.
+      END IF
+
+      srcv(jpr_atm_dust)%clname = 'OATMDUST'
+      IF (TRIM(sn_rcv_atm_dust%cldes) == 'medusa')  THEN
+        srcv(jpr_atm_dust)%laction = .TRUE.
+      END IF
+#endif
+
       !
       !                                                      ! ------------------------- !
       !                                                      ! Mean Sea Level Pressure   !
@@ -625,6 +742,21 @@ CONTAINS
 !!         ENDIF
 !!         srcv(jpr_qtrice)%laction = .TRUE.
 !!      ENDIF
+
+      !                                                      ! ------------------------- !
+      !                                                      !    transmitted solar      !   
+      !                                                      ! ------------------------- !
+      srcv(jpr_qtr )%clname = 'OQtr'
+      IF( TRIM(sn_rcv_qtr%cldes) == 'coupled' ) THEN
+         IF ( TRIM( sn_rcv_qtr%clcat ) == 'yes' ) THEN
+            srcv(jpr_qtr)%nct = nn_cats_cpl
+         ELSE
+            CALL ctl_stop( 'sbc_cpl_init: sn_rcv_qtr%clcat should always be set to yes currently' )
+         ENDIF
+         srcv(jpr_qtr)%laction = .TRUE.
+      ENDIF
+
+
       !                                                      ! ------------------------- !
       !                                                      !    ice skin temperature   !
       !                                                      ! ------------------------- !
@@ -799,24 +931,6 @@ CONTAINS
          ENDIF
       ENDIF
 
-      ! =================================================== !
-      ! Allocate all parts of frcv used for received fields !
-      ! =================================================== !
-      DO jn = 1, jprcv
-         IF( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) )
-      END DO
-      ! Allocate taum part of frcv which is used even when not received as coupling field
-      IF( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) )
-      ! Allocate w10m part of frcv which is used even when not received as coupling field
-      IF( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) )
-      ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field
-      IF( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) )
-      IF( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) )
-      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.
-      IF( k_ice /= 0 ) THEN
-         IF( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) )
-         IF( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) )
-      ENDIF
 
       ! ================================ !
       !     Define the send interface    !
@@ -826,8 +940,12 @@ CONTAINS
       !                 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
-
+      ssnd(:)%laction = .FALSE. 
+      ssnd(:)%clgrid = 'T' 
+      ssnd(:)%nsgn = 1. 
+      ssnd(:)%nct = 1 
+      ssnd(:)%dimensions = 2 
+         
       !                                                      ! ------------------------- !
       !                                                      !    Surface temperature    !
       !                                                      ! ------------------------- !
@@ -978,6 +1096,25 @@ CONTAINS
       !                                                      ! ------------------------- !
       ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(sn_snd_co2%cldes) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE.
       !
+
+#if defined key_medusa 
+      !                                                      ! ------------------------- !
+      !                                                      !   MEDUSA output fields    !
+      !                                                      ! ------------------------- !
+      ! Surface dimethyl sulphide from Medusa
+      ssnd(jps_bio_dms)%clname = 'OBioDMS'
+      IF( TRIM(sn_snd_bio_dms%cldes) == 'medusa' )    ssnd(jps_bio_dms )%laction = .TRUE.
+
+      ! Surface CO2 flux from Medusa
+      ssnd(jps_bio_co2)%clname = 'OBioCO2'
+      IF( TRIM(sn_snd_bio_co2%cldes) == 'medusa' )    ssnd(jps_bio_co2 )%laction = .TRUE.
+
+      ! Surface chlorophyll from Medusa
+      ssnd(jps_bio_chloro)%clname = 'OBioChlo'
+      IF( TRIM(sn_snd_bio_chloro%cldes) == 'medusa' ) ssnd(jps_bio_chloro )%laction = .TRUE.
+#endif
+
+
       !                                                      ! ------------------------- !
       !                                                      ! Sea surface freezing temp !
       !                                                      ! ------------------------- !
@@ -1105,10 +1242,52 @@ CONTAINS
          ENDIF
       ENDIF
 
+      ! Initialise 1D river outflow scheme 
+      nn_cpl_river = 1 
+      IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_init   ! Coupled runoff using 1D array
+      
+      ! =================================================== !
+      ! Allocate all parts of frcv used for received fields !
+      ! =================================================== !
+      DO jn = 1, jprcv
+
+         IF ( srcv(jn)%laction ) THEN 
+            SELECT CASE( srcv(jn)%dimensions )
+            !
+            CASE( 0 )   ! Scalar field
+               ALLOCATE( frcv(jn)%z3(1,1,1) )
+               
+            CASE( 1 )   ! 1D field
+               ALLOCATE( frcv(jn)%z3(nn_cpl_river,1,1) )
+               
+            CASE DEFAULT  ! 2D (or pseudo 3D) field.
+               ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) )
+            END SELECT
+         END IF
+
+      END DO
+      ! Allocate taum part of frcv which is used even when not received as coupling field
+      IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) )
+      ! Allocate w10m part of frcv which is used even when not received as coupling field
+      IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) )
+      ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field
+      IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) )
+      IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) )
+      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.
+      IF( k_ice /= 0 ) THEN
+         IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) )
+         IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) )
+      END IF
+
       !
       ! ================================ !
       !   initialisation of the coupler  !
       ! ================================ !
+
+      ! There's no point initialising the coupler if we've accumulated any errors in 
+      ! coupling field definitions or settings. 
+      IF (nstop > 0) CALL ctl_stop( 'STOP', 'sbc_cpl_init: Errors encountered in coupled field definitions' )
+
       CALL cpl_define(jprcv, jpsnd, nn_cplmodel)
 
       IF(ln_usecplmask) THEN
@@ -1122,6 +1301,26 @@ CONTAINS
       ENDIF
       xcplmask(:,:,0) = 1. - SUM( xcplmask(:,:,1:nn_cplmodel), dim = 3 )
       !
+      IF( nn_coupled_iceshelf_fluxes .gt. 0 ) THEN 
+          ! Crude masks to separate the Antarctic and Greenland icesheets. Obviously something 
+          ! more complicated could be done if required. 
+          greenland_icesheet_mask = 0.0 
+          WHERE( gphit >= 0.0 ) greenland_icesheet_mask = 1.0 
+          antarctica_icesheet_mask = 0.0 
+          WHERE( gphit < 0.0 ) antarctica_icesheet_mask = 1.0 
+  
+          IF( .not. ln_rstart ) THEN 
+             greenland_icesheet_mass = 0.0  
+             greenland_icesheet_mass_rate_of_change = 0.0  
+             greenland_icesheet_timelapsed = 0.0 
+             antarctica_icesheet_mass = 0.0  
+             antarctica_icesheet_mass_rate_of_change = 0.0  
+             antarctica_icesheet_timelapsed = 0.0 
+          ENDIF 
+ 
+      ENDIF 
+      !
+      IF (ln_timing) CALL timing_stop('sbc_cpl_init')
       !
    END SUBROUTINE sbc_cpl_init
 
@@ -1181,15 +1380,26 @@ CONTAINS
       LOGICAL  ::   llnewtx, llnewtau      ! update wind stress components and module??
       INTEGER  ::   ji, jj, jn             ! dummy loop indices
       INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdt did not change since nit000)
+      INTEGER  ::   ikchoix
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztx2, zty2
       REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars
       REAL(wp) ::   zcoef                  ! temporary scalar
+      LOGICAL  ::   ll_wrtstp              ! write diagnostics?
       REAL(wp) ::   zrhoa  = 1.22          ! Air density kg/m3
       REAL(wp) ::   zcdrag = 1.5e-3        ! drag coefficient
+      REAL(wp) ::   zgreenland_icesheet_mass_in, zantarctica_icesheet_mass_in 
+      REAL(wp) ::   zgreenland_icesheet_mass_b, zantarctica_icesheet_mass_b 
+      REAL(wp) ::   zmask_sum, zepsilon    
       REAL(wp) ::   zzx, zzy               ! temporary variables
       REAL(wp) ::   r1_grau                ! = 1.e0 / (grav * rho0)
       REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr, zcloud_fra
       !!----------------------------------------------------------------------
       !
+      !
+      IF (ln_timing) CALL timing_start('sbc_cpl_rcv')
+      !
+      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend )
+            !
       IF( kt == nit000 ) THEN
       !   cannot be done in the init phase when we use agrif as cpl_freq requires that oasis_enddef is done
          ncpl_qsr_freq = cpl_freq( 'O_QsrOce' ) + cpl_freq( 'O_QsrMix' ) + cpl_freq( 'I_QsrOce' ) + cpl_freq( 'I_QsrMix' )
@@ -1209,7 +1419,16 @@ CONTAINS
       !                                                      ! ======================================================= !
       isec = ( kt - nit000 ) * NINT( rn_Dt )                      ! date of exchanges
       DO jn = 1, jprcv                                          ! received fields sent by the atmosphere
-         IF( srcv(jn)%laction )   CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) )
+        IF( srcv(jn)%laction ) THEN  
+ 
+          IF ( srcv(jn)%dimensions <= 1 ) THEN 
+            CALL cpl_rcv_1d( jn, isec, frcv(jn)%z3, SIZE(frcv(jn)%z3), nrcvinfo(jn) ) 
+          ELSE 
+
+            CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 
+          END IF 
+
+        END IF 
       END DO
 
       !                                                      ! ========================= !
@@ -1238,14 +1457,34 @@ CONTAINS
             !
             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 )
-               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 )
+               IF( srcv(jpr_otx1)%clgrid == 'U' .AND. (.NOT. srcv(jpr_otx2)%laction) ) THEN
+                  ! Temporary code for HadGEM3 - will be removed eventually.
+                  ! Only applies when we have only taux on U grid and tauy on V grid
+                  DO_2D( 0, 0, 0, 0 )                                       
+                          ztx(ji,jj)=0.25*vmask(ji,jj,1)                &
+                             *(frcv(jpr_otx1)%z3(ji,jj,1)+frcv(jpr_otx1)%z3(ji-1,jj,1)    &
+                             +frcv(jpr_otx1)%z3(ji,jj+1,1)+frcv(jpr_otx1)%z3(ji-1,jj+1,1))
+                          zty(ji,jj)=0.25*umask(ji,jj,1)                &
+                             *(frcv(jpr_oty1)%z3(ji,jj,1)+frcv(jpr_oty1)%z3(ji+1,jj,1)    &
+                             +frcv(jpr_oty1)%z3(ji,jj-1,1)+frcv(jpr_oty1)%z3(ji+1,jj-1,1))
+                  END_2D
+	                       
+                  ikchoix = 1
+                  CALL repcmo (frcv(jpr_otx1)%z3(:,:,1),zty,ztx,frcv(jpr_oty1)%z3(:,:,1),ztx2,zty2,ikchoix)
+                  CALL lbc_lnk ('jpr_otx1', ztx2,'U', -1. )
+                  CALL lbc_lnk ('jpr_oty1', zty2,'V', -1. )
+                  frcv(jpr_otx1)%z3(:,:,1)=ztx2(:,:)
+                  frcv(jpr_oty1)%z3(:,:,1)=zty2(:,:)
                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->i', ztx )   
+                  frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid
+                  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 )   
+                  ELSE
+                     CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )
+                  ENDIF
+                  frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid 
                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
@@ -1539,8 +1778,10 @@ CONTAINS
          !
          IF( srcv(jpr_icb)%laction )  zqns(:,:) = zqns(:,:) - frcv(jpr_icb)%z3(:,:,1) * rLfus ! remove heat content associated to iceberg melting
          !
-         IF( ln_mixcpl ) THEN   ;   qns(:,:) = qns(:,:) * xcplmask(:,:,0) + zqns(:,:) * zmsk(:,:)
-         ELSE                   ;   qns(:,:) =                              zqns(:,:)
+         IF( ln_mixcpl ) THEN   
+            qns(:,:) = qns(:,:) * xcplmask(:,:,0) + zqns(:,:) * zmsk(:,:)
+         ELSE                   
+            qns(:,:) =                              zqns(:,:)
          ENDIF
 
          !                                                       ! solar flux over the ocean          (qsr)
@@ -1559,6 +1800,76 @@ CONTAINS
          IF( srcv(jpr_fice )%laction )   fr_i(:,:) = frcv(jpr_fice )%z3(:,:,1)
          !
       ENDIF
+
+      zepsilon = rn_iceshelf_fluxes_tolerance
+
+      IF( srcv(jpr_grnm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN
+     
+         ! This is a zero dimensional, single value field.
+         zgreenland_icesheet_mass_in =  frcv(jpr_grnm)%z3(1,1,1)
+           
+         greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt         
+         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN
+            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart
+            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts.
+            zgreenland_icesheet_mass_b = zgreenland_icesheet_mass_in
+            greenland_icesheet_mass = zgreenland_icesheet_mass_in
+         ENDIF
+         IF( ABS( zgreenland_icesheet_mass_in - greenland_icesheet_mass ) > zepsilon ) THEN
+            zgreenland_icesheet_mass_b = greenland_icesheet_mass
+           
+            ! Only update the mass if it has increased.
+            IF ( (zgreenland_icesheet_mass_in - greenland_icesheet_mass) > 0.0 ) THEN
+               greenland_icesheet_mass = zgreenland_icesheet_mass_in
+            ENDIF
+           
+            IF( zgreenland_icesheet_mass_b /= 0.0 ) &
+           &     greenland_icesheet_mass_rate_of_change = ( greenland_icesheet_mass - zgreenland_icesheet_mass_b ) / greenland_icesheet_timelapsed 
+            greenland_icesheet_timelapsed = 0.0_wp       
+         ENDIF
+         IF(lwp .AND. ll_wrtstp) THEN
+            WRITE(numout,*) 'Greenland icesheet mass (kg) read in is ', zgreenland_icesheet_mass_in
+            WRITE(numout,*) 'Greenland icesheet mass (kg) used is    ', greenland_icesheet_mass
+            WRITE(numout,*) 'Greenland icesheet mass rate of change (kg/s) is ', greenland_icesheet_mass_rate_of_change
+            WRITE(numout,*) 'Greenland icesheet seconds lapsed since last change is ', greenland_icesheet_timelapsed
+         ENDIF
+      ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
+         greenland_icesheet_mass_rate_of_change = rn_greenland_total_fw_flux
+      ENDIF
+      !                                                        ! land ice masses : Antarctica
+      IF( srcv(jpr_antm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN
+         
+         ! This is a zero dimensional, single value field.
+         zantarctica_icesheet_mass_in = frcv(jpr_antm)%z3(1,1,1)
+           
+         antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt         
+         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN
+            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart
+            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts.
+            zantarctica_icesheet_mass_b = zantarctica_icesheet_mass_in
+            antarctica_icesheet_mass = zantarctica_icesheet_mass_in
+         ENDIF
+         IF( ABS( zantarctica_icesheet_mass_in - antarctica_icesheet_mass ) > zepsilon ) THEN
+            zantarctica_icesheet_mass_b = antarctica_icesheet_mass
+           
+            ! Only update the mass if it has increased.
+            IF ( (zantarctica_icesheet_mass_in - antarctica_icesheet_mass) > 0.0 ) THEN
+               antarctica_icesheet_mass = zantarctica_icesheet_mass_in
+            END IF
+           
+            IF( zantarctica_icesheet_mass_b /= 0.0 ) &
+          &      antarctica_icesheet_mass_rate_of_change = ( antarctica_icesheet_mass - zantarctica_icesheet_mass_b ) / antarctica_icesheet_timelapsed 
+            antarctica_icesheet_timelapsed = 0.0_wp       
+         ENDIF
+         IF(lwp .AND. ll_wrtstp) THEN
+            WRITE(numout,*) 'Antarctica icesheet mass (kg) read in is ', zantarctica_icesheet_mass_in
+            WRITE(numout,*) 'Antarctica icesheet mass (kg) used is    ', antarctica_icesheet_mass
+            WRITE(numout,*) 'Antarctica icesheet mass rate of change (kg/s) is ', antarctica_icesheet_mass_rate_of_change
+            WRITE(numout,*) 'Antarctica icesheet seconds lapsed since last change is ', antarctica_icesheet_timelapsed
+         ENDIF
+      ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
+         antarctica_icesheet_mass_rate_of_change = rn_antarctica_total_fw_flux
+      ENDIF
       !
    END SUBROUTINE sbc_cpl_rcv
 
@@ -1770,6 +2081,27 @@ CONTAINS
       IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0)
       ziceld(:,:) = 1._wp - picefr(:,:)
       zcptn (:,:) = rcp * sst_m(:,:)
+
+
+      !                                                      ! ========================= !
+      SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) )             !  ice topmelt and botmelt  !
+      !                                                      ! ========================= !
+      CASE ('coupled')
+         IF (ln_scale_ice_flux) THEN
+            WHERE( a_i(:,:,:) > 1.e-10_wp )
+               qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:)
+               qcn_ice(:,:,:) = frcv(jpr_botm)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:)
+            ELSEWHERE
+               qml_ice(:,:,:) = 0.0_wp
+               qcn_ice(:,:,:) = 0.0_wp
+            END WHERE
+         ELSE
+            qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:)
+            qcn_ice(:,:,:) = frcv(jpr_botm)%z3(:,:,:)
+         ENDIF
+      END SELECT
+
+
       !
       !                                                      ! ========================= !
       !                                                      !    freshwater budget      !   (emp_tot)
@@ -1783,7 +2115,9 @@ CONTAINS
       CASE( 'conservative' )   ! received fields: jpr_rain, jpr_snow, jpr_ievp, jpr_tevp
          zsprecip(:,:) =   frcv(jpr_snow)%z3(:,:,1)                  ! May need to ensure positive here
          ztprecip(:,:) =   frcv(jpr_rain)%z3(:,:,1) + zsprecip(:,:)  ! May need to ensure positive here
-         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:)
+         IF (.not. ln_couple_ocean_evap ) THEN
+            zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:)
+         END IF
       CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp
          zemp_tot(:,:) = ziceld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + picefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1)
          zemp_ice(:,:) = frcv(jpr_semp)%z3(:,:,1) * picefr(:,:)
@@ -1791,7 +2125,9 @@ CONTAINS
          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
       !                         ! 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')
+         CALL ctl_stop( 'sbccpl/sbc_cpl_ice_flx: some fields are not defined. Change sn_rcv_emp value in namelist namsbc_cpl' )
+      CASE default              ! Default
+         CALL ctl_stop( 'sbccpl/sbc_cpl_ice_flx: some fields are not defined. Change sn_rcv_emp value in namelist namsbc_cpl' )
       END SELECT
 
       ! --- evaporation over ice (kg/m2/s) --- !
@@ -1837,19 +2173,30 @@ CONTAINS
 
       ! --- evaporation minus precipitation corrected (because of wind blowing on snow) --- !
       zemp_ice(:,:) = zemp_ice(:,:) + zsprecip(:,:) * ( picefr(:,:) - zsnw(:,:) )  ! emp_ice = A * sublimation - zsnw * sprecip
-      zemp_oce(:,:) = zemp_tot(:,:) - zemp_ice(:,:)                                ! emp_oce = emp_tot - emp_ice
 
-      ! --- evaporation over ocean (used later for qemp) --- !
-      zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - zevap_ice_total(:,:) * picefr(:,:)
+      IF ( ln_couple_ocean_evap ) THEN
+         zemp_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_rain)%z3(:,:,1) & !Ocean evap minus rain (as all rain goes straight to ocean in GC5)
+                        & - zsprecip(:,:) * ( 1._wp - zsnw(:,:) )        !subtract snow in leads after correction for blowing snow
+         zemp_tot(:,:) = zemp_oce(:,:) + zemp_ice(:,:)
+         zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1)
+      ELSE
+         zemp_oce(:,:) = zemp_tot(:,:) - zemp_ice(:,:)                                ! emp_oce = emp_tot - emp_ice
+
+         ! --- evaporation over ocean (used later for qemp) --- !
+         zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - zevap_ice_total(:,:) * picefr(:,:)
+      END IF
 
       ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0
       ! 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)
+      IF( srcv(jpr_rnf)%laction ) THEN   ! 2D runoffs (included in emp later on)
          rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1)
       ENDIF
+      IF( srcv(jpr_rnf_1d)%laction ) THEN ! 1D runoff
+         CALL cpl_rnf_1d_to_2d(frcv(jpr_rnf_1d)%z3(:,:,:))
+      ENDIF
       IF( srcv(jpr_cal)%laction ) THEN   ! calving (put in emp_tot and emp_oce)
          zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1)
          zemp_oce(:,:) = zemp_oce(:,:) - frcv(jpr_cal)%z3(:,:,1)
@@ -2009,8 +2356,10 @@ CONTAINS
       ! --- non solar flux over ocean --- !
       !         note: ziceld cannot be = 0 since we limit the ice concentration to amax
       zqns_oce = 0._wp
-      WHERE( ziceld /= 0._wp )   zqns_oce(:,:) = ( zqns_tot(:,:) - SUM( a_i * zqns_ice, dim=3 ) ) / ziceld(:,:)
 
+
+
+      WHERE( ziceld /= 0._wp )   zqns_oce(:,:) = ( zqns_tot(:,:) - SUM( a_i * zqns_ice, dim=3 ) ) / ziceld(:,:)
       ! Heat content per unit mass of snow (J/kg)
       WHERE( SUM( a_i, dim=3 ) > 1.e-10 )   ;   zcptsnw(:,:) = rcpi * SUM( (tn_ice - rt0) * a_i, dim=3 ) / SUM( a_i, dim=3 )
       ELSEWHERE                             ;   zcptsnw(:,:) = zcptn(:,:)
@@ -2023,7 +2372,12 @@ CONTAINS
 
       ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- !
       DO jl = 1, jpl
-         zqevap_ice(:,:,jl) = 0._wp ! should be -evap * ( ( Tice - rt0 ) * rcpi ) but atm. does not take it into account
+         ! zqevap_ice(:,:,jl) = 0._wp ! should be -evap * ( ( Tice - rt0 ) * rcpi ) but atm. does not take it into account
+
+         ! How much enthalpy is stored in sublimating snow and ice. At this stage we don't know if it is snow or ice that is
+         ! sublimating so we will use the combined snow and ice layer temperature t1_ice.
+         zqevap_ice(:,:,jl) = -zevap_ice(:,:,jl) * ( ( rt0 - t1_ice(:,:,jl) ) * rcpi + rLfus )
+
       END DO
 
       ! --- heat flux associated with emp (W/m2) --- !
@@ -2041,6 +2395,7 @@ CONTAINS
       IF( ln_mixcpl ) THEN
          qns_tot(:,:) = qns_tot(:,:) * xcplmask(:,:,0) + zqns_tot(:,:)* zmsk(:,:)
          qns_oce(:,:) = qns_oce(:,:) * xcplmask(:,:,0) + zqns_oce(:,:)* zmsk(:,:)
+
          DO jl=1,jpl
             qns_ice  (:,:,jl) = qns_ice  (:,:,jl) * xcplmask(:,:,0) +  zqns_ice  (:,:,jl)* zmsk(:,:)
             qevap_ice(:,:,jl) = qevap_ice(:,:,jl) * xcplmask(:,:,0) +  zqevap_ice(:,:,jl)* zmsk(:,:)
@@ -2085,9 +2440,14 @@ CONTAINS
       IF ( srcv(jpr_icb)%laction ) CALL iom_put('hflx_icb_cea' , - frcv(jpr_icb)%z3(:,:,1) * rLfus ) ! latent heat from icebergs melting
       IF (        iom_use('hflx_rain_cea') )    &                                                    ! heat flux from rain (cell average)
          &   CALL iom_put('hflx_rain_cea' , ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) )
-      IF (        iom_use('hflx_evap_cea') )    &                                                    ! heat flux from evap (cell average)
-         &   CALL iom_put('hflx_evap_cea' , ( frcv(jpr_tevp)%z3(:,:,1) - zevap_ice_total(:,:) * picefr(:,:) )  &
-         &                                  * zcptn(:,:) * tmask(:,:,1) )
+
+      IF ( ln_couple_ocean_evap ) THEN
+         IF ( iom_use(   'hflx_evap_cea') ) CALL iom_put('hflx_evap_cea' , frcv(jpr_tevp)%z3(:,:,1) * zcptn(:,:) * tmask(:,:,1) )            ! heat flux from evap (cell average)
+      ELSE
+         IF ( iom_use(   'hflx_evap_cea') ) CALL iom_put('hflx_evap_cea' , ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) )  &
+           &                         * zcptn(:,:) * tmask(:,:,1) )            ! heat flux from evap (cell average)
+      END IF
+
       IF (        iom_use('hflx_prec_cea') )    &                                                    ! heat flux from all precip (cell avg)
          &   CALL iom_put('hflx_prec_cea' ,    sprecip(:,:) * ( zcptsnw(:,:) - rLfus )  &
          &                                 + ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) )
@@ -2214,29 +2574,30 @@ CONTAINS
          !
       ELSEIF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN      !==  conduction flux as surface forcing  ==!
          !
-!!         SELECT CASE( TRIM( sn_rcv_qtrice%cldes ) )
-!!            !
-!!            !      ! ===> here we receive the qtr_ice_top array from the coupler
-!!         CASE ('coupled')
-!!            IF (ln_scale_ice_flux) THEN
-!!               WHERE( a_i(:,:,:) > 1.e-10_wp )
-!!                  zqtr_ice_top(:,:,:) = frcv(jpr_qtrice)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:)
-!!               ELSEWHERE
-!!                  zqtr_ice_top(:,:,:) = 0.0_wp
-!!               ENDWHERE
-!!            ELSE
-!!               zqtr_ice_top(:,:,:) = frcv(jpr_qtrice)%z3(:,:,:)
-!!            ENDIF
-!!           
-!!            ! Add retrieved transmitted solar radiation onto the ice and total solar radiation
-!!            zqsr_ice(:,:,:) = zqsr_ice(:,:,:) + zqtr_ice_top(:,:,:)
-!!            zqsr_tot(:,:)   = zqsr_tot(:,:) + SUM( zqtr_ice_top(:,:,:) * a_i(:,:,:), dim=3 )
-!!            
-!!            !      if we are not getting this data from the coupler then assume zero (fully opaque ice)
-!!         CASE ('none')
-         zqtr_ice_top(:,:,:) = 0._wp
-!!         END SELECT
-            !
+         SELECT CASE( TRIM( sn_rcv_qtr%cldes ) )
+         !
+         !      ! ===> here we receive the qtr_ice_top array from the coupler
+         CASE ('coupled')
+
+            IF (ln_scale_ice_flux) THEN
+               WHERE( a_i(:,:,:) > 0.0_wp ) zqtr_ice_top(:,:,:) = MAX(0._wp, frcv(jpr_qtr)%z3(:,:,:)) * a_i_last_couple(:,:,:) / a_i(:,:,:)
+               WHERE( a_i(:,:,:) <= 0.0_wp ) zqtr_ice_top(:,:,:) = 0.0_wp
+            ELSE
+               zqtr_ice_top(:,:,:) = MAX(0._wp, frcv(jpr_qtr)%z3(:,:,:))
+            ENDIF
+
+            ! Add retrieved transmitted solar radiation onto the ice and total solar radiation
+            zqsr_ice(:,:,:) = zqsr_ice(:,:,:) + zqtr_ice_top(:,:,:)
+            zqsr_tot(:,:) = zqsr_tot(:,:) + SUM( zqtr_ice_top(:,:,:) * a_i(:,:,:), dim=3 )
+
+         !      if we are not getting this data from the coupler then assume zero (fully opaque ice)
+         CASE ('none')
+            zqtr_ice_top(:,:,:) = 0._wp
+         CASE default
+            CALL ctl_stop( 'sbc_cpl_ice_flx: Invalid value for sn_rcv_qtr%cldes' )
+       END SELECT
+
+         !
       ENDIF
 
       IF( ln_mixcpl ) THEN
@@ -2260,6 +2621,44 @@ CONTAINS
       IF( ln_mixcpl ) THEN   ;   qsr_oce(:,:) = qsr_oce(:,:) * xcplmask(:,:,0) +  zqsr_oce(:,:)* zmsk(:,:)
       ELSE                   ;   qsr_oce(:,:) = zqsr_oce(:,:)   ;   ENDIF
 
+      IF( ln_mixcpl ) THEN
+         qsr_tot(:,:) = qsr(:,:) * ziceld(:,:) + SUM( qsr_ice(:,:,:) * a_i(:,:,:), dim=3 )   ! total flux from blk
+         qsr_tot(:,:) = qsr_tot(:,:) * xcplmask(:,:,0) +  zqsr_tot(:,:)* zmsk(:,:)
+         DO jl = 1, jpl
+            qsr_ice(:,:,jl) = qsr_ice(:,:,jl) * xcplmask(:,:,0) +  zqsr_ice(:,:,jl)* zmsk(:,:)
+         END DO
+      ELSE
+         qsr_tot(:,:  ) = zqsr_tot(:,:  )
+         qsr_ice(:,:,:) = zqsr_ice(:,:,:)
+      ENDIF
+
+      !                                                      ! ========================= !
+      SELECT CASE( TRIM( sn_rcv_dqnsdt%cldes ) )             !          d(qns)/dt        !
+      !                                                      ! ========================= !
+      CASE ('coupled')
+         IF ( TRIM(sn_rcv_dqnsdt%clcat) == 'yes' ) THEN
+            zdqns_ice(:,:,1:jpl) = frcv(jpr_dqnsdt)%z3(:,:,1:jpl)
+         ELSE
+            ! Set all category values equal for the moment
+            DO jl=1,jpl
+               zdqns_ice(:,:,jl) = frcv(jpr_dqnsdt)%z3(:,:,1)
+            ENDDO
+         ENDIF
+      CASE( 'none' ) 
+         zdqns_ice(:,:,:) = 0._wp
+      CASE default
+         CALL ctl_stop( 'sbc_cpl_ice_flx: Invalid value for sn_rcv_dqnsdt%cldes' )
+      END SELECT
+      
+      IF( ln_mixcpl ) THEN
+         DO jl=1,jpl
+            dqns_ice(:,:,jl) = dqns_ice(:,:,jl) * xcplmask(:,:,0) + zdqns_ice(:,:,jl) * zmsk(:,:)
+         ENDDO
+      ELSE
+         dqns_ice(:,:,:) = zdqns_ice(:,:,:)
+      ENDIF
+
+
       !                                                      ! ================== !
       !                                                      !   ice skin temp.   !
       !                                                      ! ================== !
@@ -2297,7 +2696,8 @@ CONTAINS
       INTEGER, INTENT(in) ::   kt
       INTEGER, INTENT(in) ::   Kbb, Kmm    ! ocean model time level index
       !
-      INTEGER ::   ji, jj, jl   ! dummy loop indices
+      INTEGER ::   ji, jj, jl   ! dummy loop indices      
+      INTEGER ::   ikchoix
       INTEGER ::   isec, info   ! local integer
       REAL(wp) ::   zumax, zvmax
       REAL(wp), DIMENSION(jpi,jpj)     ::   zfr_l, ztmp1, ztmp2, zotx1, zoty1, zotz1, zitx1, zity1, zitz1
@@ -2317,12 +2717,15 @@ CONTAINS
             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
-            IF( l_useCT )  THEN    ;   ztmp1(:,:) =eos_pt_from_ct( CASTSP(ts(:,:,1,jp_tem,Kmm)), CASTSP(ts(:,:,1,jp_sal,Kmm)) )
-            ELSE                   ;   ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)
+            IF( l_useCT )  THEN    
+                ztmp1(:,:) =eos_pt_from_ct( CASTSP(ts(:,:,1,jp_tem,Kmm)), CASTSP(ts(:,:,1,jp_sal,Kmm)) )
+            ELSE                   
+                ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)
             ENDIF
             !
             SELECT CASE( sn_snd_temp%cldes)
-            CASE( 'oce only'             )   ;   ztmp1(:,:) =   ztmp1(:,:) + rt0
+            CASE( 'oce only'             )   
+                ztmp1(:,:) =   ztmp1(:,:) + rt0
             CASE( 'oce and ice'          )   ;   ztmp1(:,:) =   ztmp1(:,:) + rt0
                SELECT CASE( sn_snd_temp%clcat )
                CASE( 'yes' )
@@ -2564,18 +2967,37 @@ CONTAINS
       !                                                      ! ------------------------- !
       !                                                      !  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 )
+      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 ) 
+      ENDIF 
+#if defined key_medusa 
+      !
+      IF (ln_medusa) THEN
+      !                                                      ! ---------------------------------------------- !
+      !                                                      !  CO2 flux, DMS and chlorophyll from MEDUSA     !
+      !                                                      ! ---------------------------------------------- !
+         IF ( ssnd(jps_bio_co2)%laction ) THEN
+            CALL cpl_snd( jps_bio_co2, isec, RESHAPE( CO2Flux_out_cpl, (/jpi,jpj,1/) ), info )
+         ENDIF
+
+         IF ( ssnd(jps_bio_dms)%laction )  THEN
+            CALL cpl_snd( jps_bio_dms, isec, RESHAPE( DMS_out_cpl, (/jpi,jpj,1/) ), info )
+         ENDIF
+
+         IF ( ssnd(jps_bio_chloro)%laction )  THEN
+            CALL cpl_snd( jps_bio_chloro, isec, RESHAPE( chloro_out_cpl, (/jpi,jpj,1/) ), info )
+         ENDIF
       ENDIF
       !
+#endif
       !                                                      ! ------------------------- !
       IF( ssnd(jps_ocx1)%laction ) THEN                      !      Surface current      !
          !                                                   ! ------------------------- !
          !
          !                                                  j+1   j     -----V---F
          ! surface velocity always sent from T point                     !       |
-         !                                                        j      |   T   U
+         !  [except for HadGEM3]                                  j      |   T   U
          !                                                               |       |
          !                                                   j    j-1   -I-------|
          !                                               (for I)         |       |
@@ -2587,11 +3009,19 @@ CONTAINS
          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) )
-               END_2D
-            CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T
+               IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN
+                  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) )
+                  END_2D
+               ELSE
+! Temporarily Changed for UKV
+                  DO_2D( 0, 0, 0, 0 )
+                        zotx1(ji,jj) = uu(ji,jj,1,Kmm)
+                        zoty1(ji,jj) = vv(ji,jj,1,Kmm)
+                  END_2D
+               ENDIF
+           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)
@@ -2607,6 +3037,7 @@ CONTAINS
                      &         + 0.5 * ( v_ice(ji,jj  )     + v_ice(ji  ,jj-1  )     ) *  fr_i(ji,jj)
                END_2D
             END SELECT
+               
             CALL lbc_lnk( 'sbccpl', zotx1, ssnd(jps_ocx1)%clgrid, -1.0_wp,  zoty1, ssnd(jps_ocy1)%clgrid, -1.0_wp )
             !
          ENDIF
@@ -2614,15 +3045,37 @@ CONTAINS
          !
          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
-            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(:,:)
+            IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN
+               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
+                  zity1(:,:) = ztmp2(:,:)
+               ENDIF
+            ELSE
+               ! Temporary code for HadGEM3 - will be removed eventually.
+               ! Only applies when we want uvel on U grid and vvel on V grid
+               ! Rotate U and V onto geographic grid before sending.
+	
+              DO_2D( 0, 0, 0, 0 )
+                     ztmp1(ji,jj)=0.25*vmask(ji,jj,1)                  &
+                          *(zotx1(ji,jj)+zotx1(ji-1,jj)    &
+                          +zotx1(ji,jj+1)+zotx1(ji-1,jj+1))
+                     ztmp2(ji,jj)=0.25*umask(ji,jj,1)                  &
+                          *(zoty1(ji,jj)+zoty1(ji+1,jj)    &
+                          +zoty1(ji,jj-1)+zoty1(ji+1,jj-1))
+               END_2D
+              
+               ! Ensure any N fold and wrap columns are updated
+               CALL lbc_lnk('zotx1', ztmp1, 'V', -1.0)
+               CALL lbc_lnk('zoty1', ztmp2, 'U', -1.0)
+	               
+               ikchoix = -1
+               CALL repcmo (zotx1,ztmp2,ztmp1,zoty1,zotx1,zoty1,ikchoix)
             ENDIF
          ENDIF
          !
@@ -2783,6 +3236,7 @@ CONTAINS
       IF( ssnd(jps_sstfrz)%laction )  CALL cpl_snd( jps_sstfrz, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info)
 #endif
       !
+      IF (ln_timing) CALL timing_stop('sbc_cpl_snd')
    END SUBROUTINE sbc_cpl_snd
 
    !!======================================================================
diff --git a/src/OCE/SBC/sbcrnf.F90 b/src/OCE/SBC/sbcrnf.F90
index 4ab71be21f9dfb0b380f3b0ee91024e7b62b7b40..abccf126bc0a37a51e7d1462546ea40523bba825 100644
--- a/src/OCE/SBC/sbcrnf.F90
+++ b/src/OCE/SBC/sbcrnf.F90
@@ -20,6 +20,7 @@ MODULE sbcrnf
    USE sbc_oce        ! surface boundary condition variables
    USE eosbn2         ! Equation Of State
    USE closea, ONLY: l_clo_rnf, clo_rnf ! closed seas
+   USE isf_oce
    !
    USE in_out_manager ! I/O manager
    USE fldread        ! read input field at current time step
@@ -40,8 +41,10 @@ MODULE sbcrnf
    LOGICAL                    ::      ln_rnf_depth_ini  !: depth       river runoffs  computed at the initialisation
    REAL(wp)                   ::      rn_rnf_max        !: maximum value of the runoff climatologie (ln_rnf_depth_ini =T)
    REAL(wp)                   ::      rn_dep_max        !: depth over which runoffs is spread       (ln_rnf_depth_ini =T)
+   REAL(wp)                   ::      tot_flux           !: total iceberg flux (temporary variable)
    INTEGER                    ::      nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0)
    LOGICAL           , PUBLIC ::   ln_rnf_icb        !: iceberg flux is specified in a file
+   LOGICAL                    ::   ln_icb_mass       !: Scale iceberg flux to match FW flux from coupled model
    LOGICAL                    ::   ln_rnf_tem        !: temperature river runoffs attribute specified in a file
    LOGICAL           , PUBLIC ::   ln_rnf_sal        !: salinity    river runoffs attribute specified in a file
    TYPE(FLD_N)       , PUBLIC ::   sn_rnf            !: information about the runoff file to be read
@@ -119,8 +122,8 @@ CONTAINS
       !
       IF( .NOT. l_rnfcpl )  THEN
                             CALL fld_read ( kt, nn_fsbc, sf_rnf   )    ! Read Runoffs data and provide it at kt ( runoffs + iceberg )
-         IF( ln_rnf_icb )   CALL fld_read ( kt, nn_fsbc, sf_i_rnf )    ! idem for iceberg flux if required
       ENDIF
+      IF(   ln_rnf_icb   )   CALL fld_read ( kt, nn_fsbc, sf_i_rnf )    ! idem for iceberg flux        if required
       IF(   ln_rnf_tem   )   CALL fld_read ( kt, nn_fsbc, sf_t_rnf )    ! idem for runoffs temperature if required
       IF(   ln_rnf_sal   )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required
       !
@@ -138,14 +141,57 @@ CONTAINS
                 CALL iom_put( 'hflx_icb_cea' , -fwficb(:,:) * rLfus )   ! output Heat Flux into Sea Water due to Iceberg Thermodynamics -->
              ENDIF
          ENDIF
-         !
+
+         IF( ln_rnf_icb ) THEN
+            fwficb(:,:) = rn_rfact * ( sf_i_rnf(1)%fnow(:,:,1) ) * tmask(:,:,1)  ! updated runoff value at time step kt
+            IF( ln_icb_mass ) THEN
+                ! Modify the Iceberg FW flux to be consistent with the change in
+                ! mass of the Antarctic/Greenland ice sheet for FW conservation in
+                ! coupled model. This isn't perfect as FW flux will go into ocean at
+                ! wrong time of year but more important to maintain FW balance
+                tot_flux = SUM(fwficb(:,:)*e1e2t(:,:)*tmask_i(:,:)*greenland_icesheet_mask(:,:)) !Need to multiply by area to convert to kg/s
+                IF( lk_mpp ) CALL mpp_sum( 'icbclv', tot_flux )
+                IF( tot_flux > rsmall ) THEN
+                    WHERE( greenland_icesheet_mask(:,:) == 1.0 )                                                                                 &
+                    &    fwficb(:,:) = fwficb(:,:) * greenland_icesheet_mass_rate_of_change * rn_greenland_calving_fraction &
+                    &                                     / tot_flux
+	                ELSE IF( rn_greenland_calving_fraction < rsmall ) THEN
+                    WHERE( greenland_icesheet_mask(:,:) == 1.0 ) fwficb(:,:) = 0.0
+                ELSE
+                    CALL CTL_STOP('STOP', 'No iceberg runoff data read in for Greenland. Check input file or set rn_greenland_calving_fraction=0.0')
+                ENDIF
+
+                tot_flux = SUM(fwficb(:,:)*e1e2t(:,:)*tmask_i(:,:)*antarctica_icesheet_mask(:,:))
+                IF( lk_mpp ) CALL mpp_sum( 'icbclv', tot_flux )
+                IF( tot_flux > rsmall ) THEN
+                    WHERE( antarctica_icesheet_mask(:,:) == 1.0 )                                                                                &
+                    &    fwficb(:,:) = fwficb(:,:) * antarctica_icesheet_mass_rate_of_change * rn_antarctica_calving_fraction &
+                    &                                     / (tot_flux  + 1.0e-10_wp )
+                ELSE IF( rn_antarctica_calving_fraction < rsmall ) THEN
+                    WHERE( antarctica_icesheet_mask(:,:) == 1.0 ) fwficb(:,:) = 0.0
+                ELSE
+                    CALL CTL_STOP('STOP', 'No iceberg runoff data read in for Antarctica. Check input file or set rn_antarctica_calving_fraction=0.0')
+                ENDIF
+            ENDIF
+            CALL lbc_lnk('sbcrnf',rnf,'T',1._wp,fwficb,'T',1._wp)
+            CALL iom_put( 'berg_melt'  , fwficb(:,:)  )          ! output iceberg flux
+            CALL iom_put( 'hflx_icb_cea' , fwficb(:,:) * rLfus )   ! output Heat Flux into Sea Water due to Iceberg Thermodynamics -->
+            rnf(:,:) = rnf(:,:) + fwficb(:,:)                      ! fwficb isn't used anywhere else so add it to runoff here
+            qns_tot(:,:) = qns_tot(:,:) - fwficb(:,:) * rLfus      ! TG: I think this is correct
+         ENDIF         !
+
          !                                                           ! set temperature & salinity content of runoffs
          IF( ln_rnf_tem ) THEN                                       ! use runoffs temperature data
             rnf_tsc(:,:,jp_tem) = ( sf_t_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rho0
             CALL eos_fzp( sss_m(:,:), ztfrz(:,:) )
             WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999._wp )             ! if missing data value use SST as runoffs temperature
-               rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rho0
+               rnf_tsc(:,:,jp_tem) = MAX( sst_m(:,:), 0.0_wp ) * rnf(:,:) * r1_rho0
+            END WHERE
+            WHERE( sf_t_rnf(1)%fnow(:,:,1) == -222._wp )
+            ! where fwf comes from melting of ice shelves or iceberg
+                rnf_tsc(:,:,jp_tem) = ztfrz(:,:) * rnf(:,:) * r1_rho0 - rnf(:,:) * rLfusisf * r1_rho0_rcp
             END WHERE
+
          ELSE                                                        ! use SST as runoffs temperature
             !CEOD River is fresh water so must at least be 0 unless we consider ice
             rnf_tsc(:,:,jp_tem) = MAX( sst_m(:,:), 0.0_wp ) * rnf(:,:) * r1_rho0
@@ -158,11 +204,15 @@ CONTAINS
          IF( iom_use('sflx_rnf_cea') )   CALL iom_put( 'sflx_rnf_cea', rnf_tsc(:,:,jp_sal) * rho0       )   ! output runoff salt flux (g/m2/s)
       ENDIF
       !
+
+      ! Make sure rnf is up to date!
+      call lbc_lnk('rnf_div', rnf, 'T', 1.0)
+
       !                                                ! ---------------------------------------- !
       IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    !
          !                                             ! ---------------------------------------- !
          IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN         !* Restart: read in restart file
-            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios
+            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields read in the restart file', lrxios
             CALL iom_get( numror, jpdom_auto, 'rnf_b'   , rnf_b                 )   ! before runoff
             CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem) )   ! before heat content of runoff
             CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal) )   ! before salinity content of runoff
@@ -259,7 +309,7 @@ CONTAINS
       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,   &
+      NAMELIST/namsbc_rnf/ cn_dir            , ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, ln_rnf_icb, ln_icb_mass, &
          &                 sn_rnf, sn_cnf    , sn_i_rnf, sn_s_rnf    , sn_t_rnf  , sn_dep_rnf,   &
          &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact,     &
          &                 ln_rnf_depth_ini  , rn_dep_max  , rn_rnf_max, nn_rnf_depth_file
@@ -318,21 +368,22 @@ CONTAINS
          IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) )
          CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf', no_print )
          !
-         IF( ln_rnf_icb ) THEN                      ! Create (if required) sf_i_rnf structure
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '          iceberg flux read in a file'
-            ALLOCATE( sf_i_rnf(1), STAT=ierror  )
-            IF( ierror > 0 ) THEN
-               CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_i_rnf structure' )   ;   RETURN
-            ENDIF
-            ALLOCATE( sf_i_rnf(1)%fnow(jpi,jpj,1)   )
-            IF( sn_i_rnf%ln_tint ) ALLOCATE( sf_i_rnf(1)%fdta(jpi,jpj,1,2) )
-            CALL fld_fill (sf_i_rnf, (/ sn_i_rnf /), cn_dir, 'sbc_rnf_init', 'read iceberg flux data', 'namsbc_rnf' )
-         ELSE
-            fwficb(:,:) = 0._wp
-         ENDIF
 
       ENDIF
+
+      IF( ln_rnf_icb ) THEN                      ! Create (if required) sf_i_rnf structure
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '          iceberg flux read in a file'
+         ALLOCATE( sf_i_rnf(1), STAT=ierror  )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_i_rnf structure' )   ;   RETURN
+         ENDIF
+         ALLOCATE( sf_i_rnf(1)%fnow(jpi,jpj,1)   )
+         IF( sn_i_rnf%ln_tint ) ALLOCATE( sf_i_rnf(1)%fdta(jpi,jpj,1,2) )
+         CALL fld_fill (sf_i_rnf, (/ sn_i_rnf /), cn_dir, 'sbc_rnf_init', 'read iceberg flux data', 'namsbc_rnf' )
+      ELSE
+         fwficb(:,:) = 0._wp
+      ENDIF
       !
       IF( ln_rnf_tem ) THEN                      ! Create (if required) sf_t_rnf structure
          IF(lwp) WRITE(numout,*)
diff --git a/src/OCE/SBC/sbcssm.F90 b/src/OCE/SBC/sbcssm.F90
index 39fc06d26959af3be52b97c36967f987330e737d..63567c9592e0ee2af52ff85c04ab564f7e474c6f 100644
--- a/src/OCE/SBC/sbcssm.F90
+++ b/src/OCE/SBC/sbcssm.F90
@@ -59,13 +59,28 @@ CONTAINS
       INTEGER  ::   ji, jj               ! loop index
       REAL(wp) ::   zcoef, zf_sbc       ! local scalar
       REAL(wp), DIMENSION(jpi,jpj,jpts) :: zts
-      !!---------------------------------------------------------------------
+      CHARACTER(len=4),SAVE :: stype 
+      !!--------------------------------------------------------------------- 
+      IF( kt == nit000 ) THEN 
+         IF( ln_TEOS10 ) THEN 
+            stype='abs'   ! teos-10: using absolute salinity (sst is converted to potential temperature for the surface module) 
+         ELSE IF( ln_EOS80  ) THEN 
+            stype='pra'   ! eos-80: using practical salinity 
+         ELSE IF ( ln_SEOS) THEN 
+            stype='seos' ! seos using Simplified Equation of state (sst is converted to potential temperature for the surface module) 
+         ENDIF 
+      ENDIF 
       !
       !                                        !* surface T-, U-, V- ocean level variables (T, S, depth, velocity)
       zts(:,:,jp_tem) = ts(:,:,1,jp_tem,Kmm)
       zts(:,:,jp_sal) = ts(:,:,1,jp_sal,Kmm)
       !
-         !                                                ! ---------------------------------------- !
+      !                                       !===>>> CAUTION: lbc_lnk is required on fraqsr_lev since sea ice computes on the full domain
+      !                                       !                otherwise restartability and reproducibility are broken 
+      !                                       !                computed in traqsr only on the inner domain 
+      CALL lbc_lnk( 'sbc_ssm', fraqsr_1lev(:,:), 'T', 1._wp )
+      !
+      !                                                   ! ---------------------------------------- !
       IF( nn_fsbc == 1 ) THEN                             !      Instantaneous surface fields        !
          !                                                ! ---------------------------------------- !
          ssu_m(:,:) = uu(:,:,1,Kbb)
@@ -171,8 +186,8 @@ CONTAINS
       IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   !
          CALL iom_put( 'ssu_m', ssu_m )
          CALL iom_put( 'ssv_m', ssv_m )
-         CALL iom_put( 'sst_m', sst_m )
-         CALL iom_put( 'sss_m', sss_m )
+         CALL iom_put( 'sst_m_pot', sst_m ) 
+         CALL iom_put( 'sss_m_'//stype, sss_m ) 
          CALL iom_put( 'ssh_m', ssh_m )
          CALL iom_put( 'e3t_m', e3t_m )
          CALL iom_put( 'frq_m', frq_m )
diff --git a/src/OCE/TRA/eosbn2.F90 b/src/OCE/TRA/eosbn2.F90
index e13b4c933c489690888c2db1f391b0ab41f5d3f8..9a35e5ecdbe1e2f0d76e4db5b5a18669cec25955 100644
--- a/src/OCE/TRA/eosbn2.F90
+++ b/src/OCE/TRA/eosbn2.F90
@@ -45,6 +45,7 @@ MODULE eosbn2
    !
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! for ctl_stop
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
    USE prtctl         ! Print control
    USE timing         ! Timing
 
diff --git a/src/OCE/TRA/traqsr.F90 b/src/OCE/TRA/traqsr.F90
index 16b534fae6dd73241adec58505e53679492cfb29..f759bc1844b48d54c788dc3fcec5221aafffb08c 100644
--- a/src/OCE/TRA/traqsr.F90
+++ b/src/OCE/TRA/traqsr.F90
@@ -48,6 +48,7 @@ MODULE traqsr
    LOGICAL , PUBLIC ::   ln_qsr_2bd   !: 2 band         light absorption flag
    LOGICAL , PUBLIC ::   ln_qsr_bio   !: bio-model      light absorption flag
    INTEGER , PUBLIC ::   nn_chldta    !: use Chlorophyll data (=1) or not (=0)
+   REAL(wp), PUBLIC ::   rn_chl_conc  !: Chlorophyll concentration (for nn_chldta=0)
    REAL(wp), PUBLIC ::   rn_abs       !: fraction absorbed in the very near surface (RGB & 2 bands)
    REAL(wp), PUBLIC ::   rn_si0       !: very near surface depth of extinction      (RGB & 2 bands)
    REAL(wp), PUBLIC ::   rn_si1       !: deepest depth of extinction (water type I)       (2 bands)
@@ -221,7 +222,7 @@ CONTAINS
                ztmp3d(ji,jj,jk) = 41 + 20.*LOG10(zchl) + 1.e-15
             END_3D
          ELSE                                !* constant chlorophyll
-            zchl = 0.05
+            zchl = rn_chl_conc
             ! 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
@@ -341,14 +342,14 @@ CONTAINS
       !!----------------------------------------------------------------------
       INTEGER  ::   ji, jj, jk                  ! dummy loop indices
       INTEGER  ::   ios, irgb, ierror, ioptio   ! local integer
-      REAL(wp) ::   zz0, zc0 , zc1, zcoef      ! local scalars
-      REAL(wp) ::   zz1, zc2 , zc3, zchl       !   -      -
+      REAL(wp) ::   zz0, zc0 , zc1, zcoef       ! local scalars
+      REAL(wp) ::   zz1, zc2 , zc3, zchl        !   -      -
       !
       CHARACTER(len=100) ::   cn_dir   ! Root directory for location of ssr files
       TYPE(FLD_N)        ::   sn_chl   ! informations about the chlorofyl field to be read
       !!
       NAMELIST/namtra_qsr/  sn_chl, cn_dir, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio,  &
-         &                  nn_chldta, rn_abs, rn_si0, rn_si1
+         &                  nn_chldta, rn_chl_conc, rn_abs, rn_si0, rn_si1
       !!----------------------------------------------------------------------
       !
       READ  ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901)
@@ -367,6 +368,7 @@ CONTAINS
          WRITE(numout,*) '      2 band               light penetration       ln_qsr_2bd = ', ln_qsr_2bd
          WRITE(numout,*) '      bio-model            light penetration       ln_qsr_bio = ', ln_qsr_bio
          WRITE(numout,*) '      RGB : Chl data (=1) or cst value (=0)        nn_chldta  = ', nn_chldta
+         WRITE(numout,*) '      Chlorophyll concentration (for nn_chldta=0)  rn_chl_conc = ', rn_chl_conc
          WRITE(numout,*) '      RGB & 2 bands: fraction of light (rn_si1)    rn_abs     = ', rn_abs
          WRITE(numout,*) '      RGB & 2 bands: shortess depth of extinction  rn_si0     = ', rn_si0
          WRITE(numout,*) '      2 bands: longest depth of extinction         rn_si1     = ', rn_si1
@@ -415,7 +417,7 @@ CONTAINS
                &           'Solar penetration function of read chlorophyll', 'namtra_qsr' , no_print )
          ENDIF
          IF( nqsr == np_RGB ) THEN                 ! constant Chl
-            IF(lwp) WRITE(numout,*) '   ==>>>   Constant Chlorophyll concentration = 0.05'
+            IF(lwp) WRITE(numout,*) '   ==>>>   Constant Chlorophyll concentration = ', rn_chl_conc
          ENDIF
          !
       CASE( np_2BD )                   !==  2 bands light penetration  ==!
diff --git a/src/OCE/ZDF/zdf_oce.F90 b/src/OCE/ZDF/zdf_oce.F90
index 40bcb56ce9b07a1c3ac51ffd51d45f310e0c64fa..bcb2d68c0fb07cb17f37b521787d340a89743648 100644
--- a/src/OCE/ZDF/zdf_oce.F90
+++ b/src/OCE/ZDF/zdf_oce.F90
@@ -39,6 +39,7 @@ MODULE zdf_oce
    !                             ! gravity wave-induced vertical mixing
    LOGICAL , PUBLIC ::   ln_zdfswm   !: surface  wave-induced mixing flag
    LOGICAL , PUBLIC ::   ln_zdfiwm   !: internal wave-induced mixing flag
+   LOGICAL , PUBLIC ::   ln_zdftmx   !: old tidal mixing scheme (Simmons et al 2004) 
    LOGICAL , PUBLIC ::   ln_zdfmfc   !: convection: eddy diffusivity Mass Flux Convection
    !                             ! coefficients
    REAL(wp), PUBLIC ::   rn_avm0     !: vertical eddy viscosity (m2/s)
diff --git a/src/OCE/ZDF/zdfmxl.F90 b/src/OCE/ZDF/zdfmxl.F90
index a2510884cdf25bfeca911ec303e9978a03ea7a77..f15ca2eac06d75b014dcab1d8a93471604e2faef 100644
--- a/src/OCE/ZDF/zdfmxl.F90
+++ b/src/OCE/ZDF/zdfmxl.F90
@@ -15,6 +15,7 @@ MODULE zdfmxl
    USE dom_oce        ! ocean space and time domain variables
    USE trc_oce  , ONLY: l_offline         ! ocean space and time domain variables
    USE zdf_oce        ! ocean vertical physics
+   USE eosbn2         ! for zdf_mxl_zint
    !
    USE in_out_manager ! I/O manager
    USE prtctl         ! Print control
@@ -26,15 +27,27 @@ MODULE zdfmxl
    PRIVATE
 
    PUBLIC   zdf_mxl, zdf_mxl_turb, zdf_mxl_alloc   ! called by zdfphy.F90
+   PUBLIC   zdf_mxl_zint                           ! called by diahth.F90
 
    INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   nmln    !: number of level in the mixed layer (used by LDF, ZDF, TRD, TOP)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmld    !: mixing layer depth (turbocline)      [m]   (used by TOP)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlp    !: mixed layer depth  (rho=rho0+zdcrit) [m]   (used by LDF)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlpt   !: depth of the last T-point inside the mixed layer [m] (used by LDF)
+   REAL(wp), PUBLIC, ALLOCATABLE,       DIMENSION(:,:) ::   hmld_zint  !: vertically-interpolated mixed layer depth   [m]
+   REAL(wp), PUBLIC, ALLOCATABLE,       DIMENSION(:,:) ::   htc_mld    ! Heat content of hmld_zint
+   LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)    :: ll_found   ! Is T_b to be found by interpolation ?
+   LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)  :: ll_belowml ! Flag points below mixed layer when ll_found=F
 
    REAL(wp), PUBLIC ::   rho_c = 0.01_wp    !: density criterion for mixed layer depth
    REAL(wp), PUBLIC ::   avt_c = 5.e-4_wp   ! Kz criterion for the turbocline depth
 
+   TYPE, PUBLIC :: MXL_ZINT   !: Structure for MLD defs
+      INTEGER   :: mld_type   ! mixed layer type     
+      REAL(wp)  :: zref       ! depth of initial T_ref
+      REAL(wp)  :: dT_crit    ! Critical temp diff
+      REAL(wp)  :: iso_frac   ! Fraction of rn_dT_crit 
+   END TYPE MXL_ZINT
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
 #  include "single_precision_substitute.h90"
@@ -52,7 +65,8 @@ CONTAINS
       !!----------------------------------------------------------------------
       zdf_mxl_alloc = 0      ! set to zero if no array to be allocated
       IF( .NOT. ALLOCATED( nmln ) ) THEN
-         ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), STAT= zdf_mxl_alloc )
+         ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), hmld_zint(jpi,jpj),     &
+   &          htc_mld(jpi,jpj), ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc )
          !
          CALL mpp_sum ( 'zdfmxl', zdf_mxl_alloc )
          IF( zdf_mxl_alloc /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl_alloc: failed to allocate arrays.' )
@@ -86,6 +100,8 @@ CONTAINS
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth'
             IF(lwp) WRITE(numout,*) '~~~~~~~ '
+            !                             ! allocate zdfmxl arrays
+            IF( zdf_mxl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl : unable to allocate arrays' )
          ENDIF
       ENDIF
       !
@@ -120,6 +136,352 @@ CONTAINS
       !
    END SUBROUTINE zdf_mxl
 
+   SUBROUTINE zdf_mxl_zint_mld( sf , Kmm) 
+      !!---------------------------------------------------------------------------------- 
+      !!                    ***  ROUTINE zdf_mxl_zint_mld  *** 
+      !                                                                        
+      !   Calculate vertically-interpolated mixed layer depth diagnostic. 
+      !            
+      !   This routine can calculate the mixed layer depth diagnostic suggested by
+      !   Kara et al, 2000, JGR, 105, 16803, but is more general and can calculate
+      !   vertically-interpolated mixed-layer depth diagnostics with other parameter
+      !   settings set in the namzdf_mldzint namelist.  
+      ! 
+      !   If mld_type=1 the mixed layer depth is calculated as the depth at which the  
+      !   density has increased by an amount equivalent to a temperature difference of  
+      !   0.8C at the surface. 
+      ! 
+      !   For other values of mld_type the mixed layer is calculated as the depth at  
+      !   which the temperature differs by 0.8C from the surface temperature.  
+      !                                                                        
+      !   David Acreman, Daley Calvert                                      
+      ! 
+      !!----------------------------------------------------------------------------------- 
+
+      TYPE(MXL_ZINT), INTENT(in)  :: sf
+      INTEGER, INTENT(in) ::   Kmm  ! ocean time level index
+
+      ! Diagnostic criteria
+      INTEGER   :: nn_mld_type   ! mixed layer type     
+      REAL(wp)  :: rn_zref       ! depth of initial T_ref
+      REAL(wp)  :: rn_dT_crit    ! Critical temp diff
+      REAL(wp)  :: rn_iso_frac   ! Fraction of rn_dT_crit used
+
+      ! Local variables
+      REAL(wp), PARAMETER :: zepsilon = 1.e-30          ! local small value
+      INTEGER, DIMENSION(jpi,jpj) :: ikmt          ! number of active tracer levels 
+      INTEGER, DIMENSION(jpi,jpj) :: ik_ref        ! index of reference level 
+      INTEGER, DIMENSION(jpi,jpj) :: ik_iso        ! index of last uniform temp level 
+      REAL, DIMENSION(jpi,jpj,jpk)  :: zT            ! Temperature or density 
+      REAL, DIMENSION(jpi,jpj)    :: ppzdep        ! depth for use in calculating d(rho) 
+      REAL, DIMENSION(jpi,jpj)    :: zT_ref        ! reference temperature 
+      REAL    :: zT_b                                   ! base temperature 
+      REAL, DIMENSION(jpi,jpj,jpk)  :: zdTdz         ! gradient of zT 
+      REAL, DIMENSION(jpi,jpj,jpk)  :: zmoddT        ! Absolute temperature difference 
+      REAL    :: zdz                                    ! depth difference 
+      REAL    :: zdT                                    ! temperature difference 
+      REAL, DIMENSION(jpi,jpj)    :: zdelta_T      ! difference critereon 
+      REAL, DIMENSION(jpi,jpj)    :: zRHO1, zRHO2  ! Densities 
+      INTEGER :: ji, jj, jk                             ! loop counter 
+
+      !!------------------------------------------------------------------------------------- 
+      !  
+      ! Unpack structure
+      nn_mld_type = sf%mld_type
+      rn_zref     = sf%zref
+      rn_dT_crit  = sf%dT_crit
+      rn_iso_frac = sf%iso_frac
+
+      ! Set the mixed layer depth criterion at each grid point 
+      IF( nn_mld_type == 0 ) THEN
+         zdelta_T(:,:) = rn_dT_crit
+         zT(:,:,:) = rhop(:,:,:)
+      ELSE IF( nn_mld_type == 1 ) THEN
+         ppzdep(:,:)=0.0 
+         call eos ( ts(:,:,1,:,Kmm), ppzdep(:,:), zRHO1(:,:) ) 
+! Use zT temporarily as a copy of tsn with rn_dT_crit added to SST 
+! [assumes number of tracers less than number of vertical levels] 
+         zT(:,:,1:jpts)=ts(:,:,1,1:jpts,Kmm) 
+         zT(:,:,jp_tem)=zT(:,:,1)+rn_dT_crit 
+         CALL eos( zT(:,:,1:jpts), ppzdep(:,:), zRHO2(:,:) ) 
+         zdelta_T(:,:) = abs( zRHO1(:,:) - zRHO2(:,:) ) * rho0 
+         ! RHO from eos (2d version) doesn't calculate north or east halo: 
+         CALL lbc_lnk( 'zdfmxl', zdelta_T, 'T', 1. ) 
+         zT(:,:,:) = rhop(:,:,:) 
+      ELSE 
+         zdelta_T(:,:) = rn_dT_crit                      
+         zT(:,:,:) = ts(:,:,:,jp_tem,Kmm)                           
+      END IF 
+
+      ! Calculate the gradient of zT and absolute difference for use later 
+      DO jk = 1 ,jpk-2 
+         zdTdz(:,:,jk)  =    ( zT(:,:,jk+1) - zT(:,:,jk) ) / e3w(:,:,jk+1,Kmm) 
+         zmoddT(:,:,jk) = abs( zT(:,:,jk+1) - zT(:,:,jk) ) 
+      END DO 
+
+      ! Find density/temperature at the reference level (Kara et al use 10m).          
+      ! ik_ref is the index of the box centre immediately above or at the reference level 
+      ! Find rn_zref in the array of model level depths and find the ref    
+      ! density/temperature by linear interpolation.                                   
+      DO jk = jpkm1, 2, -1 
+         WHERE ( gdept(:,:,jk,Kmm) > rn_zref ) 
+           ik_ref(:,:) = jk - 1 
+           zT_ref(:,:) = zT(:,:,jk-1) + zdTdz(:,:,jk-1) * ( rn_zref - gdept(:,:,jk-1,Kmm) ) 
+         END WHERE 
+      END DO 
+
+      ! If the first grid box centre is below the reference level then use the 
+      ! top model level to get zT_ref 
+      WHERE ( gdept(:,:,1,Kmm) > rn_zref )  
+         zT_ref = zT(:,:,1) 
+         ik_ref = 1 
+      END WHERE 
+
+      ! The number of active tracer levels is 1 less than the number of active w levels 
+      ikmt(:,:) = mbkt(:,:) - 1 
+
+      ! Initialize / reset
+      ll_found(:,:) = .false.
+
+      IF ( rn_iso_frac - zepsilon > 0. ) THEN
+         ! Search for a uniform density/temperature region where adjacent levels          
+         ! differ by less than rn_iso_frac * deltaT.                                      
+         ! ik_iso is the index of the last level in the uniform layer  
+         ! ll_found indicates whether the mixed layer depth can be found by interpolation 
+         ik_iso(:,:)   = ik_ref(:,:) 
+         DO jj = 1, jpj      ! Changed from nlcj
+            DO ji = 1, jpi   ! Changed from nlci
+!CDIR NOVECTOR 
+               DO jk = ik_ref(ji,jj), ikmt(ji,jj)-1 
+                  IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN 
+                     ik_iso(ji,jj)   = jk 
+                     ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) ) 
+                     EXIT 
+                  END IF 
+               END DO 
+            END DO 
+         END DO 
+
+         ! Use linear interpolation to find depth of mixed layer base where possible 
+         hmld_zint(:,:) = rn_zref 
+         DO jj = 1, jpj 
+            DO ji = 1, jpi 
+               IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN 
+                  zdz =  abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) ) 
+                  hmld_zint(ji,jj) = gdept(ji,jj,ik_iso(ji,jj),Kmm) + zdz 
+               END IF 
+            END DO 
+         END DO 
+      END IF
+
+      ! If ll_found = .false. then calculate MLD using difference of zdelta_T    
+      ! from the reference density/temperature 
+ 
+! Prevent this section from working on land points 
+      WHERE ( tmask(:,:,1) /= 1.0 ) 
+         ll_found = .true. 
+      END WHERE 
+ 
+      DO jk=1, jpk 
+         ll_belowml(:,:,jk) = abs( zT(:,:,jk) - zT_ref(:,:) ) >= zdelta_T(:,:)  
+      END DO 
+ 
+! Set default value where interpolation cannot be used (ll_found=false)  
+      DO jj = 1, jpj 
+         DO ji = 1, jpi 
+            IF ( .not. ll_found(ji,jj) )  hmld_zint(ji,jj) = gdept(ji,jj,ikmt(ji,jj),Kmm) 
+         END DO 
+      END DO 
+
+      DO jj = 1, jpj 
+         DO ji = 1, jpi 
+!CDIR NOVECTOR 
+            DO jk = ik_ref(ji,jj)+1, ikmt(ji,jj) 
+               IF ( ll_found(ji,jj) ) EXIT 
+               IF ( ll_belowml(ji,jj,jk) ) THEN                
+                  zT_b = zT_ref(ji,jj) + zdelta_T(ji,jj) * SIGN(1.0, zdTdz(ji,jj,jk-1) ) 
+                  zdT  = zT_b - zT(ji,jj,jk-1)                                      
+                  zdz  = zdT / zdTdz(ji,jj,jk-1)                                       
+                  hmld_zint(ji,jj) = gdept(ji,jj,jk-1,Kmm) + zdz 
+                  EXIT                                                   
+               END IF 
+            END DO 
+         END DO 
+      END DO 
+
+      hmld_zint(:,:) = hmld_zint(:,:)*tmask(:,:,1) 
+      !  
+   END SUBROUTINE zdf_mxl_zint_mld
+
+   SUBROUTINE zdf_mxl_zint_htc( kt , Kmm)
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE zdf_mxl_zint_htc  ***
+      !! 
+      !! ** Purpose :   
+      !!
+      !! ** Method  :   
+      !!----------------------------------------------------------------------
+
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      INTEGER, INTENT(in) ::   Kmm  ! ocean time level index
+
+      INTEGER :: ji, jj, jk
+      INTEGER :: ikmax
+      REAL(wp) :: zc, zcoef
+      !
+      INTEGER,  ALLOCATABLE, DIMENSION(:,:) ::   ilevel
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zthick_0, zthick
+
+      !!----------------------------------------------------------------------
+
+      IF( .NOT. ALLOCATED(ilevel) ) THEN
+         ALLOCATE( ilevel(jpi,jpj), zthick_0(jpi,jpj), &
+         &         zthick(jpi,jpj), STAT=ji )
+         IF( lk_mpp  )   CALL mpp_sum( 'zdfmxl', ji )
+         IF( ji /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl_zint_htc : unable to allocate arrays' )
+      ENDIF
+
+      ! Find last whole model T level above the MLD
+      ilevel(:,:)   = 0
+      zthick_0(:,:) = 0._wp
+
+      DO jk = 1, jpkm1  
+         DO jj = 1, jpj
+            DO ji = 1, jpi                    
+               zthick_0(ji,jj) = zthick_0(ji,jj) + e3t(ji,jj,jk,Kmm)
+               IF( zthick_0(ji,jj) < hmld_zint(ji,jj) )   ilevel(ji,jj) = jk
+            END DO
+         END DO
+         WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2)
+         WRITE(numout,*) 'gdepw(jk+1 =',jk+1,') =',gdepw(2,2,jk+1,Kmm)
+      END DO
+
+      ! Surface boundary condition
+      IF( ln_linssh ) THEN  ;   zthick(:,:) = ssh(:,:,Kmm)   ;   htc_mld(:,:) = ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) * tmask(:,:,1)   
+      ELSE                  ;   zthick(:,:) = 0._wp       ;   htc_mld(:,:) = 0._wp                                   
+      ENDIF
+
+      ! Deepest whole T level above the MLD
+      ikmax = MIN( MAXVAL( ilevel(:,:) ), jpkm1 )
+
+      ! Integration down to last whole model T level
+      DO jk = 1, ikmax
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zc = e3t(ji,jj,jk,Kmm) * REAL( MIN( MAX( 0, ilevel(ji,jj) - jk + 1 ) , 1  )  )    ! 0 below ilevel
+               zthick(ji,jj) = zthick(ji,jj) + zc
+               htc_mld(ji,jj) = htc_mld(ji,jj) + zc * ts(ji,jj,jk,jp_tem,Kmm) * tmask(ji,jj,jk)
+            END DO
+         END DO
+      END DO
+
+      ! Subsequent partial T level
+      zthick(:,:) = hmld_zint(:,:) - zthick(:,:)   !   remaining thickness to reach MLD
+
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            htc_mld(ji,jj) = htc_mld(ji,jj) + ts(ji,jj,ilevel(ji,jj)+1,jp_tem,Kmm)  & 
+      &                      * MIN( e3t(ji,jj,ilevel(ji,jj)+1,Kmm), zthick(ji,jj) ) * tmask(ji,jj,ilevel(ji,jj)+1)
+         END DO
+      END DO
+
+      WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2)
+
+      ! Convert to heat content
+      zcoef = rho0 * rcp
+      htc_mld(:,:) = zcoef * htc_mld(:,:)
+
+   END SUBROUTINE zdf_mxl_zint_htc
+
+   SUBROUTINE zdf_mxl_zint( kt , Kmm)
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE zdf_mxl_zint  ***
+      !! 
+      !! ** Purpose :   
+      !!
+      !! ** Method  :   
+      !!----------------------------------------------------------------------
+
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      INTEGER, INTENT(in) ::   Kmm  ! ocean time level index
+
+      INTEGER :: ios
+      INTEGER :: jn
+
+      INTEGER :: nn_mld_diag = 0    ! number of diagnostics
+
+      CHARACTER(len=1) :: cmld
+
+      LOGICAL, SAVE, DIMENSION(5) :: l_mld, l_htc
+
+      TYPE(MXL_ZINT) :: sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5
+      TYPE(MXL_ZINT), SAVE, DIMENSION(5) ::   mld_diags
+
+      NAMELIST/namzdf_mldzint/ nn_mld_diag, sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5
+
+      !!----------------------------------------------------------------------
+      
+      IF( kt == nit000 ) THEN
+         READ  ( numnam_ref, namzdf_mldzint, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_mldzint in reference namelist' )
+
+         READ  ( numnam_cfg, namzdf_mldzint, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_mldzint in configuration namelist' )
+         IF(lwm) WRITE ( numond, namzdf_mldzint )
+
+         IF( nn_mld_diag > 5 )   CALL ctl_stop( 'STOP', 'zdf_mxl_ini: Specify no more than 5 MLD definitions' )
+
+         l_mld(:) = .FALSE. ; l_htc(:) = .FALSE.
+
+         mld_diags(1) = sn_mld1
+         mld_diags(2) = sn_mld2
+         mld_diags(3) = sn_mld3
+         mld_diags(4) = sn_mld4
+         mld_diags(5) = sn_mld5
+
+         IF( nn_mld_diag > 0 ) THEN
+            IF( lwp ) THEN
+               WRITE(numout,*) '=============== Vertically-interpolated mixed layer ================'
+               WRITE(numout,*) '(Diagnostic number, nn_mld_type, rn_zref, rn_dT_crit, rn_iso_frac)'
+            ENDIF
+
+            DO jn = 1, nn_mld_diag
+               ! Whether the diagnostic is requested
+               WRITE(cmld,'(I1)') jn
+               IF( iom_use( "mldzint_"//cmld ) ) l_mld(jn) = .TRUE.
+               IF( iom_use( "mldhtc_"//cmld  ) ) l_htc(jn) = .TRUE.
+
+               IF( lwp ) THEN
+                  WRITE(numout,*) 'MLD criterion',jn,':'
+                  WRITE(numout,*) '    nn_mld_type =', mld_diags(jn)%mld_type
+                  WRITE(numout,*) '    rn_zref ='    , mld_diags(jn)%zref
+                  WRITE(numout,*) '    rn_dT_crit =' , mld_diags(jn)%dT_crit
+                  WRITE(numout,*) '    rn_iso_frac =', mld_diags(jn)%iso_frac
+               ENDIF
+            END DO
+            WRITE(numout,*) '===================================================================='
+         ENDIF
+      ENDIF
+
+      IF( nn_mld_diag > 0 ) THEN
+         DO jn = 1, nn_mld_diag
+            WRITE(cmld,'(I1)') jn
+
+            IF( l_mld(jn) .OR. l_htc(jn) ) THEN
+               CALL zdf_mxl_zint_mld( mld_diags(jn), Kmm)
+
+               IF( l_mld(jn) ) CALL iom_put( "mldzint_"//cmld, hmld_zint(:,:) )
+
+               IF( l_htc(jn) ) THEN
+                  CALL zdf_mxl_zint_htc( kt, Kmm )
+                  CALL iom_put( "mldhtc_"//cmld, htc_mld(:,:) )
+               ENDIF
+            ENDIF
+         END DO
+      ENDIF
+
+   END SUBROUTINE zdf_mxl_zint
+
 
    SUBROUTINE zdf_mxl_turb( kt, Kmm )
       !!----------------------------------------------------------------------
diff --git a/src/OCE/ZDF/zdfphy.F90 b/src/OCE/ZDF/zdfphy.F90
index 890e839f8ab5094cdc9dac7cedb4517120601fac..31062abaa4094f8342bfe22e03354f71e11b94da 100644
--- a/src/OCE/ZDF/zdfphy.F90
+++ b/src/OCE/ZDF/zdfphy.F90
@@ -24,6 +24,7 @@ MODULE zdfphy
    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 zdftmx         ! vertical physics: old tidal mixing scheme (Simmons et al 2004)
    USE zdfswm         ! vertical physics: surface  wave-induced mixing
    USE zdfmxl         ! vertical physics: mixed layer
    USE tranpc         ! convection: non penetrative adjustment
@@ -89,6 +90,7 @@ CONTAINS
          &             ln_zdfnpc, nn_npc , nn_npcp,                  &     ! convection : npc
          &             ln_zdfddm, rn_avts, rn_hsbfr,                 &     ! double diffusion
          &             ln_zdfswm,                                    &     ! surface  wave-induced mixing
+         &             ln_zdftmx,                                    &     ! old tidal mixing scheme (Simmons et al 2004)
          &             ln_zdfiwm,                                    &     ! internal  -      -      -
          &             ln_zad_Aimp,                                  &     ! apdative-implicit vertical advection
          &             rn_avm0, rn_avt0, nn_avb, nn_havtb                  ! coefficients
@@ -227,6 +229,7 @@ CONTAINS
       !
       !                          !== gravity wave-driven mixing  ==!
       IF( ln_zdfiwm )   CALL zdf_iwm_init       ! internal wave-driven mixing
+      IF( ln_zdftmx )   CALL zdf_tmx_init       ! old tidal mixing scheme (Simmons et al)
       IF( ln_zdfswm )   CALL zdf_swm_init       ! surface  wave-driven mixing
 
       !                          !== top/bottom friction  ==!
@@ -348,6 +351,7 @@ CONTAINS
       !                                         !* 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( ln_zdftmx )   CALL zdf_tmx( kt, Kmm, avm, avt, avs )        ! old tidal mixing scheme (Simmons et al 2004)
 
       !                                         !* Lateral boundary conditions (sign unchanged)
       IF(nn_hls==1) THEN
diff --git a/src/OCE/ZDF/zdftke.F90 b/src/OCE/ZDF/zdftke.F90
index a26df6b6a77d6afb85c38d66e08719adf28412bc..97e4817c6a72ac2ce6215fa5b642eb22344c4af8 100644
--- a/src/OCE/ZDF/zdftke.F90
+++ b/src/OCE/ZDF/zdftke.F90
@@ -84,6 +84,7 @@ MODULE zdftke
    REAL(wp) ::   rn_bshear ! background shear (>0) currently a numerical threshold (do not change it)
    INTEGER  ::   nn_etau   ! type of depth penetration of surface tke (=0/1/2/3)
    INTEGER  ::      nn_htau   ! type of tke profile of penetration (=0/1)
+   REAL(wp) ::      rn_htau_scaling   ! a acaling factor to apply to the penetration of TKE
    INTEGER  ::   nn_bc_surf! surface condition (0/1=Dir/Neum) ! Only applicable for wave coupling
    INTEGER  ::   nn_bc_bot ! surface condition (0/1=Dir/Neum) ! Only applicable for wave coupling
    REAL(wp) ::      rn_efr    ! fraction of TKE surface value which penetrates in the ocean
@@ -96,7 +97,7 @@ MODULE zdftke
    REAL(wp) ::   rhftau_add = 1.e-3_wp     ! add offset   applied to HF part of taum  (nn_etau=3)
    REAL(wp) ::   rhftau_scl = 1.0_wp       ! scale factor applied to HF part of taum  (nn_etau=3)
 
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htau    ! depth of tke penetration (nn_htau)
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:)   ::   htau    ! depth of tke penetration (nn_htau)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dissl   ! now mixing lenght of dissipation
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   apdlr   ! now mixing lenght of dissipation
 
@@ -733,6 +734,7 @@ CONTAINS
          &                 rn_emin0, rn_bshear, nn_mxl   , ln_mxl0  ,  &
          &                 rn_mxl0 , nn_mxlice, rn_mxlice,             &
          &                 nn_pdl  , ln_lc    , rn_lc    ,             &
+         &                 rn_htau_scaling    ,                        &
          &                 nn_etau , nn_htau  , rn_efr   , nn_eice  ,  &
          &                 nn_bc_surf, nn_bc_bot, ln_mxhsw
       !!----------------------------------------------------------------------
@@ -789,6 +791,7 @@ CONTAINS
          ENDIF
          WRITE(numout,*) '      test param. to add tke induced by wind      nn_etau   = ', nn_etau
          WRITE(numout,*) '          type of tke penetration profile            nn_htau   = ', nn_htau
+         WRITE(numout,*) '          scaling factor for tke penetration depth   rn_htau_scaling   = ', rn_htau_scaling
          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 )
@@ -819,7 +822,7 @@ CONTAINS
       !                               !* Check of some namelist values
       IF( nn_mxl  < 0   .OR.  nn_mxl  > 3 )   CALL ctl_stop( 'bad flag: nn_mxl is  0, 1, 2 or 3' )
       IF( nn_pdl  < 0   .OR.  nn_pdl  > 1 )   CALL ctl_stop( 'bad flag: nn_pdl is  0 or 1' )
-      IF( nn_htau < 0   .OR.  nn_htau > 1 )   CALL ctl_stop( 'bad flag: nn_htau is 0 or 1' )
+      IF( ( nn_htau < 0   .OR.  nn_htau > 1 ) .AND. nn_htau .NE. 4 .AND. nn_htau .NE. 5 )   CALL ctl_stop( 'bad flag: nn_htau is 0, 1 , 4 or 5 ' )
       IF( nn_etau == 3 .AND. .NOT. ln_cpl )   CALL ctl_stop( 'nn_etau == 3 : HF taum only known in coupled mode' )
       !
       IF( ln_mxl0 ) THEN
@@ -831,9 +834,24 @@ CONTAINS
       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
+            htau(:,:) = rn_htau_scaling*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(:,:) ) ) )   )
+         CASE( 4 )                                 ! F(latitude) : 0.5m to 10m/30m poleward of 13/40 degrees north/south
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+                  IF( gphit(ji,jj) <= 0._wp ) THEN
+                     htau(ji,jj) = MAX(  0.5_wp, MIN( 30._wp, 45._wp* rn_htau_scaling*ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   )
+                  ELSE
+                     htau(ji,jj) = MAX(  0.5_wp, MIN( 10._wp, 45._wp* rn_htau_scaling*ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   )
+                  ENDIF
+            END_2D
+         CASE( 5 )                                 ! Variation on case 4 with a steeper ramp further south in Southern Hemisphere
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
+                  htau(ji,jj) = MAX(  0.5_wp, MIN( 10._wp, 45._wp* rn_htau_scaling*ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   )
+                  IF( gphit(ji,jj) <= -40._wp ) THEN
+                      htau(ji,jj) = htau(ji,jj) + MIN( 20._wp, 135._wp * ABS( SIN( rpi/180._wp * (gphit(ji,jj) + 40.0) ) ) )
+                  ENDIF
+            END_2D
          END SELECT
       ENDIF
       !                                !* read or initialize all required files
diff --git a/src/OCE/ZDF/zdftmx.F90 b/src/OCE/ZDF/zdftmx.F90
new file mode 100644
index 0000000000000000000000000000000000000000..881dd0a1b9d31e5adc32b3877ff5c8e1afc94f2c
--- /dev/null
+++ b/src/OCE/ZDF/zdftmx.F90
@@ -0,0 +1,525 @@
+MODULE zdftmx
+   !!========================================================================
+   !!                       ***  MODULE  zdftmx  ***
+   !! Ocean physics: vertical tidal mixing coefficient
+   !!========================================================================
+   !! History :  1.0  !  2004-04  (L. Bessieres, G. Madec)  Original code
+   !!             -   !  2006-08  (A. Koch-Larrouy) Indonesian strait
+   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   'key_zdftmx'                                  Tidal vertical mixing
+   !!----------------------------------------------------------------------
+   !!   zdf_tmx       : global     momentum & tracer Kz with tidal induced Kz
+   !!   tmx_itf       : Indonesian momentum & tracer Kz with tidal induced Kz 
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers variables
+   USE dom_oce        ! ocean space and time domain variables
+   USE zdf_oce        ! ocean vertical physics variables
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE eosbn2         ! ocean equation of state
+   USE phycst         ! physical constants
+   USE prtctl         ! Print control
+   USE in_out_manager ! I/O manager
+   USE iom            ! I/O Manager
+   USE lib_mpp        ! MPP library
+   USE timing         ! Timing
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   zdf_tmx         ! called in step module 
+   PUBLIC   zdf_tmx_init    ! called in opa module 
+   PUBLIC   zdf_tmx_alloc   ! called in nemogcm module
+
+   LOGICAL, PUBLIC, PARAMETER ::   lk_zdftmx = .TRUE.    !: tidal mixing flag
+
+   !                       !!* Namelist  namzdf_tmx : tidal mixing *
+   REAL(wp) ::  rn_htmx     ! vertical decay scale for turbulence (meters)
+   REAL(wp) ::  rn_n2min    ! threshold of the Brunt-Vaisala frequency (s-1)
+   REAL(wp) ::  rn_tfe      ! tidal dissipation efficiency (St Laurent et al. 2002)
+   REAL(wp) ::  rn_me       ! mixing efficiency (Osborn 1980)
+   LOGICAL  ::  ln_tmx_itf  ! Indonesian Through Flow (ITF): Koch-Larrouy et al. (2007) parameterization
+   REAL(wp) ::  rn_tfe_itf  ! ITF tidal dissipation efficiency (St Laurent et al. 2002)
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   en_tmx     ! energy available for tidal mixing (W/m2)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   mask_itf   ! mask to use over Indonesian area
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   az_tmx     ! coefficient used to evaluate the tidal induced Kz
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id: zdftmx.F90 8788 2017-11-22 18:01:02Z davestorkey $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION zdf_tmx_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION zdf_tmx_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpk), STAT=zdf_tmx_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ('zdftmx', zdf_tmx_alloc )
+      IF( zdf_tmx_alloc /= 0 )   CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays')
+   END FUNCTION zdf_tmx_alloc
+
+
+   SUBROUTINE zdf_tmx( kt, Kmm, p_avm, p_avt, p_avs)
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE zdf_tmx  ***
+      !!                   
+      !! ** Purpose :   add to the vertical mixing coefficients the effect of
+      !!              tidal mixing (Simmons et al 2004).
+      !!
+      !! ** Method  : - tidal-induced vertical mixing is given by:
+      !!                  Kz_tides = az_tmx / max( rn_n2min, N^2 )
+      !!              where az_tmx is a coefficient that specified the 3D space 
+      !!              distribution of the faction of tidal energy taht is used
+      !!              for mixing. Its expression is set in zdf_tmx_init routine,
+      !!              following Simmons et al. 2004.
+      !!                NB: a specific bounding procedure is performed on av_tide
+      !!              so that the input tidal energy is actually almost used. The
+      !!              basic maximum value is 60 cm2/s, but values of 300 cm2/s 
+      !!              can be reached in area where bottom stratification is too 
+      !!              weak.
+      !!
+      !!              - update av_tide in the Indonesian Through Flow area
+      !!              following Koch-Larrouy et al. (2007) parameterisation
+      !!              (see tmx_itf routine).
+      !!
+      !!              - update the model vertical eddy viscosity and diffusivity: 
+      !!                     avt  = avt  +    av_tides
+      !!                     avm  = avm  +    av_tides
+      !!
+      !! ** Action  :   avt, avm   increased by tidal mixing
+      !!
+      !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263.
+      !!              Koch-Larrouy et al. 2007, GRL.
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt , Kmm  ! ocean time-step , time level
+      REAL(wp), DIMENSION(:,:,:) , INTENT(inout) ::   p_avm          ! momentum Kz (w-points)
+      REAL(wp), DIMENSION(:,:,:) , INTENT(inout) ::   p_avt, p_avs   ! tracer   Kz (w-points)
+      !!
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   ztpc         ! scalar workspace
+      REAL(wp), DIMENSION(jpi,jpj) ::   zkz
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zav_tide
+      !!----------------------------------------------------------------------
+      !
+      !                          ! ----------------------- !
+      !                          !  Standard tidal mixing  !  (compute zav_tide)
+      !                          ! ----------------------- !
+      !                             !* First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s
+      zav_tide(:,:,:) = MIN(  60.e-4, az_tmx(:,:,:) / MAX( rn_n2min, rn2(:,:,:) )  )
+
+      zkz(:,:) = 0.e0               !* Associated potential energy consummed over the whole water column
+      DO jk = 2, jpkm1
+         zkz(:,:) = zkz(:,:) + e3w(:,:,jk,Kmm) * MAX( 0.e0, rn2(:,:,jk) ) * rho0 * zav_tide(:,:,jk) * wmask(:,:,jk)
+      END DO
+
+      DO jj = 1, jpj                !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx
+         DO ji = 1, jpi
+            IF( zkz(ji,jj) /= 0.e0 )   zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj)
+         END DO
+      END DO
+
+      DO jk = 2, jpkm1     !* Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zav_tide bound by 300 cm2/s
+         DO jj = 1, jpj                !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx
+            DO ji = 1, jpi
+               zav_tide(ji,jj,jk) = zav_tide(ji,jj,jk) * MIN( zkz(ji,jj), 30./6. ) * wmask(ji,jj,jk)  !kz max = 300 cm2/s
+            END DO
+         END DO
+      END DO
+
+      IF( kt == nit000 ) THEN       !* check at first time-step: diagnose the energy consumed by zav_tide
+         ztpc = 0.e0
+         DO jk= 1, jpk
+            DO jj= 1, jpj
+               DO ji= 1, jpi
+                  ztpc = ztpc + e3w(ji,jj,jk,Kmm) * e1t(ji,jj) * e2t(ji,jj)   &
+                     &         * MAX( 0.e0, rn2(ji,jj,jk) ) * zav_tide(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj)
+               END DO
+            END DO
+         END DO
+         ztpc= rho0 / ( rn_tfe * rn_me ) * ztpc
+         IF(lwp) WRITE(numout,*) 
+         IF(lwp) WRITE(numout,*) '          N Total power consumption by av_tide    : ztpc = ', ztpc * 1.e-12 ,'TW'
+      ENDIF
+       
+      !                          ! ----------------------- !
+      !                          !    ITF  tidal mixing    !  (update zav_tide)
+      !                          ! ----------------------- !
+      IF( ln_tmx_itf )   CALL tmx_itf( kt, zav_tide , Kmm)
+
+      !                          ! ----------------------- !
+      !                          !   Update  mixing coefs  !                          
+      !                          ! ----------------------- !
+      DO jk = 2, jpkm1              !* update momentum & tracer diffusivity with tidal mixing
+         DO jj = 1, jpj                !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx
+            DO ji = 1, jpi
+               p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk)
+               p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk)
+               p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_tide(ji,jj,jk) * wmask(ji,jj,jk)
+            END DO
+         END DO
+      END DO
+      
+      !                             !* output tidal mixing coefficient
+      CALL iom_put( "av_tmx", zav_tide )
+
+      IF(sn_cfctl%l_prtctl)   CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=p_avt, clinfo2=' p_avt: ', kdim=jpk)
+      !
+   END SUBROUTINE zdf_tmx
+
+
+   SUBROUTINE tmx_itf( kt, pav , Kmm)
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tmx_itf  ***
+      !!                   
+      !! ** Purpose :   modify the vertical eddy diffusivity coefficients 
+      !!              (pav) in the Indonesian Through Flow area (ITF).
+      !!
+      !! ** Method  : - Following Koch-Larrouy et al. (2007), in the ITF defined
+      !!                by msk_itf (read in a file, see tmx_init), the tidal
+      !!                mixing coefficient is computed with :
+      !!                  * q=1 (i.e. all the tidal energy remains trapped in
+      !!                         the area and thus is used for mixing)
+      !!                  * the vertical distribution of the tifal energy is a
+      !!                    proportional to N above the thermocline (d(N^2)/dz > 0)
+      !!                    and to N^2 below the thermocline (d(N^2)/dz < 0)
+      !!
+      !! ** Action  :   av_tide   updated in the ITF area (msk_itf)
+      !!
+      !! References :  Koch-Larrouy et al. 2007, GRL 
+      !!----------------------------------------------------------------------
+      INTEGER , INTENT(in   )                         ::   kt, Kmm   ! ocean time-step
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pav  ! Tidal mixing coef.
+      !! 
+      INTEGER  ::   ji, jj, jk    ! dummy loop indices
+      REAL(wp) ::   zcoef, ztpc   ! temporary scalar
+      REAL(wp), DIMENSION(jpi,jpj)   ::   zkz                        ! 2D workspace
+      REAL(wp), DIMENSION(jpi,jpj)   ::   zsum1 , zsum2 , zsum       !  -      -
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zempba_3d_1, zempba_3d_2   ! 3D workspace
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zempba_3d  , zdn2dz        !  -      -
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zavt_itf                   !  -      -
+      !!----------------------------------------------------------------------
+      !
+      !                             ! compute the form function using N2 at each time step
+      zdn2dz     (:,:,jpk) = 0.e0
+      zempba_3d_1(:,:,jpk) = 0.e0
+      zempba_3d_2(:,:,jpk) = 0.e0
+      DO jk = 1, jpkm1             
+         zdn2dz     (:,:,jk) = rn2(:,:,jk) - rn2(:,:,jk+1)           ! Vertical profile of dN2/dz
+!CDIR NOVERRCHK
+         zempba_3d_1(:,:,jk) = SQRT(  MAX( 0.e0, rn2(:,:,jk) )  )    !    -        -    of N
+         zempba_3d_2(:,:,jk) =        MAX( 0.e0, rn2(:,:,jk) )       !    -        -    of N^2
+      END DO
+      !
+      zsum (:,:) = 0.e0
+      zsum1(:,:) = 0.e0
+      zsum2(:,:) = 0.e0
+      DO jk= 2, jpk
+         zsum1(:,:) = zsum1(:,:) + zempba_3d_1(:,:,jk) * e3w(:,:,jk,Kmm) * tmask(:,:,jk) * tmask(:,:,jk-1)
+         zsum2(:,:) = zsum2(:,:) + zempba_3d_2(:,:,jk) * e3w(:,:,jk,Kmm) * tmask(:,:,jk) * tmask(:,:,jk-1)               
+      END DO
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            IF( zsum1(ji,jj) /= 0.e0 )   zsum1(ji,jj) = 1.e0 / zsum1(ji,jj)
+            IF( zsum2(ji,jj) /= 0.e0 )   zsum2(ji,jj) = 1.e0 / zsum2(ji,jj)                
+         END DO
+      END DO
+
+      DO jk= 1, jpk
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zcoef = 0.5 - SIGN( 0.5, zdn2dz(ji,jj,jk) )       ! =0 if dN2/dz > 0, =1 otherwise 
+               ztpc  = zempba_3d_1(ji,jj,jk) * zsum1(ji,jj) *        zcoef     &
+                  &  + zempba_3d_2(ji,jj,jk) * zsum2(ji,jj) * ( 1. - zcoef )
+               !
+               zempba_3d(ji,jj,jk) =               ztpc 
+               zsum     (ji,jj)    = zsum(ji,jj) + ztpc * e3w(ji,jj,jk,Kmm)
+            END DO
+         END DO
+       END DO
+       DO jj = 1, jpj
+          DO ji = 1, jpi
+             IF( zsum(ji,jj) > 0.e0 )   zsum(ji,jj) = 1.e0 / zsum(ji,jj)                
+          END DO
+       END DO
+
+      !                             ! first estimation bounded by 10 cm2/s (with n2 bounded by rn_n2min) 
+      zcoef = rn_tfe_itf / ( rn_tfe * rho0 )
+      DO jk = 1, jpk
+         zavt_itf(:,:,jk) = MIN(  10.e-4, zcoef * en_tmx(:,:) * zsum(:,:) * zempba_3d(:,:,jk)   &
+            &                                      / MAX( rn_n2min, rn2(:,:,jk) ) * tmask(:,:,jk)  )
+      END DO           
+
+      zkz(:,:) = 0.e0               ! Associated potential energy consummed over the whole water column
+      DO jk = 2, jpkm1
+         zkz(:,:) = zkz(:,:) + e3w(:,:,jk,Kmm) * MAX( 0.e0, rn2(:,:,jk) ) * rho0 * zavt_itf(:,:,jk) * tmask(:,:,jk) * tmask(:,:,jk-1)
+      END DO
+
+      DO jj = 1, jpj                ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx
+         DO ji = 1, jpi
+            IF( zkz(ji,jj) /= 0.e0 )   zkz(ji,jj) = en_tmx(ji,jj) * rn_tfe_itf / rn_tfe / zkz(ji,jj)
+         END DO
+      END DO
+
+      DO jk = 2, jpkm1              ! Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zavt_itf bound by 300 cm2/s
+         zavt_itf(:,:,jk) = zavt_itf(:,:,jk) * MIN( zkz(:,:), 120./10. ) * tmask(:,:,jk) * tmask(:,:,jk-1)   ! kz max = 120 cm2/s
+      END DO
+
+      IF( kt == nit000 ) THEN       ! diagnose the nergy consumed by zavt_itf
+         ztpc = 0.e0
+         DO jk= 1, jpk
+            DO jj= 1, jpj
+               DO ji= 1, jpi
+                  ztpc = ztpc + e1t(ji,jj) * e2t(ji,jj) * e3w(ji,jj,jk,Kmm) * MAX( 0.e0, rn2(ji,jj,jk) )   &
+                     &                     * zavt_itf(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj)
+               END DO
+            END DO
+         END DO
+         ztpc= rho0 * ztpc / ( rn_me * rn_tfe_itf )
+         IF(lwp) WRITE(numout,*) '          N Total power consumption by zavt_itf: ztpc = ', ztpc * 1.e-12 ,'TW'
+      ENDIF
+
+      !                             ! Update pav with the ITF mixing coefficient
+      DO jk = 2, jpkm1
+         pav(:,:,jk) = pav     (:,:,jk) * ( 1.e0 - mask_itf(:,:) )   &
+            &        + zavt_itf(:,:,jk) *          mask_itf(:,:) 
+      END DO
+      !
+   END SUBROUTINE tmx_itf
+
+
+   SUBROUTINE zdf_tmx_init
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE zdf_tmx_init  ***
+      !!                     
+      !! ** Purpose :   Initialization of the vertical tidal mixing, Reading
+      !!              of M2 and K1 tidal energy in nc files
+      !!
+      !! ** Method  : - Read the namtmx namelist and check the parameters
+      !!
+      !!              - Read the input data in NetCDF files :
+      !!              M2 and K1 tidal energy. The total tidal energy, en_tmx, 
+      !!              is the sum of M2, K1 and S2 energy where S2 is assumed 
+      !!              to be: S2=(1/2)^2 * M2
+      !!              mask_itf, a mask array that determine where substituing 
+      !!              the standard Simmons et al. (2005) formulation with the
+      !!              one of Koch_Larrouy et al. (2007).
+      !!
+      !!              - Compute az_tmx, a 3D coefficient that allows to compute
+      !!             the standard tidal-induced vertical mixing as follows:
+      !!                  Kz_tides = az_tmx / max( rn_n2min, N^2 )
+      !!             with az_tmx a bottom intensified coefficient is given by:
+      !!                 az_tmx(z) = en_tmx / ( rho0 * rn_htmx ) * EXP( -(H-z)/rn_htmx )
+      !!                                                  / ( 1. - EXP( - H   /rn_htmx ) ) 
+      !!             where rn_htmx the characteristic length scale of the bottom 
+      !!             intensification, en_tmx the tidal energy, and H the ocean depth
+      !!
+      !! ** input   :   - Namlist namtmx
+      !!                - NetCDF file : M2_ORCA2.nc, K1_ORCA2.nc, and mask_itf.nc
+      !!
+      !! ** Action  : - Increase by 1 the nstop flag is setting problem encounter
+      !!              - defined az_tmx used to compute tidal-induced mixing
+      !!
+      !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263.
+      !!              Koch-Larrouy et al. 2007, GRL.
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      INTEGER  ::   inum         ! local integer
+      INTEGER  ::   ios
+      REAL(wp) ::   ztpc, ze_z   ! local scalars
+      REAL(wp), DIMENSION(jpi,jpj)   ::  zem2, zek1   ! read M2 and K1 tidal energy
+      REAL(wp), DIMENSION(jpi,jpj)   ::  zkz          ! total M2, K1 and S2 tidal energy
+      REAL(wp), DIMENSION(jpi,jpj)   ::  zfact        ! used for vertical structure function
+      REAL(wp), DIMENSION(jpi,jpj)   ::  zhdep        ! Ocean depth 
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zpc        ! power consumption
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zav_tide   ! tidal mixing coefficient
+      !!
+      NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf
+      !!----------------------------------------------------------------------
+      !
+      
+      ! Namelist namzdf_tmx in reference namelist : Tidal Mixing
+      READ  ( numnam_ref, namzdf_tmx, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist' )
+
+      ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing
+      READ  ( numnam_cfg, namzdf_tmx, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist' )
+      IF(lwm) WRITE ( numond, namzdf_tmx )
+
+      IF(lwp) THEN                   ! Control print
+         WRITE(numout,*)
+         WRITE(numout,*) 'zdf_tmx_init : tidal mixing'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namzdf_tmx : set tidal mixing parameters'
+         WRITE(numout,*) '      Vertical decay scale for turbulence   = ', rn_htmx 
+         WRITE(numout,*) '      Brunt-Vaisala frequency threshold     = ', rn_n2min
+         WRITE(numout,*) '      Tidal dissipation efficiency          = ', rn_tfe
+         WRITE(numout,*) '      Mixing efficiency                     = ', rn_me
+         WRITE(numout,*) '      ITF specific parameterisation         = ', ln_tmx_itf
+         WRITE(numout,*) '      ITF tidal dissipation efficiency      = ', rn_tfe_itf
+      ENDIF
+
+      !                              ! allocate tmx arrays
+      IF( zdf_tmx_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' )
+
+      IF( ln_tmx_itf ) THEN          ! read the Indonesian Through Flow mask
+         CALL iom_open('mask_itf',inum)
+         CALL iom_get (inum, jpdom_global, 'tmaskitf',mask_itf,1) ! 
+         CALL iom_close(inum)
+      ENDIF
+
+      ! read M2 tidal energy flux : W/m2  ( zem2 < 0 )
+      CALL iom_open('M2rowdrg',inum)
+      CALL iom_get (inum, jpdom_global, 'field',zem2,1) ! 
+      CALL iom_close(inum)
+
+      ! read K1 tidal energy flux : W/m2  ( zek1 < 0 )
+      CALL iom_open('K1rowdrg',inum)
+      CALL iom_get (inum, jpdom_global, 'field',zek1,1) ! 
+      CALL iom_close(inum)
+ 
+      ! Total tidal energy ( M2, S2 and K1  with S2=(1/2)^2 * M2 )
+      ! only the energy available for mixing is taken into account,
+      ! (mixing efficiency tidal dissipation efficiency)
+      en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * ssmask(:,:)
+
+!============
+!TG: Bug for VVL? Should this section be moved out of _init and be updated at every timestep?
+      ! Vertical structure (az_tmx)
+      DO jj = 1, jpj                ! part independent of the level
+         DO ji = 1, jpi
+            zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1)       ! depth of the ocean
+            zfact(ji,jj) = rho0 * rn_htmx * ( 1. - EXP( -zhdep(ji,jj) / rn_htmx ) )
+            IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = en_tmx(ji,jj) / zfact(ji,jj)
+         END DO
+      END DO
+      DO jk= 1, jpk                 ! complete with the level-dependent part
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               az_tmx(ji,jj,jk) = zfact(ji,jj) * EXP( -( zhdep(ji,jj)-gdepw_0(ji,jj,jk) ) / rn_htmx ) * tmask(ji,jj,jk)
+            END DO
+         END DO
+      END DO
+!===========
+
+      IF( lwp ) THEN
+         ! Control print
+         ! Total power consumption due to vertical mixing
+         ! zpc = rho0 * 1/rn_me * rn2 * zav_tide
+         zav_tide(:,:,:) = 0.e0
+         DO jk = 2, jpkm1
+            zav_tide(:,:,jk) = az_tmx(:,:,jk) / MAX( rn_n2min, rn2(:,:,jk) )
+         END DO
+
+         ztpc = 0.e0
+         zpc(:,:,:) = MAX(rn_n2min,rn2(:,:,:)) * zav_tide(:,:,:)
+         DO jk= 2, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ztpc = ztpc + e3w_0(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj)
+               END DO
+            END DO
+         END DO
+         ztpc= rho0 * 1/(rn_tfe * rn_me) * ztpc
+
+         WRITE(numout,*) 
+         WRITE(numout,*) '          Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW'
+
+
+         ! control print 2
+         zav_tide(:,:,:) = MIN( zav_tide(:,:,:), 60.e-4 )   
+         zkz(:,:) = 0.e0
+         DO jk = 2, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zkz(ji,jj) = zkz(ji,jj) + e3w_0(ji,jj,jk) * MAX(0.e0, rn2(ji,jj,jk)) * rho0 * zav_tide(ji,jj,jk) * wmask(ji,jj,jk)
+               END DO
+            END DO
+         END DO
+         ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               IF( zkz(ji,jj) /= 0.e0 )   THEN
+                   zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj)
+               ENDIF
+            END DO
+         END DO
+         ztpc = 1.e50
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               IF( zkz(ji,jj) /= 0.e0 )   THEN
+                   ztpc = Min( zkz(ji,jj), ztpc)
+               ENDIF
+            END DO
+         END DO
+         WRITE(numout,*) '          Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) )
+
+         DO jk = 2, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zav_tide(ji,jj,jk) = zav_tide(ji,jj,jk) * MIN( zkz(ji,jj), 30./6. ) * wmask(ji,jj,jk)  !kz max = 300 cm2/s
+               END DO
+            END DO
+         END DO
+         ztpc = 0.e0
+         zpc(:,:,:) = Max(0.e0,rn2(:,:,:)) * zav_tide(:,:,:)
+         DO jk= 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ztpc = ztpc + e3w_0(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj)
+               END DO
+            END DO
+         END DO
+         ztpc= rho0 * 1/(rn_tfe * rn_me) * ztpc
+         WRITE(numout,*) '          2 Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW'
+
+         DO jk = 1, jpk
+            ze_z =                  SUM( e1t(:,:) * e2t(:,:) * zav_tide(:,:,jk)     * tmask_i(:,:) )   &
+               &     / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) )
+            ztpc = 1.E50
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  IF( zav_tide(ji,jj,jk) /= 0.e0 )   ztpc =Min( ztpc, zav_tide(ji,jj,jk) )
+               END DO
+            END DO
+            WRITE(numout,*) '            N2 min - jk= ', jk,'   ', ze_z * 1.e4,' cm2/s min= ',ztpc*1.e4,   &
+               &       'max= ', MAXVAL(zav_tide(:,:,jk) )*1.e4, ' cm2/s'
+         END DO
+
+         WRITE(numout,*) '          e_tide : ', SUM( e1t*e2t*en_tmx ) / ( rn_tfe * rn_me ) * 1.e-12, 'TW'
+         WRITE(numout,*) 
+         WRITE(numout,*) '          Initial profile of tidal vertical mixing'
+         DO jk = 1, jpk
+            DO jj = 1,jpj
+               DO ji = 1,jpi
+                  zkz(ji,jj) = az_tmx(ji,jj,jk) /MAX( rn_n2min, rn2(ji,jj,jk) )
+               END DO
+            END DO
+            ze_z =                  SUM( e1t(:,:) * e2t(:,:) * zkz(:,:)     * tmask_i(:,:) )   &
+               &     / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) )
+            WRITE(numout,*) '                jk= ', jk,'   ', ze_z * 1.e4,' cm2/s'
+         END DO
+         DO jk = 1, jpk
+            zkz(:,:) = az_tmx(:,:,jk) /rn_n2min
+            ze_z =                  SUM( e1t(:,:) * e2t(:,:) * zkz(:,:)     * tmask_i(:,:) )   &
+               &     / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) )
+            WRITE(numout,*) 
+            WRITE(numout,*) '          N2 min - jk= ', jk,'   ', ze_z * 1.e4,' cm2/s min= ',MINVAL(zkz)*1.e4,   &
+               &       'max= ', MAXVAL(zkz)*1.e4, ' cm2/s'
+         END DO
+         !
+      ENDIF
+      !
+   END SUBROUTINE zdf_tmx_init
+
+   !!======================================================================
+END MODULE zdftmx
diff --git a/src/OCE/nemogcm.F90 b/src/OCE/nemogcm.F90
index 68fc8ddff9b62871f18c3bff2585619dc4ab0163..e8461cf9a1511e338c8af507cbbd0e54b459c994 100644
--- a/src/OCE/nemogcm.F90
+++ b/src/OCE/nemogcm.F90
@@ -73,6 +73,7 @@ MODULE nemogcm
    USE lib_mpp        ! distributed memory computing
    USE mppini         ! shared/distributed memory setting (mpp_init routine)
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
+   USE sbccpl 
    USE halo_mng       ! halo manager
 
    IMPLICIT NONE
@@ -176,6 +177,9 @@ CONTAINS
 #  if defined key_qco   ||   defined key_linssh
             CALL stp_MLF( istp )
 #  else
+	    IF (lk_oasis) THEN
+               CALL sbc_cpl_snd( istp, Nbb, Nnn )  ! Coupling to atmos
+            ENDIF
             CALL stp    ( istp )
 #  endif
             istp = istp + 1
@@ -262,7 +266,7 @@ CONTAINS
 #if defined key_xios
       IF( Agrif_Root() ) THEN
          IF( lk_oasis ) THEN
-            CALL cpl_init( "oceanx", ilocal_comm )                               ! nemo local communicator given by oasis
+            CALL cpl_init( "toyoce", ilocal_comm )                               ! nemo local communicator given by oasis
             CALL xios_initialize( "not used"       , local_comm =ilocal_comm )   ! send nemo communicator to xios
          ELSE
             CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios
@@ -272,7 +276,7 @@ CONTAINS
 #else
       IF( lk_oasis ) THEN
          IF( Agrif_Root() ) THEN
-            CALL cpl_init( "oceanx", ilocal_comm )          ! nemo local communicator given by oasis
+            CALL cpl_init( "toyoce", ilocal_comm )          ! nemo local communicator given by oasis
          ENDIF
          CALL mpp_start( ilocal_comm )
       ELSE
@@ -496,6 +500,11 @@ CONTAINS
       !
       IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA
       !
+
+      IF (nstop > 0) THEN
+         CALL CTL_STOP('STOP','Critical errors in NEMO initialisation')
+      END IF
+
       IF( ln_timing    )   CALL timing_stop( 'nemo_init')
       !
    END SUBROUTINE nemo_init
diff --git a/src/OCE/par_oce.F90 b/src/OCE/par_oce.F90
index f72dce4489875d625f007354ea52d9c622c951af..37ea7dad74988872bab14eaa6c4fcde6d458c81c 100644
--- a/src/OCE/par_oce.F90
+++ b/src/OCE/par_oce.F90
@@ -99,6 +99,12 @@ MODULE par_oce
    INTEGER, PUBLIC ::   Ni_0, Nj_0       !: local domain size without halo
    INTEGER, PUBLIC ::   Ni0glo, Nj0glo   !: global domain size without halo
 
+   INTEGER, PUBLIC ::   Nis0_ext             !: start I-index with wrap/N-fold
+   INTEGER, PUBLIC ::   Nie0_ext             !: end   I-index with wrap/N-fold
+   INTEGER, PUBLIC ::   Njs0_ext             !: start J-index with wrap/N-fold
+   INTEGER, PUBLIC ::   Nje0_ext             !: end   J-index with wrap/N-fold
+   INTEGER, PUBLIC ::   Ni_0_ext, Nj_0_ext       !: local domain size with wrap/N-fold
+   INTEGER, PUBLIC ::   Ni0glo_ext, Nj0glo_ext   !: global domain size with wrap/N-fold
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
    !! $Id: par_oce.F90 15119 2021-07-13 14:43:22Z jchanut $
diff --git a/src/OCE/step.F90 b/src/OCE/step.F90
index 35bbfc7e8e219689d13795da5830a1a4ed20120b..105b201092c7a852609dafab40acda4d02bed06c 100644
--- a/src/OCE/step.F90
+++ b/src/OCE/step.F90
@@ -90,7 +90,7 @@ CONTAINS
 #if defined key_agrif
       IF( nstop > 0 ) RETURN   ! avoid to go further if an error was detected during previous time step (child grid)
       kstp = nit000 + Agrif_Nb_Step()
-      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices
+      Kbb_a = Nbb; Nnn_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices
       IF( lk_agrif_debug ) THEN
          IF( Agrif_Root() .and. lwp)   WRITE(*,*) '---'
          IF(lwp)   WRITE(*,*) 'Grid Number', Agrif_Fixed(),' time step ', kstp, 'int tstep', Agrif_NbStepint()
@@ -172,6 +172,7 @@ CONTAINS
                          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
       ! lbc_lnk needed for zdf_sh2 when using nn_hls = 2, moved here to allow tiling in zdf_phy
       IF( nn_hls == 2 .AND. l_zdfsh2 ) CALL lbc_lnk( 'stp', avm_k, 'W', 1.0_wp )
@@ -296,6 +297,7 @@ CONTAINS
       IF( ln_diadct  )   CALL dia_dct   ( kstp,      Nnn )      ! Transports
                          CALL dia_ar5   ( kstp,      Nnn )      ! ar5 diag
                          CALL dia_ptr   ( kstp,      Nnn )      ! Poleward adv/ldf TRansports diagnostics
+                         CALL dia_prod  ( kstp,      Nnn )      ! ocean model: products
                          CALL dia_wri   ( kstp,      Nnn )      ! ocean model: outputs
       IF( ln_crs     )   CALL crs_fld   ( kstp,      Nnn )      ! ocean model: online field coarsening & output
       IF( lk_diadetide ) CALL dia_detide( kstp )                ! Weights computation for daily detiding of model diagnostics
@@ -396,7 +398,7 @@ CONTAINS
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! AGRIF recursive integration
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                         Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs      ! agrif_oce module copies of time level indices
+                         Kbb_a = Nbb; Nnn_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
 
 #endif
@@ -429,7 +431,7 @@ CONTAINS
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Coupled mode
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      IF( lk_oasis .AND. nstop == 0 )   CALL sbc_cpl_snd( kstp, Nbb, Nnn )     ! coupled mode : field exchanges
+      !!IF( lk_oasis .AND. nstop == 0 )   CALL sbc_cpl_snd( kstp, Nbb, Nnn )     ! coupled mode : field exchanges
       !
 #if defined key_xios
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
diff --git a/src/OCE/step_oce.F90 b/src/OCE/step_oce.F90
index 38dda2a2f2ba1abe6ac7fe4e1ac7c1bce38c08b8..5dab47657be67956a2b007c611c586aff16562ae 100644
--- a/src/OCE/step_oce.F90
+++ b/src/OCE/step_oce.F90
@@ -85,6 +85,7 @@ MODULE step_oce
    USE diahsb          ! heat, salt and volume budgets    (dia_hsb routine)
    USE diacfl          ! CFL diagnostics                  (dia_cfl routine)
    USE diaobs          ! Observation operator             (dia_obs routine)
+   USE diaprod
    USE diadetide       ! Weights computation for daily detiding of model diagnostics
    USE diamlr          ! IOM context management for multiple-linear-regression analysis
    USE flo_oce         ! floats variables
diff --git a/src/SAS/sbcssm.F90 b/src/SAS/sbcssm.F90
index bd72a97a2fce97df86563d71cf83918224b12e7f..487f50f5f60c2d6ed271447b32849c93e733b208 100644
--- a/src/SAS/sbcssm.F90
+++ b/src/SAS/sbcssm.F90
@@ -79,9 +79,19 @@ CONTAINS
       INTEGER  ::   ji, jj     ! 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
+      CHARACTER(len=4),SAVE :: stype
       !!----------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start( 'sbc_ssm')
+      IF( kt == nit000 ) THEN
+         IF( ln_TEOS10 ) THEN
+            stype='abs'   ! teos-10: using absolute salinity (sst is converted to potential temperature for the surface module)
+         ELSE IF( ln_EOS80  ) THEN
+            stype='pra'   ! eos-80: using practical salinity
+         ELSE IF ( ln_SEOS) THEN
+            stype='seos' ! seos using Simplified Equation of state (sst is converted to potential temperature for the surface module)
+         ENDIF
+      ENDIF
 
       IF ( l_sasread ) THEN
          IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d )      !==   read data at kt time step   ==!
@@ -156,8 +166,8 @@ CONTAINS
       IF( l_initdone ) THEN          !   Mean value at each nn_fsbc time-step   !
          CALL iom_put( 'ssu_m', ssu_m )
          CALL iom_put( 'ssv_m', ssv_m )
-         CALL iom_put( 'sst_m', sst_m )
-         CALL iom_put( 'sss_m', sss_m )
+         CALL iom_put( 'sst_m_pot', sst_m )
+         CALL iom_put( 'sss_m_'//stype, sss_m )
          CALL iom_put( 'ssh_m', ssh_m )
          CALL iom_put( 'e3t_m', e3t_m )
          IF( ln_read_frq    )   CALL iom_put( 'frq_m', frq_m )