Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90	(revision 7581)
@@ -93,10 +93,10 @@
       REAL(wp) ::   zgcad        ! temporary scalars
       REAL(wp), DIMENSION(2) ::   zsum
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zgcr
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zgcr
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('sol_pcg')
       !
-      CALL wrk_alloc( jpi, jpj, zgcr )
+      ALLOCATE( zgcr(jpi,jpj) )
       !
       ! Initialization of the algorithm with standard PCG
@@ -210,5 +210,5 @@
       CALL lbc_lnk( gcx, c_solver_pt, 1. )      ! Output in gcx with lateral b.c. applied
       ! 
-      CALL wrk_dealloc( jpi, jpj, zgcr )
+      DEALLOCATE ( zgcr )
       !
       IF( nn_timing == 1 )  CALL timing_stop('sol_pcg')
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7581)
@@ -80,11 +80,13 @@
       !
       INTEGER ::   jk   ! dummy loop index
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrdt, ztrds   ! 3D workspace
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zun, zvn, zwn
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds   ! 3D workspace
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_adv')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zun, zvn, zwn )
+      ALLOCATE(zun(jpi, jpj, jpk))
+      ALLOCATE(zvn(jpi, jpj, jpk))
+      ALLOCATE(zwn(jpi, jpj, jpk))
       !                                          ! set time step
       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
@@ -124,5 +126,6 @@
       !
       IF( l_trdtra )   THEN                    !* Save ta and sa trends
-         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds )
+         ALLOCATE(ztrdt( jpi, jpj, jpk) )
+         ALLOCATE(ztrds( jpi, jpj, jpk) )
          ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
          ztrds(:,:,:) = tsa(:,:,:,jp_sal)
@@ -166,5 +169,6 @@
          CALL trd_tra( kt, 'TRA', jp_tem, jptra_totad, ztrdt )
          CALL trd_tra( kt, 'TRA', jp_sal, jptra_totad, ztrds )
-         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds )
+         DEALLOCATE (ztrdt)
+         DEALLOCATE (ztrds)
       ENDIF
       !                                              ! print mean trends (used for debugging)
@@ -174,5 +178,7 @@
       IF( nn_timing == 1 )  CALL timing_stop( 'tra_adv' )
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zun, zvn, zwn )
+      DEALLOCATE(zun)
+      DEALLOCATE(zvn)
+      DEALLOCATE(zwn)
       !                                          
    END SUBROUTINE tra_adv
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 7581)
@@ -82,11 +82,14 @@
       REAL(wp) ::   zv, z0v, zzwy, z0w        !   -      -
       REAL(wp) ::   ztra, zbtr, zdt, zalpha   !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zslpx, zslpy   ! 3D workspace
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zwx  , zwy     ! -      - 
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zslpx, zslpy   ! 3D workspace
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwx  , zwy     ! -      - 
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_adv_muscl')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zslpx, zslpy, zwx, zwy )
+      ALLOCATE( zslpx(1:jpi, 1:jpj, 1:jpk) )
+      ALLOCATE( zslpy(1:jpi, 1:jpj, 1:jpk) )
+      ALLOCATE( zwx  (1:jpi, 1:jpj, 1:jpk) )
+      ALLOCATE( zwy  (1:jpi, 1:jpj, 1:jpk) )
       !
       IF( kt == kit000 )  THEN
@@ -288,5 +291,8 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zslpx, zslpy, zwx, zwy )
+      DEALLOCATE( zslpx )
+      DEALLOCATE( zslpy )
+      DEALLOCATE( zwx   )
+      DEALLOCATE( zwy   )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_adv_muscl')
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 7581)
@@ -86,12 +86,14 @@
       REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk   !   -      -
       REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk   !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zwi, zwz
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz, zptry
-      REAL(wp), POINTER, DIMENSION(:,:)   :: z2d
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zwi, zwz
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz, zptry
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:)   :: z2d
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_adv_tvd')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwi, zwz )
+      ALLOCATE(zwi(1:jpi, 1:jpj, 1:jpk))
+      ALLOCATE(zwz(1:jpi, 1:jpj, 1:jpk))
+
       !
       IF( kt == kit000 )  THEN
@@ -107,11 +109,13 @@
       !
       IF( l_trd .OR. l_trans )  THEN
