Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg	(revision 9067)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg	(revision 9089)
@@ -2,4 +2,12 @@
 !! NEMO/OPA  : ISOMIP Configuration namelist to overwrite reference dynamical namelist
 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!-----------------------------------------------------------------------
+&namusr_def    !   ISOMIP user defined namelist  
+!-----------------------------------------------------------------------
+   ln_zps      = .true.    ! z-partial-step coordinate
+   rn_e1deg    =   0.3     !  zonal      grid-spacing (degrees)
+   rn_e2deg    =   0.1     !  meridional grid-spacing (degrees)
+   rn_e3       =   30.     !  vertical resolution
+/
 !-----------------------------------------------------------------------
 &namrun        !   parameters of the run
@@ -10,4 +18,5 @@
    nn_leapy    =       0   !  Leap year calendar (1) or not (0)
    ln_clobber  = .true.    !  clobber (overwrite) an existing file
+   nn_istate   =       0   !  output the initial state (1) or not (0)
    nn_stock    =  99999999 !  frequency of creation of a restart file (modulo referenced to 1)
    nn_write    =      48   !  frequency of write in the output file   (modulo referenced to nn_it000)
@@ -19,4 +28,8 @@
    ln_read_cfg = .false.   !  (=T) read the domain configuration file
       !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules
+      cn_domcfg = "ISOMIP_zps_domcfg"         ! domain configuration filename
+      !
+   ln_write_cfg= .false.   !  (=T) create the domain configuration file
+      cn_domcfg_out = "ISOMIP_cfg_out"    ! filename of the created file
 /
 !-----------------------------------------------------------------------
@@ -44,5 +57,5 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   nn_fsbc     = 6         !  frequency of surface boundary condition computation
+   nn_fsbc     = 1         !  frequency of surface boundary condition computation
    !                       !     (also = the frequency of sea-ice model call)
    ln_blk      = .false.    !  Bulk formulation                          (T => fill namsbc_blk )
@@ -168,5 +181,10 @@
 &namdrg            !   top/bottom drag coefficient                      (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_non_lin = .true.    !  non-linear  drag: Cd = Cd0 |U|
+   ln_NONE    = .false.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot
+   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top)
+   ln_non_lin = .true.     !  non-linear  drag: Cd = Cd0 |U|
+   ln_loglayer= .false.    !  logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+   !
+   ln_drgimp  = .false.    !  implicit top/bottom friction flag
 /
 !-----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_hgr.F90	(revision 9067)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_hgr.F90	(revision 9089)
@@ -17,9 +17,8 @@
    USE par_oce         ! ocean space and time domain
    USE phycst          ! physical constants
-   USE usrdef_nam, ONLY: rn_lam0, rn_phi0, rn_e1deg, rn_e2deg   ! horizontal resolution in meters
+   USE usrdef_nam, ONLY: rn_e1deg, rn_e2deg   ! horizontal resolution in meters
    !
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -29,5 +28,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2017)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -66,6 +65,4 @@
       !!-------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
-      !
       IF(lwp) THEN
          WRITE(numout,*)
@@ -79,27 +76,26 @@
       !                       !==  grid point position  ==!   (in degrees)
       DO jj = 1, jpj
+         DO ji = 1, jpi             ! longitude   (west coast at lon=0°)
+            plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )  
+            plamu(ji,jj) = rn_e1deg * (          REAL( ji-1 + nimpp-1 , wp )  )
+            plamv(ji,jj) = plamt(ji,jj)
+            plamf(ji,jj) = plamu(ji,jj)
+            !                       ! latitude   (south coast at lat= 81°)
+            pphit(ji,jj) = rn_e2deg * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) - 80._wp
+            pphiu(ji,jj) = pphit(ji,jj)
+            pphiv(ji,jj) = rn_e2deg * (          REAL( jj-1 + njmpp-1 , wp )  ) - 80_wp
+            pphif(ji,jj) = pphiv(ji,jj)
+         END DO
+      END DO
+      !
+      !                       !==  Horizontal scale factors  ==!   (in meters)
+      DO jj = 1, jpj
          DO ji = 1, jpi
