clening cell type (removing everything connected with units), removing UNIT keyword

from CELL and defining instead units for A,B,C and ABC keywords. Added two more keywords
in COORD sections to have an additional and disentangled control of the units for
coordinates (UNIT and SCALEDi, in &COORD). Updating the whole bunch of regtests and
resetting 9 for numerics (due to the new conversion tools). Several cosmetics.
Moreover, this commit introduces the possibility to have units also for output quantities.
At the moment this keyword is supported only for a minor set of print_keys (essentially
the ones that were depending on the unit_of_length of cell). More work to do on this
topic in the future.


svn-origin-rev: 7967
This commit is contained in:
Teodoro Laino 2008-11-25 10:57:52 +00:00
parent 11b2bacf76
commit 2154ba256c
1507 changed files with 1003 additions and 2770 deletions

View file

@ -20,11 +20,11 @@ MODULE atoms_input
USE atomic_kind_types, ONLY: atomic_kind_type,&
get_atomic_kind
USE cell_types, ONLY: cell_type,&
get_cell,&
pbc,&
scaled_to_real
USE cp_linked_list_val, ONLY: cp_sll_val_next,&
cp_sll_val_type
USE cp_units, ONLY: cp_unit_to_cp2k
USE f77_blas
USE input_section_types, ONLY: section_vals_get,&
section_vals_get_subs_vals,&
@ -70,7 +70,7 @@ CONTAINS
INTEGER, PARAMETER :: nblock_atom = 10000
CHARACTER(len=2*default_string_length) :: line_att
CHARACTER(len=default_string_length) :: my_default_index
CHARACTER(len=default_string_length) :: my_default_index, unit_str
INTEGER :: end_c, handle, iatom, ILEN, &
j, natom, output_unit, &
start_c, wrd
@ -78,7 +78,7 @@ CONTAINS
is_ok, my_overwrite, &
my_save_mem, &
scaled_coordinates
REAL(KIND=dp) :: r0(3), unit_of_length
REAL(KIND=dp) :: r0(3), unit_conv
TYPE(atom_info_type), POINTER :: atom_info
TYPE(cell_type), POINTER :: cell
TYPE(cp_logger_type), POINTER :: logger
@ -111,9 +111,10 @@ CONTAINS
!-----------------------------------------------------------------------------
atom_info => topology%atom_info
cell => topology%cell
CALL get_cell(cell=cell,&
scaled_coordinates=scaled_coordinates,&
unit_of_length=unit_of_length)
CALL section_vals_val_get(coord_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(coord_section,"SCALED",l_val=scaled_coordinates,error=error)
unit_conv = cp_unit_to_cp2k(1.0_dp,TRIM(unit_str),error=error)
!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------
! 2. Read in the coordinates from &COORD section in the input file
@ -233,7 +234,7 @@ CPSourceFileRef,&
r0 = atom_info%r(:,iatom)
CALL scaled_to_real(atom_info%r(:,iatom),r0,cell)
ELSE
atom_info%r(:,iatom) = atom_info%r(:,iatom)*unit_of_length
atom_info%r(:,iatom) = atom_info%r(:,iatom)*unit_conv
END IF
END DO
IF(my_save_mem) CALL section_vals_remove_values(coord_section, error)
@ -262,18 +263,18 @@ CPSourceFileRef,&
INTEGER, PARAMETER :: nblock_atom = 10000
CHARACTER(len=2*default_string_length) :: line_att
CHARACTER(len=default_string_length) :: name_kind
CHARACTER(len=default_string_length) :: name_kind, unit_str
CHARACTER(len=default_string_length), &
ALLOCATABLE, DIMENSION(:) :: at_name, at_name_c
INTEGER :: end_c, handle, ishell, istat, &
j, nshell, output_unit, &
sh_index, start_c, wrd
INTEGER, ALLOCATABLE, DIMENSION(:) :: at_index, at_index_c
LOGICAL :: explicit, failure, ionode, &
is_ok, is_shell, my_save_mem, &
scaled_coordinates
LOGICAL :: core_scaled_coordinates, explicit, failure, ionode, is_ok, &
is_shell, my_save_mem, shell_scaled_coordinates
REAL(KIND=dp) :: dab, mass_com, rab(3), &
unit_of_length
unit_conv_core, &
unit_conv_shell
REAL(KIND=dp), ALLOCATABLE, &
DIMENSION(:, :) :: r, rc
TYPE(atomic_kind_type), POINTER :: atomic_kind
@ -301,14 +302,13 @@ CPSourceFileRef,&
IF (.NOT.explicit) RETURN
CALL timeset(routineN,handle)
CALL get_cell(cell=cell,&
scaled_coordinates=scaled_coordinates,&
unit_of_length=unit_of_length)
!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------
! 2. Read in the coordinates from &SHELL_COORD section in the input file
!-----------------------------------------------------------------------------
CALL section_vals_val_get(shell_coord_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(shell_coord_section,"SCALED",l_val=shell_scaled_coordinates,error=error)
unit_conv_shell = cp_unit_to_cp2k(1.0_dp,TRIM(unit_str),error=error)
CALL section_vals_val_get(shell_coord_section,"_DEFAULT_KEYWORD_",&
n_rep_val=nshell,error=error)
@ -361,6 +361,9 @@ CPSourceFileRef,&
core_coord_section => section_vals_get_subs_vals(subsys_section,"core_COORD",error=error)
CALL section_vals_get(core_coord_section, explicit=explicit, error=error)
IF(explicit) THEN
CALL section_vals_val_get(core_coord_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(core_coord_section,"SCALED",l_val=core_scaled_coordinates,error=error)
unit_conv_core = cp_unit_to_cp2k(1.0_dp,TRIM(unit_str),error=error)
CALL section_vals_val_get(core_coord_section,"_DEFAULT_KEYWORD_",&
n_rep_val=nshell,error=error)
@ -421,10 +424,10 @@ CPSourceFileRef,&
CALL uppercase(name_kind)
IF((TRIM(at_name(ishell))==TRIM(name_kind)).AND. is_shell) THEN
sh_index = particle_set(at_index(ishell))%shell_index
IF (scaled_coordinates) THEN
IF (shell_scaled_coordinates) THEN
CALL scaled_to_real(r(:,ishell),shell_particle_set(sh_index)%r(:),cell)
ELSE
shell_particle_set(sh_index)%r(:) = r(:,ishell)*unit_of_length
shell_particle_set(sh_index)%r(:) = r(:,ishell)*unit_conv_shell
END IF
shell_particle_set(sh_index)%atom_index=at_index(ishell)
@ -438,10 +441,10 @@ CPSourceFileRef,&
core_particle_set(sh_index)%atom_index=at_index(ishell)
rab = pbc(shell_particle_set(sh_index)%r,core_particle_set(sh_index)%r,cell)
ELSE IF(explicit) THEN
IF (scaled_coordinates) THEN
IF (core_scaled_coordinates) THEN
CALL scaled_to_real(rc(:,ishell),core_particle_set(sh_index)%r(:),cell)
ELSE
core_particle_set(sh_index)%r(:) = rc(:,ishell)*unit_of_length
core_particle_set(sh_index)%r(:) = rc(:,ishell)*unit_conv_core
END IF
core_particle_set(sh_index)%atom_index=at_index_c(ishell)
rab = pbc(shell_particle_set(sh_index)%r,core_particle_set(sh_index)%r,cell)

View file

@ -5,7 +5,7 @@
! *****************************************************************************
!> \par History
!> none
!> 11.2008 Teodoro Laino [tlaino] - deeply cleaning cell_type from units
!> \author MK (16.01.2002, based on a earlier version of CJM and JGH)
! *****************************************************************************
MODULE cell_types
@ -16,14 +16,13 @@ MODULE cell_types
USE cp_parser_types, ONLY: cp_parser_type,&
parser_create,&
parser_release
USE cp_units, ONLY: cp_unit_to_cp2k,&
USE cp_units, ONLY: cp_unit_from_cp2k,&
cp_unit_to_cp2k,&
cp_units_rad
USE f77_blas
USE input_constants, ONLY: &
do_cell_cp2k, do_cell_xsc, use_perd_none, use_perd_x, use_perd_xy, &
use_perd_xyz, use_perd_xz, use_perd_y, use_perd_yz, use_perd_z, &
use_unit_angstrom, use_unit_bohr, use_unit_scaled_angstrom, &
use_unit_scaled_bohr
use_perd_xyz, use_perd_xz, use_perd_y, use_perd_yz, use_perd_z
USE input_cp2k, ONLY: parsed_cp2k_input
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_type,&
@ -31,12 +30,12 @@ MODULE cell_types
section_vals_val_set,&
section_vals_val_unset
USE kinds, ONLY: default_path_length,&
default_string_length,&
dp
USE mathconstants, ONLY: degree
USE mathlib, ONLY: angle,&
det_3x3,&
inv_3x3
USE physcon, ONLY: bohr
USE termination, ONLY: stop_program
#include "cp_common_uses.h"
@ -53,11 +52,6 @@ MODULE cell_types
!> \version 1.0
! *****************************************************************************
TYPE cell_type
!FM to rm
CHARACTER(LEN=8) :: unit_of_length_name
REAL(KIND = dp) :: unit_of_length
LOGICAL :: scaled_coordinates
!FM probably to rm
REAL(KIND = dp) :: subcells
@ -107,17 +101,13 @@ CONTAINS
CPPrecondition(ASSOCIATED(cell_2),cp_failure_level,routineP,error,failure)
compare = (&
(cell_2%unit_of_length_name == cell_1%unit_of_length_name).AND.&
(cell_2%deth == cell_1%deth).AND.&
(cell_2%subcells == cell_1%subcells).AND.&
(cell_2%unit_of_length == cell_1%unit_of_length).AND.&
(ALL(cell_2%perd == cell_1%perd)).AND.&
(ALL(cell_2%hmat == cell_1%hmat)).AND.&
(ALL(cell_2%h_inv == cell_1%h_inv)).AND.&
(((.NOT.cell_2%orthorhombic) .OR. cell_1%orthorhombic).AND.&
(cell_2%orthorhombic .OR. (.NOT.cell_1%orthorhombic))).AND.&
(((.NOT.cell_2%scaled_coordinates) .OR. cell_1%scaled_coordinates).AND.&
(cell_2%scaled_coordinates .OR. (.NOT.cell_1%scaled_coordinates))))
(cell_2%orthorhombic .OR. (.NOT.cell_1%orthorhombic))))
END FUNCTION compare_cells
@ -135,15 +125,12 @@ CONTAINS
CPPrecondition(ASSOCIATED(cell_in),cp_failure_level,routineP,error,failure)
CPPrecondition(ASSOCIATED(cell_out),cp_failure_level,routineP,error,failure)
cell_out%unit_of_length_name = cell_in%unit_of_length_name
cell_out%deth = cell_in%deth
cell_out%subcells = cell_in%subcells
cell_out%unit_of_length = cell_in%unit_of_length
cell_out%perd = cell_in%perd
cell_out%hmat = cell_in%hmat
cell_out%h_inv = cell_in%h_inv
cell_out%orthorhombic = cell_in%orthorhombic
cell_out%scaled_coordinates= cell_in%scaled_coordinates
cell_out%ref_count = 1
last_cell_id = last_cell_id + 1
cell_out%id_nr = last_cell_id
@ -186,14 +173,12 @@ CONTAINS
!> \date 16.01.2002
!> \version 1.0
! *****************************************************************************
SUBROUTINE get_cell(cell,unit_of_length_name,alpha,beta,gamma,deth,subcells,&
unit_of_length,orthorhombic,scaled_coordinates,abc,periodic,h,h_inv,id_nr)
SUBROUTINE get_cell(cell,alpha,beta,gamma,deth,subcells,orthorhombic,abc,&
periodic,h,h_inv,id_nr)
TYPE(cell_type), POINTER :: cell
CHARACTER(LEN=8), INTENT(OUT), OPTIONAL :: unit_of_length_name
REAL(KIND=dp), INTENT(OUT), OPTIONAL :: alpha, beta, gamma, deth, &
subcells, unit_of_length
LOGICAL, INTENT(OUT), OPTIONAL :: orthorhombic, &
scaled_coordinates
subcells
LOGICAL, INTENT(OUT), OPTIONAL :: orthorhombic
REAL(KIND=dp), DIMENSION(3), &
INTENT(OUT), OPTIONAL :: abc
INTEGER, DIMENSION(3), INTENT(OUT), &
@ -202,13 +187,8 @@ CONTAINS
INTENT(OUT), OPTIONAL :: h, h_inv
INTEGER, INTENT(out), OPTIONAL :: id_nr
IF (PRESENT(unit_of_length_name))&
unit_of_length_name = cell%unit_of_length_name
IF (PRESENT(unit_of_length)) unit_of_length = cell%unit_of_length
IF (PRESENT(deth)) deth = cell%deth
IF (PRESENT(orthorhombic)) orthorhombic = cell%orthorhombic
IF (PRESENT(scaled_coordinates))&
scaled_coordinates = cell%scaled_coordinates
IF (PRESENT(periodic)) periodic(:) = cell%perd(:)
IF (PRESENT(subcells)) subcells = cell%subcells
IF (PRESENT(h)) h(:,:) = cell%hmat(:,:)
@ -533,7 +513,7 @@ CONTAINS
CHARACTER(len=*), PARAMETER :: routineN = 'read_cell', &
routineP = moduleN//':'//routineN
INTEGER :: my_per, my_val, n_rep
INTEGER :: my_per, n_rep
LOGICAL :: failure, my_check
REAL(KIND=dp), DIMENSION(:), POINTER :: cell_par
TYPE(section_vals_type), POINTER :: cell_ref_section
@ -546,11 +526,8 @@ CONTAINS
IF (.NOT.ASSOCIATED(cell_ref)) CALL cell_create(cell_ref,error=error)
IF (PRESENT(check_for_ref)) my_check = check_for_ref
cell%unit_of_length_name = "BOHR"
cell%deth = 0.0_dp
cell%unit_of_length = 1.0_dp
cell%orthorhombic = .TRUE.
cell%scaled_coordinates = .FALSE.
cell%perd(:) = 1
cell%hmat(:,:) = 0.0_dp
cell%h_inv(:,:) = 0.0_dp
@ -603,28 +580,6 @@ CONTAINS
CPPostcondition(.FALSE.,cp_failure_level,routineP,error,failure)
END SELECT
CALL section_vals_val_get(cell_section,"UNITS",i_val=my_val,error=error)
SELECT CASE (my_val)
CASE (use_unit_angstrom)
cell%unit_of_length = bohr
cell%unit_of_length_name = "ANGSTROM"
cell%scaled_coordinates = .FALSE.
CASE (use_unit_bohr)
cell%unit_of_length = 1.0_dp
cell%unit_of_length_name = "BOHR"
cell%scaled_coordinates = .FALSE.
CASE (use_unit_scaled_angstrom)
cell%unit_of_length = bohr
cell%unit_of_length_name = "ANGSTROM"
cell%scaled_coordinates = .TRUE.
CASE (use_unit_scaled_bohr)
cell%unit_of_length = 1.0_dp
cell%unit_of_length_name = "BOHR"
cell%scaled_coordinates = .TRUE.
CASE DEFAULT
CPPostcondition(.FALSE.,cp_failure_level,routineP,error,failure)
END SELECT
cell%hmat(:,:) = cell%hmat(:,:)*cell%unit_of_length
CALL init_cell(cell)
IF (.NOT.my_check) RETURN
@ -657,7 +612,8 @@ CONTAINS
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_path_length) :: cell_file_name
INTEGER :: idum, my_format, n_rep, stat
INTEGER :: i, idum, j, my_format, n_rep, &
stat
LOGICAL :: explicit, failure, my_end
REAL(KIND=dp) :: xdum
REAL(KIND=dp), DIMENSION(3, 3) :: hmat
@ -684,6 +640,12 @@ CONTAINS
CALL parser_release(parser,error=error)
CALL section_vals_val_unset(cell_section,"CELL_FILE_NAME",error=error)
CALL section_vals_val_unset(cell_section,"CELL_FILE_FORMAT",error=error)
! Conver to CP2K units
DO i = 1, 3
DO j = 1, 3
hmat(j,i) = cp_unit_to_cp2k(hmat(j,i), "angstrom", error=error)
END DO
END DO
! Check if the cell was already defined
explicit = .FALSE.
CALL section_vals_val_get(cell_section,"A",n_rep_val=n_rep,error=error)
@ -769,76 +731,60 @@ CPSourceFileRef,&
!> \author MK
!> \date 02.06.2000
!> \version 1.0
!> \par History
!> - 11.2008 Teodoro Laino [tlaino] - rewrite and enabling user driven units
! *****************************************************************************
SUBROUTINE write_cell(cell,subsys_section,cell_ref,error)
RECURSIVE SUBROUTINE write_cell(cell,subsys_section,cell_ref,label,error)
TYPE(cell_type), POINTER :: cell
TYPE(section_vals_type), POINTER :: subsys_section
TYPE(cell_type), OPTIONAL, POINTER :: cell_ref
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: label
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(len=*), PARAMETER :: routineN = 'write_cell', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_string_length) :: my_label, unit_str
INTEGER :: output_unit
REAL(KIND=dp) :: alpha, beta, gamma
REAL(KIND=dp) :: alpha, beta, gamma, val
REAL(KIND=dp), DIMENSION(3) :: abc
TYPE(cp_logger_type), POINTER :: logger
NULLIFY(logger)
logger => cp_error_get_logger(error)
my_label = "CELL|"
IF (PRESENT(label)) my_label = TRIM(label)
output_unit = cp_print_key_unit_nr(logger,subsys_section,"PRINT%CELL",&
extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%CELL%UNIT",c_val=unit_str,error=error)
IF (output_unit>0) THEN
CALL get_cell(cell=cell,abc=abc,alpha=alpha,beta=beta,gamma=gamma)
WRITE (UNIT=output_unit, FMT='( )')
val = cp_unit_from_cp2k(cell%deth,TRIM(unit_str)//"^3",error=error)
WRITE (UNIT=output_unit,FMT="(T2,A,T61,F20.3)")&
"CELL| Volume ["//TRIM(cell%unit_of_length_name)//"**3]:",&
cell%deth/cell%unit_of_length**3
TRIM(my_label)//" Volume ["//TRIM(unit_str)//"^3]:",val
val = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
WRITE (UNIT=output_unit,FMT="(T2,A,T30,3F10.3,4X,A6,F11.3)")&
"CELL| Vector a ["//TRIM(cell%unit_of_length_name)//"]:",&
cell%hmat(:,1)/cell%unit_of_length,&
"|a| = ",abc(1)/cell%unit_of_length,&
"CELL| Vector b ["//TRIM(cell%unit_of_length_name)//"]:",&
cell%hmat(:,2)/cell%unit_of_length,&
"|b| = ",abc(2)/cell%unit_of_length,&
"CELL| Vector c ["//TRIM(cell%unit_of_length_name)//"]:",&
cell%hmat(:,3)/cell%unit_of_length,&
"|c| = ",abc(3)/cell%unit_of_length
TRIM(my_label)//" Vector a ["//TRIM(unit_str)//"]:", cell%hmat(:,1)*val,&
"|a| = ",abc(1)*val,&
TRIM(my_label)//" Vector b ["//TRIM(unit_str)//"]:",cell%hmat(:,2)*val,&
"|b| = ",abc(2)*val,&
TRIM(my_label)//" Vector c ["//TRIM(unit_str)//"]:",cell%hmat(:,3)*val,&
"|c| = ",abc(3)*val
WRITE (UNIT=output_unit,FMT="(T2,A,T70,F11.3)")&
"CELL| Angle (b,c), alpha [degree]: ",alpha,&
"CELL| Angle (a,c), beta [degree]: ",beta,&
"CELL| Angle (a,b), gamma [degree]: ",gamma
TRIM(my_label)//" Angle (b,c), alpha [degree]: ",alpha,&
TRIM(my_label)//" Angle (a,c), beta [degree]: ",beta,&
TRIM(my_label)//" Angle (a,b), gamma [degree]: ",gamma
WRITE (UNIT=output_unit,FMT="(T2,A,T70,F11.3)")&
"CELL| Grid size for subcell generation",cell%subcells
IF ( PRESENT ( cell_ref ) ) THEN
WRITE (UNIT=output_unit, FMT='( )' )
CALL get_cell(cell=cell_ref,abc=abc,alpha=alpha,beta=beta,gamma=gamma)
WRITE (UNIT=output_unit,FMT="(T2,A,T61,F20.3)")&
"CELL_REF| Volume ["//TRIM(cell_ref%unit_of_length_name)//"**3]:",&
cell_ref%deth/cell%unit_of_length**3
WRITE (UNIT=output_unit,FMT="(T2,A,T30,3F10.3,4X,A6,F11.3)")&
"CELL_REF| Vector a ["//TRIM(cell_ref%unit_of_length_name)//"]:",&
cell_ref%hmat(:,1)/cell_ref%unit_of_length,&
"|a| = ",abc(1)/cell_ref%unit_of_length,&
"CELL_REF| Vector b ["//TRIM(cell_ref%unit_of_length_name)//"]:",&
cell_ref%hmat(:,2)/cell_ref%unit_of_length,&
"|b| = ",abc(2)/cell_ref%unit_of_length,&
"CELL_REF| Vector c ["//TRIM(cell_ref%unit_of_length_name)//"]:",&
cell_ref%hmat(:,3)/cell_ref%unit_of_length,&
"|c| = ",abc(3)/cell_ref%unit_of_length
WRITE (UNIT=output_unit,FMT="(T2,A,T70,F11.3)")&
"CELL_REF| Angle (b,c), alpha [degree]: ",alpha,&
"CELL_REF| Angle (a,c), beta [degree]: ",beta,&
"CELL_REF| Angle (a,b), gamma [degree]: ",gamma
WRITE (UNIT=output_unit,FMT="(T2,A,T70,F11.3)")&
"CELL_REF| Grid size for subcell generation",cell_ref%subcells
ENDIF
TRIM(my_label)//" Grid size for subcell generation",cell%subcells
END IF
CALL cp_print_key_finished_output(output_unit,logger,subsys_section,&
"PRINT%CELL",error=error)
IF (PRESENT(cell_ref)) THEN
CALL write_cell(cell_ref, subsys_section, label="CELL_REF|", error=error)
ENDIF
END SUBROUTINE write_cell
! *****************************************************************************

View file

@ -146,11 +146,14 @@ CONTAINS
!> (defaults to debug_print_level)
!> \param error variable to control error logging, stopping,...
!> see module cp_error_handling
!> \param unit_str specifies an unit of measure for output quantity. If not
!> provided the control is totally left to how the output was coded
!> (i.e. USERS have no possibility to change it)
!> \author fawzi
! *****************************************************************************
SUBROUTINE cp_print_key_section_create(print_key_section, name, description, &
print_level,each_iter_names,each_iter_values,add_last,filename,&
common_iter_levels,citations,supported_feature,error)
common_iter_levels,citations,supported_feature,unit_str,error)
TYPE(section_type), POINTER :: print_key_section
CHARACTER(len=*), INTENT(IN) :: name, description
INTEGER, INTENT(IN), OPTIONAL :: print_level
@ -163,6 +166,7 @@ CONTAINS
INTEGER, INTENT(IN), OPTIONAL :: common_iter_levels
INTEGER, DIMENSION(:), OPTIONAL :: citations
LOGICAL, INTENT(IN), OPTIONAL :: supported_feature
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: unit_str
TYPE(cp_error_type), INTENT(INOUT) :: error
CHARACTER(len=*), PARAMETER :: routineN = 'cp_print_key_section_create', &
@ -298,6 +302,16 @@ CONTAINS
default_i_val=cp_out_default, supported_feature=supported_feature,error=error)
CALL section_add_keyword(print_key_section,keyword,error=error)
CALL keyword_release(keyword,error=error)
IF (PRESENT(unit_str)) THEN
CALL keyword_create(keyword, name="UNIT",&
description='Specify the unit of measurement for the quantity in output. '//&
"All available CP2K units can be used.",&
usage="UNIT angstrom",default_c_val=TRIM(unit_str),supported_feature=supported_feature,&
error=error)
CALL section_add_keyword(print_key_section,keyword,error=error)
CALL keyword_release(keyword,error=error)
END IF
END IF
END SUBROUTINE cp_print_key_section_create

