Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/cfgs/SHARED/namelist_ref	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/cfgs/SHARED/namelist_ref	(revision 13351)
@@ -645,5 +645,5 @@
    ln_agrif_2way   = .true.  !  activate two way nesting
    ln_init_chfrpar = .false. !  initialize child grids from parent
-   ln_vremap       = .false. !  use vertical remapping
+   ln_vert_remap   = .false. !  use vertical remapping
    ln_chk_bathy    = .false. !  =T  check the parent bathymetry
    ln_spc_dyn      = .true.  !  use 0 as special value for dynamics
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90	(revision 13351)
@@ -23,5 +23,5 @@
    LOGICAL , PUBLIC ::   ln_spc_dyn    = .FALSE.   !: use zeros (.false.) or not (.true.) in
                                                    !: bdys dynamical fields interpolation
-   LOGICAL , PUBLIC ::   ln_vremap     = .FALSE.   !: use vertical remapping
+   LOGICAL , PUBLIC ::   ln_vert_remap = .FALSE.   !: use vertical remapping
    REAL(wp), PUBLIC ::   rn_sponge_tra = 0.002     !: sponge coeff. for tracers
    REAL(wp), PUBLIC ::   rn_sponge_dyn = 0.002     !: sponge coeff. for dynamics
@@ -55,8 +55,8 @@
    INTEGER,  PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbkt_parent, mbku_parent, mbkv_parent
 
-   INTEGER, PUBLIC :: tsn_id                                                  ! AGRIF profile for tracers interpolation and update
+   INTEGER, PUBLIC :: ts_interp_id, ts_update_id                              ! AGRIF profile for tracers interpolation and update
    INTEGER, PUBLIC :: un_interp_id, vn_interp_id                              ! AGRIF profiles for interpolations
    INTEGER, PUBLIC :: un_update_id, vn_update_id                              ! AGRIF profiles for udpates
-   INTEGER, PUBLIC :: tsn_sponge_id, un_sponge_id, vn_sponge_id               ! AGRIF profiles for sponge layers
+   INTEGER, PUBLIC :: ts_sponge_id, un_sponge_id, vn_sponge_id                ! AGRIF profiles for sponge layers
    INTEGER, PUBLIC :: tsini_id, uini_id, vini_id, sshini_id                   ! AGRIF profile for initialization
 # if defined key_top
@@ -75,5 +75,5 @@
 !$AGRIF_DO_NOT_TREAT
    LOGICAL, PUBLIC :: use_sign_north
-   REAL, PUBLIC :: sign_north
+   REAL, PUBLIC    :: sign_north
    LOGICAL, PUBLIC :: l_ini_child = .FALSE.
    LOGICAL, PUBLIC :: l_vremap    = .FALSE.
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90	(revision 13351)
@@ -169,7 +169,7 @@
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = .TRUE.
-      l_vremap 		    = ln_vremap
-      !
-      CALL Agrif_Bc_variable( tsn_id, procname=interptsn )
+      l_vremap 		    = ln_vert_remap
+      !
+      CALL Agrif_Bc_variable( ts_interp_id, procname=interptsn )
       !
       Agrif_UseSpecialValue = .FALSE.
@@ -194,5 +194,5 @@
       Agrif_SpecialValue    = 0.0_wp
       Agrif_UseSpecialValue = ln_spc_dyn
-      l_vremap              = ln_vremap
+      l_vremap              = ln_vert_remap
       !
       use_sign_north = .TRUE.
@@ -785,5 +785,5 @@
       Agrif_SpecialValue    = 0.e0
       Agrif_UseSpecialValue = .TRUE.
-      l_vremap              = ln_vremap
+      l_vremap              = ln_vert_remap
       !
       CALL Agrif_Bc_variable( avm_id, calledweight=zalpha, procname=interpavm )       
@@ -828,5 +828,5 @@
          END DO
 
-         IF( l_vremap .OR. l_ini_child) THEN
+         IF( l_vremap .OR. l_ini_child ) THEN
             ! Interpolate thicknesses
             ! Warning: these are masked, hence extrapolated prior interpolation.
@@ -1588,5 +1588,5 @@
       ! --- West --- !
       IF(lk_west) THEN
