Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/C1D_PAPA/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/C1D_PAPA/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/C1D_PAPA/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -74,25 +74,24 @@
       kpj = 3
       kpk = 75 
-      !
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : C1 case'
-      WRITE(numout,*) '      type of vertical coordinate : '
-      WRITE(numout,*) '         z-coordinate flag                     ln_zco = ', ln_zco
-      WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps
-      WRITE(numout,*) '         s-coordinate flag                     ln_sco = ', ln_sco
-      WRITE(numout,*) '      C1D domain = 3 x 3 x75 grid-points                '
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio =  7                   ! C1D configuration : 3x3 basin with cyclic Est-West and Norht-South condition
       !
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      C1D : closed basin                 jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : C1 case'
+         WRITE(numout,*) '      type of vertical coordinate : '
+         WRITE(numout,*) '         z-coordinate flag                     ln_zco = ', ln_zco
+         WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps
+         WRITE(numout,*) '         s-coordinate flag                     ln_sco = ', ln_sco
+         WRITE(numout,*) '      C1D domain = 3 x 3 x75 grid-points                '
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      C1D : closed basin                       jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DOM/domain.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DOM/domain.F90	(revision 11320)
@@ -530,7 +530,9 @@
       !!----------------------------------------------------------------------
       !
-      WRITE(numout,*) '           '
-      WRITE(numout,*) 'domain_cfg : domain size read in ', TRIM( cn_domcfg ), ' file'
-      WRITE(numout,*) '~~~~~~~~~~ '
+      IF(lwp) THEN
+         WRITE(numout,*) '           '
+         WRITE(numout,*) 'domain_cfg : domain size read in ', TRIM( cn_domcfg ), ' file'
+         WRITE(numout,*) '~~~~~~~~~~ '
+      ENDIF
       !
       CALL iom_open( cn_domcfg, inum )
@@ -543,7 +545,9 @@
          CALL iom_get( inum, 'ORCA_index', zorca_res )   ;   kk_cfg = NINT( zorca_res )
          !
-         WRITE(numout,*) '   .'
-         WRITE(numout,*) '   ==>>>   ORCA configuration '
-         WRITE(numout,*) '   .'
+         IF(lwp) THEN
+            WRITE(numout,*) '   .'
+            WRITE(numout,*) '   ==>>>   ORCA configuration '
+            WRITE(numout,*) '   .'
+         ENDIF
          !
       ELSE                                !- cd_cfg & k_cfg are not used
@@ -566,9 +570,11 @@
       CALL iom_close( inum )
       !
-      WRITE(numout,*) '      cn_cfg = ', TRIM(cd_cfg), '   nn_cfg = ', kk_cfg
-      WRITE(numout,*) '      jpiglo = ', kpi
-      WRITE(numout,*) '      jpjglo = ', kpj
-      WRITE(numout,*) '      jpkglo = ', kpk
-      WRITE(numout,*) '      type of global domain lateral boundary   jperio = ', kperio
+      IF(lwp) THEN
+         WRITE(numout,*) '      cn_cfg = ', TRIM(cd_cfg), '   nn_cfg = ', kk_cfg
+         WRITE(numout,*) '      jpiglo = ', kpi
+         WRITE(numout,*) '      jpjglo = ', kpj
+         WRITE(numout,*) '      jpkglo = ', kpk
+         WRITE(numout,*) '      type of global domain lateral boundary   jperio = ', kperio
+      ENDIF
       !        
    END SUBROUTINE domain_cfg
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/USR/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/USR/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/USR/usrdef_nam.F90	(revision 11320)
@@ -80,27 +80,27 @@
 #endif
       kpk = jpkglo
-      !
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : GYRE case'
-      WRITE(numout,*) '      GYRE used as Benchmark (=T)                      ln_bench  = ', ln_bench
-      WRITE(numout,*) '      inverse resolution & implied domain size         nn_GYRE   = ', nn_GYRE
-#if defined key_agrif
-      IF( Agrif_Root() ) THEN
-#endif
-      WRITE(numout,*) '         jpiglo = 30*nn_GYRE+2                            jpiglo = ', kpi
-      WRITE(numout,*) '         jpjglo = 20*nn_GYRE+2                            jpjglo = ', kpj
-#if defined key_agrif
-      ENDIF
-#endif
-      WRITE(numout,*) '      number of model levels                              jpkglo = ', kpk
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! GYRE configuration : closed domain
       !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral b.c. of the global domain set to closed     jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : GYRE case'
