Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 3231)
@@ -49,6 +49,4 @@
       !! ** Action  :   (ua,va) updated with the now vorticity term trend
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !
@@ -61,7 +59,5 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_adv_cen2')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zfu_t, zfv_t, zfu_f, zfv_f, zfu_uw, zfv_vw, zfw )
-      zfu => tsa(:,:,:,1) 
-      zfv => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi, jpj, jpk, zfu_t, zfv_t, zfu_f, zfv_f, zfu_uw, zfv_vw, zfu, zfv, zfw )
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -163,5 +159,5 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zfu_t, zfv_t, zfu_f, zfv_f, zfu_uw, zfv_vw, zfw )
+      CALL wrk_dealloc( jpi, jpj, jpk, zfu_t, zfv_t, zfu_f, zfv_f, zfu_uw, zfv_vw, zfu, zfv, zfw )
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_adv_cen2')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 3231)
@@ -70,6 +70,4 @@
       !! Reference : Shchepetkin & McWilliams, 2005, Ocean Modelling. 
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !
       INTEGER, INTENT(in) ::   kt     ! ocean time-step index
       !
@@ -84,8 +82,6 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_adv_ubs')
       !
-      CALL wrk_alloc( jpi, jpj, jpk,       zfu_t , zfv_t , zfu_f , zfv_f, zfu_uw, zfv_vw, zfw )
-      CALL wrk_alloc( jpi, jpj, jpk, jpts, zlu_uu, zlv_vv, zlu_uv, zlv_vu                     )
-      zfu => tsa(:,:,:,1) 
-      zfv => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi, jpj, jpk,       zfu_t , zfv_t , zfu_f , zfv_f, zfu_uw, zfv_vw, zfu, zfv, zfw )
+      CALL wrk_alloc( jpi, jpj, jpk, jpts, zlu_uu, zlv_vv, zlu_uv, zlv_vu                               )
       !
       IF( kt == nit000 ) THEN
@@ -255,6 +251,6 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      CALL wrk_dealloc( jpi, jpj, jpk,       zfu_t , zfv_t , zfu_f , zfv_f, zfu_uw, zfv_vw, zfw )
-      CALL wrk_dealloc( jpi, jpj, jpk, jpts, zlu_uu, zlv_vv, zlu_uv, zlv_vu                     )
+      CALL wrk_dealloc( jpi, jpj, jpk,       zfu_t , zfv_t , zfu_f , zfv_f, zfu_uw, zfv_vw, zfu, zfv, zfw )
+      CALL wrk_dealloc( jpi, jpj, jpk, jpts, zlu_uu, zlv_vv, zlu_uv, zlv_vu                               )
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_adv_ubs')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 3231)
@@ -19,4 +19,5 @@
    USE prtctl          ! Print control
    USE timing          ! Timing
+   USE wrk_nemo        ! Memory Allocation
 
    IMPLICIT NONE
@@ -44,6 +45,4 @@
       !! ** Action  :   (ua,va)   momentum trend increased by bottom friction trend
       !!---------------------------------------------------------------------
-      USE oce, ONLY:   ztrduv => tsa   ! tsa used as 4D workspace
-      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !! 
@@ -51,4 +50,5 @@
       INTEGER  ::   ikbu, ikbv   ! local integers
       REAL(wp) ::   zm1_2dt      ! local scalar
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
       !!---------------------------------------------------------------------
       !
@@ -62,6 +62,7 @@
 
         IF( l_trddyn )   THEN                      ! temporary save of ua and va trends
-           ztrduv(:,:,:,1) = ua(:,:,:)
-           ztrduv(:,:,:,2) = va(:,:,:)
+           CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
+           ztrdu(:,:,:) = ua(:,:,:)
+           ztrdv(:,:,:) = va(:,:,:)
         ENDIF
 
@@ -85,7 +86,8 @@
         !
         IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
