SUBROUTINE basisb (xptg, thlitdel, pn, ngleg, nherm, oscil,parity, parityfn, bfaci, rho, mega) ! P U R P O S E O F S U B R O U T I N E ! This routine calculates Legendre and harmonic oscillator basis ! functions for use in AphDel_Old or AphDel_New transformation. ! Assumes channel, not alternate, quadrature. ! I N P U T A R G U M E N T S ! narran number of arrangement channels. ! ngleg number of Gauss_Legendre quadrature points for each ! arrangement channel. ! nlegndre maximum order of the Legendre polynomial for each ! arrangement channel. ! nherm number of Gauss_Hermite quadrature points for each ! arrangement channel. ! noscil maximum order of the oscillator basis for each ! arrangement. ! parity parity of the surface-functions. ! xptg Gauss_Legendre quadrature points, cos(bigtheta). ! thlitdel array of delves theta angles. ! O U T P U T A R G U M E N T S ! pn Legendre polynomial basis. ! oscil Harmonic oscillator basis. ! parityfn parity function. This function is 1 for even parity and ! cos(chi) for odd parity. ! bfaci coord trans factor that goes with sho fcns of zlit. ! !this routine is called by: ! sfunbasb !this routine calls ! popt,equilth,legendre,harmonic !----------------------------------------------------------------------- ! <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ! I N C L U D E F I L E S USE fileunits_Module USE Numeric_Kinds_Module USE Narran_Module USE PES_MODULE USE gaussb_Module USE Masses_Module USE MassFactor2_Module USE Integrat_Module IMPLICIT NONE ! I N T E G E R S INTEGER karran, iglegn, ihermt,& parity, ngleg, nherm,& n, l, mega, inos ! R E A L S REAL(Kind=WP_Kind) xptg, thlitdel, ct, pn, oscil,& parityfn,& rho, tanth,& chi, sinths, cosths, bfac, bfaci, zlit,& sinthd, costhd, azsbzc,& y, s2td, c2td, sqr,& cos4,half,zero,one,two,four,six,& beta, eps, sin4, cos, atan, sin, sqrt, tan, asin ! D I M E N S I O N S DIMENSION xptg(mxglegn, narran), thlitdel(maxhermt, narran), pn(0:mxl,mxglegn,narran),oscil(0:mxn,maxhermt,narran),& parityfn(mxglegn, maxhermt,narran), bfaci(maxhermt,narran), ngleg(narran), nherm(narran) REAL(Kind=WP_Kind), ALLOCATABLE :: thliteq(:),az(:),bz(:),cz(:),& se(:),cparm(:),rhoprm(:),rhofix(:) ! I N T R I N S I C F U N C T I O N S INTRINSIC cos, atan, sin, sqrt, tan, asin ! E X T E R N A L S EXTERNAL popt, legendre, harmonic ! P A R A M E T E R S PARAMETER (half=0.5d0, zero=0.0d0, one=1.0d0) PARAMETER (two=2.0d0, four=4.0d0, six=6.0d0) !----------------------------------------------------------------------- ! Determine printing options. !----------------------------------------------------------------------- LOGICAL little, medium, full, expfit, tmud2, lifhb, fh2t5 INTEGER ithcall, ithsub DATA ithcall /0/, ithsub /0/ DATA little /.false./, medium /.false./, full /.false./ CALL popt ('basisb ', little, medium, full, ithcall, ithsub) !----------------------------------------------------------------------- ! old_way=.true. gives the parametrization that was used from 89/11 to ! 92/5. old_way=.false. gives the parametrization used since 92/5. ! Note. The following parametrization must match that in abm/basis.F. !----------------------------------------------------------------------- WRITE(Out_Unit,*)'begining of routine basisb' IF(Medium)WRITE(Out_Unit,*)'old_way=',old_way WRITE(Msg_Unit,*)'old_way=',old_way 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(PES_Name=='FH2 T5A PES')THEN fh2t5 = .true. ELSE fh2t5 = .false. ENDIF !------------------------------------------------------------------------ !ALLOCATE momory !------------------------------------------------------------------------ ALLOCATE( thliteq(narran), az(narran), bz(narran), cz(narran),& se(narran), cparm(narran),rhoprm(narran),& rhofix(narran)) !------------------------------------------------------------------------ ! determine scaled equilibrium internuclear distances. DO karran = 1, narran se(karran)=rx(karran)*re(karran)/d(karran) ! the following is used for tmu+d2 and lifh IF(old_way)THEN IF(tmud2)THEN rhofix(karran)=1.025d0*se(karran) ELSEIF(lifhb)THEN rhofix(karran)=1.1*se(karran) ENDIF ENDIF ENDDO ! --------------------------------------------------------------------- ! determine equilibrium value of thlitdel. ! detn parameters relating hermite quadrature variable z to thlitdel. ! z=a*tan(theta)-b*cot(theta)+c ! -------------------------------------------------------------------- DO karran=1,narran IF(old_way)THEN rhoprm(karran)=rho ENDIF cparm(karran)=calpha(karran) IF(old_way)THEN IF(rho