Index: trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5039)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5040)
@@ -365,16 +365,14 @@
       INTEGER  ::   ji, jj, jl, jk            ! dummy loop indices
       INTEGER  ::   inum                      ! temporary logical unit
+      INTEGER  ::   ierror                    ! error flag
       INTEGER  ::   ii_bump, ij_bump, ih      ! bump center position
       INTEGER  ::   ii0, ii1, ij0, ij1, ik    ! local indices
       REAL(wp) ::   r_bump , h_bump , h_oce   ! bump characteristics 
       REAL(wp) ::   zi, zj, zh, zhmin         ! local scalars
-      INTEGER , POINTER, DIMENSION(:,:) ::   idta   ! global domain integer data
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zdta   ! global domain scalar data
+      INTEGER , ALLOCATABLE, DIMENSION(:,:) ::   idta   ! global domain integer data
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdta   ! global domain scalar data
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('zgr_bat')
-      !
-      CALL wrk_alloc( jpidta, jpjdta, idta )
-      CALL wrk_alloc( jpidta, jpjdta, zdta )
       !
       IF(lwp) WRITE(numout,*)
@@ -385,4 +383,9 @@
          !                                            ! ================== !
          !                                            ! global domain level and meter bathymetry (idta,zdta)
+         !
+         ALLOCATE( idta(jpidta,jpjdta), STAT=ierror )
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate idta array' )
+         ALLOCATE( zdta(jpidta,jpjdta), STAT=ierror )
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate zdta array' )
          !
          IF( ntopo == 0 ) THEN                        ! flat basin
@@ -489,4 +492,6 @@
             WHERE( bathy(:,:) <= 0._wp )  risfdep(:,:) = 0._wp
          END IF
+         !
+         DEALLOCATE( idta, zdta )
          !
          !                                            ! ================ !
@@ -593,7 +598,4 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpidta, jpjdta, idta )
-      CALL wrk_dealloc( jpidta, jpjdta, zdta )
-      !
       IF( nn_timing == 1 )  CALL timing_stop('zgr_bat')
       !
Index: trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90	(revision 5039)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90	(revision 5040)
@@ -146,13 +146,12 @@
       INTEGER  ::   inum, iim, ijm            ! local integers
       INTEGER  ::   ifreq, il1, il2, ij, ii
-      INTEGER  ::   ijpt0,ijpt1
+      INTEGER  ::   ijpt0,ijpt1, ierror
       REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk
       CHARACTER (len=15) ::   clexp
-      INTEGER, POINTER, DIMENSION(:,:)  :: icof
-      INTEGER, POINTER, DIMENSION(:,:)  :: idata
+      INTEGER,     POINTER, DIMENSION(:,:)  :: icof
+      INTEGER, ALLOCATABLE, DIMENSION(:,:)  :: idata
       !!----------------------------------------------------------------------
       !                                
       CALL wrk_alloc( jpi   , jpj   , icof  )
-      CALL wrk_alloc( jpidta, jpjdta, idata )
       !
       IF(lwp) WRITE(numout,*)
@@ -234,4 +233,7 @@
          ! ===================== equatorial strip (20N-20S) defined at t-points
          
+         ALLOCATE( idata(jpidta,jpjdta), STAT=ierror )
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'ldf_dyn_c2d_orca: unable to allocate idata array' )
+         !
          CALL ctl_opn( inum, 'ahmcoef', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
          READ(inum,9101) clexp, iim, ijm
@@ -269,5 +271,6 @@
 9201     FORMAT(3x,13(i3,12x))
 9202     FORMAT(i3,41i3)
-
+         
+         DEALLOCATE(idata)
 
          ! Set ahm1 and ahm2  ( T- and F- points) (used for laplacian operator)
@@ -346,5 +349,4 @@
       !
       CALL wrk_dealloc( jpi   , jpj   , icof  )
-      CALL wrk_dealloc( jpidta, jpjdta, idata )
       !
    END SUBROUTINE ldf_dyn_c2d_orca
@@ -374,13 +376,12 @@
       INTEGER ::   iim, ijm
       INTEGER ::   ifreq, il1, il2, ij, ii
-      INTEGER ::   ijpt0,ijpt1
+      INTEGER ::   ijpt0,ijpt1, ierror
       REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk, zam20s
       CHARACTER (len=15) ::   clexp
-      INTEGER, POINTER, DIMENSION(:,:)  :: icof
-      INTEGER, POINTER, DIMENSION(:,:)  :: idata
+      INTEGER,     POINTER, DIMENSION(:,:)  :: icof
+      INTEGER, ALLOCATABLE, DIMENSION(:,:)  :: idata
       !!----------------------------------------------------------------------
       !                                
       CALL wrk_alloc( jpi   , jpj   , icof  )
-      CALL wrk_alloc( jpidta, jpjdta, idata )
       !                                
 
@@ -464,4 +465,7 @@
          ! ===================== equatorial strip (20N-20S) defined at t-points
          
+         ALLOCATE( idata(jpidta,jpjdta), STAT=ierror )
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'ldf_dyn_c2d_orca_R1: unable to allocate idata array' )
+         !
          CALL ctl_opn( inum, 'ahmcoef', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL',   &
             &           1, numout, lwp )
@@ -501,5 +505,6 @@
 9201     FORMAT(3x,13(i3,12x))
 9202     FORMAT(i3,41i3)
-
+         
+         DEALLOCATE(idata)
 
          ! Set ahm1 and ahm2  ( T- and F- points) (used for laplacian operator)
@@ -583,5 +588,4 @@
       !
       CALL wrk_dealloc( jpi   , jpj   , icof  )
-      CALL wrk_dealloc( jpidta, jpjdta, idata )
       !
    END SUBROUTINE ldf_dyn_c2d_orca_R1
