next up previous index
Next: C312 Bessel Functions Up: CERNLIB Previous: C307 Digamma or

C309 Coulomb Wave, Bessel, and Spherical Bessel Functions for Complex Argument(s) and Order

Routine ID: C309
Author(s): I.J. Thompson, A.R. BarnettLibrary: MATHLIB
Submitter: K.S. KölbigSubmitted: 15.01.1988
Language: FortranRevised:

Subroutine subprograms CCLBES and WCLBES calculate any one of the following sequences of functions:

  1. Regular and irregular Coulomb wave functions Fλ+n(η,z), Gλ+n(η,z)
    and their first derivatives with respect to z, F'λ+n(η,z), G'λ+n(η,z) ,
    or simple combination of these;
  2. Spherical Bessel functions jλ+n(z), yλ+n(z)
    and their first derivatives with respect to z, j'λ+n(z), y'λ+n(z) ,
    or simple combination of these (spherical Hankel functions);
  3. Bessel functions Jλ+n(z), Yλ+n(z)
    and their first derivatives with respect to z, J'λ+n(z), Y'λ+n(z) ,
    or simple combination of these (Hankel functions);
  4. Modified Bessel functions Iλ+n(z), Kλ+n(z)
    and their first derivatives with respect to z, I'λ+n(z), K'λ+n(z) ;

for complex arguments η,z , complex order λ , and n=0,1,...,N.

On computers other than CDC or Cray, only the double-precision version WCLBES is available. On CDC and Cray computers, only the single-precision version CCLBES is available.

Structure:

SUBROUTINE subprograms
User Entry Names: CCLBES, WCLBES
Internal Entry Names: C309R1, C309R2, C309R3, C309R4, C309R5, C309R6, C309R7, C309R8
Files Referenced: Unit 6
External References: CLGAMA, WLGAMA (C306), CDIGAM, WDIGAM (C307)

Usage:

CALL CCLBES(Z,ETA,ZLMIN,NL,F,G,FP,GP,SIG,KFN,MODE,JFAIL,JPR) or
CALL WCLBES(Z,ETA,ZLMIN,NL,F,G,FP,GP,SIG,KFN,NODE,JFAIL,JPR)
where Z, ETA, ZLMIN, F, G, FP, GP, SIG are of type COMPLEX for subroutine CCLBES and of type COMPLEX*16 for subroutine WCLBES, and where NL, KFN, MODE, JFAIL, JPR are of type INTEGER.
Z
Argument z ≠0 .
ETA
Argument η (ignored if KFN > 0 ).
ZLMIN
Order λmin of the first function in the computed sequence.
NL
Specifies the order λmin+NL of the last function in the computed sequence. (NL ≥0 ).
F,G,FP,GP
One-dimensional arrays with dimension (0:d) where d is in each case ≥NL+1 . On exit, each of F(n),G(n),FP(n),GP(n) may contain the value of a function of order λmin+n , or its first order derivative, (n=0,1,...,NL) , as specified jointly by KFN and |MODE|.
SIG
One-dimensional array with dimension (0:d), where d ≥NL+1 . On exit, provided KFN=0 , SIG(n) contains the Coulomb phase shift σ(η) for λ=λmin+n, (n=0,1,..., NL) .
KFN
Specifies, in conjunction with the absolute value of MODE, the type of functions which are stored.
MODE
The absolute value of MODE specifies, in conjunction with KFN, the type of function which are stored, and also specifies which of the arrays F,G,FP,GP are in fact set to meaningful values. The sign of MODE specifies whether or not the functions are multiplied by a scaling factor.
JFAIL
On exit, JFAIL is set to zero if no error condition is detected. Otherwise JFAIL is set as described under Error handling.
JPR
= 0: Suppress printing of error messages.
= 1: Print error messages.

The type of function which is stored in array F depends only on KFN, while the type of function which is stored in array G depends both on KFN and on |MODE|. Arrays FP and GP (if set) contain the first order derivatives with respect to z of the functions in F and G, respectively. Using the abbreviations (i = -1 )

Fλ Fλ(η,z), Gλ Gλ(η,z), Hλ± Gλ±iFλ,

jλ jλ(z), yλ yλ(z), hλ(1,2) jλ±iyλ,

Jλ Jλ(z), Yλ Yλ(z), Hλ(1,2) Jλ±iYλ,

Iλ Iλ(z), Kλ Kλ(z),

the choice of function is given by the following table:

Array |MODE| 4|c|KFN

-1 or 0 1 2 3

F all values Fλ jλ Jλ Iλ

G 1,2,3,4 Gλ yλ Yλ Kλ

11,12 Hλ+ hλ(1) H λ(1) -

21,22 Hλ- hλ(2) Hλ(2) -

If KFN=0 the phase shifts σ(η) are stored in array SIG. Otherwise SIG is not set.

Which of arrays F,G,FP,GP are in fact set is determined by |MODE| according to the following table:
|MODE| FGFPGP
1, 11, 21 set set set set
2, 12, 22 set set - -
3 set - set -
4 set - - -

In both the tables above, a dash indicates that the corresponding array does not contain meaningful values on exit. These arrays are, however, used internally as working space, and must therefore be dimensioned correctly. The sign of MODE specifies whether or not the functions are to be multiplied by a scaling factor, depending only on z, which will bring their values closer to unity when |z| is large, or η is small and |λ|<|z| . The same scaling factor is applied to the first order derivatives in FP or GP as is applied to the functions in F or G, respectively.

MODE
>0: No scaling factor.
MODE
<0: Let S=Im(z) if KFN<3 , S=Re(z) if KFN=3 ; then the scaling factors for F and G are

F: exp(-|S|) F,j,J,I

G: exp(-|S|) G,y,Y

exp(S) H+,h(1),H(1),K

exp(-S) H-,h(2),H(2).

Method:

The method is described in the References.

Restrictions:

See Ref. 1, in particular Sect. 4.

Accuracy:

The absolute values of the results are usually accurate to within two or three decimal digits of the machine precision. For details of exceptions see Ref. 1, Sect. 4.

Error handling:

If an error condition is detected, JFAIL is set to one of the following values and a message is printed if JPR=1 .

> 0

An arithmetic error occurred during the final recursion. Correct results are available up to and including subscript value NL-JFAIL-1.
- 1

One of the continued fraction calculations failed or there was an arithmetic error before any results could be calculated.
- 2

Argument out of range.
- 3

One or more functions corresponding to λmin could not be calculated. Some values corresponding to λ>λmin may be correct.
- 4

Excessive internal cancellation probably renders the result meaningless.

This program package is a modified version of the CPC Program Library package COULCC (see Ref. 1). The changes are formal, not computational.

References:

  1. I.J. Thompson and A.R. Barnett, COULCC: A continued-fraction algorithm for Coulomb functions of complex order with complex arguments, Comput. Phys. Comm. 36 (1985) 363--372.
  2. I.J. Thompson and A.R. Barnett, Coulomb and Bessel functions of complex arguments and order, J. Comput. Phys. 64 (1986) 490--509.

A copy of Ref. 1 is available in the Program Library Office.

C312



next up previous index
Next: C312 Bessel Functions Up: CERNLIB Previous: C307 Digamma or


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995