+         WRITE(numout,*) '      GYRE used as Benchmark (=T)                      ln_bench  = ', ln_bench
+         WRITE(numout,*) '      inverse resolution & implied domain size         nn_GYRE   = ', nn_GYRE
+#if defined key_agrif
+         IF( Agrif_Root() ) THEN
+#endif
+         WRITE(numout,*) '         jpiglo = 30*nn_GYRE+2                            jpiglo = ', kpi
+         WRITE(numout,*) '         jpjglo = 20*nn_GYRE+2                            jpjglo = ', kpj
+#if defined key_agrif
+         ENDIF
+#endif
+         WRITE(numout,*) '      number of model levels                              jpkglo = ', kpk
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral b.c. of the global domain set to closed        jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -69,5 +69,5 @@
       cd_cfg = 'BENCH'             ! name & resolution (not used)
       kk_cfg = 0
-
+      !
       IF( nn_isize < 0 .AND. nn_jsize < 0 ) THEN
       !
@@ -86,29 +86,30 @@
          kpj = nn_jsize
       ENDIF
- 
+      !
       kpk = nn_ksize
       kperio = nn_perio
-
       !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : BENCH test case'
-      IF( nn_isize > 0 ) THEN
-         WRITE(numout,*) '      global domain size-x            nn_isize = ',  nn_isize
-      ELSE
-         WRITE(numout,*) '                                          jpni = ', jpni
-         WRITE(numout,*) '       local domain size-x           -nn_isize = ', -nn_isize
-         WRITE(numout,*) '      global domain size-x                 kpi = ', kpi
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : BENCH test case'
+         IF( nn_isize > 0 ) THEN
+            WRITE(numout,*) '      global domain size-x            nn_isize = ',  nn_isize
+         ELSE
+            WRITE(numout,*) '                                          jpni = ', jpni
+            WRITE(numout,*) '       local domain size-x           -nn_isize = ', -nn_isize
+            WRITE(numout,*) '      global domain size-x                 kpi = ', kpi
+         ENDIF
+         IF( nn_jsize > 0 ) THEN
+            WRITE(numout,*) '      global domain size-y            nn_jsize = ', nn_jsize
+         ELSE
+            WRITE(numout,*) '                                          jpnj = ', jpnj
+            WRITE(numout,*) '       local domain size-y           -nn_jsize = ', -nn_jsize
+            WRITE(numout,*) '      global domain size-y                 kpj = ', kpj
+         ENDIF
+         WRITE(numout,*) '      global domain size-z            nn_ksize = ', nn_ksize
+         WRITE(numout,*) '      LBC of the global domain          kperio = ', kperio
       ENDIF
-      IF( nn_jsize > 0 ) THEN
-         WRITE(numout,*) '      global domain size-y            nn_jsize = ', nn_jsize
-      ELSE
-         WRITE(numout,*) '                                          jpnj = ', jpnj
-         WRITE(numout,*) '       local domain size-y           -nn_jsize = ', -nn_jsize
-         WRITE(numout,*) '      global domain size-y                 kpj = ', kpj
-      ENDIF
-      WRITE(numout,*) '      global domain size-z            nn_ksize = ', nn_ksize
-      WRITE(numout,*) '      LBC of the global domain          kperio = ', kperio
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/CANAL/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/CANAL/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/CANAL/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -119,40 +119,40 @@
       !
       zh  = (kpk-1)*rn_dz
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case'
-      WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
-      WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
-      WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
-      WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
-      WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
-      WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'
-      WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
-      WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
-      WRITE(numout,*) '          H [m] : ', zh
-      WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
-      WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
-      WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'
-      WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'
-      WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'
-      WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac
-      WRITE(numout,*) '      initial Canal max current        rn_vtxmax  = ',  rn_vtxmax, ' m/s'
-      WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'
-      WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'
-      WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'
-      WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase
-      WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase
-      WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)'
-      WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise
-      WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 1                    ! EW_CANAL configuration : closed basin
-      !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      EW_CANAL : closed basin            jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case'
+         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
+         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
+         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
+         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
+         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
+         WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'
+         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
+         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
+         WRITE(numout,*) '          H [m] : ', zh
+         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
+         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
+         WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'
+         WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'
+         WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'
+         WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac
+         WRITE(numout,*) '      initial Canal max current         rn_vtxmax  = ',  rn_vtxmax, ' m/s'
+         WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'
+         WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'
+         WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'
+         WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase
+         WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase
+         WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)'
+         WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise
+         WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      EW_CANAL : closed basin               jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -79,25 +79,25 @@
       zlx = kpi*rn_dx*1.e-3
       zly = kpj*rn_dy*1.e-3
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : ICE_ADV1D test case'
-      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
-      WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
-      WRITE(numout,*) '      ICE_ADV1D domain  '
-      WRITE(numout,*) '         LX [km]: ', zlx
-      WRITE(numout,*) '         LY [km]: ', zly
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-      WRITE(numout,*) '         Coriolis:', ln_corio
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! ICE_ADV1D configuration : bi-periodic basin
-      !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      ICE_ADV1D : closed basin                    jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : ICE_ADV1D test case'
+         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
+         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
+         WRITE(numout,*) '      ICE_ADV1D domain  '
+         WRITE(numout,*) '         LX [km]: ', zlx
+         WRITE(numout,*) '         LY [km]: ', zly
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '         Coriolis:', ln_corio
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      ICE_ADV1D : closed basin                 jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -81,15 +81,13 @@
       !
       cd_cfg = 'ICE_ADV2D'           ! name & resolution (not used)
