Index: /NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90
===================================================================
--- /NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90	(revision 10408)
+++ /NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90	(revision 10409)
@@ -149,4 +149,5 @@
       INTEGER ::   iarea0                     !   -       -
       INTEGER ::   ierr, ios                  ! 
+      INTEGER ::   inbi, inbj, iimax,  ijmax  ! 
       INTEGER, ALLOCATABLE, DIMENSION(:)     ::   iin, ii_nono, ii_noea          ! 1D workspace
       INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ijn, ii_noso, ii_nowe          !  -     -
@@ -181,19 +182,18 @@
       ! If dimensions of processor grid weren't specified in the namelist file
       ! then we calculate them here now that we have our communicator size
-      IF( jpni < 1 .OR. jpnj < 1 )   CALL mpp_init_bestpartition( mppsize, jpni, jpnj )
-!!$      IF( jpni < 1 .OR. jpnj < 1 ) THEN
-!!$         CALL mpp_init_bestpartition( mppsize, jpni, jpnj )
-!!$      ELSE
-!!$         CALL mpp_init_bestpartition( mppsize, inbi, inbj )
-!!$         CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax )
-!!$         CALL mpp_basic_decomposition( inbi, inbj,  iimax,  ijmax )
-!!$         IF( iimax*ijmax < jpimax*jpjmax ) THEN
-!!$            WRITE(ctmp1,*) '   The chossen domain decomposition ', jpni, jpnj
-!!$            WRITE(ctmp2,*) '   exceeds the maximum number of ocean subdomains = ', inijmin
-!!$            WRITE(ctmp3,*) '   we suppressed ', jpni*jpnj - mppsize, ' land subdomains '
-!!$            WRITE(ctmp4,*) '   BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...'
-!!$            CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 )
-!!$         ENDIF
-!!$      ENDIF
+      IF( jpni < 1 .OR. jpnj < 1 ) THEN
+         CALL mpp_init_bestpartition( mppsize, jpni, jpnj )
+      ELSE
+         CALL mpp_init_bestpartition( mppsize, inbi, inbj )
+         CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax )
+         CALL mpp_basic_decomposition( inbi, inbj,  iimax,  ijmax )
+         IF( iimax*ijmax < jpimax*jpjmax ) THEN
+            WRITE(ctmp1,*) '   The chosen domain decomposition ', jpni, jpnj
+            WRITE(ctmp2,*) '   has larger MPI subdomains ', jpimax, jpjmax, jpimax*jpjmax
+            WRITE(ctmp3,*) '   than the following domain decompostion ', inbi, inbj
+            WRITE(ctmp4,*) '   which MPI subdomains size is ', iimax, ijmax, iimax*ijmax
+            CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, '    --- YOU ARE WASTING CPU... ---' )
+         ENDIF
+      ENDIF
       
       ! look for land mpi subdomains...
@@ -653,8 +653,8 @@
       !!                    klcj       : second dimension
       !!----------------------------------------------------------------------
-      INTEGER,                       INTENT(in   ) ::   knbi, knbj
-      INTEGER,                       INTENT(  out) ::   kimax, kjmax
-      INTEGER, DIMENSION(knbi,knbj), INTENT(  out) ::   kimppt, kjmppt
-      INTEGER, DIMENSION(knbi,knbj), INTENT(  out) ::   klci, klcj
+      INTEGER,                                 INTENT(in   ) ::   knbi, knbj
+      INTEGER,                                 INTENT(  out) ::   kimax, kjmax
+      INTEGER, DIMENSION(knbi,knbj), OPTIONAL, INTENT(  out) ::   kimppt, kjmppt
+      INTEGER, DIMENSION(knbi,knbj), OPTIONAL, INTENT(  out) ::   klci, klcj
       !
       INTEGER ::   ji, jj
@@ -664,10 +664,11 @@
       !
 #if defined key_nemocice_decomp
-      jpimax = ( nx_global+2-2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim.
-      jpjmax = ( ny_global+2-2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim. 
+      kimax = ( nx_global+2-2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim.
+      kjmax = ( ny_global+2-2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim. 
 #else
       kimax = ( jpiglo - 2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim.
       kjmax = ( jpjglo - 2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim.
 #endif
+      IF( .NOT. PRESENT(kimppt) ) RETURN
       !
       !  1. Dimension arrays for subdomains
