Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 8463)
@@ -523,5 +523,5 @@
 
 
-     <field_group id="trdtrc_T" grid_ref="grid_T_3D">  <!-- key_trdtrc || key_trdmlx_trc -->
+     <field_group id="ptrd_T" grid_ref="grid_T_3D">  <!-- key_trdtrc || key_trdmlx_trc -->
       <!-- MEDUSA : variables available with key_medusa -->
        <!-- trd case: jptra_xad -->
@@ -673,5 +673,5 @@
        <field id="ZDP_PHN"      long_name="non-diatom phytoplankton"                          unit="mmol-N/m3/s" />
        <field id="ZDP_PHD"      long_name="diatom     phytoplankton"                          unit="mmol-N/m3/s" />
-       <field id="ZDF_ZMI"      long_name="micro zooplankton"                                 unit="mmol-N/m3/s" />
+       <field id="ZDP_ZMI"      long_name="micro zooplankton"                                 unit="mmol-N/m3/s" />
        <field id="ZDP_ZME"      long_name="meso  zooplankton"                                 unit="mmol-N/m3/s" />
        <field id="ZDP_DIN"      long_name="dissolved inorganic nitrogen"                      unit="mmol-N/m3/s" />
@@ -1187,5 +1187,5 @@
        <field field_ref="ZDP_PHN"      name="ZDP_PHN"   />
        <field field_ref="ZDP_PHD"      name="ZDP_PHD"   />
-       <field field_ref="ZDF_ZMI"      name="ZDF_ZMI"   />
+       <field field_ref="ZDP_ZMI"      name="ZDP_ZMI"   />
        <field field_ref="ZDP_ZME"      name="ZDP_ZME"   />
        <field field_ref="ZDP_DIN"      name="ZDP_DIN"   />
@@ -1435,4 +1435,159 @@
    </field_group>
 
