Index: NEMO/trunk/src/NST/agrif_oce_interp.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_oce_interp.F90	(revision 14122)
+++ NEMO/trunk/src/NST/agrif_oce_interp.F90	(revision 14170)
@@ -76,7 +76,4 @@
       IF(lwp) WRITE(numout,*) ' '
 
-      IF ( ln_rstart ) & 
-         & CALL ctl_stop('AGRIF hot start should be desactivated in restarting mode')
-
       IF ( .NOT.Agrif_Parent(l_1st_euler) ) & 
          & CALL ctl_stop('AGRIF hot start requires to force Euler first step on parent')
@@ -86,13 +83,11 @@
       Agrif_UseSpecialValue = .TRUE.
 
-      ts(:,:,:,:,:) = 0.0_wp
-      uu(:,:,:,:)   = 0.0_wp
-      vv(:,:,:,:)   = 0.0_wp 
-      ssh(:,:,:)    = 0._wp
+      ts(:,:,:,:,Kbb) = 0.0_wp
+      uu(:,:,:,Kbb)   = 0.0_wp
+      vv(:,:,:,Kbb)   = 0.0_wp 
        
       Krhs_a = Kbb   ;   Kmm_a = Kbb
 
       CALL Agrif_Init_Variable(tsini_id, procname=interptsn)
-      CALL Agrif_Init_Variable(sshini_id, procname=interpsshn)
 
       Agrif_UseSpecialValue = ln_spc_dyn
@@ -108,6 +103,4 @@
       Krhs_a = Kaa   ;   Kmm_a = Kmm
 
-      ssh(:,:,Kbb) = ssh(:,:,Kbb) * tmask(:,:,1)
-
       DO jn = 1, jpts
          ts(:,:,:,jn,Kbb) = ts(:,:,:,jn,Kbb) * tmask(:,:,:)
@@ -118,10 +111,9 @@
       CALL lbc_lnk_multi( 'agrif_istate_oce', uu(:,:,:  ,Kbb), 'U', -1.0_wp , vv(:,:,:,Kbb), 'V', -1.0_wp )
       CALL lbc_lnk( 'agrif_istate_oce', ts(:,:,:,:,Kbb), 'T',  1.0_wp )
-      CALL lbc_lnk( 'agrif_istate_oce', ssh(:,:,Kbb), 'T', 1.0_wp )
 
    END SUBROUTINE Agrif_istate_oce
 
 
-   SUBROUTINE Agrif_istate_ssh( Kbb, Kmm )
+   SUBROUTINE Agrif_istate_ssh( Kbb, Kmm, Kaa )
       !!----------------------------------------------------------------------
       !!                 *** ROUTINE agrif_istate_ssh ***
@@ -132,5 +124,5 @@
       IMPLICIT NONE
       !
-      INTEGER, INTENT(in)  :: Kbb, Kmm 
+      INTEGER, INTENT(in)  :: Kbb, Kmm, Kaa 
       !!----------------------------------------------------------------------
       IF(lwp) WRITE(numout,*) ' '
@@ -139,22 +131,25 @@
       IF(lwp) WRITE(numout,*) ' '
 
-      IF ( ln_rstart ) & 
-         & CALL ctl_stop('AGRIF hot start should be desactivated in restarting mode')
-
       IF ( .NOT.Agrif_Parent(l_1st_euler) ) & 
          & CALL ctl_stop('AGRIF hot start requires to force Euler first step on parent')
 
-      Kmm_a = Kmm
-      ssh(:,:,Kmm) = 0._wp
-
+      Krhs_a = Kbb   ;   Kmm_a = Kbb
+      !
       Agrif_SpecialValue    = 0._wp
       Agrif_UseSpecialValue = .TRUE.
       l_ini_child           = .TRUE.
       !
+      ssh(:,:,Kbb) = 0._wp
       CALL Agrif_Init_Variable(sshini_id, procname=interpsshn)
       !
       Agrif_UseSpecialValue = .FALSE.
       l_ini_child           = .FALSE.
-      CALL lbc_lnk( 'dom_vvl_rst', ssh(:,:,Kmm), 'T', 1._wp )
+      !
+      Krhs_a = Kaa   ;   Kmm_a = Kmm
+      !
+      CALL lbc_lnk( 'Agrif_istate_ssh', ssh(:,:,Kbb), 'T', 1._wp )
+      !
+      ssh(:,:,Kmm) = ssh(:,:,Kbb)
+      ssh(:,:,Kaa) = 0._wp
 
    END SUBROUTINE Agrif_istate_ssh
@@ -203,5 +198,6 @@
 
       IF( .NOT.ln_dynspg_ts ) THEN ! Get transports
-         ubdy(:,:) = 0._wp   ;   vbdy(:,:) = 0._wp 
+         ubdy(:,:) = 0._wp    ;  vbdy(:,:) = 0._wp
+         utint_stage(:,:) = 0 ;  vtint_stage(:,:) = 0
          CALL Agrif_Bc_variable( unb_interp_id, procname=interpunb )
          CALL Agrif_Bc_variable( vnb_interp_id, procname=interpvnb )
@@ -274,10 +270,4 @@
          IF( .NOT.ln_dynspg_ts ) THEN 
             DO ji = mi0(ibdy1), mi1(ibdy2)
