Index: NEMO/trunk/cfgs/AMM12/EXPREF/context_nemo.xml
===================================================================
--- NEMO/trunk/cfgs/AMM12/EXPREF/context_nemo.xml	(revision 12276)
+++ NEMO/trunk/cfgs/AMM12/EXPREF/context_nemo.xml	(revision 12377)
@@ -16,16 +16,89 @@
        <variable id="rhoic"     type="float" > 917.0 </variable>
        <variable id="rhosn"     type="float" > 330.0 </variable>
-       <variable id="missval"   type="float" > 1.e20 </variable>
+       <variable id="missval"  type="float" > 1.e20 </variable>	       
     </variable_definition>
 
 <!-- Fields definition -->
-    <field_definition src="./field_def_nemo-oce.xml"/>      <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     -->
+
+<!-- Override field definitions for multiple-linear-regression analysis (diamlr) -->
+    <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" >
+      <field_group id="diamlr_fields">
+        <!-- Time -->
+        <field id="diamlr_time" grid_ref="diamlr_grid_T_2D" prec="8" />
+        <!-- Regressors for tidal harmonic analysis -->
+        <field id="diamlr_r001" field_ref="diamlr_time" expr="sin( __TDE_M2_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M2" />
+        <field id="diamlr_r002" field_ref="diamlr_time" expr="cos( __TDE_M2_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M2" />
+        <field id="diamlr_r003" field_ref="diamlr_time" expr="sin( __TDE_K1_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K1" />
+        <field id="diamlr_r004" field_ref="diamlr_time" expr="cos( __TDE_K1_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K1" />
+        <field id="diamlr_r005" enabled=".FALSE." />
+        <field id="diamlr_r006" enabled=".FALSE." />
+        <field id="diamlr_r007" enabled=".FALSE." />
+        <field id="diamlr_r008" enabled=".FALSE." />
+        <field id="diamlr_r009" enabled=".FALSE." />
+        <field id="diamlr_r010" enabled=".FALSE." />
+        <field id="diamlr_r011" enabled=".FALSE." />
+        <field id="diamlr_r012" enabled=".FALSE." />
+        <field id="diamlr_r013" enabled=".FALSE." />
+        <field id="diamlr_r014" enabled=".FALSE." />
+        <field id="diamlr_r015" enabled=".FALSE." />
+        <field id="diamlr_r016" enabled=".FALSE." />
+        <field id="diamlr_r017" enabled=".FALSE." />
+        <field id="diamlr_r018" enabled=".FALSE." />
+        <field id="diamlr_r019" enabled=".FALSE." />
+        <field id="diamlr_r020" enabled=".FALSE." />
+        <field id="diamlr_r021" enabled=".FALSE." />
+        <field id="diamlr_r022" enabled=".FALSE." />
+        <field id="diamlr_r023" enabled=".FALSE." />
+        <field id="diamlr_r024" enabled=".FALSE." />
+        <field id="diamlr_r025" enabled=".FALSE." />
+        <field id="diamlr_r026" enabled=".FALSE." />
+        <field id="diamlr_r027" enabled=".FALSE." />
+        <field id="diamlr_r028" enabled=".FALSE." />
+        <field id="diamlr_r029" enabled=".FALSE." />
+        <field id="diamlr_r030" enabled=".FALSE." />
+        <field id="diamlr_r031" enabled=".FALSE." />
+        <field id="diamlr_r032" enabled=".FALSE." />
+        <field id="diamlr_r033" enabled=".FALSE." />
+        <field id="diamlr_r034" enabled=".FALSE." />
+        <field id="diamlr_r035" enabled=".FALSE." />
+        <field id="diamlr_r036" enabled=".FALSE." />
+        <field id="diamlr_r037" enabled=".FALSE." />
+        <field id="diamlr_r038" enabled=".FALSE." />
+        <field id="diamlr_r101" field_ref="diamlr_time" expr="diamlr_time^0.0"                       enabled=".TRUE."  comment="mean"            />
+        <!-- Fields selected for regression analysis -->
+        <field id="diamlr_f001" field_ref="ssh"  enabled=".TRUE." />
+        <field id="diamlr_f002" field_ref="uoce" enabled=".TRUE." />
+        <field id="diamlr_f003" field_ref="voce" enabled=".TRUE." />
+        <field id="diamlr_f004" field_ref="toce" enabled=".TRUE." />
+      </field_group>
+    </field_definition>
 
 <!-- Files definition -->
     <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     -->
 
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
+
+<!-- Activation of intermediate output for multiple-linear-regression analysis (diamlr) -->
+      <file_group id="diamlr_files" output_freq="1d"  output_level="10" enabled=".TRUE."/>
+
+<!-- Activation and selection of daily detided model diagnostics (diadetide) -->
+      <file_group id="diadetide_files" output_freq="1d" output_level="10" enabled=".TRUE.">
+	<file id="file22" name_suffix="_M2detided_grid_T" description="M2-detided ocean T-grid variables">
+	  <field id="diadetide_ssh"  field_ref="diadetide_weight_grid_T_2D" operation="accumulate"> this * ssh </field>
+	</file>
+	<file id="file23" name_suffix="_M2detided_grid_U" description="M2-detided ocean U-grid variables">
+	  <field id="diadetide_uoce" field_ref="diadetide_weight_grid_U_3D" operation="accumulate"> this * uoce </field>
+	</file>
+	<file id="file24" name_suffix="_M2detided_grid_V" description="M2-detided ocean V-grid variables">
+	  <field id="diadetide_voce"  field_ref="diadetide_weight_grid_V_3D" operation="accumulate"> this * voce </field>
+	</file>
+      </field_group>
+
+    </file_definition>
+
 <!-- Axis definition -->
     <axis_definition src="./axis_def_nemo.xml"/>
