Skip to content

Commit

Permalink
iphoto=2 problem in grid bnd
Browse files Browse the repository at this point in the history
  • Loading branch information
octavioroncero committed Apr 23, 2024
1 parent 3604a01 commit b83dd1d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 18 deletions.
6 changes: 3 additions & 3 deletions SRC/AUXILIARy-CODES/distriwvp.f
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ program distriparawvp ! version v6 in progress

**>> Main Loop in energy

open(15,file='distriS2prod.elec',status='unknown')
open(15,file='distriS2prod.vib',status='unknown')
ifile=36
ivfile=15
iii=ifile
Expand Down Expand Up @@ -479,8 +479,8 @@ program distriparawvp ! version v6 in progress
S2no=S2no+S2pro(iv,j,ielec,iom)
vibprod(iv)=vibprod(iv)+S2pro(iv,j,ielec,iom)
rotprod(j)=rotprod(j)+S2pro(iv,j,ielec,iom)
vibrot(j)=vibrot(j)+rotprod(j)
enddo
vibrot(j)=vibrot(j)+rotprod(j)
enddo
endif
! write(iii,'(1000(1x,e15.7))') e/(conve1*8065.5d0)
! & ,(rotprod(j)*photonorm,j=j00,j1)
Expand Down
4 changes: 3 additions & 1 deletion SRC/main_potini.f
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ program potini

if(iphoto.gt.0.and.iphoto.le.2)then
call pot2 ! to initialize global indexes
call set_trans_dipole
if(iphoto.eq.1)then
call set_trans_dipole
endif
elseif(iphoto.eq.3)then
call pot2 ! to initialize global indexes
call set_coupling ! for electronic predissociation
Expand Down
3 changes: 2 additions & 1 deletion SRC/mod_baseYfunciones_01y2.f
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ subroutine radial_functions01_write
endif
if(idproc.eq.0)then
write(23,'(100(1x,e15.7))')r*convl
& ,((potmat(ie,je)/conve/ev2cm,ie=je,nelec),je=1,nelec) !,ielec
& , potmat(ielec,ielec)/conve/ev2cm
! & ,((potmat(ie,je)/conve/ev2cm,ie=je,nelec),je=1,nelec) !,ielec
endif
enddo
if(idproc.eq.0)close(23)
Expand Down
32 changes: 23 additions & 9 deletions SRC/mod_photoini_01y2.f
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,21 @@ subroutine dip_bnd

xnorm=0.d0
xnormOmgProc(:)=0.d0
xnormtot=0.d0
do i=1,ntotproc(idproc)
call indiproc(i,icanp,ielec,iom,iangp,ir,ir1,ir2)
xnorm=xnorm+rpaq0(i)*rpaq0(i)
xnormOmgProc(iom)=xnormOmgProc(iom)+rpaq0(i)*rpaq0(i)
enddo
write(6,*)' xnorm partial = ',xnorm
write(6,*)' dip_bnd: xnorm partial = ',xnorm,' in proc=',idproc
call MPI_BARRIER(MPI_COMM_WORLD, ierror)


call MPI_REDUCE(xnorm,xnormtot,1,MPI_REAL8,MPI_SUM
& ,0,MPI_COMM_WORLD,ierr)
call MPI_BCAST(xnormtot,1,MPI_REAL8,0,MPI_COMM_WORLD,ierr)

write(6,*)' dip_bnd: xnorm total = ',xnormtot,' renormalizing'
if(xnormtot.lt.1.d-15)then
write(6,*)' norm of initial wvp too low= ',xnormtot
call flush(6)
Expand Down Expand Up @@ -385,7 +389,7 @@ subroutine dip_bndgrid
integer :: ivX,it,it0,indt,iloop,nnn
real*8 :: rmis1bnd,rfin1bnd,rmis2bnd,rfin2bnd
real*8 :: ah1bnd,ah2bnd,x123,xnorm,xnormtot,y123,ssign
real*8 :: yyy,xxx,coef,coef2,xx,yy,xnormbnd
real*8 :: yyy,xxx,coef,coef2,xx,yy,xnormbnd,xnormbnd_tot
integer :: nr1bnd,nr2bnd,iommaxbnd,nelecmaxbnd,nangumin
& ,iomminbnd

