Index: NEMO/branches/2019/ENHANCE-03_domcfg/src/domclo.F90
===================================================================
--- NEMO/branches/2019/ENHANCE-03_domcfg/src/domclo.F90	(revision 11654)
+++ NEMO/branches/2019/ENHANCE-03_domcfg/src/domclo.F90	(revision 11658)
@@ -156,21 +156,9 @@
       DO jcs = 1,nn_closea
 
-         !! 2.2 : print out and sanity check
-         !! flag changed in sanity checks
-         lskip = .FALSE.
-
-         !! define seed to extract the closed sea jcs
-         CALL dom_ngb(sn_lake(jcs)%rlonsrc, sn_lake(jcs)%rlatsrc, jiseed, jjseed, zdistseed, 'T')
-
          !! how the excess of the closed seas is spread out:
-         IF (lwp) THEN
-            WRITE(numout,*)
-            WRITE(numout,'(a,a10,a,2f7.2,a)')'    processing lake ',TRIM(sn_lake(jcs)%cname)             &
-                 &        ,' ( lat/lon : ',sn_lake(jcs)%rlatsrc, sn_lake(jcs)%rlonsrc,' )'
-         END IF
          cloc = sn_lake(jcs)%cloctrg
          csch = sn_lake(jcs)%cschtrg
-  
-         !! set up indexes and mask  ! SELECT CASE ...
+
+         !! set up indexes and mask
          SELECT CASE (csch)
          CASE('glo')
@@ -178,18 +166,22 @@
             zmsksrc(:,:) = msk_glo(:,:)
             zmsktrg(:,:) = msk_gloid(:,:)
-            IF (lwp) WRITE(numout,*)'        net evap/precip will be spread globally'
          CASE('rnf') 
             jsch = jrnf
             zmsksrc(:,:) = msk_rnf(:,:)
             zmsktrg(:,:) = msk_rnfid(:,:)
-            IF (lwp) WRITE(numout,*)'        net precip will be spread locally and net evap globally'
          CASE('emp')
             jsch = jemp 
             zmsksrc(:,:) = msk_emp(:,:)
             zmsktrg(:,:) = msk_empid(:,:)
-            IF (lwp) WRITE(numout,*)'        net precip will be spread locally'
          CASE DEFAULT
-            CALL ctl_stop( 'STOP', 'domclo: unknown target type for lake (should be glo, emp, rnf)' )
+            CALL ctl_stop( 'STOP', 'domclo: ',TRIM(csch),' is an unknown target type for lake (should be glo, emp, rnf)' )
          END SELECT
+
+         !! 2.2 : print out and sanity check
+         !! flag changed in sanity checks
+         lskip = .FALSE.
+
+         !! define seed to extract the closed sea jcs
+         CALL dom_ngb(sn_lake(jcs)%rlonsrc, sn_lake(jcs)%rlatsrc, jiseed, jjseed, zdistseed, 'T')
 
          !! sanity check on the msk value (closea mask should be 99 otherwise, lake already processed)
@@ -209,7 +201,17 @@
             lskip = .TRUE.
          END IF
-
+ 
          !! 2.3 : compute mask for global, rnf, emp case
          IF (.NOT. lskip) THEN
+
+            IF (lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,'(a,a10,a,2f7.2,a,2i6,a,f7.2,a)')                               &
+                    &         '    processing lake ',TRIM(sn_lake(jcs)%cname)               &
+                    &        ,' ( lat/lon : ',sn_lake(jcs)%rlatsrc, sn_lake(jcs)%rlonsrc    &
+                    &        ,' , i/j     : ',jiseed,jjseed                                 &
+                    &        ,' , distance to seed : ',zdistseed,'m )'
+            END IF
+
             !! fill close sea mask with counter value
             CALL fill_pool( jiseed, jjseed, zmsksrc, REAL(jsch  ,8))
@@ -248,7 +250,8 @@
 
                !! print
-               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a)')'         river mouth area is defined by         points within ',zradtrg(1)         &
-                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                                  &
-                             &        ,' (closest point is i/j ',jiseed, jjseed,')'
+               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a,f7.0,a)')                                            &
+                             &         '         river mouth area is defined by         points within ',zradtrg(1) &
+                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                &
+                             &        ,' (closest wet point is i/j ',jiseed, jjseed,' at ',zdistseed,' m )'
             CASE ('coast')
                !! define coastline mask
@@ -265,7 +268,8 @@
 
                !! print