+
+    <field_group id="trendMEDUSA_short" >
+       <!-- trd case: jptra_totad -->
+       <field field_ref="TAD_CHN"      name="TAD_CHN"   />
+       <field field_ref="TAD_CHN_E3T"  name="TAD_CHN_E3T"   />
+       <field field_ref="TAD_CHD"      name="TAD_CHD"   />
+       <field field_ref="TAD_CHD_E3T"  name="TAD_CHD_E3T"   />
+       <field field_ref="TAD_PHN"      name="TAD_PHN"   />
+       <field field_ref="TAD_PHN_E3T"  name="TAD_PHN_E3T"   />
+       <field field_ref="TAD_PHD"      name="TAD_PHD"   />
+       <field field_ref="TAD_PHD_E3T"  name="TAD_PHD_E3T"   />
+       <field field_ref="TAD_ZMI"      name="TAD_ZMI"   />
+       <field field_ref="TAD_ZMI_E3T"  name="TAD_ZMI_E3T"   />
+       <field field_ref="TAD_ZME"      name="TAD_ZME"   />
+       <field field_ref="TAD_ZME_E3T"  name="TAD_ZME_E3T"   />
+       <field field_ref="TAD_DIN"      name="TAD_DIN"   />
+       <field field_ref="TAD_DIN_E3T"  name="TAD_DIN_E3T"   />
+       <field field_ref="TAD_SIL"      name="TAD_SIL"   />
+       <field field_ref="TAD_SIL_E3T"  name="TAD_SIL_E3T"   />
+       <field field_ref="TAD_FER"      name="TAD_FER"   />
+       <field field_ref="TAD_FER_E3T"  name="TAD_FER_E3T"   />
+       <field field_ref="TAD_DET"      name="TAD_DET"   />
+       <field field_ref="TAD_DET_E3T"  name="TAD_DET_E3T"   />
+       <field field_ref="TAD_PDS"      name="TAD_PDS"   />
+       <field field_ref="TAD_PDS_E3T"  name="TAD_PDS_E3T"   />
+       <field field_ref="TAD_DTC"      name="TAD_DTC"   />
+       <field field_ref="TAD_DTC_E3T"  name="TAD_DTC_E3T"   />
+       <field field_ref="TAD_DiC"      name="TAD_DiC"   />
+       <field field_ref="TAD_DiC_E3T"  name="TAD_DiC_E3T"   />
+       <field field_ref="TAD_ALK"      name="TAD_ALK"   />
+       <field field_ref="TAD_ALK_E3T"  name="TAD_ALK_E3T"   />
+       <field field_ref="TAD_OXY"      name="TAD_OXY"   />
+       <field field_ref="TAD_OXY_E3T"  name="TAD_OXY_E3T"   />
+       <!-- trd case: jptra_sms -->
+       <field field_ref="SMS_CHN"      name="SMS_CHN"   />
+       <field field_ref="SMS_CHN_E3T"  name="SMS_CHN_E3T"   />
+       <field field_ref="SMS_CHD"      name="SMS_CHD"   />
+       <field field_ref="SMS_CHD_E3T"  name="SMS_CHD_E3T"   />
+       <field field_ref="SMS_PHN"      name="SMS_PHN"   />
+       <field field_ref="SMS_PHN_E3T"  name="SMS_PHN_E3T"   />
+       <field field_ref="SMS_PHD"      name="SMS_PHD"   />
+       <field field_ref="SMS_PHD_E3T"  name="SMS_PHD_E3T"   />
+       <field field_ref="SMS_ZMI"      name="SMS_ZMI"   />
+       <field field_ref="SMS_ZMI_E3T"  name="SMS_ZMI_E3T"   />
+       <field field_ref="SMS_ZME"      name="SMS_ZME"   />
+       <field field_ref="SMS_ZME_E3T"  name="SMS_ZME_E3T"   />
+       <field field_ref="SMS_DIN"      name="SMS_DIN"   />
+       <field field_ref="SMS_DIN_E3T"  name="SMS_DIN_E3T"   />
+       <field field_ref="SMS_SIL"      name="SMS_SIL"   />
+       <field field_ref="SMS_SIL_E3T"  name="SMS_SIL_E3T"   />
+       <field field_ref="SMS_FER"      name="SMS_FER"   />
+       <field field_ref="SMS_FER_E3T"  name="SMS_FER_E3T"   />
+       <field field_ref="SMS_DET"      name="SMS_DET"   />
+       <field field_ref="SMS_DET_E3T"  name="SMS_DET_E3T"   />
+       <field field_ref="SMS_PDS"      name="SMS_PDS"   />
+       <field field_ref="SMS_PDS_E3T"  name="SMS_PDS_E3T"   />
+       <field field_ref="SMS_DTC"      name="SMS_DTC"   />
+       <field field_ref="SMS_DTC_E3T"  name="SMS_DTC_E3T"   />
+       <field field_ref="SMS_DiC"      name="SMS_DiC"   /> 
+       <field field_ref="SMS_DiC_E3T"  name="SMS_DiC_E3T"   />
+       <field field_ref="SMS_ALK"      name="SMS_ALK"   />
+       <field field_ref="SMS_ALK_E3T"  name="SMS_ALK_E3T"   />
+       <field field_ref="SMS_OXY"      name="SMS_OXY"   />
+       <field field_ref="SMS_OXY_E3T"  name="SMS_OXY_E3T"   />
+       <!-- trd case: jptra_tot -->   
+       <field field_ref="TOT_CHN"      name="TOT_CHN"   />
+       <field field_ref="TOT_CHN_E3T"  name="TOT_CHN_E3T"   />
+       <field field_ref="TOT_CHD"      name="TOT_CHD"   />
+       <field field_ref="TOT_CHD_E3T"  name="TOT_CHD_E3T"   />
+       <field field_ref="TOT_PHN"      name="TOT_PHN"   />
+       <field field_ref="TOT_PHN_E3T"  name="TOT_PHN_E3T"   />
+       <field field_ref="TOT_PHD"      name="TOT_PHD"   />
+       <field field_ref="TOT_PHD_E3T"  name="TOT_PHD_E3T"   />
+       <field field_ref="TOT_ZMI"      name="TOT_ZMI"   />
+       <field field_ref="TOT_ZME"      name="TOT_ZME"   />
+       <field field_ref="TOT_ZME_E3T"  name="TOT_ZME_E3T"   />
+       <field field_ref="TOT_DIN"      name="TOT_DIN"   />
+       <field field_ref="TOT_DIN_E3T"  name="TOT_DIN_E3T"   />
+       <field field_ref="TOT_SIL"      name="TOT_SIL"   />
+       <field field_ref="TOT_SIL_E3T"  name="TOT_SIL_E3T"   />
+       <field field_ref="TOT_FER"      name="TOT_FER"   />
+       <field field_ref="TOT_FER_E3T"  name="TOT_FER_E3T"   />
+       <field field_ref="TOT_DET"      name="TOT_DET"   />
+       <field field_ref="TOT_DET_E3T"  name="TOT_DET_E3T"   />
+       <field field_ref="TOT_PDS"      name="TOT_PDS"   />
+       <field field_ref="TOT_PDS_E3T"  name="TOT_PDS_E3T"   />
+       <field field_ref="TOT_DTC"      name="TOT_DTC"   />
+       <field field_ref="TOT_DTC_E3T"  name="TOT_DTC_E3T"   />
+       <field field_ref="TOT_DiC"      name="TOT_DiC"   />
+       <field field_ref="TOT_DiC_E3T"  name="TOT_DiC_E3T"   />
+       <field field_ref="TOT_ALK"      name="TOT_ALK"   />   
+       <field field_ref="TOT_ALK_E3T"  name="TOT_ALK_E3T"   />
+       <field field_ref="TOT_OXY"      name="TOT_OXY"   />
+       <field field_ref="TOT_OXY_E3T"  name="TOT_OXY_E3T"   />  
+    </field_group>
+
+    <field_group id="trendCFC11_short" >
+          <!-- cfc11 -->
+          <field field_ref="TOT_CFC11"     name="TOT_CFC11"     standard_name="CFC-11_Concentration"                  />
+          <field field_ref="TOT_CFC11_E3T" name="TOT_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
+          <field field_ref="TAD_CFC11"     name="TAD_CFC11"     standard_name="CFC-11_Concentration"                  />
+          <field field_ref="TAD_CFC11_E3T" name="TAD_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
+          <field field_ref="SMS_CFC11"     name="SMS_CFC11"     standard_name="CFC-11_Concentration"                  />
+          <field field_ref="SMS_CFC11_E3T" name="SMS_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
+   </field_group>
+
+    <field_group id="trendCFC12_short" >
+          <!-- cfc12 -->
+          <field field_ref="TOT_CFC12"     name="TOT_CFC12"     standard_name="CFC-12_Concentration"                  />
+          <field field_ref="TOT_CFC12_E3T" name="TOT_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
+          <field field_ref="TAD_CFC12"     name="TAD_CFC12"     standard_name="CFC-12_Concentration"                  />
+          <field field_ref="TAD_CFC12_E3T" name="TAD_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
+          <field field_ref="SMS_CFC12"     name="SMS_CFC12"     standard_name="CFC-12_Concentration"                  />
+          <field field_ref="SMS_CFC12_E3T" name="SMS_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
+   </field_group>
+
+    <field_group id="trendSF6_short" >
+          <!-- sf6 -->
+          <field field_ref="TOT_SF6"      name="TOT_SF6"      standard_name="SF6_Concentration"                     />
+          <field field_ref="TOT_SF6_E3T"  name="TOT_SF6_E3T"  standard_name="SF6_Concentration"                     />
+          <field field_ref="TAD_SF6"      name="TAD_SF6"      standard_name="SF6_Concentration"                     />
+          <field field_ref="TAD_SF6_E3T"  name="TAD_SF6_E3T"  standard_name="SF6_Concentration"                     />
+          <field field_ref="SMS_SF6"      name="SMS_SF6"      standard_name="SF6_Concentration"                     />
+          <field field_ref="SMS_SF6_E3T"  name="SMS_SF6_E3T"  standard_name="SF6_Concentration"                     />
+   </field_group>
+
+    <field_group id="trendAGE_short" >
+          <!-- age -->
+          <field field_ref="TOT_Age"      name="TOT_Age"      standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="TOT_Age_E3T"  name="TOT_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="TAD_Age"      name="TAD_Age"      standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="TAD_Age_E3T"  name="TAD_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="SMS_Age"      name="SMS_Age"      standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="SMS_Age_E3T"  name="SMS_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
+   </field_group>
+
+    <field_group id="trendIDTRA_short" >
+          <!-- Ideal tracer -->
+          <field field_ref="TOT_IDTRA"      name="TOT_IDTRA"      standard_name="IDTRA_Concentration"               />
+          <field field_ref="TOT_IDTRA_E3T"  name="TOT_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
+          <field field_ref="TAD_IDTRA"      name="TAD_IDTRA"      standard_name="IDTRA_Concentration"               />
+          <field field_ref="TAD_IDTRA_E3T"  name="TAD_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
+          <field field_ref="SMS_IDTRA"      name="SMS_IDTRA"      standard_name="IDTRA_Concentration"               />
+          <field field_ref="SMS_IDTRA_E3T"  name="SMS_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
+   </field_group>
+
+    <field_group id="trendC14B_short" >
+          <!-- c14 bomb -->
+          <field field_ref="TOT_C14B"      name="TOT_C14B"      standard_name="C14b_Concentration"               />
+          <field field_ref="TOT_C14B_E3T"  name="TOT_C14B_E3T"  standard_name="C14b_Concentration"               />
+          <field field_ref="TAD_C14B"      name="TAD_C14B"      standard_name="C14b_Concentration"               />
+          <field field_ref="TAD_C14B_E3T"  name="TAD_C14B_E3T"  standard_name="C14b_Concentration"               />
+          <field field_ref="SMS_C14B"      name="SMS_C14B"      standard_name="C14b_Concentration"               />
+          <field field_ref="SMS_C14B_E3T"  name="SMS_C14B_E3T"  standard_name="C14b_Concentration"               />
+   </field_group>
 
     <field_group id="groupMEDUSA_dia" >
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_MEDUSA_et_al_ref
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_MEDUSA_et_al_ref	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_MEDUSA_et_al_ref	(revision 8463)
@@ -98,6 +98,6 @@
    nn_ctls_trc =   0        !  control surface type in mixed-layer trends (0,1 or n<jpk)
    rn_ucf_trc  =   1        !  unit conversion factor (=1 -> /seconds ; =86400. -> /day)
