Index: /CONFIG/UNIFORM/v6/IPSLCM6/AA_make
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/AA_make	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/AA_make	(revision 2878)
@@ -94,5 +94,5 @@
 
 orca1lim3: ../../modeles/NEMOGCM/CONFIG
-	(cd ../../modeles/NEMOGCM/CONFIG ; cp ../../../config/IPSLCM6/SOURCES/NEMO/*.*90 ORCA1_LIM3_PISCES/MY_SRC/ ; cp ../../../config/IPSLCM6/SOURCES/NEMO/arch-${FCM_ARCH}.fcm ../ARCH/. ; cp ../../../config/IPSLCM6/SOURCES/NEMO/*.cfg ../TOOLS/COMPILE/. ; ./makenemo -m ${FCM_ARCH} -n ORCA1_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC TOP_SRC" -j16 add_key "key_oasis3 key_top key_pisces key_diahth"  del_key "key_mpp_rep key_nosignedzero                  " ; cp ORCA1_LIM3_PISCES/BLD/bin/nemo.exe ../../../bin/opa ; )
+	(cd ../../modeles/NEMOGCM/CONFIG ; cp ../../../config/IPSLCM6/SOURCES/NEMO/*.*90 ORCA1_LIM3_PISCES/MY_SRC/ ; cp ../../../config/IPSLCM6/SOURCES/NEMO/arch-${FCM_ARCH}.fcm ../ARCH/. ; cp ../../../config/IPSLCM6/SOURCES/NEMO/*.cfg ../TOOLS/COMPILE/. ; ./makenemo -m ${FCM_ARCH} -n ORCA1_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC TOP_SRC" -j16 add_key "key_oasis3 key_diahth"  del_key "key_mpp_rep key_nosignedzero                  " ; cp ORCA1_LIM3_PISCES/BLD/bin/nemo.exe ../../../bin/opa ; )
 
 orca1lim3nopisces: ../../modeles/NEMOGCM/CONFIG
Index: /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/pdControl/COMP/opa9.card
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/pdControl/COMP/opa9.card	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/pdControl/COMP/opa9.card	(revision 2878)
@@ -26,4 +26,9 @@
             (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/merged_ESACCI_BIOMER4V1R1_CHL_REG05.nc               ,  . ), \
             (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/weights_reg05_2_eorca1_bilinear.nc                   ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_bot.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_pyc.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_cri.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/decay_scale_bot.nc                                   ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/decay_scale_cri.nc                                   ,  . ), \
 	    (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/vosaline_360x180-ORCA1_WOA13_climatemonth.nc         , sali_ref_clim_monthly.nc )
 
Index: /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/piControl/COMP/opa9.card
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/piControl/COMP/opa9.card	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/EXPERIMENTS/IPSLCM/piControl/COMP/opa9.card	(revision 2878)
@@ -26,4 +26,9 @@
             (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/merged_ESACCI_BIOMER4V1R1_CHL_REG05.nc               ,  . ), \
             (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/weights_reg05_2_eorca1_bilinear.nc                   ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_bot.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_pyc.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/mixing_power_cri.nc                                  ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/decay_scale_bot.nc                                   ,  . ), \
+            (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/decay_scale_cri.nc                                   ,  . ), \
 	    (${R_IN}/OCE/IPSLCM6/${opa9_UserChoices_ORCA_version}/vosaline_360x180-ORCA1_WOA13_climatemonth.nc         , sali_ref_clim_monthly.nc )
 
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/field_def_nemo.xml
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/field_def_nemo.xml	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/field_def_nemo.xml	(revision 2878)
@@ -259,5 +259,7 @@
          <field id="v_imasstr"    long_name="Sea-ice mass transport along j-axis"                          standard_name="sea_ice_y_transport"                                unit="kg/s"         />
          <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" />
-         <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />        
+         <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />   
+         <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" />
+         <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" />     
        
          <field id="iceconc"      long_name="ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="%"            />
@@ -311,4 +313,5 @@
          <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/day" />
          <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/day" />
+         <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/day" />
          <field id="sfx"          long_name="salt flux total"                                              unit="1e-3*kg/m2/day" />
 
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-opa.xml
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-opa.xml	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-opa.xml	(revision 2878)
@@ -37,11 +37,11 @@
        
         <file id="file2" name_suffix="_scalar" description="scalar variables" enabled=".true." >
-      <field field_ref="voltot"  grid_ref="grid_1point"     name="scvoltot"  />
-      <field field_ref="sshtot"  grid_ref="grid_1point"     name="scsshtot"  />
-      <field field_ref="sshsteric" grid_ref="grid_1point"   name="scsshste"  />
-      <field field_ref="sshthster" grid_ref="grid_1point"   name="scsshtst"  />
-      <field field_ref="masstot"   grid_ref="grid_1point"   name="scmastot"  />
-      <field field_ref="temptot"   grid_ref="grid_1point"   name="sctemtot"  />
-      <field field_ref="saltot"    grid_ref="grid_1point"   name="scsaltot"  />
+           <field field_ref="voltot"      grid_ref="grid_1point"     name="scvoltot"  />
+           <field field_ref="sshtot"      grid_ref="grid_1point"     name="scsshtot"  />
+           <field field_ref="sshsteric"   grid_ref="grid_1point"   name="scsshste"  />
+           <field field_ref="sshthster"   grid_ref="grid_1point"   name="scsshtst"  />
+           <field field_ref="masstot"     grid_ref="grid_1point"   name="scmastot"  />
+           <field field_ref="temptot"     grid_ref="grid_1point"   name="sctemtot"  />
+           <field field_ref="saltot"      grid_ref="grid_1point"   name="scsaltot"  />
 
           <field field_ref="bgtemper"     grid_ref="grid_1point" name="bgtemper"    />
@@ -179,4 +179,10 @@
       <!-- <field field_ref="28d"           level="1" /> -->
       <field field_ref="hc300"         level="1" />
+      <!-- next variables are additional for PISCES offline-->
+          <field field_ref="hdiv"         name="hdivtr"   long_name="horizontal divergence transport"      operation="average" freq_op="1mo" > @hdiv * @e3t </field>
+          <field field_ref="wspd"         name="windsp"  />
+          <field field_ref="empbmr"       name="wfob"     long_name="water_flux_into_sea_water at prev time-step"    />
+          <field field_ref="fmmflx"       name="fmmflx"  />
+          <field field_ref="iceconc"      name="siconc"  />
         </file>
 
@@ -186,4 +192,6 @@
 	  <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity" operation="average" freq_op="1mo" > @uoce_e3u / @e3u </field>
 	  <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" />
+          <field field_ref="uocetr_eff"   name="uocetr_eff"  />
+          <field field_ref="ahu_bbl"       />
       <!-- available with key_diaar5 -->
       <field field_ref="u_masstr"     name="vozomatr"  />
@@ -197,4 +205,6 @@
 	  <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity" operation="average" freq_op="1mo" > @voce_e3v / @e3v </field>
 	  <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" />
+          <field field_ref="vocetr_eff"   name="vocetr_eff"  />
+          <field field_ref="ahv_bbl"       />
       <!-- available with key_diaar5 -->
       <field field_ref="v_masstr"     name="vomematr"  />
@@ -208,4 +218,7 @@
 	  <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" />
 	  <field field_ref="w_masstr"     name="vovematr"  />
+          <field field_ref="logavs"       name="difvsolog"  long_name="ocean_vertical_salt_diffusivity" operation="average" freq_op="1mo" > exp( @logavs ) </field>
+          <field field_ref="aht2d"        name="ahtt"   />
+          <field field_ref="aht2d_eiv"    name="aeiv"   />
 	</file>
 
@@ -374,4 +387,11 @@
       <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" />
       <field field_ref="wocetr_eff"   name="wocetr_eff"  />
+      <field field_ref="avt_evd"      name="avt_evd"    />
+      <field field_ref="av_wave"      name="av_wave"    />
+      <field field_ref="bn2"          name="bn2"        />
+      <field field_ref="bflx_tmx"     name="bflx_tmx"   />
+      <field field_ref="pcmap_tmx"    name="pcmap_tmx"  />
+      <field field_ref="emix_tmx"     name="emix_tmx"   />
+      <field field_ref="av_ratio"     name="av_ratio"   />
     </file>
 
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-pisces.xml
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-pisces.xml	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/file_def_nemo-pisces.xml	(revision 2878)
@@ -146,5 +146,4 @@
         <field field_ref="EPCAL100"  name="EPCAL100"  />
         <field field_ref="xfracal"   name="xfracal"  />
-        <field field_ref="GRAZ1"     name="GRAZT" operation="average" freq_op="1y" > @GRAZ1 + @GRAZ2 </field> 
     </file>
 
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/namelist_ORCA1_cfg
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/namelist_ORCA1_cfg	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/PARAM/namelist_ORCA1_cfg	(revision 2878)
@@ -129,5 +129,7 @@
    sn_chl      ='merged_ESACCI_BIOMER4V1R1_CHL_REG05',  -1  , 'CHLA' , .true. , .true. , 'yearly' , 'weights_reg05_2_eorca1_bilinear.nc' , '' , ''
    ln_traqsr   = .true.    !  Light penetration (T) or not (F)
-   nn_chldta   =      2    !  RGB : 2D Chl data (=1), 3D Chl data (=2) or cst value (=0)
+   ln_qsr_rgb  = .false.   !  RGB (Red-Green-Blue) light penetration
+   ln_qsr_2bd  = .false.   !  2 bands              light penetration
+   ln_qsr_bio  = .true.    !  bio-model light penetration
 /
 !-----------------------------------------------------------------------
@@ -346,4 +348,11 @@
 /
 !-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+   nn_zpyc     = 2         !  pycnocline-intensified dissipation scales as N (=1) or N^2 (=2)
+   ln_mevar    = .true.    !  variable (T) or constant (F) mixing efficiency
+   ln_tsdiff   = .true.    !  account for differential T/S mixing (T) or not (F)
+/
+!-----------------------------------------------------------------------
 &namsol        !   elliptic solver / island / free surface
 !-----------------------------------------------------------------------
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA1.cfg
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA1.cfg	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA1.cfg	(revision 2878)
@@ -39,12 +39,11 @@
 #  field | files patterns | files additionnal  | operations | title | units | calcul of area
 #-----------------------------------------------------------------------------------------------------------------
+ no3_global  | "NO3"      | "eORCA1.1_grid.nc"  | "(NO3[d=1,k=1])"               | "Nitrate Concentration at surface"      | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ dic_global  | "DIC"      | "eORCA1.1_grid.nc"  | "(DIC[d=1,k=1])"               | "DIC Concentration at surface"          | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ alk_global  | "Alkalini" | "eORCA1.1_grid.nc"  | "(Alkalini[d=1,k=1])"          | "Alkalinity Concentration  at surface"  | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ o2_global   | "O2"       | "eORCA1.1_grid.nc"  | "(O2[d=1,k=1])"                | "Oxygen Concentration at surface"       | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ si_global   | "Si"       | "eORCA1.1_grid.nc"  | "(Si[d=1,k=1])"                | "Silicate Concentration at surface"     | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ po4_global  | "PO4"      | "eORCA1.1_grid.nc"  | "(PO4[d=1,k=1])"               | "Phosphorus Concentration  at surface"  | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ cflx_global | "Cflx"     | "eORCA1.1_grid.nc"  | "(Cflx[d=1]*3600*24*365*12)"   | "Ocean carbon flux (GLOBAL)"            | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
+ epc_global  | "EPC100"   | "eORCA1.1_grid.nc"  | "(EPC100[d=1]*3600*24*365*12)" | "Carbon export at 100m (GLOBAL)"        | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
 #-----------------------------------------------------------------------------------------------------------------
- no3_global  | "NO3"      | "eORCA1.1_grid.nc"  | "(NO3[d=1])"                   | "Nitrate Concentration (GLOBAL)"      | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- dic_global  | "DIC"      | "eORCA1.1_grid.nc"  | "(DIC[d=1])"                   | "DIC Concentration (GLOBAL)"          | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- alk_global  | "Alkalini" | "eORCA1.1_grid.nc"  | "(Alkalini[d=1])"              | "Alkalinity Concentration (GLOBAL)"   | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- o2_global   | "O2"       | "eORCA1.1_grid.nc"  | "(O2[d=1])"                    | "Oxygen Concentration (GLOBAL)"       | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- si_global   | "Si"       | "eORCA1.1_grid.nc"  | "(Si[d=1])"                    | "Silicate Concentration (GLOBAL)"     | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- po4_global  | "PO4"      | "eORCA1.1_grid.nc"  | "(PO4[d=1])"                   | "Phosphorus Concentration (GLOBAL)"   | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- cflx_global | "Cflx"     | "eORCA1.1_grid.nc"  | "(Cflx[d=1]*3600*24*365*12)"   | "Ocean carbon flux (GLOBAL)"          | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
- epc_global  | "EPC100"   | "eORCA1.1_grid.nc"  | "(EPC100[d=1]*3600*24*365*12)" | "Carbon export at 100m (GLOBAL)"      | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
-#-----------------------------------------------------------------------------------------------------------------
Index: /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA2.cfg
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA2.cfg	(revision 2877)
+++ /CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/POST/monitoring01_pisces_ORCA2.cfg	(revision 2878)
@@ -39,11 +39,11 @@
 #  field | files patterns | files additionnal  | operations | title | units | calcul of area
 #-----------------------------------------------------------------------------------------------------------------
- no3_global  | "NO3"      | "ORCA2.3_grid.nc"  | "(NO3[d=1])"                   | "Nitrate Concentration (GLOBAL)"      | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- dic_global  | "DIC"      | "ORCA2.3_grid.nc"  | "(DIC[d=1])"                   | "DIC Concentration (GLOBAL)"          | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- alk_global  | "Alkalini" | "ORCA2.3_grid.nc"  | "(Alkalini[d=1])"              | "Alkalinity Concentration (GLOBAL)"   | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- o2_global   | "O2"       | "ORCA2.3_grid.nc"  | "(O2[d=1])"                    | "Oxygen Concentration (GLOBAL)"       | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- si_global   | "Si"       | "ORCA2.3_grid.nc"  | "(Si[d=1])"                    | "Silicate Concentration (GLOBAL)"     | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- po4_global  | "PO4"      | "ORCA2.3_grid.nc"  | "(PO4[d=1])"                   | "Phosphorus Concentration (GLOBAL)"   | "mmol/m3"    | "mask[d=2]*volume[d=2]"
- cflx_global | "Cflx"     | "ORCA2.3_grid.nc"  | "(Cflx[d=1]*3600*24*365*12)"   | "Ocean carbon flux (GLOBAL)"          | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
- epc_global  | "EPC100"   | "ORCA2.3_grid.nc"  | "(EPC100[d=1]*3600*24*365*12)" | "Carbon export at 100m (GLOBAL)"      | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
+ no3_global  | "NO3"      | "ORCA2.3_grid.nc"  | "(NO3[d=1,k=1])"               | "Nitrate Concentration at surface"      | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ dic_global  | "DIC"      | "ORCA2.3_grid.nc"  | "(DIC[d=1,k=1])"               | "DIC Concentration at surface"          | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ alk_global  | "Alkalini" | "ORCA2.3_grid.nc"  | "(Alkalini[d=1,k=1])"          | "Alkalinity Concentration  at surface"  | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ o2_global   | "O2"       | "ORCA2.3_grid.nc"  | "(O2[d=1,k=1])"                | "Oxygen Concentration at surface"       | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ si_global   | "Si"       | "ORCA2.3_grid.nc"  | "(Si[d=1,k=1])"                | "Silicate Concentration at surface"     | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ po4_global  | "PO4"      | "ORCA2.3_grid.nc"  | "(PO4[d=1,k=1])"               | "Phosphorus Concentration  at surface"  | "mmol/m3"    | "mask[d=2,k=1]*area[d=2]"
+ cflx_global | "Cflx"     | "ORCA2.3_grid.nc"  | "(Cflx[d=1]*3600*24*365*12)"   | "Ocean carbon flux (GLOBAL)"            | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
+ epc_global  | "EPC100"   | "ORCA2.3_grid.nc"  | "(EPC100[d=1]*3600*24*365*12)" | "Carbon export at 100m (GLOBAL)"        | "gC/m2/yr"   | "mask[k=1,d=2]*area[d=2]"
 #-----------------------------------------------------------------------------------------------------------------
Index: NFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/diaar5.F90
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/diaar5.F90	(revision 2877)
+++ 	(revision )
@@ -1,274 +1,0 @@
-MODULE diaar5
-   !!======================================================================
-   !!                       ***  MODULE  diaar5  ***
-   !! AR5 diagnostics
-   !!======================================================================
-   !! History :  3.2  !  2009-11  (S. Masson)  Original code
-   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA
-   !!----------------------------------------------------------------------
-#if defined key_diaar5   || defined key_esopa
-   !!----------------------------------------------------------------------
-   !!   'key_diaar5'  :                           activate ar5 diagnotics
-   !!----------------------------------------------------------------------
-   !!   dia_ar5       : AR5 diagnostics
-   !!   dia_ar5_init  : initialisation of AR5 diagnostics
-   !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and active tracers 
-   USE dom_oce        ! ocean space and time domain
-   USE eosbn2         ! equation of state                (eos_bn2 routine)
-   USE lib_mpp        ! distribued memory computing library
-   USE iom            ! I/O manager library
-   USE timing         ! preformance summary
-   USE wrk_nemo       ! working arrays
-   USE fldread        ! type FLD_N
-   USE phycst         ! physical constant
-   USE in_out_manager  ! I/O manager
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   dia_ar5        ! routine called in step.F90 module
-   PUBLIC   dia_ar5_init   ! routine called in opa.F90 module
-   PUBLIC   dia_ar5_alloc  ! routine called in nemogcm.F90 module
-
-   LOGICAL, PUBLIC, PARAMETER :: lk_diaar5 = .TRUE.   ! coupled flag
-
-   REAL(wp)                         ::   vol0         ! ocean volume (interior domain)
-   REAL(wp)                         ::   area_tot     ! total ocean surface (interior domain)
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   area         ! cell surface (interior domain)
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   thick0       ! ocean thickness (interior domain)
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sn0          ! initial salinity
-      
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id: diaar5.F90 5253 2015-05-05 12:46:46Z diovino $
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   FUNCTION dia_ar5_alloc()
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE dia_ar5_alloc  ***
-      !!----------------------------------------------------------------------
-      INTEGER :: dia_ar5_alloc
-      !!----------------------------------------------------------------------
-      !
-      ALLOCATE( area(jpi,jpj), thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc )
-      !
-      IF( lk_mpp             )   CALL mpp_sum ( dia_ar5_alloc )
-      IF( dia_ar5_alloc /= 0 )   CALL ctl_warn('dia_ar5_alloc: failed to allocate arrays')
-      !
-   END FUNCTION dia_ar5_alloc
-
-
-   SUBROUTINE dia_ar5( kt )
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE dia_ar5  ***
-      !!
-      !! ** Purpose :   compute and output some AR5 diagnostics
-      !!----------------------------------------------------------------------
-      !
-      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
-      !
-      INTEGER  ::   ji, jj, jk                      ! dummy loop arguments
-      REAL(wp) ::   zvolssh, zvol, zssh_steric, zztmp, zarho, ztemp, zsal, zmass
-      !
-      REAL(wp), POINTER, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace 
-      REAL(wp), POINTER, DIMENSION(:,:,:)   :: zrhd , zrhop               ! 3D workspace
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace
-      !!--------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('dia_ar5')
- 
-      CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres )
-      CALL wrk_alloc( jpi , jpj , jpk        , zrhd      , zrhop    )
-      CALL wrk_alloc( jpi , jpj , jpk , jpts , ztsn                 )
-
-      zarea_ssh(:,:) = area(:,:) * sshn(:,:)
-
-      !                                         ! total volume of liquid seawater
-      zvolssh = SUM( zarea_ssh(:,:) ) 
-      IF( lk_mpp )   CALL mpp_sum( zvolssh )
-      zvol = vol0 + zvolssh
-      
-      CALL iom_put( 'voltot', zvol               )
-      CALL iom_put( 'sshtot', zvolssh / area_tot )
-
-      !                     
-      ztsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem)                    ! thermosteric ssh
-      ztsn(:,:,:,jp_sal) = sn0(:,:,:)
-      CALL eos( ztsn, zrhd, fsdept_n(:,:,:) )                       ! now in situ density using initial salinity
-      !
-      zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
-      DO jk = 1, jpkm1
-         zbotpres(:,:) = zbotpres(:,:) + fse3t(:,:,jk) * zrhd(:,:,jk)
-      END DO
-      IF( .NOT.lk_vvl ) THEN
-         IF ( ln_isfcav ) THEN
-            DO ji=1,jpi
-               DO jj=1,jpj
-                  zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj)
-               END DO
-            END DO
-         ELSE
-            zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
-         END IF
-      END IF
-      !                                         
-      zarho = SUM( area(:,:) * zbotpres(:,:) ) 
-      IF( lk_mpp )   CALL mpp_sum( zarho )
-      zssh_steric = - zarho / area_tot
-      CALL iom_put( 'sshthster', zssh_steric )
-      
-      !                                         ! steric sea surface height
-      CALL eos( tsn, zrhd, zrhop, fsdept_n(:,:,:) )                 ! now in situ and potential density
-      zrhop(:,:,jpk) = 0._wp
-      CALL iom_put( 'rhop', zrhop )
-      !
-      zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
-      DO jk = 1, jpkm1
-         zbotpres(:,:) = zbotpres(:,:) + fse3t(:,:,jk) * zrhd(:,:,jk)
-      END DO
-      IF( .NOT.lk_vvl ) THEN
-         IF ( ln_isfcav ) THEN
-            DO ji=1,jpi
-               DO jj=1,jpj
-                  zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj)
-               END DO
-            END DO
-         ELSE
-            zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
-         END IF
-      END IF
-      !    
-      zarho = SUM( area(:,:) * zbotpres(:,:) ) 
-      IF( lk_mpp )   CALL mpp_sum( zarho )
-      zssh_steric = - zarho / area_tot
-      CALL iom_put( 'sshsteric', zssh_steric )
-      
-      !                                         ! ocean bottom pressure
-      zztmp = rau0 * grav * 1.e-4_wp               ! recover pressure from pressure anomaly and cover to dbar = 1.e4 Pa
-      zbotpres(:,:) = zztmp * ( zbotpres(:,:) + sshn(:,:) + thick0(:,:) )
-      CALL iom_put( 'botpres', zbotpres )
-
-      !                                         ! Mean density anomalie, temperature and salinity
-      ztemp = 0._wp
-      zsal  = 0._wp
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zztmp = area(ji,jj) * fse3t(ji,jj,jk)
-               ztemp = ztemp + zztmp * tsn(ji,jj,jk,jp_tem)
-               zsal  = zsal  + zztmp * tsn(ji,jj,jk,jp_sal)
-            END DO
-         END DO
-      END DO
-      IF( .NOT.lk_vvl ) THEN
-         IF ( ln_isfcav ) THEN
-            DO ji=1,jpi
-               DO jj=1,jpj
-                  ztemp = ztemp + zarea_ssh(ji,jj) * tsn(ji,jj,mikt(ji,jj),jp_tem) 
-                  zsal  = zsal  + zarea_ssh(ji,jj) * tsn(ji,jj,mikt(ji,jj),jp_sal) 
-               END DO
-            END DO
-         ELSE
-            ztemp = ztemp + SUM( zarea_ssh(:,:) * tsn(:,:,1,jp_tem) )
-            zsal  = zsal  + SUM( zarea_ssh(:,:) * tsn(:,:,1,jp_sal) )
-         END IF
-      ENDIF
-      IF( lk_mpp ) THEN  
-         CALL mpp_sum( ztemp )
-         CALL mpp_sum( zsal  )
-      END IF
-      !
-      zmass = rau0 * ( zarho + zvol )                 ! total mass of liquid seawater
-      ztemp = ztemp / zvol                            ! potential temperature in liquid seawater
-      zsal  = zsal  / zvol                            ! Salinity of liquid seawater
-      !
-      CALL iom_put( 'masstot', zmass )
-      CALL iom_put( 'temptot', ztemp )
-      CALL iom_put( 'saltot' , zsal  )
-      !
-      CALL wrk_dealloc( jpi , jpj              , zarea_ssh , zbotpres )
-      CALL wrk_dealloc( jpi , jpj , jpk        , zrhd      , zrhop    )
-      CALL wrk_dealloc( jpi , jpj , jpk , jpts , ztsn                 )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_ar5')
-      !
-   END SUBROUTINE dia_ar5
-
-
-   SUBROUTINE dia_ar5_init
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dia_ar5_init  ***
-      !!                   
-      !! ** Purpose :   initialization for AR5 diagnostic computation
-      !!----------------------------------------------------------------------
-      INTEGER  ::   inum
-      INTEGER  ::   ik
-      INTEGER  ::   ji, jj, jk  ! dummy loop indices
-      REAL(wp) ::   zztmp  
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zsaldta   ! Jan/Dec levitus salinity
-      !
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('dia_ar5_init')
-      !
-      CALL wrk_alloc( jpi, jpj, jpk, 2, zsaldta )
-      !                                      ! allocate dia_ar5 arrays
-      IF( dia_ar5_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' )
-
-      area(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:)
-
-      area_tot = SUM( area(:,:) )   ;   IF( lk_mpp )   CALL mpp_sum( area_tot )
-
-      vol0        = 0._wp
-      thick0(:,:) = 0._wp
-      DO jk = 1, jpkm1
-         vol0        = vol0        + SUM( area (:,:) * tmask(:,:,jk) * e3t_0(:,:,jk) )
-         thick0(:,:) = thick0(:,:) +    tmask_i(:,:) * tmask(:,:,jk) * e3t_0(:,:,jk)
-      END DO
-      IF( lk_mpp )   CALL mpp_sum( vol0 )
-
-      CALL iom_open ( 'sali_ref_clim_monthly', inum )
-      CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,1), 1  )
-      CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,2), 12 )
-      CALL iom_close( inum )
-
-      sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )        
-      sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:)
-      IF( ln_zps ) THEN               ! z-coord. partial steps
-         DO jj = 1, jpj               ! interpolation of salinity at the last ocean level (i.e. the partial step)
-            DO ji = 1, jpi
-               ik = mbkt(ji,jj)
-               IF( ik > 1 ) THEN
-                  zztmp = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
-                  sn0(ji,jj,ik) = ( 1._wp - zztmp ) * sn0(ji,jj,ik) + zztmp * sn0(ji,jj,ik-1)
-               ENDIF
-            END DO
-         END DO
-      ENDIF
-      !
-      CALL wrk_dealloc( jpi, jpj, jpk, 2, zsaldta )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_ar5_init')
-      !
-   END SUBROUTINE dia_ar5_init
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option :                                         NO diaar5
-   !!----------------------------------------------------------------------
-   LOGICAL, PUBLIC, PARAMETER :: lk_diaar5 = .FALSE.   ! coupled flag
-CONTAINS
-   SUBROUTINE dia_ar5_init    ! Dummy routine
-   END SUBROUTINE dia_ar5_init
-   SUBROUTINE dia_ar5( kt )   ! Empty routine
-      INTEGER ::   kt
-      WRITE(*,*) 'dia_ar5: You should not have seen this print! error?', kt
-   END SUBROUTINE dia_ar5
-#endif
-
-   !!======================================================================
-END MODULE diaar5
Index: NFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcdmp.F90
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcdmp.F90	(revision 2877)
+++ 	(revision )
@@ -1,375 +1,0 @@
-MODULE trcdmp
-   !!======================================================================
-   !!                       ***  MODULE  trcdmp  ***
-   !! Ocean physics: internal restoring trend on passive tracers
-   !!======================================================================
-   !! History :  OPA  !  1991-03  (O. Marti, G. Madec)  Original code
-   !!                 !  1996-01  (G. Madec) statement function for e3
-   !!                 !  1997-05  (H. Loukos)  adapted for passive tracers
-   !!    NEMO    9.0  !  2004-03  (C. Ethe)    free form + modules
-   !!            3.2  !  2007-02  (C. Deltel)  Diagnose ML trends for passive tracers
-   !!            3.3  !  2010-06  (C. Ethe, G. Madec) merge TRA-TRC 
-   !!----------------------------------------------------------------------
-#if  defined key_top 
-   !!----------------------------------------------------------------------
-   !!   trc_dmp      : update the tracer trend with the internal damping
-   !!   trc_dmp_init : initialization, namlist read, parameters control
-   !!----------------------------------------------------------------------
-   USE oce_trc         ! ocean dynamics and tracers variables
-   USE trc             ! ocean passive tracers variables
-   USE trcnam_trp      ! passive tracers transport namelist variables
-   USE trcdta
-   USE tradmp
-   USE prtctl_trc      ! Print control for debbuging
-   USE trdtra
-   USE trd_oce
-   USE iom
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC trc_dmp            ! routine called by step.F90
-   PUBLIC trc_dmp_clo        ! routine called by step.F90
-   PUBLIC trc_dmp_alloc      ! routine called by nemogcm.F90
-
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1)
-
-   INTEGER, PARAMETER           ::   npncts   = 8        ! number of closed sea
-   INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j)
-   INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j)
-
-   !! * Substitutions
-#  include "top_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id: trcdmp.F90 6308 2016-02-12 11:32:54Z cetlod $ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   INTEGER FUNCTION trc_dmp_alloc()
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE trc_dmp_alloc  ***
-      !!----------------------------------------------------------------------
-      ALLOCATE( restotr(jpi,jpj,jpk) , STAT=trc_dmp_alloc )
-      !
-      IF( trc_dmp_alloc /= 0 )   CALL ctl_warn('trc_dmp_alloc: failed to allocate array')
-      !
-   END FUNCTION trc_dmp_alloc
-
-
-   SUBROUTINE trc_dmp( kt )
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE trc_dmp  ***
-      !!                  
-      !! ** Purpose :   Compute the passive tracer trend due to a newtonian damping
-      !!      of the tracer field towards given data field and add it to the
-      !!      general tracer trends.
-      !!
-      !! ** Method  :   Newtonian damping towards trdta computed 
-      !!      and add to the general tracer trends:
-      !!                     trn = tra + restotr * (trdta - trb)
-      !!         The trend is computed either throughout the water column
-      !!      (nlmdmptr=0) or in area of weak vertical mixing (nlmdmptr=1) or
-      !!      below the well mixed layer (nlmdmptr=2)
-      !!
-      !! ** Action  : - update the tracer trends tra with the newtonian 
-      !!                damping trends.
-      !!              - save the trends ('key_trdmxl_trc')
-      !!----------------------------------------------------------------------
-      !!
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      !!
-      INTEGER  ::   ji, jj, jk, jn, jl       ! dummy loop indices
-      REAL(wp) ::   ztra                 ! temporary scalars
-      CHARACTER (len=22) :: charout
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrtrd
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 3D  workspace
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dmp')
-      !
-      ! 0. Initialization (first time-step only)
-      !    --------------
-      IF( kt == nittrc000 ) CALL trc_dmp_init
-
-      IF( l_trdtrc )   CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )   ! temporary save of trends
-      !
-      IF( nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
-         !
-         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
-         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000
-         !                                                          ! ===========
-         DO jn = 1, jptra                                           ! tracer loop
-            !                                                       ! ===========
-            IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends 
-            !
-            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-               jl = n_trc_index(jn) 
-               SELECT CASE ( nn_zdmp_tr )
-               !
-               CASE( 0 )                !==  newtonian damping throughout the water column  ==!
-                  DO jk = 1, jpkm1
-                     DO jj = 2, jpjm1
-                        DO ji = fs_2, fs_jpim1   ! vector opt.
-                           ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
-                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
-                        END DO
-                     END DO
-                  END DO
-               !
-               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==!
-                  DO jk = 1, jpkm1
-                     DO jj = 2, jpjm1
-                        DO ji = fs_2, fs_jpim1   ! vector opt.
-                           IF( avt(ji,jj,jk) <= 5.e-4_wp )  THEN 
-                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
-                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
-                           ENDIF
-                        END DO
-                     END DO
-                  END DO
-               !
-               CASE ( 2 )               !==  no damping in the mixed layer   ==! 
-                  DO jk = 1, jpkm1
-                     DO jj = 2, jpjm1
-                        DO ji = fs_2, fs_jpim1   ! vector opt.
-                           IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN
-                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
-                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
-                           END IF
-                        END DO
-                     END DO
-                  END DO
-               !  
-               END SELECT
-               ! 
-            ENDIF
-            !
-            IF( l_trdtrc ) THEN
-               ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:)
-               CALL trd_tra( kt, 'TRC', jn, jptra_dmp, ztrtrd )
-            END IF
-            !                                                       ! ===========
-         END DO                                                     ! tracer loop
-         !                                                          ! ===========
-         CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
-      ENDIF
-      !
-      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
-      !                                          ! print mean trends (used for debugging)
-      IF( ln_ctl )   THEN
-         WRITE(charout, FMT="('dmp ')") ;  CALL prt_ctl_trc_info(charout)
-                                           CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
-      ENDIF
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dmp')
-      !
-   END SUBROUTINE trc_dmp
-
-   SUBROUTINE trc_dmp_clo( kt )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE trc_dmp_clo  ***
-      !!
-      !! ** Purpose :   Closed sea domain initialization
-      !!
-      !! ** Method  :   if a closed sea is located only in a model grid point
-      !!                we restore to initial data
-      !!
-      !! ** Action  :   nctsi1(), nctsj1() : south-west closed sea limits (i,j)
-      !!                nctsi2(), nctsj2() : north-east Closed sea limits (i,j)
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      !
-      INTEGER :: ji , jj, jk, jn, jl, jc                     ! dummy loop indicesa
-      INTEGER :: isrow                                      ! local index
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 3D  workspace
-
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         ! initial values
-         nctsi1(:) = 1  ;  nctsi2(:) = 1
-         nctsj1(:) = 1  ;  nctsj2(:) = 1
-
-         ! set the closed seas (in data domain indices)
-         ! -------------------
-
-         IF( cp_cfg == "orca" ) THEN
-            !
-            SELECT CASE ( jp_cfg )
-            !                                           ! =======================
-            CASE ( 1 )                                  ! eORCA_R1 configuration
-            !                                           ! =======================
-            isrow = 332 - jpjglo
-            !
-                                                        ! Caspian Sea
-            nctsi1(1)   = 333  ; nctsj1(1)   = 243 - isrow
-            nctsi2(1)   = 342  ; nctsj2(1)   = 274 - isrow
-            !                                           ! Lake Superior
-            nctsi1(2)   = 198  ; nctsj1(2)   = 258 - isrow
-            nctsi2(2)   = 204  ; nctsj2(2)   = 262 - isrow
-            !                                           ! Lake Michigan
-            nctsi1(3)   = 201  ; nctsj1(3)   = 250 - isrow
-            nctsi2(3)   = 203  ; nctsj2(3)   = 256 - isrow
-            !                                           ! Lake Huron
-            nctsi1(4)   = 204  ; nctsj1(4)   = 252 - isrow
-            nctsi2(4)   = 209  ; nctsj2(4)   = 256 - isrow
-            !                                           ! Lake Erie
-            nctsi1(5)   = 206  ; nctsj1(5)   = 249 - isrow
-            nctsi2(5)   = 209  ; nctsj2(5)   = 251 - isrow
-            !                                           ! Lake Ontario
-            nctsi1(6)   = 210  ; nctsj1(6)   = 252 - isrow
-            nctsi2(6)   = 212  ; nctsj2(6)   = 252 - isrow
-            !                                           ! Victoria Lake
-            nctsi1(7)   = 321  ; nctsj1(7)   = 180 - isrow
-            nctsi2(7)   = 322  ; nctsj2(7)   = 189 - isrow
-            !                                           ! Baltic Sea
-            nctsi1(8)   = 297  ; nctsj1(8)   = 270 - isrow
-            nctsi2(8)   = 308  ; nctsj2(8)   = 293 - isrow
-                                
-            !                                           ! =======================
-            CASE ( 2 )                                  !  ORCA_R2 configuration
-               !                                        ! =======================
-               !                                            ! Caspian Sea
-               nctsi1(1)   =  11  ;  nctsj1(1)   = 103
-               nctsi2(1)   =  17  ;  nctsj2(1)   = 112
-               !                                            ! Great North American Lakes
-               nctsi1(2)   =  97  ;  nctsj1(2)   = 107
-               nctsi2(2)   = 103  ;  nctsj2(2)   = 111
-               !                                            ! Black Sea 1 : west part of the Black Sea
-               nctsi1(3)   = 174  ;  nctsj1(3)   = 107
-               nctsi2(3)   = 181  ;  nctsj2(3)   = 112
-              !                                            ! Black Sea 2 : est part of the Black Sea
-               nctsi1(4)   =   2  ;  nctsj1(4)   = 107
-               nctsi2(4)   =   6  ;  nctsj2(4)   = 112
-               !                                            ! Baltic Sea
-               nctsi1(5)   =  145 ;  nctsj1(5)   = 116
-               nctsi2(5)   =  150 ;  nctsj2(5)   = 126
-               !                                        ! =======================
-            CASE ( 4 )                                  !  ORCA_R4 configuration
-               !                                        ! =======================
-               !                                            ! Caspian Sea
-               nctsi1(1)   =  4  ;  nctsj1(1)   = 53
-               nctsi2(1)   =  4  ;  nctsj2(1)   = 56
-               !                                            ! Great North American Lakes
-               nctsi1(2)   = 49  ;  nctsj1(2)   = 55
-               nctsi2(2)   = 51  ;  nctsj2(2)   = 56
-               !                                            ! Black Sea
-               nctsi1(3)   = 88  ;  nctsj1(3)   = 55
-               nctsi2(3)   = 91  ;  nctsj2(3)   = 56
-               !                                            ! Baltic Sea
-               nctsi1(4)   = 75  ;  nctsj1(4)   = 59
-               nctsi2(4)   = 76  ;  nctsj2(4)   = 61
-               !                                        ! =======================
-            CASE ( 025 )                                ! ORCA_R025 configuration
-               !                                        ! =======================
-                                                     ! Caspian + Aral sea
-               nctsi1(1)   = 1330 ; nctsj1(1)   = 645
-               nctsi2(1)   = 1400 ; nctsj2(1)   = 795
-               !                                        ! Azov Sea
-               nctsi1(2)   = 1284 ; nctsj1(2)   = 722
-               nctsi2(2)   = 1304 ; nctsj2(2)   = 747
-               !
-            END SELECT
-            !
-         ENDIF
-         !
-
-         ! convert the position in local domain indices
-         ! --------------------------------------------
-         DO jc = 1, npncts
-            nctsi1(jc)   = mi0( nctsi1(jc) )
-            nctsj1(jc)   = mj0( nctsj1(jc) )
-
-            nctsi2(jc)   = mi1( nctsi2(jc) )
-            nctsj2(jc)   = mj1( nctsj2(jc) )
-         END DO
-         !
-      ENDIF
-
-      ! Restore close seas values to initial data
-      IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping
-         !
-         IF(lwp)  WRITE(numout,*)
-         IF(lwp)  WRITE(numout,*) ' trc_dmp_clo : Restoring of nutrients on close seas at time-step kt = ', kt
-         IF(lwp)  WRITE(numout,*)
-         !
-         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
-         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000
-         !
-         DO jn = 1, jptra
-            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-                jl = n_trc_index(jn)
-                IF(lwp)  WRITE(numout,*)
-                DO jc = 1, npncts
-                   DO jk = 1, jpkm1
-                      DO jj = nctsj1(jc), nctsj2(jc)
-                         DO ji = nctsi1(jc), nctsi2(jc)
-                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * rf_trfac(jl)
-                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
-                         ENDDO
-                      ENDDO
-                   ENDDO
-                ENDDO
-             ENDIF
-          ENDDO
-          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
-          !
-      ENDIF
-      !
-   END SUBROUTINE trc_dmp_clo
-
-
-   SUBROUTINE trc_dmp_init
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE trc_dmp_init  ***
-      !! 
-      !! ** Purpose :   Initialization for the newtonian damping 
-      !!
-      !! ** Method  :   read the nammbf namelist and check the parameters
-      !!              called by trc_dmp at the first timestep (nittrc000)
-      !!----------------------------------------------------------------------
-      !
-      INTEGER :: imask  !local file handle
-
-      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init')
-      !
-
-      IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries
-      SELECT CASE ( nn_zdmp_tr )
-      CASE ( 0 )   ;   IF(lwp) WRITE(numout,*) '   tracer damping throughout the water column'
-      CASE ( 1 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the turbocline (avt > 5 cm2/s)'
-      CASE ( 2 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the mixed layer'
-      CASE DEFAULT
-         WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr
-         CALL ctl_stop(ctmp1)
-      END SELECT
-
-      IF( .NOT. ln_tradmp )   &
-         &   CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' )
-      !
-      !                          ! Read damping coefficients from file
-      !Read in mask from file
-      CALL iom_open ( cn_resto_tr, imask)
-      CALL iom_get  ( imask, jpdom_autoglo, 'resto', restotr)
-      CALL iom_close( imask )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dmp_init')
-      !
-   END SUBROUTINE trc_dmp_init
-
-#else
-   !!----------------------------------------------------------------------
-   !!  Dummy module :                                     No passive tracer
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE trc_dmp( kt )        ! Empty routine
-      INTEGER, INTENT(in) :: kt
-      WRITE(*,*) 'trc_dmp: You should not have seen this print! error?', kt
-   END SUBROUTINE trc_dmp
-#endif
-
-
-   !!======================================================================
-END MODULE trcdmp
Index: NFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcdta.F90
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcdta.F90	(revision 2877)
+++ 	(revision )
@@ -1,264 +1,0 @@
-MODULE trcdta
-   !!======================================================================
-   !!                     ***  MODULE  trcdta  ***
-   !! TOP :  reads passive tracer data 
-   !!=====================================================================
-   !! History :   1.0  !  2002-04  (O. Aumont)  original code
-   !!              -   !  2004-03  (C. Ethe)  module
-   !!              -   !  2005-03  (O. Aumont, A. El Moussaoui) F90
-   !!            3.4   !  2010-11  (C. Ethe, G. Madec)  use of fldread + dynamical allocation 
-   !!            3.5   !  2013-08  (M. Vichi)  generalization for other BGC models
-   !!----------------------------------------------------------------------
-#if  defined key_top 
-   !!----------------------------------------------------------------------
-   !!   'key_top'                                                TOP model 
-   !!----------------------------------------------------------------------
-   !!   trc_dta    : read and time interpolated passive tracer data
-   !!----------------------------------------------------------------------
-   USE par_trc       !  passive tracers parameters
-   USE oce_trc       !  shared variables between ocean and passive tracers
-   USE trc           !  passive tracers common variables
-   USE iom           !  I/O manager
-   USE lib_mpp       !  MPP library
-   USE fldread       !  read input fields
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   trc_dta         ! called in trcini.F90 and trcdmp.F90
-   PUBLIC   trc_dta_init    ! called in trcini.F90 
-
-   INTEGER  , SAVE, PUBLIC                             :: nb_trcdta   ! number of tracers to be initialised with data
-   INTEGER  , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: n_trc_index ! indice of tracer which is initialised with data
-   INTEGER  , SAVE, PUBLIC                             :: ntra        ! MAX( 1, nb_trcdta ) to avoid compilation error with bounds checking
-   REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: rf_trfac    ! multiplicative factor for tracer values
-!$AGRIF_DO_NOT_TREAT
-   TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: sf_trcdta   ! structure of input SST (file informations, fields read)
-!$AGRIF_END_DO_NOT_TREAT
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id: trcdta.F90 6308 2016-02-12 11:32:54Z cetlod $ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE trc_dta_init(ntrc)
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE trc_dta_init  ***
-      !!                    
-      !! ** Purpose :   initialisation of passive tracer input data 
-      !! 
-      !! ** Method  : - Read namtsd namelist
-      !!              - allocates passive tracer data structure 
-      !!----------------------------------------------------------------------
-      !
-      INTEGER,INTENT(IN) :: ntrc                             ! number of tracers
-      INTEGER            :: jl, jn                           ! dummy loop indices
-      INTEGER            :: ierr0, ierr1, ierr2, ierr3       ! temporary integers
-      INTEGER            :: ios                              ! Local integer output status for namelist read
-      CHARACTER(len=100) :: clndta, clntrc
-      REAL(wp)           :: zfact
-      !
-      CHARACTER(len=100)            :: cn_dir
-      TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_i ! array of namelist informations on the fields to read
-      TYPE(FLD_N), DIMENSION(jpmaxtrc) :: sn_trcdta
-      REAL(wp)   , DIMENSION(jpmaxtrc) :: rn_trfac    ! multiplicative factor for tracer values
-      !!
-      NAMELIST/namtrc_dta/ sn_trcdta, cn_dir, rn_trfac 
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dta_init')
-      !
-      !  Initialisation
-      ierr0 = 0  ;  ierr1 = 0  ;  ierr2 = 0  ;  ierr3 = 0  
-      ! Compute the number of tracers to be initialised with data
-      ALLOCATE( n_trc_index(ntrc), slf_i(ntrc), STAT=ierr0 )
-      IF( ierr0 > 0 ) THEN
-         CALL ctl_stop( 'trc_nam: unable to allocate n_trc_index' )   ;   RETURN
-      ENDIF
-      nb_trcdta      = 0
-      n_trc_index(:) = 0
-      DO jn = 1, ntrc
-         IF( ln_trc_ini(jn) ) THEN
-             nb_trcdta       = nb_trcdta + 1 
-             n_trc_index(jn) = nb_trcdta 
-         ENDIF
-      ENDDO
-      !
-      ntra = MAX( 1, nb_trcdta )   ! To avoid compilation error with bounds checking
-      IF(lwp) THEN
-         WRITE(numout,*) ' '
-         WRITE(numout,*) ' number of passive tracers to be initialize by data :', ntra
-         WRITE(numout,*) ' '
-      ENDIF
-      !
-      REWIND( numnat_ref )              ! Namelist namtrc_dta in reference namelist : Passive tracer input data
-      READ  ( numnat_ref, namtrc_dta, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta in reference namelist', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc_dta in configuration namelist : Passive tracer input data
-      READ  ( numnat_cfg, namtrc_dta, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta in configuration namelist', lwp )
-      IF(lwm) WRITE ( numont, namtrc_dta )
-
-      IF( lwp ) THEN
-         DO jn = 1, ntrc
-            IF( ln_trc_ini(jn) )  THEN    ! open input file only if ln_trc_ini(jn) is true
-               clndta = TRIM( sn_trcdta(jn)%clvar ) 
-               clntrc = TRIM( ctrcnm   (jn)       ) 
-               zfact  = rn_trfac(jn)
-               IF( clndta /=  clntrc ) THEN 
-                  CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation :  ',   &
-                  &              'the variable name in the data file : '//clndta//   & 
-                  &              '  must be the same than the name of the passive tracer : '//clntrc//' ')
-               ENDIF
-               WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' name : ', clndta, & 
-               &               ' multiplicative factor : ', zfact
-            ENDIF
-         END DO
-      ENDIF
-      !
-      IF( nb_trcdta > 0 ) THEN       !  allocate only if the number of tracer to initialise is greater than zero
-         ALLOCATE( sf_trcdta(nb_trcdta), rf_trfac(nb_trcdta), STAT=ierr1 )
-         IF( ierr1 > 0 ) THEN
-            CALL ctl_stop( 'trc_dta_ini: unable to allocate  sf_trcdta structure' )   ;   RETURN
-         ENDIF
-         !
-         DO jn = 1, ntrc
-            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-               jl = n_trc_index(jn)
-               slf_i(jl)    = sn_trcdta(jn)
-               rf_trfac(jl) = rn_trfac(jn)
-                                            ALLOCATE( sf_trcdta(jl)%fnow(jpi,jpj,jpk)   , STAT=ierr2 )
-               IF( sn_trcdta(jn)%ln_tint )  ALLOCATE( sf_trcdta(jl)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 )
-               IF( ierr2 + ierr3 > 0 ) THEN
-                 CALL ctl_stop( 'trc_dta : unable to allocate passive tracer data arrays' )   ;   RETURN
-               ENDIF
-            ENDIF
-            !   
-         ENDDO
-         !                         ! fill sf_trcdta with slf_i and control print
-         CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta', 'Passive tracer data', 'namtrc' )
-         !
-      ENDIF
-      !
-      DEALLOCATE( slf_i )          ! deallocate local field structure
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dta_init')
-      !
-   END SUBROUTINE trc_dta_init
-
-
-   SUBROUTINE trc_dta( kt, ptrc )
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE trc_dta  ***
-      !!                    
-      !! ** Purpose :   provides passive tracer data at kt
-      !! 
-      !! ** Method  : - call fldread routine
-      !!              - s- or mixed z-s coordinate: vertical interpolation on model mesh
-      !!              - ln_trcdmp=F: deallocates the data structure as they are not used
-      !!
-      !! ** Action  :   sf_trcdta   passive tracer data on medl mesh and interpolated at time-step kt
-      !!----------------------------------------------------------------------
-      INTEGER                       , INTENT(in   ) ::   kt     ! ocean time-step
-      REAL(wp), DIMENSION(jpi,jpj,jpk,nb_trcdta), INTENT(inout) ::   ptrc     ! array of information on the field to read
-      !
-      INTEGER ::   ji, jj, jk, jl, jkk, ik    ! dummy loop indices
-      REAL(wp)::   zl, zi
-      REAL(wp), DIMENSION(jpk) ::  ztp                ! 1D workspace
-      CHARACTER(len=100) :: clndta
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dta')
-      !
-      IF( nb_trcdta > 0 ) THEN
-         !
-         CALL fld_read( kt, 1, sf_trcdta )      !==   read data at kt time step   ==!
-         !
-         DO jl = 1, nb_trcdta
-            ptrc(:,:,:,jl) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:)    ! Mask
-         ENDDO
-         !
-         IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
-            !
-            IF( kt == nit000 .AND. lwp )THEN
-               WRITE(numout,*)
-               WRITE(numout,*) 'trc_dta: interpolates passive tracer data onto the s- or mixed s-z-coordinate mesh'
-            ENDIF
-            DO jl = 1, nb_trcdta
-               DO jj = 1, jpj                         ! vertical interpolation of T & S
-                  DO ji = 1, jpi
-                     DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points
-                        zl = fsdept_n(ji,jj,jk)
-                        IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data
-                           ztp(jk) =  ptrc(ji,jj,1,jl)
-                        ELSEIF( zl > gdept_1d(jpk) ) THEN         ! below the last level of data
-                           ztp(jk) =  ptrc(ji,jj,jpkm1,jl)
-                        ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1
-                           DO jkk = 1, jpkm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1)
-                              IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
-                                 zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
-                                 ztp(jk) = ptrc(ji,jj,jkk,jl) + ( ptrc(ji,jj,jkk+1,jl) - ptrc(ji,jj,jkk,jl) ) * zi 
-                              ENDIF
-                           END DO
-                        ENDIF
-                     END DO
-                     DO jk = 1, jpkm1
-                        ptrc(ji,jj,jk,jl) = ztp(jk) * tmask(ji,jj,jk)     ! mask required for mixed zps-s-coord
-                     END DO
-                     ptrc(ji,jj,jpk,jl) = 0._wp
-                  END DO
-               END DO
-            END DO
-            ! 
-         ELSE                                !==   z- or zps- coordinate   ==!
-            !                             
-            IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
-               DO jl = 1, nb_trcdta
-                  !
-                  DO jj = 1, jpj
-                     DO ji = 1, jpi
-                        ik = mbkt(ji,jj) 
-                        IF( ik > 1 ) THEN
-                           zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
-                           ptrc(ji,jj,ik,jl) = (1.-zl) * ptrc(ji,jj,ik,jl) + zl * ptrc(ji,jj,ik-1,jl)
-                        ENDIF
-                        ik = mikt(ji,jj)
-                        IF( ik > 1 ) THEN
-                           zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
-                           ptrc(ji,jj,ik,jl) = (1.-zl) * ptrc(ji,jj,ik,jl) + zl * ptrc(ji,jj,ik+1,jl)
-                        ENDIF
-                     END DO
-                  END DO
-              END DO
-            ENDIF
-            !
-         ENDIF
-         !
-      ENDIF
-      ! 
-      IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==!
-        !                                                    (data used only for initialisation)
-        IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run'
-        DO jl = 1, nb_trcdta
-                                        DEALLOCATE( sf_trcdta(jl)%fnow)     !  arrays in the structure
-           IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta)
-        ENDDO
-      ENDIF
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dta')
-      !
-   END SUBROUTINE trc_dta
-#else
-   !!----------------------------------------------------------------------
-   !!   Dummy module                              NO 3D passive tracer data
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE trc_dta( kt, sf_trcdta, zrf_trfac )        ! Empty routine
-      WRITE(*,*) 'trc_dta: You should not have seen this print! error?', kt
-   END SUBROUTINE trc_dta
-#endif
-   !!======================================================================
-END MODULE trcdta
Index: NFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcini.F90
===================================================================
--- /CONFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/trcini.F90	(revision 2877)
+++ 	(revision )
@@ -1,227 +1,0 @@
-MODULE trcini
-   !!======================================================================
-   !!                         ***  MODULE trcini  ***
-   !! TOP :   Manage the passive tracer initialization
-   !!======================================================================
-   !! History :   -   ! 1991-03 (O. Marti)  original code
-   !!            1.0  ! 2005-03 (O. Aumont, A. El Moussaoui) F90
-   !!            2.0  ! 2005-10 (C. Ethe, G. Madec) revised architecture
-   !!            4.0  ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation
-   !!----------------------------------------------------------------------
-#if defined key_top
-   !!----------------------------------------------------------------------
-   !!   'key_top'                                                TOP models
-   !!----------------------------------------------------------------------
-   !!   trc_init  :   Initialization for passive tracer
-   !!   top_alloc :   allocate the TOP arrays
-   !!----------------------------------------------------------------------
-   USE oce_trc         ! shared variables between ocean and passive tracers
-   USE trc             ! passive tracers common variables
-   USE trcrst          ! passive tracers restart
-   USE trcnam          ! Namelist read
-   USE trcini_cfc      ! CFC      initialisation
-   USE trcini_pisces   ! PISCES   initialisation
-   USE trcini_c14b     ! C14 bomb initialisation
-   USE trcini_my_trc   ! MY_TRC   initialisation
-   USE trcdta          ! initialisation from files
-   USE daymod          ! calendar manager
-   USE zpshde          ! partial step: hor. derivative   (zps_hde routine)
-   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
-   USE trcsub          ! variables to substep passive tracers
-   USE lib_mpp         ! distribued memory computing library
-   USE wrk_nemo
-   USE sbc_oce
-   USE trcice          ! tracers in sea ice
- 
-   IMPLICIT NONE
-   PRIVATE
-   
-   PUBLIC   trc_init   ! called by opa
-
-    !! * Substitutions
-#  include "domzgr_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 4.0 , NEMO Consortium (2011)
-   !! $Id: trcini.F90 6308 2016-02-12 11:32:54Z cetlod $ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-   
-   SUBROUTINE trc_init
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_init  ***
-      !!
-      !! ** Purpose :   Initialization of the passive tracer fields 
-      !!
-      !! ** Method  : - read namelist
-      !!              - control the consistancy 
-      !!              - compute specific initialisations
-      !!              - set initial tracer fields (either read restart 
-      !!                or read data or analytical formulation
-      !!---------------------------------------------------------------------
-      INTEGER ::   jk, jn, jl    ! dummy loop indices
-      CHARACTER (len=25) :: charout
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrcdta
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('trc_init')
-      !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-      CALL top_alloc()              ! allocate TOP arrays
-
-      l_trcdm2dc = ln_dm2dc .OR. ( ln_cpl .AND. ncpl_qsr_freq /= 1 )
-      l_trcdm2dc = l_trcdm2dc  .AND. .NOT. lk_offline
-      IF( l_trcdm2dc .AND. lwp ) &
-         &   CALL ctl_warn(' Coupling with passive tracers and used of diurnal cycle. &
-         & Computation of a daily mean shortwave for some biogeochemical models) ')
-
-      IF( nn_cla == 1 )   &
-         &  CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' )
-
-      CALL trc_nam      ! read passive tracers namelists
-      !
-      IF(lwp) WRITE(numout,*)
-      !
-      IF( ln_rsttr .AND. .NOT. lk_offline ) CALL trc_rst_cal( nit000, 'READ' )   ! calendar
-      !
-      IF(lwp) WRITE(numout,*)
-                                                              ! masked grid volume
-      !                                                              ! masked grid volume
-      DO jk = 1, jpk
-         cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk)
-      END DO
-      IF( lk_degrad ) cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:)      ! degrad option: reduction by facvol
-      !                                                              ! total volume of the ocean 
-      areatot = glob_sum( cvol(:,:,:) )
-
-      IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model
-      IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC     tracers
-      IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer
-      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC  tracers
-
-      CALL trc_ice_ini                                 ! Tracers in sea ice
-
-      IF( lwp ) THEN
-         !
-         CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea )
-         !
-      ENDIF
-
-      IF( ln_trcdta )      CALL trc_dta_init(jptra)
-
-
-      IF( ln_rsttr ) THEN
-        !
-        CALL trc_rst_read              ! restart from a file
-        !
-      ELSE
-        !
-        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
-            !
-            CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
-            !
-            CALL trc_dta( nit000, ztrcdta )   ! read tracer data at nit000
-            !
-            DO jn = 1, jptra
-               IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-                  jl = n_trc_index(jn) 
-                  trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * rf_trfac(jl)
-               ENDIF
-            ENDDO
-            !
-            CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
-            ! 
-        ENDIF
-        !
-        trb(:,:,:,:) = trn(:,:,:,:)
-        ! 
-      ENDIF
- 
-      tra(:,:,:,:) = 0._wp
-      IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav )   &              ! Partial steps: before horizontal gradient of passive
-        &    CALL zps_hde    ( nit000, jptra, trn, gtru, gtrv  )  ! Partial steps: before horizontal gradient
-      IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav )   &
-        &    CALL zps_hde_isf( nit000, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )       ! tracers at the bottom ocean level
-
-
-      !
-      IF( nn_dttrc /= 1 )        CALL trc_sub_ini      ! Initialize variables for substepping passive tracers
-      !
-
-      trai(:) = 0._wp                                                   ! initial content of all tracers
-      DO jn = 1, jptra
-         trai(jn) = trai(jn) + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   )
-      END DO
-
-      IF(lwp) THEN               ! control print
-         WRITE(numout,*)
-         WRITE(numout,*)
-         WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
-         WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
-         WRITE(numout,*) '          *** Total inital content of all tracers '
-         WRITE(numout,*)
-         DO jn = 1, jptra
-            WRITE(numout,9000) jn, TRIM( ctrcnm(jn) ), trai(jn)
-         ENDDO
-         WRITE(numout,*)
-      ENDIF
-      IF(lwp) WRITE(numout,*)
-      IF(ln_ctl) THEN            ! print mean trends (used for debugging)
-         CALL prt_ctl_trc_init
-         WRITE(charout, FMT="('ini ')")
-         CALL prt_ctl_trc_info( charout )
-         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
-      ENDIF
-9000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10)
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_init')
-      !
-   END SUBROUTINE trc_init
-
-
-   SUBROUTINE top_alloc
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE top_alloc  ***
-      !!
-      !! ** Purpose :   Allocate all the dynamic arrays of the OPA modules
-      !!----------------------------------------------------------------------
-      USE trcadv        , ONLY:   trc_adv_alloc          ! TOP-related alloc routines...
-      USE trc           , ONLY:   trc_alloc
-      USE trcnxt        , ONLY:   trc_nxt_alloc
-      USE trczdf        , ONLY:   trc_zdf_alloc
-      USE trdtrc_oce    , ONLY:   trd_trc_oce_alloc
-#if defined key_trdmxl_trc 
-      USE trdmxl_trc    , ONLY:   trd_mxl_trc_alloc
-#endif
-      !
-      INTEGER :: ierr
-      !!----------------------------------------------------------------------
-      !
-      ierr =        trc_adv_alloc()          ! Start of TOP-related alloc routines...
-      ierr = ierr + trc_alloc    ()
-      ierr = ierr + trc_nxt_alloc()
-      ierr = ierr + trc_zdf_alloc()
-      ierr = ierr + trd_trc_oce_alloc()
-#if defined key_trdmxl_trc 
-      ierr = ierr + trd_mxl_trc_alloc()
-#endif
-      !
-      IF( lk_mpp    )   CALL mpp_sum( ierr )
-      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'top_alloc : unable to allocate standard ocean arrays' )
-      !
-   END SUBROUTINE top_alloc
-
-#else
-   !!----------------------------------------------------------------------
-   !!  Empty module :                                     No passive tracer
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE trc_init                      ! Dummy routine   
-   END SUBROUTINE trc_init
-#endif
-
-   !!======================================================================
-END MODULE trcini