-               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a)')'         river mouth area is defined by coastal points within ',zradtrg(1) &
-                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                                  &
-                             &        ,' (closest point is i/j ',jiseed, jjseed,')'
+               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a,f7.0,a)')                                            &
+                             &         '         river mouth area is defined by coastal points within ',zradtrg(1) &
+                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                &
+                             &        ,' (closest wet point is i/j ',jiseed, jjseed,' at ',zdistseed,' m )'
 
             CASE DEFAULT
@@ -277,4 +281,8 @@
             zarea = glob_sum('domclo',zmsktrg * msk_opnsea)
             IF (zarea == 0._wp) CALL ctl_stop( 'STOP', 'river mouth area is 0, tune lon/lat trg or radtrg for this lake') 
+            !
+            zarea = glob_sum('domclo',zmsksrc * msk_opnsea)
+            IF (zarea > 0._wp) CALL ctl_stop( 'STOP', 'closed seas and open ocean have common points, '                           &
+               &                                    , 'tune lon/lat src or check if your lake is really closed on the model grid')
 
             !! set up indexes and mask 
@@ -284,12 +292,15 @@
                msk_glo(:,:)   = zmsksrc(:,:)
                msk_gloid(:,:) = zmsktrg(:,:)
+               IF (lwp) WRITE(numout,*)'        net evap/precip will be spread globally (glo)'
             CASE ('rnf')
                jrnf = jrnf + 1
                msk_rnf(:,:)   = zmsksrc(:,:)
                msk_rnfid(:,:) = zmsktrg(:,:)
+               IF (lwp) WRITE(numout,*)'        net precip will be spread locally and net evap globally (rnf)'
             CASE ('emp')
                jemp = jemp + 1
                msk_emp(:,:)   = zmsksrc(:,:)
                msk_empid(:,:) = zmsktrg(:,:)
+               IF (lwp) WRITE(numout,*)'        net evap/precip will be spread locally (emp)'
             END SELECT
 
Index: NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90
===================================================================
--- NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90	(revision 11654)
+++ NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90	(revision 11658)
@@ -60,5 +60,4 @@
    REAL(wp), PUBLIC ::   e3zps_min       !: miminum thickness for partial steps (meters)
    REAL(wp), PUBLIC ::   e3zps_rat       !: minimum thickness ration for partial steps
-   INTEGER, PUBLIC  ::   nperio          !: type of lateral boundary condition
 
    ! Song and Haidvogel 1994 stretching parameters
@@ -702,5 +701,5 @@
             ENDIF
          ENDIF
-      ELSEIF( jperio == 1 .OR. jperio == 4 .OR. jperio ==  6 ) THEN
+      ELSEIF( l_Iperio ) THEN
          IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions on mbathy: jperio = ', jperio
          mbathy( 1 ,:) = mbathy(jpim1,:)
@@ -1166,5 +1165,5 @@
             mbathy(:,:)  = INT( zbathy(:,:) )
          ENDIF
-         IF( nperio == 1 .OR. nperio  ==  4 .OR. nperio  ==  6 ) THEN 
+         IF( l_Iperio ) THEN 
             misfdep( 1 ,:) = misfdep(jpim1,:)            ! local domain is cyclic east-west 
             misfdep(jpi,:) = misfdep(  2  ,:) 
Index: NEMO/branches/2019/ENHANCE-03_domcfg/src/iom.F90
===================================================================
--- NEMO/branches/2019/ENHANCE-03_domcfg/src/iom.F90	(revision 11654)
+++ NEMO/branches/2019/ENHANCE-03_domcfg/src/iom.F90	(revision 11658)
@@ -660,5 +660,7 @@
       ! do we read the overlap 
       ! ugly patch SM+JMM+RB to overwrite global definition in some cases
-      llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif
+      !llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif
+      ! for domain_cfg, force to read the full domain
+      llnoov = .FALSE.
       ! create the file name by added, if needed, TRIM(Agrif_CFixed()) and TRIM(clsuffix)
       ! =============
@@ -1052,5 +1054,8 @@
          ! do we read the overlap 
          ! ugly patch SM+JMM+RB to overwrite global definition in some cases
-         llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif 
+         ! 
+         !llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif 
+         ! for domain_cfg tools force to read the full domain
+         llnoov = .FALSE.
          ! check kcount and kstart optionals parameters...
          IF( PRESENT(kcount) .AND. (.NOT. PRESENT(kstart)) ) CALL ctl_stop(trim(clinfo), 'kcount present needs kstart present')
@@ -1233,5 +1238,6 @@
                ENDIF
             ENDIF
-      
+            WRITE(numout,*) 'istart icnt',istart, ' ', icnt 
+            WRITE(numout,*) ' idx i1, i2, j1, j2 ',ix1, ix2, iy1, iy2
             CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d )
 
