V3FIT
bcspvec.f
1  subroutine bcspvec(ict,ivec,xvec,yvec,ivd,fval,
2  > nx,xpkg,ny,ypkg,fspl,inf3,
3  > iwarn,ier)
4 c
5 c vectorized spline evaluation routine -- 2d spline
6 c 1. call vectorized zone lookup routine
7 c 2. call vectorized spline evaluation routine
8 c
9 c--------------------------
10 c input:
11  integer ict(6) ! selector:
12 c ict(1)=1 for f (don't evaluate if ict(1)=0)
13 c ict(2)=1 for df/dx (don't evaluate if ict(2)=0)
14 c ict(3)=1 for df/dy (don't evaluate if ict(3)=0)
15 c ict(4)=1 for d2f/dx2 (don't evaluate if ict(4)=0)
16 c ict(5)=1 for d2f/dy2 (don't evaluate if ict(5)=0)
17 c ict(6)=1 for d2f/dxdy (don't evaluate if ict(6)=0)
18 c
19  integer ivec ! vector dimensioning
20 c
21 c ivec-- number of vector pts (spline values to look up)
22 c
23 c list of (x,y) pairs:
24 c
25  real xvec(ivec) ! x-locations at which to evaluate
26  real yvec(ivec) ! y-locations at which to evaluate
27 c
28  integer ivd ! 1st dimension of output array
29 c
30 c ivd -- 1st dimension of fval, .ge.ivec
31 c
32 c output:
33  real fval(ivd,*) ! output array
34 c
35 c fval(1:ivec,1) -- values as per 1st non-zero ict(...) element
36 c fval(1:ivec,2) -- values as per 2nd non-zero ict(...) element
37 c --etc--
38 c
39 c input:
40  integer nx,ny ! dimension of spline grids
41  real xpkg(nx,4) ! x grid "package" (cf genxpkg)
42  real ypkg(ny,4) ! y grid "package" (cf genxpkg)
43  integer inf3 ! fspl 3rd array dimension, .ge.nx
44  real fspl(4,4,inf3,ny) ! (non-compact) spline coefficients
45 c
46 c output:
47 c condition codes, 0 = normal return
48  integer iwarn ! =1 if an x value was out of range
49  integer ier ! =1 if argument error detected
50 c
51 c---------------------------------------------------------------
52 c local arrays
53 c
54  integer ix(ivec) ! x zone indices
55  real dxv(ivec) ! x displacements w/in zones
56  integer iy(ivec) ! y zone indices
57  real dyv(ivec) ! y displacements w/in zones
58 c
59 c---------------------------------------------------------------
60 c
61 c error checks
62 c
63  ier=0
64 c
65  if(nx.lt.2) then
66  write(6,*) .lt.' ?bcspvec: nx2: nx = ',nx
67  ier=1
68  endif
69 c
70  if(ny.lt.2) then
71  write(6,*) .lt.' ?bcspvec: ny2: ny = ',ny
72  ier=1
73  endif
74 c
75  if(ivec.le.0) then
76  write(6,*) .le.' ?bcspvec: vector dimension 0: ivec = ',
77  > ivec
78  ier=1
79  endif
80 c
81  if(ivd.lt.ivec) then
82  write(6,*)
83  > ' ?bcspvec: output vector dimension less than input ',
84  > 'vector dimension.'
85  write(6,*) ' ivec=',ivec,' ivd=',ivd
86  ier=1
87  endif
88 c
89  if(ier.ne.0) return
90 c
91 c vectorized lookups
92 c
93  ix=0
94  iy=0
95  call xlookup(ivec,xvec,nx,xpkg,1,ix,dxv,dxv,dxv,iwarn1)
96  call xlookup(ivec,yvec,ny,ypkg,1,iy,dyv,dyv,dyv,iwarn2)
97  iwarn=max(iwarn1,iwarn2)
98 c
99 c vectorized evaluation
100 c
101  call bcspevfn(ict,ivec,ivd,fval,ix,iy,dxv,dyv,fspl,inf3,ny)
102 c
103  return
104  end