1 c intrinsic-unix-bessel.f
3 c Test Bessel function intrinsics.
4 c These functions are only available if provided by system
6 c David Billinghurst <David.Billinghurst@riotinto.com>
9 double precision dx, da
24 c BESJ0 - Bessel function of first kind of order zero
27 call c_r(BESJ0(x),a,'BESJ0(real)')
28 call c_d(BESJ0(dx),da,'BESJ0(double)')
29 call c_d(DBESJ0(dx),da,'DBESJ0(double)')
31 c BESJ1 - Bessel function of first kind of order one
34 call c_r(BESJ1(x),a,'BESJ1(real)')
35 call c_d(BESJ1(dx),da,'BESJ1(double)')
36 call c_d(DBESJ1(dx),da,'DBESJ1(double)')
38 c BESJN - Bessel function of first kind of order N
41 call c_r(BESJN(i,x),a,'BESJN(integer,real)')
42 call c_r(BESJN(j,x),a,'BESJN(integer*2,real)')
43 call c_r(BESJN(k,x),a,'BESJN(integer*1,real)')
44 call c_d(BESJN(i,dx),da,'BESJN(integer,double)')
45 call c_d(BESJN(j,dx),da,'BESJN(integer*2,double)')
46 call c_d(BESJN(k,dx),da,'BESJN(integer*1,double)')
47 call c_d(DBESJN(i,dx),da,'DBESJN(integer,double)')
48 call c_d(DBESJN(j,dx),da,'DBESJN(integer*2,double)')
49 call c_d(DBESJN(k,dx),da,'DBESJN(integer*1,double)')
51 c BESY0 - Bessel function of second kind of order zero
54 call c_r(BESY0(x),a,'BESY0(real)')
55 call c_d(BESY0(dx),da,'BESY0(double)')
56 call c_d(DBESY0(dx),da,'DBESY0(double)')
58 c BESY1 - Bessel function of second kind of order one
61 call c_r(BESY1(x),a,'BESY1(real)')
62 call c_d(BESY1(dx),da,'BESY1(double)')
63 call c_d(DBESY1(dx),da,'DBESY1(double)')
65 c BESYN - Bessel function of second kind of order N
68 call c_r(BESYN(i,x),a,'BESYN(integer,real)')
69 call c_r(BESYN(j,x),a,'BESYN(integer*2,real)')
70 call c_r(BESYN(k,x),a,'BESYN(integer*1,real)')
71 call c_d(BESYN(i,dx),da,'BESYN(integer,double)')
72 call c_d(BESYN(j,dx),da,'BESYN(integer*2,double)')
73 call c_d(BESYN(k,dx),da,'BESYN(integer*1,double)')
74 call c_d(DBESYN(i,dx),da,'DBESYN(integer,double)')
75 call c_d(DBESYN(j,dx),da,'DBESYN(integer*2,double)')
76 call c_d(DBESYN(k,dx),da,'DBESYN(integer*1,double)')
78 if ( fail ) call abort()
81 subroutine failure(label)
82 c Report failure and set flag
86 write(6,'(a,a,a)') 'Test ',label,' FAILED'
90 subroutine c_r(a,b,label)
91 c Check if REAL a equals b, and fail otherwise
94 if ( abs(a-b) .gt. 1.0e-5 ) then
96 write(6,*) 'Got ',a,' expected ', b
100 subroutine c_d(a,b,label)
101 c Check if DOUBLE PRECISION a equals b, and fail otherwise
102 double precision a, b
104 if ( abs(a-b) .gt. 1.0d-5 ) then
106 write(6,*) 'Got ',a,' expected ', b