Subroutine get_cheby Use Numeric_Kinds_Module Use CommonInfo_Module USE Convrsns_Module Use Time_Module Use Cheby_Module Implicit None !========================================================================================= ! Written by: Jeff Crawford ! ! Calculate the number of terms to be included in the Chebychev expansion. Also, ! calculates the Bessel function arguments. ! ! For more information, see J. Chem Phys 81,3967 (1984) page 3968 second column for ! method to determine number of terms. ! ! Variables: ! alpha= factor used to adjust number of terms in Chebychev expansion (alpha > 1). ! bessarg = argument of Bessel functions used in the expansion ! e_range = eigenvalue range ! minterms = minimum number of terms to be included in the expansion ! ncheby = number of terms in Chebychev expansion !========================================================================================= ! I N T E R N A L S Integer :: minterms, temp Real(dp) ::alpha !========================================================================================= ! Initialize variables minterms=25 bessarg=0.d0 ncheby=1 alpha=1.9d0 !========================================================================================= ! Calculate the number of terms to be used e_range=eigmax-eigmin bessarg=(e_range*deltat)/2.d0 ncheby=Ceiling(alpha*bessarg) !========================================================================================= ! Check that the current parameters have provided a large enough number of terms. ! If not, recalculate e_range and bessarg ! Write info WRITE(Out_Unit,21) 'Chebychev Sum Info:' IF (ncheby.lt.minterms) THEN temp=ncheby ncheby=minterms bessarg=ncheby/alpha e_range=2.d0*bessarg/deltat eigmax=e_range+eigmin shift=eigmax+eigmin norm=eigmax-eigmin WRITE(Out_Unit,22) 'Number of Cheby terms is too small' WRITE(Out_Unit,22) 'Recalculating ncheby, e_range, and bessarg' ENDIF WRITE(Out_Unit,23) 'e_range', e_range, e_range*autoev WRITE(Out_Unit,24) 'ncheby ', ncheby 21 FORMAT(/1X,a,/1X,50('-')) 22 FORMAT(1X,a) 23 FORMAT(1X,a,10('.'),F7.4,' au',3X,F7.3,' eV') 24 FORMAT(1X,a,10('.'),I4) Return End Subroutine get_cheby