|
板凳
楼主 |
发表于 2023-9-29 16:23:43
|
只看该作者
麻烦您忙看一下,子程序中还有几个子程序,我就是写的主程序调用一下,不知道问题出在哪里?
program main
implicit none
integer,parameter :: n = 200
real*8,parameter :: r = 5.d0,cost = 0
real*8,parameter :: zmin = 20.d0,zmax = 100.d0
real*8 ::z,v
integer :: i
do i=1,n
z=zmin + (zmax-zmin)*(i-1.d0)/(n-1.d0)
call potlr_li_li2(z,r,cost,v)
write(111,*)z,v
enddo
stop
end
subroutine potlr_li_li2(z,r,cost,v)
implicit none
real*8,intent(in) :: z,r,cost
real*8,intent(out) :: v
real*8 :: polli,ionli,polyli2,polzli2,ionli2,vdisp,vli2
real*8 :: fac
!polarizability of Li
polli=165.09246072d0
!ionization energy of Li
ionli=0.19809291d0
!excitation energy of Li2 (X --> A)
ionli2=0.06371177857d0
!perpendicular polarizability of Li2
call poly_li2(r,polyli2)
!parallel polarizability of Li2
call polz_li2(r,polzli2)
!dispersion energy
fac=0.5d0*ionli*ionli2*polli/(ionli+ionli2)/z**6
vdisp=-fac*(2.d0*polyli2+polzli2+(polzli2-polyli2)*(1.5d0*cost**2-0.5d0))
!diatom energy
call pot_li2(r,vli2)
!total long-range energy
v=vdisp+vli2-0.006661542414d0
return
end subroutine
subroutine pot_li2(r,v,idg,dv)
implicit none |
|