Index: branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90
===================================================================
--- branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90	(revision 3318)
+++ branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90	(revision 3325)
@@ -5,5 +5,5 @@
    !!=====================================================================
    !! History :  3.5  !  2012-02  (G. Madec) creation from trdmod: split DYN and TRA trends
-   !!                           and manage  3D trends output for U, V, and KE
+   !!                                        and manage  3D trends output for U, V, and KE
    !!----------------------------------------------------------------------
 
@@ -21,7 +21,8 @@
    USE sbc_oce        ! surface boundary condition: ocean
    USE phycst         ! physical constants
-   USE trdvor         ! ocean vorticity trends 
-   USE trdglo         ! trends:global domain averaged
-   USE trdmld         ! ocean active mixed layer tracers trends 
+   USE trdken         ! trends: Kinetic ENergy 
+   USE trdglo         ! trends: global domain averaged
+   USE trdvor         ! trends: vertical averaged vorticity 
+   USE trdmld         ! trends: mixed layer averaged 
    USE in_out_manager ! I/O manager
    USE iom            ! I/O manager library
@@ -31,6 +32,4 @@
    IMPLICIT NONE
    PRIVATE
-
-   REAL(wp) ::   r2dt    ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0
 
    PUBLIC trd_dyn        ! called by all dynXX modules
@@ -57,14 +56,11 @@
       INTEGER                   , INTENT(in   ) ::   ktrd           ! trend index
       INTEGER                   , INTENT(in   ) ::   kt             ! time step
-      !!
-      INTEGER ::   ji, jj   ! dummy loop indices
-      REAL(wp), POINTER, DIMENSION(:,:) ::   ztswu, ztswv    ! 2D workspace 
       !!----------------------------------------------------------------------
+      !
+      putrd(:,:,:) = putrd(:,:,:) * umask(:,:,:)                       ! mask the trends
+      pvtrd(:,:,:) = pvtrd(:,:,:) * vmask(:,:,:)
+      !
 
-      CALL wrk_alloc( jpi, jpj, ztswu, ztswv )
-
-      IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt      ! = rdtra (restart with Euler time stepping)
-      ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt      ! = 2 rdttra (leapfrog)
-      ENDIF
+!!gm NB : here a lbc_lnk should probably be added
 
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -81,5 +77,5 @@
       !  Kinetic Energy trends
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!gm      IF( ln_KE_trd  )   CALL trd_KE( putrd, pvtrd, ktrd, kt )
+      IF( ln_KE_trd  )   CALL trd_ken( putrd, pvtrd, ktrd, kt )
 
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -92,6 +88,4 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 !!gm      IF( ln_dyn_mld )   CALL trd_mld_dyn   
-      !
-      CALL wrk_dealloc( jpi, jpj, ztswu, ztswv )
       !
    END SUBROUTINE trd_dyn
@@ -113,10 +107,4 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3dx, z3dy                 ! 3D workspace 
       !!----------------------------------------------------------------------
-      !
-      putrd(:,:,:) = putrd(:,:,:) * umask(:,:,:)                       ! mask the trends
-      pvtrd(:,:,:) = pvtrd(:,:,:) * vmask(:,:,:)
-
-!!gm NB : here a lbc_lnk should probably be added
-
       !
       SELECT CASE( ktrd )
@@ -151,6 +139,6 @@
                               CALL iom_put( "vtrd_zdf", pvtrd )
                               !                                    ! wind stress trends
-                              z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 )
-                              z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 )
+                              z2dx(:,:) = ( utau_b(:,:) + utau(:,:) ) / ( fse3u(:,:,1) * rau0 )
+                              z2dy(:,:) = ( vtau_b(:,:) + vtau(:,:) ) / ( fse3v(:,:,1) * rau0 )
                               CALL iom_put( "utrd_tau", z2dx )
                               CALL iom_put( "vtrd_tau", z2dy )
