Skip to content

Commit

Permalink
REFTRAJ with energy but no forces
Browse files Browse the repository at this point in the history
  • Loading branch information
marci73 committed Dec 5, 2018
1 parent 2171b89 commit d0b94cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cp_control_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ SUBROUTINE read_dft_control(dft_control, dft_section)
CHARACTER(len=default_path_length) :: basis_set_file_name, potential_file_name
CHARACTER(LEN=default_string_length), &
DIMENSION(:), POINTER :: tmpstringlist
INTEGER :: excitations, i, irep, isize, method_id, &
INTEGER :: excitations, irep, isize, method_id, &
nrep, xc_deriv_method_id
LOGICAL :: do_ot, do_rtp, explicit, is_present, &
l_param, not_SE, was_present
Expand Down
6 changes: 6 additions & 0 deletions src/motion/input_cp2k_md.F
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ SUBROUTINE create_reftraj_section(section)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, name="eval_forces", &
description="Evaluate the forces for each retrieved snapshot during a REFTRAJ run", &
repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL create_msd_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
Expand Down
2 changes: 1 addition & 1 deletion src/motion/integrator.F
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ SUBROUTINE reftraj ( md_env)
! Task to perform on the reference trajectory
! Compute energy and forces
![NB] let reftraj work with force mixing which does not have consistent energies and forces
CALL force_env_calc_energy_force(force_env,eval_energy_forces=reftraj_env%info%eval_EF,&
CALL force_env_calc_energy_force(force_env,calc_force=reftraj_env%info%eval_forces,eval_energy_forces=reftraj_env%info%eval_EF,&
require_consistent_energy_force=.FALSE.)
! Metadynamics
Expand Down
3 changes: 3 additions & 0 deletions src/motion/reftraj_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ MODULE reftraj_types
INTEGER :: last_snapshot
INTEGER :: stride
LOGICAL :: eval_ef
LOGICAL :: eval_forces
LOGICAL :: variable_volume
LOGICAL :: msd
TYPE(cp_parser_type), POINTER :: traj_parser
Expand Down Expand Up @@ -116,6 +117,8 @@ SUBROUTINE create_reftraj(reftraj, reftraj_section, para_env)
CALL section_vals_val_get(reftraj_section, "LAST_SNAPSHOT", i_val=reftraj%info%last_snapshot)
CALL section_vals_val_get(reftraj_section, "STRIDE", i_val=reftraj%info%stride)
CALL section_vals_val_get(reftraj_section, "EVAL_ENERGY_FORCES", l_val=reftraj%info%eval_ef)
CALL section_vals_val_get(reftraj_section, "EVAL_FORCES", l_val=reftraj%info%eval_forces)
IF(reftraj%info%eval_forces) reftraj%info%eval_ef = .TRUE.

CALL section_vals_val_get(reftraj_section, "MSD%_SECTION_PARAMETERS_", &
l_val=reftraj%info%msd)
Expand Down

0 comments on commit d0b94cf

Please sign in to comment.