26 use,
intrinsic :: iso_fortran_env
74 integer,
parameter,
public :: &
79 integer,
public,
parameter :: &
86 integer,
public,
parameter :: &
87 PROJ_J_INDEPENDENT = 0, & !< Non-relativisitic or scalar-relativistic pseudopotentials
91 integer,
parameter,
public :: INVALID_L = 333
93 character(len=4),
parameter :: ps_name(PSEUDO_FORMAT_UPF1:PSEUDO_FORMAT_PSP8) = &
94 (/
"upf1",
"upf2",
"qso ",
"psml",
"psf ",
"cpi ",
"fhi ",
"hgh ",
"psp8"/)
99 integer :: projector_type
100 integer :: relativistic_treatment
103 character(len=10),
private :: label
105 integer,
private :: ispin
107 real(real64),
private :: z
108 real(real64) :: z_val
109 type(valconf_t) :: conf
111 type(logrid_t),
private :: g
113 type(spline_t),
allocatable :: ur(:, :)
114 logical,
allocatable :: bound(:, :)
121 logical :: no_vl = .false.
123 real(real64) :: projectors_sphere_threshold
130 real(real64) :: rc_max
133 integer :: projectors_per_l(5)
134 real(real64),
allocatable :: h(:,:,:), k(:, :, :)
135 real(real64),
allocatable :: qij(:, :, :)
136 integer :: radial_augmentation_lmax = -1
137 integer :: radial_augmentation_nprojectors = 0
138 logical :: radial_augmentation_has_angular_channels = .false.
139 type(spline_t),
allocatable :: radial_augmentation(:, :)
140 type(spline_t),
allocatable :: kb(:, :)
141 type(spline_t),
allocatable :: dkb(:, :)
144 integer :: paw_nwavefunctions = 0
145 integer :: paw_augmentation_lmax = -1
147 real(real64) :: paw_core_energy =
m_zero
148 real(real64) :: paw_cutoff_radius =
m_zero
149 logical :: paw_has_ae_core = .false.
150 integer,
allocatable :: paw_l(:)
152 type(
spline_t),
allocatable :: paw_phi_ps(:)
160 real(real64),
allocatable :: paw_occ(:)
161 real(real64),
allocatable :: paw_grid(:)
162 real(real64),
allocatable :: paw_rab(:)
163 real(real64),
allocatable :: paw_multipoles(:, :, :)
172 logical,
private :: has_long_range
173 logical,
private :: is_separated
178 real(real64) :: sigma_erf
180 logical,
private :: has_density
182 type(
spline_t),
allocatable :: density_der(:)
185 integer :: file_format
187 integer :: exchange_functional
188 integer :: correlation_functional
191 real(real64),
parameter ::
eps = 1.0e-8_real64
197 subroutine ps_init(ps, namespace, label, z, user_lmax, user_llocal, ispin, filename)
198 type(
ps_t),
intent(out) :: ps
200 character(len=10),
intent(in) :: label
201 integer,
intent(in) :: user_lmax
202 integer,
intent(in) :: user_llocal
203 integer,
intent(in) :: ispin
204 real(real64),
intent(in) :: z
205 character(len=*),
intent(in) :: filename
207 integer :: l, ii, ll, is, ierr
213 real(real64),
allocatable :: eigen(:, :)
246 call parse_variable(namespace,
'SpeciesProjectorSphereThreshold', 0.001_real64, ps%projectors_sphere_threshold)
257 call messages_write(
"Cannot determine the pseudopotential type for species '"//trim(label)//
"' from", &
265 ps%relativistic_treatment = proj_j_independent
267 ps%sigma_erf = 0.625_real64
269 ps%projectors_per_l = 0
271 select case (ps%file_format)
273 ps%has_density = .
true.
275 ps%has_density = .false.
278 select case (ps%file_format)
282 call ps_psf_init(ps_psf, ispin, filename, namespace)
289 ps%lmax = ps_psf%ps_grid%no_l_channels - 1
291 if (user_lmax /= invalid_l)
then
292 ps%lmax = min(ps%lmax, user_lmax)
293 if (user_lmax /= ps%lmax)
then
294 message(1) =
"lmax in Species block for " // trim(label) // &
295 " is larger than number available in pseudopotential."
300 ps%conf%p = ps_psf%ps_grid%no_l_channels
301 if (ps%lmax == 0) ps%llocal = 0
304 if (user_llocal == invalid_l)
then
307 ps%llocal = user_llocal
310 ps%projectors_per_l(1:ps%lmax+1) = 1
311 if (ps%llocal > -1) ps%projectors_per_l(ps%llocal+1) = 0
320 call ps_cpi_init(ps_cpi, trim(filename), namespace)
321 ps%conf%p = ps_cpi%ps_grid%no_l_channels
323 call ps_fhi_init(ps_fhi, trim(filename), namespace)
324 ps%conf%p = ps_fhi%ps_grid%no_l_channels
328 ps%conf%symbol = label(1:2)
337 ps%lmax = ps%conf%p - 1
339 if (user_lmax /= invalid_l)
then
340 ps%lmax = min(ps%lmax, user_lmax)
341 if (user_lmax /= ps%lmax)
then
342 message(1) =
"lmax in Species block for " // trim(label) // &
343 " is larger than number available in pseudopotential."
348 if (ps%lmax == 0) ps%llocal = 0
351 if (user_llocal == invalid_l)
then
354 ps%llocal = user_llocal
357 ps%projectors_per_l(1:ps%lmax+1) = 1
358 if (ps%llocal > -1) ps%projectors_per_l(ps%llocal+1) = 0
372 call hgh_init(ps_hgh, trim(filename), namespace)
376 ps%z_val = ps_hgh%z_val
379 ps%lmax = ps_hgh%l_max
380 ps%conf%symbol = label(1:2)
381 ps%sigma_erf = ps_hgh%rlocal
383 ps%projectors_per_l(1:ps%lmax+1) = 1
403 call ps_xml_init(ps_xml, namespace, trim(filename), ps%file_format, ierr)
413 if (.not.
parse_is_defined(namespace,
'SpeciesProjectorSphereThreshold'))
then
414 ps%projectors_sphere_threshold = 1.0e-4_real64
427 if (ps_xml%kleinman_bylander)
then
428 ps%conf%p = ps_xml%nwavefunctions
430 ps%conf%p = ps_xml%lmax + 1
433 do ll = 0, ps_xml%lmax
434 ps%conf%l(ll + 1) = ll
437 ps%kbc = ps_xml%nchannels
438 ps%lmax = ps_xml%lmax
440 ps%projectors_per_l = 0
441 do ll = 0, ps_xml%lmax
445 if (ps_xml%kleinman_bylander)
then
446 ps%llocal = ps_xml%llocal
450 if (ps_xml%llocal >= 0) ps%llocal = ps_xml%llocal
451 if (user_llocal /= invalid_l) ps%llocal = user_llocal
452 assert(ps%llocal >= 0)
453 assert(ps%llocal <= ps%lmax)
456 ps%g%nrval = ps_xml%grid_size
458 safe_allocate(ps%g%rofi(1:ps%g%nrval))
459 safe_allocate(ps%g%r2ofi(1:ps%g%nrval))
461 do ii = 1, ps%g%nrval
462 ps%g%rofi(ii) = ps_xml%grid(ii)
463 ps%g%r2ofi(ii) = ps_xml%grid(ii)**2
468 ps%local = (ps%lmax == 0 .and. ps%llocal == 0 ) .or. (ps%lmax == -1 .and. ps%llocal == -1)
471 safe_allocate(ps%kb (0:ps%lmax, 1:ps%kbc))
472 safe_allocate(ps%dkb (0:ps%lmax, 1:ps%kbc))
473 safe_allocate(ps%ur (1:ps%conf%p, 1:ps%ispin))
474 safe_allocate(ps%bound(1:ps%conf%p, 1:ps%ispin))
475 safe_allocate(ps%h (0:ps%lmax, 1:ps%kbc, 1:ps%kbc))
476 safe_allocate(ps%qij (0:ps%lmax, 1:ps%kbc, 1:ps%kbc))
477 safe_allocate(ps%density(1:ps%ispin))
478 safe_allocate(ps%density_der(1:ps%ispin))
489 safe_allocate(eigen(1:ps%conf%p, 1:ps%ispin))
493 select case (ps%file_format)
506 safe_allocate(ps%k (0:ps%lmax, 1:ps%kbc, 1:ps%kbc))
516 call spline_der(ps%density(is), ps%density_der(is), ps%projectors_sphere_threshold)
521 call spline_der(ps%core, ps%core_der, ps%projectors_sphere_threshold)
526 ps%has_long_range = .
true.
527 ps%is_separated = .false.
529 call ps_info(ps, filename, namespace)
531 safe_deallocate_a(eigen)
538 subroutine ps_info(ps, filename, namespace)
539 type(
ps_t),
intent(in) :: ps
540 character(len=*),
intent(in) :: filename
549 select case (ps%file_format)
550 case (pseudo_format_upf1)
558 case (pseudo_format_psp8)
580 select case (ps%pseudo_type)
594 select case (ps%file_format)
608 if (ps%llocal >= 0)
then
620 if (ps%llocal < 0)
then
650 type(
ps_t),
intent(inout) :: ps
652 real(real64),
allocatable :: vsr(:), vlr(:), nlr(:)
653 real(real64) :: r, exp_arg, max_val_vsr
658 assert(ps%g%nrval > 0)
660 safe_allocate(vsr(1:ps%g%nrval))
661 safe_allocate(vlr(1:ps%g%nrval))
662 safe_allocate(nlr(1:ps%g%nrval))
668 do ii = 1, ps%g%nrval
674 if(abs(vsr(ii)) < 1.0e-14_real64) vsr(ii) =
m_zero
675 max_val_vsr = max(max_val_vsr, abs(vsr(ii)))
677 exp_arg = -
m_half*r**2/ps%sigma_erf**2
686 call spline_fit(ps%g%nrval, ps%g%rofi, vlr, ps%vlr, ps%projectors_sphere_threshold)
689 call spline_fit(ps%g%nrval, ps%g%rofi, nlr, ps%nlr, ps%projectors_sphere_threshold)
694 call spline_fit(ps%g%nrval, ps%g%rofi, vsr, ps%vl, ps%projectors_sphere_threshold)
695 if (max_val_vsr < 1.0e-12_real64) ps%no_vl = .
true.
697 safe_deallocate_a(vsr)
698 safe_deallocate_a(vlr)
699 safe_deallocate_a(nlr)
701 ps%is_separated = .
true.
707 real(real64)
pure function long_range_potential(r, sigma, z_val) result(vlr)
708 real(real64),
intent(in) :: r, sigma, z_val
715 if(arg > 1e-3_real64)
then
716 vlr = -z_val * erf(arg) / r
724 type(
ps_t),
intent(inout) :: ps
732 if (l == ps%llocal) cycle
734 ps%rc_max = max(ps%rc_max, ps%kb(l, j)%x_threshold)
744 type(
ps_t),
intent(inout) :: ps
751 call spline_der(ps%kb(l, j), ps%dkb(l, j), ps%projectors_sphere_threshold)
761 type(
ps_t),
intent(inout) :: ps
762 integer,
intent(in) :: filter
763 real(real64),
intent(in) :: gmax
765 integer :: l, k, ispin
767 real(real64) :: alpha, beta_fs, rmax, rcut, gamma, beta_rs
770 call profiling_in(
"PS_FILTER")
779 if(.not. ps%no_vl)
then
780 rmax = ps%vl%x_threshold
782 call spline_filter_mask(ps%vl, max(0, ps%llocal), rmax, gmax, alpha, gamma, ps%projectors_sphere_threshold)
786 if (l == ps%llocal) cycle
788 call spline_filter_mask(ps%kb(l, k), l, ps%rc_max, gmax, alpha, gamma, ps%projectors_sphere_threshold)
793 rmax = ps%core%x_threshold
794 call spline_filter_mask(ps%core, 0, rmax, gmax, alpha, gamma, ps%projectors_sphere_threshold)
798 do ispin = 1, ps%ispin
799 if (abs(spline_integral(ps%density(ispin))) > 1.0e-12_real64)
then
800 rmax = ps%density(ispin)%x_threshold
801 call spline_filter_mask(ps%density(ispin), 0, rmax, gmax, alpha, gamma, ps%projectors_sphere_threshold)
802 call spline_force_pos(ps%density(ispin), ps%projectors_sphere_threshold)
805 if (abs(spline_integral(ps%density_der(ispin))) > 1.0e-12_real64)
then
806 rmax = ps%density_der(ispin)%x_threshold
807 call spline_filter_mask(ps%density_der(ispin), 0, rmax, gmax, alpha, gamma, ps%projectors_sphere_threshold)
814 beta_fs = 18.0_real64
819 call spline_filter_bessel(ps%vl, max(0, ps%llocal), gmax, alpha, beta_fs, rcut, beta_rs, ps%projectors_sphere_threshold)
821 if (l == ps%llocal) cycle
823 call spline_filter_bessel(ps%kb(l, k), l, gmax, alpha, beta_fs, rcut, beta_rs, ps%projectors_sphere_threshold)
828 call spline_filter_bessel(ps%core, 0, gmax, alpha, beta_fs, rcut, beta_rs, ps%projectors_sphere_threshold)
832 do ispin = 1, ps%ispin
833 call spline_filter_bessel(ps%density(ispin), 0, gmax, alpha, beta_fs, rcut, beta_rs, ps%projectors_sphere_threshold)
834 call spline_force_pos(ps%density(ispin), ps%projectors_sphere_threshold)
835 call spline_filter_bessel(ps%density_der(ispin), 0, gmax, alpha, beta_fs, rcut, beta_rs, ps%projectors_sphere_threshold)
841 call profiling_out(
"PS_FILTER")
847 type(
ps_t),
intent(inout) :: ps
848 real(real64),
contiguous,
intent(in) :: eigen(:,:)
851 real(real64) :: ur1, ur2
856 where(eigen > m_zero)
865 if (.not. ps%bound(i, is)) cycle
867 do ir = ps%g%nrval, 3, -1
869 if (abs(spline_eval(ps%ur(i, is), ps%g%rofi(ir))*ps%g%rofi(ir)) > m_zero)
then
877 ur1 = spline_eval(ps%ur(i, is), ps%g%rofi(ir-2))*ps%g%rofi(ir-2)
878 ur2 = spline_eval(ps%ur(i, is), ps%g%rofi(ir-1))*ps%g%rofi(ir-1)
879 if ((ur1*ur2 > m_zero) .and. (abs(ur2) > abs(ur1))) ps%bound(i, is) = .false.
891 subroutine ps_debug(ps, dir, namespace, gmax)
892 type(
ps_t),
intent(in) :: ps
893 character(len=*),
intent(in) :: dir
894 type(namespace_t),
intent(in) :: namespace
895 real(real64),
intent(in) :: gmax
898 type(spline_t),
allocatable :: fw(:, :)
906 iunit = io_open(trim(dir)//
'/pseudo-info', namespace, action=
'write')
907 write(iunit,
'(a,/)') ps%label
908 write(iunit,
'(a,a,/)')
'Format : ',
ps_name(ps%file_format)
909 write(iunit,
'(a,f6.3)')
'z : ', ps%z
910 write(iunit,
'(a,f6.3,/)')
'zval : ', ps%z_val
911 write(iunit,
'(a,i4)')
'lmax : ', ps%lmax
912 write(iunit,
'(a,i4)')
'lloc : ', ps%llocal
913 write(iunit,
'(a,i4,/)')
'kbc : ', ps%kbc
914 write(iunit,
'(a,f9.5,/)')
'rcmax : ', ps%rc_max
915 write(iunit,
'(a,/)')
'h matrix:'
918 write(iunit,
'(10f9.5)') (ps%h(l, k, j), j = 1, ps%kbc)
921 if (
allocated(ps%k))
then
922 write(iunit,
'(/,a,/)')
'k matrix:'
925 write(iunit,
'(10f9.5)') (ps%k(l, k, j), j = 1, ps%kbc)
930 write(iunit,
'(/,a)')
'orbitals:'
932 if (ps%ispin == 2)
then
933 write(iunit,
'(1x,a,i2,3x,a,i2,3x,a,f5.1,3x,a,l1,3x,a,f5.1,3x,a,f5.1)')
'n = ', ps%conf%n(j),
'l = ', ps%conf%l(j), &
934 'j = ', ps%conf%j(j),
'bound = ', all(ps%bound(j,:)), &
935 'occ(1) = ', ps%conf%occ(j, 1),
'occ(2) = ', ps%conf%occ(j, 2)
937 write(iunit,
'(1x,a,i2,3x,a,i2,3x,a,f5.1,3x,a,l1,3x,a,f5.1)')
'n = ', ps%conf%n(j),
'l = ', ps%conf%l(j), &
938 'j = ', ps%conf%j(j),
'bound = ', all(ps%bound(j,:)), &
939 'occ = ', ps%conf%occ(j, 1)
947 iunit = io_open(trim(dir)//
'/local', namespace, action=
'write')
948 call spline_print(ps%vl, iunit)
952 iunit = io_open(trim(dir)//
'/local_long_range', namespace, action=
'write')
953 call spline_print(ps%vlr, iunit)
957 iunit = io_open(trim(dir)//
'/local_long_range_density', namespace, action=
'write')
958 call spline_print(ps%nlr, iunit)
962 iunit = io_open(trim(dir)//
'/local_ft', namespace, action=
'write')
963 safe_allocate(fw(1, 1))
964 call spline_init(fw(1, 1))
965 call spline_3dft(ps%vl, fw(1, 1), ps%projectors_sphere_threshold, gmax = gmax)
966 call spline_print(fw(1, 1), iunit)
967 call spline_end(fw(1, 1))
968 safe_deallocate_a(fw)
972 iunit = io_open(trim(dir)//
'/nonlocal', namespace, action=
'write')
973 call spline_print(ps%kb, iunit)
976 iunit = io_open(trim(dir)//
'/nonlocal_derivative', namespace, action=
'write')
977 call spline_print(ps%dkb, iunit)
980 iunit = io_open(trim(dir)//
'/nonlocal_ft', namespace, action=
'write')
981 safe_allocate(fw(0:ps%lmax, 1:ps%kbc))
985 call spline_besselft(ps%kb(k, j), fw(k, j), k, threshold=ps%projectors_sphere_threshold, &
989 call spline_print(fw, iunit)
991 safe_deallocate_a(fw)
995 iunit = io_open(trim(dir)//
'/wavefunctions', namespace, action=
'write')
996 call spline_print(ps%ur, iunit)
1000 if (ps%has_density)
then
1001 iunit = io_open(trim(dir)//
'/density', namespace, action=
'write')
1002 call spline_print(ps%density, iunit)
1003 call io_close(iunit)
1005 iunit = io_open(trim(dir)//
'/density_derivative', namespace, action=
'write')
1006 call spline_print(ps%density_der, iunit)
1007 call io_close(iunit)
1012 iunit = io_open(trim(dir)//
'/nlcc', namespace, action=
'write')
1013 call spline_print(ps%core, iunit)
1014 call io_close(iunit)
1023 type(
ps_t),
intent(inout) :: ps
1025 if (.not.
allocated(ps%kb))
return
1029 if (ps%is_separated)
then
1030 call spline_end(ps%vlr)
1031 call spline_end(ps%nlr)
1034 call spline_end(ps%kb)
1035 call spline_end(ps%dkb)
1036 call spline_end(ps%ur)
1038 call spline_end(ps%vl)
1039 call spline_end(ps%core)
1040 call spline_end(ps%core_der)
1042 if (
allocated(ps%density))
call spline_end(ps%density)
1043 if (
allocated(ps%density_der))
call spline_end(ps%density_der)
1044 if (
allocated(ps%radial_augmentation))
call spline_end(ps%radial_augmentation)
1047 if (
allocated(ps%paw_phi_ae))
call spline_end(ps%paw_phi_ae)
1048 if (
allocated(ps%paw_phi_ps))
call spline_end(ps%paw_phi_ps)
1050 call spline_end(ps%paw_ae_vlocal)
1051 if (ps%paw_has_ae_core)
call spline_end(ps%paw_ae_core)
1054 call logrid_end(ps%g)
1056 safe_deallocate_a(ps%kb)
1057 safe_deallocate_a(ps%dkb)
1058 safe_deallocate_a(ps%ur)
1059 safe_deallocate_a(ps%bound)
1060 safe_deallocate_a(ps%h)
1061 safe_deallocate_a(ps%qij)
1062 safe_deallocate_a(ps%radial_augmentation)
1063 safe_deallocate_a(ps%k)
1064 safe_deallocate_a(ps%density)
1065 safe_deallocate_a(ps%density_der)
1066 safe_deallocate_a(ps%paw_l)
1067 safe_deallocate_a(ps%paw_phi_ae)
1068 safe_deallocate_a(ps%paw_phi_ps)
1069 safe_deallocate_a(ps%paw_occ)
1070 safe_deallocate_a(ps%paw_grid)
1071 safe_deallocate_a(ps%paw_rab)
1072 safe_deallocate_a(ps%paw_multipoles)
1080 type(
ps_t),
intent(inout) :: ps
1081 type(ps_hgh_t),
intent(inout) :: ps_hgh
1087 if (ps%lmax >= 0)
then
1088 ps%rc_max = maxval(ps_hgh%kbr(0:ps%lmax))
1092 ps%h(0:ps%lmax, 1:ps%kbc, 1:ps%kbc) = ps_hgh%h(0:ps%lmax, 1:ps%kbc, 1:ps%kbc)
1093 ps%k(0:ps%lmax, 1:ps%kbc, 1:ps%kbc) = ps_hgh%k(0:ps%lmax, 1:ps%kbc, 1:ps%kbc)
1104 integer :: l, is, j, ip
1105 real(real64),
allocatable :: hato(:), dens(:)
1109 safe_allocate(hato(1:ps_hgh%g%nrval))
1110 safe_allocate(dens(1:ps_hgh%g%nrval))
1113 do l = 0, ps_hgh%l_max
1115 hato(:) = ps_hgh%kb(:, l, j)
1117 call spline_fit(ps_hgh%g%nrval, ps_hgh%g%rofi, hato, ps%kb(l, j), &
1118 ps%projectors_sphere_threshold)
1124 call spline_fit(ps_hgh%g%nrval, ps_hgh%g%rofi, ps_hgh%vlocal, ps%vl, ps%projectors_sphere_threshold)
1131 hato(2:ps_hgh%g%nrval) = ps_hgh%rphi(2:ps_hgh%g%nrval, l)/ps_hgh%g%rofi(2:ps_hgh%g%nrval)
1134 do ip = 1, ps_hgh%g%nrval
1135 dens(ip) = dens(ip) + ps%conf%occ(l, is)*hato(ip)**2/(m_four*m_pi)
1138 call spline_fit(ps_hgh%g%nrval, ps_hgh%g%rofi, hato, ps%ur(l, is), ps%projectors_sphere_threshold)
1140 call spline_fit(ps_hgh%g%nrval, ps_hgh%g%rofi, dens, ps%density(is), ps%projectors_sphere_threshold)
1143 safe_deallocate_a(hato)
1144 safe_deallocate_a(dens)
1153 type(
ps_t),
intent(inout) :: ps
1154 type(ps_in_grid_t),
intent(in) :: ps_grid
1159 ps%z_val = ps_grid%zval
1161 ps%nlcc = ps_grid%core_corrections
1163 ps%h(0:ps%lmax, 1, 1) = ps_grid%dkbcos(1:ps%lmax+1)
1165 ps%rc_max = maxval(ps_grid%kb_radius(1:ps%lmax+1))
1171 ps%h(0:ps%lmax,:,:) = ps%h(0:ps%lmax,:,:) / m_two
1178 type(logrid_t),
intent(in) :: g
1180 real(real64),
allocatable :: hato(:), dens(:)
1181 integer :: is, l, ir, nrc, ip
1185 safe_allocate(hato(1:g%nrval))
1186 safe_allocate(dens(1:g%nrval))
1193 do l = 1, ps_grid%no_l_channels
1194 hato(2:) = ps_grid%rphi(2:, l, 1+is)/g%rofi(2:)
1195 hato(1) = first_point_extrapolate(g%rofi, hato)
1197 if(ps%conf%occ(l, is) > m_epsilon)
then
1199 dens(ip) = dens(ip) + ps%conf%occ(l, is)*hato(ip)**2/(m_four*m_pi)
1203 call spline_fit(g%nrval, g%rofi, hato, ps%ur(l, is), ps%projectors_sphere_threshold)
1206 call spline_fit(g%nrval, g%rofi, dens, ps%density(is), ps%projectors_sphere_threshold)
1212 nrc = logrid_index(g, ps_grid%kb_radius(l)) + 1
1213 hato(1:nrc) = ps_grid%KB(1:nrc, l)
1214 hato(nrc+1:g%nrval) = m_zero
1216 nrc = ps_grid%kb_nrval(l)
1217 if (nrc == 0) nrc = g%nrval
1218 call spline_fit(nrc, g%rofi, hato, ps%kb(l-1, 1), ps%projectors_sphere_threshold)
1223 hato(:) = ps_grid%vlocal(:)/m_two
1224 call spline_fit(g%nrval, g%rofi, hato, ps%vl, ps%projectors_sphere_threshold)
1226 if (ps_grid%core_corrections)
then
1228 hato(2:) = ps_grid%chcore(2:)/(m_four*m_pi*g%r2ofi(2:))
1230 do ir = g%nrval-1, 2, -1
1231 if (hato(ir) >
eps)
then
1237 hato(nrc:g%nrval) = m_zero
1238 hato(1) = first_point_extrapolate(g%rofi, hato)
1240 call spline_fit(g%nrval, g%rofi, hato, ps%core, ps%projectors_sphere_threshold)
1243 safe_deallocate_a(hato)
1244 safe_deallocate_a(dens)
1255 type(
ps_t),
intent(inout) :: ps
1256 type(ps_xml_t),
intent(in) :: ps_xml
1257 type(namespace_t),
intent(in) :: namespace
1259 integer :: ll, ip, is, ic, jc, ir, nrc, ii, jj, nproj
1260 real(real64) :: rr, kbcos, kbnorm, dnrm, avgv, volume_element
1261 real(real64),
allocatable :: kbprojector(:), wavefunction(:), nlcc_density(:), dens(:,:)
1262 integer,
allocatable :: cmap(:, :)
1263 integer,
allocatable :: bmap_us(:)
1264 integer :: ib_us, ic_us, jc_us
1265 real(real64),
allocatable :: matrix(:, :), eigenvalues(:)
1266 logical :: density_is_known
1267 real(real64),
parameter :: tol_diagonal=1.0e-10_real64
1272 if (pseudo_has_total_angular_momentum(ps_xml%pseudo))
then
1273 if (ps%file_format == pseudo_format_psp8)
then
1275 message(1) =
"SOC from PSP8 is not currently supported."
1276 message(2) =
"Only scalar relativistic effects will be considered."
1277 call messages_warning(2, namespace=namespace)
1283 ps%nlcc = ps_xml%nlcc
1285 ps%z_val = ps_xml%valence_charge
1287 ps%has_density = ps_xml%has_density
1292 call spline_fit(ps%g%nrval, ps%g%rofi, ps_xml%potential(:, ps%llocal), ps%vl, ps%projectors_sphere_threshold)
1294 safe_allocate(kbprojector(1:ps%g%nrval))
1295 safe_allocate(wavefunction(1:ps%g%nrval))
1297 kbprojector = m_zero
1298 wavefunction = m_zero
1300 density_is_known = .false.
1303 if (ps_xml%kleinman_bylander)
then
1305 safe_allocate(cmap(0:ps_xml%lmax, 1:ps_xml%nchannels))
1309 do ll = 0, ps_xml%lmax
1310 do ic = 1, ps_xml%nchannels
1314 if (ll == ps_xml%llocal) cycle
1316 if (ic > pseudo_nprojectors_per_l(ps_xml%pseudo, ll)) cycle
1321 assert(mod(ps_xml%nchannels, 2)==0)
1322 if (pseudo_projector_2j(ps_xml%pseudo, ll, ic) == 2*ll - 1)
then
1323 cmap(ll, ic) = int((ic-1)/2)*2 + 2
1325 assert(pseudo_projector_2j(ps_xml%pseudo, ll, ic) == 2*ll + 1)
1326 cmap(ll, ic) = int((ic-1)/2)*2 + 1
1332 assert(sum(cmap(ll, 1:ps_xml%nchannels)) == (ps_xml%nchannels + 1)*ps_xml%nchannels/2)
1335 assert(all(cmap >= 0 .and. cmap <= ps_xml%nchannels))
1346 do ll = 0, ps_xml%lmax
1347 do ic_us = 1, ps_xml%nchannels
1348 do jc_us = 1, ps_xml%nchannels
1349 ps%qij(ll, cmap(ll, ic_us), cmap(ll, jc_us)) = ps_xml%qij(ll, ic_us, jc_us)
1356 ps%radial_augmentation_lmax = ps_xml%radial_augmentation_lmax
1357 ps%radial_augmentation_has_angular_channels = ps_xml%radial_augmentation_has_angular_channels
1359 if (ps_xml%has_radial_augmentation)
then
1360 nproj = pseudo_nprojectors(ps_xml%pseudo)
1361 ps%radial_augmentation_nprojectors = nproj
1362 assert(ps%radial_augmentation_lmax >= 0)
1363 if (.not. ps%radial_augmentation_has_angular_channels)
then
1364 call messages_not_implemented(
"ultrasoft augmentation density without angular-resolved Q_ij^L functions")
1367 safe_allocate(ps%radial_augmentation(1:nproj*nproj, 0:ps%radial_augmentation_lmax))
1368 call spline_init(ps%radial_augmentation)
1372 safe_allocate(bmap_us(1:nproj))
1374 do ll = 0, ps_xml%lmax
1375 if (ll == ps_xml%llocal) cycle
1376 do ic_us = 1, pseudo_nprojectors_per_l(ps_xml%pseudo, ll)
1378 bmap_us(ib_us) = ib_us - ic_us + cmap(ll, ic_us)
1381 assert(ib_us == nproj)
1385 do ll = 0, ps%radial_augmentation_lmax
1386 call spline_fit(ps_xml%grid_size, ps%g%rofi, ps_xml%radial_augmentation(:, ii, jj, ll), &
1387 ps%radial_augmentation((bmap_us(ii) - 1)*nproj + bmap_us(jj), ll), ps%projectors_sphere_threshold)
1391 safe_deallocate_a(bmap_us)
1397 if (pseudo_nprojectors(ps_xml%pseudo) > 0)
then
1398 safe_allocate(matrix(1:ps_xml%nchannels, 1:ps_xml%nchannels))
1399 safe_allocate(eigenvalues(1:ps_xml%nchannels))
1401 do ll = 0, ps_xml%lmax
1404 do ic = 1, ps_xml%nchannels
1406 call spline_fit(ps_xml%kb_radius(ll, ic), ps%g%rofi, ps_xml%projector(:, ll, ic), &
1407 ps%kb(ll, cmap(ll, ic)), ps%projectors_sphere_threshold)
1408 do jc = 1, ps_xml%nchannels
1409 ps%h(ll, cmap(ll, ic), cmap(ll, jc)) = ps_xml%dij(ll, ic, jc)
1412 else if (is_diagonal(ps_xml%nchannels, ps_xml%dij(ll, :, :), tol_diagonal) .or. &
1413 pseudo_has_total_angular_momentum(ps_xml%pseudo))
then
1414 do ic = 1, ps_xml%nchannels
1416 call spline_fit(ps_xml%kb_radius(ll, ic), ps%g%rofi, ps_xml%projector(:, ll, ic), &
1417 ps%kb(ll, cmap(ll, ic)), ps%projectors_sphere_threshold)
1418 ps%h(ll, cmap(ll, ic), cmap(ll, ic)) = ps_xml%dij(ll, ic, ic)
1422 matrix(1:ps_xml%nchannels, 1:ps_xml%nchannels) = ps_xml%dij(ll, 1:ps_xml%nchannels, 1:ps_xml%nchannels)
1423 call lalg_eigensolve(ps_xml%nchannels, matrix, eigenvalues)
1425 do ic = 1, ps_xml%nchannels
1426 kbprojector = m_zero
1427 do jc = 1, ps_xml%nchannels
1428 call lalg_axpy(ps_xml%grid_size, matrix(jc, ic), ps_xml%projector(:, ll, jc), kbprojector)
1431 call spline_fit(maxval(ps_xml%kb_radius(ll, :)), ps%g%rofi, kbprojector, &
1432 ps%kb(ll, cmap(ll, ic)), ps%projectors_sphere_threshold)
1433 ps%h(ll, cmap(ll, ic), cmap(ll, ic)) = eigenvalues(ic)
1438 safe_deallocate_a(matrix)
1439 safe_deallocate_a(eigenvalues)
1442 ps%conf%p = ps_xml%nwavefunctions
1449 if ((.not.
ps_has_density(ps) .or. ps%ispin == 2) .and. ps_xml%nwavefunctions > 0)
then
1450 safe_allocate(dens(1:ps%g%nrval, 1:ps%ispin))
1454 do ii = 1, ps_xml%nwavefunctions
1456 ps%conf%n(ii) = ps_xml%wf_n(ii)
1457 ps%conf%l(ii) = ps_xml%wf_l(ii)
1459 if (ps%ispin == 2)
then
1460 ps%conf%occ(ii, 1) = min(ps_xml%wf_occ(ii), m_two*ps_xml%wf_l(ii) + m_one)
1461 ps%conf%occ(ii, 2) = ps_xml%wf_occ(ii) - ps%conf%occ(ii, 1)
1463 ps%conf%occ(ii, 1) = ps_xml%wf_occ(ii)
1466 ps%conf%j(ii) = m_zero
1467 if (pseudo_has_total_angular_momentum(ps_xml%pseudo))
then
1468 ps%conf%j(ii) = m_half*pseudo_wavefunction_2j(ps_xml%pseudo, ii)
1471 do ip = 1, ps%g%nrval
1472 if (ip <= ps_xml%grid_size)
then
1473 wavefunction(ip) = ps_xml%wavefunction(ip, ii)
1475 wavefunction(ip) = m_zero
1480 call spline_fit(ps%g%nrval, ps%g%rofi, wavefunction, ps%ur(ii, is), ps%projectors_sphere_threshold)
1485 do ip = 1, ps_xml%grid_size
1486 dens(ip, is) = dens(ip, is) + ps%conf%occ(ii, is)*wavefunction(ip)**2/(m_four*m_pi)
1494 if ((.not.
ps_has_density(ps) .or. ps%ispin == 2) .and. ps_xml%nwavefunctions > 0)
then
1496 call spline_fit(ps%g%nrval, ps%g%rofi, dens(:,is), ps%density(is), ps%projectors_sphere_threshold)
1498 safe_deallocate_a(dens)
1499 density_is_known = .
true.
1500 ps%has_density = .
true.
1503 safe_deallocate_a(cmap)
1508 ps%conf%occ = m_zero
1509 ps%conf%symbol = ps%label(1:2)
1513 call valconf_sort_by_l(ps%conf, ps_xml%lmax)
1516 if (abs(sum(ps%conf%occ) - ps%z_val ) < m_epsilon)
then
1517 safe_allocate(dens(1:ps%g%nrval, 1:ps%ispin))
1521 do ll = 0, ps_xml%lmax
1526 do ip = 1, ps_xml%grid_size
1527 rr = ps_xml%grid(ip)
1528 volume_element = rr**2*ps_xml%weights(ip)
1529 kbprojector(ip) = (ps_xml%potential(ip, ll) - ps_xml%potential(ip, ps%llocal))*ps_xml%wavefunction(ip, ll)
1530 dnrm = dnrm + kbprojector(ip)**2*volume_element
1531 avgv = avgv + kbprojector(ip)*ps_xml%wavefunction(ip, ll)*volume_element
1534 kbcos = dnrm/(safe_tol(avgv,1.0e-20_real64))
1535 kbnorm = m_one/(safe_tol(
sqrt(dnrm),1.0e-20_real64))
1537 if (ll /= ps%llocal)
then
1538 ps%h(ll, 1, 1) = kbcos
1539 kbprojector = kbprojector*kbnorm
1541 ps%h(ll, 1, 1) = m_zero
1544 call spline_fit(ps%g%nrval, ps%g%rofi, kbprojector, ps%kb(ll, 1), ps%projectors_sphere_threshold)
1547 call lalg_copy(ps_xml%grid_size, ps_xml%wavefunction(:, ll), wavefunction)
1548 wavefunction(ps_xml%grid_size+1:ps%g%nrval) = m_zero
1551 call spline_fit(ps%g%nrval, ps%g%rofi, wavefunction, ps%ur(ll + 1, is), ps%projectors_sphere_threshold)
1555 if (abs(sum(ps%conf%occ) - ps%z_val) < m_epsilon)
then
1557 do ip = 1, ps_xml%grid_size
1558 dens(ip, is) = dens(ip, is) + ps%conf%occ(ll+1, is)*wavefunction(ip)**2/(m_four*m_pi)
1565 if (abs(sum(ps%conf%occ) - ps%z_val) < m_epsilon)
then
1567 call spline_fit(ps%g%nrval, ps%g%rofi, dens(:,is), ps%density(is), ps%projectors_sphere_threshold)
1569 safe_deallocate_a(dens)
1570 density_is_known = .
true.
1571 ps%has_density = .
true.
1578 safe_allocate(dens(1:ps%g%nrval, 1))
1580 dens(1:ps_xml%grid_size, 1) = ps_xml%density(1:ps_xml%grid_size)/ps%ispin
1581 dens(ps_xml%grid_size + 1:ps%g%nrval, 1) = m_zero
1584 call spline_fit(ps%g%nrval, ps%g%rofi, dens(:, 1), ps%density(is), ps%projectors_sphere_threshold)
1587 safe_deallocate_a(dens)
1592 if (ps_xml%nlcc)
then
1594 safe_allocate(nlcc_density(1:ps%g%nrval))
1596 call lalg_copy(ps_xml%grid_size, ps_xml%nlcc_density, nlcc_density)
1599 do ir = ps_xml%grid_size - 1, 1, -1
1600 if (nlcc_density(ir) >
eps)
then
1606 nlcc_density(nrc:ps%g%nrval) = m_zero
1608 call spline_fit(ps%g%nrval, ps%g%rofi, nlcc_density, ps%core, ps%projectors_sphere_threshold)
1610 safe_deallocate_a(nlcc_density)
1615 if (ps_xml%is_paw)
then
1616 nproj = pseudo_nprojectors(ps_xml%pseudo)
1617 ps%paw_nwavefunctions = ps_xml%paw_nwavefunctions
1618 ps%paw_augmentation_lmax = ps_xml%paw_augmentation_lmax
1619 ps%paw_shape = ps_xml%paw_shape
1620 ps%paw_core_energy = ps_xml%paw_core_energy
1621 ps%paw_cutoff_radius = ps_xml%paw_cutoff_radius
1622 ps%paw_has_ae_core = ps_xml%paw_has_ae_core
1624 safe_allocate(ps%paw_l(1:nproj))
1625 ps%paw_l(1:nproj) = ps_xml%paw_l(1:nproj)
1627 safe_allocate(ps%paw_phi_ae(1:nproj))
1628 safe_allocate(ps%paw_phi_ps(1:nproj))
1629 call spline_init(ps%paw_phi_ae)
1630 call spline_init(ps%paw_phi_ps)
1632 call spline_fit(ps%g%nrval, ps%g%rofi, ps_xml%paw_phi_ae(:, ii), ps%paw_phi_ae(ii), &
1633 ps%projectors_sphere_threshold)
1634 call spline_fit(ps%g%nrval, ps%g%rofi, ps_xml%paw_phi_ps(:, ii), ps%paw_phi_ps(ii), &
1635 ps%projectors_sphere_threshold)
1638 call spline_init(ps%paw_ae_vlocal)
1639 call spline_fit(ps%g%nrval, ps%g%rofi, ps_xml%paw_ae_vlocal(:), ps%paw_ae_vlocal, &
1640 ps%projectors_sphere_threshold)
1642 if (ps%paw_has_ae_core)
then
1643 call spline_init(ps%paw_ae_core)
1644 call spline_fit(ps%g%nrval, ps%g%rofi, ps_xml%paw_ae_core(:), ps%paw_ae_core, &
1645 ps%projectors_sphere_threshold)
1648 safe_allocate(ps%paw_occ(1:nproj))
1649 ps%paw_occ(1:nproj) = ps_xml%paw_occ(1:nproj)
1651 safe_allocate(ps%paw_multipoles(1:nproj, 1:nproj, 0:ps%paw_augmentation_lmax))
1652 ps%paw_multipoles = ps_xml%paw_multipoles
1656 safe_allocate(ps%paw_grid(1:ps%g%nrval))
1657 safe_allocate(ps%paw_rab(1:ps%g%nrval))
1658 ps%paw_grid(1:ps%g%nrval) = ps%g%rofi(1:ps%g%nrval)
1659 ps%paw_rab(1:ps%g%nrval) = ps_xml%weights(1:ps%g%nrval)
1664 safe_deallocate_a(kbprojector)
1665 safe_deallocate_a(wavefunction)
1674 type(
ps_t),
intent(in) :: ps
1689 type(
ps_t),
intent(in) :: ps
1696 if (any(.not. ps%bound(i,:))) cycle
1705 type(
ps_t),
intent(in) :: ps
1707 has_density = ps%has_density
1713 pure logical function ps_has_nlcc(ps)
result(has_nlcc)
1714 type(
ps_t),
intent(in) :: ps
1722 type(
ps_t),
intent(in) :: ps
1724 is_ultrasoft = (ps%pseudo_type == pseudo_type_ultrasoft)
1729 pure logical function ps_is_paw(ps)
result(is_paw)
1730 type(
ps_t),
intent(in) :: ps
1732 is_paw = (ps%pseudo_type == pseudo_type_paw)
1738 type(
ps_t),
intent(in) :: ps
1740 requires_generalized_overlap =
ps_is_ultrasoft(ps) .or. (ps%pseudo_type == pseudo_type_paw)
1746 type(
ps_t),
intent(in) :: ps
1747 type(namespace_t),
intent(in) :: namespace
1749 integer :: ip, ispin
1751 real(real64),
allocatable ::vol(:)
1752 type(spline_t) :: volspl
1757 message(1) =
"The pseudopotential does not contain an atomic density"
1758 call messages_fatal(1, namespace=namespace)
1761 safe_allocate(vol(1:ps%g%nrval))
1763 do ip = 1, ps%g%nrval
1766 do ispin = 1, ps%ispin
1767 vol(ip) = vol(ip) + spline_eval(ps%density(ispin), rr)*m_four*m_pi*rr**5
1771 call spline_init(volspl)
1772 call spline_fit(ps%g%nrval, ps%g%rofi, vol, volspl, ps%projectors_sphere_threshold)
1773 volume = spline_integral(volspl)
1774 call spline_end(volspl)
1776 safe_deallocate_a(vol)
1785 type(namespace_t),
intent(in) :: namespace
1786 real(real64),
intent(in) :: zz
1787 real(real64),
intent(in) :: valcharge
1788 integer,
intent(in) :: ispin
1789 type(valconf_t),
intent(inout) :: conf
1801 write(message(1),
'(a,a,a)')
'Debug: Guessing the atomic occupations for ', trim(conf%symbol),
"."
1802 call messages_info(1, namespace=namespace, debug_only=.
true.)
1804 assert(valcharge <= zz)
1808 if(int(zz) > 2 .and. val > zz - 2)
then
1812 if(int(zz) > 4 .and. val > zz - 4)
then
1817 if(int(zz) > 18 .and. val > zz - 10)
then
1821 if(int(zz) > 12 .and. val > zz - 12)
then
1825 if(int(zz) > 18 .and. val > zz - 18)
then
1829 if(int(zz) > 28 .and. val > zz - 28)
then
1833 if(int(zz) > 30 .and. val > zz - 30)
then
1837 if(int(zz) > 36 .and. val > zz - 36)
then
1841 if(int(zz) > 46 .and. val > zz - 46)
then
1846 if((int(zz) > 48 .and. val > zz - 48) .or. &
1847 (int(zz) > 70 .and. int(zz) <= 81 .and. val > zz - 62))
then
1852 if((int(zz) > 54 .and. val > zz - 54) .or. &
1853 (int(zz) > 70 .and. int(zz) <= 81 .and. val > zz - 68) )
then
1858 if(int(zz) > 80 .and. val > zz - 68)
then
1864 select case (int(zz))
2181 if (val < m_epsilon)
then
2183 if (ispin == 2)
then
2184 call valconf_unpolarized_to_polarized(conf)
2188 message(1) =
"Error in attributing atomic occupations"
2189 call messages_warning(1, namespace=namespace)
2196 real(real64),
intent(inout) :: val
2197 integer,
intent(in) :: max_occ, nn
2200 conf%occ(conf%p,1) = min(val, real(max_occ, real64) )
2201 val = val - conf%occ(conf%p,1)
2207 real(real64),
intent(inout) :: val
2208 integer,
intent(in) :: max_occ, nn
2211 conf%occ(conf%p,1) = min(val, real(max_occ, real64) )
2212 val = val - conf%occ(conf%p,1)
2218 real(real64),
intent(inout) :: val
2219 integer,
intent(in) :: max_occ, nn
2222 conf%occ(conf%p,1) = min(val, real(max_occ, real64) )
2223 val = val - conf%occ(conf%p,1)
2229 real(real64),
intent(inout) :: val
2230 integer,
intent(in) :: max_occ, nn
2233 conf%occ(conf%p,1) = min(val, real(max_occ, real64) )
2234 val = val - conf%occ(conf%p,1)
2241#include "ps_pspio_inc.F90"
Some operations may be done for one spline-function, or for an array of them.
double exp(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
subroutine, public valconf_unpolarized_to_polarized(conf)
subroutine, public valconf_copy(cout, cin)
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
real(real64), parameter, public m_min_exp_arg
real(real64), parameter, public m_half
real(real64), parameter, public m_one
real(real64), parameter, public m_three
subroutine, public logrid_copy(grid_in, grid_out)
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public messages_obsolete_variable(namespace, name, rep)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
logical function, public parse_is_defined(namespace, name)
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
subroutine, public ps_cpi_end(ps_cpi)
subroutine, public ps_cpi_init(ps_cpi, filename, namespace)
subroutine, public ps_cpi_process(ps_cpi, lloc, namespace)
subroutine, public ps_fhi_end(ps_fhi)
subroutine, public ps_fhi_init(ps_fhi, filename, namespace)
subroutine, public ps_fhi_process(ps_fhi, lmax, lloc, namespace)
subroutine, public hgh_end(psp)
subroutine, public hgh_get_eigen(psp, eigen)
subroutine, public hgh_process(psp, namespace)
subroutine, public hgh_init(psp, filename, namespace)
pure logical function, public ps_requires_generalized_overlap(ps)
pure logical function, public ps_has_density(ps)
integer, parameter, public ps_filter_ts
subroutine, public ps_end(ps)
subroutine hgh_load(ps, ps_hgh)
subroutine, public ps_init(ps, namespace, label, z, user_lmax, user_llocal, ispin, filename)
subroutine ps_info(ps, filename, namespace)
subroutine, public ps_separate(ps)
Separate the local potential into (soft) long-ranged and (hard) short-ranged parts.
subroutine ps_check_bound(ps, eigen)
subroutine ps_grid_load(ps, ps_grid)
subroutine, public ps_debug(ps, dir, namespace, gmax)
real(real64) pure function, public long_range_potential(r, sigma, z_val)
Evaluate the long-range potential at a given distance.
integer, parameter, public proj_hgh
pure integer function, public ps_bound_niwfs(ps)
Returns the number of bound atomic orbitals taking into account then m quantum number multiplicity.
real(real64), parameter eps
Cutoff for determining the radius of the NLCC.
subroutine, public ps_getradius(ps)
subroutine, public ps_guess_atomic_occupations(namespace, zz, valcharge, ispin, conf)
This routines provides, given Z and the number of valence electron the occupations of the orbitals....
pure logical function, public ps_is_paw(ps)
pure logical function, public ps_has_nlcc(ps)
pure integer function, public ps_niwfs(ps)
Returns the number of atomic orbitals taking into account then m quantum number multiplicity.
subroutine, public ps_pspio_init(ps, namespace, label, z, lmax, ispin, filename)
integer, parameter, public ps_filter_none
integer, parameter, public proj_j_average
Fully-relativistic pseudopotentials with separate j-average and SOC terms.
integer, parameter, public proj_uspp
integer, parameter, public proj_rkb
integer, parameter, public proj_j_dependent
Fully-relativistic j-dependent pseudopotentials.
subroutine, public ps_derivatives(ps)
subroutine, public ps_filter(ps, filter, gmax)
pure logical function, public ps_is_ultrasoft(ps)
real(real64) function, public ps_density_volume(ps, namespace)
character(len=4), dimension(pseudo_format_upf1:pseudo_format_psp8), parameter ps_name
integer, parameter, public ps_filter_bsb
integer, parameter, public proj_kb
subroutine ps_xml_load(ps, ps_xml, namespace)
Loads XML files for QSO, UPF1, UPF2, PSML, and PSP8 formats.
subroutine, public ps_psf_init(pstm, ispin, filename, namespace)
subroutine, public ps_psf_process(ps_psf, namespace, lmax, lloc)
subroutine, public ps_psf_get_eigen(ps_psf, eigen)
subroutine, public ps_psf_end(ps_psf)
subroutine, public ps_xml_end(this)
subroutine, public ps_xml_init(this, namespace, filename, fmt, ierr)
integer, parameter, public pseudo_format_file_not_found
integer, parameter, public pseudo_type_kleinman_bylander
integer, parameter, public pseudo_format_qso
integer, parameter, public pseudo_format_hgh
integer, parameter, public pseudo_format_upf2
integer, parameter, public pseudo_type_paw
integer, parameter, public pseudo_format_cpi
integer, parameter, public pseudo_exchange_unknown
integer, parameter, public pseudo_type_semilocal
integer, parameter, public pseudo_type_ultrasoft
integer, parameter, public pseudo_correlation_unknown
integer, parameter, public pseudo_format_psf
integer, parameter, public pseudo_format_fhi
integer, parameter, public pseudo_format_unknown
integer, parameter, public pseudo_paw_shape_unknown
integer, parameter, public pseudo_format_psml
subroutine, public spline_der(spl, dspl, threshold)
subroutine, public spline_fit(nrc, rofi, ffit, spl, threshold)
real(real64) function, public spline_eval(spl, x)
character(kind=c_char, len=1) function, dimension(:), allocatable, public string_f_to_c(f_string)
convert a Fortran string to a C string
subroutine fill_s_orbs(val, max_occ, nn)
subroutine fill_p_orbs(val, max_occ, nn)
subroutine fill_d_orbs(val, max_occ, nn)
subroutine fill_f_orbs(val, max_occ, nn)
remember that the FHI format is basically the CPI format with a header
The following data type contains: (a) the pseudopotential parameters, as read from a *....
A type storing the information and data about a pseudopotential.
the basic spline datatype