View file

@ -178,7 +178,7 @@ SUBROUTINE fist_init ( fist_env, root_section,para_env, force_env_section,&
CALL get_cell (cell, abc=abc)
! Print the cell parameters
CALL write_cell ( cell, subsys_section, cell_ref, error)
CALL write_cell ( cell, subsys_section, cell_ref, error=error)
! Create the ewald environment
CALL ewald_env_create ( ewald_env, para_env, error )

View file

@ -30,6 +30,7 @@ MODULE fist_neighbor_lists
cp_print_key_should_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_units, ONLY: cp_unit_from_cp2k
USE distribution_1d_types, ONLY: distribution_1d_type
USE f77_blas
USE fist_neighbor_list_types, ONLY: fist_neighbor_add,&
@ -37,7 +38,8 @@ MODULE fist_neighbor_lists
fist_neighbor_init,&
fist_neighbor_type,&
neighbor_kind_pairs_type
USE input_section_types, ONLY: section_vals_type
USE input_section_types, ONLY: section_vals_type,&
section_vals_val_get
USE kinds, ONLY: default_string_length,&
dp
USE mathlib, ONLY: matvec_3x3
@ -64,8 +66,7 @@ MODULE fist_neighbor_lists
! Public subroutines
PUBLIC :: build_fist_neighbor_lists,&
build_neighbor_lists,&
write_neighbor_lists
build_neighbor_lists
CONTAINS
@ -99,7 +100,8 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: routineN = 'build_fist_neighbor_lists', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_string_length) :: kind_name, print_key_path
CHARACTER(LEN=default_string_length) :: kind_name, print_key_path, &
unit_str
INTEGER :: atom_a, handle, iatom_local, ikind, iw, maxatom, &
maxatom_local, natom_local_a, nkind, output_unit, stat
LOGICAL :: failure, &
@ -202,8 +204,9 @@ CONTAINS
log_filename=.FALSE.,&
file_position="REWIND",&
error=error)
CALL section_vals_val_get(mm_section,TRIM(print_key_path)//"%UNIT",c_val=unit_str,error=error)
CALL write_neighbor_lists(nonbonded,particle_set,cell,para_env,iw,&
"NONBONDED NEIGHBOR LISTS",error)
"NONBONDED NEIGHBOR LISTS",unit_str,error)
CALL cp_print_key_finished_output(unit_nr=iw,&
logger=logger,&
basis_section=mm_section,&
@ -682,7 +685,7 @@ CONTAINS
!> \author Teodoro Laino
! *****************************************************************************
SUBROUTINE write_neighbor_lists(nonbonded,particle_set,cell,para_env,output_unit,&
name,error)
name,unit_str,error)
TYPE(fist_neighbor_type), POINTER :: nonbonded
TYPE(particle_type), DIMENSION(:), &
@ -690,32 +693,28 @@ CONTAINS
TYPE(cell_type), POINTER :: cell
TYPE(cp_para_env_type), POINTER :: para_env
INTEGER, INTENT(IN) :: output_unit
CHARACTER(LEN=*), INTENT(IN) :: name
CHARACTER(LEN=*), INTENT(IN) :: name, unit_str
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: string
INTEGER :: atom_a, atom_b, iab, ilist, &
mype, nneighbor
LOGICAL :: print_headline
REAL(dp) :: dab, unit_of_length
REAL(dp) :: conv, dab
REAL(dp), DIMENSION(3) :: cell_v, ra, rab, rb
TYPE(neighbor_kind_pairs_type), POINTER :: neighbor_kind_pair
mype = para_env%mepos
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
! Print headline
string = ""
WRITE (UNIT=string,FMT="(A,I5,A)")&
TRIM(name)//" IN "//TRIM(unit_of_length_name)//" (PROCESS",mype,")"
TRIM(name)//" IN "//TRIM(unit_str)//" (PROCESS",mype,")"
CALL compress(string)
IF (output_unit > 0) WRITE (UNIT=output_unit,FMT="(/,/,T2,A)") TRIM(string)
print_headline = .TRUE.
nneighbor = 0
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
DO iab=1,SIZE(nonbonded%neighbor_kind_pairs)
neighbor_kind_pair => nonbonded%neighbor_kind_pairs(iab)
CALL matvec_3x3(cell_v, cell%hmat,REAL(neighbor_kind_pair%cell_vector,KIND=dp))
@ -736,10 +735,10 @@ CONTAINS
rab = rb(:)-ra(:)+cell_v
dab = SQRT(DOT_PRODUCT(rab,rab))
WRITE (UNIT=output_unit,FMT="(/,T3,2(I6,3(1X,F10.6)),3(1X,I3),10X,F8.4)")&
atom_a,ra(1:3)/unit_of_length,&
atom_b,rb(1:3)/unit_of_length,&
atom_a,ra(1:3)*conv,&
atom_b,rb(1:3)*conv,&
neighbor_kind_pair%cell_vector,&
dab
dab*conv
END IF
END DO ! ilist
END DO ! iab