-         CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
+         ALLOCATE(ztrdx(1:jpi, 1:jpj, 1:jpk))
+         ALLOCATE(ztrdy(1:jpi, 1:jpj, 1:jpk))
+         ALLOCATE(ztrdz(1:jpi, 1:jpj, 1:jpk))
          ztrdx(:,:,:) = 0.e0   ;    ztrdy(:,:,:) = 0.e0   ;   ztrdz(:,:,:) = 0.e0
-         CALL wrk_alloc( jpi, jpj, z2d )
+         ALLOCATE(z2d(1:jpi, 1:jpj))
       ENDIF
       !
       IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
-         CALL wrk_alloc( jpi, jpj, jpk, zptry )
+         ALLOCATE(zptry(1:jpi, 1:jpj, 1:jpk))
          zptry(:,:,:) = 0._wp
       ENDIF
@@ -304,10 +308,13 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwi, zwz )
+      DEALLOCATE( zwi )
+      DEALLOCATE( zwz )
       IF( l_trd .OR. l_trans )  THEN 
-         CALL wrk_dealloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
-         CALL wrk_dealloc( jpi, jpj, z2d )
+         DEALLOCATE( ztrdx )
+         DEALLOCATE( ztrdy )
+         DEALLOCATE( ztrdz )
+         DEALLOCATE( z2d )
       ENDIF
-      IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL wrk_dealloc( jpi, jpj, jpk, zptry )
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) DEALLOCATE( zptry )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_adv_tvd')
@@ -353,16 +360,21 @@
       REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk   !   -      -
       REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk   !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zwx_sav , zwy_sav
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zwi, zwz, zhdiv, zwz_sav, zwzts
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zptry
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrs
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:  ) :: zwx_sav , zwy_sav
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zwi, zwz, zhdiv, zwz_sav, zwzts
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zptry
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztrs
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_adv_tvd_zts')
       !
-      CALL wrk_alloc( jpi, jpj, zwx_sav, zwy_sav )
-      CALL wrk_alloc( jpi, jpj, jpk, zwi, zwz , zhdiv, zwz_sav, zwzts )
-      CALL wrk_alloc( jpi, jpj, jpk, kjpt+1, ztrs )
+      ALLOCATE(zwx_sav(jpi, jpj))
+      ALLOCATE(zwy_sav(jpi, jpj))
+      ALLOCATE(zwi(jpi, jpj, jpk))
+      ALLOCATE(zwz(jpi, jpj, jpk))        
+      ALLOCATE(zhdiv(jpi, jpj, jpk))       
+      ALLOCATE(zwz_sav(jpi, jpj, jpk))       
+      ALLOCATE(zwzts(jpi, jpj, jpk)) 
+      ALLOCATE(ztrs(jpi, jpj, jpk, kjpt+1))
       !
       IF( kt == kit000 )  THEN
@@ -376,10 +388,12 @@
       !
       IF( l_trd )  THEN
-         CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
+         ALLOCATE(ztrdx(jpi, jpj, jpk))       
+         ALLOCATE(ztrdy(jpi, jpj, jpk))       
+         ALLOCATE(ztrdz(jpi, jpj, jpk))       
          ztrdx(:,:,:) = 0._wp  ;    ztrdy(:,:,:) = 0._wp  ;   ztrdz(:,:,:) = 0._wp
       ENDIF
       !
       IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
-         CALL wrk_alloc( jpi, jpj,jpk, zptry )
+         ALLOCATE(zptry(jpi, jpj, jpk))       
          zptry(:,:,:) = 0._wp
       ENDIF
@@ -603,9 +617,20 @@
       END DO
       !
-                   CALL wrk_dealloc( jpi, jpj, jpk, zwi, zwz, zhdiv, zwz_sav, zwzts )
-                   CALL wrk_dealloc( jpi, jpj, jpk, kjpt+1, ztrs )
-                   CALL wrk_dealloc( jpi, jpj, zwx_sav, zwy_sav )
-      IF( l_trd )  CALL wrk_dealloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
-      IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL wrk_dealloc( jpi, jpj, jpk, zptry )
+      DEALLOCATE(zwi) 
+      DEALLOCATE(zwz) 
+      DEALLOCATE(zhdiv) 
+      DEALLOCATE(zwz_sav) 
+      DEALLOCATE(zwzts)
+      DEALLOCATE(ztrs )
+      DEALLOCATE(zwx_sav) 
+      DEALLOCATE(zwy_sav )
+
+      IF( l_trd )  THEN
+          DEALLOCATE(ztrdx) 
+          DEALLOCATE(ztrdy) 
+          DEALLOCATE(ztrdz)
+      END IF
+
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) DEALLOCATE(zptry )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_adv_tvd_zts')
@@ -635,10 +660,13 @@
       REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt   ! local scalars
       REAL(wp) ::   zau, zbu, zcu, zav, zbv, zcv, zup, zdo            !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zbetup, zbetdo, zbup, zbdo
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zbetup, zbetdo, zbup, zbdo
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('nonosc')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zbetup, zbetdo, zbup, zbdo )
+      ALLOCATE(zbetup(jpi, jpj, jpk))
+      ALLOCATE(zbetdo(jpi, jpj, jpk))
+      ALLOCATE(zbup(jpi, jpj, jpk))
+      ALLOCATE(zbdo(jpi, jpj, jpk))
       !
       zbig  = 1.e+40_wp
