10
0
mirror of https://gitlab.com/scemama/eplf synced 2024-11-19 04:22:38 +01:00
eplf/nuclei.irp.f

100 lines
1.9 KiB
FortranFixed
Raw Normal View History

BEGIN_PROVIDER [ integer, nucl_num ]
implicit none
BEGIN_DOC
! Number of nuclei
END_DOC
!$OMP CRITICAL (qcio_critical)
call qcio_get_geometry_num_atom(nucl_num)
!$OMP END CRITICAL (qcio_critical)
assert (nucl_num > 0)
END_PROVIDER
BEGIN_PROVIDER [ real, nucl_charge, (nucl_num) ]
implicit none
BEGIN_DOC
! Nuclear charge
END_DOC
double precision,allocatable :: buffer(:)
allocate(buffer(nucl_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_geometry_charge(buffer)
!$OMP END CRITICAL (qcio_critical)
integer :: i
do i=1,nucl_num
nucl_charge(i) = buffer(i)
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ]
implicit none
BEGIN_DOC
! Nuclear coordinates
END_DOC
double precision, allocatable :: buffer(:,:)
allocate (buffer(3,nucl_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_geometry_coord(buffer)
!$OMP END CRITICAL (qcio_critical)
integer :: i,j
do i=1,3
do j=1,nucl_num
nucl_coord(j,i) = buffer(i,j)
enddo
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ real, nucl_dist_2, (nucl_num,nucl_num) ]
&BEGIN_PROVIDER [ real, nucl_dist_vec, (nucl_num,nucl_num,3) ]
implicit none
BEGIN_DOC
! nucl_dist_2 : Nucleus-nucleus distances squared
! nucl_dist_vec : Nucleus-nucleus distances vectors
END_DOC
integer :: ie1, ie2, l
do ie2 = 1,nucl_num
do ie1 = 1,nucl_num
nucl_dist_2(ie1,ie2) = 0.d0
enddo
enddo
do l=1,3
do ie2 = 1,nucl_num
do ie1 = 1,nucl_num
nucl_dist_vec(ie1,ie2,l) = nucl_coord(ie1,l) - nucl_coord(ie2,l)
enddo
do ie1 = 1,nucl_num
nucl_dist_2(ie1,ie2) = nucl_dist_2(ie1,ie2) &
+ nucl_dist_vec(ie1,ie2,l)*nucl_dist_vec(ie1,ie2,l)
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ real, nucl_dist, (nucl_num,nucl_num) ]
implicit none
BEGIN_DOC
! Nucleus-nucleus distances
END_DOC
integer :: ie1, ie2
do ie2 = 1,nucl_num
do ie1 = 1,nucl_num
nucl_dist(ie1,ie2) = sqrt(nucl_dist_2(ie1,ie2))
enddo
enddo
END_PROVIDER