36 USE ieee_arithmetic,
ONLY: ieee_is_finite
68 LOGICAL :: source_root_argument
70 CHARACTER(LEN=default_path_length) :: filename
72 REAL(kind=
dp) :: error(6)
78 CALL check_core_derivatives()
79 CALL check_projector_addition_theorem()
80 CALL check_atomic_potential()
81 CALL check_upf_units()
83 CALL check_basis_origin()
84 CALL check_basis_derivatives()
85 CALL check_radial_grid_endpoints()
86 CALL check_contracted_basis_reader()
87 CALL check_basis_optimization_export()
89 CALL check_uspp_partial_waves()
90 CALL check_paw_import()
93 ALLOCATE (pot%rho_nlcc(3))
95 pot%core_correction = .true.
96 pot%econf = [2, 4, 0, 0]
97 pot%pname =
"previous kind"
99 IF (
ALLOCATED(pot%rho_nlcc)) error stop
"UPF release leaked the core density"
100 IF (pot%core_correction) error stop
"UPF release retained core-correction metadata"
101 IF (any(pot%econf /= 0)) error stop
"UPF release retained the previous electron configuration"
102 IF (pot%pname /=
"") error stop
"UPF release retained the previous potential name"
105 ALLOCATE (sgp%a_nlcc(2), sgp%c_nlcc(2))
106 sgp%has_nlcc = .true.
108 sgp%is_nonlocal(2) = .true.
110 IF (
ASSOCIATED(sgp%a_nlcc) .OR.
ASSOCIATED(sgp%c_nlcc)) error stop
"SGP release leaked NLCC arrays"
111 IF (sgp%has_nlcc .OR. sgp%n_nlcc /= 0) error stop
"SGP release retained NLCC metadata"
112 IF (any(sgp%is_nonlocal)) error stop
"SGP release retained nonlocal channels"
117 DO i = 1, command_argument_count()
118 CALL get_command_argument(i, filename)
121 INQUIRE (file=trim(filename)//
"/tests/UNIT_TESTS", exist=source_root_argument)
122 IF (source_root_argument) cycle
125 IF (abs(sum(pot%econf) - pot%zion) > 1.e-10_dp) error stop
"UPF valence count mismatch"
126 IF (.NOT. all(ieee_is_finite(pot%vlocal))) error stop
"Non-finite UPF local potential"
127 IF (any(pot%r(2:) <= pot%r(:
SIZE(pot%r) - 1))) error stop
"UPF mesh is not increasing"
128 IF (any(pot%rab <= 0.0_dp)) error stop
"Non-positive UPF mesh weights"
129 IF (
ALLOCATED(pot%dion))
THEN
130 IF (.NOT. all(ieee_is_finite(pot%dion))) error stop
"Non-finite UPF projector coefficients"
131 IF (.NOT. all(ieee_is_finite(pot%beta))) error stop
"Non-finite UPF projectors"
132 IF (maxval(abs(pot%dion - transpose(pot%dion))) > 1.e-10_dp) error stop
"Non-Hermitian UPF D matrix"
135 IF (.NOT. all(ieee_is_finite(error))) error stop
"Non-finite UPF transformation errors"
136 IF (pot%core_correction)
THEN
137 IF (.NOT.
ASSOCIATED(sgp%a_nlcc)) error stop
"Missing transformed UPF core density"
138 IF (.NOT. all(ieee_is_finite(sgp%c_nlcc))) error stop
"Non-finite transformed UPF core density"
140 IF (io_unit > 0)
WRITE (io_unit,
'(A,1X,A,1X,6ES16.7)')
"UPF transformation:", trim(filename), error
153 CHARACTER(LEN=*),
PARAMETER :: fixture =
"uspp-augmentation-test.upf"
155 CHARACTER(LEN=256) :: reason
158 REAL(dp),
ALLOCATABLE :: kinetic(:)
163 IF (logger%para_env%is_source())
THEN
164 OPEN (newunit=unit, file=fixture, status=
'REPLACE', action=
'WRITE')
165 WRITE (unit,
'(A)') &
166 '<UPF version="2.0.1">', &
167 "<PP_HEADER generated='Generated using ""atomic""' element=""Pt"" pseudo_type=""USPP""", &
168 " is_ultrasoft='true' z_valence='16' mesh_size=""3"" number_of_proj=""2"" l_max=""1""", &
169 ' core_correction="true" with_metagga_info="true" />', &
170 '<PP_MESH mesh="3">', &
178 '<PP_NLCC>',
'1 0.5 0.1',
'</PP_NLCC>', &
179 '<PP_TAUMOD type="real" size="3" convention="hartree_per_volume">', &
180 '0.2 0.7 0.05',
'</PP_TAUMOD>', &
181 '<PP_TAUATOM type="real" size="3">',
'3 2 1',
'</PP_TAUATOM>', &
182 '<PP_LOCAL type="real" size="3">', &
186 '<PP_BETA.1 type="real" size="3" index="1" angular_momentum="0">', &
189 '<PP_BETA.2 type="real" size="3" index="2" angular_momentum="1">', &
195 '<PP_AUGMENTATION q_with_l="T" nqf="0" nqlc="3">', &
199 '<PP_QIJL.2.2.0 first_index="2" second_index="2" composite_index="3" angular_momentum="0">', &
201 '</PP_QIJL.2.2.0>', &
202 '<PP_QIJL.1.1.0 type="real" size="3" first_index="1" second_index="1"', &
203 ' composite_index="1" angular_momentum="0" is_null="false">', &
205 '</PP_QIJL.1.1.0>', &
206 '<PP_QIJL.1.2.1 first_index="1" second_index="2" composite_index="2" angular_momentum="1">', &
208 '</PP_QIJL.1.2.1>', &
209 '<PP_QIJL.2.2.2 first_index="2" second_index="2" composite_index="3"', &
210 ' angular_momentum="2" is_null="T" size="0"/>', &
211 '</PP_AUGMENTATION>', &
216 CALL logger%para_env%sync()
218 IF (pot%generated /=
'Generated using "atomic"') error stop
'Quoted UPF header value was changed'
219 IF (any(pot%econf(0:3) /= [1, 6, 9, 0])) error stop
'Wrong 62-electron core subtraction'
220 IF (any(shape(pot%qijl) /= [3, 3, 3]) .OR. lbound(pot%qijl, 3) /= 0) error stop
'Wrong augmentation shape'
221 IF (maxval(abs(pot%qij - reshape([2._dp, 0._dp, 0._dp, 3._dp], [2, 2]))) > 1.e-14_dp)
THEN
222 error stop
'PP_Q normalization changed'
224 IF (maxval(abs(pot%qijl(:, 1, 0) - [1._dp, 2._dp, 3._dp])) > 1.e-14_dp) error stop
'Wrong s-s augmentation'
225 IF (maxval(abs(pot%qijl(:, 2, 1) - [4._dp, -5._dp, 6._dp])) > 1.e-14_dp) error stop
'Wrong s-p augmentation'
226 IF (maxval(abs(pot%qijl(:, 3, 0) - [-3._dp, 4._dp, 5._dp])) > 1.e-14_dp) error stop
'Wrong p-p augmentation'
227 IF (any(pot%qijl(:, :, 2) /= 0._dp)) error stop
'Null augmentation was not zero initialized'
228 IF (maxval(abs(pot%beta(:, 2) - [4._dp, -1._dp, 2._dp])) > 1.e-14_dp) error stop
'USPP beta normalization changed'
229 IF (abs(pot%dion(2, 2) - 4._dp) > 1.e-14_dp) error stop
'USPP D is not in Hartree'
230 IF (.NOT. pot%with_metagga_info) error stop
'UPF meta-GGA header flag was not retained'
231 IF (any(pot%tau_atom /= [3._dp, 2._dp, 1._dp]) .OR. pot%tau_atom_convention /=
'')
THEN
232 error stop
'Raw UPF atomic tau was converted or assigned an unknown convention'
235 IF (.NOT. available .OR. any(kinetic /= [0.2_dp, 0.7_dp, 0.05_dp]))
THEN
236 error stop
'Explicit canonical UPF core tau was not preserved'
238 pot%tau_nlcc_convention =
''
240 IF (available) error stop
'Unlabelled core tau was accepted as canonical'
241 DEALLOCATE (pot%tau_nlcc)
243 IF (available) error stop
'NLCC charge was used to infer missing core tau'
244 pot%rho_nlcc = 0.0_dp
246 IF (.NOT. available .OR. any(kinetic /= 0.0_dp)) error stop
'Absent core tau was not exact zero'
247 ALLOCATE (pot%tau_nlcc(3), source=1.0_dp)
249 IF (available) error stop
'Nonzero core tau without NLCC charge was accepted'
251 IF (
ALLOCATED(pot%qij) .OR.
ALLOCATED(pot%qijl)) error stop
'Augmentation arrays were not released'
252 IF (
ALLOCATED(pot%tau_nlcc) .OR.
ALLOCATED(pot%tau_atom)) error stop
'UPF kinetic arrays were not released'
253 IF (pot%with_metagga_info .OR. pot%tau_nlcc_convention /=
'' .OR. pot%tau_atom_convention /=
'')
THEN
254 error stop
'UPF kinetic metadata was not reset'
256 CALL logger%para_env%sync()
257 IF (logger%para_env%is_source())
THEN
258 OPEN (newunit=unit, file=fixture, status=
'OLD')
259 CLOSE (unit, status=
'DELETE')
267 SUBROUTINE check_uspp_partial_waves()
268 CHARACTER(LEN=*),
PARAMETER :: fixture =
'uspp-partial-waves-test.upf'
270 CHARACTER(LEN=5) :: has_wfc
271 INTEGER :: unit, variant
278 IF (variant == 1) has_wfc =
'true'
279 IF (logger%para_env%is_source())
THEN
280 OPEN (newunit=unit, file=fixture, status=
'REPLACE', action=
'WRITE')
281 WRITE (unit,
'(A)') &
282 '<UPF version="2.0.1">', &
283 '<PP_HEADER element="H" pseudo_type="US" is_ultrasoft="true" is_paw="false"', &
284 ' has_wfc="'//trim(has_wfc)//
'" z_valence="1" mesh_size="3"', &
285 ' number_of_proj="2" number_of_wfc="1" l_max="1"/>', &
286 '<PP_MESH mesh="3">', &
287 '<PP_R>',
'0.5 1 1.5',
'</PP_R>', &
288 '<PP_RAB>',
'0.5 0.5 0.5',
'</PP_RAB>',
'</PP_MESH>', &
289 '<PP_LOCAL>',
'6 4 2',
'</PP_LOCAL>', &
291 '<PP_BETA.1 index="1" angular_momentum="0" size="3">',
'1 4 9',
'</PP_BETA.1>', &
292 '<PP_BETA.2 index="2" angular_momentum="1" size="3">',
'2 -1 3',
'</PP_BETA.2>', &
293 '<PP_DIJ>',
'2 0 0 8',
'</PP_DIJ>', &
294 '<PP_AUGMENTATION q_with_l="T" nqf="0" nqlc="3">', &
295 '<PP_Q>',
'2 0 0 3',
'</PP_Q>', &
296 '<PP_QIJL.1.1.0 first_index="1" second_index="1" composite_index="1" angular_momentum="0">', &
297 '1 2 3',
'</PP_QIJL.1.1.0>', &
298 '<PP_QIJL.1.2.1 first_index="1" second_index="2" composite_index="2" angular_momentum="1">', &
299 '4 -5 6',
'</PP_QIJL.1.2.1>', &
300 '<PP_QIJL.2.2.0 first_index="2" second_index="2" composite_index="3" angular_momentum="0">', &
301 '-3 4 5',
'</PP_QIJL.2.2.0>', &
302 '<PP_QIJL.2.2.2 first_index="2" second_index="2" composite_index="3" angular_momentum="2">', &
303 '0 0 0',
'</PP_QIJL.2.2.2>',
'</PP_AUGMENTATION>',
'</PP_NONLOCAL>', &
304 '<PP_PSWFC>',
'<PP_CHI.1 l="0">',
'999 999 999',
'</PP_CHI.1>',
'</PP_PSWFC>'
305 IF (variant == 1)
THEN
307 WRITE (unit,
'(A)') &
308 '<PP_FULL_WFC number_of_wfc="2">', &
309 '<PP_PSWFC.2 type="real" size="3" l="1">',
'2 3 -4',
'</PP_PSWFC.2>', &
310 '<PP_AEWFC.1 index="1" l="0">',
'-3 5 -7',
'</PP_AEWFC.1>', &
311 '<PP_AEWFC.2 index="2" l="1">',
'5 -7 9',
'</PP_AEWFC.2>', &
312 '<PP_PSWFC.1 l="0">',
'1 -2 3',
'</PP_PSWFC.1>',
'</PP_FULL_WFC>'
314 WRITE (unit,
'(A)')
'</UPF>'
317 CALL logger%para_env%sync()
318 IF (variant == 1)
THEN
320 IF (
ALLOCATED(potential%partial_waves)) error stop
'USPP full waves imported without augmentation request'
323 CALL atom_read_upf(potential, fixture, read_augmentation=.true.)
324 IF (potential%is_paw) error stop
'USPP full waves were classified as PAW'
325 IF (variant == 1)
THEN
326 IF (.NOT.
ALLOCATED(potential%partial_waves)) error stop
'Missing optional USPP full waves'
327 associate(waves => potential%partial_waves)
328 IF (any(shape(waves%ae_wfc) /= [3, 2])) error stop
'USPP full-wave count differs from beta count'
329 IF (any(waves%ae_wfc /= reshape([-3._dp, 5._dp, -7._dp, 5._dp, -7._dp, 9._dp], [3, 2])))
THEN
330 error stop
'USPP AE full-wave order or original normalization changed'
332 IF (any(waves%ps_wfc /= reshape([1._dp, -2._dp, 3._dp, 2._dp, 3._dp, -4._dp], [3, 2])))
THEN
333 error stop
'USPP PS full waves changed or were confused with atomic guesses'
335 IF (any(waves%angular_momenta /= [0, 1])) error stop
'Wrong USPP full-wave angular momenta'
338 DEALLOCATE (potential%partial_waves%ps_wfc)
342 IF (
ALLOCATED(potential%partial_waves)) error stop
'USPP without full waves allocated partial-wave data'
345 IF (
ALLOCATED(potential%partial_waves)) error stop
'USPP full-wave data not released'
346 CALL logger%para_env%sync()
348 IF (logger%para_env%is_source())
THEN
349 OPEN (newunit=unit, file=fixture, status=
'OLD')
350 CLOSE (unit, status=
'DELETE')
352 END SUBROUTINE check_uspp_partial_waves
357 SUBROUTINE check_paw_import()
358 CHARACTER(LEN=*),
PARAMETER :: fixture =
'paw-import-test.upf'
361 TYPE(atom_upfpot_type) :: pot
362 TYPE(cp_logger_type),
POINTER :: logger
364 logger => cp_get_default_logger()
365 IF (logger%para_env%is_source())
THEN
366 OPEN (newunit=unit, file=fixture, status=
'REPLACE', action=
'WRITE')
367 WRITE (unit,
'(A)') &
368 '<UPF version="2.0.1">', &
369 '<PP_HEADER element="Li" pseudo_type="PAW" is_ultrasoft="true" is_paw="true"', &
370 ' z_valence="1" mesh_size="3" number_of_proj="1" l_max="0"/>', &
371 '<PP_MESH mesh="3">',
'<PP_R>',
'0.5 1 1.5',
'</PP_R>', &
372 '<PP_RAB>',
'0.5 0.5 0.5',
'</PP_RAB>',
'</PP_MESH>', &
373 '<PP_LOCAL>',
'-6 -4 -2',
'</PP_LOCAL>',
'<PP_NONLOCAL>', &
374 '<PP_BETA.1 index="1" angular_momentum="0" size="3">',
'1 2 3',
'</PP_BETA.1>', &
375 '<PP_DIJ>',
'2',
'</PP_DIJ>', &
376 '<PP_AUGMENTATION q_with_l="T" nqf="0" nqlc="1" cutoff_r_index="2" l_max_aug="0">', &
377 '<PP_Q>',
'0.25',
'</PP_Q>',
'<PP_MULTIPOLES>',
'0.125',
'</PP_MULTIPOLES>', &
378 '<PP_QIJL.1.1.0 first_index="1" second_index="1" composite_index="1" angular_momentum="0">', &
379 '1 2 0',
'</PP_QIJL.1.1.0>',
'</PP_AUGMENTATION>',
'</PP_NONLOCAL>', &
380 '<PP_FULL_WFC number_of_wfc="1">', &
381 '<PP_AEWFC.1 l="0">',
'-2 3 4',
'</PP_AEWFC.1>', &
382 '<PP_PSWFC.1 l="0">',
'1 3 4',
'</PP_PSWFC.1>',
'</PP_FULL_WFC>', &
383 '<PP_PAW paw_data_format="2" core_energy="-8">', &
384 '<PP_OCCUPATIONS>',
'1',
'</PP_OCCUPATIONS>', &
385 '<PP_AE_NLCC>',
'2 1 0',
'</PP_AE_NLCC>', &
386 '<PP_AE_VLOC>',
'-10 -6 -2',
'</PP_AE_VLOC>',
'</PP_PAW>', &
387 '<PP_GIPAW gipaw_data_format="2">',
'<PP_GIPAW_CORE_ORBITALS number_of_core_orbitals="1">', &
388 '<PP_GIPAW_CORE_ORBITAL.1 index="1" n="1.0" l="0.0">', &
389 '3 -2 1',
'</PP_GIPAW_CORE_ORBITAL.1>',
'</PP_GIPAW_CORE_ORBITALS>',
'</PP_GIPAW>',
'</UPF>'
392 CALL logger%para_env%sync()
393 CALL atom_read_upf(pot, fixture, read_header=.true.)
394 IF (.NOT. pot%is_paw .OR.
ALLOCATED(pot%paw)) error stop
'Wrong PAW header-only import'
395 CALL atom_release_upf(pot)
396 CALL atom_read_upf(pot, fixture, read_paw=.true.)
397 IF (.NOT. upf_has_complete_partial_waves(pot)) error stop
'Missing complete PAW waves'
398 associate(paw => pot%paw)
399 IF (any(paw%ae_wfc(:, 1) /= [-2._dp, 3._dp, 4._dp]) .OR. &
400 any(paw%ps_wfc(:, 1) /= [1._dp, 3._dp, 4._dp])) error stop
'Changed PAW wave normalization'
401 IF (paw%cutoff_index /= 2 .OR. paw%multipoles(1, 1, 0) /= 0.125_dp .OR. &
402 any(pot%qijl(:, 1, 0) /= [1._dp, 2._dp, 0._dp])) error stop
'Changed PAW augmentation'
403 IF (.NOT. paw%has_core_energy .OR. paw%core_energy /= -4._dp .OR. &
404 any(paw%vlocal /= [-5._dp, -3._dp, -1._dp])) error stop
'Wrong PAW energy units'
405 IF (any(paw%rho_core /= [2._dp, 1._dp, 0._dp]) .OR. &
406 any(paw%occupations /= 1._dp)) error stop
'Changed PAW core charge or occupations'
407 IF (.NOT.
ALLOCATED(paw%gipaw_core_orbitals)) error stop
'Missing GIPAW core orbitals'
408 associate(orbitals => paw%gipaw_core_orbitals)
409 IF (any(orbitals%principal_quantum_numbers /= 1) .OR. any(orbitals%angular_momenta /= 0) .OR. &
410 any(orbitals%wfc(:, 1) /= [3._dp, -2._dp, 1._dp])) error stop
'Changed GIPAW core orbital'
413 CALL atom_release_upf(pot)
414 IF (
ALLOCATED(pot%paw) .OR. pot%is_paw) error stop
'PAW data were not reset on release'
415 CALL logger%para_env%sync()
416 IF (logger%para_env%is_source())
THEN
417 OPEN (newunit=unit, file=fixture, status=
'OLD')
418 CLOSE (unit, status=
'DELETE')
420 END SUBROUTINE check_paw_import
425 SUBROUTINE check_radial_grid_endpoints()
426 INTEGER,
PARAMETER :: n = 6400, types(2) = [do_gapw_gct, do_gapw_log]
427 REAL(dp),
PARAMETER :: inner(2) = [4.83458313724687745e-18_dp, 6.97482911687147684e-18_dp], &
428 outer(2) = [2.06843066219244770e17_dp, 57.5213142095328827_dp]
432 TYPE(grid_atom_type),
POINTER :: grid
435 DO i = 1,
SIZE(types)
436 CALL allocate_grid_atom(grid)
437 CALL create_grid_atom(grid, n, 1, 2, 0, types(i))
438 IF (.NOT. all(ieee_is_finite(grid%rad)) .OR. .NOT. all(ieee_is_finite(grid%wr)))
THEN
439 error stop
'Nonfinite radial grid'
441 IF (any(grid%rad <= 0.0_dp) .OR. any(grid%wr <= 0.0_dp)) error stop
'Nonpositive radial grid'
442 IF (any(grid%rad(:n - 1) <= grid%rad(2:))) error stop
'Unordered radial points'
444 error = abs(sum(grid%wr*exp(-grid%rad)) - 2.0_dp)
445 error = max(error, abs(sum(grid%wr*exp(-grid%rad)/grid%rad) - 1.0_dp))
446 error = max(error, abs(sum(grid%wr*exp(-grid%rad2)) - sqrt(pi)/4.0_dp))
447 IF (error > 1.e-10_dp) error stop
'Radial moment error'
449 IF (abs(grid%rad(n)/inner(i) - 1.0_dp) > 1.e-13_dp .OR. &
450 abs(grid%rad(1)/outer(i) - 1.0_dp) > 1.e-13_dp) error stop
'Radial grid endpoint error'
451 CALL deallocate_grid_atom(grid)
453 END SUBROUTINE check_radial_grid_endpoints
458 SUBROUTINE check_basis_origin()
459 INTEGER :: i, l, n, variant
460 REAL(KIND=dp) :: expected(3), r(6001), rab(6001), scale
461 TYPE(atom_basis_type) :: basis, radial
463 CALL init_atom_basis_default_pp(basis)
464 n = maxval(basis%nbas)
466 r = [(0.002_dp*real(i - 1, dp), i=1,
SIZE(r))]
468 CALL atom_basis_gridrep(basis, radial, r, rab)
469 IF (any(radial%grid%rad /= r) .OR. any(radial%grid%wr /= rab*r**2))
THEN
470 error stop
"Supplied UPF mesh changed during basis evaluation"
472 IF (maxval(abs(radial%bf(:, 1, 0) - exp(-basis%am(1, 0)*r**2))) > 1.e-14_dp)
THEN
473 error stop
"Incorrect basis values on long UPF mesh"
475 CALL release_atom_basis(radial)
477 scale = real(variant, dp)
478 IF (variant == 2)
THEN
479 basis%basis_type = cgto_basis
480 ALLOCATE (basis%cm(n, n, 0:ubound(basis%am, 2)))
483 basis%cm(i, i, :) = scale
486 CALL atom_basis_gridrep(basis, radial, [0.0_dp, 1.e-16_dp, 0.1_dp], [0.1_dp, 0.1_dp, 0.1_dp])
487 IF (.NOT. all(ieee_is_finite(radial%bf)) .OR. .NOT. all(ieee_is_finite(radial%dbf)) .OR. &
488 .NOT. all(ieee_is_finite(radial%ddbf))) error stop
"Nonfinite Gaussian derivatives at the UPF origin"
489 DO l = 0, ubound(basis%am, 2)
490 DO i = 1, basis%nbas(l)
492 IF (l == 0) expected = [1.0_dp, 0.0_dp, -2.0_dp*basis%am(i, l)]
493 IF (l == 1) expected(2) = 1.0_dp
494 IF (l == 2) expected(3) = 2.0_dp
495 IF (maxval(abs([radial%bf(1, i, l), radial%dbf(1, i, l), radial%ddbf(1, i, l)] - &
496 scale*expected)) > 1.e-12_dp) error stop
"Incorrect Gaussian origin limit"
499 CALL release_atom_basis(radial)
501 CALL release_atom_basis(basis)
502 END SUBROUTINE check_basis_origin
507 SUBROUTINE check_basis_derivatives()
508 REAL(dp),
PARAMETER :: radius(4) = [0.08_dp, 0.3_dp, 0.9_dp, 2.1_dp], step = 2.e-4_dp
510 INTEGER :: i, k, l, n, variant
511 REAL(dp) :: derivative(5), errors(3), first, lap(5), &
512 r(5), reference, rho(5), second
513 REAL(dp),
ALLOCATABLE :: pmat(:, :, :)
514 TYPE(atom_basis_type) :: basis, radial
516 CALL init_atom_basis_default_pp(basis)
517 n = maxval(basis%nbas)
521 basis%am(1, :) = 0.37_dp
522 basis%am(2, :) = 2.3_dp
523 ALLOCATE (pmat(n, n, 0:ubound(basis%am, 2)))
525 pmat(1, 1, :) = 0.8_dp
526 pmat(2, 2, :) = 0.4_dp
527 pmat(1, 2, :) = -0.17_dp
528 pmat(2, 1, :) = -0.17_dp
531 IF (variant == 2)
THEN
532 basis%basis_type = cgto_basis
533 ALLOCATE (basis%cm(n, n, 0:ubound(basis%am, 2)))
535 basis%cm(1, 1, :) = 0.7_dp
536 basis%cm(2, 1, :) = -0.2_dp
537 basis%cm(1, 2, :) = 0.1_dp
538 basis%cm(2, 2, :) = 1.3_dp
540 DO k = 1,
SIZE(radius)
541 r = radius(k) + step*[-2.0_dp, -1.0_dp, 0.0_dp, 1.0_dp, 2.0_dp]
542 CALL atom_basis_gridrep(basis, radial, r, spread(step, 1, 5))
543 DO l = 0, ubound(basis%am, 2)
545 first = dot_product(radial%bf(:, i, l), [1.0_dp, -8.0_dp, 0.0_dp, 8.0_dp, -1.0_dp])/(12*step)
546 second = dot_product(radial%bf(:, i, l), [-1.0_dp, 16.0_dp, -30.0_dp, 16.0_dp, -1.0_dp])/(12*step**2)
547 errors(1) = max(errors(1), abs(first - radial%dbf(3, i, l))/(1 + abs(first)))
548 errors(2) = max(errors(2), abs(second - radial%ddbf(3, i, l))/(1 + abs(second)))
551 CALL atom_density(rho, pmat, radial, ubound(basis%am, 2), typ=
"RHO")
552 CALL atom_density(derivative, pmat, radial, ubound(basis%am, 2), typ=
"DER")
553 CALL atom_density(lap, pmat, radial, ubound(basis%am, 2), typ=
"LAP", rr=r*r)
554 first = dot_product(rho, [1.0_dp, -8.0_dp, 0.0_dp, 8.0_dp, -1.0_dp])/(12*step)
555 second = dot_product(rho, [-1.0_dp, 16.0_dp, -30.0_dp, 16.0_dp, -1.0_dp])/(12*step**2)
556 errors(1) = max(errors(1), abs(first - derivative(3))/(1 + abs(first)))
557 reference = second + 2*first/radius(k)
558 errors(3) = max(errors(3), abs(reference - lap(3))/(1 + abs(reference)))
559 CALL release_atom_basis(radial)
562 IF (io_unit > 0)
WRITE (io_unit,
'(A,3ES24.15)')
"Atomic radial derivative/Laplacian scaled errors: ", errors
564 CALL release_atom_basis(basis)
565 IF (maxval(errors) > 2.e-7_dp) error stop
"Atomic radial finite-difference derivatives disagree"
566 END SUBROUTINE check_basis_derivatives
573 SUBROUTINE check_nlcc_fit()
574 INTEGER,
PARAMETER :: nr = 1601
575 REAL(dp),
PARAMETER :: amplitudes(3) = [0.02_dp, 1.7_dp, 0.4_dp], &
576 exponents(3) = [0.15_dp, 2.3_dp, 35.0_dp]
579 REAL(dp) :: density_error, derivative, derivative_error, dx, r(nr), rab(nr), radius, &
580 reference, reference_derivative, rho(nr), value
581 REAL(dp),
ALLOCATABLE :: alpha(:), coeff(:)
584 dx = log(20.0_dp/1.e-6_dp)/real(nr - 1, dp)
587 r(i) = 20.0_dp*real(i - 1, dp)/real(nr - 1, dp)
588 rab(i) = 20.0_dp/real(nr - 1, dp)
590 r(i) = 1.e-6_dp*exp(dx*real(i - 1, dp))
593 rho(i) = sum(amplitudes*exp(-exponents*r(i)**2))
595 CALL fit_core_density_gaussians(r, rab, rho, alpha, coeff)
596 density_error = 0.0_dp
597 derivative_error = 0.0_dp
599 radius = real(i, dp)*0.017_dp
600 reference = sum(amplitudes*exp(-exponents*radius**2))
601 reference_derivative = -2.0_dp*radius*sum(exponents*amplitudes*exp(-exponents*radius**2))
602 value = sum(coeff*exp(-alpha*radius**2))
603 derivative = -2.0_dp*radius*sum(alpha*coeff*exp(-alpha*radius**2))
604 density_error = max(density_error, abs(
value - reference))
605 derivative_error = max(derivative_error, abs(derivative - reference_derivative))
607 IF (io_unit > 0)
WRITE (io_unit,
'(A,I2,2ES16.7)') &
608 "Core Gaussian fit, density and derivative:", mesh, density_error, derivative_error
609 IF (density_error > 2.e-7_dp) error stop
"Gaussian core-density fit is inaccurate"
610 IF (derivative_error > 3.e-6_dp) error stop
"Gaussian core-density derivative is inaccurate"
612 CALL fit_core_density_gaussians(r, rab, rho, alpha, coeff)
613 IF (any(coeff /= 0.0_dp)) error stop
"Zero core density generated nonzero Gaussian coefficients"
615 END SUBROUTINE check_nlcc_fit
623 SUBROUTINE check_upf_units()
624 CHARACTER(LEN=*),
PARAMETER :: fixture = &
625 'upf-units-test-with-a-potential-filename-longer-than-'// &
626 'the-default-eighty-character-string-buffer.upf'
629 TYPE(atom_potential_type) :: atomic
630 TYPE(cp_logger_type),
POINTER :: logger
631 TYPE(section_type),
POINTER :: specification
632 TYPE(section_vals_type),
POINTER :: input, potential_section
634 logger => cp_get_default_logger()
635 IF (logger%para_env%is_source())
THEN
636 CALL open_file(fixture, unit_number=unit, file_status=
"REPLACE", file_action=
"WRITE")
637 WRITE (unit,
'(A)') &
638 '<UPF version="2.0.1">', &
639 '<PP_HEADER element="He" pseudo_type="NC" z_valence="2"', &
640 ' mesh_size="3" number_of_proj="2" l_max="0" />', &
641 '<PP_MESH mesh="3">', &
642 '<PP_R type="real" size="3">', &
645 '<PP_RAB type="real" size="3">', &
649 '<PP_LOCAL type="real" size="3">', &
653 '<PP_BETA.1 type="real" size="3" index="1" angular_momentum="0">', &
656 '<PP_BETA.2 type="real" size="3" index="2" angular_momentum="0">', &
659 '<PP_DIJ type="real" size="4">', &
664 CALL close_file(unit)
666 CALL logger%para_env%sync()
667 NULLIFY (specification, input)
668 CALL create_atom_section(specification)
669 CALL section_vals_create(input, specification)
670 potential_section => section_vals_get_subs_vals(input,
'POTENTIAL')
671 CALL section_vals_val_set(potential_section,
'PSEUDO_TYPE', i_val=upf_pseudo)
672 CALL section_vals_val_set(potential_section,
'POTENTIAL_FILE_NAME', c_val=fixture)
673 CALL init_atom_potential(atomic, potential_section, 2)
674 associate(potential => atomic%upf_pot)
675 IF (maxval(abs(potential%vlocal - [3.0_dp, 2.0_dp, 1.0_dp])) > 1.e-14_dp)
THEN
676 error stop
"UPF local potential is not in Hartree"
678 IF (maxval(abs(potential%beta(:, 1) - [2.0_dp, 4.0_dp, 6.0_dp])) > 1.e-14_dp)
THEN
679 error stop
"UPF changed the first tabulated projector amplitude"
681 IF (maxval(abs(potential%beta(:, 2) - [4.0_dp, -1.0_dp, 2.0_dp])) > 1.e-14_dp)
THEN
682 error stop
"UPF changed the second tabulated projector amplitude"
684 IF (maxval(abs(potential%dion - reshape([1.0_dp, 0.2_dp, 0.2_dp, 4.0_dp], [2, 2]))) > 1.e-14_dp)
THEN
685 error stop
"UPF D matrix is not in the tabulated-projector convention"
688 CALL release_atom_potential(atomic)
689 CALL section_vals_release(input)
690 CALL section_release(specification)
691 CALL logger%para_env%sync()
692 IF (logger%para_env%is_source())
THEN
693 CALL open_file(fixture, unit_number=unit, file_status=
"OLD")
694 CALL close_file(unit, file_status=
"DELETE")
696 END SUBROUTINE check_upf_units
703 SUBROUTINE check_atomic_potential()
705 REAL(KIND=dp) :: a, b, p, reference
706 TYPE(atom_basis_type) :: basis
707 TYPE(atom_integrals) :: integrals
708 TYPE(atom_potential_type) :: atomic
709 TYPE(sgp_potential_type),
POINTER :: potential
712 CALL allocate_potential(potential)
713 potential%zeff = 1.0_dp
714 potential%core_charge_radius = 0.4_dp
715 potential%alpha_core_charge = 0.5_dp/potential%core_charge_radius**2
716 potential%n_nonlocal = 1
718 potential%is_nonlocal(0:2) = .true.
719 potential%n_local = 1
720 ALLOCATE (potential%elec_conf(0:3), potential%a_nonlocal(1), &
721 potential%c_nonlocal(1, 1, 0:2), potential%h_nonlocal(1, 0:2), &
722 potential%a_local(1), potential%c_local(1))
723 potential%elec_conf = [1, 0, 0, 0]
724 potential%a_nonlocal = 0.7_dp
725 potential%c_nonlocal = 1.0_dp/sqrt(fourpi)
726 potential%h_nonlocal = 1.0_dp
727 potential%a_local = 1.2_dp
728 potential%c_local = 0.3_dp
729 atomic%ppot_type = sgp_pseudo
730 CALL sgp_potential_conversion(potential, atomic%sgp_pot)
731 CALL init_atom_basis_default_pp(basis)
732 CALL atom_ppint_setup(integrals, basis, atomic)
734 a = basis%am(8, l) + potential%a_nonlocal(1)
735 reference = (
gamma(l + 1.5_dp)/(2.0_dp*a**(l + 1.5_dp)))**2
736 IF (abs(integrals%hnl(8, 8, l) - reference) > 1.e-9_dp*abs(reference))
THEN
737 error stop
"Atomic SGP nonlocal operator differs from analytic Gaussian integrals"
740 p = 2.0_dp*basis%am(8, 0)
741 b = 1.0_dp/(sqrt(2.0_dp)*potential%core_charge_radius)
742 reference = -potential%zeff*b/(2.0_dp*p*sqrt(p + b*b)) + &
743 potential%c_local(1)*
gamma(1.5_dp)/(2.0_dp*(p + potential%a_local(1))**1.5_dp)
744 IF (abs(integrals%core(8, 8, 0) - reference) > 1.e-9_dp*abs(reference))
THEN
745 error stop
"Atomic SGP local operator differs from analytic Gaussian integrals"
747 CALL atom_ppint_release(integrals)
748 CALL release_atom_basis(basis)
749 CALL deallocate_potential(potential)
750 END SUBROUTINE check_atomic_potential
759 SUBROUTINE check_projector_addition_theorem()
760 INTEGER,
PARAMETER :: lmax = 5
762 INTEGER :: i, j, l, lx, ly, lz, nc, ns
763 REAL(KIND=dp) :: cross, diagonal, p(0:lmax), u(3), v(3), x
764 REAL(KIND=dp),
ALLOCATABLE :: pu(:), pv(:)
765 TYPE(sgp_potential_type),
POINTER :: potential
768 CALL init_orbital_pointers(lmax)
769 CALL init_spherical_harmonics(lmax, -1)
770 CALL allocate_potential(potential)
771 potential%n_nonlocal = 1
772 potential%lmax = lmax
773 potential%nppnl = sum(nco(0:lmax))
774 ALLOCATE (potential%c_nonlocal(1, 1, 0:lmax), potential%h_nonlocal(1, 0:lmax))
776 potential%c_nonlocal = 1.0_dp/sqrt(fourpi)
777 potential%h_nonlocal = 1.0_dp
778 CALL init_potential(potential)
779 u = [0.6_dp, 0.0_dp, 0.8_dp]
780 v = [0.3_dp, -0.4_dp, 0.5_dp]
782 x = dot_product(u, v)
786 p(l) = ((2*l - 1)*x*p(l - 1) - (l - 1)*p(l - 2))/l
791 ALLOCATE (pu(nso(l)), pv(nso(l)))
797 i = nc + co(lx, ly, lz)
799 pu(j) = pu(j) + potential%cprj_ppnl(i, ns + j)*u(1)**lx*u(2)**ly*u(3)**lz
800 pv(j) = pv(j) + potential%cprj_ppnl(i, ns + j)*v(1)**lx*v(2)**ly*v(3)**lz
804 diagonal = real(2*l + 1, dp)/fourpi
805 cross = diagonal*p(l)
806 IF (abs(dot_product(pu, pu) - diagonal) > 1.e-12_dp .OR. &
807 abs(dot_product(pv, pv) - diagonal) > 1.e-12_dp .OR. &
808 abs(dot_product(pu, pv) - cross) > 1.e-12_dp)
THEN
809 error stop
"SGP projector kernel violates the spherical-harmonic addition theorem"
815 CALL deallocate_potential(potential)
816 END SUBROUTINE check_projector_addition_theorem
821 SUBROUTINE check_core_derivatives()
822 REAL(kind=dp),
PARAMETER :: h = 1.e-4_dp
824 REAL(kind=dp) :: deriv(4), lap(4), lap_fd(4), minus(4), &
825 plus(4), r(4), rho(4)
826 TYPE(atom_potential_type) :: potential
828 potential%ppot_type = sgp_pseudo
829 potential%sgp_pot%has_nlcc = .true.
830 potential%sgp_pot%n_nlcc = 2
831 potential%sgp_pot%a_nlcc(1:2) = [0.7_dp, 2.3_dp]
832 potential%sgp_pot%c_nlcc(1:2) = [1.8_dp, -0.2_dp]
833 r = [0.0_dp, 0.1_dp, 0.7_dp, 2.0_dp]
839 CALL atom_core_density(rho, potential,
"RHO", r)
840 CALL atom_core_density(plus, potential,
"RHO", r + h)
841 CALL atom_core_density(minus, potential,
"RHO", r - h)
842 CALL atom_core_density(deriv, potential,
"DER", r)
843 CALL atom_core_density(lap, potential,
"LAP", r)
844 IF (maxval(abs(deriv - (plus - minus)/(2.0_dp*h))) > 1.e-7_dp)
THEN
845 error stop
"SGP core-density derivative differs from finite differences"
847 lap_fd = (plus - 2.0_dp*rho + minus)/h**2
848 lap_fd(1) = 3.0_dp*lap_fd(1)
849 lap_fd(2:) = lap_fd(2:) + (plus(2:) - minus(2:))/(h*r(2:))
850 IF (maxval(abs(lap - lap_fd)) > 1.e-6_dp) error stop
"SGP core-density Laplacian differs from finite differences"
851 END SUBROUTINE check_core_derivatives
856 SUBROUTINE check_contracted_basis_reader()
857 INTEGER,
PARAMETER :: contractions(3) = [11, 1, 1], lower_l(3) = [0, 1, 2], &
858 primitives(3) = [11, 41, 2], sets(3) = [1, 1, 21], upper_l(3) = [3, 6, 3]
859 CHARACTER(LEN=1600),
ALLOCATABLE :: lines(:)
860 INTEGER :: b, c, i, j, l, mode, n, nc, np, ns, row, &
862 REAL(dp) :: alpha, coefficient, expected, &
864 TYPE(atom_basis_type) :: basis
865 CHARACTER(LEN=*),
PARAMETER :: fixture =
"atom-contracted-basis-test"
867 TYPE(cp_logger_type),
POINTER :: logger
868 TYPE(section_type),
POINTER :: specification
869 TYPE(section_vals_type),
POINTER :: input, pp_basis
871 logger => cp_get_default_logger()
876 ALLOCATE (lines(1 + ns*(np + 1)))
877 WRITE (lines(1),
'(I0)') ns
881 WRITE (lines(row),
'(*(I0,1X))') 1, lower_l(b), upper_l(b), np, (nc, l=lower_l(b), upper_l(b))
884 alpha = real(10*s + i, dp)/20.0_dp
885 WRITE (lines(row),
'(*(F12.6,1X))') alpha, &
886 ((real(100*s + 10*i + c + 5*l, dp)/1000.0_dp, c=1, nc), l=lower_l(b), upper_l(b))
889 IF (logger%para_env%is_source())
THEN
890 OPEN (newunit=unit, file=fixture, status=
"REPLACE", action=
"WRITE")
891 WRITE (unit,
'(A)')
'H READER-TEST', (trim(lines(i)), i=1,
SIZE(lines))
894 CALL logger%para_env%sync()
896 NULLIFY (specification, input)
897 CALL create_atom_section(specification)
898 CALL section_vals_create(input, specification)
899 pp_basis => section_vals_get_subs_vals(input,
'PP_BASIS')
900 CALL section_vals_val_set(pp_basis,
'BASIS_TYPE', i_val=contracted_gto)
901 CALL section_vals_val_set(pp_basis,
'GRID_POINTS', i_val=32)
902 CALL section_vals_val_set(pp_basis,
'BASIS_SET', c_val=
'READER-TEST')
903 CALL section_vals_val_set(pp_basis,
'BASIS_SET_FILE_NAME', c_val=fixture)
905 DO i = 1,
SIZE(lines)
906 CALL section_vals_val_set(pp_basis,
'BASIS%_DEFAULT_KEYWORD_', i_rep_val=i, c_val=trim(lines(i)))
909 CALL init_atom_basis(basis, pp_basis, 1,
'PP')
910 DO l = 0, ubound(basis%nbas, 1)
912 IF (l >= lower_l(b) .AND. l <= upper_l(b)) n = ns
913 IF (basis%nprim(l) /= n*np .OR. basis%nbas(l) /= n*nc)
THEN
914 error stop
"Incorrect atomic contracted basis dimensions"
918 alpha = real(10*s + i, dp)/20.0_dp
920 IF (abs(basis%am(j, l) - alpha) > 1.e-14_dp) error stop
"Incorrect contracted basis exponent"
922 normalization = sqrt(2.0_dp*(2.0_dp*alpha)**(l + 1.5_dp)/
gamma(l + 1.5_dp))
926 IF (s == t) coefficient = real(100*s + 10*i + c + 5*l, dp)/1000.0_dp
927 expected = normalization*coefficient
928 IF (abs(basis%cm(j, (t - 1)*nc + c, l) - expected) > 1.e-12_dp*max(1.0_dp, abs(expected)))
THEN
929 error stop
"Incorrect contracted basis coefficient or normalization"
936 CALL release_atom_basis(basis)
937 CALL section_vals_release(input)
938 CALL section_release(specification)
940 CALL logger%para_env%sync()
941 IF (logger%para_env%is_source())
THEN
942 OPEN (newunit=unit, file=fixture, status=
"OLD")
943 CLOSE (unit, status=
"DELETE")
947 END SUBROUTINE check_contracted_basis_reader
952 SUBROUTINE check_basis_optimization_export()
953 CHARACTER(LEN=160) :: line
954 INTEGER :: i, j, status, unit
955 REAL(dp) :: alpha(2), coefficient(2), norm
956 REAL(dp),
POINTER :: exponents(:)
957 TYPE(cp_logger_type),
POINTER :: logger
958 TYPE(section_type),
POINTER :: specification
959 TYPE(section_vals_type),
POINTER :: input
961 NULLIFY (specification, input)
962 CALL create_atom_section(specification)
963 CALL section_vals_create(input, specification)
964 CALL section_vals_val_set(input,
'ELEMENT', c_val=
'He')
965 CALL section_vals_val_set(input,
'ELECTRON_CONFIGURATION', c_val=
'1s2')
966 CALL section_vals_val_set(input,
'MAX_ANGULAR_MOMENTUM', i_val=0)
967 CALL section_vals_val_set(input,
'AE_BASIS%NUM_GTO', i_val=2)
968 ALLOCATE (exponents(2))
969 exponents = [2.0_dp, 0.4_dp]
970 CALL section_vals_val_set(input,
'AE_BASIS%S_EXPONENTS', r_vals_ptr=exponents)
971 CALL section_vals_val_set(input,
'METHOD%METHOD_TYPE', i_val=do_rhf_atom)
972 CALL section_vals_val_set(input,
'OPTIMIZATION%EPS_SCF', r_val=1.e-10_dp)
973 CALL section_vals_val_set(input,
'OPTIMIZATION%N_DIIS', i_val=8)
974 CALL section_vals_val_set(input,
'OPTIMIZATION%MAX_ITER', i_val=100)
975 CALL section_vals_val_set(input,
'POWELL%MAX_FUN', i_val=5)
976 CALL section_vals_val_set(input,
'POWELL%STEP_SIZE', r_val=0.15_dp)
977 CALL section_vals_val_set(input,
'POWELL%ACCURACY', r_val=1.e-5_dp)
978 CALL section_vals_val_set(input,
'PRINT%FIT_BASIS%_SECTION_PARAMETERS_', i_val=silent_print_level)
979 CALL atom_basis_opt(input)
980 CALL section_vals_release(input)
981 CALL section_release(specification)
983 logger => cp_get_default_logger()
984 CALL logger%para_env%sync()
985 OPEN (newunit=unit, file=
'OPT_BASIS', status=
'OLD', action=
'READ')
987 READ (unit,
'(A)', iostat=status) line
988 IF (status /= 0) error stop
'Missing optimized basis orbital coefficients'
989 IF (index(line,
'L Quantum Number:') > 0)
EXIT
992 READ (unit, *) alpha(i), coefficient(i)
995 IF (alpha(1) <= 2.0_dp) error stop
'Optimization did not restore the earlier best exponent'
999 norm = norm + coefficient(i)*coefficient(j)* &
1000 (2.0_dp*sqrt(alpha(i)*alpha(j))/(alpha(i) + alpha(j)))**1.5_dp
1004 IF (.NOT. ieee_is_finite(norm) .OR. abs(norm - 1.0_dp) > 1.e-7_dp)
THEN
1005 error stop
'Exported orbital is inconsistent with the optimized basis'
1007 CALL logger%para_env%sync()
1008 IF (logger%para_env%is_source())
THEN
1009 OPEN (newunit=unit, file=
'OPT_BASIS', status=
'OLD')
1010 CLOSE (unit, status=
'DELETE')
1012 END SUBROUTINE check_basis_optimization_export
subroutine check_uspp_import()
...
program atom_upf_unittest
subroutine, public atom_basis_opt(atom_section)
Optimize the atomic basis set.
calculate the orbitals for a given atomic kind type
subroutine, public sgp_potential_conversion(sgp_potential, sgp_atompot)
...
Calculate the atomic operator matrices.
subroutine, public atom_ppint_release(integrals)
Release memory allocated for atomic integrals (core electrons).
subroutine, public atom_ppint_setup(integrals, basis, potential)
...
subroutine, public atom_sgp_release(sgp_pot)
...
subroutine, public sgp_construction(sgp_pot, ecp_pot, upf_pot, orb_basis, error)
...
subroutine, public fit_core_density_gaussians(r, rab, rho, alpha, coeff)
Fit a tabulated core density without forming ill-conditioned normal equations. Column-normalized,...
Define the atom type and its sub types.
integer, parameter, public cgto_basis
subroutine, public release_atom_potential(potential)
...
subroutine, public init_atom_basis(basis, basis_section, zval, btyp)
Initialize the basis for the atomic code.
subroutine, public init_atom_potential(potential, potential_section, zval)
...
subroutine, public release_atom_basis(basis)
...
subroutine, public init_atom_basis_default_pp(basis)
...
subroutine, public atom_basis_gridrep(basis, gbasis, r, rab)
...
Routines that process Quantum Espresso UPF files.
subroutine, public atom_read_upf(pot, upf_filename, read_header, read_augmentation, read_paw)
...
pure subroutine, public atom_release_upf(upfpot)
...
Some basic routines for atomic calculations.
subroutine, public atom_core_density(corden, potential, typ, rr)
...
subroutine, public atom_density(density, pmat, basis, maxl, typ, rr)
Map the electron density on an atomic radial grid.
Utility routines to open and close files.
subroutine, public open_file(file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug)
Opens a file and returns its logical unit number.
subroutine, public close_file(unit_number, file_status)
Closes an open file given by its logical unit number.
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public silent_print_level
Definition of the atomic potential types.
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
subroutine, public cp2k_finalize()
...
subroutine, public cp2k_init()
...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), parameter, public fourpi
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
integer, dimension(:, :, :), allocatable, public co
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public nso
subroutine, public deallocate_grid_atom(grid_atom)
Deallocate a Gaussian-type orbital (GTO) basis set data set.
subroutine, public allocate_grid_atom(grid_atom)
Initialize components of the grid_atom_type structure.
subroutine, public create_grid_atom(grid_atom, nr, na, llmax, ll, quadrature)
...
Owned UPF dataset and radial conventions shared by ATOM and Quickstep. Dataset availability does not ...
pure logical function, public upf_has_complete_partial_waves(pot)
Check for a complete projector-indexed pair of original AE and PS waves.
subroutine, public upf_nlcc_kinetic(pot, kinetic, available, reason)
Obtain the independently supplied model-core kinetic density in Hartree per cubic bohr....
Provides all information about a basis set.
type of a logger, at the moment it contains just a print level starting at which level it should be l...