-   ln_trdmld_trc_restart = .false.  !  restart for ML diagnostics
-   ln_trdmld_trc_instant = .true.  !  flag to diagnose trends of instantantaneous or mean ML T/S
+   ln_trdmxl_trc_restart = .false.  !  restart for ML diagnostics
+   ln_trdmxl_trc_instant = .true.  !  flag to diagnose trends of instantantaneous or mean ML T/S
    ln_trdtrc(1)  =   .true.
    ln_trdtrc(2)  =   .true.
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_ref
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_ref	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/CONFIG/SHARED/namelist_top_ref	(revision 8463)
@@ -98,6 +98,6 @@
    nn_ctls_trc =   0        !  control surface type in mixed-layer trends (0,1 or n<jpk)
    rn_ucf_trc  =   1        !  unit conversion factor (=1 -> /seconds ; =86400. -> /day)
-   ln_trdmld_trc_restart = .false.  !  restart for ML diagnostics
-   ln_trdmld_trc_instant = .true.  !  flag to diagnose trends of instantantaneous or mean ML T/S
+   ln_trdmxl_trc_restart = .false.  !  restart for ML diagnostics
+   ln_trdmxl_trc_instant = .true.  !  flag to diagnose trends of instantantaneous or mean ML T/S
    ln_trdtrc(1)  =   .true.
    ln_trdtrc(2)  =   .true.
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 8463)
@@ -24,4 +24,5 @@
    USE trdtrc
    USE iom           ! I/O library