-           ztrduv(:,:,:,1) = ua(:,:,:) - ztrduv(:,:,:,1)
-           ztrduv(:,:,:,2) = va(:,:,:) - ztrduv(:,:,:,2)
-           CALL trd_mod( ztrduv(:,:,:,1), ztrduv(:,:,:,2), jpdyn_trd_bfr, 'DYN', kt )
+           ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
+           ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
+           CALL trd_mod( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_trd_bfr, 'DYN', kt )
+           CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
         ENDIF
         !                                          ! print mean trends (used for debugging)
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 3231)
@@ -76,6 +76,4 @@
       !!             - Save the trend (l_trddyn=T)
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   tsa                         ! (tsa) used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
@@ -85,7 +83,5 @@
       !
       IF( l_trddyn ) THEN                    ! Temporary saving of ua and va trends (l_trddyn)
-         ztrdu => tsa(:,:,:,1) 
-         ztrdv => tsa(:,:,:,2) 
-         !
+         CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
          ztrdu(:,:,:) = ua(:,:,:)  
          ztrdv(:,:,:) = va(:,:,:) 
@@ -104,4 +100,5 @@
          ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
          CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_hpg, 'DYN', kt )
+         CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
       ENDIF          
       !
@@ -191,6 +188,4 @@
       !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   tsa                         ! (tsa) used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
       !!
@@ -199,7 +194,6 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zhpi, zhpj 
       !!----------------------------------------------------------------------
-      
-      zhpi => tsa(:,:,:,1) 
-      zhpj => tsa(:,:,:,2) 
+      !  
+      CALL wrk_alloc( jpi,jpj,jpk, zhpi, zhpj )
       !
       IF( kt == nit000 ) THEN
@@ -245,4 +239,6 @@
       END DO
       !
+      CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zhpj )
+      !
    END SUBROUTINE hpg_zco
 
@@ -256,6 +252,4 @@
       !! ** Action  : - Update (ua,va) with the now hydrastatic pressure trend
       !!---------------------------------------------------------------------- 
-      USE oce, ONLY:   tsa                         ! (tsa) used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
       !!
@@ -265,7 +259,6 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zhpi, zhpj 
       !!----------------------------------------------------------------------
-       
-      zhpi => tsa(:,:,:,1) 
-      zhpj => tsa(:,:,:,2) 
+      !
+      CALL wrk_alloc( jpi,jpj,jpk, zhpi, zhpj )
       !
       IF( kt == nit000 ) THEN
@@ -343,5 +336,6 @@
       END DO
       !
-
+      CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zhpj )
+      !
    END SUBROUTINE hpg_zps
 
@@ -365,6 +359,4 @@
       !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   tsa                         ! (tsa) used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
       !!
@@ -373,7 +365,6 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zhpi, zhpj 
       !!----------------------------------------------------------------------
-
-      zhpi => tsa(:,:,:,1) 
-      zhpj => tsa(:,:,:,2) 
+      !
+      CALL wrk_alloc( jpi,jpj,jpk, zhpi, zhpj )
       !
       IF( kt == nit000 ) THEN
@@ -432,4 +423,6 @@
       END DO
       !
+      CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zhpj )
+      !
    END SUBROUTINE hpg_sco
 
@@ -442,6 +435,4 @@
       !! Reference: Shchepetkin and McWilliams, J. Geophys. Res., 108(C3), 3090, 2003
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa                         ! (tsa) used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
       !!
@@ -458,7 +449,5 @@
       CALL wrk_alloc( jpi, jpj, jpk, dzx  , dzy  , dzz  , dzu  , dzv  , dzw   ) 
       CALL wrk_alloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 
-      CALL wrk_alloc( jpi, jpj, jpk, rho_i, rho_j, rho_k                      ) 
-      zhpi => tsa(:,:,:,1) 
-      zhpj => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi, jpj, jpk, rho_i, rho_j, rho_k,  zhpi,  zhpj        ) 
       !
 
@@ -660,5 +649,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, dzx  , dzy  , dzz  , dzu  , dzv  , dzw   ) 
       CALL wrk_dealloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 
-      CALL wrk_dealloc( jpi, jpj, jpk, rho_i, rho_j, rho_k                      ) 
+      CALL wrk_dealloc( jpi, jpj, jpk, rho_i, rho_j, rho_k,  zhpi,  zhpj        ) 
       !
    END SUBROUTINE hpg_djc
@@ -678,7 +667,4 @@
       !!
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa                          ! (tsa) used as 2 3D workspace
-      !!----------------------------------------------------------------------
-      !!
       INTEGER, PARAMETER  :: polynomial_type = 1    ! 1: cubic spline, 2: linear
       INTEGER, INTENT(in) ::   kt                   ! ocean time-step index
