trilinear_interp Function

public function trilinear_interp(x, y, z, x0, y0, z0, x1, y1, z1, corners)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: x
real, intent(in) :: y
real, intent(in) :: z
real, intent(in) :: x0
real, intent(in) :: y0
real, intent(in) :: z0
real, intent(in) :: x1
real, intent(in) :: y1
real, intent(in) :: z1
real, intent(in) :: corners(8)

Return Value real


Called by

proc~~trilinear_interp~~CalledByGraph proc~trilinear_interp trilinear_interp proc~trilinear_interp_var trilinear_interp_var proc~trilinear_interp_var->proc~trilinear_interp proc~wallfunheat wallfunheat proc~wallfunheat->proc~trilinear_interp_var proc~wallfunmom wallfunmom proc~wallfunmom->proc~trilinear_interp_var proc~ibmwallfun ibmwallfun proc~ibmwallfun->proc~wallfunheat proc~ibmwallfun->proc~wallfunmom program~dalesurban DALESURBAN program~dalesurban->proc~ibmwallfun

Source Code

   real function trilinear_interp(x, y, z, x0, y0, z0, x1, y1, z1, corners)
     real, intent(in) :: x, y, z, x0, y0, z0, x1, y1, z1, corners(8)
     real :: xd, yd, zd

     xd = (x - x0) / (x1 - x0)
     yd = (y - y0) / (y1 - y0)
     zd = (z - z0) / (z1 - z0)
     ! check all positive

     trilinear_interp = corners(1) * (1-xd)*(1-yd)*(1-zd) + & ! c000
                        corners(2) * (  xd)*(1-yd)*(1-zd) + & ! c100
                        corners(3) * (1-xd)*(  yd)*(1-zd) + & ! c010
                        corners(4) * (  xd)*(  yd)*(1-zd) + & ! c110
                        corners(5) * (1-xd)*(1-yd)*(  zd) + & ! c001
                        corners(6) * (  xd)*(1-yd)*(  zd) + & ! c101
                        corners(7) * (1-xd)*(  yd)*(  zd) + & ! c011
                        corners(8) * (  xd)*(  yd)*(  zd)     ! c111

   end function trilinear_interp