@@ -717,5 +745,8 @@
       CALL lbc_lnk( paa, 'U', -1. )   ;   CALL lbc_lnk( pbb, 'V', -1. )   ! lateral boundary condition (changed sign)
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zbetup, zbetdo, zbup, zbdo )
+      DEALLOCATE(zbetup)
+      DEALLOCATE(zbetdo) 
+      DEALLOCATE(zbup)
+      DEALLOCATE(zbdo)
       !
       IF( nn_timing == 1 )  CALL timing_stop('nonosc')
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7581)
@@ -107,5 +107,5 @@
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step
       !
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::  ztrdt, ztrds
       !!----------------------------------------------------------------------
       !
@@ -113,5 +113,6 @@
       !
       IF( l_trdtra )   THEN                         !* Save ta and sa trends
-         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds )
+         ALLOCATE( ztrdt (1:jpi, 1:jpj, 1:jpk))
+         ALLOCATE( ztrds (1:jpi, 1:jpj, 1:jpk))
          ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
          ztrds(:,:,:) = tsa(:,:,:,jp_sal)
@@ -151,5 +152,5 @@
          CALL trd_tra( kt, 'TRA', jp_tem, jptra_bbl, ztrdt )
          CALL trd_tra( kt, 'TRA', jp_sal, jptra_bbl, ztrds )
-         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds )
+         DEALLOCATE( ztrdt, ztrds )
       ENDIF
       !
@@ -187,10 +188,10 @@
       INTEGER  ::   ik           ! local integers
       REAL(wp) ::   zbtr         ! local scalars
-      REAL(wp), POINTER, DIMENSION(:,:) :: zptb
+      REAL(wp), ALLOCATABLE , DIMENSION(:,:) :: zptb
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('tra_bbl_dif')
       !
-      CALL wrk_alloc( jpi, jpj, zptb )
+      ALLOCATE(zptb(1:jpi, 1:jpj))
       !
       DO jn = 1, kjpt                                     ! tracer loop
@@ -217,5 +218,5 @@
       END DO                                                ! end tracer
       !                                                     ! ===========
-      CALL wrk_dealloc( jpi, jpj, zptb )
+      DEALLOCATE( zptb )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_bbl_dif')
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 7581)
@@ -53,5 +53,5 @@
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step 
       CHARACTER (len=22) :: charout
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
       !!----------------------------------------------------------------------
       !
@@ -64,5 +64,5 @@
 
       IF( l_trdtrc )  THEN
-         CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
+         ALLOCATE(ztrtrd( jpi, jpj, jpk, jptra )) ! temporary save of trends
          ztrtrd(:,:,:,:)  = tra(:,:,:,:)
       ENDIF
@@ -95,5 +95,5 @@
            CALL trd_tra( kt, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
         END DO
-        CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
+        DEALLOCATE(ztrtrd ) ! temporary save of trends
       ENDIF
       !
Index: branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
===================================================================
--- branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 7580)
+++ branches/UKMO/dev_r5518_optim_GO6_alloc/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 7581)
@@ -59,5 +59,5 @@
       REAL(wp)           :: zdep
       CHARACTER (len=22) :: charout
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
       !!----------------------------------------------------------------------
       !
@@ -81,5 +81,5 @@
       !
       IF( l_trdtrc )  THEN
-         CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd )
+         ALLOCATE( ztrtrd ( jpi, jpj, jpk, jptra) )
          ztrtrd(:,:,:,:)  = tra(:,:,:,:)
       ENDIF
@@ -120,5 +120,5 @@
            CALL trd_tra( kt, 'TRC', jn, jptra_ldf, ztrtrd(:,:,:,jn) )
         END DO
-        CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd )
+        DEALLOCATE( ztrtrd )
       ENDIF
       !                                          ! print mean trends (used for debugging)