-         ispon  = nn_sponge_len * Agrif_irhox() + 1
+         ispon  = nn_sponge_len * Agrif_irhox()
          istart = nn_hls + 2                                 ! halo + land + 1
          iend   = nn_hls + 1 + nbghostcells + ispon          ! halo + land + nbghostcells + sponge
@@ -1610,5 +1610,5 @@
       ! --- East --- !
       IF(lk_east) THEN
-         ispon  = nn_sponge_len * Agrif_irhox() + 1
+         ispon  = nn_sponge_len * Agrif_irhox() 
          istart = jpiglo - ( nn_hls + nbghostcells + ispon ) ! halo + land + nbghostcells + sponge - 1
          iend   = jpiglo - ( nn_hls + 1 )                    ! halo + land + 1                     - 1
@@ -1632,5 +1632,5 @@
       ! --- South --- !
       IF(lk_south) THEN
-         ispon  = nn_sponge_len * Agrif_irhoy() + 1 
+         ispon  = nn_sponge_len * Agrif_irhoy() 
          jstart = nn_hls + 2                                 ! halo + land + 1
          jend   = nn_hls + 1 + nbghostcells + ispon          ! halo + land + nbghostcells + sponge
@@ -1654,5 +1654,5 @@
       ! --- North --- !
       IF(lk_north) THEN
-         ispon  = nn_sponge_len * Agrif_irhoy() + 1 
+         ispon  = nn_sponge_len * Agrif_irhoy() 
          jstart = jpjglo - ( nn_hls + nbghostcells + ispon)  ! halo + land + nbghostcells +sponge - 1
          jend   = jpjglo - ( nn_hls + 1 )                    ! halo + land + 1            - 1
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_sponge.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_sponge.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_sponge.F90	(revision 13351)
@@ -55,8 +55,8 @@
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = .TRUE.
-      l_vremap              = ln_vremap
+      l_vremap              = ln_vert_remap
       tabspongedone_tsn     = .FALSE.
       !
-      CALL Agrif_Bc_Variable( tsn_sponge_id, calledweight=zcoef, procname=interptsn_sponge )
+      CALL Agrif_Bc_Variable( ts_sponge_id, calledweight=zcoef, procname=interptsn_sponge )
       !
       Agrif_UseSpecialValue = .FALSE.
@@ -82,5 +82,5 @@
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = ln_spc_dyn
-      l_vremap              = ln_vremap
+      l_vremap              = ln_vert_remap
       use_sign_north        = .TRUE.
       sign_north            = -1._wp
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_update.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_update.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_update.F90	(revision 13351)
@@ -52,14 +52,14 @@
       Agrif_UseSpecialValueInUpdate = .NOT.l_vremap
       Agrif_SpecialValueFineGrid    = 0._wp
-      l_vremap                      = ln_vremap
+      l_vremap                      = ln_vert_remap
       ! 
 # if ! defined DECAL_FEEDBACK
-      CALL Agrif_Update_Variable(tsn_id, procname=updateTS)
+      CALL Agrif_Update_Variable(ts_update_id, procname=updateTS)
 ! near boundary update:
-!      CALL Agrif_Update_Variable(tsn_id,locupdate=(/0,2/), procname=updateTS)
+!      CALL Agrif_Update_Variable(ts_update_id,locupdate=(/0,2/), procname=updateTS)
 # else
-      CALL Agrif_Update_Variable(tsn_id, locupdate=(/1,0/),procname=updateTS)
+      CALL Agrif_Update_Variable(ts_update_id, locupdate=(/1,0/),procname=updateTS)
 ! near boundary update:
-!      CALL Agrif_Update_Variable(tsn_id,locupdate=(/1,2/), procname=updateTS)
+!      CALL Agrif_Update_Variable(ts_update_id,locupdate=(/1,2/), procname=updateTS)
 # endif
       !
@@ -81,5 +81,5 @@
       Agrif_UseSpecialValueInUpdate = .FALSE.
       Agrif_SpecialValueFineGrid    = 0._wp
-      l_vremap                      = ln_vremap
+      l_vremap                      = ln_vert_remap
       use_sign_north                = .TRUE.
       sign_north                    = -1._wp
@@ -128,5 +128,5 @@
       !
       use_sign_north = .FALSE.
-      ln_vremap = .FALSE.
+      l_vremap = .FALSE.
       !
    END SUBROUTINE Agrif_Update_Dyn