@@ -697,7 +683,6 @@
       !!----------------------------------------------------------------------
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 
-      zdeptht => tsa(:,:,:,1) 
-      zrhh    => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 
+      CALL wrk_alloc( jpi,jpj,jpk, zdeptht, zrhh ) 
       !
       IF( kt == nit000 ) THEN
@@ -955,5 +940,6 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zdeptht, zrhh ) 
       !
    END SUBROUTINE hpg_prj
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90	(revision 3231)
@@ -54,6 +54,4 @@
       !!             - save this trends (l_trddyn=T) for post-processing
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !!
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !!
@@ -75,7 +73,5 @@
 
       IF( l_trddyn ) THEN           ! Save ua and va trends
-         ztrdu => tsa(:,:,:,1) 
-         ztrdv => tsa(:,:,:,2) 
-         !
+         CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
          ztrdu(:,:,:) = ua(:,:,:) 
          ztrdv(:,:,:) = va(:,:,:) 
@@ -136,4 +132,5 @@
          ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
          CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_keg, 'DYN', kt )
+         CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
       ENDIF
       !
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 3231)
@@ -87,18 +87,13 @@
       !!              - save the trend in (zwk3,zwk4) ('key_trddyn')
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !
       INTEGER, INTENT( in ) ::   kt           ! ocean time-step index
       !
       INTEGER ::   ji, jj, jk                 ! dummy loop indices
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwk1, zwk2
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwk3, zwk4
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwk1, zwk2, zwk3, zwk4
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('dyn_ldf_bilapg')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwk1, zwk2 ) 
-      zwk3 => tsa(:,:,:,1) 
-      zwk4 => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi, jpj, jpk, zwk1, zwk2, zwk3, zwk4 ) 
       !
       IF( kt == nit000 ) THEN
@@ -135,5 +130,5 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwk1, zwk2 ) 
+      CALL wrk_dealloc( jpi, jpj, jpk, zwk1, zwk2, zwk3, zwk4 ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_ldf_bilapg')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 3231)
@@ -40,4 +40,5 @@
    USE lbclnk          ! lateral boundary condition (or mpp link)
    USE lib_mpp         ! MPP library
+   USE wrk_nemo        ! Memory Allocation
    USE prtctl          ! Print control
 #if defined key_agrif
@@ -93,6 +94,4 @@
       !!               un,vn   now horizontal velocity of next time-step
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
       !
@@ -109,6 +108,5 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_nxt')
       !
-      ze3u_f => tsa(:,:,:,1) 
-      ze3v_f => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj,jpk, ze3u_f, ze3v_f )
       !
       IF( kt == nit000 ) THEN
@@ -281,4 +279,6 @@
          &                       tab3d_2=vn, clinfo2=' Vn: '       , mask2=vmask )
       ! 
+      CALL wrk_dealloc( jpi,jpj,jpk, ze3u_f, ze3v_f )
+      !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_nxt')
       !
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 3231)
@@ -41,4 +41,5 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! distributed memory computing library
+   USE wrk_nemo        ! Memory Allocation
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
@@ -104,6 +105,4 @@
       !! References : Roullet and Madec 1999, JGR.
       !!---------------------------------------------------------------------
-      USE oce, ONLY:   tsa                 ! tsa used as 2 3D workspace
-      !!
       INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index
       INTEGER, INTENT(  out) ::   kindic   ! solver convergence flag (<0 if not converge)
@@ -116,6 +115,5 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_spg_flt')
       !
-      zub => tsa(:,:,:,1) 
-      zvb => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj,jpk, zub, zvb )
       !
       IF( kt == nit000 ) THEN
@@ -353,4 +351,6 @@
       IF( lrst_oce ) CALL flt_rst( kt, 'WRITE' )
       !
+      CALL wrk_dealloc( jpi,jpj,jpk, zub, zvb )
+      !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_flt')
       !
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 3231)
@@ -75,6 +75,4 @@
       !!               and planetary vorticity trends) ('key_trddyn')
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   tsa            ! tsa used as 2 3D workspace
-      !!
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !
@@ -84,8 +82,5 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_vor')
       !
