   !!======================================================================

#ifdef key_agrif

  SUBROUTINE interp3dturb(tabres,l1,l2,k1,k2,i1,i2,j1,j2,before)

#include "toolcpp.h"

   USE parameters
   USE comvars3d, ONLY : turb_nbeq
   USE comvarp3d, ONLY : ect,psi
   USE comvars2d
   USE comvarp2d
   USE comturb
#if defined key_siggen || defined key_gencoord
   USE toolgeom, ONLY : f_hzu
#endif

   IMPLICIT NONE

   INTEGER i1,i2,j1,j2,k1,k2,l1,l2
   REAL tabres(l1:l2,k1:k2,i1:i2,j1:j2)
   INTEGER i,j,k,l
   LOGICAL :: before

   !!----------------------------------------------------------------------
   !! * Executable part

   PRINT_DBG*, 'enter INTERP3DTURB routine'
!
   IF (before) THEN
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j) == -valmanq) THEN
           DO k=k1,k2
             DO l=l1,l2
               tabres(l,k,i,j) = Agrif_SpecialValue
             END DO
           END DO
         ELSE
           DO k=k1,k2
             tabres(1,k,i,j) = ect(k,i,j)
             tabres(2,k,i,j) = psi(k,i,j)
             IF (turb_nbeq == 2) THEN
               tabres(3,k,i,j) = eps(k,i,j)
             END IF
           END DO
         END IF
       END DO
     END DO
   ELSE
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j)==-valmanq) THEN
           DO k=k1,k2
             ect(k,i,j) = valmanq
             psi(k,i,j) = valmanq
             IF (turb_nbeq == 2) THEN
               eps(k,i,j) = valmanq
             END IF
           END DO
         ELSE
           DO k=k1,k2
             ect(k,i,j) = tabres(1,k,i,j)
             psi(k,i,j) = tabres(2,k,i,j)
             IF (turb_nbeq == 2) THEN
               eps(k,i,j) = tabres(3,k,i,j)
             END IF
           END DO
         END IF
       END DO
     END DO
   END IF

   PRINT_DBG*, 'exit INTERP3DTURB routine'

   RETURN

  END SUBROUTINE interp3dturb

   !!======================================================================

  SUBROUTINE interp3dkz(tabres,k1,k2,i1,i2,j1,j2,before)

   USE parameters
   USE comvars3d, ONLY : kz
   USE comvars2d
   USE comvarp2d
   USE comturb
#if defined key_siggen || defined key_gencoord
   USE toolgeom, ONLY : f_hzu
#endif

   IMPLICIT NONE

   INTEGER i1,i2,j1,j2,k1,k2
   REAL tabres(k1:k2,i1:i2,j1:j2)
   INTEGER i,j,k
   LOGICAL :: before

   !!----------------------------------------------------------------------
   !! * Executable part

   PRINT_DBG*, 'enter INTERP3DKZ routine'
!
   IF (before) THEN
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j) == -valmanq) THEN
           DO k=k1,k2
             tabres(k,i,j) = Agrif_SpecialValue
           END DO
         ELSE
           DO k=k1,k2
             tabres(k,i,j) = kz(k,i,j)
           END DO
         END IF
       END DO
     END DO
   ELSE
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j)==-valmanq) THEN
           DO k=k1,k2
             kz(k,i,j) = valmanq
           END DO
         ELSE
           DO k=k1,k2
             kz(k,i,j)  = tabres(k,i,j)
           END DO
         END IF
       END DO
     END DO
   END IF

   PRINT_DBG*, 'exit INTERP3DKZ routine'

   RETURN

  END SUBROUTINE interp3dkz

   !!======================================================================

  SUBROUTINE interp3dnz(tabres,k1,k2,i1,i2,j1,j2,before)

   USE parameters
   USE comvars3d, ONLY : nz
   USE comvars2d
   USE comvarp2d
   USE comturb
#if defined key_siggen || defined key_gencoord
   USE toolgeom, ONLY : f_hzu
#endif

   IMPLICIT NONE

   INTEGER i1,i2,j1,j2,k1,k2
   REAL tabres(k1:k2,i1:i2,j1:j2)
   INTEGER i,j,k
   LOGICAL :: before

   !!----------------------------------------------------------------------
   !! * Executable part

   PRINT_DBG*, 'enter INTERP3DNZ routine'
!
   IF (before) THEN
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j) == -valmanq) THEN
           DO k=k1,k2
             tabres(k,i,j) = Agrif_SpecialValue
           END DO
         ELSE
           DO k=k1,k2
             tabres(k,i,j) = nz(k,i,j)
           END DO
         END IF
       END DO
     END DO
   ELSE
     DO j=j1,j2
       DO i=i1,i2
         IF (h0(i,j)==-valmanq) THEN
           DO k=k1,k2
             nz(k,i,j) = valmanq
           END DO
         ELSE
           DO k=k1,k2
             nz(k,i,j)  = tabres(k,i,j)
           END DO
         END IF
       END DO
     END DO
   END IF

   PRINT_DBG*, 'exit INTERP3DKZ routine'

   RETURN

  END SUBROUTINE interp3dnz

#else
  SUBROUTINE agrif_turb_empty
   RETURN
  END SUBROUTINE agrif_turb_empty
#endif
