mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Split input_cp2k_dft.F (#3554)
This commit is contained in:
parent
68ba995ea6
commit
55a83f1f3a
11 changed files with 8140 additions and 7664 deletions
|
|
@ -246,6 +246,13 @@ list(
|
|||
input_cp2k_colvar.F
|
||||
input_cp2k_constraints.F
|
||||
input_cp2k_dft.F
|
||||
input_cp2k_print_dft.F
|
||||
input_cp2k_scf.F
|
||||
input_cp2k_as.F
|
||||
input_cp2k_opt.F
|
||||
input_cp2k_qs.F
|
||||
input_cp2k_se.F
|
||||
input_cp2k_xas.F
|
||||
input_cp2k_distribution.F
|
||||
input_cp2k_ec.F
|
||||
input_cp2k_eip.F
|
||||
|
|
|
|||
462
src/input_cp2k_as.F
Normal file
462
src/input_cp2k_as.F
Normal file
|
|
@ -0,0 +1,462 @@
|
|||
!--------------------------------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
! !
|
||||
! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
!--------------------------------------------------------------------------------------------------!
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief function that build the active space section of the input
|
||||
!> \par History
|
||||
!> 10.2005 moved out of input_cp2k [fawzi]
|
||||
!> 07.2024 moved out of input_cp2k_dft [JGH]
|
||||
!> \author fawzi
|
||||
! **************************************************************************************************
|
||||
MODULE input_cp2k_as
|
||||
USE cp_output_handling, ONLY: cp_print_key_section_create,&
|
||||
debug_print_level,&
|
||||
high_print_level,&
|
||||
low_print_level,&
|
||||
medium_print_level,&
|
||||
silent_print_level
|
||||
USE input_constants, ONLY: &
|
||||
casci_canonical, dmft_model, eri_method_full_gpw, eri_method_gpw_ht, eri_operator_coulomb, &
|
||||
eri_operator_erf, eri_operator_erfc, eri_operator_gaussian, eri_operator_trunc, &
|
||||
eri_operator_yukawa, gaussian, hf_model, manual_selection, mao_projection, no_solver, &
|
||||
qiskit_solver, rsdft_model, wannier_projection
|
||||
USE input_cp2k_loc, ONLY: create_localize_section
|
||||
USE input_keyword_types, ONLY: keyword_create,&
|
||||
keyword_release,&
|
||||
keyword_type
|
||||
USE input_section_types, ONLY: section_add_keyword,&
|
||||
section_add_subsection,&
|
||||
section_create,&
|
||||
section_release,&
|
||||
section_type
|
||||
USE input_val_types, ONLY: char_t,&
|
||||
integer_t,&
|
||||
lchar_t,&
|
||||
logical_t,&
|
||||
real_t
|
||||
USE kinds, ONLY: dp
|
||||
USE string_utilities, ONLY: s2a
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_as'
|
||||
|
||||
PUBLIC :: create_active_space_section
|
||||
|
||||
CONTAINS
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create CP2K input section for the calculation of an active space Hamiltonian
|
||||
!> \param section ...
|
||||
!> \par History:
|
||||
!> - Creation 06.04.2016
|
||||
!> \author JHU
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_active_space_section(section)
|
||||
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: print_key, subsection
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
|
||||
CALL section_create(section, __LOCATION__, name="ACTIVE_SPACE", &
|
||||
description="Define parameters and method to calculate an electronic active space", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword, subsection, print_key)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, &
|
||||
name="_SECTION_PARAMETERS_", &
|
||||
description="Controls the activation of the ACTIVE_SPACE section", &
|
||||
usage="&ACTIVE_SPACE ON", &
|
||||
default_l_val=.FALSE., &
|
||||
lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MODEL", &
|
||||
description="Model used to calculate active space interaction Hamiltonian.", &
|
||||
usage="MODEL HARTREE-FOCK", &
|
||||
default_i_val=hf_model, &
|
||||
enum_c_vals=s2a("HARTREE-FOCK", "RSDFT", "DMFT"), &
|
||||
enum_i_vals=(/hf_model, rsdft_model, dmft_model/), &
|
||||
enum_desc=s2a("Hartree-Fock model for interaction Hamiltonian", &
|
||||
"Range-separated DFT model for interaction Hamiltonian", &
|
||||
"DMFT model Hamiltonian"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ELECTRONS", &
|
||||
description="The number of active electrons in the CAS space", &
|
||||
usage="ACTIVE_ELECTRONS 4", n_var=1, default_i_val=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ORBITALS", &
|
||||
description="The number of active orbitals defining the CAS space.", &
|
||||
usage="ACTIVE_ORBITALS 2", n_var=1, default_i_val=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ORBITAL_INDICES", &
|
||||
description="The indices of the active orbitals. Requires ORBITAL_SELECTION MANUAL!", &
|
||||
usage="ACTIVE_ORBITAL_INDICES 2 3 {...}", n_var=-1, default_i_vals=(/-1/), &
|
||||
type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ISOLATED_SYSTEM", &
|
||||
description="System is treated without any periodic boundary conditions.", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "FCIDUMP", &
|
||||
description="Controls the writing of a file in FCIDUMP format.", &
|
||||
print_level=high_print_level, filename="")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_SELECTION", &
|
||||
description="Method used to select active space orbitals.", &
|
||||
usage="ORBITAL_SELECTION CANONICAL", &
|
||||
default_i_val=casci_canonical, &
|
||||
enum_c_vals=s2a("CANONICAL", "WANNIER_PROJECTION", "MAO", "MANUAL"), &
|
||||
enum_i_vals=(/casci_canonical, wannier_projection, mao_projection, manual_selection/), &
|
||||
enum_desc=s2a("Select orbitals using energy ordering of canoncial orbitals", &
|
||||
"Select orbitals from projected Wannier functions", &
|
||||
"Select orbitals from modified atomic orbitals", &
|
||||
"Select orbitals manually via ACTIVE_ORBITAL_INDICES"))
|
||||
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SUBSPACE_ATOM", &
|
||||
description="Number of atom that defines the subspace to be projected on.", &
|
||||
usage="SUBSPACE_ATOM x", default_i_val=-1, &
|
||||
type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SUBSPACE_SHELL", &
|
||||
description="Shell definition for subsapce.", &
|
||||
usage="SUBSPACE_SHELL 3d4s", default_c_val="X", &
|
||||
type_of_var=char_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SCF_EMBEDDING", &
|
||||
description="Whether to turn on the self-consistent embedding scheme", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="QCSCHEMA", &
|
||||
description="Name of the QCSchema file, may include a path", &
|
||||
usage="QCSCHEMA <FILENAME>", &
|
||||
type_of_var=lchar_t, repeats=.FALSE., &
|
||||
default_lc_val="")
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="AS_SOLVER", &
|
||||
description="The external active space solver for the embedding approach", &
|
||||
usage="AS_SOLVER QISKIT", &
|
||||
default_i_val=no_solver, &
|
||||
enum_c_vals=s2a("NONE", "QISKIT"), &
|
||||
enum_i_vals=(/no_solver, qiskit_solver/), &
|
||||
enum_desc=s2a("NO solver, used to produce FCIDUMP/QCSchema files", &
|
||||
"QISKIT active space solver"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_ITER", &
|
||||
description="Energy convergence threshold of the DFT embedding scheme.", &
|
||||
usage="EPS_ITER 1.0E-6 ", type_of_var=real_t, &
|
||||
default_r_val=1.0E-6_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
|
||||
description="Max number of iterations for the DFT embedding scheme.", &
|
||||
usage="MAX_ITER 50", type_of_var=integer_t, &
|
||||
default_i_val=50)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL create_print_orb_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_eri_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_eri_gpw(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_localize_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_socket_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
END SUBROUTINE create_active_space_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_socket_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="SOCKET", &
|
||||
description="Parameters to set up the socket communicating to the external active space solver.", &
|
||||
n_keywords=3, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
CALL keyword_create(keyword, __LOCATION__, name="INET", &
|
||||
description="Use an INET socket rather than a UNIX socket.", &
|
||||
usage="INET <LOGICAL>", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PORT", &
|
||||
description="Port number for the socket client.", &
|
||||
usage="port <INTEGER>", &
|
||||
default_i_val=12345)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="HOST", &
|
||||
description="Host name for the socket client.", &
|
||||
usage="host <HOSTNAME>", &
|
||||
default_c_val="embedding_socket")
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_socket_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_print_orb_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="PRINT_ORBITAL_CUBES", &
|
||||
description="Controls printing of active orbital cube files.", &
|
||||
n_keywords=5, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
|
||||
description="Body of Filename for the cube files.", &
|
||||
usage="FILENAME {name}", default_c_val="ActiveOrbital", &
|
||||
type_of_var=char_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ALIST", &
|
||||
description="List of alpha orbitals to be printed. -1 defaults to all values", &
|
||||
usage="ALIST {1 2 3 ...}", n_var=-1, default_i_vals=(/-1/), &
|
||||
lone_keyword_i_val=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="BLIST", &
|
||||
description="List of beta orbitals to be printed. -1 defaults to all values", &
|
||||
usage="ALIST {1 2 3 ...}", n_var=-1, default_i_vals=(/-1/), &
|
||||
lone_keyword_i_val=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
|
||||
description="The stride (X,Y,Z) used to write the cube file"// &
|
||||
" (larger values result in smaller cube files)."// &
|
||||
" You can provide 3 numbers (for X,Y,Z) or 1 number valid for all components", &
|
||||
usage="STRIDE {2 2 2}", n_var=-1, default_i_vals=(/2, 2, 2/), &
|
||||
type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STOP_AFTER_CUBES", &
|
||||
description="Whether to stop the computation after printing the cubes.", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_print_orb_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_eri_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="ERI", &
|
||||
description="Parameters for the electron repulsion integrals.", &
|
||||
n_keywords=5, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
|
||||
description="Method used in ERI calculation.", &
|
||||
usage="METHOD FULL_GPW", &
|
||||
enum_c_vals=s2a("FULL_GPW", "GPW_HALF_TRANSFORM"), &
|
||||
enum_i_vals=(/eri_method_full_gpw, eri_method_gpw_ht/), &
|
||||
enum_desc=s2a("Use the GPW approach with MOs", &
|
||||
"Use the GPW approach for half-transformed MO ERIs"), &
|
||||
default_i_val=eri_method_full_gpw)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="OPERATOR", &
|
||||
description="Operator used in ERI calculation.", &
|
||||
usage="OPERATOR <1/R>", &
|
||||
enum_c_vals=s2a("<1/R>", "<EXP(-A*R)/R>", "<ERF(A*R)/R>", &
|
||||
"<ERFC(A*R)/R>", "<EXP(-A*R2)/R>", "<H(A-R)/R>"), &
|
||||
enum_i_vals=(/eri_operator_coulomb, eri_operator_yukawa, &
|
||||
eri_operator_erf, eri_operator_erfc, eri_operator_gaussian, eri_operator_trunc/), &
|
||||
enum_desc=s2a("Coulomb operator", &
|
||||
"Yukawa potential operator", &
|
||||
"Error function potential operator", &
|
||||
"Complementary error function potential operator", &
|
||||
"Gaussian potential operator", &
|
||||
"Truncated Coulomb potential"), &
|
||||
default_i_val=eri_operator_coulomb)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="OPERATOR_PARAMETER", &
|
||||
description="Range parameter for ERI operator.", &
|
||||
usage="OPERATOR_PARAMETER 4.0", type_of_var=real_t, &
|
||||
default_r_val=0.5_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PERIODICITY", &
|
||||
description="Periodicity used for operators in ERI calclulation.", &
|
||||
usage="PERIODICITY {1 1 1}", n_var=-1, default_i_vals=(/1, 1, 1/), &
|
||||
type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
|
||||
description="Radius of operator interactions in non-periodic cases.", &
|
||||
usage="CUTOFF_RADIUS 20", type_of_var=real_t, &
|
||||
default_r_val=-1.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="EPS_INTEGRAL", &
|
||||
description="Accuracy of ERIs that will be stored.", &
|
||||
usage="EPS_INTEGRAL 1.0E-10 ", type_of_var=real_t, &
|
||||
default_r_val=1.0E-12_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_eri_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_eri_gpw(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="ERI_GPW", &
|
||||
description="Parameters for the GPW approach to electron repulsion integrals.", &
|
||||
n_keywords=5, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_GRID", &
|
||||
description="Determines a threshold for the GPW based integration", &
|
||||
usage="EPS_GRID 1.0E-9 ", type_of_var=real_t, &
|
||||
default_r_val=1.0E-8_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
|
||||
description="Determines a threshold for the sparse matrix multiplications if METHOD "// &
|
||||
"GPW_HALF_TRANSFORM is used", &
|
||||
usage="EPS_FILTER 1.0E-9 ", type_of_var=real_t, &
|
||||
default_r_val=1.0E-9_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
|
||||
description="The cutoff of the finest grid level in the GPW integration.", &
|
||||
usage="CUTOFF 300", type_of_var=real_t, &
|
||||
default_r_val=300.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="REL_CUTOFF", &
|
||||
variants=(/"RELATIVE_CUTOFF"/), &
|
||||
description="Determines the grid at which a Gaussian is mapped.", &
|
||||
usage="REL_CUTOFF 50", type_of_var=real_t, &
|
||||
default_r_val=50.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STORE_WFN", &
|
||||
variants=(/"STORE_WAVEFUNCTION"/), &
|
||||
description="Store wavefunction in real space representation for integration.", &
|
||||
usage="STORE_WFN T", type_of_var=logical_t, &
|
||||
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="GROUP_SIZE", &
|
||||
description="Sets the size of a subgroup for ERI calculation, "// &
|
||||
"each of which with a full set of work grids, arrays or orbitals "// &
|
||||
"depending on the method of grids (work grids, arrays, orbitals). "// &
|
||||
"Small numbers reduce communication but increase the memory demands. "// &
|
||||
"A negative number indicates all processes (default).", &
|
||||
usage="GROUP_SIZE 2", type_of_var=integer_t, &
|
||||
default_i_val=-1)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PRINT_LEVEL", &
|
||||
variants=(/"IOLEVEL"/), &
|
||||
description="How much output is written by the individual groups.", &
|
||||
usage="PRINT_LEVEL HIGH", &
|
||||
default_i_val=silent_print_level, enum_c_vals= &
|
||||
s2a("SILENT", "LOW", "MEDIUM", "HIGH", "DEBUG"), &
|
||||
enum_desc=s2a("Almost no output", &
|
||||
"Little output", "Quite some output", "Lots of output", &
|
||||
"Everything is written out, useful for debugging purposes only"), &
|
||||
enum_i_vals=(/silent_print_level, low_print_level, medium_print_level, &
|
||||
high_print_level, debug_print_level/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_eri_gpw
|
||||
|
||||
END MODULE input_cp2k_as
|
||||
7744
src/input_cp2k_dft.F
7744
src/input_cp2k_dft.F
File diff suppressed because it is too large
Load diff
544
src/input_cp2k_opt.F
Normal file
544
src/input_cp2k_opt.F
Normal file
|
|
@ -0,0 +1,544 @@
|
|||
!--------------------------------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
! !
|
||||
! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
!--------------------------------------------------------------------------------------------------!
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief function that build the dft section of the input
|
||||
!> \par History
|
||||
!> 10.2005 moved out of input_cp2k [fawzi]
|
||||
!> \author fawzi
|
||||
! **************************************************************************************************
|
||||
MODULE input_cp2k_opt
|
||||
USE cp_output_handling, ONLY: add_last_numeric,&
|
||||
cp_print_key_section_create,&
|
||||
high_print_level,&
|
||||
silent_print_level
|
||||
USE input_constants, ONLY: &
|
||||
do_lri_opt_all, do_lri_opt_coeff, do_lri_opt_exps, embed_diff, embed_fa, &
|
||||
embed_grid_angstrom, embed_grid_bohr, embed_level_shift, embed_none, embed_quasi_newton, &
|
||||
embed_resp, embed_steep_desc, gaussian
|
||||
USE input_keyword_types, ONLY: keyword_create,&
|
||||
keyword_release,&
|
||||
keyword_type
|
||||
USE input_section_types, ONLY: section_add_keyword,&
|
||||
section_add_subsection,&
|
||||
section_create,&
|
||||
section_release,&
|
||||
section_type
|
||||
USE input_val_types, ONLY: integer_t,&
|
||||
lchar_t,&
|
||||
logical_t
|
||||
USE kinds, ONLY: dp
|
||||
USE string_utilities, ONLY: s2a
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_opt'
|
||||
|
||||
PUBLIC :: create_optimize_lri_basis_section
|
||||
PUBLIC :: create_optimize_embed
|
||||
PUBLIC :: create_optimize_dmfet
|
||||
|
||||
CONTAINS
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief input section for optimization of the auxililary basis for LRIGPW
|
||||
!> \param section the section to create
|
||||
!> \author Dorothea Golze [05.2014]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_optimize_lri_basis_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: subsection
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="OPTIMIZE_LRI_BASIS", &
|
||||
description="This section specifies the parameters for optimizing "// &
|
||||
"the lri auxiliary basis sets for LRIGPW. The Powell optimizer is used.", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword, subsection)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ACCURACY", &
|
||||
description="Target accuracy for the objective function (RHOEND)", &
|
||||
usage="ACCURACY 5.0E-4", default_r_val=1.0E-5_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MAX_FUN", &
|
||||
description="Maximum number of function evaluations", &
|
||||
usage="MAX_FUN 200", default_i_val=4000)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
|
||||
description="Initial step size for search algorithm (RHOBEG)", &
|
||||
usage="STEP_SIZE 1.0E-1", default_r_val=5.0E-2_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CONDITION_WEIGHT", &
|
||||
description="This keyword allows to give different weight "// &
|
||||
"factors to the condition number (LOG(cond) is used).", &
|
||||
usage="CONDITION_WEIGHT 1.0E-4", default_r_val=1.0E-6_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="USE_CONDITION_NUMBER", &
|
||||
description="Determines whether condition number should be part "// &
|
||||
"of optimization or not", &
|
||||
usage="USE_CONDITION_NUMBER", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="GEOMETRIC_SEQUENCE", &
|
||||
description="Exponents are assumed to be a geometric sequence. "// &
|
||||
"Only the minimal and maximal exponents of one set are optimized and "// &
|
||||
"the other exponents are obtained by geometric progression.", &
|
||||
usage="GEOMETRIC_SEQUENCE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DEGREES_OF_FREEDOM", &
|
||||
description="Specifies the degrees of freedom in the basis "// &
|
||||
"optimization.", &
|
||||
usage="DEGREES_OF_FREEDOM ALL", &
|
||||
enum_c_vals=s2a("ALL", "COEFFICIENTS", "EXPONENTS"), &
|
||||
enum_desc=s2a("Set all parameters in the basis to be variable.", &
|
||||
"Set all coefficients in the basis set to be variable.", &
|
||||
"Set all exponents in the basis to be variable."), &
|
||||
enum_i_vals=(/do_lri_opt_all, do_lri_opt_coeff, do_lri_opt_exps/), &
|
||||
default_i_val=do_lri_opt_exps)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL create_constrain_exponents_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
END SUBROUTINE create_optimize_lri_basis_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Input for DFT embedding
|
||||
!> \param section ...
|
||||
!> \author Vladimir Rybkin [08.2017]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_optimize_embed(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="OPT_EMBED", &
|
||||
description="This section specifies optional parameters for DFT embedding potential optimization.", &
|
||||
n_keywords=19, n_subsections=4, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="REG_LAMBDA", &
|
||||
description="Parameter for Yang's regularization "// &
|
||||
"involving kinetic matrix.", &
|
||||
usage="REG_LAMBDA 0.0001", default_r_val=0.0001_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="N_ITER", &
|
||||
description="Maximum number of iterations "// &
|
||||
"in the optimization procedure.", &
|
||||
usage="N_ITER 75", default_i_val=50)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TRUST_RAD", &
|
||||
description="Maximum number of iterations "// &
|
||||
"in the optimization procedure.", &
|
||||
usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DENS_CONV_MAX", &
|
||||
description="Convergence criterion for "// &
|
||||
"the maximum electron density difference.", &
|
||||
usage="DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DENS_CONV_INT", &
|
||||
description="Convergence criterion for "// &
|
||||
"the integrated electron density difference.", &
|
||||
usage="DENS_CONV_INT 0.1", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SPIN_DENS_CONV_MAX", &
|
||||
description="Convergence criterion for "// &
|
||||
"the maximum electron density difference.", &
|
||||
usage="DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SPIN_DENS_CONV_INT", &
|
||||
description="Convergence criterion for "// &
|
||||
"the integrated electron density difference.", &
|
||||
usage="DENS_CONV_INT 0.1", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="OPTIMIZER", &
|
||||
description="Optimize embedding potential.", &
|
||||
usage="OPTIMIZER LEVEL_SHIFT", &
|
||||
default_i_val=embed_steep_desc, &
|
||||
enum_c_vals=s2a("STEEPEST_DESCENT", "QUASI_NEWTON", "LEVEL_SHIFT"), &
|
||||
enum_desc=s2a("Steepest descent.", "Quasi-Newton.", "Level shift."), &
|
||||
enum_i_vals=(/embed_steep_desc, embed_quasi_newton, embed_level_shift/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="GRID_OPT", &
|
||||
description="Optimize embedding potential on the grid. ", &
|
||||
usage="GRID_OPT .TRUE.", &
|
||||
default_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LEEUWEN-BAERENDS", &
|
||||
description="Van Leeuwen-Baerends iterative update. Alternative to Wu-Yang "// &
|
||||
"optimizer. Use only with ADD_CONTST_POT.", &
|
||||
usage="LEEUWEN-BAERENDS .TRUE.", &
|
||||
default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FAB", &
|
||||
description="Finzel-Ayers-Bultinck iterative update. Generally, not reliable. ", &
|
||||
usage="FAB .TRUE.", &
|
||||
default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="VW_CUTOFF", &
|
||||
description="Cutoff for von Weizsacker potential in "// &
|
||||
"the FAB optimization procedure.", &
|
||||
usage="VW_CUTOFF 0.01", default_r_val=0.01_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="VW_SMOOTH_CUT_RANGE", &
|
||||
description="Smooth cutoff range for von Weizsacker potential in "// &
|
||||
"the FAB optimization procedure.", &
|
||||
usage="VW_CUTOFF 1.0", default_r_val=1.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="POT_GUESS", &
|
||||
description="Specifies the guess of the embedding "// &
|
||||
"potential. For optimization in finite basis (not grid optimization) "// &
|
||||
"in is a constant part to be added to the one in finite basis. ", &
|
||||
usage="DEGREES_OF_FREEDOM ALL", &
|
||||
enum_c_vals=s2a("NONE", "DIFF", "Fermi_Amaldi", "RESP"), &
|
||||
enum_desc=s2a("Initial guess is zero grid.", &
|
||||
"Initial density difference. A euristic but working approach.", &
|
||||
"Fermi-Amaldi potential. More rigorous than DIFF, although less efficient.", &
|
||||
"Coulomb interaction between the subsystem using RESP charges)"// &
|
||||
" on the total system."), &
|
||||
enum_i_vals=(/embed_none, embed_diff, embed_fa, embed_resp/), &
|
||||
default_i_val=embed_none)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CHARGE_DISTR_WIDTH", &
|
||||
description="Width of the Gaussian representing "// &
|
||||
"point charges. To be used with ADD_COULOMB_POT.", &
|
||||
usage="CHARGE_DISTR_WIDTH 3.000", default_r_val=1.12490_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="READ_EMBED_POT", &
|
||||
description="Read the embedding potential "// &
|
||||
"restart vector as a guess.", &
|
||||
usage="READ_EMBED_POT .FALSE.", default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="READ_EMBED_POT_CUBE", &
|
||||
description="Read the embedding potential "// &
|
||||
"(restart) from the cube file.", &
|
||||
usage="READ_EMBED_POT_CUBE .FALSE.", default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_RESTART_FILE_NAME", &
|
||||
description="Root of the file name where to read the embedding "// &
|
||||
"potential guess.", &
|
||||
usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_CUBE_FILE_NAME", &
|
||||
description="Root of the file name where to read the embedding "// &
|
||||
"potential (guess) as a cube.", &
|
||||
usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_SPIN_CUBE_FILE_NAME", &
|
||||
description="Root of the file name where to read the spin part "// &
|
||||
"of the embedding potential (guess) as a cube.", &
|
||||
usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL create_print_embed_diff(section)
|
||||
|
||||
CALL create_print_embed_pot_cube(section)
|
||||
|
||||
CALL create_print_embed_restart_vec(section)
|
||||
|
||||
CALL create_print_simple_grid(section)
|
||||
|
||||
END SUBROUTINE create_optimize_embed
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Input for density matrix functional embedding, DMFET
|
||||
!> \param section ...
|
||||
!> \author Vladimir Rybkin [08.2018]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_optimize_dmfet(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="OPT_DMFET", &
|
||||
description="This section specifies optional parameters for DMFET matrix potential optimization.", &
|
||||
n_keywords=8, n_subsections=4, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="N_ITER", &
|
||||
description="Maximum number of iterations "// &
|
||||
"in the optimization procedure.", &
|
||||
usage="N_ITER 75", default_i_val=50)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TRUST_RAD", &
|
||||
description="Step length "// &
|
||||
"in the optimization procedure.", &
|
||||
usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DM_CONV_MAX", &
|
||||
description="Convergence criterion for "// &
|
||||
"the maximum element of density matrix difference.", &
|
||||
usage="DM_CONV_MAX 0.01", default_r_val=0.01_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DM_CONV_INT", &
|
||||
description="Convergence criterion for "// &
|
||||
"the total density matrix difference.", &
|
||||
usage="DM_CONV_INT 0.1", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="BETA_DM_CONV_MAX", &
|
||||
description="Convergence criterion for "// &
|
||||
"the maximum element of the beta-spin density "// &
|
||||
"matrix difference.", &
|
||||
usage="DM_CONV_MAX 0.01", default_r_val=0.01_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="BETA_DM_CONV_INT", &
|
||||
description="Convergence criterion for "// &
|
||||
"the total beta-spin density matrix difference.", &
|
||||
usage="DM_CONV_INT 0.1", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="READ_DMFET_POT", &
|
||||
description="Read the matrix embedding potential "// &
|
||||
"(restart) from the cube file.", &
|
||||
usage="READ_DMFET_POT .FALSE.", default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DMFET_RESTART_FILE_NAME", &
|
||||
description="Root of the file name where to read the matrix "// &
|
||||
"potential guess.", &
|
||||
usage="DMFET_RESTART_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_optimize_dmfet
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_print_embed_diff(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
NULLIFY (print_key, keyword)
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_DENS_DIFF", &
|
||||
description="Controls the printing of cube files with "// &
|
||||
"embedding densisty differences", &
|
||||
print_level=high_print_level, add_last=add_last_numeric, filename="")
|
||||
CALL keyword_create(keyword, __LOCATION__, name="stride", &
|
||||
description="The stride (X,Y,Z) used to write the cube file "// &
|
||||
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
|
||||
" 1 number valid for all components.", &
|
||||
usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
|
||||
CALL section_add_keyword(print_key, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_print_embed_diff
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_print_embed_pot_cube(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
NULLIFY (print_key, keyword)
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_POT_CUBE", &
|
||||
description="Controls the printing of cube files with "// &
|
||||
"with embedding potential", &
|
||||
print_level=high_print_level, add_last=add_last_numeric, filename="")
|
||||
CALL keyword_create(keyword, __LOCATION__, name="stride", &
|
||||
description="The stride (X,Y,Z) used to write the cube file "// &
|
||||
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
|
||||
" 1 number valid for all components.", &
|
||||
usage="STRIDE 1 1 1", n_var=-1, default_i_vals=(/1, 1, 1/), type_of_var=integer_t)
|
||||
CALL section_add_keyword(print_key, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_print_embed_pot_cube
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_print_embed_restart_vec(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
NULLIFY (print_key)
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_POT_VECTOR", &
|
||||
description="Controls the printing of cube files with "// &
|
||||
"with embedding potential", &
|
||||
print_level=silent_print_level, add_last=add_last_numeric, filename="")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_print_embed_restart_vec
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_print_simple_grid(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
NULLIFY (print_key, keyword)
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "WRITE_SIMPLE_GRID", &
|
||||
description="Controls the printing of simple grid "// &
|
||||
"files with embedding potential: X Y Z value", &
|
||||
print_level=high_print_level, add_last=add_last_numeric, filename="")
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
|
||||
description="The stride (X,Y,Z) used to write the cube file "// &
|
||||
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
|
||||
" 1 number valid for all components.", &
|
||||
usage="STRIDE 1 1 1", n_var=-1, default_i_vals=(/1, 1, 1/), type_of_var=integer_t)
|
||||
CALL section_add_keyword(print_key, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="UNITS", &
|
||||
description="Units of the volumetric file: Angstrom or Bohr.", &
|
||||
usage="UNITS BOHR", &
|
||||
default_i_val=embed_grid_bohr, &
|
||||
enum_c_vals=s2a("BOHR", "ANGSTROM"), &
|
||||
enum_desc=s2a("Atomic units: Bohr", "Metric units: Angstrom."), &
|
||||
enum_i_vals=(/embed_grid_bohr, embed_grid_angstrom/))
|
||||
CALL section_add_keyword(print_key, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FOLD_COORD", &
|
||||
description="Activates printing folded coordinates corresponding "// &
|
||||
"to the simple grid. Used as input for external programs.", &
|
||||
usage="FOLD_COORD .TRUE.", n_var=1, type_of_var=logical_t, &
|
||||
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(print_key, keyword)
|
||||
|
||||
CALL keyword_release(keyword)
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_print_simple_grid
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief input section for constraints for auxiliary basis set optimization
|
||||
!> \param section the section to create
|
||||
!> \author Dorothea Golze [11.2014]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_constrain_exponents_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CALL section_create(section, __LOCATION__, name="CONSTRAIN_EXPONENTS", &
|
||||
description="specifies constraints for the exponents of the "// &
|
||||
"lri auxiliary basis sets in the optimization.", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
|
||||
description="Defines the upper and lower boundaries as "// &
|
||||
"(1+scale)*exp and (1-scale)*exp. Fermi-like constraint "// &
|
||||
"function", &
|
||||
usage="SCALE 0.3", default_r_val=0.3_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FERMI_EXP", &
|
||||
description="Exponent in the fermi-like constraint function. ", &
|
||||
usage="FERMI_EXP 2.63", default_r_val=2.63391_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_constrain_exponents_section
|
||||
|
||||
END MODULE input_cp2k_opt
|
||||
2728
src/input_cp2k_print_dft.F
Normal file
2728
src/input_cp2k_print_dft.F
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -40,10 +40,10 @@ MODULE input_cp2k_properties_dft
|
|||
tddfpt_kernel_none, tddfpt_kernel_stda, use_mom_ref_coac, use_mom_ref_com, &
|
||||
use_mom_ref_user, use_mom_ref_zero
|
||||
USE input_cp2k_atprop, ONLY: create_atprop_section
|
||||
USE input_cp2k_dft, ONLY: create_ddapc_restraint_section, &
|
||||
create_interp_section, &
|
||||
create_lrigpw_section, &
|
||||
USE input_cp2k_dft, ONLY: create_interp_section, &
|
||||
create_mgrid_section
|
||||
USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
|
||||
create_lrigpw_section
|
||||
USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
|
||||
USE input_cp2k_loc, ONLY: create_localize_section
|
||||
USE input_cp2k_resp, ONLY: create_resp_section
|
||||
|
|
|
|||
830
src/input_cp2k_qs.F
Normal file
830
src/input_cp2k_qs.F
Normal file
|
|
@ -0,0 +1,830 @@
|
|||
!--------------------------------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
! !
|
||||
! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
!--------------------------------------------------------------------------------------------------!
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief function that build the QS section of the input
|
||||
!> \par History
|
||||
!> 10.2005 moved out of input_cp2k [fawzi]
|
||||
!> 07.2024 moved out of input_cp2k_dft [JGH]
|
||||
!> \author fawzi
|
||||
! **************************************************************************************************
|
||||
MODULE input_cp2k_qs
|
||||
USE bibliography, ONLY: &
|
||||
Andermatt2016, Brelaz1979, Dewar1977, Dewar1985, Golze2017a, Golze2017b, Iannuzzi2006, &
|
||||
Kolafa2004, Krack2000, Kuhne2007, Lippert1997, Lippert1999, Repasky2002, Rocha2006, &
|
||||
Schenter2008, Stewart1989, Stewart2007, Thiel1992, VanVoorhis2015, VandeVondele2005a, &
|
||||
VandeVondele2006
|
||||
USE cp_output_handling, ONLY: add_last_numeric,&
|
||||
cp_print_key_section_create,&
|
||||
low_print_level
|
||||
USE input_constants, ONLY: &
|
||||
do_ddapc_constraint, do_ddapc_restraint, do_full_density, do_gapw_gcs, do_gapw_gct, &
|
||||
do_gapw_log, do_lri_inv, do_lri_inv_auto, do_lri_pseudoinv_diag, do_lri_pseudoinv_svd, &
|
||||
do_method_am1, do_method_dftb, do_method_gapw, do_method_gapw_xc, do_method_gpw, &
|
||||
do_method_lrigpw, do_method_mndo, do_method_mndod, do_method_ofgpw, do_method_pdg, &
|
||||
do_method_pm3, do_method_pm6, do_method_pm6fm, do_method_pnnl, do_method_rigpw, &
|
||||
do_method_rm1, do_method_xtb, do_ppl_analytic, do_ppl_grid, do_pwgrid_ns_fullspace, &
|
||||
do_pwgrid_ns_halfspace, do_pwgrid_spherical, do_s2_constraint, do_s2_restraint, &
|
||||
do_spin_density, gapw_1c_large, gapw_1c_medium, gapw_1c_orb, gapw_1c_small, &
|
||||
gapw_1c_very_large, gaussian, numerical, slater, wfi_aspc_nr, wfi_frozen_method_nr, &
|
||||
wfi_linear_p_method_nr, wfi_linear_ps_method_nr, wfi_linear_wf_method_nr, &
|
||||
wfi_ps_method_nr, wfi_use_guess_method_nr, wfi_use_prev_p_method_nr, &
|
||||
wfi_use_prev_rho_r_method_nr, wfi_use_prev_wf_method_nr
|
||||
USE input_cp2k_distribution, ONLY: create_distribution_section
|
||||
USE input_cp2k_opt, ONLY: create_optimize_dmfet,&
|
||||
create_optimize_embed,&
|
||||
create_optimize_lri_basis_section
|
||||
USE input_cp2k_scf, ONLY: create_cdft_control_section
|
||||
USE input_cp2k_se, ONLY: create_se_control_section
|
||||
USE input_cp2k_tb, ONLY: create_dftb_control_section,&
|
||||
create_xtb_control_section
|
||||
USE input_keyword_types, ONLY: keyword_create,&
|
||||
keyword_release,&
|
||||
keyword_type
|
||||
USE input_section_types, ONLY: section_add_keyword,&
|
||||
section_add_subsection,&
|
||||
section_create,&
|
||||
section_release,&
|
||||
section_type
|
||||
USE input_val_types, ONLY: integer_t,&
|
||||
lchar_t,&
|
||||
real_t
|
||||
USE kinds, ONLY: dp
|
||||
USE pw_grids, ONLY: do_pw_grid_blocked_false,&
|
||||
do_pw_grid_blocked_free,&
|
||||
do_pw_grid_blocked_true
|
||||
USE string_utilities, ONLY: s2a
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_qs'
|
||||
|
||||
PUBLIC :: create_qs_section, create_lrigpw_section, create_ddapc_restraint_section
|
||||
|
||||
CONTAINS
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief creates the input section for the qs part
|
||||
!> \param section the section to create
|
||||
!> \author teo
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_qs_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: subsection
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="qs", &
|
||||
description="parameters needed to set up the Quickstep framework", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (keyword, subsection)
|
||||
|
||||
! Reals
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_DEFAULT", &
|
||||
description="Try setting all EPS_xxx to values leading to an energy correct up to EPS_DEFAULT", &
|
||||
usage="EPS_DEFAULT real", default_r_val=1.0E-10_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_CORE_CHARGE", &
|
||||
description="Precision for mapping the core charges.Overrides EPS_DEFAULT/100.0 value", &
|
||||
usage="EPS_CORE_CHARGE real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="EPS_GVG_RSPACE", &
|
||||
variants=(/"EPS_GVG"/), &
|
||||
description="Sets precision of the realspace KS matrix element integration. Overrides SQRT(EPS_DEFAULT) value", &
|
||||
usage="EPS_GVG_RSPACE real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_ORB", &
|
||||
description="Sets precision of the overlap matrix elements. Overrides SQRT(EPS_DEFAULT) value", &
|
||||
usage="EPS_PGF_ORB real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="EPS_KG_ORB", &
|
||||
description="Sets precision used in coloring the subsets for the Kim-Gordon method. Overrides SQRT(EPS_DEFAULT) value", &
|
||||
usage="EPS_KG_ORB 1.0E-8", &
|
||||
type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_PPL", &
|
||||
description="Adjusts the precision for the local part of the pseudo potential. ", &
|
||||
usage="EPS_PPL real", type_of_var=real_t, default_r_val=1.0E-2_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="EPS_PPNL", &
|
||||
description="Sets precision of the non-local part of the pseudo potential. Overrides sqrt(EPS_DEFAULT) value", &
|
||||
usage="EPS_PPNL real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_CPC", &
|
||||
description="Sets precision of the GAPW projection. Overrides EPS_DEFAULT value", &
|
||||
usage="EPS_CPC real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO", &
|
||||
description="Sets precision of the density mapping on the grids.Overrides EPS_DEFAULT value", &
|
||||
usage="EPS_RHO real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO_RSPACE", &
|
||||
description="Sets precision of the density mapping in rspace.Overrides EPS_DEFAULT value."// &
|
||||
" Overrides EPS_RHO value", &
|
||||
usage="EPS_RHO_RSPACE real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO_GSPACE", &
|
||||
description="Sets precision of the density mapping in gspace.Overrides EPS_DEFAULT value."// &
|
||||
" Overrides EPS_RHO value", &
|
||||
usage="EPS_RHO_GSPACE real", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER_MATRIX", &
|
||||
description="Sets the threshold for filtering matrix elements.", &
|
||||
usage="EPS_FILTER_MATRIX 1.0E-6", type_of_var=real_t, default_r_val=0.0E0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPSFIT", &
|
||||
variants=(/"EPS_FIT"/), &
|
||||
description="GAPW: precision to give the extension of a hard gaussian ", &
|
||||
usage="EPSFIT real", default_r_val=1.0E-4_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPSISO", &
|
||||
variants=(/"EPS_ISO"/), &
|
||||
description="GAPW: precision to determine an isolated projector", &
|
||||
usage="EPSISO real", default_r_val=1.0E-12_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPSSVD", &
|
||||
variants=(/"EPS_SVD"/), &
|
||||
description="GAPW: tolerance used in the singular value decomposition of the projector matrix", &
|
||||
usage="EPS_SVD real", default_r_val=1.0E-8_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPSRHO0", &
|
||||
variants=s2a("EPSVRHO0", "EPS_VRHO0"), &
|
||||
description="GAPW : precision to determine the range of V(rho0-rho0soft)", &
|
||||
usage="EPSRHO0 real", default_r_val=1.0E-6_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ALPHA0_HARD", &
|
||||
variants=s2a("ALPHA0_H", "ALPHA0"), &
|
||||
description="GAPW: Exponent for hard compensation charge", &
|
||||
usage="ALPHA0_HARD real", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="FORCE_PAW", &
|
||||
description="Use the GAPW scheme also for atoms with soft basis sets, i.e. "// &
|
||||
"the local densities are computed even if hard and soft should be equal. "// &
|
||||
"If this keyword is not set to true, those atoms with soft basis sets are treated by a GPW scheme, i.e. "// &
|
||||
"the corresponding density contribution goes on the global grid and is expanded in PW. "// &
|
||||
"This option nullifies the effect of the GPW_TYPE in the atomic KIND", &
|
||||
usage="FORCE_PAW", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MAX_RAD_LOCAL", &
|
||||
description="GAPW : maximum radius of gaussian functions"// &
|
||||
" included in the generation of projectors", &
|
||||
usage="MAX_RAD_LOCAL real", default_r_val=25.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="GAPW_1C_BASIS", &
|
||||
description="Specifies how to construct the GAPW one center basis set. "// &
|
||||
"Default is to use the primitives from the orbital basis.", &
|
||||
usage="GAPW_1C_BASIS MEDIUM", &
|
||||
enum_c_vals=s2a("ORB", "EXT_SMALL", "EXT_MEDIUM", "EXT_LARGE", "EXT_VERY_LARGE"), &
|
||||
enum_desc=s2a("Use orbital basis set.", &
|
||||
"Extension using Small number of primitive Gaussians.", &
|
||||
"Extension using Medium number of primitive Gaussians.", &
|
||||
"Extension using Large number of primitive Gaussians.", &
|
||||
"Extension using Very Large number of primitive Gaussians."), &
|
||||
enum_i_vals=(/gapw_1c_orb, gapw_1c_small, gapw_1c_medium, &
|
||||
gapw_1c_large, gapw_1c_very_large/), &
|
||||
default_i_val=gapw_1c_orb)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MIN_PAIR_LIST_RADIUS", &
|
||||
description="Set the minimum value [Bohr] for the overlap pair list radius."// &
|
||||
" Default is 0.0 Bohr, negative values are changed to the cell size."// &
|
||||
" This allows to control the sparsity of the KS matrix for HFX calculations.", &
|
||||
usage="MIN_PAIR_LIST_RADIUS real", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
! Logicals
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LS_SCF", &
|
||||
description="Perform a linear scaling SCF", &
|
||||
usage="LS_SCF", lone_keyword_l_val=.TRUE., &
|
||||
default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ALMO_SCF", &
|
||||
description="Perform ALMO SCF", &
|
||||
usage="ALMO_SCF", lone_keyword_l_val=.TRUE., &
|
||||
default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TRANSPORT", &
|
||||
description="Perform transport calculations (coupling CP2K and OMEN)", &
|
||||
usage="TRANSPORT", lone_keyword_l_val=.TRUE., &
|
||||
default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="KG_METHOD", &
|
||||
description="Use a Kim-Gordon-like scheme.", &
|
||||
usage="KG_METHOD", lone_keyword_l_val=.TRUE., &
|
||||
default_l_val=.FALSE., citations=(/Iannuzzi2006, Brelaz1979, Andermatt2016/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="REF_EMBED_SUBSYS", &
|
||||
description="A total, reference, system in DFT embedding. ", &
|
||||
usage="REF_EMBED_SUBSYS FALSE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CLUSTER_EMBED_SUBSYS", &
|
||||
description="A cluster treated with DFT in DFT embedding. ", &
|
||||
usage="CLUSTER_EMBED_SUBSYS FALSE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="HIGH_LEVEL_EMBED_SUBSYS", &
|
||||
description="A cluster treated with a high-level method in DFT embedding. ", &
|
||||
usage="HIGH_LEVEL_EMBED_SUBSYS FALSE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DFET_EMBEDDED", &
|
||||
description="Calculation with DFT-embedding potential. ", &
|
||||
usage="DFET_EMBEDDED FALSE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DMFET_EMBEDDED", &
|
||||
description="Calculation with DM embedding potential. ", &
|
||||
usage="DMFET_EMBEDDED FALSE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
! Integers
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STO_NG", &
|
||||
description="Order of Gaussian type expansion of Slater orbital basis sets.", &
|
||||
usage="STO_NG", default_i_val=6)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LMAXN1", &
|
||||
variants=(/"LMAXRHO1"/), &
|
||||
description="GAPW : max L number for expansion of the atomic densities in spherical gaussians", &
|
||||
usage="LMAXN1 integer", &
|
||||
default_i_val=-1)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LMAXN0", &
|
||||
variants=(/"LMAXRHO0"/), &
|
||||
description="GAPW : max L number for the expansion compensation densities in spherical gaussians", &
|
||||
usage="LMAXN0 integer", &
|
||||
default_i_val=2)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LADDN0", &
|
||||
description="GAPW : integer added to the max L of the basis set, used to determine the "// &
|
||||
"maximum value of L for the compensation charge density.", &
|
||||
usage="LADDN0 integer", &
|
||||
default_i_val=99)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
! Characters
|
||||
CALL keyword_create(keyword, __LOCATION__, name="QUADRATURE", &
|
||||
description="GAPW: algorithm to construct the atomic radial grids", &
|
||||
usage="QUADRATURE GC_SIMPLE", &
|
||||
enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
|
||||
enum_i_vals=(/do_gapw_gcs, do_gapw_gct, do_gapw_log/), &
|
||||
enum_desc=s2a("Gauss-Chebyshev quadrature", &
|
||||
"Transformed Gauss-Chebyshev quadrature", &
|
||||
"Logarithmic transformed Gauss-Chebyshev quadrature"), &
|
||||
default_i_val=do_gapw_log)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PW_GRID", &
|
||||
description="What kind of PW_GRID should be employed", &
|
||||
usage="PW_GRID NS-FULLSPACE", &
|
||||
enum_c_vals=s2a("SPHERICAL", "NS-FULLSPACE", "NS-HALFSPACE"), &
|
||||
enum_desc=s2a("- not tested", " tested", " - not tested"), &
|
||||
enum_i_vals=(/do_pwgrid_spherical, do_pwgrid_ns_fullspace, do_pwgrid_ns_halfspace/), &
|
||||
default_i_val=do_pwgrid_ns_fullspace)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_LAYOUT", &
|
||||
description="Force a particular real-space layout for the plane waves grids. "// &
|
||||
"Numbers ≤ 0 mean that this dimension is free, incorrect layouts will be ignored. "// &
|
||||
"The default (/-1,-1/) causes CP2K to select a good value, "// &
|
||||
"i.e. plane distributed for large grids, more general distribution for small grids.", &
|
||||
usage="PW_GRID_LAYOUT 4 16", &
|
||||
repeats=.FALSE., n_var=2, &
|
||||
default_i_vals=(/-1, -1/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_BLOCKED", &
|
||||
description="Can be used to set the distribution in g-space for the pw grids and their FFT.", &
|
||||
usage="PW_GRID_BLOCKED FREE", &
|
||||
enum_c_vals=s2a("FREE", "TRUE", "FALSE"), &
|
||||
enum_desc=s2a("CP2K will select an appropriate value", "blocked", "not blocked"), &
|
||||
enum_i_vals=(/do_pw_grid_blocked_free, do_pw_grid_blocked_true, do_pw_grid_blocked_false/), &
|
||||
default_i_val=do_pw_grid_blocked_free)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="EXTRAPOLATION", &
|
||||
variants=s2a("INTERPOLATION", "WF_INTERPOLATION"), &
|
||||
description="Extrapolation strategy for the wavefunction during e.g. MD. "// &
|
||||
"Not all options are available for all simulation methods. "// &
|
||||
"PS and ASPC are recommended, see also EXTRAPOLATION_ORDER.", &
|
||||
citations=(/Kolafa2004, VandeVondele2005a, Kuhne2007/), &
|
||||
usage="EXTRAPOLATION PS", &
|
||||
enum_c_vals=s2a("USE_GUESS", "USE_PREV_P", "USE_PREV_RHO_R", "LINEAR_WF", &
|
||||
"LINEAR_P", "LINEAR_PS", "USE_PREV_WF", "PS", "FROZEN", "ASPC"), &
|
||||
enum_desc=s2a( &
|
||||
"Use the method specified with SCF_GUESS, i.e. no extrapolation", &
|
||||
"Use the previous density matrix", &
|
||||
"Use the previous density in real space", &
|
||||
"Linear extrapolation of the wavefunction (not available for K-points)", &
|
||||
"Linear extrapolation of the density matrix", &
|
||||
"Linear extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
|
||||
"Use the previous wavefunction (not available for K-points)", &
|
||||
"Higher order extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
|
||||
"Frozen ...", &
|
||||
"Always stable predictor corrector, similar to PS, but going for MD stability instead of initial guess accuracy. "// &
|
||||
"(not available for K-points)"), &
|
||||
enum_i_vals=(/ &
|
||||
wfi_use_guess_method_nr, &
|
||||
wfi_use_prev_p_method_nr, &
|
||||
wfi_use_prev_rho_r_method_nr, &
|
||||
wfi_linear_wf_method_nr, &
|
||||
wfi_linear_p_method_nr, &
|
||||
wfi_linear_ps_method_nr, &
|
||||
wfi_use_prev_wf_method_nr, &
|
||||
wfi_ps_method_nr, &
|
||||
wfi_frozen_method_nr, &
|
||||
wfi_aspc_nr/), &
|
||||
default_i_val=wfi_aspc_nr)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EXTRAPOLATION_ORDER", &
|
||||
description="Order for the PS or ASPC extrapolation (typically 2-4). "// &
|
||||
"Higher order might bring more accuracy, but comes, "// &
|
||||
"for large systems, also at some cost. "// &
|
||||
"In some cases, a high order extrapolation is not stable,"// &
|
||||
" and the order needs to be reduced.", &
|
||||
usage="EXTRAPOLATION_ORDER {integer}", default_i_val=3)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
|
||||
description="Specifies the electronic structure method that should be employed", &
|
||||
usage="METHOD GAPW", &
|
||||
enum_c_vals=s2a("GAPW", "GAPW_XC", "GPW", "LRIGPW", "RIGPW", &
|
||||
"MNDO", "MNDOD", "AM1", "PM3", "PM6", "PM6-FM", "PDG", "RM1", "PNNL", "DFTB", "xTB", "OFGPW"), &
|
||||
enum_desc=s2a("Gaussian and augmented plane waves method", &
|
||||
"Gaussian and augmented plane waves method only for XC", &
|
||||
"Gaussian and plane waves method", &
|
||||
"Local resolution of identity method", &
|
||||
"Resolution of identity method for HXC terms", &
|
||||
"MNDO semiempirical", "MNDO-d semiempirical", "AM1 semiempirical", &
|
||||
"PM3 semiempirical", "PM6 semiempirical", "PM6-FM semiempirical", "PDG semiempirical", &
|
||||
"RM1 semiempirical", &
|
||||
"PNNL semiempirical", &
|
||||
"DFTB Density Functional based Tight-Binding", &
|
||||
"GFN-xTB Extended Tight-Binding", &
|
||||
"OFGPW Orbital-free GPW method"), &
|
||||
enum_i_vals=(/do_method_gapw, do_method_gapw_xc, do_method_gpw, do_method_lrigpw, do_method_rigpw, &
|
||||
do_method_mndo, do_method_mndod, do_method_am1, do_method_pm3, &
|
||||
do_method_pm6, do_method_pm6fm, do_method_pdg, do_method_rm1, &
|
||||
do_method_pnnl, do_method_dftb, do_method_xtb, do_method_ofgpw/), &
|
||||
citations=(/Lippert1997, Lippert1999, Krack2000, VandeVondele2005a, &
|
||||
VandeVondele2006, Dewar1977, Dewar1985, Rocha2006, Stewart1989, Thiel1992, &
|
||||
Repasky2002, Stewart2007, VanVoorhis2015, Schenter2008/), &
|
||||
default_i_val=do_method_gpw)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CORE_PPL", &
|
||||
description="Specifies the method used to calculate the local pseudopotential contribution.", &
|
||||
usage="CORE_PPL ANALYTIC", &
|
||||
enum_c_vals=s2a("ANALYTIC", "GRID"), &
|
||||
enum_desc=s2a("Analytic integration of integrals", &
|
||||
"Numerical integration on real space grid. Lumped together with core charge"), &
|
||||
enum_i_vals=(/do_ppl_analytic, do_ppl_grid/), &
|
||||
default_i_val=do_ppl_analytic)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_RESTART_FILE_NAME", &
|
||||
description="Root of the file name where to read the embedding "// &
|
||||
"potential guess.", &
|
||||
usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_CUBE_FILE_NAME", &
|
||||
description="Root of the file name where to read the embedding "// &
|
||||
"potential (guess) as a cube.", &
|
||||
usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EMBED_SPIN_CUBE_FILE_NAME", &
|
||||
description="Root of the file name where to read the spin part "// &
|
||||
"of the embedding potential (guess) as a cube.", &
|
||||
usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
|
||||
type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL create_distribution_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_dftb_control_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_xtb_control_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_se_control_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_mulliken_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT")
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_cdft_control_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_s2_restraint_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_lrigpw_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_optimize_lri_basis_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
! Embedding subsections: DFET and DMFET
|
||||
CALL create_optimize_embed(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_optimize_dmfet(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
END SUBROUTINE create_qs_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_mulliken_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
NULLIFY (keyword)
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="MULLIKEN_RESTRAINT", &
|
||||
description="Use mulliken charges in a restraint (check code for details)", &
|
||||
n_keywords=7, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
|
||||
description="force constant of the restraint", &
|
||||
usage="STRENGTH {real} ", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
|
||||
description="target value of the restraint", &
|
||||
usage="TARGET {real} ", default_r_val=1._dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
|
||||
description="Specifies the list of atoms that is summed in the restraint", &
|
||||
usage="ATOMS {integer} {integer} .. {integer}", &
|
||||
n_var=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_mulliken_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
!> \param section_name ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_ddapc_restraint_section(section, section_name)
|
||||
TYPE(section_type), POINTER :: section
|
||||
CHARACTER(len=*), INTENT(in) :: section_name
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
NULLIFY (keyword, print_key)
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
|
||||
description="Use DDAPC charges in a restraint (check code for details)", &
|
||||
n_keywords=7, n_subsections=0, repeats=.TRUE.)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
|
||||
description="Specifies the type of density used for the fitting", &
|
||||
usage="TYPE_OF_DENSITY (FULL|SPIN)", &
|
||||
enum_c_vals=s2a("FULL", "SPIN"), &
|
||||
enum_i_vals=(/do_full_density, do_spin_density/), &
|
||||
enum_desc=s2a("Full density", "Spin density"), &
|
||||
default_i_val=do_full_density)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
|
||||
description="force constant of the restraint", &
|
||||
usage="STRENGTH {real} ", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
|
||||
description="target value of the restraint", &
|
||||
usage="TARGET {real} ", default_r_val=1._dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
|
||||
description="Specifies the list of atoms that is summed in the restraint", &
|
||||
usage="ATOMS {integer} {integer} .. {integer}", &
|
||||
n_var=-1, type_of_var=integer_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="COEFF", &
|
||||
description="Defines the the coefficient of the atom in the atom list (default is one) ", &
|
||||
usage="COEFF 1.0 -1.0", &
|
||||
type_of_var=real_t, n_var=-1)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
|
||||
description="Specifies the functional form of the term added", &
|
||||
usage="FUNCTIONAL_FORM RESTRAINT", &
|
||||
enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
|
||||
enum_i_vals=(/do_ddapc_restraint, do_ddapc_constraint/), &
|
||||
enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
|
||||
default_i_val=do_ddapc_restraint)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
|
||||
description="Controls the printing basic info about the method", &
|
||||
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_ddapc_restraint_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_s2_restraint_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
NULLIFY (keyword)
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
|
||||
CALL section_create(section, __LOCATION__, name="S2_RESTRAINT", &
|
||||
description="Use S2 in a re/constraint (OT only)", &
|
||||
n_keywords=7, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
|
||||
description="force constant of the restraint", &
|
||||
usage="STRENGTH {real} ", default_r_val=0.1_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
|
||||
description="target value of the restraint", &
|
||||
usage="TARGET {real} ", default_r_val=1._dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
|
||||
description="Specifies the functional form of the term added", &
|
||||
usage="FUNCTIONAL_FORM RESTRAINT", &
|
||||
enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
|
||||
enum_i_vals=(/do_s2_restraint, do_s2_constraint/), &
|
||||
enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
|
||||
default_i_val=do_s2_restraint)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_s2_restraint_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief input section for optional parameters for LRIGPW
|
||||
!> LRI: local resolution of identity
|
||||
!> \param section the section to create
|
||||
!> \author Dorothea Golze [02.2015]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_lrigpw_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="LRIGPW", &
|
||||
description="This section specifies optional parameters for LRIGPW.", &
|
||||
n_keywords=3, n_subsections=0, repeats=.FALSE., citations=(/Golze2017b/))
|
||||
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="LRI_OVERLAP_MATRIX", &
|
||||
description="Specifies whether to calculate the inverse or the "// &
|
||||
"pseudoinverse of the overlap matrix of the auxiliary "// &
|
||||
"basis set. Calculating the pseudoinverse is necessary "// &
|
||||
"for very large auxiliary basis sets, but more expensive. "// &
|
||||
"Using the pseudoinverse, consistent forces are not "// &
|
||||
"guaranteed yet.", &
|
||||
usage="LRI_OVERLAP_MATRIX INVERSE", &
|
||||
enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
|
||||
"AUTOSELECT"), &
|
||||
enum_desc=s2a("Calculate inverse of the overlap matrix.", &
|
||||
"Calculate the pseuodinverse of the overlap matrix "// &
|
||||
"using singular value decomposition.", &
|
||||
"Calculate the pseudoinverse of the overlap matrix "// &
|
||||
"by prior diagonalization.", &
|
||||
"Choose automatically for each pair whether to "// &
|
||||
"calculate the inverse or pseudoinverse based on the "// &
|
||||
"condition number of the overlap matrix for each pair. "// &
|
||||
"Calculating the pseudoinverse is much more expensive."), &
|
||||
enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
|
||||
do_lri_pseudoinv_diag, do_lri_inv_auto/), &
|
||||
default_i_val=do_lri_inv)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="MAX_CONDITION_NUM", &
|
||||
description="If AUTOSELECT is chosen for LRI_OVERLAP_MATRIX, this "// &
|
||||
"keyword specifies that the pseudoinverse is calculated "// &
|
||||
"only if the LOG of the condition number of the lri "// &
|
||||
"overlap matrix is larger than the given value.", &
|
||||
usage="MAX_CONDITION_NUM 20.0", default_r_val=20.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EPS_O3_INT", &
|
||||
description="Threshold for ABA and ABB integrals in LRI. "// &
|
||||
"This is used for screening in the KS and "// &
|
||||
"force calculations (tensor contractions).", &
|
||||
usage="EPS_O3_INT 1.e-10", default_r_val=1.0e-14_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DEBUG_LRI_INTEGRALS", &
|
||||
description="Debug the integrals needed for LRIGPW.", &
|
||||
usage="DEBUG_LRI_INTEGRALS TRUE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="EXACT_1C_TERMS", &
|
||||
description="Don't use LRI for one center densities.", &
|
||||
usage="EXACT_1C_TERMS TRUE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PPL_RI", &
|
||||
description="Use LRI/RI for local pseudopotential.", &
|
||||
usage="PPL_RI TRUE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RI_STATISTIC", &
|
||||
description="Print statistical information on the RI calculation.", &
|
||||
usage="RI_STATISTIC TRUE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_APPROXIMATION", &
|
||||
description="Calculate distant pairs using an independent atom approximation.", &
|
||||
usage="DISTANT_PAIR_APPROXIMATION TRUE", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_METHOD", &
|
||||
description="Method used to separate pair density for distant pairs. "// &
|
||||
"Options: EW (equal weights); AW (atomic weights); SW (set weights); "// &
|
||||
"LW (shell function weights)", &
|
||||
usage="DISTANT_PAIR_METHOD {method}", &
|
||||
default_c_val="LW")
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_RADII", &
|
||||
description="Inner and outer radii used in distant "// &
|
||||
"pair separation. Smooth interpolation between inner and outer "// &
|
||||
"radius is used.", &
|
||||
usage="DISTANT_PAIR_RADII r_inner {real} r_outer {real} ", &
|
||||
n_var=2, default_r_vals=(/8._dp, 12._dp/), unit_str='bohr', &
|
||||
type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="SHG_LRI_INTEGRALS", &
|
||||
description="Uses the SHG (solid harmonic Gaussian) integral "// &
|
||||
"scheme instead of Obara-Saika", &
|
||||
usage="SHG_LRI_INTEGRALS TRUE", &
|
||||
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., &
|
||||
citations=(/Golze2017a/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RI_SINV", &
|
||||
description="Approximation to be used for the inverse of the "// &
|
||||
"RI overlap matrix. INVF, INVS: exact inverse, apply directly "// &
|
||||
"for solver (F:full matrix, S:sparsematrix). AINV approximate inverse, use with PCG. "// &
|
||||
"NONE: no approximation used with CG solver.", &
|
||||
usage="RI_SINV NONE", default_c_val="INVF")
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_lrigpw_section
|
||||
|
||||
END MODULE input_cp2k_qs
|
||||
1991
src/input_cp2k_scf.F
Normal file
1991
src/input_cp2k_scf.F
Normal file
File diff suppressed because it is too large
Load diff
463
src/input_cp2k_se.F
Normal file
463
src/input_cp2k_se.F
Normal file
|
|
@ -0,0 +1,463 @@
|
|||
!--------------------------------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
! !
|
||||
! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
!--------------------------------------------------------------------------------------------------!
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief function that build the semi empirical section of the input
|
||||
!> \par History
|
||||
!> 10.2005 moved out of input_cp2k [fawzi]
|
||||
!> 07.2024 moved out of input_cp2k [JGH]
|
||||
!> \author fawzi
|
||||
! **************************************************************************************************
|
||||
MODULE input_cp2k_se
|
||||
USE cp_output_handling, ONLY: cp_print_key_section_create,&
|
||||
high_print_level
|
||||
USE cp_units, ONLY: cp_unit_to_cp2k
|
||||
USE input_constants, ONLY: &
|
||||
do_se_is_kdso, do_se_is_kdso_d, do_se_is_slater, do_se_lr_ewald, do_se_lr_ewald_gks, &
|
||||
do_se_lr_ewald_r3, do_se_lr_none, gaussian, numerical, slater
|
||||
USE input_cp2k_mm, ONLY: create_neighbor_lists_section
|
||||
USE input_keyword_types, ONLY: keyword_create,&
|
||||
keyword_release,&
|
||||
keyword_type
|
||||
USE input_section_types, ONLY: section_add_keyword,&
|
||||
section_add_subsection,&
|
||||
section_create,&
|
||||
section_release,&
|
||||
section_type
|
||||
USE input_val_types, ONLY: char_t,&
|
||||
real_t
|
||||
USE kinds, ONLY: dp
|
||||
USE string_utilities, ONLY: s2a
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_se'
|
||||
|
||||
PUBLIC :: create_se_control_section
|
||||
|
||||
CONTAINS
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param section ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_se_control_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
TYPE(section_type), POINTER :: subsection
|
||||
|
||||
NULLIFY (keyword)
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="SE", &
|
||||
description="Parameters needed to set up the Semi-empirical methods", &
|
||||
n_keywords=8, n_subsections=0, repeats=.FALSE.)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ORTHOGONAL_BASIS", &
|
||||
description="Assume orthogonal basis set. This flag is overwritten by "// &
|
||||
"methods with fixed orthogonal/non-orthogonal basis set.", &
|
||||
usage="ORTHOGONAL_BASIS", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="STO_NG", &
|
||||
description="Provides the order of the Slater orbital expansion of Gaussian-Type Orbitals.", &
|
||||
usage="STO_NG", default_i_val=6)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="ANALYTICAL_GRADIENTS", &
|
||||
description="Nuclear Gradients are computed analytically or numerically", &
|
||||
usage="ANALYTICAL_GRADIENTS", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DELTA", &
|
||||
description="Step size in finite difference force calculation", &
|
||||
usage="DELTA {real} ", default_r_val=1.e-6_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="INTEGRAL_SCREENING", &
|
||||
description="Specifies the functional form for the ", &
|
||||
usage="INTEGRAL_SCREENING (KDSO|KDSO-D|SLATER)", &
|
||||
enum_c_vals=s2a("KDSO", "KDSO-D", "SLATER"), &
|
||||
enum_i_vals=(/do_se_IS_kdso, do_se_IS_kdso_d, do_se_IS_slater/), &
|
||||
enum_desc=s2a("Uses the standard NDDO Klopman-Dewar-Sabelli-Ohno equation "// &
|
||||
"for the screening of the Coulomb interactions.", &
|
||||
"Uses a modified Klopman-Dewar-Sabelli-Ohno equation, dumping the screening "// &
|
||||
"parameter for the Coulomb interactions.", &
|
||||
"Uses an exponential Slater-type function for modelling the Coulomb interactions."), &
|
||||
default_i_val=do_se_IS_kdso)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
|
||||
description="Specifies the type of treatment for the electrostatic long-range part "// &
|
||||
"in semi-empirical calculations.", &
|
||||
usage="PERIODIC (NONE|EWALD|EWALD_R3|EWALD_GKS)", &
|
||||
enum_c_vals=s2a("NONE", "EWALD", "EWALD_R3", "EWALD_GKS"), &
|
||||
enum_i_vals=(/do_se_lr_none, do_se_lr_ewald, do_se_lr_ewald_r3, do_se_lr_ewald_gks/), &
|
||||
enum_desc=s2a("The long-range part is not explicitly treaten. The interaction "// &
|
||||
"depends uniquely on the Cutoffs used for the calculation.", &
|
||||
"Enables the usage of Multipoles Ewald summation schemes. The short-range part "// &
|
||||
"is tapered according the value of RC_COULOMB.", &
|
||||
"Enables the usage of Multipoles Ewald summation schemes together with a long-range "// &
|
||||
"treatment for the 1/R^3 term, deriving from the short-range component. This option "// &
|
||||
"is active only for K-DSO integral screening type.", &
|
||||
"Use Ewald directly in Coulomb integral evaluation, works only with Slater screening"), &
|
||||
default_i_val=do_se_lr_none)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="FORCE_KDSO-D_EXCHANGE", &
|
||||
description="This keywords forces the usage of the KDSO-D integral screening "// &
|
||||
"for the Exchange integrals (default is to apply the screening only to the "// &
|
||||
"Coulomb integrals.", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISPERSION", &
|
||||
description="Use dispersion correction", &
|
||||
lone_keyword_l_val=.TRUE., &
|
||||
usage="DISPERSION", default_l_val=.FALSE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_PARAMETER_FILE", &
|
||||
description="Specify file that contains the atomic dispersion parameters", &
|
||||
usage="DISPERSION_PARAMETER_FILE filename", &
|
||||
n_var=1, type_of_var=char_t, default_c_val="")
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_RADIUS", &
|
||||
description="Define radius of dispersion interaction", &
|
||||
usage="DISPERSION_RADIUS", default_r_val=15._dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="COORDINATION_CUTOFF", &
|
||||
description="Define cutoff for coordination number calculation", &
|
||||
usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="D3_SCALING", &
|
||||
description="Scaling parameters (s6,sr6,s8) for the D3 dispersion method,", &
|
||||
usage="D3_SCALING 1.0 1.0 1.0", n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
NULLIFY (subsection)
|
||||
CALL create_coulomb_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_exchange_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_screening_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_lr_corr_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_neighbor_lists_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_se_memory_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_se_print_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
CALL create_se_ga_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
END SUBROUTINE create_se_control_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create the COULOMB se section
|
||||
!> \param section the section to create
|
||||
!> \date 03.2009
|
||||
!> \author Teodoro Laino [tlaino]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_lr_corr_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="LR_CORRECTION", &
|
||||
description="Setup parameters for the evaluation of the long-range correction term in SE "// &
|
||||
"calculations.", n_keywords=0, n_subsections=1, repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
|
||||
description="Atomic Cutoff Radius Cutoff for the evaluation of the long-ranbe correction integrals. ", &
|
||||
usage="CUTOFF {real} ", unit_str="angstrom", &
|
||||
default_r_val=cp_unit_to_cp2k(value=6.0_dp, unit_str="angstrom"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_TAPER", &
|
||||
description="Atomic Cutoff Radius Cutoff for Tapering the long-range correction integrals. "// &
|
||||
"If not specified it assumes the same value specified for the CUTOFF.", &
|
||||
usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_RANGE", &
|
||||
description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
|
||||
"where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
|
||||
usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_lr_corr_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create the COULOMB se section
|
||||
!> \param section the section to create
|
||||
!> \date 03.2009
|
||||
!> \author Teodoro Laino [tlaino]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_coulomb_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="COULOMB", &
|
||||
description="Setup parameters for the evaluation of the COULOMB term in SE "// &
|
||||
"calculations.", n_keywords=0, n_subsections=1, repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, name="CUTOFF", &
|
||||
description="Atomic Cutoff Radius Cutoff for the evaluation of the Coulomb integrals. "// &
|
||||
"For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
|
||||
"to evaluate all pair interactions. Instead, for periodic calculations the default numerical value is used.", &
|
||||
usage="CUTOFF {real} ", unit_str="angstrom", &
|
||||
default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_TAPER", &
|
||||
description="Atomic Cutoff Radius Cutoff for Tapering Coulomb integrals. "// &
|
||||
"If not specified it assumes the same value specified for the CUTOFF.", &
|
||||
usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_RANGE", &
|
||||
description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
|
||||
"where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
|
||||
usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_coulomb_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create the EXCHANGE se section
|
||||
!> \param section the section to create
|
||||
!> \date 03.2009
|
||||
!> \author Teodoro Laino [tlaino]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_exchange_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="EXCHANGE", &
|
||||
description="Setup parameters for the evaluation of the EXCHANGE and "// &
|
||||
"core Hamiltonian terms in SE calculations.", n_keywords=0, n_subsections=1, &
|
||||
repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
|
||||
description="Atomic Cutoff Radius Cutoff for the evaluation of the Exchange integrals. "// &
|
||||
"For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
|
||||
"to evaluate all pair interactions. Instead, for periodic calculations the default is the "// &
|
||||
"minimum value between 1/4 of the cell dimension and the value specified in input (either"// &
|
||||
" explicitly defined or the default numerical value).", &
|
||||
usage="CUTOFF {real} ", unit_str="angstrom", &
|
||||
default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_TAPER", &
|
||||
description="Atomic Cutoff Radius Cutoff for Tapering Exchange integrals. "// &
|
||||
"If not specified it assumes the same value specified for the CUTOFF.", &
|
||||
usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_RANGE", &
|
||||
description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
|
||||
"where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
|
||||
usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_exchange_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create the SCREENING se section
|
||||
!> \param section the section to create
|
||||
!> \date 03.2009
|
||||
!> \author Teodoro Laino [tlaino]
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_screening_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="SCREENING", &
|
||||
description="Setup parameters for the tapering of the Coulomb/Exchange Screening in "// &
|
||||
"KDSO-D integral scheme,", n_keywords=0, n_subsections=1, repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_TAPER", &
|
||||
description="Atomic Cutoff Radius Cutoff for Tapering the screening term. ", &
|
||||
usage="RC_TAPER {real} ", unit_str="angstrom", &
|
||||
default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="RC_RANGE", &
|
||||
description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
|
||||
"where r0=2*RC_TAPER-20*RC_RANGE.", &
|
||||
usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_screening_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Create the print se section
|
||||
!> \param section the section to create
|
||||
!> \author teo
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_se_print_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(section_type), POINTER :: print_key
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="print", &
|
||||
description="Section of possible print options in SE code.", &
|
||||
n_keywords=0, n_subsections=1, repeats=.FALSE.)
|
||||
|
||||
NULLIFY (print_key)
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "NEIGHBOR_LISTS", &
|
||||
description="Activates the printing of the neighbor lists used"// &
|
||||
" for the periodic SE calculations.", &
|
||||
print_level=high_print_level, filename="", unit_str="angstrom")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "SUBCELL", &
|
||||
description="Activates the printing of the subcells used for the "// &
|
||||
"generation of neighbor lists for periodic SE.", &
|
||||
print_level=high_print_level, filename="__STD_OUT__")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
CALL cp_print_key_section_create(print_key, __LOCATION__, "EWALD_INFO", &
|
||||
description="Activates the printing of the information for "// &
|
||||
"Ewald multipole summation in periodic SE.", &
|
||||
print_level=high_print_level, filename="__STD_OUT__")
|
||||
CALL section_add_subsection(section, print_key)
|
||||
CALL section_release(print_key)
|
||||
|
||||
END SUBROUTINE create_se_print_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief creates the input section for use with the GA part of the code
|
||||
!> \param section the section to create
|
||||
!> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_se_ga_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="GA", &
|
||||
description="Sets up memory parameters for the storage of the integrals", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, &
|
||||
name="NCELLS", &
|
||||
description="Defines the number of linked cells for the neighbor list. "// &
|
||||
"Default value is number of processors", &
|
||||
usage="NCELLS 10", &
|
||||
default_i_val=0)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
END SUBROUTINE create_se_ga_section
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief creates the input section for the se-memory part integral storage
|
||||
!> \param section the section to create
|
||||
!> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE create_se_memory_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CPASSERT(.NOT. ASSOCIATED(section))
|
||||
CALL section_create(section, __LOCATION__, name="MEMORY", &
|
||||
description="Sets up memory parameters for the storage of the integrals", &
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
NULLIFY (keyword)
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, &
|
||||
name="EPS_STORAGE", &
|
||||
description="Storage threshold for compression is EPS_STORAGE", &
|
||||
usage="EPS_STORAGE 1.0E-10", &
|
||||
default_r_val=1.0E-10_dp)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create( &
|
||||
keyword, __LOCATION__, &
|
||||
name="MAX_MEMORY", &
|
||||
description="Defines the maximum amount of memory [MB] used to store precomputed "// &
|
||||
"(possibly compressed) two-electron two-center integrals", &
|
||||
usage="MAX_MEMORY 256", &
|
||||
default_i_val=50)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, __LOCATION__, name="COMPRESS", &
|
||||
description="Enables the compression of the integrals in memory.", &
|
||||
usage="COMPRESS <LOGICAL>", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
END SUBROUTINE create_se_memory_section
|
||||
|
||||
END MODULE input_cp2k_se
|
||||
1027
src/input_cp2k_xas.F
Normal file
1027
src/input_cp2k_xas.F
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -28,7 +28,7 @@ MODULE scf_control_types
|
|||
outer_scf_optimizer_diis, outer_scf_optimizer_newton, outer_scf_optimizer_newton_ls, &
|
||||
outer_scf_optimizer_none, outer_scf_optimizer_sd, outer_scf_optimizer_secant, &
|
||||
outer_scf_s2_constraint, smear_energy_window, smear_fermi_dirac, smear_list
|
||||
USE input_cp2k_dft, ONLY: create_scf_section
|
||||
USE input_cp2k_scf, ONLY: create_scf_section
|
||||
USE input_enumeration_types, ONLY: enum_i2c,&
|
||||
enumeration_type
|
||||
USE input_keyword_types, ONLY: keyword_get,&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue