IF<ABS(BJ(N1) ) .GT.TOLR) ICOUNT=0 WEDGE45 



10 CONTINUE WEDGE46 



14 CONTINUE WEDGE47 



F=BJ(l)/2. WEDGE48 



DO 20 N=1,NNN WEDGE49 



N1=N+1 WEDGE50 



XMN=XM(N1) WEDGE51 



TM=<0.0,1.0)**XMN*BJ(N1)*C0S(XMN*WA)*C0S(XMN*TH) WEDGE52 



F=F+TM WEDGE53 



20 CONTINUE WEDGE54 



F=4./XNU*F WEDGE55 



FR=REAL(F) WEDGE56 



FI=AIMAG(F> WEDGE57 



FABS=SQRT(FR*FR+FI#FI> WEDGE58 



IF(WA.LE. i.E-B) FABS=FABS/2. WEDGE59 



IF(FABS.LT.TOLR) GOTO 30 WEDGE60 



FPHA=ATAN2(FI,FR) WEDGE61 



RETURN WEDGE62 



30 FPHA=0.0 WEDGE63 



RETURN WEDGE64 



END WEDGE65 



SUBROUTINE BESJ (X , ALPHA, N ,Y , NZ ) BESJ101 



c BESJ102 



C WRITTEN BY D.E. AMOS, S.L. DANIEL AND M.K. WESTON, JANUARY, 1975. BESJ103 



C REFERENCE SAND-75-0147 BESJ104 



C BESJ105 



C ABSTRACT BESJ106 



C BESJ COMPUTES AN N MEMBER SEQUENCE OF J BESSEL FUNCTIONS BESJ107 



C J/SUB(ALPHA+K-1)/(X) , K=1,...,N FOR NON-NEGATIVE ALPHA AND X. BESJ10B 



C A COMBINATION OF THE POWER SERIES, THE ASYMPTOTIC EXPANSION BESJ109 



C FOR X TO INFINITY AND THE UNIFORM ASYMPTOTIC EXPANSION FOR BESJ110 



C NU TO INFINITY ARE APPLIED OVER SUBDIVISIONS OF THE (NU,X) BESJ111 



C PLANE. FOR VALUES OF (NU,X) NOT COVERED BY ONE OF THESE BESJ112 



C FORMULAE, THE ORDER IS INCREMENTED OR DECREMENTED BY INTEGER BESJ113 

 C VALUES INTO A REGION WHERE ONE OF THE FORMULAE APPLY. BACKWARDBESJ1 14 

 C RECURSION IS APPLIED TO REDUCE ORDERS BY INTEGER VALUES EXCEPTBESJ 1 15 



C WHERE THE ENTIRE SEQUENCE LIES IN THE OSCILLATORY REGION. IN BESJ 1 16 



C THIS CASE FORWARD RECURSION IS STABLE AND VALUES FROM THE BESJ 1 17 



C ASYMPTOTIC EXPANSION FOR X TO INFINITY START THE RECURSION BESJ118 

 C WHEN IT IS EFFICIENT TO DO SO. LEADING TERMS OF THE SERIES ANDBESJ119 



C UNIFORM EXPANSION ARE TESTED FOR UNDERFLOW. IF A SEQUENCE IS BESJ120 



C REQUESTED AND THE LAST MEMBER WOULD UNDERFLOW, THE RESULT IS BESJ121 



C SET TO ZERO AND THE NEXT LOWER ORDER TRIED, ETC., UNTIL A BESJ122 

 C MEMBER COMES ON SCALE OR ALL MEMBERS ARE SET TO ZERO. OVERFLOWBESJ 123 

 C CANNOT OCCUR. BESJ1 CALLS SUBROUTINE JAIRY AND FUNCTION GAMLN. BESJ 124 



C BESJ125 



C DESCRIPTION OF ARGUMENTS BESJ126 



C BESJ127 



C INPUT BESJ128 



C X - X.GE.O BESJ129 



C ALPHA - ORDER OF FIRST MEMBER OF THE SEQUENCE, ALPHA. GE.O BESJ130 



C N NUMBER OF MEMBERS IN THE SEQUENCE, N.GE.l BESJ131 



C OUTPUT BESJ132 



C Y - A VECTOR WHOSE FIRST N COMPONENTS CONTAIN BESJ133 



C VALUES FOR J/SUB ( ALPHA+K-1 ) / ( X ) , K=1,...,N BESJ134 



Figure A3. (Sheet 2 of 25) 

 A6 



