Index: NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domwri.F90
===================================================================
--- NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domwri.F90	(revision 13277)
+++ NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domwri.F90	(revision 13899)
@@ -13,9 +13,9 @@
    !!----------------------------------------------------------------------
    !!   dom_wri        : create and write mesh and mask file(s)
-   !!   dom_uniq       : identify unique point of a grid (TUVF)
    !!   dom_stiff      : diagnose maximum grid stiffness/hydrostatic consistency (s-coordinate)
    !!----------------------------------------------------------------------
    !
    USE dom_oce         ! ocean space and time domain
+   USE domutl          ! 
    USE phycst ,   ONLY :   rsmall
    USE wet_dry,   ONLY :   ll_wd  ! Wetting and drying
@@ -74,10 +74,4 @@
       !                                  ! ============================
       CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. )
-      !
-      !                                                         ! global domain size
-      CALL iom_rstput( 0, 0, inum, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 )
-      CALL iom_rstput( 0, 0, inum, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 )
-      CALL iom_rstput( 0, 0, inum, 'jpkglo', REAL( jpkglo, wp), ktype = jp_i4 )
-
       !                                                         ! domain characteristics
       CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 )
@@ -100,15 +94,15 @@
       
       CALL dom_uniq( zprw, 'T' )
-      DO_2D_11_11
+      DO_2D( 1, 1, 1, 1 )
          zprt(ji,jj) = ssmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask
       END_2D
       CALL iom_rstput( 0, 0, inum, 'tmaskutil', zprt, ktype = jp_i1 )  
       CALL dom_uniq( zprw, 'U' )
-      DO_2D_11_11
+      DO_2D( 1, 1, 1, 1 )
          zprt(ji,jj) = ssumask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask
       END_2D
       CALL iom_rstput( 0, 0, inum, 'umaskutil', zprt, ktype = jp_i1 )  
       CALL dom_uniq( zprw, 'V' )
-      DO_2D_11_11
+      DO_2D( 1, 1, 1, 1 )
          zprt(ji,jj) = ssvmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask
       END_2D
@@ -182,39 +176,4 @@
       !                                     ! ============================
    END SUBROUTINE dom_wri
-
-
-   SUBROUTINE dom_uniq( puniq, cdgrd )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dom_uniq  ***
-      !!                   
-      !! ** Purpose :   identify unique point of a grid (TUVF)
-      !!
-      !! ** Method  :   1) aplly lbc_lnk on an array with different values for each element
-      !!                2) check which elements have been changed
-      !!----------------------------------------------------------------------
-      CHARACTER(len=1)        , INTENT(in   ) ::   cdgrd   ! 
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   puniq   ! 
-      !
-      REAL(wp) ::  zshift   ! shift value link to the process number
-      INTEGER  ::  ji       ! dummy loop indices
-      LOGICAL, DIMENSION(SIZE(puniq,1),SIZE(puniq,2),1) ::  lldbl  ! store whether each point is unique or not
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztstref
-      !!----------------------------------------------------------------------
-      !
-      ! build an array with different values for each element 
-      ! in mpp: make sure that these values are different even between process
-      ! -> apply a shift value according to the process number
-      zshift = jpi * jpj * ( narea - 1 )
-      ztstref(:,:) = RESHAPE( (/ (zshift + REAL(ji,wp), ji = 1, jpi*jpj) /), (/ jpi, jpj /) )
-      !
-      puniq(:,:) = ztstref(:,:)                   ! default definition
-      CALL lbc_lnk( 'domwri', puniq, cdgrd, 1.0_wp )            ! apply boundary conditions
-      lldbl(:,:,1) = puniq(:,:) == ztstref(:,:)   ! check which values have been changed 
-      !
-      puniq(:,:) = 1.                             ! default definition
-      ! fill only the inner part of the cpu with llbl converted into real 
-      puniq(nldi:nlei,nldj:nlej) = REAL( COUNT( lldbl(nldi:nlei,nldj:nlej,:), dim = 3 ) , wp )
-      !
-   END SUBROUTINE dom_uniq
 
 