+   USE wrk_nemo
 
    IMPLICIT NONE
@@ -54,4 +55,7 @@
    REAL(wp) ::   xconv3 = 1.0e+3       ! conversion from mol/l/atm to mol/m3/atm
    REAL(wp) ::   xconv4 = 1.0e-12      ! conversion from mol/m3/atm to mol/m3/pptv 
+
+   !! trend temporary array:
+   REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrcfc
 
    !! * Substitutions
@@ -265,7 +269,10 @@
       !
       IF( l_trdtrc ) THEN
+          CALL wrk_alloc( jpi, jpj, jpk, ztrcfc )
           DO jn = jp_cfc0, jp_cfc1
-            CALL trd_trc( tra(:,:,:,jn), jn, jptra_sms, kt )   ! save trends
+             ztrcfc(:,:,:) = tra(:,:,:,jn)
+            CALL trd_trc( ztrcfc, jn, jptra_sms, kt )   ! save trends
           END DO
+          CALL wrk_dealloc( jpi, jpj, jpk, ztrcfc )
       END IF
       !
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_update.F90
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_update.F90	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_update.F90	(revision 8463)
@@ -70,5 +70,5 @@
       USE lib_mpp,           ONLY: ctl_stop
       USE par_kind,          ONLY: wp
-      USE par_medusa,        ONLY: jp_medusa,                                &
+      USE par_medusa,        ONLY: jp_medusa, jp_msa0, jp_msa1,              &
                                    jpalk, jpchd, jpchn, jpdet, jpdic,        &
                                    jpdin, jpdtc, jpfer, jpoxy, jppds,        &