View file

@ -204,11 +204,6 @@ MODULE input_constants
do_method_dftb=14,&
do_method_pchg=15
INTEGER, PARAMETER, PUBLIC :: use_unit_angstrom=0,&
use_unit_bohr=1,&
use_unit_scaled_angstrom=2,&
use_unit_scaled_bohr=3
INTEGER, PARAMETER, PUBLIC :: rsgrid_distributed=0,&
rsgrid_replicated=1,&
rsgrid_automatic=2

View file

@ -831,8 +831,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key_section=print_key,&
name="neighbor_lists",&
description="Controls the printing of the neighbor lists",&
print_level=debug_print_level,&
filename="",&
print_level=debug_print_level, filename="", unit_str="angstrom",&
error=error)
CALL keyword_create(keyword=keyword,&
name="sab_orb",&
@ -980,7 +979,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"SUBCELL",&
description="Activates the printing of the subcells used for the"//&
"generation of neighbor lists.", &
"generation of neighbor lists.", unit_str="angstrom",&
print_level=high_print_level,filename="__STD_OUT__",&
error=error)
CALL section_add_subsection(section,print_key,error=error)
@ -1142,23 +1141,25 @@ CONTAINS
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)
CALL cp_print_key_section_create(print_key,"gapw",&
description="Controls the printing of some gapw related information (debug).", &
print_level=debug_print_level,filename="__STD_OUT__",&
CALL section_create(subsection,name="GAPW",&
description="Controls the printing of some gapw related information (debug).",&
n_keywords=0, n_subsections=1, repeats=.FALSE., required=.TRUE.,&
error=error)
CALL keyword_create(keyword, name="projectors",&
CALL cp_print_key_section_create(print_key,"projectors",&
description="If the printkey is activated controls if information on"//&
" the projectors is printed.",&
default_l_val=.TRUE.,lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="rho0_information",&
description="If the printkey is activated controls if information on rho0 is printed.",&
default_l_val=.TRUE.,lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL section_add_subsection(section,print_key,error=error)
print_level=debug_print_level,filename="__STD_OUT__",&
error=error)
CALL section_add_subsection(subsection,print_key,error=error)
CALL section_release(print_key,error=error)
CALL cp_print_key_section_create(print_key,"rho0_information",&
description="If the printkey is activated controls if information on rho0 is printed.",&
print_level=debug_print_level,filename="__STD_OUT__",unit_str="angstrom",&
error=error)
CALL section_add_subsection(subsection,print_key,error=error)
CALL section_release(print_key,error=error)
CALL section_add_subsection(section,subsection,error=error)
CALL section_release(subsection,error=error)
CALL cp_print_key_section_create(print_key,"dft_control_parameters",&
description="Controls the printing of dft control parameters.", &
@ -2292,7 +2293,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"NEIGHBOR_LISTS",&
description="Activates the printing of the neighbor lists used"//&
" for the periodic SE calculations.", &
print_level=high_print_level,filename="",&
print_level=high_print_level,filename="",unit_str="angstrom",&
error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)

View file

@ -177,7 +177,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"NEIGHBOR_LISTS",&
description="Activates the printing of the neighbor lists.", &
print_level=high_print_level,filename="",&
print_level=high_print_level,filename="",unit_str="angstrom",&
error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)

View file

@ -849,7 +849,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"cell",&
description="Controls the printing of the cell eveytime a calculation using a new cell is started.", &
print_level=low_print_level,add_last=add_last_numeric,filename="__STD_OUT__",&
error=error)
unit_str="angstrom",error=error)
CALL section_add_subsection(subsection,print_key,error=error)
CALL section_release(print_key,error=error)
CALL section_add_subsection(section,subsection,error=error)

View file

