  SUBROUTINE tool_timeinterp_2dvar(tinter,ta,tp,taba,tabp)

   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE tool_timeinterp_2dvar  ***
   !&E
   !&E ** Purpose : temporal interpolation of any 2D quantity
   !&E
   !&E ** Description : used in case of output at a precise time
   !&E                  or in case of Demerliac filtering
   !&E
   !&E ** Called by : 
   !&E
   !&E ** External calls : 
   !&E
   !&E ** Used ij-arrays : tabp
   !&E
   !&E ** Modified variables : taba
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !  2004-08-18
   !&E
   !&E---------------------------------------------------------------------
   !! * Modules used
   USE parameters

   IMPLICIT NONE

   !! * Arguments
   REAL(kind=rlg)                                   ,INTENT(in)    :: tinter,ta,tp
   REAL(kind=rsh),DIMENSION(limin:limax,ljmin:ljmax),INTENT(inout) :: taba
   REAL(kind=rsh),DIMENSION(limin:limax,ljmin:ljmax),INTENT(in)    :: tabp

   !! * Local declarations
   INTEGER        :: i,j
   REAL(kind=rlg) :: a,b

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

    a=(tinter-ta)/(tp-ta)
    b=(tp-tinter)/(tp-ta)

   DO j=ljmin,ljmax
     DO i=limin,limax
       taba(i,j)=a*tabp(i,j)+b*taba(i,j)
       IF(ABS(taba(i,j)-valmanq)/valmanq < epsilon) taba(i,j)=valmanq
     ENDDO
   ENDDO

  END SUBROUTINE tool_timeinterp_2dvar

   !!======================================================================
 
  SUBROUTINE tool_timeinterp_3dvar(tinter,ta,tp,taba,tabp)

   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE tool_timeinterp_3dvar  ***
   !&E
   !&E ** Purpose : temporal interpolation of any 3D quantity
   !&E
   !&E ** Description : used in case of output at a precise time
   !&E                  or in case of Demerliac filtering
   !&E
   !&E ** Called by : gessor
   !&E
   !&E ** External calls : 
   !&E
   !&E ** Used ij-arrays : tabp
   !&E
   !&E ** Modified variables : taba
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !  2004-08-18
   !&E
   !&E---------------------------------------------------------------------
   !! * Modules used
   USE parameters

   IMPLICIT NONE

   !! * Arguments
   REAL(kind=rlg)                                        ,INTENT(in)    :: tinter,ta,tp
   REAL(kind=rsh),DIMENSION(kmax,limin:limax,ljmin:ljmax),INTENT(inout) :: taba
   REAL(kind=rsh),DIMENSION(kmax,limin:limax,ljmin:ljmax),INTENT(in)    :: tabp

   !! * Local declarations
   INTEGER        :: i,j,k
   REAL(kind=rlg) :: a,b

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

   a=(tinter-ta)/(tp-ta)
   b=(tp-tinter)/(tp-ta)

   DO j=ljmin,ljmax
     DO i=limin,limax
       DO k=1,kmax
         taba(k,i,j)=a*tabp(k,i,j)+b*taba(k,i,j)
         IF(ABS(taba(k,i,j)-valmanq)/valmanq.LT.epsilon) taba(k,i,j)=valmanq
       ENDDO
     ENDDO
   ENDDO

  END SUBROUTINE tool_timeinterp_3dvar