@@ -78,5 +78,5 @@
                                    jpoxy_lc, jppds_lc, jpphd_lc, jpphn_lc,   &
                                    jpsil_lc, jpzme_lc, jpzmi_lc
-      USE par_oce,           ONLY: jpi, jpim1, jpj, jpjm1
+      USE par_oce,           ONLY: jpi, jpim1, jpj, jpjm1, jpk
       USE par_trc,           ONLY: jptra
       USE sms_medusa,        ONLY: friver_dep,                               &
@@ -91,6 +91,4 @@
                                    xxi
       USE trc,               ONLY: med_diag, tra
-      USE trd_oce,           ONLY: jptra_sms 
-      USE trdtrc
 
    !!* Substitution
@@ -121,7 +119,4 @@
       !! temporary variables
       REAL(wp) :: fq0
-
-      !! trend temporary array:
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmed
 
       !!==========================================================
@@ -739,14 +734,4 @@
       ENDDO
 
-      !! MEDUSA SMS trends:
-      IF( l_trdtrc ) THEN
-          CALL wrk_alloc( jpi, jpj, jpk, ztrmed )
-          DO jn = jp_msa0, jp_msa1
-            ztrmed(:,:,:) = tra(:,:,:,jn)
-            CALL trd_trc( ztrmed, jn, jptra_sms, kt )   ! save trends
-          END DO
-          CALL wrk_dealloc( jpi, jpj, jpk, ztrmed )
-      END IF
-
       DO jj = 2,jpjm1
          DO ji = 2,jpim1
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsms_medusa.F90
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsms_medusa.F90	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsms_medusa.F90	(revision 8463)
@@ -22,4 +22,9 @@
    USE trcsed_medusa
    USE trcavg_medusa
+   !! for SMS trends
+   USE par_medusa,    ONLY: jp_msa0, jp_msa1
+   USE par_oce,       ONLY: jpi, jpj, jpk
+   USE trd_oce,       ONLY: jptra_sms, l_trdtrc
+   USE trdtrc
 
 
@@ -46,4 +51,9 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) :: kt   ! ocean time-step index
+      !! Loop variables
+      INTEGER :: jn
+      !! trend temporary array:
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmed
+
 
 # if defined key_debug_medusa
@@ -95,4 +105,15 @@
 # endif
 
+      !! MEDUSA SMS trends:
+      IF( l_trdtrc ) THEN
+          CALL wrk_alloc( jpi, jpj, jpk, ztrmed )
+          DO jn = jp_msa0, jp_msa1
+            ztrmed(:,:,:) = tra(:,:,:,jn)
+            CALL trd_trc( ztrmed, jn, jptra_sms, kt )   ! save trends
+          END DO
+          CALL wrk_dealloc( jpi, jpj, jpk, ztrmed )
+      END IF
+
+
    END SUBROUTINE trc_sms_medusa
    
Index: /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 8462)
+++ /branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 8463)
@@ -79,5 +79,5 @@
       
       !                                        !   Parameters of additional diagnostics
-      IF( .NOT. lk_offline ) CALL trc_nam_dia
+      IF( .NOT. lk_iomput )  CALL trc_nam_dia
 
       !                                        !   namelist of transport
