Skip to content

Commit

Permalink
Improved description
Browse files Browse the repository at this point in the history
  • Loading branch information
ducryf authored and mkrack committed Oct 19, 2021
1 parent 8fe32df commit 7e159ef
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 35 deletions.
5 changes: 3 additions & 2 deletions src/input_cp2k_motion_print.F
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ SUBROUTINE add_format_keyword(keyword, section, pos, description)

END IF

CALL keyword_create(keyword, __LOCATION__, name="PRINT_ATOM_NAME", &
description="Write the atom name instead of the element symbol. Only valid for the XMOL format.", &
CALL keyword_create(keyword, __LOCATION__, name="PRINT_ATOM_KIND", &
description="Write the atom kind given in the subsys section instead of the element symbol. "// &
"Only valid for the XMOL format.", &
usage="PRINT_ELEMENT_NAME logical", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
Expand Down
8 changes: 4 additions & 4 deletions src/motion/mc/mc_ensembles.F
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ SUBROUTINE mc_run_ensemble(mc_env, para_env, globenv, input_declaration, nboxes,
molecules_file, moves_file
LOGICAL :: ionode, lbias, ldiscrete, lhmc, &
lnew_bias_env, loverlap, lreject, &
lstop, print_name, should_stop
lstop, print_kind, should_stop
REAL(dp), DIMENSION(:), POINTER :: pbias, pmavbmc_mol, pmclus_box, &
pmhmc_box, pmrot_mol, pmtraion_mol, &
pmtrans_mol, pmvol_box
Expand Down Expand Up @@ -203,8 +203,8 @@ SUBROUTINE mc_run_ensemble(mc_env, para_env, globenv, input_declaration, nboxes,
CALL section_vals_val_get(root_section, "MOTION%PRINT%TRAJECTORY%UNIT", &
c_val=unit_str)
unit_conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
CALL section_vals_val_get(root_section, "MOTION%PRINT%TRAJECTORY%PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(root_section, "MOTION%PRINT%TRAJECTORY%PRINT_ATOM_KIND", &
l_val=print_kind)

! get some data out of mc_par
CALL get_mc_par(mc_par(1)%mc_par, &
Expand Down Expand Up @@ -393,7 +393,7 @@ SUBROUTINE mc_run_ensemble(mc_env, para_env, globenv, input_declaration, nboxes,
ELSE
CALL write_particle_coordinates(particles_old(ibox)%list%els, &
com_crd, dump_xmol, 'POS', 'INITIAL BOX '//TRIM(ADJUSTL(cbox)), &
unit_conv=unit_conv, print_name=print_name)
unit_conv=unit_conv, print_kind=print_kind)
ENDIF
CALL open_file(file_name=data_file(ibox), &
unit_number=data_unit(ibox), file_position='APPEND', &
Expand Down
20 changes: 10 additions & 10 deletions src/motion/neb_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ SUBROUTINE dump_neb_info(neb_env, coords, vels, forces, particle_set, logger, &
CHARACTER(LEN=default_string_length) :: line, title, unit_str
INTEGER :: crd, ener, frc, handle, i, irep, ndig, &
ndigl, ttst, vel
LOGICAL :: explicit, lval, print_name
LOGICAL :: explicit, lval, print_kind
REAL(KIND=dp) :: f_ann, tmp_r1, unit_conv
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: ekin, temperatures
TYPE(cell_type), POINTER :: cell
Expand Down Expand Up @@ -211,42 +211,42 @@ SUBROUTINE dump_neb_info(neb_env, coords, vels, forces, particle_set, logger, &
! Gather units of measure for output
CALL section_vals_val_get(neb_env%motion_print_section, "TRAJECTORY%UNIT", &
c_val=unit_str)
CALL section_vals_val_get(neb_env%motion_print_section, "TRAJECTORY%PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(neb_env%motion_print_section, "TRAJECTORY%PRINT_ATOM_KIND", &
l_val=print_kind)
unit_conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
! This information can be digested by Molden
WRITE (UNIT=title, FMT="(A,I8,A,F20.10)") " i =", istep, ", E =", energies(irep)
CALL write_particle_coordinates(particle_set, crd, dump_xmol, "POS", title, &
cell=cell, array=coords%xyz(:, irep), unit_conv=unit_conv, &
print_name=print_name)
print_kind=print_kind)
CALL m_flush(crd)
END IF
! Dump Velocities
IF (vel > 0 .AND. PRESENT(vels)) THEN
! Gather units of measure for output
CALL section_vals_val_get(neb_env%motion_print_section, "VELOCITIES%UNIT", &
c_val=unit_str)
CALL section_vals_val_get(neb_env%motion_print_section, "VELOCITIES%PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(neb_env%motion_print_section, "VELOCITIES%PRINT_ATOM_KIND", &
l_val=print_kind)
unit_conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
WRITE (UNIT=title, FMT="(A,I8,A,F20.10)") " i =", istep, ", E =", energies(irep)
CALL write_particle_coordinates(particle_set, vel, dump_xmol, "VEL", title, &
cell=cell, array=vels%xyz(:, irep), unit_conv=unit_conv, &
print_name=print_name)
print_kind=print_kind)
CALL m_flush(vel)
END IF
! Dump Forces
IF (frc > 0 .AND. PRESENT(forces)) THEN
! Gather units of measure for output
CALL section_vals_val_get(neb_env%motion_print_section, "FORCES%UNIT", &
c_val=unit_str)
CALL section_vals_val_get(neb_env%motion_print_section, "FORCES%PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(neb_env%motion_print_section, "FORCES%PRINT_ATOM_KIND", &
l_val=print_kind)
unit_conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
WRITE (UNIT=title, FMT="(A,I8,A,F20.10)") " i =", istep, ", E =", energies(irep)
CALL write_particle_coordinates(particle_set, frc, dump_xmol, "FRC", title, &
cell=cell, array=forces%xyz(:, irep), unit_conv=unit_conv, &
print_name=print_name)
print_kind=print_kind)
CALL m_flush(frc)
END IF
CALL cp_print_key_finished_output(crd, logger, neb_env%motion_print_section, &
Expand Down
10 changes: 5 additions & 5 deletions src/motion/pint_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ SUBROUTINE pint_write_centroids(pint_env)
INTEGER :: handle, handle1, iat, ib, id, idim, &
idir, ierr, outformat, should_output, &
unit_nr
LOGICAL :: new_file, print_name
LOGICAL :: new_file, print_kind
REAL(kind=dp) :: nb, ss, unit_conv, vv
TYPE(cell_type), POINTER :: cell
TYPE(cp_logger_type), POINTER :: logger
Expand Down Expand Up @@ -157,7 +157,7 @@ SUBROUTINE pint_write_centroids(pint_env)
basis_section=print_key)
IF (.NOT. BTEST(should_output, cp_p_file)) CONTINUE

print_name = .FALSE.
print_kind = .FALSE.

! get units of measure for output (if available)
CALL section_vals_val_get(print_key, "UNIT", &
Expand All @@ -175,8 +175,8 @@ SUBROUTINE pint_write_centroids(pint_env)
form = "FORMATTED"
ext = ""
CASE (dump_xmol)
CALL section_vals_val_get(print_key, "PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(print_key, "PRINT_ATOM_KIND", &
l_val=print_kind)
form = "FORMATTED"
ext = ".xyz"
CASE default
Expand Down Expand Up @@ -237,7 +237,7 @@ SUBROUTINE pint_write_centroids(pint_env)
title=title(id), &
cell=cell, &
unit_conv=unit_conv, &
print_name=print_name)
print_kind=print_kind)
CALL cp_print_key_finished_output(unit_nr, logger, &
print_key, "", local=.FALSE.)
Expand Down
12 changes: 6 additions & 6 deletions src/motion_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ SUBROUTINE write_trajectory(force_env, root_section, it, time, dtime, etot, pk_n
LOGICAL :: charge_beta, charge_extended, &
charge_occup, explicit, &
my_extended_xmol_title, new_file, &
print_name
print_kind
REAL(dp), ALLOCATABLE :: fml_array(:)
REAL(KIND=dp) :: unit_conv
TYPE(cell_type), POINTER :: cell
Expand Down Expand Up @@ -346,7 +346,7 @@ SUBROUTINE write_trajectory(force_env, root_section, it, time, dtime, etot, pk_n
charge_occup = .FALSE.
charge_beta = .FALSE.
charge_extended = .FALSE.
print_name = .FALSE.
print_kind = .FALSE.

CALL force_env_get(force_env, cell=cell, subsys=subsys)
IF (PRESENT(particles)) THEN
Expand Down Expand Up @@ -391,8 +391,8 @@ SUBROUTINE write_trajectory(force_env, root_section, it, time, dtime, etot, pk_n
ENDIF
CASE (dump_xmol)
my_extended_xmol_title = .FALSE.
CALL section_vals_val_get(root_section, "MOTION%PRINT%TRAJECTORY%PRINT_ATOM_NAME", &
l_val=print_name)
CALL section_vals_val_get(root_section, "MOTION%PRINT%TRAJECTORY%PRINT_ATOM_KIND", &
l_val=print_kind)
IF (PRESENT(extended_xmol_title)) my_extended_xmol_title = extended_xmol_title
! This information can be digested by Molden
IF (my_extended_xmol_title) THEN
Expand Down Expand Up @@ -456,11 +456,11 @@ SUBROUTINE write_trajectory(force_env, root_section, it, time, dtime, etot, pk_n
ENDIF
ENDIF
CALL write_particle_coordinates(particle_set, traj_unit, outformat, TRIM(id_wpc), TRIM(title), cell, &
array=fml_array, print_name=print_name)
array=fml_array, print_kind=print_kind)
DEALLOCATE (fml_array)
ELSE
CALL write_particle_coordinates(particle_set, traj_unit, outformat, TRIM(id_wpc), TRIM(title), cell, &
unit_conv=unit_conv, print_name=print_name, &
unit_conv=unit_conv, print_kind=print_kind, &
charge_occup=charge_occup, &
charge_beta=charge_beta, &
charge_extended=charge_extended)
Expand Down
14 changes: 7 additions & 7 deletions src/particle_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ END SUBROUTINE get_particle_set
!> \param charge_occup ...
!> \param charge_beta ...
!> \param charge_extended ...
!> \param print_name ...
!> \param print_kind ...
!> \date 14.01.2002
!> \author MK
!> \version 1.0
! **************************************************************************************************
SUBROUTINE write_particle_coordinates(particle_set, iunit, output_format, &
content, title, cell, array, unit_conv, &
charge_occup, charge_beta, &
charge_extended, print_name)
charge_extended, print_kind)

TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
INTEGER :: iunit, output_format
Expand All @@ -187,7 +187,7 @@ SUBROUTINE write_particle_coordinates(particle_set, iunit, output_format, &
REAL(KIND=dp), DIMENSION(:), INTENT(IN), OPTIONAL :: array
REAL(KIND=dp), INTENT(IN), OPTIONAL :: unit_conv
LOGICAL, INTENT(IN), OPTIONAL :: charge_occup, charge_beta, &
charge_extended, print_name
charge_extended, print_kind

CHARACTER(len=*), PARAMETER :: routineN = 'write_particle_coordinates'

Expand All @@ -198,7 +198,7 @@ SUBROUTINE write_particle_coordinates(particle_set, iunit, output_format, &
INTEGER :: handle, iatom, natom
LOGICAL :: dummy, my_charge_beta, &
my_charge_extended, my_charge_occup, &
my_print_name
my_print_kind
REAL(KIND=dp) :: angle_alpha, angle_beta, angle_gamma, &
factor, qeff
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: arr
Expand All @@ -224,14 +224,14 @@ SUBROUTINE write_particle_coordinates(particle_set, iunit, output_format, &
END IF
SELECT CASE (output_format)
CASE (dump_xmol)
my_print_name = .FALSE.
IF (PRESENT(print_name)) my_print_name = print_name
my_print_kind = .FALSE.
IF (PRESENT(print_kind)) my_print_kind = print_kind
WRITE (iunit, "(I8)") natom
WRITE (iunit, "(A)") TRIM(title)
DO iatom = 1, natom
CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
element_symbol=element_symbol)
IF (LEN_TRIM(element_symbol) == 0 .OR. my_print_name) THEN
IF (LEN_TRIM(element_symbol) == 0 .OR. my_print_kind) THEN
CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
name=atm_name)
dummy = qmmm_ff_precond_only_qm(id1=atm_name)
Expand Down
2 changes: 1 addition & 1 deletion tests/QMMM/SE/regtest-force-mixing/tyrosine_NVT.inp
Original file line number Diff line number Diff line change
Expand Up @@ -3945,7 +3945,7 @@
&PRINT
&TRAJECTORY
FORMAT XYZ
PRINT_ATOM_NAME
PRINT_ATOM_KIND .TRUE.
&EACH
MD 1
&END EACH
Expand Down

0 comments on commit 7e159ef

Please sign in to comment.