-               uu_b(ji,:,Krhs_a) = 0._wp
-               DO jk = 1, jpkm1
-                  DO jj = 1, jpj
-                     uu_b(ji,jj,Krhs_a) = uu_b(ji,jj,Krhs_a) + e3u(ji,jj,jk,Krhs_a) * uu(ji,jj,jk,Krhs_a) * umask(ji,jj,jk)
-                  END DO
-               END DO
                DO jj = 1, jpj
                   uu_b(ji,jj,Krhs_a) = ubdy(ji,jj) * r1_hu(ji,jj,Krhs_a)
@@ -304,13 +294,8 @@
          !
          ibdy1 = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox() 
-         ibdy2 = jpiglo - ( nn_hls + 1 )              !
+         ibdy2 = jpiglo - ( nn_hls + 1 )     
+         !
          IF( .NOT.ln_dynspg_ts ) THEN 
             DO ji = mi0(ibdy1), mi1(ibdy2)
-               vv_b(ji,:,Krhs_a) = 0._wp
-               DO jk = 1, jpkm1
-                  DO jj = 1, jpj
-                     vv_b(ji,jj,Krhs_a) = vv_b(ji,jj,Krhs_a) + e3v(ji,jj,jk,Krhs_a) * vv(ji,jj,jk,Krhs_a) * vmask(ji,jj,jk)
-                  END DO
-               END DO
                DO jj = 1, jpj
                   vv_b(ji,jj,Krhs_a) = vbdy(ji,jj) * r1_hv(ji,jj,Krhs_a)
@@ -318,5 +303,5 @@
             END DO
          ENDIF
-
+         !
          DO ji = mi0(ibdy1), mi1(ibdy2)
             zvb(ji,:) = 0._wp
@@ -345,13 +330,7 @@
          IF( .NOT.ln_dynspg_ts ) THEN
             DO jj = mj0(jbdy1), mj1(jbdy2)
-               vv_b(:,jj,Krhs_a) = 0._wp
-               DO jk = 1, jpkm1
-                  DO ji = 1, jpi
-                     vv_b(ji,jj,Krhs_a) = vv_b(ji,jj,Krhs_a) + e3v(ji,jj,jk,Krhs_a) * vv(ji,jj,jk,Krhs_a) * vmask(ji,jj,jk)
-                  END DO
-               END DO
-               DO ji=1,jpi
-                  vv_b(ji,jj,Krhs_a) = vv_b(ji,jj,Krhs_a) * r1_hv(ji,jj,Krhs_a) 
-                  uu_b(ji,jj,Krhs_a) = uu_b(ji,jj,Krhs_a) * r1_hu(ji,jj,Krhs_a)
+               DO ji = 1, jpi
+                  uu_b(ji,jj,Krhs_a) = ubdy(ji,jj) * r1_hu(ji,jj,Krhs_a)
+                  vv_b(ji,jj,Krhs_a) = vbdy(ji,jj) * r1_hv(ji,jj,Krhs_a)
                END DO
             END DO
@@ -401,11 +380,5 @@
          IF( .NOT.ln_dynspg_ts ) THEN
             DO jj = mj0(jbdy1), mj1(jbdy2)
-               vv_b(:,jj,Krhs_a) = 0._wp
-               DO jk = 1, jpkm1
-                  DO ji = 1, jpi
-                     vv_b(ji,jj,Krhs_a) = vv_b(ji,jj,Krhs_a) + e3v(ji,jj,jk,Krhs_a) * vv(ji,jj,jk,Krhs_a) * vmask(ji,jj,jk)
-                  END DO
-               END DO
-               DO ji=1,jpi
+               DO ji = 1, jpi
                   vv_b(ji,jj,Krhs_a) = vbdy(ji,jj) * r1_hv(ji,jj,Krhs_a)
                END DO
@@ -432,18 +405,13 @@
          jbdy1 = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy()  
          jbdy2 = jpjglo - ( nn_hls + 1 )
+         !
          IF( .NOT.ln_dynspg_ts ) THEN
             DO jj = mj0(jbdy1), mj1(jbdy2)
-               uu_b(:,jj,Krhs_a) = 0._wp
-               DO jk = 1, jpkm1
-                  DO ji = 1, jpi
-                     uu_b(ji,jj,Krhs_a) = uu_b(ji,jj,Krhs_a) + e3u(ji,jj,jk,Krhs_a) * uu(ji,jj,jk,Krhs_a) * umask(ji,jj,jk)
-                  END DO
-               END DO
-               DO ji=1,jpi
+               DO ji = 1, jpi
                   uu_b(ji,jj,Krhs_a) = ubdy(ji,jj) * r1_hu(ji,jj,Krhs_a)
                END DO
             END DO
          ENDIF
-
+         !
          DO jj = mj0(jbdy1), mj1(jbdy2)
             zub(:,jj) = 0._wp
@@ -991,5 +959,5 @@
       ELSE
          IF( l_ini_child ) THEN
-            ssh(i1:i2,j1:j2,Kmm_a) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
+            ssh(i1:i2,j1:j2,Krhs_a) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
          ELSE
             hbdy(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
