Index: /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 5830)
+++ /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 5831)
@@ -74,6 +74,4 @@
       !! ** Action  : - pta  becomes the after tracer
       !!---------------------------------------------------------------------
-      USE oce     , ONLY:   zwd => ua       , zws => va         ! (ua,va) used as 3D workspace
-      !
       INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index
       INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index
@@ -86,10 +84,10 @@
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::  zrhs, ze3tb, ze3tn, ze3ta   ! local scalars
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi, zwt
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi, zwt, zwd, zws
       !!---------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_zdf_imp')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwi, zwt ) 
+      CALL wrk_alloc( jpi,jpj,jpk,   zwi, zwt, zwd, zws ) 
       !
       IF( kt == kit000 )  THEN
@@ -226,5 +224,5 @@
       !                                               ! ================= !
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwi, zwt ) 
+      CALL wrk_dealloc( jpi,jpj,jpk,   zwi, zwt, zwd, zws ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_zdf_imp')
Index: /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
===================================================================
--- /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 5830)
+++ /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 5831)
@@ -11,13 +11,15 @@
 
    !!----------------------------------------------------------------------
-   !!   zdf_evd      : increase the momentum and tracer Kz at the location of
-   !!                  statically unstable portion of the water column (ln_zdfevd=T)
+   !!   zdf_evd       : increase the momentum and tracer Kz at the location of
+   !!                   statically unstable portion of the water column (ln_zdfevd=T)
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain variables
    USE zdf_oce         ! ocean vertical physics variables
+   !
    USE in_out_manager  ! I/O manager
    USE iom             ! for iom_put
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE wrk_nemo        ! work arrays
    USE timing          ! Timing
 
@@ -51,9 +53,8 @@
       !! References :   Lazar, A., these de l'universite Paris VI, France, 1997
       !!----------------------------------------------------------------------
-      USE oce,   zavt_evd => ua , zavm_evd => va  ! (ua,va) used ua workspace
-      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step indexocean time step
       !
       INTEGER ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zavt_evd, zavm_evd
       !!----------------------------------------------------------------------
       !
@@ -66,7 +67,9 @@
          IF(lwp) WRITE(numout,*)
       ENDIF
-
+      !
+      CALL wrk_alloc( jpi,jpj,jpk,   zavt_evd, zavm_evd ) 
+      !
       zavt_evd(:,:,:) = avt(:,:,:)           ! set avt prior to evd application
-
+      !
       SELECT CASE ( nn_evdm )
       !
@@ -111,4 +114,6 @@
       CALL iom_put( "avt_evd", zavt_evd )              ! output this change
       !
+      CALL wrk_dealloc( jpi,jpj,jpk,   zavt_evd, zavm_evd ) 
+      !
       IF( nn_timing == 1 )  CALL timing_stop('zdf_evd')
       !
Index: /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 5830)
+++ /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 5831)
@@ -105,17 +105,17 @@
       !!              Koch-Larrouy et al. 2007, GRL.
       !!----------------------------------------------------------------------
-      USE oce, zav_tide  =>   ua    ! use ua as workspace
-      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step 
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   ztpc         ! scalar workspace
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zkz
+      REAL(wp), POINTER, DIMENSION(:,:)   ::   zkz
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zav_tide
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('zdf_tmx')
       !
-      CALL wrk_alloc( jpi,jpj, zkz )
-
+      CALL wrk_alloc( jpi,jpj,       zkz )
+      CALL wrk_alloc( jpi,jpj,jpk,   zav_tide )
+      !
       !                          ! ----------------------- !
       !                          !  Standard tidal mixing  !  (compute zav_tide)
@@ -180,5 +180,6 @@
       IF(ln_ctl)   CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk)
       !
-      CALL wrk_dealloc( jpi,jpj, zkz )
+      CALL wrk_dealloc( jpi,jpj,       zkz )
+      CALL wrk_dealloc( jpi,jpj,jpk,   zav_tide )
       !
       IF( nn_timing == 1 )  CALL timing_stop('zdf_tmx')
