finter2d Function

function finter2d(func, x, y)

Arguments

Type IntentOptional Attributes Name
type(finter2d_type) :: func
real(kind=8) :: x
real(kind=8) :: y

Return Value real(kind=8)


Calls

proc~~finter2d~~CallsGraph proc~finter2d finter2d f f proc~finter2d->f locate locate proc~finter2d->locate polin2 polin2 proc~finter2d->polin2 x x proc~finter2d->x y y proc~finter2d->y

Source Code

function finter2d(func,x,y)
  real(8)         :: x,y
  type(finter2d_type) :: func
  real(8)         :: finter2d
  real(8)         :: f,df
  integer         :: itmp,jtmp,kx,ky,k0x,k0y,k1x,k1y
  integer         :: n
  N=func%N    !order of polynomial interpolation
  finter2d=0.d0
  itmp=locate(func%X(func%Imin:func%Imax),x)
  jtmp=locate(func%Y(func%Jmin:func%Jmax),y)
  kx=max(itmp-(N-1)/2,1)
  ky=max(jtmp-(N-1)/2,1)
  k0x = kx ; if(k0x < func%Imin)k0x=func%Imin
  k0y = ky ; if(k0y < func%Jmin)k0y=func%Jmin
  k1x = kx+N+1
  if(k1x > func%Imax)then         
     k1x=func%Imax
     k0x=k1x-N-1
  endif
  k1y = ky+N+1
  if(k1y > func%Jmax)then
     k1y=func%Jmax
     k0y=k1y-N-1
  endif
  call polin2(func%X(k0x:k1x),func%Y(k0y:k1y),func%F(k0x:k1x,k0y:k1y),x,y,f,df)
  finter2d=f
  return
end function finter2d