-            zti = FLOAT( ji - 1 + nimpp - 1 )         ;   ztj = FLOAT( jj - 1 + njmpp - 1 )
-            zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5   ;   zuj = FLOAT( jj - 1 + njmpp - 1 )
-            zvi = FLOAT( ji - 1 + nimpp - 1 )         ;   zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5
-            zfi = FLOAT( ji - 1 + nimpp - 1 ) + 0.5   ;   zfj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5
-     ! Longitude
-            plamt(ji,jj) = rn_lam0 + rn_e1deg * zti
-            plamu(ji,jj) = rn_lam0 + rn_e1deg * zui
-            plamv(ji,jj) = rn_lam0 + rn_e1deg * zvi
-            plamf(ji,jj) = rn_lam0 + rn_e1deg * zfi
-     ! Latitude
-            pphit(ji,jj) = rn_phi0 + rn_e2deg * ztj
-            pphiu(ji,jj) = rn_phi0 + rn_e2deg * zuj
-            pphiv(ji,jj) = rn_phi0 + rn_e2deg * zvj
-            pphif(ji,jj) = rn_phi0 + rn_e2deg * zfj
-            
-     !                       !==  Horizontal scale factors  ==!   (in meters)
-     ! e1
+            !                       ! e1   (zonal)
             pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg
             pe1u(ji,jj) = ra * rad * COS( rad * pphiu(ji,jj) ) * rn_e1deg
             pe1v(ji,jj) = ra * rad * COS( rad * pphiv(ji,jj) ) * rn_e1deg
             pe1f(ji,jj) = ra * rad * COS( rad * pphif(ji,jj) ) * rn_e1deg
-     ! e2
+            !                       ! e2   (meridional)
             pe2t(ji,jj) = ra * rad * rn_e2deg
             pe2u(ji,jj) = ra * rad * rn_e2deg
@@ -109,5 +105,5 @@
       END DO
       !                             ! NO reduction of grid size in some straits 
-      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
+      ke1e2u_v    = 0               !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
       pe1e2u(:,:) = 0._wp           !    CAUTION: set to zero to avoid error with some compilers that
       pe1e2v(:,:) = 0._wp           !             require an initialization of INTENT(out) arguments
@@ -116,10 +112,6 @@
       !                       !==  Coriolis parameter  ==!
       kff = 0                       ! Coriolis parameter calculated on the sphere
-      !
-      !
       pff_f(:,:) = 0._wp            ! CAUTION: set to zero to avoid error with some compilers that
       pff_t(:,:) = 0._wp            !             require an initialization of INTENT(out) arguments
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
       !
    END SUBROUTINE usr_def_hgr
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_nam.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_nam.F90	(revision 9067)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_nam.F90	(revision 9089)
@@ -29,11 +29,12 @@
    PUBLIC   usr_def_nam   ! called by nemogcm.F90
 
-   !                              !!* namusr_def namelist *!!
-   REAL(wp), PUBLIC ::   rn_lam0, rn_phi0     
-   REAL(wp), PUBLIC ::   rn_e1deg, rn_e2deg, rn_e3
-   REAL(wp), PUBLIC ::   rbathy
+   !                                         !!* namusr_def namelist *!!
+   REAL(wp), PUBLIC ::   rn_e1deg, rn_e2deg   !: horizontal resolution   [degrees]
+   REAL(wp), PUBLIC ::   rn_e3                !: vertical   resolution         [m]
+   
+   REAL(wp), PARAMETER, PUBLIC ::   rbathy = 900._wp   !: depth of the seafloor   [m]
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2017)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -61,5 +62,5 @@
       INTEGER ::   ios, ii   ! Local integer
       !!
-      NAMELIST/namusr_def/ ln_zco, ln_zps, ln_sco, rn_lam0, rn_phi0, rn_e1deg, rn_e2deg, rn_e3
+      NAMELIST/namusr_def/ ln_zco, ln_zps, ln_sco, rn_e1deg, rn_e2deg, rn_e3
       !!----------------------------------------------------------------------
       !
@@ -74,23 +75,28 @@
       cd_cfg = 'ISOMIP'           ! name & resolution (not used)
       kk_cfg = INT( rn_e3 )
-      rbathy = 900.0   ! sea bed depth
       !
-      ! Global Domain size:  ISOMIP domain is  200 km x 3 grid-points x 2000 m
-      kpi = INT( 15.0  / rn_e1deg ) + 1
-      kpj = INT( 10.0  / rn_e2deg ) + 1
-      kpk = INT( rbathy / rn_e3 ) + 1
+      ! Global Domain size:  ISOMIP domain is  15° x 10° x 900 m
+      kpi = INT(  15.0  / rn_e1deg ) + 2     ! add 2 for t-point in the east  & west  coasts
+      kpj = INT(  10.0  / rn_e2deg ) + 2     !     -        -           north & south   -
+      kpk = INT( rbathy / rn_e3    ) + 1     ! add 1 for t-point in the seafloor
       !
       !                             ! control print
