Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 9019)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 9125)
@@ -36,5 +36,4 @@
    USE par_kind
    USE crslbclnk
-   USE wrk_nemo       ! work arrays
    USE lib_mpp
 
@@ -352,8 +351,7 @@
       INTEGER  ::   ji, jj, jk , ii, ij, je_2
       REAL(wp) ::   zdAm
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   zvol, zmask      
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zvol, zmask      
       !!----------------------------------------------------------------  
       !
-      CALL wrk_alloc( jpi,jpj,jpk,   zvol, zmask )
       !
       p_fld1_crs(:,:,:) = 0._wp
@@ -445,5 +443,4 @@
       CALL crs_lbc_lnk( p_fld2_crs, cd_type, 1.0 ) 
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zvol, zmask )
       !
    END SUBROUTINE crs_dom_facvol
@@ -487,5 +484,5 @@
       INTEGER  ::   ii, ij, ijie, ijje, je_2
       REAL(wp) ::   zflcrs, zsfcrs   
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   zsurf, zsurfmsk, zmask  
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zsurf, zsurfmsk, zmask  
       !!----------------------------------------------------------------  
       !
@@ -496,5 +493,5 @@
       CASE ( 'VOL' )
          !
-         CALL wrk_alloc( jpi,jpj,jpk,   zsurf, zsurfmsk )
+         ALLOCATE( zsurf(jpi,jpj,jpk), zsurfmsk(jpi,jpj,jpk) )
          !   
          SELECT CASE ( cd_type )
@@ -585,9 +582,9 @@
                END SELECT
 
-              CALL wrk_dealloc( jpi, jpj, jpk, zsurf, zsurfmsk )
+              DEALLOCATE( zsurf, zsurfmsk )
 
          CASE ( 'SUM' )
          
-            CALL wrk_alloc( jpi, jpj, jpk, zsurfmsk )
+            ALLOCATE( zsurfmsk(jpi,jpj,jpk) )
 
             SELECT CASE ( cd_type )
@@ -763,9 +760,9 @@
               ENDIF
 
-              CALL wrk_dealloc( jpi, jpj, jpk, zsurfmsk )
+              DEALLOCATE( zsurfmsk )
 
          CASE ( 'MAX' )    !  search the max of unmasked grid cells
 
-            CALL wrk_alloc( jpi, jpj, jpk, zmask )
+            ALLOCATE( zmask(jpi,jpj,jpk) )
 
             SELECT CASE ( cd_type )
@@ -934,9 +931,9 @@
               END SELECT
 
-              CALL wrk_dealloc( jpi, jpj, jpk, zmask )
+              DEALLOCATE( zmask )
 
          CASE ( 'MIN' )      !   Search the min of unmasked grid cells
 
-            CALL wrk_alloc( jpi, jpj, jpk, zmask )
+            ALLOCATE( zmask(jpi,jpj,jpk) )
 
             SELECT CASE ( cd_type )
@@ -1104,5 +1101,5 @@
             END SELECT
             !
-            CALL wrk_dealloc( jpi, jpj, jpk, zmask )
+            DEALLOCATE( zmask )
             !
          END SELECT
@@ -1149,5 +1146,5 @@
       INTEGER  :: ijie, ijje, ii, ij, je_2
       REAL(wp) :: zflcrs, zsfcrs   
-      REAL(wp), DIMENSION(:,:), POINTER :: zsurfmsk   
+      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: zsurfmsk   
       !!----------------------------------------------------------------  
       !
@@ -1158,5 +1155,5 @@
         CASE ( 'VOL' )
       
-            CALL wrk_alloc( jpi, jpj, zsurfmsk )
+            ALLOCATE( zsurfmsk(jpi,jpj) )
             zsurfmsk(:,:) =  p_e12(:,:) * p_e3(:,:,1) * p_mask(:,:,1)
 
@@ -1222,9 +1219,9 @@
             ENDDO
 
-            CALL wrk_dealloc( jpi, jpj, zsurfmsk )
+            DEALLOCATE( zsurfmsk )
 
          CASE ( 'SUM' )
          
-            CALL wrk_alloc( jpi, jpj, zsurfmsk )
+            ALLOCATE( zsurfmsk(jpi,jpj) )
             IF( PRESENT( p_e3 ) ) THEN
                zsurfmsk(:,:) =  p_e12(:,:) * p_e3(:,:,1) * p_mask(:,:,1)
@@ -1364,5 +1361,5 @@
               ENDIF
 
-              CALL wrk_dealloc( jpi, jpj, zsurfmsk )
+              DEALLOCATE( zsurfmsk )
 
          CASE ( 'MAX' )
@@ -1644,5 +1641,5 @@
       INTEGER ::  ijie, ijje, ii, ij, je_2
       REAL(wp) :: ze3crs  
-      REAL(wp), DIMENSION(:,:,:), POINTER :: zmask, zsurf   
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zmask, zsurf   
 
       !!----------------------------------------------------------------  
@@ -1651,6 +1648,4 @@
        p_e3_max_crs(:,:,:) = 1.
    
-
-       CALL wrk_alloc( jpi, jpj, jpk, zmask, zsurf )
 
        SELECT CASE ( cd_type )
@@ -1756,5 +1751,4 @@
        CALL crs_lbc_lnk( p_e3_max_crs, cd_type, 1.0, pval=1.0 )  
        !              
-       CALL wrk_dealloc( jpi, jpj, jpk, zsurf, zmask )
        !
    END SUBROUTINE crs_dom_e3
@@ -1773,10 +1767,8 @@
       INTEGER  :: ji, jj, jk                   ! dummy loop indices
       INTEGER  :: ii, ij, je_2
-      REAL(wp), DIMENSION(:,:,:), POINTER :: zsurf, zsurfmsk   
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zsurf, zsurfmsk   
       !!----------------------------------------------------------------  
       ! Initialize
 
-
-      CALL wrk_alloc( jpi, jpj, jpk, zsurf, zsurfmsk )
       !
       SELECT CASE ( cd_type )
@@ -1867,6 +1859,4 @@
       CALL crs_lbc_lnk( p_surf_crs    , cd_type, 1.0, pval=1.0 )
       CALL crs_lbc_lnk( p_surf_crs_msk, cd_type, 1.0, pval=1.0 )
-
-      CALL wrk_dealloc( jpi, jpj, jpk, zsurfmsk, zsurf )
 
    END SUBROUTINE crs_dom_sfc
@@ -2236,8 +2226,6 @@
       !!  local variables
       INTEGER  :: ji,jj,jk      ! dummy indices
-      REAL(wp), DIMENSION(:,:)  , POINTER :: zmbk
+      REAL(wp), DIMENSION(jpi_crs, jpj_crs) :: zmbk
       !!----------------------------------------------------------------
-   
-      CALL wrk_alloc( jpi_crs, jpj_crs, zmbk )
    
       mbathy_crs(:,:) = jpkm1
@@ -2281,6 +2269,4 @@
       zmbk(:,:) = REAL( mbkv_crs(:,:), wp )   ;   CALL crs_lbc_lnk(zmbk,'V',1.0) ; mbkv_crs  (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
       !
-      CALL wrk_dealloc( jpi_crs, jpj_crs, zmbk )
-      !
    END SUBROUTINE crs_dom_bat
 
