interp Function

private function interp(tab, lb, ind, ordre)

Interpolate evenly spaced points

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(lb:) :: tab

tableau 1D à interpoler

integer(kind=I4), intent(in) :: lb

borne inférieure

integer(kind=4), intent(in) :: ind

position de l’élément “milieu”

integer(kind=4), intent(in) :: ordre

ordre de l’interp 1, 3, 5 ou 7

Return Value real(kind=R8)

valeur particulière interpolée


Called by

proc~~interp~~CalledByGraph proc~interp interp proc~interp1d interp1D proc~interp1d->proc~interp proc~interp2d interp2D proc~interp2d->proc~interp1d proc~test_interp_pond test_interp_pond proc~test_interp_pond->proc~interp1d proc~test_interp_pond->proc~interp2d program~test_intpl test_intpl program~test_intpl->proc~test_interp_pond

Source Code

function interp(tab, lb, ind, ordre)
!! Interpolate evenly spaced points
implicit none
real(kind=R8)                                :: interp    !! *valeur particulière interpolée*
integer(kind=I4), intent(in)                 :: lb        !! *borne inférieure*
integer(kind=4),  intent(in)                 :: ind       !! *position de l'élément "milieu"*
integer(kind=4),  intent(in)                 :: ordre     !! *ordre de l'interp 1, 3, 5 ou 7*
real(kind=R8),    intent(in), dimension(lb:) :: tab       !! *tableau 1D à interpoler*

   select case (ordre)

      case(1)
         interp = ci1_00*tab(ind  ) +  &  !
                  ci1_01*tab(ind+1)       !

      case(3)
         interp = ci3_00*tab(ind-1) +  &  !
                  ci3_01*tab(ind  ) +  &  !
                  ci3_02*tab(ind+1) +  &  !
                  ci3_03*tab(ind+2)       !

      case(5)
         interp = ci5_00*tab(ind-2) +  &  !
                  ci5_01*tab(ind-1) +  &  !
                  ci5_02*tab(ind  ) +  &  !
                  ci5_03*tab(ind+1) +  &  !
                  ci5_04*tab(ind+2) +  &  !
                  ci5_05*tab(ind+3)       !

      case(7)
         interp = ci7_00*tab(ind-3) +  &  !
                  ci7_01*tab(ind-2) +  &  !
                  ci7_02*tab(ind-1) +  &  !
                  ci7_03*tab(ind  ) +  &  !
                  ci7_04*tab(ind+1) +  &  !
                  ci7_05*tab(ind+2) +  &  !
                  ci7_06*tab(ind+3) +  &  !
                  ci7_07*tab(ind+4)       !

      case default
         stop 'Bad choice in function "interp"'

   endselect

return
endfunction interp