- 
+
 <!-- Domain definition -->
     <domain_definition src="./domain_def_nemo.xml"/>
Index: NEMO/trunk/cfgs/AMM12/EXPREF/file_def_nemo-oce.xml
===================================================================
--- NEMO/trunk/cfgs/AMM12/EXPREF/file_def_nemo-oce.xml	(revision 12276)
+++ NEMO/trunk/cfgs/AMM12/EXPREF/file_def_nemo-oce.xml	(revision 12377)
@@ -42,5 +42,4 @@
 
       <file_group id="25h_mean" output_freq="1d" output_level="10" enabled=".TRUE.">
-
 
      <file id="file12" name_suffix="_25hourm_grid_T" description="ocean T grid variables, 25h meaned" enabled=".TRUE." >
Index: NEMO/trunk/cfgs/AMM12/EXPREF/namelist_cfg
===================================================================
--- NEMO/trunk/cfgs/AMM12/EXPREF/namelist_cfg	(revision 12276)
+++ NEMO/trunk/cfgs/AMM12/EXPREF/namelist_cfg	(revision 12377)
@@ -154,22 +154,21 @@
 &nam_tide      !   tide parameters                                      (default: OFF)
 !-----------------------------------------------------------------------
-   ln_tide     = .true.    ! Activate tides
-      ln_tide_pot   = .true.  !  use tidal potential forcing
-
-   clname(1)     =   'Q1'   !  name of constituent
-   clname(2)     =   'O1'
-   clname(3)     =   'P1'
-   clname(4)     =   'S1'
-   clname(5)     =   'K1'
-   clname(6)     =   '2N2'
-   clname(7)     =   'MU2'
-   clname(8)     =   'N2'
-   clname(9)     =   'NU2'
-   clname(10)    =   'M2'
-   clname(11)    =   'L2'
-   clname(12)    =   'T2'
-   clname(13)    =   'S2'
-   clname(14)    =   'K2'
-   clname(15)    =   'M4'
+   ln_tide     = .true.        ! Activate tides
+      ln_tide_pot     = .true. !  use tidal potential forcing
+   sn_tide_cnames(1)  = 'Q1'   !  name of constituent
+   sn_tide_cnames(2)  = 'O1'
+   sn_tide_cnames(3)  = 'P1'
+   sn_tide_cnames(4)  = 'S1'
+   sn_tide_cnames(5)  = 'K1'
+   sn_tide_cnames(6)  = '2N2'
+   sn_tide_cnames(7)  = 'MU2'
+   sn_tide_cnames(8)  = 'N2'
+   sn_tide_cnames(9)  = 'NU2'
+   sn_tide_cnames(10) = 'M2'
+   sn_tide_cnames(11) = 'L2'
+   sn_tide_cnames(12) = 'T2'
+   sn_tide_cnames(13) = 'S2'
+   sn_tide_cnames(14) = 'K2'
+   sn_tide_cnames(15) = 'M4'
 /
 !-----------------------------------------------------------------------
@@ -351,5 +350,4 @@
 !!   namdiu       Cool skin and warm layer models                       (default: OFF)
 !!   namflo       float parameters                                      (default: OFF)
-!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
 !!   nam_diadct   transports through some sections                      (default: OFF)
 !!   nam_dia25h   25h Mean Output                                       (default: OFF)