@@ -428,5 +428,5 @@
          IF  ((l_1st_euler).AND.(Agrif_Nb_Step()==0) ) THEN
             ts(i1:i2,j1:j2,1:jpkm1,1:jpts,Kbb_a)  = ts(i1:i2,j1:j2,1:jpkm1,1:jpts,Kmm_a)
-         ENDIF
+         ENDIF         
       ENDIF
       ! 
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_top_interp.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_top_interp.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_top_interp.F90	(revision 13351)
@@ -43,9 +43,10 @@
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = .TRUE.
-      l_vremap = ln_vremap
+      l_vremap = ln_vert_remap
       !
       CALL Agrif_Bc_variable( trn_id, procname=interptrn )
+      !
       Agrif_UseSpecialValue = .FALSE.
-      l_vremap = .FALSE.
+      l_vremap              = .FALSE.
       !
    END SUBROUTINE Agrif_trc
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90	(revision 13351)
@@ -230,5 +230,5 @@
          !
          kindic_agr = 0
-         IF( .NOT. ln_vremap ) THEN
+         IF( .NOT. ln_vert_remap ) THEN
             !
             ! check if tmask and vertical scale factors agree with parent in sponge area:
@@ -251,8 +251,8 @@
       ENDIF
 
-      IF( ln_vremap ) THEN
+      IF( ln_vert_remap ) THEN
       ! Additional constrain that should be removed someday:
          IF ( Agrif_Parent(jpk).GT.jpk ) THEN
-            CALL ctl_stop( ' With ln_vremap, child grids must have jpk greater or equal to the parent value' )
+            CALL ctl_stop( ' With ln_vert_remap, child grids must have jpk greater or equal to the parent value' )
          ENDIF
       ENDIF
@@ -294,10 +294,10 @@
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = .TRUE.
-      l_vremap              = ln_vremap
-
-      CALL Agrif_Bc_variable(       tsn_id,calledweight=1.,procname=interptsn)
+      l_vremap              = ln_vert_remap
+
+      CALL Agrif_Bc_variable(ts_interp_id,calledweight=1.,procname=interptsn)
       CALL Agrif_Sponge
       tabspongedone_tsn = .FALSE.
-      CALL Agrif_Bc_variable(tsn_sponge_id,calledweight=1.,procname=interptsn_sponge)
+      CALL Agrif_Bc_variable(ts_sponge_id,calledweight=1.,procname=interptsn_sponge)
       ! reset tsa to zero
       ts(:,:,:,:,Krhs_a) = 0._wp
@@ -394,6 +394,7 @@
       ind3 = nn_hls + 2 + nbghostcells_y_s
 
-      CALL agrif_declare_variable((/2,2,0,0/),(/ind2,ind3,0,0/)  ,(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),tsn_id)
-      CALL agrif_declare_variable((/2,2,0,0/),(/ind2,ind3,0,0/)  ,(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),tsn_sponge_id)
+      CALL agrif_declare_variable((/2,2,0,0/),(/ind2,ind3,0,0/)  ,(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),ts_interp_id)
+      CALL agrif_declare_variable((/2,2,0,0/),(/ind2,ind3,0,0/)  ,(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),ts_update_id)
+      CALL agrif_declare_variable((/2,2,0,0/),(/ind2,ind3,0,0/)  ,(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),ts_sponge_id)
       CALL agrif_declare_variable((/1,2,0,0/),(/ind2-1,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,2/),un_interp_id)
       CALL agrif_declare_variable((/2,1,0,0/),(/ind2,ind3-1,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,2/),vn_interp_id)
@@ -423,9 +424,9 @@
       ! 2. Type of interpolation
       !-------------------------
-      CALL Agrif_Set_bcinterp(       tsn_id,interp =AGRIF_linear)
+      CALL Agrif_Set_bcinterp( ts_interp_id,interp =AGRIF_linear)
       CALL Agrif_Set_bcinterp( un_interp_id,interp1=Agrif_linear,interp2=AGRIF_ppm   )
       CALL Agrif_Set_bcinterp( vn_interp_id,interp1=AGRIF_ppm   ,interp2=Agrif_linear)
 