-      WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '   Namelist namusr_def : ISOMIP test case'                                  ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '      type of vertical coordinate : '                                         ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '         z-coordinate flag                     ln_zco = ', ln_zco             ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps             ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '         s-coordinate flag                     ln_sco = ', ln_sco             ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '   '                                                                              ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'       ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                     ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '   Namelist namusr_def : ISOMIP test case'                                        ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      type of vertical coordinate : '                                             ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         z-coordinate flag                     ln_zco   = ', ln_zco               ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         z-partial-step coordinate flag        ln_zps   = ', ln_zps               ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         s-coordinate flag                     ln_sco   = ', ln_sco               ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      resolution'                                                                 ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         zonal      resolution                 rn_e1deg = ', rn_e1deg, ' degrees' ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         meridional resolution                 rn_e1deg = ', rn_e1deg, ' degrees' ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters'  ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      ISOMIP domain = 15° x 10° x 900 m'                                          ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo   = ', kpi                  ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '                                               jpjglo   = ', kpj                  ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '                                               jpkglo   = ', kpk                  ;   ii = ii + 1
+      !
       !
       !                             ! Set the lateral boundary condition of the global domain
@@ -99,5 +105,5 @@
       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1
       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '      ISOMIP : closed basin                    jperio = ', kperio             ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      ISOMIP : closed basin                    jperio   = ', kperio             ;   ii = ii + 1
       !
    END SUBROUTINE usr_def_nam
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_zgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_zgr.F90	(revision 9067)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_zgr.F90	(revision 9089)
@@ -171,26 +171,22 @@
          END DO         
          !                                   ! bottom scale factors and depth at  U-, V-, UW and VW-points
-         DO jk = 1,jpkm1                     ! Computed as the minimum of neighbooring scale factors
+         pe3u (:,:,:) = pe3t(:,:,:)
+         pe3uw(:,:,:) = pe3w(:,:,:)
+         DO jk = 1, jpk                      ! Computed as the minimum of neighbooring scale factors
             DO jj = 1, jpjm1
-               DO ji = 1, fs_jpim1   ! vector opt.
-                  pe3u (ji,jj,jk) = MIN( pe3t(ji,jj,jk), pe3t(ji+1,jj,jk) )
+               DO ji = 1, jpi
                   pe3v (ji,jj,jk) = MIN( pe3t(ji,jj,jk), pe3t(ji,jj+1,jk) )
-                  pe3uw(ji,jj,jk) = MIN( pe3w(ji,jj,jk), pe3w(ji+1,jj,jk) )
                   pe3vw(ji,jj,jk) = MIN( pe3w(ji,jj,jk), pe3w(ji,jj+1,jk) )
+                  pe3f (ji,jj,jk) = pe3v(ji,jj,jk)
                END DO
             END DO
-            DO jj = 1, jpjm1
-               DO ji = 1, fs_jpim1   ! vector opt.
-                 pe3f(ji,jj,jk) = MIN( pe3v(ji,jj,jk), pe3v(ji+1,jj,jk) )
-               END DO
-            END DO
-         END DO
-         CALL lbc_lnk( pe3u , 'U', 1._wp )   ;   CALL lbc_lnk( pe3uw, 'U', 1._wp )   ! lateral boundary conditions
+         END DO
          CALL lbc_lnk( pe3v , 'V', 1._wp )   ;   CALL lbc_lnk( pe3vw, 'V', 1._wp )
          CALL lbc_lnk( pe3f , 'F', 1._wp )
-         DO jk = 1,jpkm1
+         DO jk = 1, jpk
             ! set to z-scale factor if zero (i.e. along closed boundaries) because of lbclnk
             WHERE( pe3u (:,:,jk) == 0._wp )   pe3u (:,:,jk) = pe3t_1d(jk)
             WHERE( pe3v (:,:,jk) == 0._wp )   pe3v (:,:,jk) = pe3t_1d(jk)
+            WHERE( pe3f (:,:,jk) == 0._wp )   pe3f (:,:,jk) = pe3t_1d(jk)
             WHERE( pe3uw(:,:,jk) == 0._wp )   pe3uw(:,:,jk) = pe3w_1d(jk)
             WHERE( pe3vw(:,:,jk) == 0._wp )   pe3vw(:,:,jk) = pe3w_1d(jk)