-      IF( l_trddyn )   THEN
-         ztrdu => tsa(:,:,:,1) 
-         ztrdv => tsa(:,:,:,2) 
-      END IF
+      IF( l_trddyn )   CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
       !
       !                                          ! vorticity term 
@@ -187,4 +182,6 @@
       IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' vor  - Ua: ', mask1=umask,               &
          &                     tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+      !
+      IF( l_trddyn )   CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_vor')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90	(revision 3231)
@@ -55,6 +55,4 @@
       !!              - Save the trends in (ztrdu,ztrdv) ('key_trddyn')
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step inedx
       !
@@ -68,8 +66,6 @@
       IF( nn_timing == 1 )  CALL timing_start('dyn_zad')
       !
-      CALL wrk_alloc( jpi, jpj, zww ) 
-      !
-      zwuw  => tsa(:,:,:,1) 
-      zwvw  => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj, zww ) 
+      CALL wrk_alloc( jpi,jpj,jpk, zwuw , zwvw ) 
       !
       IF( kt == nit000 ) THEN
@@ -129,5 +125,6 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      CALL wrk_dealloc( jpi, jpj, zww ) 
+      CALL wrk_dealloc( jpi,jpj, zww ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zwuw , zwvw ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_zad')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90	(revision 3231)
@@ -57,6 +57,4 @@
       !! ** Action : - Update (ua,va) with the vertical diffusive trend
       !!---------------------------------------------------------------------
-      USE oce     , ONLY:   tsa             ! tsa used as 2 3D workspace
-      !
       INTEGER , INTENT(in) ::   kt     ! ocean time-step index
       REAL(wp), INTENT(in) ::   p2dt   ! time-step 
@@ -64,14 +62,10 @@
       INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
       REAL(wp) ::   zrau0r, zlavmr, zua, zva   ! local scalars
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwx, zwy
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwz, zww
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwx, zwy, zwz, zww
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('dyn_zdf_exp')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwz, zww ) 
-      !
-      zwx => tsa(:,:,:,1) 
-      zwy => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj,jpk, zwx, zwy, zwz, zww ) 
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -126,5 +120,5 @@
       END DO                           ! End of time splitting
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwz, zww ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zwx, zwy, zwz, zww ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_zdf_exp')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 3231)
@@ -57,6 +57,4 @@
       !! ** Action : - Update (ua,va) arrays with the after vertical diffusive mixing trend.
       !!---------------------------------------------------------------------
-      USE oce     , ONLY:   tsa       ! tsa used as 2 3D workspace
-      !!
       INTEGER , INTENT(in) ::  kt     ! ocean time-step index
       REAL(wp), INTENT(in) ::  p2dt   ! vertical profile of tracer time-step
@@ -69,14 +67,10 @@
       REAL(wp) ::   zbfru, zbfrv 
       REAL(wp) ::   zbfr_imp = 0._wp                        ! toggle (SAVE'd by assignment) 
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwd, zws
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi, zwd, zws
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('dyn_zdf_imp')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwi ) 
-      !
-      zwd => tsa(:,:,:,1) 
-      zws => tsa(:,:,:,2) 
+      CALL wrk_alloc( jpi,jpj,jpk, zwi, zwd, zws ) 
       !
       IF( kt == nit000 ) THEN
@@ -251,5 +245,5 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwi ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zwi, zwd, zws ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_zdf_imp')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 3231)
@@ -77,6 +77,4 @@
       !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling.
       !!----------------------------------------------------------------------
-      USE oce     , ONLY: tsa             ! tsa used as 2 3D workspace
-      !!
       INTEGER, INTENT(in) ::   kt   ! time step
       !
@@ -232,5 +230,5 @@
       IF( lk_diaar5 ) THEN                            ! vertical mass transport & its square value
          ! Caution: in the VVL case, it only correponds to the baroclinic mass transport.
-         z3d => tsa(:,:,:,1)
+         CALL wrk_alloc( jpi,jpj,jpk, z3d )
          z2d(:,:) = rau0 * e1t(:,:) * e2t(:,:)
          DO jk = 1, jpk
@@ -239,4 +237,5 @@
          CALL iom_put( "w_masstr" , z3d                     )  
          CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) )
