Index: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90
===================================================================
--- branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90	(revision 2610)
+++ branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90	(revision 2636)
@@ -4,37 +4,32 @@
    !! Ocean trends :   set tracer and momentum trend variables
    !!======================================================================
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/TRD/trdmld_oce.F90,v 1.2 2005/03/27 18:35:23 opalod Exp $ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-#if defined key_top
+#if defined key_top   ||   defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
 
-   USE par_oce                        ! ocean parameters
-   USE par_trc                        ! passive tracers parameters
+   USE par_oce       ! ocean parameters
+   USE par_trc       ! passive tracers parameters
 
    IMPLICIT NONE
    PUBLIC
 
-   !!* Namelist namtoptrd:  diagnostics on passive tracers trends
-   INTEGER  ::    nn_trd_trc                 !: time step frequency dynamics and tracers trends
-   INTEGER  ::    nn_ctls_trc                !: control surface type for trends vertical integration
+   !                                         !!* Namelist namtoptrd:  diagnostics on passive tracers trends
+   INTEGER  ::    nn_trd_trc                  !: time step frequency dynamics and tracers trends
+   INTEGER  ::    nn_ctls_trc                 !: control surface type for trends vertical integration
    REAL(wp) ::    rn_ucf_trc                  !: unit conversion factor (for netCDF trends outputs)
-   LOGICAL  ::    ln_trdmld_trc_instant    !: flag to diagnose inst./mean ML trc trends
-   LOGICAL  ::    ln_trdmld_trc_restart    !: flag to restart mixed-layer trc diagnostics
-   CHARACTER(len=50) ::  cn_trdrst_trc_in  !: suffix of pass. tracer restart name (input)
-   CHARACTER(len=50) ::  cn_trdrst_trc_out !: suffix of pass. tracer restart name (output)
+   LOGICAL  ::    ln_trdmld_trc_instant       !: flag to diagnose inst./mean ML trc trends
+   LOGICAL  ::    ln_trdmld_trc_restart       !: flag to restart mixed-layer trc diagnostics
+   CHARACTER(len=50) ::  cn_trdrst_trc_in     !: suffix of pass. tracer restart name (input)
+   CHARACTER(len=50) ::  cn_trdrst_trc_out    !: suffix of pass. tracer restart name (output)
    LOGICAL, DIMENSION (jptra) ::   ln_trdtrc  !: large trends diagnostic to write or not (namelist)
 
 # if defined key_trdtrc && defined key_iomput
    LOGICAL, PARAMETER ::   lk_trdtrc = .TRUE. 
-#else
+# else
    LOGICAL, PARAMETER ::   lk_trdtrc = .FALSE.   !: ML trend flag
-#endif
+# endif
 
-#if defined key_trdmld_trc
+# if defined key_trdmld_trc   ||   defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_trdmld_trc'                     mixed layer trends diagnostics
@@ -108,9 +103,9 @@
       tmltrdm_trc                                !: total cumulative trends over the analysis window
 
-#else
+# else
    LOGICAL, PARAMETER ::   lk_trdmld_trc = .FALSE.   !: ML trend flag
-#endif
+# endif
 
-#if defined key_lobster
+# if defined key_lobster
    CHARACTER(LEN=80) :: clname_bio, ctrd_bio(jpdiabio,2)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  &
@@ -121,23 +116,17 @@
       tmltrd_csum_ub_bio                         !: before (prev. analysis period) cumulated sum over the
                                                  !: upper triangle
-#endif
-
-#else
+# endif
    !!----------------------------------------------------------------------
-   !!  Empty module :                                     No passive tracer
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/TRD/trdmld_oce.F90,v 1.2 2005/03/27 18:35:23 opalod Exp $ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-#endif
-
-#if defined key_top
 CONTAINS
 
-   FUNCTION trd_mod_trc_oce_alloc()
+   INTEGER FUNCTION trd_mod_trc_oce_alloc()
       !!----------------------------------------------------------------------
       !!         *** ROUTINE trd_mod_trc_oce_alloc ***
       !!----------------------------------------------------------------------
-      USE in_out_manager, ONLY: ctl_warn
-      !
-      INTEGER :: trd_mod_trc_oce_alloc
-      ! Locals
+      USE lib_mpp, ONLY: ctl_warn
       INTEGER :: ierr(2)
       !!----------------------------------------------------------------------
@@ -145,5 +134,5 @@
       ierr(:) = 0
 
-#if defined key_trdmld_trc
+# if defined key_trdmld_trc
       ALLOCATE(nmld_trc(jpi,jpj),          nbol_trc(jpi,jpj),           &
                wkx_trc(jpi,jpj,jpk),       rmld_trc(jpi,jpj),           &
@@ -166,6 +155,6 @@
                tmltrdm_trc(jpi,jpj,jptra),                   &
                Stat=ierr(1))
-#endif
-#if defined key_lobster
+# endif
+# if defined key_lobster
       ALLOCATE(tmltrd_bio(jpi,jpj,jpdiabio),         &
                tmltrd_sum_bio(jpi,jpj,jpdiabio),     &
@@ -173,20 +162,22 @@
                tmltrd_csum_ub_bio(jpi,jpj,jpdiabio), &
                Stat=ierr(2))
-#endif
+# endif
 
       trd_mod_trc_oce_alloc = MAXVAL(ierr)
 
-      IF(trd_mod_trc_oce_alloc /= 0)THEN
-         CALL ctl_warn('trd_mod_trc_oce_alloc : failed to allocate arrays.')
-      END IF
+      IF( trd_mod_trc_oce_alloc /= 0 )   CALL ctl_warn('trd_mod_trc_oce_alloc : failed to allocate arrays')
 
-#if defined key_trdmld_trc
-      ! Initialise what used to be a parameter - max level for mixed-layer 
-      ! trends diag.
-      jpktrd_trc = jpk
+# if defined key_trdmld_trc
+      jpktrd_trc = jpk      ! Initialise what used to be a parameter - max level for mixed-layer trends diag.
+# endif
+      !
+   END FUNCTION trd_mod_trc_oce_alloc
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Empty module :                                     No passive tracer
+   !!----------------------------------------------------------------------
 #endif
 
-   END FUNCTION trd_mod_trc_oce_alloc
-#endif
-
+   !!======================================================================
 END MODULE trdmod_trc_oce
