Constructor for a linear_interp_5d class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(linear_interp_5d), | intent(inout) | :: | me | |||
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(:) | :: | q | ||
real(kind=wp), | intent(in), | dimension(:) | :: | r | ||
real(kind=wp), | intent(in), | dimension(:,:,:,:,:) | :: | f | ||
integer, | intent(out) | :: | istat |
|
pure subroutine initialize_5d(me,x,y,z,q,r,f,istat) implicit none class(linear_interp_5d),intent(inout) :: me real(wp),dimension(:),intent(in) :: x real(wp),dimension(:),intent(in) :: y real(wp),dimension(:),intent(in) :: z real(wp),dimension(:),intent(in) :: q real(wp),dimension(:),intent(in) :: r real(wp),dimension(:,:,:,:,:),intent(in) :: f integer,intent(out) :: istat !! `0` : no problems, !! `1` : `x` is not strictly increasing, !! `2` : `y` is not strictly increasing, !! `3` : `z` is not strictly increasing, !! `4` : `q` is not strictly increasing, !! `5` : `r` is not strictly increasing, !! `10` : `x` is not equal to size(f,1), !! `20` : `y` is not equal to size(f,2), !! `30` : `z` is not equal to size(f,3), !! `40` : `q` is not equal to size(f,4), !! `50` : `r` is not equal to size(f,5), !! `100` : cannot use linear interpolation for only one point. call me%destroy() istat = 0 if (istat==0 .and. size(x)/=size(f,1)) istat = 10 if (istat==0 .and. size(y)/=size(f,2)) istat = 20 if (istat==0 .and. size(z)/=size(f,3)) istat = 30 if (istat==0 .and. size(q)/=size(f,4)) istat = 40 if (istat==0 .and. size(r)/=size(f,5)) istat = 50 if (istat==0) then call me%check_inputs(x=x,y=y,z=z,q=q,r=r,ierr=istat) if (istat==0) then allocate(me%f(size(x),size(y),size(z),size(q),size(r))); me%f = f allocate(me%x(size(x))); me%x = x allocate(me%y(size(y))); me%y = y allocate(me%z(size(z))); me%z = z allocate(me%q(size(q))); me%q = q allocate(me%r(size(r))); me%r = r me%initialized = .true. end if end if end subroutine initialize_5d