SUBROUTINE AphDel_New(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 USE AzBzCz_Module IMPLICIT NONE SAVE LOGICAL AphDel_All REAL(Kind=WP_Kind) rho INTEGER naph, ndelve, jrmax, nxdim, nydim, nidm, jrjtmax,indexdel 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) INTEGER id(9,mxelmnt),ngor(narran) 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), allocatable :: wx(:),x(:),wy(:) REAL(Kind=WP_Kind), allocatable :: thetd(:,:), xptg(:,:) REAL(Kind=WP_Kind) h1(9,npoint) INTEGER jx(npoint), jy(npoint), jc1(npoint), xnode(mxnode), idni(mxnode) REAL(Kind=WP_Kind),allocatable :: sqci(:), a(:) REAL(Kind=WP_Kind) upsil !, az(3), bz(3), cz(3) LOGICAL little,medium,full INTEGER tea, lam, karran INTEGER lamsave, jtsav,ipsav REAL(Kind=WP_Kind) rhosav INTEGER ithcll,ithsub 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) sumx,sumk,sum0,pi2,sq2i,rac,cnorm DATA ithcll/0/,ithsub/0/ DATA little/.false./,medium/.false./,full/.false./ CALL popt('AphDel_New ',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. ! ! ------------------------------------------------------------------ DATA lamsave/-1000/, rhosav/-1.0d0/,jtsav/-1/,ipsav/-1/ ! !allocata storage for several matrix ! ALLOCATE(chanl(mxbasis, 0:mxmega), nvib(mxbasis),jrot(mxbasis,0:mxmega)) WRITE(Out_Unit,*)'oliver size of chanl,nvib,jrot=',size(chanl),size(nvib),size(jrot) IF(.Not.Allocated(wx))ALLOCATE(wx(96),x(96),wy(96)) IF(.Not.Allocated(thetd))ALLOCATE(thetd(maxhermt,narran),xptg(mxglegn,narran)) WRITE(Out_Unit,*)'oliver size of thetd,xptg=',size(thetd),size(xptg) IF(.Not.Allocated(sqci))ALLOCATE(sqci(3),a(200)) ! WRITE(Out_Unit,555)rho 555 FORMAT(1h1,' aph to delves projection at rho=',f10.5) IF(rho==rhosav) go to 2 ! ------------------------------------------------------------------ ! start calculations done on the first pass only ! ------------------------------------------------------------------ IF(nstatebigtemp)THEN bigtemp=abs(umat(idel,iaph)) indexdel=idel ENDIF ENDDO edel=(Etot-xksq3(indexdel)/usys2)*autoev ejac=Energy3_Jacobi(indexdel)*autoev eaph=Energy3_APH(iaph)*autoev WRITE(Compare_APH_Jac_Unit,'(A5,i5,A5,i5,F10.7,6i5,i5,3es15.7,F7.2,A1)')' iaph=',iaph,' idel=',indexdel, bigtemp, & kchan(indexdel), elect3(indexdel), mvib3(indexdel), jrot3(indexdel), & lorb3(indexdel), mega3(indexdel), nuj3(indexdel), edel, eaph, ejac, abs((eaph-edel)/edel)*100d0,'%' ENDDO CLOSE(eaph_Unit) CLOSE(Compare_APH_Jac_Unit) ENDIF ! ------------------------------------------------------------------ ! test orthogonality of umat ! ------------------------------------------------------------------ ! the first direction tests the adequacy of the delves basis CALL delchk(naph,temp,ndelve,umat) IF(little)THEN WRITE(Out_Unit,'(1h1,"utranspose*u"/)') CALL mxoutl(temp,naph,naph,0,'aph ','aph ') ENDIF AphDel_All=.True. ! Controls the amount of output in APH_To_Delves.txt DO iaph=1,naph IF(abs(temp(iaph,iaph))>1.1)THEN WRITE(Out_Unit,7768)iaph,temp(iaph,iaph) ELSE IF(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(1h0,'***warning**** for iaph=',i5,' the delves basis is not adequate',5x,f10.5) 7765 FORMAT(1h0,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,64) 64 FORMAT(1h1,'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) ELSE IF(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(1x,'warning APH basis incomplete: idel=',i4,' channel=',i4,' mvib=',i4,' jrot=',i4,' lorb=',i4,f8.5) 8769 FORMAT(1x,'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_new') 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(1h0,'parity error. for jtot=',i3,' it tried jrot3=',i3, ' and lorb3=',i3,' with parity=',i3) STOP 'AphDel_New' 999 WRITE(Out_Unit,61)jtot,parity 61 FORMAT(1h0,'parity error. for jtot=',i3,' it tried parity=',i3) STOP 'AphDel_New' ENDSUBROUTINE AphDel_New