+         CALL wrk_dealloc( jpi,jpj,jpk, z3d )
       ENDIF
       !
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 3231)
@@ -96,7 +96,4 @@
       !!               of now neutral surfaces at u-, w- and v- w-points, resp.
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   zwz => ua       , zww => va   ! (ua,va) used as workspace
-      USE oce     , ONLY:   tsa                           ! (tsa) used as workspace
-      !!
       INTEGER , INTENT(in)                   ::   kt    ! ocean time-step index
       REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   prd   ! in situ density
@@ -110,4 +107,5 @@
       REAL(wp) ::   zcj, zfj, zav, zbv, zaj, zbj   !   -      -
       REAL(wp) ::   zck, zfk,      zbw             !   -      -
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwz, zww
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zdzr
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zgru, zgrv
@@ -116,8 +114,5 @@
       IF( nn_timing == 1 )  CALL timing_start('ldf_slp')
       !
-      CALL wrk_alloc( jpi,jpj,jpk, zdzr )
-      !
-      zgru => tsa(:,:,:,1)
-      zgrv => tsa(:,:,:,2)
+      CALL wrk_alloc( jpi,jpj,jpk, zwz, zww, zdzr, zgru, zgrv )
 
       zeps   =  1.e-20_wp        !==   Local constant initialization   ==!
@@ -366,5 +361,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi,jpj,jpk, zdzr )
+      CALL wrk_dealloc( jpi,jpj,jpk, zwz, zww, zdzr, zgru, zgrv )
       !
       IF( nn_timing == 1 )  CALL timing_stop('ldf_slp')
@@ -387,6 +382,4 @@
       !!             - wslp2              squared slope of neutral surfaces at w-points.
       !!----------------------------------------------------------------------
-      USE oce     , ONLY:   zalbet  => ua       ! use ua as workspace
-      !!
       INTEGER, INTENT( in ) ::   kt             ! ocean time-step index
       !!
@@ -401,4 +394,5 @@
       REAL(wp) ::   zbeta0
       REAL(wp), POINTER, DIMENSION(:,:)     ::   z1_mlbw
+      REAL(wp), POINTER, DIMENSION(:,:,:)   ::   zalbet
       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zdxrho , zdyrho, zdzrho     ! Horizontal and vertical density gradients
       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zti_mlb, ztj_mlb            ! for Griffies operator only
@@ -408,4 +402,5 @@
       !
       CALL wrk_alloc( jpi,jpj, z1_mlbw )
+      CALL wrk_alloc( jpi,jpj,jpk, zalbet )
       CALL wrk_alloc( jpi,jpj,jpk,2, zdxrho , zdyrho, zdzrho,              klstart = 0  )
       CALL wrk_alloc( jpi,jpj,  2,2, zti_mlb, ztj_mlb,        kkstart = 0, klstart = 0  )
@@ -602,4 +597,5 @@
       !
       CALL wrk_dealloc( jpi,jpj, z1_mlbw )
+      CALL wrk_dealloc( jpi,jpj,jpk, zalbet )
       CALL wrk_dealloc( jpi,jpj,jpk,2, zdxrho , zdyrho, zdzrho,              klstart = 0  )
       CALL wrk_dealloc( jpi,jpj,  2,2, zti_mlb, ztj_mlb,        kkstart = 0, klstart = 0  )
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 3231)
@@ -133,8 +133,4 @@
       !!              coefficients using the GLS turbulent closure scheme.
       !!----------------------------------------------------------------------
-      USE oce     , ONLY: tsa                 ! use tsa as workspace
-      USE oce     , ONLY: z_elem_a  =>   ua   ! use ua as workspace
-      USE oce     , ONLY: z_elem_b  =>   va   ! use va as workspace
-      !
       INTEGER, INTENT(in) ::   kt ! ocean time step
       INTEGER  ::   ji, jj, jk, ibot, ibotm1, dir  ! dummy loop arguments
@@ -152,5 +148,5 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   eps         ! dissipation rate
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zwall_psi   ! Wall function use in the wb case (ln_sigpsi.AND.ln_crban=T)
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z_elem_c, psi
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z_elem_a, z_elem_b, z_elem_c, psi
       !!--------------------------------------------------------------------
       !
@@ -158,8 +154,5 @@
       !
       CALL wrk_alloc( jpi,jpj, zdep, zflxs, zhsro )
