2 c intrinsic-unix-bessel.f
4 c Test Bessel function intrinsics.
5 c These functions are only available if provided by system
7 c David Billinghurst <David.Billinghurst@riotinto.com>
10 double precision dx, da
25 c BESJ0 - Bessel function of first kind of order zero
28 call c_r(BESJ0(x),a,'BESJ0(real)')
29 call c_d(BESJ0(dx),da,'BESJ0(double)')
30 call c_d(DBESJ0(dx),da,'DBESJ0(double)')
32 c BESJ1 - Bessel function of first kind of order one
35 call c_r(BESJ1(x),a,'BESJ1(real)')
36 call c_d(BESJ1(dx),da,'BESJ1(double)')
37 call c_d(DBESJ1(dx),da,'DBESJ1(double)')
39 c BESJN - Bessel function of first kind of order N
42 call c_r(BESJN(i,x),a,'BESJN(integer,real)')
43 call c_r(BESJN(j,x),a,'BESJN(integer(2),real)')
44 call c_r(BESJN(k,x),a,'BESJN(integer(1),real)')
45 call c_d(BESJN(i,dx),da,'BESJN(integer,double)')
46 call c_d(BESJN(j,dx),da,'BESJN(integer(2),double)')
47 call c_d(BESJN(k,dx),da,'BESJN(integer(1),double)')
48 call c_d(DBESJN(i,dx),da,'DBESJN(integer,double)')
49 call c_d(DBESJN(j,dx),da,'DBESJN(integer(2),double)')
50 call c_d(DBESJN(k,dx),da,'DBESJN(integer(1),double)')
52 c BESY0 - Bessel function of second kind of order zero
55 call c_r(BESY0(x),a,'BESY0(real)')
56 call c_d(BESY0(dx),da,'BESY0(double)')
57 call c_d(DBESY0(dx),da,'DBESY0(double)')
59 c BESY1 - Bessel function of second kind of order one
62 call c_r(BESY1(x),a,'BESY1(real)')
63 call c_d(BESY1(dx),da,'BESY1(double)')
64 call c_d(DBESY1(dx),da,'DBESY1(double)')
66 c BESYN - Bessel function of second kind of order N
69 call c_r(BESYN(i,x),a,'BESYN(integer,real)')
70 call c_r(BESYN(j,x),a,'BESYN(integer(2),real)')
71 call c_r(BESYN(k,x),a,'BESYN(integer(1),real)')
72 call c_d(BESYN(i,dx),da,'BESYN(integer,double)')
73 call c_d(BESYN(j,dx),da,'BESYN(integer(2),double)')
74 call c_d(BESYN(k,dx),da,'BESYN(integer(1),double)')
75 call c_d(DBESYN(i,dx),da,'DBESYN(integer,double)')
76 call c_d(DBESYN(j,dx),da,'DBESYN(integer(2),double)')
77 call c_d(DBESYN(k,dx),da,'DBESYN(integer(1),double)')
79 if ( fail ) call abort()
82 subroutine failure(label)
83 c Report failure and set flag
87 write(6,'(a,a,a)') 'Test ',label,' FAILED'
91 subroutine c_r(a,b,label)
92 c Check if REAL a equals b, and fail otherwise
95 if ( abs(a-b) .gt. 1.0e-5 ) then
97 write(6,*) 'Got ',a,' expected ', b
101 subroutine c_d(a,b,label)
102 c Check if DOUBLE PRECISION a equals b, and fail otherwise
103 double precision a, b
105 if ( abs(a-b) .gt. 1.0d-5 ) then
107 write(6,*) 'Got ',a,' expected ', b