-      kk_cfg = INT( rn_dx )
+      kk_cfg = NINT( rn_dx )
       !
-      ! Global Domain size:  ICE_ADV2D domain is  300 km x 300 Km x 10 m
-      kpi = INT( 300.e3 / rn_dx ) -1
-      kpj = INT( 300.e3 / rn_dy ) -1
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
+      IF( Agrif_Root() ) THEN        ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m
+         kpi = NINT( 300.e3 / rn_dx ) - 1
+         kpj = NINT( 300.e3 / rn_dy ) - 1
+      ELSE
          kpi = nbcellsx + 2 + 2*nbghostcells
          kpj = nbcellsy + 2 + 2*nbghostcells
       ENDIF
-#endif
       kpk = 1
       !
@@ -98,30 +96,27 @@
       zlx = kpi*rn_dx*1.e-3
       zly = kpj*rn_dy*1.e-3
+      !
+      IF( Agrif_Root() ) THEN   ;   kperio = 7     ! ICE_AGRIF configuration : bi-periodic basin
+      ELSE                      ;   kperio = 0     ! closed periodicity for the zoom
+      ENDIF
       !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : ICE_ADV2D test case'
-      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
-      WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
-      WRITE(numout,*) '      ICE_ADV2D domain = 300 km x 300Km x 1 grid-point '
-      WRITE(numout,*) '         LX [km]: ', zlx
-      WRITE(numout,*) '         LY [km]: ', zly
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-      WRITE(numout,*) '         Coriolis:', ln_corio
-      !
-      !                             ! Set the lateral boundary condition of the global domain
-      kperio = 7                    ! ICE_ADV2D configuration : bi-periodic basin
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-      kperio = 0
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : ICE_ADV2D test case'
+         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
+         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
+         WRITE(numout,*) '      ICE_ADV2D domain = 300 km x 300Km x 1 grid-point '
+         WRITE(numout,*) '         LX [km]: ', zlx
+         WRITE(numout,*) '         LY [km]: ', zly
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '         Coriolis:', ln_corio
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      ICE_ADV2D : bi-periodic basin            jperio = ', kperio
       ENDIF
-#endif
-      !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      ICE_ADV2D : bi-periodic basin               jperio = ', kperio
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -81,15 +81,13 @@
       !
       cd_cfg = 'ICE_AGRIF'           ! name & resolution (not used)
-      kk_cfg = INT( rn_dx )
+      kk_cfg = NINT( rn_dx )
       !
-      ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m
-      kpi = INT( 300.e3 / rn_dx ) -1
-      kpj = INT( 300.e3 / rn_dy ) -1
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
+      IF( Agrif_Root() ) THEN        ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m
+         kpi = NINT( 300.e3 / rn_dx ) - 1
+         kpj = NINT( 300.e3 / rn_dy ) - 1
+      ELSE
          kpi = nbcellsx + 2 + 2*nbghostcells
          kpj = nbcellsy + 2 + 2*nbghostcells
       ENDIF
-#endif
       kpk = 1
       !
@@ -98,30 +96,27 @@
       zlx = kpi*rn_dx*1.e-3
       zly = kpj*rn_dy*1.e-3
+      !
+      IF( Agrif_Root() ) THEN   ;   kperio = 7     ! ICE_AGRIF configuration : bi-periodic basin
+      ELSE                      ;   kperio = 0     ! closed periodicity for the zoom
+      ENDIF
       !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : ICE_AGRIF test case'