-      CALL wrk_alloc( jpi,jpj,jpk, eb, mxlb, shear, eps, zwall_psi )
-      !
-      z_elem_c  => tsa(:,:,:,1)
-      psi       => tsa(:,:,:,2)
+      CALL wrk_alloc( jpi,jpj,jpk, eb, mxlb, shear, eps, zwall_psi, z_elem_a, z_elem_b, z_elem_c, psi )
 
       ! Preliminary computing
@@ -890,5 +883,5 @@
       !
       CALL wrk_dealloc( jpi,jpj, zdep, zflxs, zhsro )
-      CALL wrk_dealloc( jpi,jpj,jpk, eb, mxlb, shear, eps, zwall_psi )
+      CALL wrk_dealloc( jpi,jpj,jpk, eb, mxlb, shear, eps, zwall_psi, z_elem_a, z_elem_b, z_elem_c, psi )
       !
       IF( nn_timing == 1 )  CALL timing_stop('zdf_gls')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 3231)
@@ -192,7 +192,4 @@
       !!                (= Kz dz[Ub] * dz[Un] )
       !! ---------------------------------------------------------------------
-      USE oce     , ONLY:   zdiag => ua          ! (ua,va) used  as workspace
-      USE oce     , ONLY:   tsa                  ! (tsa) used  as workspace
-      !!
       INTEGER  ::   ji, jj, jk                      ! dummy loop arguments
 !!bfr      INTEGER  ::   ikbu, ikbv, ikbum1, ikbvm1      ! temporary scalar
@@ -207,8 +204,7 @@
       REAL(wp) ::   zzd_up, zzd_lw                  !    -         -
 !!bfr      REAL(wp) ::   zebot                           !    -         -
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zd_up, zd_lw
       INTEGER , POINTER, DIMENSION(:,:  ) :: imlc
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zhlc
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zpelc
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zpelc, zdiag, zd_up, zd_lw
       !!--------------------------------------------------------------------
       !
@@ -217,9 +213,6 @@
       CALL wrk_alloc( jpi,jpj, imlc )    ! integer
       CALL wrk_alloc( jpi,jpj, zhlc ) 
-      CALL wrk_alloc( jpi,jpj,jpk, zpelc ) 
-      !
-      zd_up => tsa(:,:,:,1) 
-      zd_lw => tsa(:,:,:,2) 
-
+      CALL wrk_alloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 
+      !
       zbbrau = rn_ebb / rau0       ! Local constant initialisation
       zfact1 = -.5_wp * rdt 
@@ -437,5 +430,5 @@
       CALL wrk_dealloc( jpi,jpj, imlc )    ! integer
       CALL wrk_dealloc( jpi,jpj, zhlc ) 
-      CALL wrk_dealloc( jpi,jpj,jpk, zpelc ) 
+      CALL wrk_dealloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('tke_tke')
@@ -479,18 +472,14 @@
       !!              - avmu, avmv : now vertical eddy viscosity at uw- and vw-points
       !!----------------------------------------------------------------------
-      USE oce, ONLY:  zmpdl => ua    ! ua used as workspace
-      USE oce, ONLY:  tsa            ! use tsa as workspace
-      !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zrn2, zraug, zcoef, zav     ! local scalars
       REAL(wp) ::   zdku, zpdlr, zri, zsqen     !   -      -
       REAL(wp) ::   zdkv, zemxl, zemlm, zemlp   !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zmxlm, zmxld
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zmpdl, zmxlm, zmxld
       !!--------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tke_avn')
-      !
-      zmxlm => tsa(:,:,:,1) 
-      zmxld => tsa(:,:,:,2) 
+
+      CALL wrk_alloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 
 
       !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -664,4 +653,6 @@
             &          tab3d_2=avmv, clinfo2=       ' v: ', mask2=vmask, ovlap=1, kdim=jpk )
       ENDIF
+      !
+      CALL wrk_dealloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('tke_avn')
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/oce.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 3229)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 3231)
@@ -28,5 +28,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   rn2b ,  rn2            !: brunt-vaisala frequency**2   [s-2]
    !
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:), TARGET ::  tsa             !: 4D T-S trends fields & work array 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsa             !: 4D T-S trends fields & work array 
    !
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rhd    !: in situ density anomalie rhd=(rho-rau0)/rau0  [no units]
