1
0
mirror of https://github.com/TREX-CoE/irpjast.git synced 2024-12-25 13:53:59 +01:00
irpjast/orders.irp.f

142 lines
2.9 KiB
FortranFixed
Raw Normal View History

2020-11-17 21:35:52 +01:00
BEGIN_PROVIDER [integer, naord]
implicit none
BEGIN_DOC
! Expansion order for f_en
2020-11-26 16:12:33 +01:00
END_DOC
naord = 5
2020-11-17 21:35:52 +01:00
END_PROVIDER
BEGIN_PROVIDER [integer, nbord]
implicit none
BEGIN_DOC
! Expansion order for f_ee
2020-11-26 16:12:33 +01:00
END_DOC
nbord = 5
2020-11-17 21:35:52 +01:00
END_PROVIDER
BEGIN_PROVIDER [integer, ncord]
implicit none
BEGIN_DOC
! Expansion order for f_een
2020-11-26 16:12:33 +01:00
END_DOC
ncord = 5
2020-11-17 21:35:52 +01:00
END_PROVIDER
2021-01-25 00:16:09 +01:00
2020-12-08 13:08:23 +01:00
BEGIN_PROVIDER [integer, dim_cord_vect]
implicit none
BEGIN_DOC
! Recomputes the length of the unique C coefficients
END_DOC
integer :: k, p, l, lmax
dim_cord_vect = 0
do p = 2, ncord
2021-01-25 00:16:09 +01:00
do k = p - 1, 0, -1
if ( k /= 0 ) then
lmax = p - k
else
lmax = p - k - 2
end if
do l = lmax, 0, -1
if (iand(p - k - l, 1) == 1) cycle
dim_cord_vect = dim_cord_vect + 1
2020-12-08 13:08:23 +01:00
end do
end do
end do
2020-12-09 22:23:19 +01:00
2020-12-08 13:08:23 +01:00
END_PROVIDER
2021-01-25 00:16:09 +01:00
BEGIN_PROVIDER [ integer, lkpm_of_cindex, (4,dim_cord_vect) ]
implicit none
BEGIN_DOC
! Transform l,k,p into a consecutive index
END_DOC
integer :: p,k,l,lmax,m
integer :: kk
kk=0
do p = 2, ncord
do k = p - 1, 0, -1
if ( k /= 0 ) then
lmax = p - k
else
lmax = p - k - 2
end if
do l = lmax, 0, -1
if (iand(p - k - l, 1) == 1) cycle
m = (p - k - l) / 2
kk = kk+1
lkpm_of_cindex(1,kk) = l
lkpm_of_cindex(2,kk) = k
lkpm_of_cindex(3,kk) = p
lkpm_of_cindex(4,kk) = m
enddo
enddo
enddo
END_PROVIDER
2020-11-17 21:35:52 +01:00
2020-12-08 18:56:36 +01:00
BEGIN_PROVIDER [double precision, aord_vect, (naord + 1, typenuc)]
&BEGIN_PROVIDER [double precision, bord_vect, (nbord + 1)]
2020-12-08 13:08:23 +01:00
&BEGIN_PROVIDER [double precision, cord_vect, (dim_cord_vect, typenuc)]
2020-12-07 10:55:37 +01:00
implicit none
BEGIN_DOC
! Read Jastow coefficients from file
END_DOC
PROVIDE naord
PROVIDE nbord
PROVIDE ncord
character(len=*), parameter :: FILE_NAME = "jast_coeffs.txt"
integer :: i, fu, rc
2021-01-25 00:16:09 +01:00
2020-12-07 10:55:37 +01:00
open(action='read', file=FILE_NAME, iostat=rc, newunit=fu)
2021-01-25 00:16:09 +01:00
2020-12-07 10:55:37 +01:00
read(fu, *) aord_vect
read(fu, *) bord_vect
read(fu, *) cord_vect
2021-01-25 00:16:09 +01:00
2020-12-07 10:55:37 +01:00
close(fu)
2020-11-17 21:35:52 +01:00
END_PROVIDER
2020-12-10 14:16:39 +01:00
2021-01-25 00:16:09 +01:00
BEGIN_PROVIDER [ double precision, cord_vect_full, (dim_cord_vect, nnuc) ]
implicit none
BEGIN_DOC
! cord_vect for all atoms
END_DOC
integer :: a
do a=1,nnuc
cord_vect_full(1:dim_cord_vect,a) = cord_vect(1:dim_cord_vect,typenuc_arr(a))
enddo
END_PROVIDER
2020-12-10 14:16:39 +01:00
BEGIN_PROVIDER [ double precision, cord_vect_lkp, (0:ncord-1, 0:ncord-1, 2:ncord, typenuc) ]
implicit none
BEGIN_DOC
2020-12-14 13:40:47 +01:00
! Creates c-tensor with right order of the indexes p, k, l
2020-12-10 14:16:39 +01:00
END_DOC
2020-12-14 13:40:47 +01:00
integer :: alpha, l, k, p, lmax, cindex
2020-12-10 14:16:39 +01:00
2020-12-14 13:40:47 +01:00
cord_vect_lkp = 0.0d0
do alpha = 1, typenuc
2021-01-25 00:16:09 +01:00
cindex = 0
2020-12-10 14:16:39 +01:00
do p = 2, ncord
2020-12-14 13:40:47 +01:00
do k = p - 1, 0, -1
2020-12-10 14:16:39 +01:00
if ( k /= 0 ) then
lmax = p - k
else
lmax = p - k - 2
end if
do l = lmax, 0, -1
2020-12-14 13:40:47 +01:00
if (iand(p - k - l, 1) == 1) cycle
2020-12-10 14:16:39 +01:00
cindex = cindex + 1
2020-12-14 13:40:47 +01:00
cord_vect_lkp(l, k, p, alpha) = cord_vect(cindex, alpha)
2020-12-10 14:16:39 +01:00
end do
end do
end do
end do
END_PROVIDER