V3FIT
ezspline_type.f90
1 module ezspline_type
2 
3  integer, parameter :: ezspline_r8 = selected_real_kind(12,100)
4  integer, parameter :: ezspline_r4 = selected_real_kind(6,37)
5  real(ezspline_r8), parameter :: ezspline_twopi_r8 = 6.2831853071795865_ezspline_r8
6  real(ezspline_r4), parameter :: ezspline_twopi_r4 = 6.2831853071795865_ezspline_r4
7 
8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 ! EZspline data types
10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 
13  !
14  ! 3-d Spline/Akima Hermite/Piecewise Linear interpolations
15  !
16  ! Grid
17  !
18  real(ezspline_r8), dimension(:), allocatable :: x1, x2, x3
19  !
20  ! The boundary condition values (for slope and 2nd derivative).
21  ! Can be optionally set by the user. Not used for periodic and
22  ! not a knot boundary conditions.
23  !
24  real(ezspline_r8), dimension(:,:), allocatable :: bcval1min, bcval1max
25  real(ezspline_r8), dimension(:,:), allocatable :: bcval2min, bcval2max
26  real(ezspline_r8), dimension(:,:), allocatable :: bcval3min, bcval3max
27  !
28  ! Select between spline (0) and Akima spline (1); default=0 (spline)
29  !
30  integer :: isHermite ! set after EZspline_init call...
31  !
32  ! set =0 for Spline, Akima or Hybrid; =1 for piecewise linear: this is set
33  ! by EZspline_init, EZhybrid_init, or EZlinear_init; DO NOT SET DIRECTLY:
34  !
35  integer :: isLinear
36  !
37  ! set =0 by init routines other than EZhybrid_init which sets it =1:
38  integer :: isHybrid
39  !
40  ! the following is set by EZhybrid_init; other EZ*_init routines clear:
41  integer :: hspline(3) ! interpolation code along each dimension
42  ! -1: zonal step fcn; =0: pc linear; =1: Akima Hermite; =2: Spline
43  !
44  ! Grid sizes (set during EZ*_init call).
45  !
46  integer :: n1, n2, n3
47  !
48  ! Grid zone lookup method
49  !
50  integer :: klookup1,klookup2,klookup3
51  !
52  ! Type of boundary conditions (set during EZspline_init call) on left
53  ! and right hand side. Possible values are:
54  !
55  ! -1 periodic
56  ! 0 not a knot
57  ! +1 1st derivative imposed
58  ! +2 2nd derivative imposed
59  !
60  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
61  ! and not a knot boundary conditions on right-hand side. The values of
62  ! the derivatives a set via bcval1min. (See above.)
63  !
64  integer ibctype1(2), ibctype2(2), ibctype3(2)
65  !
66  ! Grid lengths. DO NOT SET.
67  !
68  real(ezspline_r8) :: x1min, x1max, x2min, x2max, x3min, x3max
69  !
70  ! Compact cubic coefficient arrays. DO NOT SET.
71  !
72  real(ezspline_r8), dimension(:,:,:,:), allocatable :: fspl
73  !
74  ! Control/Other. DO NOT SET.
75  !
76  integer :: isReady
77 
78  integer :: ilin1, ilin2, ilin3
79  real(ezspline_r8), dimension(:,:), allocatable :: x1pkg, x2pkg, x3pkg
80  !
81  integer :: nguard
82  end type ezspline3_r8
83 
85  !
86  ! 2-d Spline/Akima Hermite/Piecewise Linear interpolation
87  !
88  ! Grid
89  !
90  real(ezspline_r8), dimension(:), allocatable :: x1, x2
91  !
92  ! The boundary condition values (for slope and 2nd derivative).
93  ! Can be optionally set by the user. Not used for periodic and
94  ! not a knot boundary conditions.
95  !
96  real(ezspline_r8), dimension(:), allocatable :: bcval1min, bcval1max
97  real(ezspline_r8), dimension(:), allocatable :: bcval2min, bcval2max
98  !
99  ! Select between spline (0) and Akima spline (1); default=0 (spline)
100  !
101  integer :: isHermite ! set after EZspline_init call...
102  !
103  ! set =0 for Spline, Akima or Hybrid; =1 for piecewise linear: this is set
104  ! by EZspline_init, EZhybrid_init, or EZlinear_init; DO NOT SET DIRECTLY:
105  !
106  integer :: isLinear
107  !
108  ! set =0 by init routines other than EZhybrid_init which sets it =1:
109  integer :: isHybrid
110  !
111  ! the following is set by EZhybrid_init; other EZ*_init routines clear:
112  integer :: hspline(2) ! interpolation code along each dimension
113  ! -1: zonal step fcn; =0: pc linear; =1: Akima Hermite; =2: Spline
114  !
115  ! Grid sizes (set during EZ*_init call).
116  !
117  integer :: n1, n2
118  !
119  ! Grid zone lookup method
120  !
121  integer :: klookup1,klookup2
122  !
123  ! Type of boundary conditions (set during EZspline_init call) on left
124  ! and right hand side. Possible values are:
125  !
126  ! -1 periodic
127  ! 0 not a knot
128  ! +1 1st derivative imposed
129  ! +2 2nd derivative imposed
130  !
131  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
132  ! and not a knot boundary conditions on right-hand side. The values of
133  ! the derivatives are set via bcval1min. (See above)
134  !
135  integer ibctype1(2), ibctype2(2)
136  !
137  ! Grid lengths. DO NOT SET.
138  !
139  real(ezspline_r8) :: x1min, x1max, x2min, x2max
140  !
141  ! Compact cubic coefficient arrays. DO NOT SET.
142  !
143  real(ezspline_r8), dimension(:,:,:), allocatable :: fspl
144  !
145  ! Control/Other. DO NOT SET.
146  !
147  integer :: isReady
148 
149  integer :: ilin1, ilin2
150  real(ezspline_r8), dimension(:,:), allocatable :: x1pkg, x2pkg
151  !
152  integer :: nguard
153  end type ezspline2_r8
154 
156  !
157  ! 1-d Spline/Akima Hermite/Piecewise Linear interpolation
158  !
159  ! Grid
160  !
161  real(ezspline_r8), dimension(:), allocatable :: x1
162  !
163  ! The boundary condition values (for slope and 2nd derivative).
164  ! Can be optionally set by the user. Not used for periodic and
165  ! not a knot boundary conditions.
166  !
167  real(ezspline_r8) :: bcval1min, bcval1max
168  !
169  ! Select between spline (0) and Akima spline (1); default=0 (spline)
170  !
171  integer :: isHermite ! set after EZspline_init call...
172  !
173  ! set =0 for Spline or Akima; =1 for piecewise linear: this is set
174  ! by EZspline_init or EZlinear_init; DO NOT SET DIRECTLY:
175  !
176  integer :: isLinear
177  !
178  ! Grid sizes (set during EZ*_init call).
179  !
180  integer :: n1
181  !
182  ! Grid zone lookup method
183  !
184  integer :: klookup1
185  !
186  ! Type of boundary conditions (set during EZspline_init call) on left
187  ! and right hand side. Possible values are:
188  !
189  ! -1 periodic
190  ! 0 not a knot
191  ! +1 1st derivative imposed
192  ! +2 2nd derivative imposed
193  !
194  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
195  ! and not a knot boundary conditions on right-hand side. The values of
196  ! the derivatives are set via bcval1min. (See above)
197  !
198  integer ibctype1(2)
199  !
200  ! Grid lengths. DO NOT SET.
201  !
202  real(ezspline_r8) :: x1min, x1max
203  !
204  ! Compact cubic coefficient arrays. DO NOT SET.
205  !
206  real(ezspline_r8), dimension(:,:), allocatable :: fspl
207  !
208  ! Control/Other. DO NOT SET.
209  !
210  integer :: isReady
211 
212  integer :: ilin1
213  real(ezspline_r8), dimension(:,:), allocatable :: x1pkg
214  !
215  integer :: nguard
216  end type ezspline1_r8
217 
219  !
220  ! 3-d Spline/Akima Hermite/Piecewise Linear interpolation
221  !
222  ! Grid
223  !
224  real(ezspline_r4), dimension(:), allocatable :: x1, x2, x3
225  !
226  ! The boundary condition values (for slope and 2nd derivative).
227  ! Can be optionally set by the user. Not used for periodic and
228  ! not a knot boundary conditions.
229  !
230  real(ezspline_r4), dimension(:,:), allocatable :: bcval1min, bcval1max
231  real(ezspline_r4), dimension(:,:), allocatable :: bcval2min, bcval2max
232  real(ezspline_r4), dimension(:,:), allocatable :: bcval3min, bcval3max
233  !
234  ! Select between spline (0) and Akima spline (1); default=0 (spline)
235  !
236  integer :: isHermite ! set after EZspline_init call...
237  !
238  ! set =0 for Spline, Akima or Hybrid; =1 for piecewise linear: this is set
239  ! by EZspline_init, EZhybrid_init, or EZlinear_init; DO NOT SET DIRECTLY:
240  !
241  integer :: isLinear
242  !
243  ! set =0 by init routines other than EZhybrid_init which sets it =1:
244  integer :: isHybrid
245  !
246  ! the following is set by EZhybrid_init; other EZ*_init routines clear:
247  integer :: hspline(3) ! interpolation code along each dimension
248  ! -1: zonal step fcn; =0: pc linear; =1: Akima Hermite; =2: Spline
249  !
250  ! Grid sizes (set during EZ*_init call).
251  !
252  integer :: n1, n2, n3
253  !
254  ! Grid zone lookup method
255  !
256  integer :: klookup1,klookup2,klookup3
257  !
258  ! Type of boundary conditions (set during EZspline_init call) on left
259  ! and right hand side. Possible values are:
260  !
261  ! -1 periodic
262  ! 0 not a knot
263  ! +1 1st derivative imposed
264  ! +2 2nd derivative imposed
265  !
266  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
267  ! and not a knot boundary conditions on right-hand side. The values of
268  ! the derivatives a set via bcval1min. (See above.)
269  !
270  integer ibctype1(2), ibctype2(2), ibctype3(2)
271  !
272  ! Grid lengths. DO NOT SET.
273  !
274  real(ezspline_r4) :: x1min, x1max, x2min, x2max, x3min, x3max
275  !
276  ! Compact cubic coefficient arrays. DO NOT SET.
277  !
278  real(ezspline_r4), dimension(:,:,:,:), allocatable :: fspl
279  !
280  ! Control/Other. DO NOT SET.
281  !
282  integer :: isReady
283 
284  integer :: ilin1, ilin2, ilin3
285  real(ezspline_r4), dimension(:,:), allocatable :: x1pkg, x2pkg, x3pkg
286  !
287  integer :: nguard
288  end type ezspline3_r4
289 
291  !
292  ! 2-d Spline/Akima Hermite/Piecewise Linear interpolation
293  !
294  ! Grid
295  !
296  real(ezspline_r4), dimension(:), allocatable :: x1, x2
297  !
298  ! The boundary condition values (for slope and 2nd derivative).
299  ! Can be optionally set by the user. Not used for periodic and
300  ! not a knot boundary conditions.
301  !
302  real(ezspline_r4), dimension(:), allocatable :: bcval1min, bcval1max
303  real(ezspline_r4), dimension(:), allocatable :: bcval2min, bcval2max
304  !
305  ! Select between spline (0) and Akima spline (1); default=0 (spline)
306  !
307  integer :: isHermite ! set after EZspline_init call...
308  !
309  ! set =0 for Spline, Akima or Hybrid; =1 for piecewise linear: this is set
310  ! by EZspline_init, EZhybrid_init, or EZlinear_init; DO NOT SET DIRECTLY:
311  !
312  integer :: isLinear
313  !
314  ! set =0 by init routines other than EZhybrid_init which sets it =1:
315  integer :: isHybrid
316  !
317  ! the following is set by EZhybrid_init; other EZ*_init routines clear:
318  integer :: hspline(2) ! interpolation code along each dimension
319  ! -1: zonal step fcn; =0: pc linear; =1: Akima Hermite; =2: Spline
320  !
321  ! Grid sizes (set during EZ*_init call).
322  !
323  integer :: n1, n2
324  !
325  ! Grid zone lookup method
326  !
327  integer :: klookup1,klookup2
328  !
329  ! Type of boundary conditions (set during EZspline_init call) on left
330  ! and right hand side. Possible values are:
331  !
332  ! -1 periodic
333  ! 0 not a knot
334  ! +1 1st derivative imposed
335  ! +2 2nd derivative imposed
336  !
337  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
338  ! and not a knot boundary conditions on right-hand side. The values of
339  ! the derivatives are set via bcval1min. (See above)
340  !
341  integer ibctype1(2), ibctype2(2)
342  !
343  ! Grid lengths. DO NOT SET.
344  !
345  real(ezspline_r4) :: x1min, x1max, x2min, x2max
346  !
347  ! Compact cubic coefficient arrays. DO NOT SET.
348  !
349  real(ezspline_r4), dimension(:,:,:), allocatable :: fspl
350  !
351  ! Control/Other. DO NOT SET.
352  !
353  integer :: isReady
354 
355  integer :: ilin1, ilin2
356  real(ezspline_r4), dimension(:,:), allocatable :: x1pkg, x2pkg
357  !
358  integer :: nguard
359  end type ezspline2_r4
360 
362  !
363  ! 1-d Spline/Akima Hermite/Piecewise Linear interpolation
364  !
365  ! Grid
366  !
367  real(ezspline_r4), dimension(:), allocatable :: x1
368  !
369  ! The boundary condition values (for slope and 2nd derivative).
370  ! Can be optionally set by the user. Not used for periodic and
371  ! not a knot boundary conditions.
372  !
373  real(ezspline_r4) :: bcval1min, bcval1max
374  !
375  ! Select between spline (0) and Akima spline (1); default=0 (spline)
376  !
377  integer :: isHermite ! set after EZspline_init call...
378  !
379  ! set =0 for Spline or Akima; =1 for piecewise linear: this is set
380  ! by EZspline_init or EZlinear_init; DO NOT SET DIRECTLY:
381  !
382  integer :: isLinear
383  !
384  ! Grid sizes (set during EZ*_init call).
385  !
386  integer :: n1
387  !
388  ! Grid zone lookup method
389  !
390  integer :: klookup1
391  !
392  ! Type of boundary conditions (set during EZspline_init call) on left
393  ! and right hand side. Possible values are:
394  !
395  ! -1 periodic
396  ! 0 not a knot
397  ! +1 1st derivative imposed
398  ! +2 2nd derivative imposed
399  !
400  ! For instance, ibctype1 =(/1, 0/) for 1st derivative set on left-hand
401  ! and not a knot boundary conditions on right-hand side. The values of
402  ! the derivatives are set via bcval1min. (See above)
403  !
404  integer ibctype1(2)
405  !
406  ! Grid lengths. DO NOT SET.
407  !
408  real(ezspline_r4) :: x1min, x1max
409  !
410  ! Compact cubic coefficient arrays. DO NOT SET.
411  !
412  real(ezspline_r4), dimension(:,:), allocatable :: fspl
413  !
414  ! Control/Other. DO NOT SET.
415  !
416  integer :: isReady
417 
418  integer :: ilin1
419  real(ezspline_r4), dimension(:,:), allocatable :: x1pkg
420  !
421  integer :: nguard
422  end type ezspline1_r4
423 
424 !=========================================================================
425 ! End type
426 end module ezspline_type
ezspline_type::ezspline2_r8
Definition: ezspline_type.f90:84
ezspline_type::ezspline2_r4
Definition: ezspline_type.f90:290
ezspline_type::ezspline1_r8
Definition: ezspline_type.f90:155
ezspline_type::ezspline1_r4
Definition: ezspline_type.f90:361
ezspline_type::ezspline3_r8
Definition: ezspline_type.f90:12
ezspline_type::ezspline3_r4
Definition: ezspline_type.f90:218