2020-03-31 12:39:26 +02:00
|
|
|
subroutine allocate_grid(nNuc,ZNuc,max_ang_mom,min_exponent,max_exponent, &
|
|
|
|
radial_precision,nAng,nGrid)
|
2020-03-25 10:39:45 +01:00
|
|
|
|
|
|
|
! Allocate quadrature grid with numgrid (Radovan Bast)
|
|
|
|
|
|
|
|
use numgrid
|
|
|
|
use, intrinsic :: iso_c_binding, only: c_ptr
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nNuc
|
|
|
|
double precision,intent(in) :: ZNuc(nNuc)
|
|
|
|
|
|
|
|
integer,intent(in) :: max_ang_mom(nNuc)
|
|
|
|
double precision,intent(in) :: min_exponent(nNuc,maxL+1)
|
|
|
|
double precision,intent(in) :: max_exponent(nNuc)
|
|
|
|
|
2020-03-25 11:25:48 +01:00
|
|
|
double precision :: radial_precision
|
|
|
|
integer,intent(in) :: nAng
|
|
|
|
|
2020-03-25 10:39:45 +01:00
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iNuc
|
|
|
|
|
|
|
|
integer :: min_num_angular_points
|
|
|
|
integer :: max_num_angular_points
|
|
|
|
|
|
|
|
type(c_ptr) :: context
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
integer,intent(out) :: nGrid
|
|
|
|
|
|
|
|
! Set useful variables
|
|
|
|
|
2020-03-25 11:25:48 +01:00
|
|
|
min_num_angular_points = nAng
|
|
|
|
max_num_angular_points = nAng
|
2020-03-25 10:39:45 +01:00
|
|
|
|
|
|
|
! Get total number of grid points
|
|
|
|
|
|
|
|
nGrid = 0
|
|
|
|
|
|
|
|
do iNuc=1,nNuc
|
|
|
|
|
2020-03-25 12:56:28 +01:00
|
|
|
context = numgrid_new_atom_grid(radial_precision,min_num_angular_points,max_num_angular_points, &
|
|
|
|
int(ZNuc(iNuc)),max_exponent(iNuc),max_ang_mom(iNuc), &
|
|
|
|
min_exponent(iNuc,1:max_ang_mom(iNuc)+1))
|
2020-03-25 10:39:45 +01:00
|
|
|
|
|
|
|
nGrid = nGrid + numgrid_get_num_grid_points(context)
|
|
|
|
|
|
|
|
call numgrid_free_atom_grid(context)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end subroutine allocate_grid
|