@ -27,6 +27,7 @@ MODULE input_cp2k_restarts
USE cp_para_types, ONLY: cp_para_env_type
USE cp_subsys_types, ONLY: cp_subsys_get,&
cp_subsys_type
USE cp_units, ONLY: cp_unit_from_cp2k
USE csvr_system_types, ONLY: csvr_system_type
USE distribution_1d_types, ONLY: distribution_1d_type
USE dynamical_coeff_types, ONLY: dyn_coeff_set_type,&
@ -43,10 +44,13 @@ MODULE input_cp2k_restarts
force_env_type,&
multiple_fe_list,&
use_qmmm
USE input_constants, ONLY: &
do_band_collective, do_thermo_csvr, do_thermo_no_communication, &
do_thermo_nose, mol_dyn_run, mon_car_run, pint_run, use_unit_angstrom, &
use_unit_bohr, use_unit_scaled_angstrom, use_unit_scaled_bohr
USE input_constants, ONLY: do_band_collective,&
do_thermo_csvr,&
do_thermo_no_communication,&
do_thermo_nose,&
mol_dyn_run,&
mon_car_run,&
pint_run
USE input_section_types, ONLY: &
section_get_keyword_index, section_type, section_vals_add_values, &
section_vals_get, section_vals_get_subs_vals, &
@ -79,7 +83,6 @@ MODULE input_cp2k_restarts
rng_record_length
USE particle_list_types, ONLY: particle_list_type
USE particle_types, ONLY: particle_type
USE physcon, ONLY: bohr
USE qmmm_ff_fist, ONLY: qmmm_ff_precond_only_qm
USE string_utilities, ONLY: ascii_to_string,&
string_to_ascii
@ -247,10 +250,11 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: routineN = 'update_subsys_release', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: handle, iforce_eval, myid, &
nforce_eval
INTEGER, DIMENSION(:), POINTER :: i_force_eval
LOGICAL :: explicit, failure, &
LOGICAL :: explicit, failure, scale, &
skip_vel_section
TYPE(cp_subsys_type), POINTER :: subsys
TYPE(force_env_type), POINTER :: my_force_b, my_force_env
@ -296,7 +300,16 @@ CONTAINS
core_particles=core_particles, error=error)
work_section => section_vals_get_subs_vals(subsys_section,"COORD",error=error)
CALL section_vals_get(work_section,explicit=explicit,error=error)
IF (explicit) THEN
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,error=error)
END IF
CALL section_vals_remove_values(work_section, error)
IF (explicit) THEN
CALL section_vals_val_set(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_set(work_section,"SCALED",l_val=scale,error=error)
END IF
work_section => section_vals_get_subs_vals(subsys_section,"VELOCITY",error=error)
IF (.NOT.skip_vel_section) THEN
@ -305,7 +318,17 @@ CONTAINS
IF(ASSOCIATED(shell_particles)) THEN
work_section => section_vals_get_subs_vals(subsys_section,"SHELL_COORD",error=error)
CALL Section_vals_remove_values(work_section, error=error)
CALL section_vals_get(work_section,explicit=explicit,error=error)
IF (explicit) THEN
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,error=error)
END IF
CALL section_vals_remove_values(work_section, error=error)
IF (explicit) THEN
CALL section_vals_val_set(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_set(work_section,"SCALED",l_val=scale,error=error)
END IF
work_section => section_vals_get_subs_vals(subsys_section,"SHELL_VELOCITY",error=error)
IF (.NOT.skip_vel_section) THEN
CALL section_vals_remove_values(work_section, error=error)
@ -314,7 +337,17 @@ CONTAINS
IF(ASSOCIATED(core_particles)) THEN
work_section => section_vals_get_subs_vals(subsys_section,"CORE_COORD",error=error)
CALL Section_vals_remove_values(work_section, error=error)
CALL section_vals_get(work_section,explicit=explicit,error=error)
IF (explicit) THEN
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,error=error)
END IF
CALL section_vals_remove_values(work_section, error=error)
IF (explicit) THEN
CALL section_vals_val_set(work_section,"UNIT",c_val=unit_str,error=error)
CALL section_vals_val_set(work_section,"SCALED",l_val=scale,error=error)
END IF
work_section => section_vals_get_subs_vals(subsys_section,"CORE_VELOCITY",error=error)
IF (.NOT.skip_vel_section) THEN
CALL section_vals_remove_values(work_section, error=error)
@ -1577,7 +1610,8 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: routineN = 'update_subsys', &
routineP = moduleN//':'//routineN
INTEGER :: handle, my_unit
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: handle
LOGICAL :: failure, scale, use_ref_cell
REAL(KIND=dp) :: conv_factor
TYPE(cell_type), POINTER :: cell, cell_ref
@ -1598,19 +1632,11 @@ CONTAINS
CALL cp_subsys_get(subsys, particles=particles, molecules_new=molecules,&
shell_particles=shell_particles, core_particles=core_particles,&
multipoles=multipoles, error=error)
work_section => section_vals_get_subs_vals(subsys_section,"COORD",error=error)
CALL section_vals_val_get(subsys_section,"CELL%UNITS",i_val=my_unit,error=error)
scale = .FALSE.
SELECT CASE(my_unit)
CASE (use_unit_angstrom,use_unit_scaled_angstrom)
conv_factor = bohr
IF (my_unit==use_unit_scaled_angstrom) scale = .TRUE.
CASE (use_unit_bohr,use_unit_scaled_bohr)
conv_factor = 1.0_dp
IF (my_unit==use_unit_scaled_bohr) scale = .TRUE.
CASE DEFAULT
CPPostcondition(.FALSE.,cp_failure_level,routineP,error,failure)
END SELECT
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,ignore_required=.TRUE.,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,ignore_required=.TRUE.,error=error)
conv_factor = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
! Coordinates and Velocities
work_section => section_vals_get_subs_vals(subsys_section,"COORD",error=error)
CALL section_coord_val_set(work_section, particles, molecules, conv_factor, scale,&
@ -1625,6 +1651,9 @@ CONTAINS
! write restart input for shell-model
IF(ASSOCIATED(shell_particles)) THEN
work_section => section_vals_get_subs_vals(subsys_section,"SHELL_COORD",error=error)
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,ignore_required=.TRUE.,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,ignore_required=.TRUE.,error=error)
conv_factor = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
CALL section_coord_val_set(work_section, shell_particles, molecules, &
conv_factor, scale, cell, shell=.TRUE., error=error)
IF (.NOT.skip_vel_section) THEN
@ -1634,6 +1663,9 @@ CONTAINS
ENDIF
IF(ASSOCIATED(core_particles)) THEN
work_section => section_vals_get_subs_vals(subsys_section,"CORE_COORD",error=error)
CALL section_vals_val_get(work_section,"UNIT",c_val=unit_str,ignore_required=.TRUE.,error=error)
CALL section_vals_val_get(work_section,"SCALED",l_val=scale,ignore_required=.TRUE.,error=error)
conv_factor = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
CALL section_coord_val_set(work_section, core_particles, molecules, &
conv_factor, scale, cell, shell=.TRUE., error=error)
IF (.NOT.skip_vel_section) THEN
@ -1678,9 +1710,8 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: routineN = 'update_cell_section', &
routineP = moduleN//':'//routineN
INTEGER :: handle, my_unit, stat
LOGICAL :: failure, scale, use_ref_cell
REAL(KIND=dp) :: conv_factor
INTEGER :: handle, stat
LOGICAL :: failure, use_ref_cell
REAL(KIND=dp), DIMENSION(:), POINTER :: work
TYPE(cell_type), POINTER :: cell, cell_ref
TYPE(section_vals_type), POINTER :: work_section
@ -1695,59 +1726,45 @@ CONTAINS
cell_ref=cell_ref,&
use_ref_cell=use_ref_cell,&
error=error)
ELSE
END IF
CALL section_vals_val_get(subsys_section,"CELL%UNITS",i_val=my_unit,error=error)
scale = .FALSE.
SELECT CASE(my_unit)
CASE (use_unit_angstrom,use_unit_scaled_angstrom)
conv_factor = bohr
IF (my_unit==use_unit_scaled_angstrom) scale = .TRUE.
CASE (use_unit_bohr,use_unit_scaled_bohr)
conv_factor = 1.0_dp
IF (my_unit==use_unit_scaled_bohr) scale = .TRUE.
CASE DEFAULT
CPPostcondition(.FALSE.,cp_failure_level,routineP,error,failure)
END SELECT
! CELL
work_section => section_vals_get_subs_vals(subsys_section,"CELL",error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - A
work(1:3) = cell%hmat(1:3,1)/conv_factor
work(1:3) = cell%hmat(1:3,1)
CALL section_vals_val_set(work_section,"A",r_vals_ptr=work,error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - B
work(1:3) = cell%hmat(1:3,2)/conv_factor
work(1:3) = cell%hmat(1:3,2)
CALL section_vals_val_set(work_section,"B",r_vals_ptr=work,error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - C
work(1:3) = cell%hmat(1:3,3)/conv_factor
work(1:3) = cell%hmat(1:3,3)
CALL section_vals_val_set(work_section,"C",r_vals_ptr=work,error=error)
CALL section_vals_val_unset(work_section,"ABC",error=error)
! CELL_REF
IF (use_ref_cell.AND.ASSOCIATED(cell_ref)) THEN
work_section => section_vals_get_subs_vals(subsys_section,"CELL%CELL_REF",error=error)
CALL section_vals_val_set(work_section,"UNITS",i_val=my_unit,error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - A
work(1:3) = cell_ref%hmat(1:3,1)/conv_factor
work(1:3) = cell_ref%hmat(1:3,1)
CALL section_vals_val_set(work_section,"A",r_vals_ptr=work,error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - B
work(1:3) = cell_ref%hmat(1:3,2)/conv_factor
work(1:3) = cell_ref%hmat(1:3,2)
CALL section_vals_val_set(work_section,"B",r_vals_ptr=work,error=error)
ALLOCATE(work(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! CELL VECTORS - C
work(1:3) = cell_ref%hmat(1:3,3)/conv_factor
work(1:3) = cell_ref%hmat(1:3,3)
CALL section_vals_val_set(work_section,"C",r_vals_ptr=work,error=error)
CALL section_vals_val_unset(work_section,"ABC",error=error)
END IF
CALL timestop(handle)
END SUBROUTINE update_cell_section
@ -1820,7 +1837,7 @@ CONTAINS
r = s
CALL real_to_scaled(s,r,cell)
ELSE
s = s/conv_factor
s = s*conv_factor
END IF
DO k = 1, 3
WRITE(rcval,"(ES25.16)") s(k)
@ -1867,7 +1884,7 @@ CONTAINS
r = s
CALL real_to_scaled(s,r,cell)
ELSE
s = s/conv_factor
s = s*conv_factor
END IF
DO k = 1, 3
WRITE(rcval,"(ES25.16)") s(k)
@ -1964,8 +1981,8 @@ CONTAINS
ALLOCATE(vel(3),stat=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Always stored in A.U.
IF(PRESENT(particles)) vel = particles%els(irk)%v(1:3)/conv_factor
IF(PRESENT(velocity)) vel = velocity(1:3,irk)/conv_factor
IF(PRESENT(particles)) vel = particles%els(irk)%v(1:3)*conv_factor
IF(PRESENT(velocity)) vel = velocity(1:3,irk)*conv_factor
CALL val_create(my_val,r_vals_ptr=vel,error=error)

View file

@ -88,35 +88,35 @@ CONTAINS
NULLIFY(keyword, subsection)
CALL keyword_create(keyword, name="A",&
description="Specify the Cartesian components for the cell vector a in the unit of length "//&
"given by the keyword UNITS. This defines the first column of the h matrix.",&
usage="A 10.000 0.000 0.000",&
description="Specify the Cartesian components for the cell vector A. "//&
"This defines the first column of the h matrix.",&
usage="A 10.000 0.000 0.000",unit_str="angstrom",&
n_var=3,type_of_var=real_t,repeats=.FALSE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="B",&
description="Specify the Cartesian components for the cell vector b in the unit of length "//&
"given by the keyword UNITS. This defines the second column of the h matrix.",&
usage="B 0.000 10.000 0.000",&
description="Specify the Cartesian components for the cell vector B. "//&
"This defines the second column of the h matrix.",&
usage="B 0.000 10.000 0.000", unit_str="angstrom",&
n_var=3,type_of_var=real_t,repeats=.FALSE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="C",&
description="Specify the Cartesian components for the cell vector c in the unit of length "//&
"given by the keyword UNITS. This defines the third column of the h matrix.",&
usage="C 0.000 0.000 10.000",&
description="Specify the Cartesian components for the cell vector C. "//&
"This defines the third column of the h matrix.",&
usage="C 0.000 0.000 10.000", unit_str="angstrom",&
n_var=3,type_of_var=real_t,repeats=.FALSE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="ABC",&
description="Specify the lengths of the cell vectors a, b, and c in the unit of length "//&
"given by the keyword UNITS. This defines the diagonal elements of h matrix "//&
description="Specify the lengths of the cell vectors A, B, and C. "//&
"This defines the diagonal elements of h matrix "//&
"for an orthorhombic cell. For non-orthorhombic cells use the keywords "//&
"A, B, and C.",&
usage="ABC 10.000 10.000 10.000",&
usage="ABC 10.000 10.000 10.000", unit_str="angstrom",&
n_var=3,type_of_var=real_t,repeats=.FALSE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
@ -146,17 +146,6 @@ CONTAINS
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="UNITS",&
variants=(/"UNIT"/),&
description="Specify the global length units used in the input.",&
usage="UNITS ANGSTROM",&
enum_c_vals=s2a( "ANGSTROM","BOHR","SCALED_ANGSTROM","SCALED_BOHR"),&
enum_i_vals=(/ use_unit_angstrom, use_unit_bohr,&
use_unit_scaled_angstrom, use_unit_scaled_bohr/),&
default_i_val=use_unit_bohr, error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="PERIODIC",&
description="Specify the directions for which periodic boundary conditions (PBC) will be applied. "//&
"Important notice: This applies to the generation of the pair lists as well as to the "//&
@ -331,7 +320,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"atomic_coordinates",&
description="controls the output of the atomic coordinates when setting up the"//&
"force environment. For printing coordinates during MD or GEO refer to the keyword"//&
" trajectory.",&
" trajectory.",unit_str="angstrom",&
print_level=medium_print_level, filename="__STD_OUT__",error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)
@ -342,7 +331,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"interatomic_distances",&
description="controls the output of the interatomic distances when setting up the"//&
"force environment",&
"force environment",unit_str="angstrom",&
print_level=debug_print_level, filename="__STD_OUT__",error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)
@ -401,7 +390,8 @@ CONTAINS
CALL cp_print_key_section_create(print_key,"cell",&
description="controls the output of the cell parameters",&
print_level=medium_print_level, filename="__STD_OUT__",error=error)
print_level=medium_print_level, filename="__STD_OUT__",&
unit_str="angstrom",error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)
@ -481,13 +471,15 @@ CONTAINS
CALL section_release(print_key,error=error)
CALL cp_print_key_section_create(print_key,"radii",&
description="controls the output of radii information",&
description="controls the output of radii information",unit_str="angstrom",&
print_level=high_print_level, filename="__STD_OUT__",error=error)
CALL keyword_create(keyword, name="core_charges_radii",&
description="If the printkey is activated controls the printing of the radii of the core charges",&
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="pgf_radii",&
description="If the printkey is activated controls the printing of the core gaussian radii",&
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., error=error)
@ -518,17 +510,20 @@ CONTAINS
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="gth_ppnl_radii",&
description="If the printkey is activated controls the printing of the "//&
"gth pseudo potential non local radii",&
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="gapw_prj_radii",&
description="If the printkey is activated controls the printing of the gapw projector radii",&
default_l_val=.TRUE., lone_keyword_l_val=.TRUE., error=error)
CALL section_add_keyword(print_key,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)
@ -618,7 +613,7 @@ CONTAINS
CALL cp_print_key_section_create(print_key,name="STRUCTURE_DATA",&
description="Request the printing of special structure data during a structure "//&
"optimization (in MOTION%PRINT) or when setting up a subsys (in SUBSYS%PRINT).",&
print_level=high_print_level,filename="__STD_OUT__",error=error)
print_level=high_print_level,filename="__STD_OUT__",unit_str="angstrom",error=error)
CALL keyword_create(keyword, name="POSITION", variants=(/"POS"/),&
description="Print the position vector of atom a specified by its index",&
@ -859,6 +854,21 @@ CONTAINS
n_keywords=1, n_subsections=0, repeats=.FALSE., required=.TRUE.,&
error=error)
NULLIFY(keyword)
CALL keyword_create(keyword, name="UNIT",&
description='Specify the unit of measurement for the coordinates in input'//&
"All available CP2K units can be used.",&
usage="UNIT angstrom",default_c_val="angstrom",supported_feature=.TRUE.,&
error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="SCALED",&
description='Specify if the coordinateds in input are scaled.',&
usage="SCALED F",default_l_val=.FALSE.,supported_feature=.TRUE.,&
lone_keyword_l_val=.TRUE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="_DEFAULT_KEYWORD_",&
description="The atoms coordinates in xyz format.",repeats=.TRUE.,&
usage="H 0.7 0.3 0.3", type_of_var=lchar_t, error=error)
@ -895,6 +905,21 @@ CONTAINS
n_keywords=1, n_subsections=0, repeats=.FALSE., required=.TRUE.,&
error=error)
NULLIFY(keyword)
CALL keyword_create(keyword, name="UNIT",&
description='Specify the unit of measurement for the coordinates in input'//&
"All available CP2K units can be used.",&
usage="UNIT angstrom",default_c_val="angstrom",supported_feature=.TRUE.,&
error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="SCALED",&
description='Specify if the coordinateds in input are scaled.',&
usage="SCALED F",default_l_val=.FALSE.,supported_feature=.TRUE.,&
lone_keyword_l_val=.TRUE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="_DEFAULT_KEYWORD_",&
description="The shell coordinates in xyz format.",repeats=.TRUE.,&
usage="at_name rx ry rz at_index", type_of_var=lchar_t, error=error)
@ -931,6 +956,21 @@ CONTAINS
n_keywords=1, n_subsections=0, repeats=.FALSE., required=.TRUE.,&
error=error)
NULLIFY(keyword)
CALL keyword_create(keyword, name="UNIT",&
description='Specify the unit of measurement for the coordinates in input'//&
"All available CP2K units can be used.",&
usage="UNIT angstrom",default_c_val="angstrom",supported_feature=.TRUE.,&
error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="SCALED",&
description='Specify if the coordinateds in input are scaled.',&
usage="SCALED F",default_l_val=.FALSE.,supported_feature=.TRUE.,&
lone_keyword_l_val=.TRUE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
CALL keyword_create(keyword, name="_DEFAULT_KEYWORD_",&
description="The core coordinates in xyz format.",repeats=.TRUE.,&
usage="at_name rx ry rz at_index", type_of_var=lchar_t, error=error)
@ -1138,8 +1178,7 @@ CONTAINS
CALL keyword_create(keyword, name="GPW_TYPE",&
description="Force one type to be treated by the GPW scheme,"//&
" whatever are its primitives, even if the GAPW method is used",&
usage="GPW_TYPE",&
default_l_val=.FALSE.,lone_keyword_l_val=.TRUE.,error=error)
usage="GPW_TYPE",default_l_val=.FALSE.,lone_keyword_l_val=.TRUE.,error=error)
CALL section_add_keyword(section,keyword,error=error)
CALL keyword_release(keyword,error=error)
@ -1670,9 +1709,8 @@ CONTAINS
NULLIFY(print_key)
CALL cp_print_key_section_create(print_key,"NEIGHBOR_LISTS",&
description="Activates the printing of the neighbor lists used"//&
" for generating the connectivity.", &
print_level=high_print_level,filename="",&
error=error)
" for generating the connectivity.", print_level=high_print_level,&
filename="", unit_str="angstrom", error=error)
CALL section_add_subsection(section,print_key,error=error)
CALL section_release(print_key,error=error)

View file

@ -19,16 +19,17 @@ MODULE kg_core
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_units, ONLY: cp_unit_from_cp2k
USE distribution_2d_types, ONLY: distribution_2d_type
USE erf_fn, ONLY: erfc
USE f77_blas
USE input_section_types, ONLY: section_vals_val_get
USE kg_energy_types, ONLY: kg_energy_type
USE kg_environment_types, ONLY: get_kg_env,&
kg_environment_type
USE kg_force_types, ONLY: kg_force_type
USE kinds, ONLY: dp,&
dp_size,&
int_size
USE kinds, ONLY: default_string_length,&
dp
USE mathconstants, ONLY: oorootpi,&
pi,&
twopi
@ -38,7 +39,6 @@ MODULE kg_core
deallocate_subcell,&
local_atoms_type,&
subcell_type
USE termination, ONLY: stop_memory
USE timings, ONLY: timeset,&
timestop
#include "cp_common_uses.h"
@ -70,16 +70,19 @@ CONTAINS
CHARACTER(len=*), PARAMETER :: routineN = 'calculate_ecore_rspace', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: atom_a, atom_b, group, handle, i, iatom, iatom_local, &
iatom_subcell, icell, ikind, istat, j, jatom, jatom_local, jcell, &
jkind, k, kcell, maxatom_local, natom, natom_local_a, natom_local_b, &
nkind, output_unit
iatom_subcell, icell, ikind, j, jatom, jatom_local, jcell, jkind, k, &
kcell, maxatom_local, natom, natom_local_a, natom_local_b, nkind, &
output_unit, stat
INTEGER, DIMENSION(3) :: cell_b, ncell, nsubcell, &
periodic
LOGICAL :: cell000, include_ab
REAL(KIND=dp) :: aab, dab, eab, ecore_overlap, f, fab, r_skin, rab2, &
rab2_max, rab_max, rootaab, subcells, unit_of_length, zab
LOGICAL :: cell000, failure, include_ab
REAL(KIND=dp) :: aab, conv, dab, eab, &
ecore_overlap, f, fab, &
r_skin, rab2, rab2_max, &
rab_max, rootaab, subcells, &
zab
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: alpha, radius, zeff
REAL(KIND=dp), DIMENSION(3) :: deab, r, r_pbc, rab, rb, s, &
sab_max, sb, sb_max, sb_min, &
@ -100,6 +103,7 @@ CONTAINS
TYPE(subcell_type), DIMENSION(:, :, :), &
POINTER :: subcell
failure = .FALSE.
NULLIFY(logger)
logger => cp_error_get_logger(error)
@ -130,31 +134,25 @@ CONTAINS
CALL get_cell(cell=cell,&
periodic=periodic,&
subcells=subcells,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
subcells=subcells)
! Allocate work storage
nkind = SIZE(atomic_kind_set)
ALLOCATE (atom(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom",nkind*int_size)
ALLOCATE (atom(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
ALLOCATE (alpha(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"alpha",nkind*dp_size)
ALLOCATE (alpha(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
alpha(:) = 0.0_dp
ALLOCATE (radius(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"radius",nkind*dp_size)
ALLOCATE (radius(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
radius(:) = 0.0_dp
ALLOCATE (zeff(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"zeff",nkind*dp_size)
ALLOCATE (zeff(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
zeff(:) = 0.0_dp
! Initialize the local data structures
@ -187,15 +185,10 @@ CONTAINS
IF (natom_local_a > 0) THEN
ALLOCATE (atom(ikind)%list_local_a_index(natom_local_a),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_a_index",&
natom_local_a*int_size)
END IF
ALLOCATE (atom(ikind)%list_local_a_index(natom_local_a),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Build index vector for mapping
DO iatom_local=1,natom_local_a
atom_a = distribution_2d%local_rows(ikind)%array(iatom_local)
DO iatom=1,natom
@ -210,12 +203,8 @@ CONTAINS
IF (natom_local_b > 0) THEN
ALLOCATE (atom(ikind)%list_local_b_index(natom_local_b),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_b_index",&
natom_local_b*int_size)
END IF
ALLOCATE (atom(ikind)%list_local_b_index(natom_local_b),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Build index vector for mapping
@ -230,17 +219,11 @@ CONTAINS
END DO
END IF
ALLOCATE (atom(ikind)%r_pbc(3,natom),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%r_pbc",3*natom*dp_size)
END IF
ALLOCATE (atom(ikind)%r_pbc(3,natom),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
ALLOCATE (atom(ikind)%s_pbc(3,natom),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%s_pbc",3*natom*dp_size)
END IF
ALLOCATE (atom(ikind)%s_pbc(3,natom),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Calculate PBC coordinates
@ -257,11 +240,13 @@ CONTAINS
output_unit = cp_print_key_unit_nr(logger,kg_env%input,"DFT%PRINT%SUBCELL",&
extension=".Log",error=error)
CALL section_vals_val_get(kg_env%input,"DFT%PRINT%SUBCELL%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,/,T2,A,/,/,T3,A,T29,A,T54,A)")&
"SUBCELL GRID FOR THE CALCULATION OF THE CORE CHARGE OVERLAP",&
"Atomic kind pair","Grid size",&
"Subcell size in "//unit_of_length_name
"Subcell size in "//unit_str
END IF
ecore_overlap = 0.0_dp
@ -307,7 +292,7 @@ CONTAINS
s(:) = 1.0_dp/REAL(nsubcell(:),dp)
CALL scaled_to_real(r,s,cell)
WRITE (UNIT=output_unit,FMT="(T3,2I8,4X,3I5,6X,3F12.6)")&
ikind,jkind,nsubcell(1:3),r(1:3)/unit_of_length
ikind,jkind,nsubcell(1:3),r(1:3)*conv
END IF
! Check, if we have to consider a subcell grid
@ -563,42 +548,34 @@ CONTAINS
DO ikind=1,nkind
NULLIFY (atom(ikind)%list)
IF (ASSOCIATED(atom(ikind)%list_local_a_index)) THEN
DEALLOCATE (atom(ikind)%list_local_a_index,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_a_index")
DEALLOCATE (atom(ikind)%list_local_a_index,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%list_local_b_index)) THEN
DEALLOCATE (atom(ikind)%list_local_b_index,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_b_index")
DEALLOCATE (atom(ikind)%list_local_b_index,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%r_pbc)) THEN
DEALLOCATE (atom(ikind)%r_pbc,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%r_pbc")
DEALLOCATE (atom(ikind)%r_pbc,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%s_pbc)) THEN
DEALLOCATE (atom(ikind)%s_pbc,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%s_pbc")
DEALLOCATE (atom(ikind)%s_pbc,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
END DO
DEALLOCATE (atom,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom")
DEALLOCATE (atom,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (alpha,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"alpha")
DEALLOCATE (alpha,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (radius,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"radius")
DEALLOCATE (radius,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (zeff,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"zeff")
DEALLOCATE (zeff,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
CALL mp_sum(ecore_overlap,group)

View file

@ -250,11 +250,8 @@ CONTAINS
! create the cell structure for the molecule
CALL cell_create(cell_mol,error=error)
cell_mol%unit_of_length_name = "BOHR"
cell_mol%deth = 0.0_dp
cell_mol%unit_of_length = 1.0_dp
cell_mol%orthorhombic = .TRUE.
cell_mol%scaled_coordinates = .FALSE.
cell_mol%subcells = 2.0_dp
cell_mol%perd(:) = 0
cell_mol%hmat(:,:) = 0.0_dp

View file

@ -18,17 +18,18 @@ MODULE kg_neighbor_lists
real_to_scaled
USE cp_control_types, ONLY: dft_control_type,&
qs_control_type
USE cp_output_handling, ONLY: cp_p_file,&
cp_print_key_finished_output,&
cp_print_key_should_output,&
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_units, ONLY: cp_unit_from_cp2k
USE distribution_1d_types, ONLY: distribution_1d_type
USE external_potential_types, ONLY: elp_potential_type,&
get_potential,&
gth_potential_type
USE f77_blas
USE input_section_types, ONLY: section_vals_type
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_type,&
section_vals_val_get
USE kg_environment_types, ONLY: get_kg_env,&
kg_environment_type,&
set_kg_env
@ -108,15 +109,14 @@ CONTAINS
CHARACTER(len=*), PARAMETER :: routineN = 'build_kg_neighbor_lists1', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_string_length) :: print_key_path
INTEGER :: atom_a, handle, iatom, iatom_local, ikind, istat, iw, maxatom, &
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: atom_a, handle, iatom, iatom_local, ikind, istat, maxatom, &
maxatom_local, natom_a, natom_local_a, nkind, output_unit
LOGICAL :: elp_potential_present, &
gth_potential_present, &
print_subcell_grid
gth_potential_present
LOGICAL, ALLOCATABLE, DIMENSION(:) :: aux_present, orb_present, &
ppl_present
REAL(dp) :: r_skin
REAL(dp) :: r_skin, unit_conv
REAL(dp), ALLOCATABLE, DIMENSION(:) :: aux_radius, orb_radius, &
ppl_radius
REAL(dp), DIMENSION(3) :: r_pbc
@ -135,13 +135,14 @@ CONTAINS
DIMENSION(:), POINTER :: sac_ppl, sac_ppl_aux
TYPE(particle_type), DIMENSION(:), &
POINTER :: particle_set
TYPE(section_vals_type), POINTER :: neighbor_list_section
NULLIFY(logger)
logger => cp_error_get_logger(error)
CALL timeset(routineN,handle)
NULLIFY (atomic_kind)
NULLIFY (atomic_kind, neighbor_list_section)
NULLIFY (atomic_kind_set)
NULLIFY (cell)
NULLIFY (distribution_1d)
@ -152,10 +153,10 @@ CONTAINS
NULLIFY (particle_set)
NULLIFY (sac_ppl)
NULLIFY (sac_ppl_aux)
print_subcell_grid = .FALSE.
output_unit = cp_print_key_unit_nr(logger,force_env_section,"DFT%PRINT%SUBCELL",&
extension=".Log",error=error)
IF (output_unit>0) print_subcell_grid = .TRUE.
CALL section_vals_val_get(force_env_section,"DFT%PRINT%SUBCELL%UNIT",c_val=unit_str,error=error)
unit_conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
! *** Set Verlet skin ***
@ -323,10 +324,10 @@ CONTAINS
IF (gth_potential_present.OR.elp_potential_present) THEN
neighbor_list_section => section_vals_get_subs_vals(force_env_section,"DFT%PRINT%NEIGHBOR_LISTS",error=error)
IF (ANY(ppl_present).AND.ANY(orb_present)) THEN
CALL build_gth_ppl_neighbor_lists(sac_ppl,atom,cell,r_skin,maxatom_local,&
print_subcell_grid,output_unit,&
unit_conv,unit_str,output_unit,&
orb_present,ppl_present,&
orb_radius,ppl_radius,&
name="ORBITAL GTH-PPL",&
@ -334,66 +335,21 @@ CONTAINS
CALL set_kg_env(kg_env=kg_env,sac_ppl=sac_ppl,error=error)
print_key_path = "DFT%PRINT%NEIGHBOR_LISTS/SAC_PPL"
IF (BTEST(cp_print_key_should_output(logger%iter_info,force_env_section,&
print_key_path,error=error),&
cp_p_file)) THEN
iw = cp_print_key_unit_nr(logger=logger,&
basis_section=force_env_section,&
print_key_path=print_key_path,&
extension=".out",&
middle_name="orb_sac_ppl",&
local=.TRUE.,&
log_filename=.FALSE.,&
file_position="REWIND",&
error=error)
CALL write_neighbor_lists(sac_ppl,particle_set,cell,para_env,iw,&
"ORBITAL GTH-PPL",error)
CALL cp_print_key_finished_output(unit_nr=iw,&
logger=logger,&
basis_section=force_env_section,&
print_key_path=print_key_path,&
local=.TRUE.,&
error=error)
END IF
CALL write_neighbor_lists(sac_ppl,particle_set,cell,para_env,neighbor_list_section,&
"/SAC_PPL","orb_sac_ppl","ORBITAL GTH-PPL",error)
END IF
IF (ANY(ppl_present).AND.ANY(aux_present)) THEN
CALL build_gth_ppl_neighbor_lists(sac_ppl_aux,atom,cell,r_skin,maxatom_local,&
print_subcell_grid,output_unit,&
unit_conv,unit_str,output_unit,&
aux_present,ppl_present,&
aux_radius,ppl_radius,&
name="AUXILIARY ORBITAL GTH-PPL")
CALL set_kg_env(kg_env=kg_env,sac_ppl_aux=sac_ppl_aux,error=error)
print_key_path = "DFT%PRINT%NEIGHBOR_LISTS/SAC_PPL"
IF (BTEST(cp_print_key_should_output(logger%iter_info,force_env_section,&
print_key_path,error=error),&
cp_p_file)) THEN
iw = cp_print_key_unit_nr(logger=logger,&
basis_section=force_env_section,&
print_key_path=print_key_path,&
extension=".out",&
middle_name="aux_sac_ppl",&
local=.TRUE.,&
log_filename=.FALSE.,&
file_position="REWIND",&
error=error)
CALL write_neighbor_lists(sac_ppl,particle_set,cell,para_env,iw,&
"AUXILIARY ORBITAL GTH-PPL",error)
CALL cp_print_key_finished_output(unit_nr=iw,&
logger=logger,&
basis_section=force_env_section,&
print_key_path=print_key_path,&
local=.TRUE.,&
error=error)
END IF
CALL write_neighbor_lists(sac_ppl,particle_set,cell,para_env,neighbor_list_section,&
"/SAC_PPL","aux_sac_ppl","AUXILIARY ORBITAL GTH-PPL",error)
END IF
END IF

View file

@ -122,7 +122,7 @@ CONTAINS
CALL get_cell (cell, abc=abc)
! Print the cell parameters ***
CALL write_cell ( cell, subsys_section, cell_ref, error)
CALL write_cell ( cell, subsys_section, cell_ref, error=error)
! Topology
CALL topology_control ( atomic_kind_set, particle_set, molecule_kind_set, molecule_set,&

View file

@ -24,6 +24,7 @@ MODULE particle_types
pbc
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_units, ONLY: cp_unit_from_cp2k
USE f77_blas
USE input_constants, ONLY: dump_atomic,&
dump_dcd,&
@ -658,10 +659,9 @@ CONTAINS
routineN = 'write_fist_particle_coordinates', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: iatom, ikind, iw, natom
REAL(KIND=dp) :: mass, qeff, unit_of_length
REAL(KIND=dp) :: conv, mass, qeff
TYPE(cp_logger_type), POINTER :: logger
NULLIFY(logger)
@ -669,14 +669,11 @@ CONTAINS
iw = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%ATOMIC_COORDINATES",extension=".coordLog",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%ATOMIC_COORDINATES%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (iw>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
WRITE (UNIT=iw,FMT="(/,/,T2,A)")&
"MODULE FIST: ATOMIC COORDINATES IN "//TRIM(unit_of_length_name)
"MODULE FIST: ATOMIC COORDINATES IN "//TRIM(unit_str)
WRITE (UNIT=iw,&
FMT="(/,T3,A,7X,2(A1,11X),A1,8X,A8,5X,A6,/)")&
"Atom Kind ATM_TYP","X","Y","Z"," q(eff)"," Mass"
@ -691,7 +688,7 @@ CONTAINS
WRITE (UNIT=iw,&
FMT="(T2,I5,1X,I4,3X,A4,3X,3F12.6,4X,F6.2,2X,F11.4)")&
iatom,ikind,name,&
particle_set(iatom)%r(1:3)/unit_of_length,qeff,mass/massunit
particle_set(iatom)%r(1:3)*conv,qeff,mass/massunit
END DO
WRITE (iw,'(/)')
END IF
@ -717,9 +714,9 @@ CONTAINS
TYPE(cp_error_type), INTENT(INOUT) :: error
CHARACTER(LEN=2) :: element_symbol
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: iatom, ikind, iw, natom, z
REAL(KIND=dp) :: mass, unit_of_length, zeff
REAL(KIND=dp) :: conv, mass, zeff
TYPE(cp_logger_type), POINTER :: logger
NULLIFY(logger)
@ -727,14 +724,11 @@ CONTAINS
iw = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%ATOMIC_COORDINATES",extension=".coordLog",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%ATOMIC_COORDINATES%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (iw>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
WRITE (UNIT=iw,FMT="(/,/,T2,A)")&
"MODULE "//TRIM(label)//": ATOMIC COORDINATES IN "//TRIM(unit_of_length_name)
"MODULE "//TRIM(label)//": ATOMIC COORDINATES IN "//TRIM(unit_str)
WRITE (UNIT=iw,&
FMT="(/,T3,A,7X,2(A1,11X),A1,8X,A8,5X,A6,/)")&
"Atom Kind Element","X","Y","Z"," Z(eff)"," Mass"
@ -750,7 +744,7 @@ CONTAINS
WRITE (UNIT=iw,&
FMT="(T2,I5,1X,I4,3X,A2,2X,I3,3F12.6,4X,F6.2,2X,F11.4)")&
iatom,ikind,element_symbol,z,&
particle_set(iatom)%r(1:3)/unit_of_length,zeff,mass/massunit
particle_set(iatom)%r(1:3)*conv,zeff,mass/massunit
END DO
WRITE (iw,'(/)')
END IF
@ -777,11 +771,11 @@ CONTAINS
CHARACTER(len=*), PARAMETER :: routineN = 'write_particle_distances', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: iatom, iw, jatom, natom, stat
INTEGER, DIMENSION(3) :: periodic
LOGICAL :: failure
REAL(KIND=dp) :: dab, unit_of_length
REAL(KIND=dp) :: conv, dab
REAL(KIND=dp), ALLOCATABLE, &
DIMENSION(:, :) :: distance_matrix
REAL(KIND=dp), DIMENSION(3) :: rab
@ -793,32 +787,27 @@ CONTAINS
iw = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%INTERATOMIC_DISTANCES",extension=".distLog",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%INTERATOMIC_DISTANCES%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (iw>0) THEN
CALL get_cell(cell=cell,&
periodic=periodic,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
CALL get_cell(cell=cell, periodic=periodic)
natom = SIZE(particle_set)
ALLOCATE (distance_matrix(natom,natom),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
distance_matrix(:,:) = 0.0_dp
DO iatom=1,natom
DO jatom=iatom+1,natom
rab(:) = pbc(particle_set(iatom)%r(:),&
particle_set(jatom)%r(:),cell)
dab = SQRT(rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3))
distance_matrix(iatom,jatom) = dab/unit_of_length
distance_matrix(iatom,jatom) = dab*conv
distance_matrix(jatom,iatom) = distance_matrix(iatom,jatom)
END DO
END DO
! *** Print the distance matrix ***
WRITE (UNIT=iw,FMT="(/,/,T2,A)")&
"INTERATOMIC DISTANCES IN "//TRIM(unit_of_length_name)
"INTERATOMIC DISTANCES IN "//TRIM(unit_str)
CALL write_particle_matrix(distance_matrix,particle_set,iw,error=error)
END IF
@ -900,14 +889,13 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: routineN = 'write_structure_data', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: string
CHARACTER(LEN=default_string_length) :: string, unit_str
INTEGER :: handle, i, iw, n, natom, &
wrk1(1), wrk2(2), wrk3(3), &
wrk4(4)
INTEGER, DIMENSION(:), POINTER :: atomic_indices
LOGICAL :: failure, unique
REAL(KIND=dp) :: dab, unit_of_length
REAL(KIND=dp) :: conv, dab
REAL(KIND=dp), DIMENSION(3) :: rab, rbc, rcd
TYPE(cp_logger_type), POINTER :: logger
TYPE(section_vals_type), POINTER :: section
@ -925,11 +913,9 @@ CONTAINS
extension=".coordLog",&
error=error)
CALL section_vals_val_get(input_section,"PRINT%STRUCTURE_DATA%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (iw > 0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
natom = SIZE(particle_set)
section => section_vals_get_subs_vals(section_vals=input_section,&
subsection_name="PRINT%STRUCTURE_DATA",&
@ -943,7 +929,7 @@ CONTAINS
error=error)
IF (n > 0) THEN
WRITE (UNIT=iw,FMT="(/,T3,A,/)")&
"Position vector r(i) of atom i in "//TRIM(unit_of_length_name)
"Position vector r(i) of atom i in "//TRIM(unit_str)
DO i=1,n
CALL section_vals_val_get(section_vals=section,&
keyword_name="POSITION",&
@ -959,7 +945,7 @@ CONTAINS
IF (((wrk1(1)>=1).AND.(wrk1(SIZE(wrk1))<=natom)).AND.unique) THEN
WRITE (UNIT=iw,FMT="(T3,A,T20,A,3F13.6)")&
"r"//TRIM(string),"=",&
pbc(particle_set(atomic_indices(1))%r(1:3),cell)/unit_of_length
pbc(particle_set(atomic_indices(1))%r(1:3),cell)*conv
ELSE
WRITE (UNIT=iw,FMT="(T3,A)")&
"Invalid atomic index "//TRIM(string)//" specified. Print request is ignored."
@ -975,7 +961,7 @@ CONTAINS
IF (n > 0) THEN
WRITE (UNIT=iw,FMT="(/,T3,A,/)")&
"Distance vector r(i,j) between the atom i and j in "//&
TRIM(unit_of_length_name)
TRIM(unit_str)
DO i=1,n
CALL section_vals_val_get(section_vals=section,&
keyword_name="DISTANCE",&
@ -993,8 +979,8 @@ CONTAINS
particle_set(atomic_indices(2))%r(:),cell)
dab = SQRT(rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3))
WRITE (UNIT=iw,FMT="(T3,A,T20,A,3F13.6,3X,A,F13.6)")&
"r"//TRIM(string),"=",rab(:)/unit_of_length,&
"|r| =",dab/unit_of_length
"r"//TRIM(string),"=",rab(:)*conv,&
"|r| =",dab*conv
ELSE
WRITE (UNIT=iw,FMT="(T3,A)")&
"Invalid atomic indices "//TRIM(string)//" specified. Print request is ignored."

View file

@ -310,7 +310,7 @@ CONTAINS
paw_proj%nprj(0:maxl) = 0
output_unit = cp_print_key_unit_nr(logger,force_env_section,&
"DFT%PRINT%GAPW/PROJECTORS",extension=".Log",error=error)
"DFT%PRINT%GAPW%PROJECTORS",extension=".Log",error=error)
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,T2,A)")&
@ -559,7 +559,7 @@ CONTAINS
ENDDO ! lshell
CALL cp_print_key_finished_output(output_unit,logger,force_env_section,&
"DFT%PRINT%GAPW/PROJECTORS",error=error)
"DFT%PRINT%GAPW%PROJECTORS",error=error)
! *** Release the working storage for the current value lshell ***
DEALLOCATE(set_radius,STAT=stat)

View file

@ -22,13 +22,14 @@ MODULE qs_core_energies
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_units, ONLY: cp_unit_from_cp2k
USE distribution_1d_types, ONLY: distribution_1d_type
USE distribution_2d_types, ONLY: distribution_2d_type
USE erf_fn, ONLY: erfc
USE f77_blas
USE kinds, ONLY: dp,&
dp_size,&
int_size
USE input_section_types, ONLY: section_vals_val_get
USE kinds, ONLY: default_string_length,&
dp
USE mathconstants, ONLY: oorootpi,&
twopi
USE message_passing, ONLY: mp_sum
@ -47,8 +48,7 @@ MODULE qs_core_energies
next_block_node,&
real_block_node_type,&
real_matrix_type
USE termination, ONLY: stop_memory,&
stop_program
USE termination, ONLY: stop_program
USE timings, ONLY: timeset,&
timestop
USE virial_methods, ONLY: virial_pair_force
@ -98,12 +98,8 @@ CONTAINS
REAL(KIND=dp), DIMENSION(:, :), POINTER :: h_block, p_block
TYPE(real_block_node_type), POINTER :: h_block_node, p_block_node
! -------------------------------------------------------------------------
CALL timeset(routineN,handle)
ecore = 0.0_dp
CALL get_matrix_info(matrix=h,nblock_row=nblock_row)
DO iblock_row=1,nblock_row
@ -176,19 +172,22 @@ CONTAINS
CHARACTER(len=*), PARAMETER :: routineN = 'calculate_ecore_overlap', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: atom_a, atom_b, group, handle, i, iatom, iatom_local, &
iatom_subcell, icell, ikind, istat, j, jatom, jatom_local, jcell, &
jkind, k, kcell, maxatom_local, natom, natom_local_a, natom_local_b, &
nkind, output_unit
iatom_subcell, icell, ikind, j, jatom, jatom_local, jcell, jkind, k, &
kcell, maxatom_local, natom, natom_local_a, natom_local_b, nkind, &
output_unit, stat
INTEGER, DIMENSION(3) :: cell_b, ncell, nsubcell, &
periodic
INTEGER, DIMENSION(:), POINTER :: local_cols_array, &
local_rows_array
LOGICAL :: cell000, include_ab, &
LOGICAL :: cell000, failure, include_ab, &
only_molecule, use_virial
REAL(KIND=dp) :: aab, dab, eab, ecore_overlap, f, fab, r_skin, rab2, &
rab2_max, rab_max, rootaab, subcells, unit_of_length, zab
REAL(KIND=dp) :: aab, conv, dab, eab, &
ecore_overlap, f, fab, &
r_skin, rab2, rab2_max, &
rab_max, rootaab, subcells, &
zab
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: alpha, radius, zeff
REAL(KIND=dp), DIMENSION(3) :: deab, r, r_pbc, rab, rb, s, &
sab_max, sb, sb_max, sb_min, &
@ -211,8 +210,7 @@ CONTAINS
POINTER :: subcell
TYPE(virial_type), POINTER :: virial
! -------------------------------------------------------------------------
failure = .FALSE.
NULLIFY(logger)
logger => cp_error_get_logger(error)
@ -233,9 +231,7 @@ CONTAINS
IF (PRESENT(molecular)) only_molecule = molecular
! Set Verlet skin
r_skin = 0.0_dp
CALL get_qs_env(qs_env=qs_env,&
atomic_kind_set=atomic_kind_set,&
cell=cell,&
@ -248,33 +244,26 @@ CONTAINS
CALL get_cell(cell=cell,&
periodic=periodic,&
subcells=subcells,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
subcells=subcells)
! Allocate work storage
nkind = SIZE(atomic_kind_set)
use_virial = virial%pv_availability.AND.(.NOT.virial%pv_numer)
ALLOCATE (atom(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom",nkind*int_size)
ALLOCATE (atom(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
ALLOCATE (alpha(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"alpha",nkind*dp_size)
ALLOCATE (alpha(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
alpha(:) = 0.0_dp
ALLOCATE (radius(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"radius",nkind*dp_size)
ALLOCATE (radius(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
radius(:) = 0.0_dp
ALLOCATE (zeff(nkind),STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"zeff",nkind*int_size)
ALLOCATE (zeff(nkind),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
zeff(:) = 0.0_dp
! Initialize the local data structures
@ -316,15 +305,10 @@ CONTAINS
IF (natom_local_a > 0) THEN
ALLOCATE (atom(ikind)%list_local_a_index(natom_local_a),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_a_index",&
natom_local_a*int_size)
END IF
ALLOCATE (atom(ikind)%list_local_a_index(natom_local_a),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Build index vector for mapping
DO iatom_local=1,natom_local_a
atom_a = local_rows_array(iatom_local)
DO iatom=1,natom
@ -339,12 +323,8 @@ CONTAINS
IF (natom_local_b > 0) THEN
ALLOCATE (atom(ikind)%list_local_b_index(natom_local_b),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_b_index",&
natom_local_b*int_size)
END IF
ALLOCATE (atom(ikind)%list_local_b_index(natom_local_b),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Build index vector for mapping
@ -360,17 +340,11 @@ CONTAINS
END IF
ALLOCATE (atom(ikind)%r_pbc(3,natom),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%r_pbc",3*natom*dp_size)
END IF
ALLOCATE (atom(ikind)%r_pbc(3,natom),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
ALLOCATE (atom(ikind)%s_pbc(3,natom),STAT=istat)
IF (istat /= 0) THEN
CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%s_pbc",3*natom*dp_size)
END IF
ALLOCATE (atom(ikind)%s_pbc(3,natom),STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
! Calculate PBC coordinates
@ -387,11 +361,13 @@ CONTAINS
output_unit = cp_print_key_unit_nr(logger,qs_env%input,"DFT%PRINT%SUBCELL",&
extension=".Log",error=error)
CALL section_vals_val_get(qs_env%input,"DFT%PRINT%SUBCELL%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit > 0) THEN
WRITE (UNIT=output_unit,FMT="(/,/,T2,A,/,/,T3,A,T29,A,T54,A)")&
"SUBCELL GRID FOR THE CALCULATION OF THE CORE CHARGE OVERLAP",&
"Atomic kind pair","Grid size",&
"Subcell size in "//unit_of_length_name
"Subcell size in "//unit_str
END IF
ecore_overlap = 0.0_dp
@ -437,7 +413,7 @@ CONTAINS
s(:) = 1.0_dp/REAL(nsubcell(:),KIND=dp)
CALL scaled_to_real(r,s,cell)
WRITE (UNIT=output_unit,FMT="(T3,2I8,4X,3I5,6X,3F12.6)")&
ikind,jkind,nsubcell(1:3),r(1:3)/unit_of_length
ikind,jkind,nsubcell(1:3),r(1:3)*conv
END IF
! Check, if we have to consider a subcell grid
@ -698,42 +674,34 @@ CONTAINS
DO ikind=1,nkind
NULLIFY (atom(ikind)%list)
IF (ASSOCIATED(atom(ikind)%list_local_a_index)) THEN
DEALLOCATE (atom(ikind)%list_local_a_index,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_a_index")
DEALLOCATE (atom(ikind)%list_local_a_index,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%list_local_b_index)) THEN
DEALLOCATE (atom(ikind)%list_local_b_index,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%list_local_b_index")
DEALLOCATE (atom(ikind)%list_local_b_index,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%r_pbc)) THEN
DEALLOCATE (atom(ikind)%r_pbc,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%r_pbc")
DEALLOCATE (atom(ikind)%r_pbc,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
IF (ASSOCIATED(atom(ikind)%s_pbc)) THEN
DEALLOCATE (atom(ikind)%s_pbc,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom(ikind)%s_pbc")
DEALLOCATE (atom(ikind)%s_pbc,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
END IF
END DO
DEALLOCATE (atom,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"atom")
DEALLOCATE (atom,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (alpha,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"alpha")
DEALLOCATE (alpha,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (radius,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"radius")
DEALLOCATE (radius,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
DEALLOCATE (zeff,STAT=istat)
IF (istat /= 0) CALL stop_memory(routineN,moduleN,__LINE__,&
"zeff")
DEALLOCATE (zeff,STAT=stat)
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
CALL mp_sum(ecore_overlap,group)

View file

@ -20,19 +20,20 @@ MODULE qs_interactions
USE basis_set_types, ONLY: get_gto_basis_set,&
gto_basis_set_type,&
set_gto_basis_set
USE cell_types, ONLY: cell_type,&
get_cell
USE cell_types, ONLY: cell_type
USE cp_control_types, ONLY: qs_control_type,&
semi_empirical_control_type
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_units, ONLY: cp_unit_from_cp2k
USE external_potential_types, ONLY: all_potential_type,&
elp_potential_type,&
get_potential,&
gth_potential_type,&
set_potential
USE f77_blas
USE input_section_types, ONLY: section_vals_type
USE input_section_types, ONLY: section_vals_type,&
section_vals_val_get
USE kinds, ONLY: default_string_length,&
dp
USE orbital_pointers, ONLY: coset
@ -553,10 +554,9 @@ CONTAINS
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=10) :: bas
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, nkind, output_unit
REAL(KIND=dp) :: kind_radius, unit_of_length
REAL(KIND=dp) :: conv, kind_radius
TYPE(atomic_kind_type), POINTER :: atomic_kind
TYPE(cp_logger_type), POINTER :: logger
TYPE(gto_basis_set_type), POINTER :: orb_basis_set
@ -566,18 +566,15 @@ CONTAINS
NULLIFY(orb_basis_set)
bas="ORBITAL "
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
! *** Print the kind radii ***
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/KIND_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,T2,A,T56,A,T63,A,T75,A)")&
"RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_of_length_name),&
"RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_str),&
"Kind","Label","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
@ -588,7 +585,7 @@ CONTAINS
CALL get_gto_basis_set(gto_basis_set=orb_basis_set,&
kind_radius=kind_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,kind_radius/unit_of_length
ikind,name,kind_radius*conv
ELSE
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T72,A9)")&
ikind,name,"no basis"
@ -614,11 +611,9 @@ CONTAINS
TYPE(section_vals_type), POINTER :: subsys_section
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, nkind, output_unit
REAL(KIND=dp) :: core_charge_radius, &
unit_of_length
REAL(KIND=dp) :: conv, core_charge_radius
TYPE(all_potential_type), POINTER :: all_potential
TYPE(atomic_kind_type), POINTER :: atomic_kind
TYPE(cp_logger_type), POINTER :: logger
@ -629,14 +624,13 @@ CONTAINS
logger => cp_error_get_logger(error)
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/CORE_CHARGE_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
WRITE (UNIT=output_unit,FMT="(/,T2,A,T56,A,T63,A,T75,A)")&
"RADII: CORE CHARGE DISTRIBUTIONS in "//&
TRIM(unit_of_length_name),"Kind","Label","Radius"
TRIM(unit_str),"Kind","Label","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
CALL get_atomic_kind(atomic_kind=atomic_kind,&
@ -648,17 +642,17 @@ CONTAINS
CALL get_potential(potential=all_potential,&
core_charge_radius=core_charge_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,core_charge_radius/unit_of_length
ikind,name,core_charge_radius*conv
ELSE IF (ASSOCIATED(elp_potential)) THEN
CALL get_potential(potential=elp_potential,&
core_charge_radius=core_charge_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,core_charge_radius/unit_of_length
ikind,name,core_charge_radius*conv
ELSE IF (ASSOCIATED(gth_potential)) THEN
CALL get_potential(potential=gth_potential,&
core_charge_radius=core_charge_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,core_charge_radius/unit_of_length
ikind,name,core_charge_radius*conv
END IF
END DO
END IF
@ -682,14 +676,12 @@ CONTAINS
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=10) :: bas
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, ipgf, iset, nkind, &
nset, output_unit
INTEGER, DIMENSION(:), POINTER :: npgf
REAL(KIND=dp) :: kg_radius, kind_radius, &
short_kind_radius, &
unit_of_length
REAL(KIND=dp) :: conv, kg_radius, kind_radius, &
short_kind_radius
REAL(KIND=dp), DIMENSION(:), POINTER :: set_radius
REAL(KIND=dp), DIMENSION(:, :), POINTER :: pgf_radius
TYPE(atomic_kind_type), POINTER :: atomic_kind
@ -710,18 +702,16 @@ CONTAINS
CALL stop_program("write_pgf_orb_radii","undefined basis type")
END IF
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
! *** Print the kind radii ***
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/KIND_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,T2,A,T46,A,T53,A,T63,A,T72,A)")&
"RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_of_length_name),&
"RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_str),&
"Kind","Label","Radius","OCE/KG Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
@ -748,8 +738,8 @@ CONTAINS
END IF
IF(ASSOCIATED(aux_basis_set).OR.ASSOCIATED(orb_basis_set)) THEN
WRITE (UNIT=output_unit,FMT="(T45,I5,T53,A5,T59,F12.6,T73,F12.6,/,T73,F12.6)")&
ikind,name,kind_radius/unit_of_length,short_kind_radius/unit_of_length,&
kg_radius/unit_of_length
ikind,name,kind_radius*conv,short_kind_radius*conv,&
kg_radius*conv
ELSE
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T72,A9)")&
ikind,name,"no basis"
@ -765,7 +755,7 @@ CONTAINS
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,T2,A,T51,A,T57,A,T65,A,T75,A)")&
"RADII: SHELL SETS OF "//TRIM(bas)//" BASIS in "//&
TRIM(unit_of_length_name),"Kind","Label","Set","Radius"
TRIM(unit_str),"Kind","Label","Set","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
IF ( bas(1:3) == "ORB" ) THEN
@ -791,7 +781,7 @@ CONTAINS
END IF
IF(ASSOCIATED(aux_basis_set).OR.ASSOCIATED(orb_basis_set)) THEN
WRITE (UNIT=output_unit,FMT="(T50,I5,T57,A5,(T63,I5,T69,F12.6))")&
ikind,name,(iset,set_radius(iset)/unit_of_length,iset=1,nset)
ikind,name,(iset,set_radius(iset)*conv,iset=1,nset)
ELSE
WRITE (UNIT=output_unit,FMT="(T50,I5,T58,A5,T73,A8)")&
ikind,name,"no basis"
@ -806,7 +796,7 @@ CONTAINS
IF (output_unit>0) THEN
WRITE (UNIT=output_unit,FMT="(/,T2,A,T51,A,T57,A,T65,A,T75,A)")&
"RADII: PRIMITIVE GAUSSIANS OF "//TRIM(bas)//" BASIS in "//&
TRIM(unit_of_length_name),"Kind","Label","Set","Radius"
TRIM(unit_str),"Kind","Label","Set","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
IF ( bas(1:3) == "ORB" ) THEN
@ -836,7 +826,7 @@ CONTAINS
DO iset=1,nset
WRITE (UNIT=output_unit,FMT="(T50,I5,T57,A5,T63,I5,(T69,F12.6))")&
ikind,name,iset,&
(pgf_radius(ipgf,iset)/unit_of_length,ipgf=1,npgf(iset))
(pgf_radius(ipgf,iset)*conv,ipgf=1,npgf(iset))
END DO
ELSE
WRITE (UNIT=output_unit,FMT="(T50,I5,T58,A5,T73,A8)")&
@ -864,10 +854,9 @@ CONTAINS
TYPE(section_vals_type), POINTER :: subsys_section
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, nkind, output_unit
REAL(KIND=dp) :: ppl_radius, unit_of_length
REAL(KIND=dp) :: conv, ppl_radius
TYPE(atomic_kind_type), POINTER :: atomic_kind
TYPE(cp_logger_type), POINTER :: logger
TYPE(elp_potential_type), POINTER :: elp_potential
@ -877,14 +866,13 @@ CONTAINS
logger => cp_error_get_logger(error)
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/GTH_PPL_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
WRITE (UNIT=output_unit,FMT="(/,T2,A,T56,A,T63,A,T75,A)")&
"RADII: LOCAL PART OF GTH/ELP PP in "//&
TRIM(unit_of_length_name),"Kind","Label","Radius"
TRIM(unit_str),"Kind","Label","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
CALL get_atomic_kind(atomic_kind=atomic_kind,&
@ -895,12 +883,12 @@ CONTAINS
CALL get_potential(potential=gth_potential,&
ppl_radius=ppl_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,ppl_radius/unit_of_length
ikind,name,ppl_radius*conv
ELSE IF (ASSOCIATED(elp_potential)) THEN
CALL get_potential(potential=elp_potential,&
ppl_radius=ppl_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,ppl_radius/unit_of_length
ikind,name,ppl_radius*conv
END IF
END DO
END IF
@ -924,10 +912,9 @@ CONTAINS
TYPE(section_vals_type), POINTER :: subsys_section
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, nkind, output_unit
REAL(KIND=dp) :: ppnl_radius, unit_of_length
REAL(KIND=dp) :: conv, ppnl_radius
TYPE(atomic_kind_type), POINTER :: atomic_kind
TYPE(cp_logger_type), POINTER :: logger
TYPE(gth_potential_type), POINTER :: gth_potential
@ -936,14 +923,13 @@ CONTAINS
logger => cp_error_get_logger(error)
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/GTH_PPNL_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
WRITE (UNIT=output_unit,FMT="(/,T2,A,T56,A,T63,A,T75,A)")&
"RADII: NON-LOCAL PART OF GTH PP in "//&
TRIM(unit_of_length_name),"Kind","Label","Radius"
TRIM(unit_str),"Kind","Label","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
CALL get_atomic_kind(atomic_kind=atomic_kind,&
@ -953,7 +939,7 @@ CONTAINS
CALL get_potential(potential=gth_potential,&
ppnl_radius=ppnl_radius)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,ppnl_radius/unit_of_length
ikind,name,ppnl_radius*conv
END IF
END DO
END IF
@ -973,11 +959,10 @@ CONTAINS
TYPE(section_vals_type), POINTER :: subsys_section
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(LEN=8) :: unit_of_length_name
CHARACTER(LEN=default_string_length) :: name
CHARACTER(LEN=default_string_length) :: name, unit_str
INTEGER :: ikind, nkind, output_unit
LOGICAL :: paw_atom
REAL(KIND=dp) :: rcprj, unit_of_length
REAL(KIND=dp) :: conv, rcprj
TYPE(atomic_kind_type), POINTER :: atomic_kind
TYPE(cp_logger_type), POINTER :: logger
TYPE(paw_proj_set_type), POINTER :: paw_proj_set
@ -986,14 +971,13 @@ CONTAINS
logger => cp_error_get_logger(error)
output_unit = cp_print_key_unit_nr(logger,subsys_section,&
"PRINT%RADII/GAPW_PRJ_RADII",extension=".Log",error=error)
CALL section_vals_val_get(subsys_section,"PRINT%RADII%UNIT",c_val=unit_str,error=error)
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
IF (output_unit>0) THEN
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
nkind = SIZE(atomic_kind_set)
WRITE (UNIT=output_unit,FMT="(/,T2,A,T56,A,T63,A,T75,A)")&
"RADII: ONE CENTER PROJECTORS in "//&
TRIM(unit_of_length_name),"Kind","Label","Radius"
TRIM(unit_str),"Kind","Label","Radius"
DO ikind=1,nkind
atomic_kind => atomic_kind_set(ikind)
CALL get_atomic_kind(atomic_kind=atomic_kind,&
@ -1004,7 +988,7 @@ CONTAINS
CALL get_paw_proj_set(paw_proj_set=paw_proj_set,&
rcprj=rcprj)
WRITE (UNIT=output_unit,FMT="(T55,I5,T63,A5,T69,F12.6)")&
ikind,name,rcprj/unit_of_length
ikind,name,rcprj*conv
END IF
END DO
END IF

View file

@ -18,6 +18,7 @@
!> \author MI
! *****************************************************************************
MODULE qs_linres_nmr_utils
USE atomic_kind_types, ONLY: atomic_kind_type
USE cell_types, ONLY: cell_type,&
pbc
@ -31,7 +32,8 @@ MODULE qs_linres_nmr_utils
USE cp_parser_types, ONLY: cp_parser_type,&
parser_create,&
parser_release
USE cp_units, ONLY: cp_unit_to_cp2k
USE cp_units, ONLY: cp_unit_from_cp2k,&
cp_unit_to_cp2k
USE f77_blas
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_type,&
@ -204,7 +206,7 @@ CONTAINS
nmr_env%chi_SI2ppmcgs = 6.022045_dp/1.0E+2_dp
! Chi to Shift: 10^-30 * 2/3 mu_0 / Omega * 1/ppm
nmr_env%chi_SI2shiftppm = 1.0E-30_dp * 8.37758041E-7_dp/ &
& (cell%deth /cell%unit_of_length**3*1.0E-30_dp) * 1.0E+6_dp
(cp_unit_from_cp2k(cell%deth,"angstrom^3",error=error)*1.0E-30_dp) * 1.0E+6_dp
IF(output_unit>0) THEN
IF(nmr_env%do_nics) THEN

File diff suppressed because it is too large Load diff

View file

@ -21,8 +21,10 @@ MODULE qs_rho0_methods
USE external_potential_types, ONLY: all_potential_type
USE f77_blas
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_type
USE kinds, ONLY: dp
section_vals_type,&
section_vals_val_get
USE kinds, ONLY: default_string_length,&
dp
USE mathconstants, ONLY: dfac,&
fourpi
USE memory_utilities, ONLY: reallocate
@ -329,6 +331,7 @@ MODULE qs_rho0_methods
CHARACTER(len=*), PARAMETER :: routineN = 'init_rho0', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=default_string_length) :: unit_str
INTEGER :: handle, iat, iatom, ikind, istat, l, l_rho1_max, laddg, lmaxg, &
max_nr, maxl, maxnset, maxso, nat, natom, nchan_c, nchan_s, nkind, nr, &
nset, nsotot, output_unit
@ -563,13 +566,15 @@ MODULE qs_rho0_methods
END IF
dft_section => section_vals_get_subs_vals(qs_env%input,"DFT",error=error)
output_unit = cp_print_key_unit_nr(logger,dft_section,"PRINT%GAPW/RHO0_INFORMATION",&
output_unit = cp_print_key_unit_nr(logger,dft_section,"PRINT%GAPW%RHO0_INFORMATION",&
extension=".Log",error=error)
CALL section_vals_val_get(dft_section,"PRINT%GAPW%RHO0_INFORMATION%UNIT",c_val=unit_str,&
error=error)
IF (output_unit>0) THEN
CALL write_rho0_info(rho0_mpole,cell,output_unit,error)
CALL write_rho0_info(rho0_mpole,unit_str,output_unit,error)
END IF
CALL cp_print_key_finished_output(output_unit,logger,dft_section,&
"PRINT%GAPW/RHO0_INFORMATION",error=error)
"PRINT%GAPW%RHO0_INFORMATION",error=error)
CALL timestop(handle)

View file

@ -5,8 +5,7 @@
! *****************************************************************************
MODULE qs_rho0_types
USE cell_types, ONLY: cell_type,&
get_cell
USE cp_units, ONLY: cp_unit_from_cp2k
USE erf_fn, ONLY: erf
USE f77_blas
USE kinds, ONLY: dp,&
@ -637,25 +636,21 @@ CONTAINS
END SUBROUTINE initialize_mpole_rho
! *****************************************************************************
SUBROUTINE write_rho0_info(rho0_mpole,cell,output_unit,error)
SUBROUTINE write_rho0_info(rho0_mpole,unit_str,output_unit,error)
TYPE(rho0_mpole_type), POINTER :: rho0_mpole
TYPE(cell_type), POINTER :: cell
CHARACTER(LEN=*), INTENT(IN) :: unit_str
INTEGER, INTENT(in) :: output_unit
TYPE(cp_error_type), INTENT(inout) :: error
CHARACTER(len=*), PARAMETER :: routineN = 'write_rho0_info', &
routineP = moduleN//':'//routineN
CHARACTER(LEN=8) :: unit_of_length_name
INTEGER :: ikind, l, nkind
REAL(dp) :: unit_of_length
CALL get_cell(cell=cell,&
unit_of_length=unit_of_length,&
unit_of_length_name=unit_of_length_name)
REAL(dp) :: conv
IF (ASSOCIATED(rho0_mpole)) THEN
conv = cp_unit_from_cp2k(1.0_dp,TRIM(unit_str),error=error)
WRITE (UNIT=output_unit,FMT="(/,T5,A,/)") &
"*** Compensation density charges data set ***"
@ -677,7 +672,7 @@ CONTAINS
nkind = SIZE(rho0_mpole%lmax0_kind,1)
DO ikind = 1, nkind
WRITE (UNIT=output_unit,FMT="(/,T2,A,T55,I2)")&
"- rho0 max L and radii in "//TRIM(unit_of_length_name)//&
"- rho0 max L and radii in "//TRIM(unit_str)//&
" for the atom kind :", ikind
WRITE (UNIT=output_unit,FMT="(T2,T20,A,T55,I5)")&
@ -685,19 +680,19 @@ CONTAINS
WRITE (UNIT=output_unit,FMT="(T2,T20,A,T55,f20.10)")&
"=> radius of Vh(rho0_h-rho0_s): ",&
rho0_mpole%mp_gau(ikind)%r_V0hmV0s/unit_of_length
rho0_mpole%mp_gau(ikind)%r_V0hmV0s*conv
WRITE (UNIT=output_unit,FMT="(T2,T20,A,T55,f20.10)")&
"=> max radius of g0 hard: ",&
rho0_mpole%mp_gau(ikind)%rpgf0_h/unit_of_length
rho0_mpole%mp_gau(ikind)%rpgf0_h*conv
WRITE (UNIT=output_unit,FMT="(T2,T20,A,T55,f20.10)")&
"=> max radius of g0 soft: ",&
rho0_mpole%mp_gau(ikind)%rpgf0_s/unit_of_length
rho0_mpole%mp_gau(ikind)%rpgf0_s*conv
WRITE (UNIT=output_unit,FMT="(T2,T20,A,T55,f20.10)")&
"=> orb_radius for the 3c lists: ",&
rho0_mpole%orb_radius_3c(ikind)/unit_of_length
rho0_mpole%orb_radius_3c(ikind)*conv
END DO ! ikind

View file

@ -24,7 +24,6 @@
&SUBSYS
&CELL
ABC 100.0 100.0 100.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -27,7 +27,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -27,7 +27,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -27,7 +27,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -27,7 +27,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -20,7 +20,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -19,7 +19,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -21,7 +21,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -21,7 +21,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -22,7 +22,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -20,7 +20,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -30,7 +30,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -21,7 +21,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -30,7 +30,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -30,7 +30,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -25,7 +25,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -25,7 +25,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -24,7 +24,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -30,7 +30,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -22,7 +22,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -22,7 +22,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -28,7 +28,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -29,7 +29,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -32,7 +32,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -29,7 +29,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -28,7 +28,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
SUBCELLS 10.0
&END CELL
&COORD

View file

@ -29,7 +29,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -36,7 +36,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -23,7 +23,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

View file

@ -20,7 +20,6 @@ METHOD EP
&SUBSYS
&CELL
ABC 9.8528 9.8528 9.8528
UNIT ANGSTROM
&END CELL
&COORD
O 2.280398 9.146539 5.088696

View file

@ -28,7 +28,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
O 0.000000 0.000000 0.000000 H2O1

View file

@ -34,7 +34,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
Ar 0.000000 0.000000 0.000000

View file

@ -28,7 +28,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
Ar 0.000000 0.000000 0.000000

View file

@ -33,7 +33,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
Ar 0.000000 0.000000 0.000000

View file

@ -21,7 +21,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
O 0.000000 0.000000 -0.065587

View file

@ -28,7 +28,6 @@
&SUBSYS
&CELL
ABC 6.0 6.0 6.0
UNIT ANGSTROM
&END CELL
&COORD
Ar 0.000000 0.000000 0.000000

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME ../../water_1.pdb

View file

@ -78,7 +78,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -110,7 +109,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -142,7 +140,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -79,7 +79,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -111,7 +110,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -143,7 +141,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -48,7 +48,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -80,7 +79,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -112,7 +110,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -79,7 +79,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -112,7 +111,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -145,7 +143,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -89,7 +89,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -122,7 +121,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -155,7 +153,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -187,7 +184,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -219,7 +215,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -89,7 +89,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -122,7 +121,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -155,7 +153,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -187,7 +184,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL
@ -219,7 +215,6 @@
&END TOPOLOGY
&CELL
ABC 30.9751780 30.8599250 30.7278700
UNIT ANGSTROM
&END CELL
&END SUBSYS
&END FORCE_EVAL

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 30.0 30.0 30.0
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_BETA

View file

@ -55,7 +55,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -54,7 +54,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -54,7 +54,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -53,7 +53,6 @@
&SUBSYS
&CELL
ABC 9.865 9.865 9.865
UNIT ANGSTROM
&END CELL
&COORD
O -4.583 5.333 1.560 H2O

View file

@ -16,7 +16,6 @@
&SUBSYS
&CELL
ABC 20 20 20
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_BETA

View file

@ -48,7 +48,6 @@
A 26.2236461476644 0.508235414971433 0.352095900341464
B 15.3935301632910 21.2250717093132 0.339884967068496
C 15.3881435611913 8.04313631389397 19.6199427770879
UNIT ANGSTROM
&END CELL
&COORD
AL -18.8567449782927 -9.84653151159998 -6.72435609218356

View file

@ -48,7 +48,6 @@
A 5.128 0.0 0.0
B 2.92661 4.210859 0.0
C 2.92661 1.53001 3.92306
UNIT ANGSTROM
&END CELL
&COORD
AL 3.865389 2.020786 1.380917

View file

@ -25,7 +25,6 @@
&SUBSYS
&CELL
ABC 17.1580 17.158 17.158
UNIT ANGSTROM
&END CELL
&COORD
Ar -8.53869012951987116 -15.5816257770688615 2.85663672298278293

View file

@ -26,7 +26,6 @@
&SUBSYS
&CELL
ABC 17.1580 17.158 17.158
UNIT ANGSTROM
&END CELL
&COORD
Ar -8.53869012951987116 -15.5816257770688615 2.85663672298278293

View file

@ -18,7 +18,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_BETA

View file

@ -17,7 +17,6 @@
&SUBSYS
&CELL
ABC 50.0 50.0 50.0
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_BETA

View file

@ -25,7 +25,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
COORD_FILE_NAME sample_pdb/ethene.pdb

View file

@ -17,7 +17,6 @@
&SUBSYS
&CELL
ABC 20.0 20.0 20.0
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_BETA

View file

@ -258,7 +258,6 @@
&SUBSYS
&CELL
ABC 24.955 24.955 24.955
UNIT ANGSTROM
&END CELL
&TOPOLOGY
CHARGE_B

View file

@ -33,7 +33,6 @@
&SUBSYS
&CELL
ABC 10.0 10.0 10.0
UNIT ANGSTROM
PERIODIC NONE
&END CELL
&COORD

Some files were not shown because too many files have changed in this diff Show more