Index: /trunk/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/oce_trc.F90	(revision 1176)
+++ /trunk/NEMO/TOP_SRC/oce_trc.F90	(revision 1177)
@@ -154,7 +154,5 @@
    USE oce , ONLY :   rhop    =>    rhop    !: potential volumic mass (kg m-3) 
    USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units)
-# if defined key_trc_diatrd
    USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s)
-# endif
 
 
@@ -206,4 +204,5 @@
 
    !* mixing & mixed layer depth *
+   USE zdfmxl , ONLY :   nmln        =>   nmln        !: number of level in the mixed layer
    USE zdfmxl , ONLY :   hmld        =>   hmld        !: mixing layer depth (turbocline)
    USE zdfmxl , ONLY :   hmlp        =>   hmlp        !: mixed layer depth  (rho=rho0+zdcrit) (m)
Index: /trunk/NEMO/TOP_SRC/trcini.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trcini.F90	(revision 1176)
+++ /trunk/NEMO/TOP_SRC/trcini.F90	(revision 1177)
@@ -26,4 +26,7 @@
    USE trcini_my_trc   ! MY_TRC  initialisation
    USE trcdta          ! 
+   USE trdmld_trc_oce
+   USE trdmld_trc
+
    USE in_out_manager  ! I/O manager
    USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
@@ -118,4 +121,6 @@
       ENDIF
 
+      IF( lk_trdmld_trc  )  CALL trd_mld_trc_init     ! trends: Mixed-layer
+
       !                 ! Computation content of all tracers
       trai = 0.e0
Index: /trunk/NEMO/TOP_SRC/trclec.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trclec.F90	(revision 1176)
+++ /trunk/NEMO/TOP_SRC/trclec.F90	(revision 1177)
@@ -27,4 +27,5 @@
    USE trclsm_my_trc     ! MY_TRC SMS namelist
    USE in_out_manager    ! I/O manager
+   USE trdmld_trc_oce
 
    IMPLICIT NONE
@@ -69,6 +70,8 @@
       !!
       NAMELIST/namtoptrc/ ndttrc, nwritetrc, lrsttr, nrsttr, tracer
-#if defined key_trc_diatrd
-      NAMELIST/namtoptrd/ luttrd, nwritetrd                                             ! dynamical trends
+#if defined key_trdmld_trc || defined key_trc_diatrd
+      NAMELIST/namtoptrd/ ntrd_trc, nctls_trc, ucf_trc, &
+                         ln_trdmld_trc_restart, ln_trdmld_trc_instant, &
+                         luttrd
 #endif
 
@@ -131,22 +134,27 @@
       ENDIF
 
-#if defined key_trc_diatrd
+#if defined key_trdmld_trc || defined key_trc_diatrd
 
       ! Namelist natrtd (transport trends)
       ! ----------------------------------------------
-      nwritetrd = 10                 ! default values (no dynamical trend recording)
+      ntrd_trc  = 20
+      nctls_trc =  6
+      ucf_trc   =  1.
+      ln_trdmld_trc_instant = .TRUE.
+      ln_trdmld_trc_restart =.FALSE.
       DO jn = 1, jptra
          luttrd(jn) = .FALSE.
       END DO
 
-      REWIND( numnat )               ! read natrtd
+      REWIND( numnat )               !  namelist namtoptrd : passive tracer trends diagnostic
       READ  ( numnat, namtoptrd )
 
-      nkeep=0
-      ikeep(:)=0
+#if defined key_trc_diatrd
+      nkeep    = 0
+      ikeep(:) = 0
       DO jn = 1, jptra
          IF( luttrd(jn) ) THEN 
-             nkeep    = nkeep + 1
-             ikeep(jn)=nkeep
+             nkeep     = nkeep + 1
+             ikeep(jn) = nkeep
          END IF 
       END DO
@@ -156,14 +164,32 @@
       ENDIF 
 
-      IF(lwp) THEN                   ! control print
+      nwritetrd = ntrd_trc
+#endif
+
+     IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) ' Namelist : namtoptrd'
-         WRITE(numout,*) '    frequency of outputs for dynamical trends nwritetrd = ', nwritetrd
+         WRITE(numout,*) ' trd_mld_trc_init : read namelist namtoptrd                        '
+         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~                                               '
+         WRITE(numout,*) '   * frequency of trends diagnostics   ntrd_trc               = ', ntrd_trc
+         WRITE(numout,*) '   * control surface type              nctls_trc              = ', nctls_trc
+         WRITE(numout,*) '   * restart for ML diagnostics        ln_trdmld_trc_restart  = ', ln_trdmld_trc_restart
+         WRITE(numout,*) '   * flag to diagnose trends of                                 '
+         WRITE(numout,*) '     instantantaneous or mean ML T/S   ln_trdmld_trc_instant  = ', ln_trdmld_trc_instant
+         WRITE(numout,*) '   * unit conversion factor            ucf_trc                = ', ucf_trc
+#if defined key_trdmld_trc
+         DO jn = 1, jptra
+            WRITE(numout,*) '    keep dynamical trends for tracer number :', jn, luttrd(jn)
+         END DO
+#else
          DO jn = 1, jptra
             WRITE(numout,*) '    keep dynamical trends for tracer number :', jn, luttrd(jn), ikeep(jn)
          END DO
+
+         WRITE(numout,*)
          WRITE(numout,*) '    total = ', nkeep, ' tracers dyn trends saved'
          WRITE(numout,*) '    size of trtrd = ', jpi*jpj*jpk*nkeep*jpdiatrc
-      ENDIF
+#endif
+      ENDIF
+
 #endif
 
Index: /trunk/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trcrst.F90	(revision 1176)
+++ /trunk/NEMO/TOP_SRC/trcrst.F90	(revision 1177)
@@ -230,5 +230,7 @@
           CALL trc_rst_stat            ! statistics
           CALL iom_close( numrtw )     ! close the restart file (only at last time step)
+#if ! defined key_trdmld_trc
           lrst_trc = .FALSE.
+#endif
        ENDIF
       !
