Initialize a bspline_3d type with multiple outputs: nf functions of
the same inputs, on the same grid.
The last dimension of fcn is the output index.
This is a wrapper for db3ink (multiple-output version).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bspline_3d), | intent(inout) | :: | me |
the spline |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
|
|
| real(kind=wp), | intent(in), | dimension(:) | :: | y |
|
|
| real(kind=wp), | intent(in), | dimension(:) | :: | z |
|
|
| real(kind=wp), | intent(in), | dimension(:,:,:,:) | :: | fcn |
|
|
| integer(kind=ip), | intent(in) | :: | kx |
The order of spline pieces in |
||
| integer(kind=ip), | intent(in) | :: | ky |
The order of spline pieces in |
||
| integer(kind=ip), | intent(in) | :: | kz |
The order of spline pieces in |
||
| integer(kind=ip), | intent(out) | :: | iflag |
status flag (see db3ink) |
||
| logical, | intent(in), | optional | :: | extrap |
if true, then extrapolation is allowed (default is false) |
pure subroutine initialize_3d_auto_knots_multi(me,x,y,z,fcn,kx,ky,kz,iflag,extrap) implicit none class(bspline_3d),intent(inout) :: me !! the spline real(wp),dimension(:),intent(in) :: x !! `(nx)` array of \(x\) abcissae. Must be strictly increasing. real(wp),dimension(:),intent(in) :: y !! `(ny)` array of \(y\) abcissae. Must be strictly increasing. real(wp),dimension(:),intent(in) :: z !! `(nz)` array of \(z\) abcissae. Must be strictly increasing. real(wp),dimension(:,:,:,:),intent(in) :: fcn !! `(nx,ny,nz,nf)` array of function values to interpolate !! (the last dimension is the output index) integer(ip),intent(in) :: kx !! The order of spline pieces in \(x\) integer(ip),intent(in) :: ky !! The order of spline pieces in \(y\) integer(ip),intent(in) :: kz !! The order of spline pieces in \(z\) integer(ip),intent(out) :: iflag !! status flag (see [[db3ink]]) logical,intent(in),optional :: extrap !! if true, then extrapolation is allowed !! (default is false) integer(ip),dimension(3) :: n !! number of points in each direction integer(ip) :: nf !! number of outputs call me%destroy() n(1) = size(x,kind=ip) n(2) = size(y,kind=ip) n(3) = size(z,kind=ip) nf = size(fcn,4,kind=ip) me%nx = n(1) me%ny = n(2) me%nz = n(3) me%kx = kx me%ky = ky me%kz = kz allocate(me%tx(n(1)+kx)) allocate(me%ty(n(2)+ky)) allocate(me%tz(n(3)+kz)) allocate(me%bcoef(n(1),n(2),n(3),nf)) allocate(me%work_val_1(ky,kz)) allocate(me%work_val_2(kz)) allocate(me%work_val_3(3_ip*max(kx,ky,kz))) call db3ink(x,n(1),y,n(2),z,n(3),fcn,kx,ky,kz,0_ip,me%tx,me%ty,me%tz,me%bcoef,iflag) if (iflag==0_ip) then me%nf = nf call me%set_extrap_flag(extrap) end if me%initialized = iflag==0_ip me%iflag = iflag end subroutine initialize_3d_auto_knots_multi