@@ -351,15 +352,13 @@
       !!              Koch-Larrouy et al. 2007, GRL.
       !!----------------------------------------------------------------------
-      USE oce     ,         zav_tide =>  ua         ! ua used as workspace
-      !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       INTEGER  ::   inum         ! local integer
       INTEGER  ::   ios
       REAL(wp) ::   ztpc, ze_z   ! local scalars
-      REAL(wp), DIMENSION(:,:)  , POINTER ::  zem2, zek1   ! read M2 and K1 tidal energy
-      REAL(wp), DIMENSION(:,:)  , POINTER ::  zkz          ! total M2, K1 and S2 tidal energy
-      REAL(wp), DIMENSION(:,:)  , POINTER ::  zfact        ! used for vertical structure function
-      REAL(wp), DIMENSION(:,:)  , POINTER ::  zhdep        ! Ocean depth 
-      REAL(wp), DIMENSION(:,:,:), POINTER ::  zpc      ! power consumption
+      REAL(wp), DIMENSION(:,:)  , POINTER ::  zem2, zek1     ! read M2 and K1 tidal energy
+      REAL(wp), DIMENSION(:,:)  , POINTER ::  zkz            ! total M2, K1 and S2 tidal energy
+      REAL(wp), DIMENSION(:,:)  , POINTER ::  zfact          ! used for vertical structure function
+      REAL(wp), DIMENSION(:,:)  , POINTER ::  zhdep          ! Ocean depth 
+      REAL(wp), DIMENSION(:,:,:), POINTER ::  zpc, zav_tide  ! power consumption
       !!
       NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf
@@ -368,17 +367,17 @@
       IF( nn_timing == 1 )  CALL timing_start('zdf_tmx_init')
       !
-      CALL wrk_alloc( jpi,jpj, zem2, zek1, zkz, zfact, zhdep )
-      CALL wrk_alloc( jpi,jpj,jpk, zpc )
-      
-      REWIND( numnam_ref )              ! Namelist namzdf_tmx in reference namelist : Tidal Mixing
+      CALL wrk_alloc( jpi,jpj,       zem2, zek1, zkz, zfact, zhdep )
+      CALL wrk_alloc( jpi,jpj,jpk,   zpc, zav_tide )
+      !
+      REWIND( numnam_ref )             ! Namelist namzdf_tmx in reference namelist : Tidal Mixing
       READ  ( numnam_ref, namzdf_tmx, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp )
-
-      REWIND( numnam_cfg )              ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing
+      !
+      REWIND( numnam_cfg )             ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing
       READ  ( numnam_cfg, namzdf_tmx, IOSTAT = ios, ERR = 902 )
 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp )
       IF(lwm) WRITE ( numond, namzdf_tmx )
-
-      IF(lwp) THEN                   ! Control print
+      !
+      IF(lwp) THEN                     ! Control print
          WRITE(numout,*)
          WRITE(numout,*) 'zdf_tmx_init : tidal mixing'
@@ -392,27 +391,23 @@
          WRITE(numout,*) '      ITF tidal dissipation efficiency      = ', rn_tfe_itf
       ENDIF