Expand Down Expand Up @@ -523,26 +527,30 @@ subroutine dip_bndgrid
write(6,*)' building initial wave packet for iphoto= ',iphoto
call flush(6)

do i=1,ntotproc(idproc)
do i=1,ntotproc(idproc)
call indiproc(i,icanp,ielec,iom,iangp,ir,ir1,ir2)
iang=indangreal(iangp,idproc)
if(ir1.le.nr1bnd.and.ir2.le.nr2bnd
& .and.iang.le.nangubnd
& .and.ielec.le.nelecmaxbnd)then
& .and.iang.le.nangubnd)then
! & .and.ielec.le.nelecmax)then
! & .and.ielec.le.nelecmaxbnd)then
if(iphoto.eq.2)then

if(iom.le.iommaxbnd)then
xxx=bndvec(ir1,ir2,iang,iom,ielec)
rpaq0(i)=bndvec(ir1,ir2,iang,iom,ielec)
xnormbnd=xnormbnd+xxx*xxx
if(ielec.eq.ielecref)then
xxx=bndvec(ir1,ir2,iang,iom,1)
rpaq0(i)=rpaq0(i)+xxx
xnormbnd=xnormbnd+xxx*xxx
endif
endif
elseif(iphoto.eq.1)then
do iomini=0,iommaxbnd
iq=iom-iomini
if(iabs(iq).le.1)then
y123=dipol(ir,iang,ielec,iq)
x123=factresj(iomini,iq,iom)
xxx=bndvec(ir1,ir2,iang,iomini,ielec)
! xxx=bndvec(ir1,ir2,iang,iomini,ielec)
xxx=bndvec(ir1,ir2,iang,iomini,1)
rpaq0(i)=rpaq0(i)+xxx*y123*x123
xnormbnd=xnormbnd+xxx*xxx

Expand All @@ -559,7 +567,13 @@ subroutine dip_bndgrid
call MPI_BARRIER(MPI_COMM_WORLD, ierror)

write(6,*)' In dip_bndgrid norm bound state= ',xnormbnd
& ,' in proc= ',idproc
nnn=1
call MPI_REDUCE(xnormbnd,xnormbnd_tot,nnn,MPI_REAL8,MPI_SUM
& ,0,MPI_COMM_WORLD,ierr)
call MPI_BCAST(xnormbnd_tot,nnn,MPI_REAL8,0,MPI_COMM_WORLD,ierr)

write(6,*)'dip_bndgrid total norm bound state= ',xnormbnd_tot
deallocate(ielecbnd,iombnd
& ,ir1bnd,ir2bnd,iangbnd)
return
Expand Down
6 changes: 3 additions & 3 deletions SRC/mod_pot_01y2.f
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ subroutine write_pot
vangtot(ir1,iang)=0.d0
endif
enddo
write(ifile,'(500(1x,e15.7))')r1,r2
& ,(vangtot(ir1,iang),iang=1,nangu,nangplot)
write(ifile,'(500(1x,e20.12))')r1,r2
& ,(vangtot(ir1,iang)/conve1/ev2cm,iang=1,nangu,nangplot)
! endif
enddo

Expand All @@ -562,7 +562,7 @@ subroutine write_pot
ctet=cgamma(iang)
angulo=dacos(ctet)*180.d0/pi
write(ifile,'(500(1x,e15.7))')r2,angulo
& ,(vangtot(ir1,iang))
& ,(vangtot(ir1,iang)/conve1/ev2cm)
enddo
! endif
enddo
Expand Down
2 changes: 1 addition & 1 deletion SRC/photo/cheby-spectra.f
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ program chebyspectra
*energy grid in eV
* parameter(Emin=-5.d0,Emax=5.d0,ne=100000,xkgam=0.000005)

* kmax (maxinum number of Chebyshev iterations read
* kmax (maximum number of Chebyshev iterations read
* parameter(kmax=500000)
* dimension auto(0:kmax)

Expand Down

0 comments on commit b83dd1d

Please sign in to comment.