Cylindrical interpolation coefficients and indicies for a 3D grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in), | dimension(:) | :: | r | R values |
|
real(kind=Float64), | intent(in), | dimension(:) | :: | z | Z values |
|
real(kind=Float64), | intent(in), | dimension(:) | :: | phi | Phi values |
|
real(kind=Float64), | intent(in) | :: | rout | R value to interpolate |
||
real(kind=Float64), | intent(in) | :: | zout | Z value to interpolate |
||
real(kind=Float64), | intent(in) | :: | phiout | Phi value to interpolate |
||
type(InterpolCoeffs3D), | intent(out) | :: | c | Interpolation Coefficients |
||
integer, | intent(out), | optional | :: | err | Error code |
subroutine cyl_interpol3D_coeff_arr(r,z,phi,rout,zout,phiout,c,err)
!+ Cylindrical interpolation coefficients and indicies for a 3D grid
real(Float64), dimension(:), intent(in) :: r
!+ R values
real(Float64), dimension(:), intent(in) :: z
!+ Z values
real(Float64), dimension(:), intent(in) :: phi
!+ Phi values
real(Float64), intent(in) :: rout
!+ R value to interpolate
real(Float64), intent(in) :: zout
!+ Z value to interpolate
real(Float64), intent(in) :: phiout
!+ Phi value to interpolate
type(InterpolCoeffs3D), intent(out) :: c
!+ Interpolation Coefficients
integer, intent(out), optional :: err
!+ Error code
type(InterpolCoeffs2D) :: b
real(Float64) :: rmin, phimin, zmin, dr, dphi, dz
integer :: sr, sphi, sz, err_status
err_status = 1
sr = size(r)
sphi = size(phi)
sz = size(z)
rmin = r(1)
zmin = z(1)
dr = abs(r(2)-r(1))
dz = abs(z(2)-z(1))
if (sphi .eq. 1) then
call interpol2D_coeff(rmin, dr, sr, zmin, dz, sz, rout, zout, b, err_status)
c%b111 = b%b11
c%b121 = b%b12
c%b221 = b%b22
c%b211 = b%b21
c%b212 = 0
c%b222 = 0
c%b122 = 0
c%b112 = 0
c%i = b%i
c%j = b%j
c%k = 1
else
phimin = phi(1)
dphi = abs(phi(2)-phi(1))
call cyl_interpol3D_coeff(rmin, dr, sr, zmin, dz, sz, phimin, dphi, sphi, rout, zout, phiout, c, err_status)
endif
if(present(err)) err = err_status
end subroutine cyl_interpol3D_coeff_arr