-
-      !                              ! allocate tmx arrays
+      !                                ! allocate tmx arrays
       IF( zdf_tmx_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' )
 
-      IF( ln_tmx_itf ) THEN          ! read the Indonesian Through Flow mask
+      IF( ln_tmx_itf ) THEN            ! read the Indonesian Through Flow mask
          CALL iom_open('mask_itf',inum)
          CALL iom_get (inum, jpdom_data, 'tmaskitf',mask_itf,1) ! 
          CALL iom_close(inum)
       ENDIF
-
-      ! read M2 tidal energy flux : W/m2  ( zem2 < 0 )
+      !                                ! read M2 tidal energy flux : W/m2  ( zem2 < 0 )
       CALL iom_open('M2rowdrg',inum)
       CALL iom_get (inum, jpdom_data, 'field',zem2,1) ! 
       CALL iom_close(inum)
-
-      ! read K1 tidal energy flux : W/m2  ( zek1 < 0 )
+      !                                ! read K1 tidal energy flux : W/m2  ( zek1 < 0 )
       CALL iom_open('K1rowdrg',inum)
       CALL iom_get (inum, jpdom_data, 'field',zek1,1) ! 
       CALL iom_close(inum)
- 
-      ! Total tidal energy ( M2, S2 and K1  with S2=(1/2)^2 * M2 )
-      ! only the energy available for mixing is taken into account,
-      ! (mixing efficiency tidal dissipation efficiency)
+      !                                ! Total tidal energy ( M2, S2 and K1  with S2=(1/2)^2 * M2 )
+      !                                ! only the energy available for mixing is taken into account,
+      !                                ! (mixing efficiency tidal dissipation efficiency)
       en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * ssmask(:,:)
 
@@ -421,6 +416,6 @@
 !!gm : you are right, but tidal mixing acts in deep ocean (H>500m) where e3 is O(100m)
 !!     the error is thus ~1% which I feel comfortable with, compared to uncertainties in tidal energy dissipation.
-      ! Vertical structure (az_tmx)
-      DO jj = 1, jpj                ! part independent of the level
+      !                                ! Vertical structure (az_tmx)
+      DO jj = 1, jpj                         ! part independent of the level
          DO ji = 1, jpi
             zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1)       ! depth of the ocean
@@ -429,5 +424,5 @@
          END DO
       END DO
-      DO jk= 1, jpk                 ! complete with the level-dependent part
+      DO jk= 1, jpk                          ! complete with the level-dependent part
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -437,5 +432,5 @@
       END DO
 !===========
-
+      !
       IF( nprint == 1 .AND. lwp ) THEN
          ! Control print
@@ -446,6 +441,6 @@
             zav_tide(:,:,jk) = az_tmx(:,:,jk) / MAX( rn_n2min, rn2(:,:,jk) )
          END DO
-
-         ztpc = 0.e0
+         !
+         ztpc = 0._wp
          zpc(:,:,:) = MAX(rn_n2min,rn2(:,:,:)) * zav_tide(:,:,:)
          DO jk= 2, jpkm1
@@ -458,12 +453,11 @@
          IF( lk_mpp )   CALL mpp_sum( ztpc )
          ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc
-
+         !
          WRITE(numout,*) 
          WRITE(numout,*) '          Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW'
-
-
+         !
          ! control print 2
          zav_tide(:,:,:) = MIN( zav_tide(:,:,:), 60.e-4 )   
-         zkz(:,:) = 0.e0
+         zkz(:,:) = 0._wp
          DO jk = 2, jpkm1
                zkz(:,:) = zkz(:,:) + fse3w(:,:,jk) * MAX(0.e0, rn2(:,:,jk)) * rau0 * zav_tide(:,:,jk) * wmask(:,:,jk)
@@ -486,9 +480,9 @@
          END DO
          WRITE(numout,*) '          Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) )
-
+         !
          DO jk = 2, jpkm1
             zav_tide(:,:,jk) = zav_tide(:,:,jk) * MIN( zkz(:,:), 30./6. ) * wmask(:,:,jk)  !kz max = 300 cm2/s
          END DO
-         ztpc = 0.e0
+         ztpc = 0._wp
          zpc(:,:,:) = Max(0.e0,rn2(:,:,:)) * zav_tide(:,:,:)
          DO jk= 1, jpk
Index: /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 5830)
+++ /branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 5831)
@@ -38,6 +38,4 @@
 
    !* ocean fields: here now and after fields *
-   USE oce , ONLY :   ua      =>    ua      !: i-horizontal velocity (m s-1) 
-   USE oce , ONLY :   va      =>    va      !: j-horizontal velocity (m s-1)
    USE oce , ONLY :   un      =>    un      !: i-horizontal velocity (m s-1) 
    USE oce , ONLY :   vn      =>    vn      !: j-horizontal velocity (m s-1)
