SUBROUTINE Basis_Delves(z,thetd,az,bz,cz,karran) USE fileunits_Module USE numeric_kinds_Module USE Narran_Module USE PES_MODULE USE GaussQuady_Module USE gaussb_Module USE Masses_Module USE MassFactor2_Module USE Integrat_Module USE rhonum_module USE thetas_MODULE USE Numbers_Module IMPLICIT NONE INTEGER iglegn, ihermt, n, l,inos,i INTEGER ic,iy,in,karran REAL(Kind=WP_Kind) thlitdel, ct,& parityfn,& rho, tanth,& chi, sinths, cosths,z(*), zlit(maxhermt),& sinthd, costhd, azsbzc,& y, s2td, c2td, sqr,& cos4, beta, eps, sin4, cos, sin, tan, asin,pi2,thetd(maxhermt,Narran) REAL(Kind=WP_Kind) zmc,a(3),x(3),az(3),bz(3),cz(3) dimension thlitdel(maxhermt, narran) REAL(Kind=WP_Kind), allocatable :: thliteq(:), se(:), cparm(:), rhoprm(:), rhofix(:) REAL(Kind=WP_Kind),allocatable :: sqci(:) INTRINSIC cos, atan, sin, sqrt, tan, asin REAL(Kind=WP_Kind) atan2, max, sign INTRINSIC atan2, max, sign !----------------------------------------------------------------------- ! Determine printing options. !----------------------------------------------------------------------- LOGICAL little, medium, full, expfit, tmud2, lifhb, fh2t5 INTEGER ithcall, ithsub, ithcal2 DATA ithcall /0/, ithcal2 /0/, ithsub /0/ IF(old_way)THEN IF(PES_Name=='tmud2 pairwise add. ')THEN tmud2 = .true. WRITE(Out_Unit,*)'tmud2=.true.' ELSE !WRITE(Out_Unit,*)'tmud2=.false.' tmud2 = .false. ENDIF IF(PES_Name=='LiFH_B BondOrder PES')THEN expfit = .true. lifhb = .true. !WRITE(Out_Unit,*)'Using exponential fit to cparm' ELSE expfit = .false. lifhb = .false. !WRITE(Out_Unit,*)'Using morse fit to cparm' ENDIF ENDIF IF(.NOT.allocated(thliteq))THEN ALLOCATE(thliteq(narran)) ALLOCATE(se(narran)) ALLOCATE(cparm(narran)) ALLOCATE(rhoprm(narran)) ALLOCATE(rhofix(narran)) ALLOCATE(sqci(narran)) ENDIF pi2=2.d0*atan(1.d0) rho=rhonum !Step1 try to get thlitdel ic=karran !Step2 Get thliteq ! determine scaled equilibrium internuclear distances. se(karran)=rx(karran)*re(karran) IF(old_way)THEN IF (tmud2)THEN ! the following is used for tmu+d2 rhofix(karran)=1.025d0*se(karran) ELSE IF (lifhb)THEN ! the following is used for LiFH rhofix(karran)=1.1*se(karran) ENDIF ENDIF ! --------------------------------------------------------------------- ! determine equilibrium value of thlitdel. ! detn parameters relating hermite quadrature variable z to thlitdel. ! z=a*tan(theta)-b*cot(theta)+c ! -------------------------------------------------------------------- IF(old_way)THEN rhoprm(karran)=rho ENDIF cparm(karran)=calpha(karran) IF(old_way)THEN IF(rho