SUBROUTINE AphDel_Old(rho, naph, ndelve, tstore, umat, temp,& plmst,djmkp,phi,betqf,chi1,thaph,snthd,& nxdim,nydim,jrmax,jrjtmax,id,th,ch,f,& h1,jx,jy,jc1,xnode,beta,idi,nid,idni,nidm) !----------------------------------------------------------------------- !this routine is called by: ! aphdelbf !this routine calls ! popt,numgen,factor,lgnd11,aphdef,legendre,clebp,intfbr,intbas,wigner,mxoutl,delchk,aphchk !----------------------------------------------------------------------- USE fileunits_Module USE Numeric_Kinds_Module USE Convrsns_Module USE Narran_Module USE Integrat_Module USE sfntyp_Module USE totj_Module USE Numbers_Module USE thetas_Module USE qlam_Module USE Qall_Module !USE Gaussb_Module USE GaussQuady_Module USE opts_Module USE chiang_Module USE VFunc_Module USE Storage_Module USE rhosur_Module USE TotalEng_Module USE Masses_Module USE quantb_Module IMPLICIT NONE SAVE LOGICAL AphDel_All LOGICAL little, medium, full INTEGER ithcll, ithsub INTEGER tea, lam, karran INTEGER lamsave, jtsav,ipsav INTEGER naph, ndelve, jrmax, nxdim, nydim, nidm, jrjtmax, indexdel INTEGER jx(npoint), jy(npoint), jc1(npoint), xnode(mxnode), idni(mxnode) INTEGER id(9,mxelmnt),ngor(narran) INTEGER nx,k,i,ix,in,iy,jr,ic,ja,jb,jc,kp,md,me,kmax,idel,iaph, kpoint,lr,nujm REAL(Kind=WP_Kind) rho, rhosav REAL(Kind=WP_Kind) beta(nidm,3*mxnode/4), idi(nidm,3*mxnode/4),nid(3*mxnode/4) REAL(Kind=WP_Kind) plmtemp(0:mxl) REAL(Kind=WP_Kind) plmst(0:jrjtmax,nxdim,0:jrmax) REAL(Kind=WP_Kind) djmkp(0:jrjtmax,nxdim,nydim,3) REAL(Kind=WP_Kind) phi(nxdim,nydim,narran) REAL(Kind=WP_Kind) betqf(nxdim,nydim,3) REAL(Kind=WP_Kind) chi1(nxdim,nydim,3) REAL(Kind=WP_Kind) thaph(nxdim,nydim,3) REAL(Kind=WP_Kind) snthd(nydim,3) REAL(Kind=WP_Kind) th(9,mxelmnt), ch(9,mxelmnt), f(mxnode) REAL(Kind=WP_Kind) tstore(ndelve,ndelve), temp(naph,naph), bfaci REAL(Kind=WP_Kind) umat(ndelve,naph), bigtemp, eaph, edel, ejac REAL(Kind=WP_Kind) upsil REAL(Kind=WP_Kind) h1(9,npoint) REAL(Kind=WP_Kind), ALLOCATABLE :: wx(:),x(:),wy(:) REAL(Kind=WP_Kind), ALLOCATABLE :: thetd(:,:), xptg(:,:) REAL(Kind=WP_Kind), ALLOCATABLE :: sqci(:), a(:) REAL(Kind=WP_Kind) sumx,sumk,sum0,pi2,sq2i,rac,cnorm DATA ithcll/0/,ithsub/0/ DATA little/.false./,medium/.false./,full/.false./ DATA lamsave/-1000/, rhosav/-1.0d0/,jtsav/-1/,ipsav/-1/ CALL popt('AphDel_Old ',little,medium,full,ithcll,ithsub) !---------------------------------------------------------------------- ! this routine transforms the wigner r-matrix in the ! (aph) basis to the wigner r-matrix in the delves basis. !----------------------------------------------------------------------- ! requires subprograms lgnd11,lgndrx,cleb,legendre, and trnsfm ! also requires function djmk and its routines numgen and factor ! --------------------------------------------------------------------- ! rho.......hyperradius (bohr) ! naph......number of coupled channels in the aph frame. ! lambda....lambda quantum numbers in the aph frame. ! ndelve......number of coupled channels in the delves frame. hopefully ! naph is approximately equal to ndelve. ! jtot......total angular momentum quantum number. ! kchan.....kchan(idel) is arrangement channel (1, 2 or 3) with which ! state idel is associated. ! mvib......vibrational quantum numbers in the delves frame. ! jrot3......rotational quantum numbers in the delves frame. ! lorb3......orbital angular momentum quantum numbers in the delves ! frame. ! tstore....temporary storage matrix. used here to store unitarity ! test and also clebsch-gordan coeffs. ! temp......temporary storage matrix used in unitarity tests. ! umat......orthogonal u-matrix that transforms the r-matrix in the ! aph frame to the r-matrix in the delves frame. ! nxdim.....number of quadrature points in legendre quad on rotor angle ! nhermt..number of quadrature points in hermite quad on delves angle. ! nuj3....(nuj3(idel)-1)*nhermt locates start of upsil in chinuj array. ! plmst.....array of plm(k to jrmx, nxdim, jrmx) ! djmkp.....array of definite parity djmk(k to jrmx, nxdim,nhermt) ! phi.......phi(nxdim,nhermt) are aph surf fcns of fixed jtot and iaph ! at the delves quadrature points. ! upsil.....upsil(nhermt,ndelve) are delves vibrational functions. !---------------------------------------------------------------------- ! plmst array for storing associated legendre ! polynomials. This array is needed for the ! APH to delves transformation only. ! djmkp array for storing Wigner rotation functions. ! This array is needed for the APH to Delves ! transformation only. ! betqf array for storing beta angles. This array ! is needed for the APH to Delves transformation ! only. ! chi1 array for storing chi angles. This array is ! needed for the APH to Delves transformation ! only. ! thaph array for storing the APH theta angles. This ! array is needed for the APH to Delves ! transformation only. ! snthd array for storing the sin of the theta Delves ! This array is needed for the APH to Delves ! transformation only. ! nx number of Gauss_Legendre quadrature points. ! ny number of Gauss_Laguerre quadrature points. ! jrmax value of the largest rotational quantum ! number used in the Delves region. ! ! ------------------------------------------------------------------ ! !allocata storage for several matrix ! ALLOCATE(chanl(mxbasis, 0:mxmega), nvib(mxbasis),jrot(mxbasis,0:mxmega)) IF(.Not.ALLOCATED(wx))ALLOCATE(wx(96),x(96),wy(96)) IF(.Not.ALLOCATED(thetd))ALLOCATE(thetd(maxhermt,narran),xptg(mxglegn,narran)) IF(.Not.ALLOCATED(sqci))ALLOCATE(sqci(3),a(200)) WRITE(Out_Unit,*)'oliver size of chanl,nvib,jrot=',size(chanl),size(nvib),size(jrot) WRITE(Out_Unit,*)'oliver size of thetd,xptg=',size(thetd),size(xptg) WRITE(Out_Unit,'(//," aph to delves projection at rho=",f10.5)')rho IF(rho==rhosav) GOTO 2 ! ------------------------------------------------------------------ ! start calculations done on the first pass only ! ------------------------------------------------------------------ IF(nstate1.1)THEN WRITE(Out_Unit,7768)iaph,temp(iaph,iaph) ELSEIF(ABS(temp(iaph,iaph))<0.9)THEN WRITE(Out_Unit,7768)iaph,temp(iaph,iaph) ELSE IF(AphDel_All)WRITE(Out_Unit,7765)iaph,temp(iaph,iaph) ENDIF ENDDO 7768 FORMAT(/,'***warning**** for iaph=',i5,' the delves basis is not adequate',5x,f10.5) 7765 FORMAT(/,10x,'Fantastic for iaph=',i5, 'the delves basis is adequate',5x,f10.5) ! the following direction tests the aph basis. CALL aphchk(ndelve,tstore,naph,umat) IF(little)THEN WRITE(Out_Unit,'(//,"u*utranspose",/)') CALL MxOutL(tstore,ndelve,ndelve,0,'space','space') ENDIF DO idel=1,ndelve IF(ABS(tstore(idel,idel))>1.1)THEN WRITE(Out_Unit,8768)idel,kchan(idel), mvib3(idel),jrot3(idel), lorb3(idel),tstore(idel,idel) ELSEIF(ABS(tstore(idel,idel))<0.4)THEN WRITE(Out_Unit,8768)idel,kchan(idel), mvib3(idel),jrot3(idel), lorb3(idel),tstore(idel,idel) ELSE IF(AphDel_All)WRITE(Out_Unit,8769)idel,kchan(idel), mvib3(idel),jrot3(idel), lorb3(idel),tstore(idel,idel) ENDIF ENDDO 8768 FORMAT(/,'warning APH basis incomplete: idel=',i4,' channel=',i4,' mvib=',i4,' jrot=',i4,' lorb=',i4,f8.5) 8769 FORMAT(/,'Fantastic APH basis complete: idel=',i4,' channel=',i4,' mvib=',i4,' jrot=',i4,' lorb=',i4,f8.5) DO i = 1, ndelve elect3(i) = 0 ENDDO WRITE(Out_Unit,*)'naph,ndelve=', naph, ndelve IF(little)THEN WRITE(Out_Unit,*)'Etot=', Etot ENDIF ! save umat on disc umat_unit WRITE(Out_Unit,*)'Quantum Numbers used in APH to Delves Transformation' DO I=1,ndelve energy3_delves(i)=Etot-xksq3(i)/usys2 ENDDO CALL Quant_Out (ndelve, kchan, elect3, mvib3, jrot3, lorb3, energy3_delves, xksq3,'AphDel_Old') OPEN(Unit=umat_unit,File=OutDIR(1:LEN(TRIM(OutDIR)))//'BinOut/Umat.bin',form='unformatted', status='unknown') WRITE(umat_unit)naph, ndelve WRITE(umat_unit)(Etot-xksq3(i)/usys2,i=1,ndelve) WRITE(umat_unit)kchan WRITE(umat_unit)elect3 WRITE(umat_unit)mvib3 WRITE(umat_unit)jrot3 WRITE(umat_unit)lorb3 WRITE(umat_unit)umat CLOSE(Unit=umat_unit,status='keep') jtsav=jtot ipsav=parity rhosav=rho ! !deallocata storage for several matrix ! DEALLOCATE(chanl, nvib,jrot) !DEALLOCATE(wx,x,wy) !DEALLOCATE(thetd,xptg) !DEALLOCATE(sqci,a) ! RETURN ! ------------------------------------------------------------------ ! access the following only for parity error ! ------------------------------------------------------------------ 998 WRITE(Out_Unit,62)jtot,jr,lr,parity 62 FORMAT(/,'parity error. for jtot=',i3,' it tried jrot3=',i3, ' and lorb3=',i3,' with parity=',i3) STOP 'AphDel_Old' 999 WRITE(Out_Unit,61)jtot,parity 61 FORMAT(/,'parity error. for jtot=',i3,' it tried parity=',i3) STOP 'AphDel_Old' ENDSUBROUTINE AphDel_Old