5D nearest neighbor interpolation routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nearest_interp_5d), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | y | |||
real(kind=wp), | intent(in) | :: | z | |||
real(kind=wp), | intent(in) | :: | q | |||
real(kind=wp), | intent(in) | :: | r | |||
real(kind=wp), | intent(out) | :: | f |
Nearest |
||
integer, | intent(out), | optional | :: | istat |
|
pure subroutine nearest_5d(me,x,y,z,q,r,f,istat) implicit none class(nearest_interp_5d),intent(inout) :: me real(wp),intent(in) :: x real(wp),intent(in) :: y real(wp),intent(in) :: z real(wp),intent(in) :: q real(wp),intent(in) :: r real(wp),intent(out) :: f !! Nearest \( f(x,y,z,q,r) \) integer,intent(out),optional :: istat !! `0` : no problems, !! `-1` : class has not been initialized integer :: mflag integer,dimension(2) :: ix, iy, iz, iq, ir integer :: i, j, k, l, m if (me%initialized) then call dintrv(me%x,x,me%ilox,ix(1),ix(2),mflag,i) call dintrv(me%y,y,me%iloy,iy(1),iy(2),mflag,j) call dintrv(me%z,z,me%iloz,iz(1),iz(2),mflag,k) call dintrv(me%q,q,me%iloq,iq(1),iq(2),mflag,l) call dintrv(me%r,r,me%ilor,ir(1),ir(2),mflag,m) f = me%f(i,j,k,l,m) if (present(istat)) istat = 0 else if (present(istat)) istat = -1 f = zero end if end subroutine nearest_5d