V3FIT
ezspline_isindomain.f90
1 !/////
2 ! R8 !
3 !/////
4 !
5 ! 1-D
6 !
7  subroutine ezspline_isindomain1_r8(spline_o, p1, ier)
8  use ezspline_obj
9  implicit none
10  type(EZspline1_r8) :: spline_o
11  real(ezspline_r8), intent(in) :: p1
12 
13  ! ier:
14  ! 6=out of interval p1 < min(x1)
15  ! 7=out of interval p1 > max(x1)
16  integer, intent(out) :: ier
17 
18  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
19  real(ezspline_r8) :: eps1
20 
21  ier = 0
22 
23  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
24 
25 
26  if(p1 < spline_o%x1( 1)-eps1) then
27  ier = 6
28  return
29  endif
30  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
31  ier = 7
32  return
33  endif
34 
35  end subroutine ezspline_isindomain1_r8
36 
37  subroutine ezspline_isindomain1_array_r8(spline_o, k1, p1, ier)
38  use ezspline_obj
39  type(EZspline1_r8) :: spline_o
40  integer, intent(in) :: k1
41  real(ezspline_r8), intent(in) :: p1(k1)
42  integer, intent(out) :: ier
43 
44  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
45  real(ezspline_r8) :: eps1
46 
47  ier = 0
48 
49  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
50 
51  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
52  ier = 6
53  return
54  endif
55  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
56  ier = 7
57  return
58  endif
59 
60  end subroutine ezspline_isindomain1_array_r8
61 
62 
63 
64 !!
65 !! 2-D
66 !!
67 
68 
69  subroutine ezspline_isindomain2_r8(spline_o, p1, p2, ier)
70  use ezspline_obj
71  implicit none
72  type(EZspline2_r8) :: spline_o
73  real(ezspline_r8), intent(in) :: p1, p2
74 
75  ! ier:
76  ! 6=out of interval p1 < min(x1)
77  ! 7=out of interval p1 > max(x1)
78  ! 8=out of interval p2 < min(x2)
79  ! 9=out of interval p2 > max(x2)
80  integer, intent(out) :: ier
81 
82  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
83  real(ezspline_r8) :: eps1, eps2
84 
85  ier = 0
86 
87  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
88  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
89 
90 
91  if(p1 < spline_o%x1( 1)-eps1) then
92  ier = 6
93  return
94  endif
95  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
96  ier = 7
97  return
98  endif
99  if(p2 < spline_o%x2( 1)-eps2) then
100  ier = 8
101  return
102  endif
103  if(p2 > spline_o%x2(spline_o%n2)+eps2) then
104  ier = 9
105  return
106  endif
107 
108  end subroutine ezspline_isindomain2_r8
109 
110  subroutine ezspline_isindomain2_array_r8(spline_o, k1, k2, p1, p2, ier)
111  use ezspline_obj
112  type(EZspline2_r8) :: spline_o
113  integer, intent(in) :: k1, k2
114  real(ezspline_r8), intent(in) :: p1(k1), p2(k2)
115  integer, intent(out) :: ier
116 
117  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
118  real(ezspline_r8) :: eps1, eps2
119 
120  ier = 0
121 
122  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
123  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
124 
125  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
126  ier = 6
127  return
128  endif
129  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
130  ier = 7
131  return
132  endif
133  if(minval(p2(1:k2)) < spline_o%x2( 1)-eps2) then
134  ier = 8
135  return
136  endif
137  if(maxval(p2(1:k2)) > spline_o%x2(spline_o%n2)+eps2) then
138  ier = 9
139  return
140  endif
141 
142  end subroutine ezspline_isindomain2_array_r8
143 
144  subroutine ezspline_isindomain2_cloud_r8(spline_o, k, p1, p2, ier)
145  use ezspline_obj
146  type(EZspline2_r8) :: spline_o
147  integer, intent(in) :: k
148  real(ezspline_r8), intent(in) :: p1(k), p2(k)
149  integer, intent(out) :: ier
150 
151  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
152  real(ezspline_r8) :: eps1, eps2
153 
154  ier = 0
155 
156  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
157  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
158 
159  if(minval(p1(1:k)) < spline_o%x1( 1)-eps1) then
160  ier = 6
161  return
162  endif
163  if(maxval(p1(1:k)) > spline_o%x1(spline_o%n1)+eps1) then
164  ier = 7
165  return
166  endif
167  if(minval(p2(1:k)) < spline_o%x2( 1)-eps2) then
168  ier = 8
169  return
170  endif
171  if(maxval(p2(1:k)) > spline_o%x2(spline_o%n2)+eps2) then
172  ier = 9
173  return
174  endif
175 
176  end subroutine ezspline_isindomain2_cloud_r8
177 
178 
179 
180 !!!
181 !!! 3-D
182 !!!
183 
184 
185  subroutine ezspline_isindomain3_r8(spline_o, p1, p2, p3, ier)
186  use ezspline_obj
187  implicit none
188  type(EZspline3_r8) :: spline_o
189  real(ezspline_r8), intent(in) :: p1, p2, p3
190 
191  ! ier:
192  ! 6=out of interval p1 < min(x1)
193  ! 7=out of interval p1 > max(x1)
194  ! 8=out of interval p2 < min(x2)
195  ! 9=out of interval p2 > max(x2)
196  ! 10=out of interval p3 < min(x3)
197  ! 11=out of interval p3 > max(x3)
198  integer, intent(out) :: ier
199 
200  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
201  real(ezspline_r8) :: eps1, eps2, eps3
202 
203  ier = 0
204 
205  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
206  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
207  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
208 
209 
210  if(p1 < spline_o%x1( 1)-eps1) then
211  ier = 6
212  return
213  endif
214  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
215  ier = 7
216  return
217  endif
218  if(p2 < spline_o%x2( 1)-eps2) then
219  ier = 8
220  return
221  endif
222  if(p2 > spline_o%x2(spline_o%n2)+eps2) then
223  ier = 9
224  return
225  endif
226  if(p3 < spline_o%x3( 1)-eps3) then
227  ier = 10
228  return
229  endif
230  if(p3 > spline_o%x3(spline_o%n3)+eps3) then
231  ier = 11
232  return
233  endif
234 
235  end subroutine ezspline_isindomain3_r8
236 
237  subroutine ezspline_isindomain3_array_r8(spline_o, k1, k2, k3, p1, p2, p3, ier)
238  use ezspline_obj
239  type(EZspline3_r8) :: spline_o
240  integer, intent(in) :: k1, k2, k3
241  real(ezspline_r8), intent(in) :: p1(k1), p2(k2), p3(k3)
242  integer, intent(out) :: ier
243 
244  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
245  real(ezspline_r8) :: eps1, eps2, eps3
246 
247  ier = 0
248 
249  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
250  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
251  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
252 
253  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
254  ier = 6
255  return
256  endif
257  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
258  ier = 7
259  return
260  endif
261  if(minval(p2(1:k2)) < spline_o%x2( 1)-eps2) then
262  ier = 8
263  return
264  endif
265  if(maxval(p2(1:k2)) > spline_o%x2(spline_o%n2)+eps2) then
266  ier = 9
267  return
268  endif
269  if(minval(p3(1:k3)) < spline_o%x3( 1)-eps3) then
270  ier = 10
271  return
272  endif
273  if(maxval(p3(1:k3)) > spline_o%x3(spline_o%n3)+eps3) then
274  ier = 11
275  return
276  endif
277 
278  end subroutine ezspline_isindomain3_array_r8
279 
280  subroutine ezspline_isindomain3_cloud_r8(spline_o, k, p1, p2, p3, ier)
281  use ezspline_obj
282  type(EZspline3_r8) :: spline_o
283  integer, intent(in) :: k
284  real(ezspline_r8), intent(in) :: p1(k), p2(k), p3(k)
285  integer, intent(out) :: ier
286 
287  real(ezspline_r8), parameter :: small = 1.e-10_ezspline_r8
288  real(ezspline_r8) :: eps1, eps2, eps3
289 
290  ier = 0
291 
292  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
293  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
294  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
295 
296  if(minval(p1(1:k)) < spline_o%x1( 1)-eps1) then
297  ier = 6
298  return
299  endif
300  if(maxval(p1(1:k)) > spline_o%x1(spline_o%n1)+eps1) then
301  ier = 7
302  return
303  endif
304  if(minval(p2(1:k)) < spline_o%x2( 1)-eps2) then
305  ier = 8
306  return
307  endif
308  if(maxval(p2(1:k)) > spline_o%x2(spline_o%n2)+eps2) then
309  ier = 9
310  return
311  endif
312  if(minval(p3(1:k)) < spline_o%x3( 1)-eps3) then
313  ier = 10
314  return
315  endif
316  if(maxval(p3(1:k)) > spline_o%x3(spline_o%n3)+eps3) then
317  ier = 11
318  return
319  endif
320  end subroutine ezspline_isindomain3_cloud_r8
321 
322 !/////
323 ! R4 !
324 !/////
325 !
326 ! 1-D
327 !
328 
329 
330  subroutine ezspline_isindomain1_r4(spline_o, p1, ier)
331  use ezspline_obj
332  implicit none
333  type(EZspline1_r4) :: spline_o
334  real(ezspline_r4), intent(in) :: p1
335 
336  ! ier:
337  ! 6=out of interval p1 < min(x1)
338  ! 7=out of interval p1 > max(x1)
339  integer, intent(out) :: ier
340 
341  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
342  real(ezspline_r4) :: eps1
343 
344  ier = 0
345 
346  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
347 
348 
349  if(p1 < spline_o%x1( 1)-eps1) then
350  ier = 6
351  return
352  endif
353  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
354  ier = 7
355  return
356  endif
357 
358  end subroutine ezspline_isindomain1_r4
359 
360  subroutine ezspline_isindomain1_array_r4(spline_o, k1, p1, ier)
361  use ezspline_obj
362  type(EZspline1_r4) :: spline_o
363  integer, intent(in) :: k1
364  real(ezspline_r4), intent(in) :: p1(k1)
365  integer, intent(out) :: ier
366 
367  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
368  real(ezspline_r4) :: eps1
369 
370  ier = 0
371 
372  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
373 
374  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
375  ier = 6
376  return
377  endif
378  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
379  ier = 7
380  return
381  endif
382 
383  end subroutine ezspline_isindomain1_array_r4
384 
385 
386 
387 !!
388 !! 2-D
389 !!
390 
391 
392  subroutine ezspline_isindomain2_r4(spline_o, p1, p2, ier)
393  use ezspline_obj
394  implicit none
395  type(EZspline2_r4) :: spline_o
396  real(ezspline_r4), intent(in) :: p1, p2
397 
398  ! ier:
399  ! 6=out of interval p1 < min(x1)
400  ! 7=out of interval p1 > max(x1)
401  ! 8=out of interval p2 < min(x2)
402  ! 9=out of interval p2 > max(x2)
403  integer, intent(out) :: ier
404 
405  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
406  real(ezspline_r4) :: eps1, eps2
407 
408  ier = 0
409 
410  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
411  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
412 
413 
414  if(p1 < spline_o%x1( 1)-eps1) then
415  ier = 6
416  return
417  endif
418  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
419  ier = 7
420  return
421  endif
422  if(p2 < spline_o%x2( 1)-eps2) then
423  ier = 8
424  return
425  endif
426  if(p2 > spline_o%x2(spline_o%n2)+eps2) then
427  ier = 9
428  return
429  endif
430 
431  end subroutine ezspline_isindomain2_r4
432 
433  subroutine ezspline_isindomain2_array_r4(spline_o, k1, k2, p1, p2, ier)
434  use ezspline_obj
435  type(EZspline2_r4) :: spline_o
436  integer, intent(in) :: k1, k2
437  real(ezspline_r4), intent(in) :: p1(k1), p2(k2)
438  integer, intent(out) :: ier
439 
440  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
441  real(ezspline_r4) :: eps1, eps2
442 
443  ier = 0
444 
445  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
446  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
447 
448  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
449  ier = 6
450  return
451  endif
452  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
453  ier = 7
454  return
455  endif
456  if(minval(p2(1:k2)) < spline_o%x2( 1)-eps2) then
457  ier = 8
458  return
459  endif
460  if(maxval(p2(1:k2)) > spline_o%x2(spline_o%n2)+eps2) then
461  ier = 9
462  return
463  endif
464 
465  end subroutine ezspline_isindomain2_array_r4
466 
467  subroutine ezspline_isindomain2_cloud_r4(spline_o, k, p1, p2, ier)
468  use ezspline_obj
469  type(EZspline2_r4) :: spline_o
470  integer, intent(in) :: k
471  real(ezspline_r4), intent(in) :: p1(k), p2(k)
472  integer, intent(out) :: ier
473 
474  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
475  real(ezspline_r4) :: eps1, eps2
476 
477  ier = 0
478 
479  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
480  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
481 
482  if(minval(p1(1:k)) < spline_o%x1( 1)-eps1) then
483  ier = 6
484  return
485  endif
486  if(maxval(p1(1:k)) > spline_o%x1(spline_o%n1)+eps1) then
487  ier = 7
488  return
489  endif
490  if(minval(p2(1:k)) < spline_o%x2( 1)-eps2) then
491  ier = 8
492  return
493  endif
494  if(maxval(p2(1:k)) > spline_o%x2(spline_o%n2)+eps2) then
495  ier = 9
496  return
497  endif
498 
499  end subroutine ezspline_isindomain2_cloud_r4
500 
501 
502 
503 !!!
504 !!! 3-D
505 !!!
506 
507 
508  subroutine ezspline_isindomain3_r4(spline_o, p1, p2, p3, ier)
509  use ezspline_obj
510  implicit none
511  type(EZspline3_r4) :: spline_o
512  real(ezspline_r4), intent(in) :: p1, p2, p3
513 
514  ! ier:
515  ! 6=out of interval p1 < min(x1)
516  ! 7=out of interval p1 > max(x1)
517  ! 8=out of interval p2 < min(x2)
518  ! 9=out of interval p2 > max(x2)
519  ! 10=out of interval p3 < min(x3)
520  ! 11=out of interval p3 > max(x3)
521  integer, intent(out) :: ier
522 
523  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
524  real(ezspline_r4) :: eps1, eps2, eps3
525 
526  ier = 0
527 
528  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
529  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
530  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
531 
532 
533  if(p1 < spline_o%x1( 1)-eps1) then
534  ier = 6
535  return
536  endif
537  if(p1 > spline_o%x1(spline_o%n1)+eps1) then
538  ier = 7
539  return
540  endif
541  if(p2 < spline_o%x2( 1)-eps2) then
542  ier = 8
543  return
544  endif
545  if(p2 > spline_o%x2(spline_o%n2)+eps2) then
546  ier = 9
547  return
548  endif
549  if(p3 < spline_o%x3( 1)-eps3) then
550  ier = 10
551  return
552  endif
553  if(p3 > spline_o%x3(spline_o%n3)+eps3) then
554  ier = 11
555  return
556  endif
557 
558  end subroutine ezspline_isindomain3_r4
559 
560  subroutine ezspline_isindomain3_array_r4(spline_o, k1, k2, k3, p1, p2, p3, ier)
561  use ezspline_obj
562  type(EZspline3_r4) :: spline_o
563  integer, intent(in) :: k1, k2, k3
564  real(ezspline_r4), intent(in) :: p1(k1), p2(k2), p3(k3)
565  integer, intent(out) :: ier
566 
567  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
568  real(ezspline_r4) :: eps1, eps2, eps3
569 
570  ier = 0
571 
572  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
573  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
574  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
575 
576  if(minval(p1(1:k1)) < spline_o%x1( 1)-eps1) then
577  ier = 6
578  return
579  endif
580  if(maxval(p1(1:k1)) > spline_o%x1(spline_o%n1)+eps1) then
581  ier = 7
582  return
583  endif
584  if(minval(p2(1:k2)) < spline_o%x2( 1)-eps2) then
585  ier = 8
586  return
587  endif
588  if(maxval(p2(1:k2)) > spline_o%x2(spline_o%n2)+eps2) then
589  ier = 9
590  return
591  endif
592  if(minval(p3(1:k3)) < spline_o%x3( 1)-eps3) then
593  ier = 10
594  return
595  endif
596  if(maxval(p3(1:k3)) > spline_o%x3(spline_o%n3)+eps3) then
597  ier = 11
598  return
599  endif
600 
601  end subroutine ezspline_isindomain3_array_r4
602 
603  subroutine ezspline_isindomain3_cloud_r4(spline_o, k, p1, p2, p3, ier)
604  use ezspline_obj
605  type(EZspline3_r4) :: spline_o
606  integer, intent(in) :: k
607  real(ezspline_r4), intent(in) :: p1(k), p2(k), p3(k)
608  integer, intent(out) :: ier
609 
610  real(ezspline_r4), parameter :: small = 1.e-10_ezspline_r4
611  real(ezspline_r4) :: eps1, eps2, eps3
612 
613  ier = 0
614 
615  eps1 = small*(spline_o%x1(spline_o%n1) - spline_o%x1(1))
616  eps2 = small*(spline_o%x2(spline_o%n2) - spline_o%x2(1))
617  eps3 = small*(spline_o%x3(spline_o%n3) - spline_o%x3(1))
618 
619  if(minval(p1(1:k)) < spline_o%x1( 1)-eps1) then
620  ier = 6
621  return
622  endif
623  if(maxval(p1(1:k)) > spline_o%x1(spline_o%n1)+eps1) then
624  ier = 7
625  return
626  endif
627  if(minval(p2(1:k)) < spline_o%x2( 1)-eps2) then
628  ier = 8
629  return
630  endif
631  if(maxval(p2(1:k)) > spline_o%x2(spline_o%n2)+eps2) then
632  ier = 9
633  return
634  endif
635  if(minval(p3(1:k)) < spline_o%x3( 1)-eps3) then
636  ier = 10
637  return
638  endif
639  if(maxval(p3(1:k)) > spline_o%x3(spline_o%n3)+eps3) then
640  ier = 11
641  return
642  endif
643  end subroutine ezspline_isindomain3_cloud_r4
644