9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-27 13:53:29 +01:00
qp2/src/cas_based_on_top/example.irp.f

44 lines
1.3 KiB
Fortran
Raw Normal View History

2020-04-07 11:42:29 +02:00
subroutine write_on_top_in_real_space
implicit none
BEGIN_DOC
! This routines is a simple example of how to plot the on-top pair density on a simple 1D grid
END_DOC
double precision :: zmax,dz,r(3),on_top_in_r,total_density,zcenter,dist
2021-04-08 20:37:17 +02:00
double precision :: core_dens, inact_dens,act_dens(2,1)
2020-04-07 11:42:29 +02:00
integer :: nz,i,istate
character*(128) :: output
integer :: i_unit_output,getUnitAndOpen
PROVIDE ezfio_filename
output=trim(ezfio_filename)//'.on_top'
2021-04-08 20:37:17 +02:00
print*,'output = ',trim(output)
2020-04-07 11:42:29 +02:00
i_unit_output = getUnitAndOpen(output,'w')
2021-04-08 20:37:17 +02:00
zmax = 5.0d0
2020-04-07 11:42:29 +02:00
print*,'nucl_coord(1,3) = ',nucl_coord(1,3)
print*,'nucl_coord(2,3) = ',nucl_coord(2,3)
dist = dabs(nucl_coord(1,3) - nucl_coord(2,3))
2021-04-08 20:37:17 +02:00
zmax += dist
2020-04-07 11:42:29 +02:00
zcenter = (nucl_coord(1,3) + nucl_coord(2,3))*0.5d0
print*,'zcenter = ',zcenter
print*,'zmax = ',zmax
nz = 1000
dz = zmax / dble(nz)
2021-04-08 20:37:17 +02:00
r(:) = 0.d0
r(3) = zcenter -zmax * 0.5d0
2020-04-07 11:42:29 +02:00
print*,'r(3) = ',r(3)
istate = 1
2021-04-08 20:37:17 +02:00
write(i_unit_output,*)" z, on-top(z), n(z) "
2020-04-07 11:42:29 +02:00
do i = 1, nz
call give_on_top_in_r_one_state(r,istate,on_top_in_r)
2021-04-08 20:37:17 +02:00
call give_cas_density_in_r(core_dens,inact_dens,act_dens,total_density,r)
2020-04-07 11:42:29 +02:00
write(i_unit_output,*)r(3),on_top_in_r,total_density
r(3) += dz
enddo
end