Subroutine bessel_coef Use Numeric_Kinds_Module Use CommonInfo_Module Use Cheby_Module Implicit None !===================================================================== ! Written by: Jeff Crawford ! ! This subroutine outputs an array of J Bessel functions, the number ! of which is determined by the number of terms needed in the ! Chebychev expansion. These Bessel functions are used to get ! the Chebychev expansion coefficients. ! ! Variables: ! bessarg= argument of Bessel functions. ! bessfunc(ncheby)= array containing bessel function values ! nbess= output from RJBESL indicating number of terms calculated ! ncheby= number of terms in chebychev expansion sum Integer nbess !==================================================================== ! Calculate bessel functions with argument bessarg Allocate(bessel_func(ncheby)) bessel_func=0.d0 Call rjbesl(bessarg,0.d0,ncheby,bessel_func,nbess) !==================================================================== ! Error check: make sure nbess=ncheby IF (nbess.ne.ncheby) THEN print*,'ERROR: bessel function argument' print*,'Include more time steps to resolve the problem' stop 'bessel_coef' ENDIF Return End Subroutine bessel_coef