Skip to content

Commit

Permalink
writing pot file for npun=1
Browse files Browse the repository at this point in the history
  • Loading branch information
octavioroncero committed Nov 25, 2022
1 parent 69ed958 commit efbce11
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions SRC/mod_pot_01y2.f
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,17 @@ subroutine write_pot
include "mpif.h"
double precision :: vang(npun1,nangu),vangtot(npun1,nangu)
integer :: ifile,ie,je,jr2,ir1,ir2,iang,iang_proc,ir,nnn,ierr
double precision :: r1,r2
double precision :: r1,r2,ctet,angulo

ifile=10
do ie=1,nelec
do je=ie,nelec
if(idproc.eq.0)then
if(idproc.eq.0.and.npun1.gt.1)then
write(name,"('potr1r2.e',i1,'.'i1)")ie,je
open(ifile,file=name,status='unknown')
elseif(idproc.eq.0.and.npun1.eq.1)then
write(name,"('potr2gam.e',i1,'.'i1)")ie,je
open(ifile,file=name,status='unknown')
endif

do jr2=1,npun2
Expand Down Expand Up @@ -531,7 +534,7 @@ subroutine write_pot
call MPI_REDUCE(vang,vangtot,nnn,MPI_REAL8,MPI_SUM
& ,0,MPI_COMM_WORLD,ierr)

if(idproc.eq.0)then
if(idproc.eq.0.and.npun1.gt.1)then
do ir1=1,npun1,n1plot
r1=rmis1+dble(ir1-1)*ah1
! if(r1.le.absr1)then
Expand All @@ -545,9 +548,28 @@ subroutine write_pot
! endif
enddo

write(ifile,'()')
elseif(idproc.eq.0.and.npun1.eq.1)then
do ir1=1,npun1,n1plot
r1=rmis1+dble(ir1-1)*ah1
! if(r1.le.absr1)then
do iang=1,nangu
if(dabs(vangtot(ir1,iang)).lt.1.d-90)then
vangtot(ir1,iang)=0.d0
endif
enddo
do iang=1,nangu,nangplot
ctet=cgamma(iang)
angulo=dacos(ctet)*180.d0/pi
write(ifile,'(500(1x,e15.7))')r2,angulo
& ,(vangtot(ir1,iang))
enddo
! endif
enddo

write(ifile,'()')

endif ! idproc==0
endif ! idproc==0, npun1>1 or 1

! endif ! r2.le.r2abs
enddo ! ir2
Expand Down

0 comments on commit efbce11

Please sign in to comment.