-      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
-      WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
-      WRITE(numout,*) '      ICE_AGRIF domain = 300 km x 300Km x 1 grid-point '
-      WRITE(numout,*) '         LX [km]: ', zlx
-      WRITE(numout,*) '         LY [km]: ', zly
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-      WRITE(numout,*) '         Coriolis:', ln_corio
-      !
-      !                             ! Set the lateral boundary condition of the global domain
-      kperio = 7                    ! ICE_AGRIF configuration : bi-periodic basin
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-      kperio = 0
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : ICE_AGRIF test case'
+         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
+         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'
+         WRITE(numout,*) '      ICE_AGRIF domain = 300 km x 300Km x 1 grid-point '
+         WRITE(numout,*) '         LX [km]: ', zlx
+         WRITE(numout,*) '         LY [km]: ', zly
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '         Coriolis:', ln_corio
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      ICE_AGRIF : bi-periodic basin            jperio = ', kperio
       ENDIF
-#endif
-      !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      ICE_AGRIF : bi-periodic basin               jperio = ', kperio
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ISOMIP/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ISOMIP/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/ISOMIP/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -78,29 +78,29 @@
       kpk = INT( rbathy / rn_e3    ) + 1     ! add 1 for t-point in the seafloor
       !
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : ISOMIP test case'
-      WRITE(numout,*) '      type of vertical coordinate : '
-      WRITE(numout,*) '         z-coordinate flag                     ln_zco   = ', ln_zco
-      WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps   = ', ln_zps
-      WRITE(numout,*) '         s-coordinate flag                     ln_sco   = ', ln_sco
-      WRITE(numout,*) '      resolution'
-      WRITE(numout,*) '         zonal      resolution                 rn_e1deg = ', rn_e1deg, ' degrees'
-      WRITE(numout,*) '         meridional resolution                 rn_e1deg = ', rn_e1deg, ' degrees'
-      WRITE(numout,*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters'
-      WRITE(numout,*) '      ISOMIP domain = 15° x 10° x 900 m'
-      WRITE(numout,*) '         resulting global domain size :        jpiglo   = ', kpi
-      WRITE(numout,*) '                                               jpjglo   = ', kpj
-      WRITE(numout,*) '                                               jpkglo   = ', kpk
-      !
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! ISOMIP configuration : close basin
       !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      ISOMIP : closed basin                    jperio   = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : ISOMIP test case'
+         WRITE(numout,*) '      type of vertical coordinate : '
+         WRITE(numout,*) '         z-coordinate flag                     ln_zco   = ', ln_zco
+         WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps   = ', ln_zps
+         WRITE(numout,*) '         s-coordinate flag                     ln_sco   = ', ln_sco
+         WRITE(numout,*) '      resolution'
+         WRITE(numout,*) '         zonal      resolution                 rn_e1deg = ', rn_e1deg, ' degrees'
+         WRITE(numout,*) '         meridional resolution                 rn_e1deg = ', rn_e1deg, ' degrees'
+         WRITE(numout,*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters'
+         WRITE(numout,*) '      ISOMIP domain = 15° x 10° x 900 m'
+         WRITE(numout,*) '         resulting global domain size :        jpiglo   = ', kpi
+         WRITE(numout,*) '                                               jpjglo   = ', kpj
+         WRITE(numout,*) '                                               jpkglo   = ', kpk
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      ISOMIP : closed basin                    jperio   = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -74,23 +74,23 @@
       kpj = 3
       kpk = INT(  20.  / rn_dz ) + 1
-      !
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : LOCK_EXCHANGE test case'
-      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
-      WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'
-      WRITE(numout,*) '      LOCK_EXCHANGE domain = 64 km  x  3 grid-points  x  20 m'
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! LOCK_EXCHANGE configuration : closed domain
       !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      closed                                   jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : LOCK_EXCHANGE test case'
+         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
+         WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'
+         WRITE(numout,*) '      LOCK_EXCHANGE domain = 64 km  x  3 grid-points  x  20 m'
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      closed                                   jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/VORTEX/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -80,40 +80,38 @@
       !
       cd_cfg = 'VORTEX'             ! name & resolution (not used)
-      kk_cfg = INT( rn_dx )
+      kk_cfg = nINT( rn_dx )
       !
-      ! Global Domain size:  VORTEX global domain is  1800 km x 1800 Km x 5000 m
-      kpi = INT( 1800.e3  / rn_dx ) + 3  
-      kpj = INT( 1800.e3  / rn_dy ) + 3 
-      kpk = INT( 5000._wp / rn_dz ) + 1
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
+      IF( Agrif_Root() ) THEN       ! Global Domain size:  VORTEX global domain is  1800 km x 1800 Km x 5000 m
+         kpi = NINT( 1800.e3  / rn_dx ) + 3  
+         kpj = NINT( 1800.e3  / rn_dy ) + 3 
+      ELSE
          kpi  = nbcellsx + 2 + 2*nbghostcells
          kpj  = nbcellsy + 2 + 2*nbghostcells
       ENDIF
-#endif
+      kpk = NINT( 5000._wp / rn_dz ) + 1
       !
       zlx = (kpi-2)*rn_dx*1.e-3
       zly = (kpj-2)*rn_dy*1.e-3
       zh  = (kpk-1)*rn_dz
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : VORTEX test case'
-      WRITE(numout,*) '      horizontal resolution             rn_dx  = ', rn_dx, ' m'
-      WRITE(numout,*) '      horizontal resolution             rn_dy  = ', rn_dy, ' m'
-      WRITE(numout,*) '      vertical resolution               rn_dz  = ', rn_dz, ' m'
-      WRITE(numout,*) '      VORTEX domain: '
-      WRITE(numout,*) '         LX [km]: ', zlx
-      WRITE(numout,*) '         LY [km]: ', zly
-      WRITE(numout,*) '          H [m] : ', zh
-      WRITE(numout,*) '      Reference latitude            rn_ppgphi0 = ', rn_ppgphi0
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! VORTEX configuration : closed basin
-      !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      VORTEX : closed basin            jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : VORTEX test case'
+         WRITE(numout,*) '      horizontal resolution             rn_dx  = ', rn_dx, ' m'
+         WRITE(numout,*) '      horizontal resolution             rn_dy  = ', rn_dy, ' m'
+         WRITE(numout,*) '      vertical resolution               rn_dz  = ', rn_dz, ' m'
+         WRITE(numout,*) '      VORTEX domain: '
+         WRITE(numout,*) '         LX [km]: ', zlx
+         WRITE(numout,*) '         LY [km]: ', zly
+         WRITE(numout,*) '          H [m] : ', zh
+         WRITE(numout,*) '      Reference latitude            rn_ppgphi0 = ', rn_ppgphi0
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      VORTEX : closed basin            jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/MY_SRC/usrdef_nam.F90	(revision 11319)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/MY_SRC/usrdef_nam.F90	(revision 11320)
@@ -76,24 +76,24 @@
       kpj = INT(  32.e3 / rn_dx ) + 2
       kpk = INT(  10.  / rn_dz ) + 1
-      !
-      !                             ! control print
-      WRITE(numout,*) '   '
-      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
-      WRITE(numout,*) '~~~~~~~~~~~ '
-      WRITE(numout,*) '   Namelist namusr_def : WAD_TEST_CASES test case'
-      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
-      WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'
-      WRITE(numout,*) '      WAD_TEST_CASES domain = 52 km  x  34 km x 10 m'
-      WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
-      WRITE(numout,*) '                                               jpjglo = ', kpj
-      WRITE(numout,*) '                                               jpkglo = ', kpk
-      !
       !                             ! Set the lateral boundary condition of the global domain
       kperio = 0                    ! WAD_TEST_CASES configuration : closed domain
       IF( nn_wad_test == 8 ) kperio = 7 ! North-South cyclic test
       !
-      WRITE(numout,*) '   '
-      WRITE(numout,*) '   Lateral boundary condition of the global domain'
-      WRITE(numout,*) '      closed                                   jperio = ', kperio
+      !                             ! control print
+      IF(lwp) THEN
+         WRITE(numout,*) '   '
+         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   Namelist namusr_def : WAD_TEST_CASES test case'
+         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
+         WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'
+         WRITE(numout,*) '      WAD_TEST_CASES domain = 52 km  x  34 km x 10 m'
+         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi
+         WRITE(numout,*) '                                               jpjglo = ', kpj
+         WRITE(numout,*) '                                               jpkglo = ', kpk
+         WRITE(numout,*) '   '
+         WRITE(numout,*) '   Lateral boundary condition of the global domain'
+         WRITE(numout,*) '      closed                                   jperio = ', kperio
+      ENDIF
       !
    END SUBROUTINE usr_def_nam