-      CALL Agrif_Set_bcinterp( tsn_sponge_id,interp =AGRIF_linear)
+      CALL Agrif_Set_bcinterp(  ts_sponge_id,interp =AGRIF_linear)
       CALL Agrif_Set_bcinterp(  un_sponge_id,interp1=Agrif_linear,interp2=AGRIF_ppm   )
       CALL Agrif_Set_bcinterp(  vn_sponge_id,interp1=AGRIF_ppm   ,interp2=Agrif_linear)
@@ -453,9 +454,9 @@
       ! 3. Location of interpolation
       !-----------------------------
-      CALL Agrif_Set_bc(       tsn_id, (/0,ind1-1/) ) ! if west,  rhox=3 and nbghost=3: columns 2 to 4
+      CALL Agrif_Set_bc( ts_interp_id, (/0,ind1-1/) ) ! if west,  rhox=3 and nbghost=3: columns 2 to 4
       CALL Agrif_Set_bc( un_interp_id, (/0,ind1-1/) ) 
       CALL Agrif_Set_bc( vn_interp_id, (/0,ind1-1/) )
 
-      CALL Agrif_Set_bc( tsn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) )  ! if west,  rhox=3, nn_sponge_len=2 
+      CALL Agrif_Set_bc(  ts_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) )  ! if west,  rhox=3, nn_sponge_len=2 
       CALL Agrif_Set_bc(  un_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) )  ! and nbghost=3: 
       CALL Agrif_Set_bc(  vn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) )  ! columns 4 to 11
@@ -475,5 +476,5 @@
 
 # if defined UPD_HIGH
-      CALL Agrif_Set_Updatetype(      tsn_id,update  = Agrif_Update_Full_Weighting)
+      CALL Agrif_Set_Updatetype(ts_interp_id,update  = Agrif_Update_Full_Weighting)
       CALL Agrif_Set_Updatetype(un_update_id,update1 = Agrif_Update_Average       , update2 = Agrif_Update_Full_Weighting)
       CALL Agrif_Set_Updatetype(vn_update_id,update1 = Agrif_Update_Full_Weighting, update2 = Agrif_Update_Average       )
@@ -491,7 +492,7 @@
 
 #else
-      CALL Agrif_Set_Updatetype(     tsn_id, update  = AGRIF_Update_Average)
-      CALL Agrif_Set_Updatetype(un_update_id,update1 = Agrif_Update_Copy   , update2 = Agrif_Update_Average)
-      CALL Agrif_Set_Updatetype(vn_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy   )
+      CALL Agrif_Set_Updatetype(ts_update_id ,update  = AGRIF_Update_Average)
+      CALL Agrif_Set_Updatetype(un_update_id ,update1 = Agrif_Update_Copy   , update2 = Agrif_Update_Average)
+      CALL Agrif_Set_Updatetype(vn_update_id ,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy   )
 
       CALL Agrif_Set_Updatetype(ub2b_update_id,update1 = Agrif_Update_Copy   , update2 = Agrif_Update_Average)
@@ -766,5 +767,5 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       NAMELIST/namagrif/ ln_agrif_2way, ln_init_chfrpar, rn_sponge_tra, rn_sponge_dyn, rn_trelax_tra, rn_trelax_dyn, &
-                       & ln_spc_dyn, ln_vremap, ln_chk_bathy
+                       & ln_spc_dyn, ln_vert_remap, ln_chk_bathy
       !!--------------------------------------------------------------------------------------
       !
@@ -787,5 +788,5 @@
          WRITE(numout,*) '      ad. time relaxation for dynamics  rn_trelax_dyn = ', rn_trelax_dyn
          WRITE(numout,*) '      use special values for dynamics   ln_spc_dyn    = ', ln_spc_dyn
-         WRITE(numout,*) '      vertical remapping                ln_vremap     = ', ln_vremap
+         WRITE(numout,*) '      vertical remapping                ln_vert_remap = ', ln_vert_remap
          WRITE(numout,*) '      check bathymetry                  ln_chk_bathy  = ', ln_chk_bathy
       ENDIF
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 13350)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 13351)
@@ -71,5 +71,5 @@
          rn_dx = Agrif_Parent(rn_dx)/Agrif_Rhox()
          rn_dy = Agrif_Parent(rn_dy)/Agrif_Rhoy()
-         rn_dz = Agrif_Parent(rn_dz)
+!         rn_dz = Agrif_Parent(rn_dz)
          rn_ppgphi0 = Agrif_Parent(rn_ppgphi0)
       ENDIF
