Skip to content

Commit

Permalink
Rename gopt_f77_methods.f90 to avoid name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Dec 18, 2021
1 parent d26c364 commit bb3ff93
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 210 deletions.
137 changes: 69 additions & 68 deletions src/motion/bfgs_optimizer.F
Original file line number Diff line number Diff line change
Expand Up @@ -13,78 +13,79 @@
! **************************************************************************************************
MODULE bfgs_optimizer

USE atomic_kind_list_types, ONLY: atomic_kind_list_type
USE atomic_kind_types, ONLY: get_atomic_kind,&
get_atomic_kind_set
USE cell_types, ONLY: cell_type,&
pbc
USE constraint_fxd, ONLY: fix_atom_control
USE cp_blacs_env, ONLY: cp_blacs_env_create,&
cp_blacs_env_release,&
cp_blacs_env_type
USE cp_external_control, ONLY: external_control
USE cp_files, ONLY: close_file,&
open_file
USE cp_fm_basic_linalg, ONLY: cp_fm_column_scale,&
cp_fm_transpose
USE cp_fm_diag, ONLY: choose_eigv_solver
USE cp_fm_struct, ONLY: cp_fm_struct_create,&
cp_fm_struct_release,&
cp_fm_struct_type
USE cp_fm_types, ONLY: cp_fm_create,&
cp_fm_get_info,&
cp_fm_read_unformatted,&
cp_fm_release,&
cp_fm_set_all,&
cp_fm_to_fm,&
cp_fm_type,&
cp_fm_write_unformatted
USE cp_gemm_interface, ONLY: cp_gemm
USE cp_log_handling, ONLY: cp_get_default_logger,&
cp_logger_type,&
cp_to_string
USE cp_output_handling, ONLY: cp_iterate,&
cp_p_file,&
cp_print_key_finished_output,&
cp_print_key_should_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_subsys_types, ONLY: cp_subsys_get,&
cp_subsys_type
USE force_env_types, ONLY: force_env_get,&
force_env_type
USE global_types, ONLY: global_environment_type
USE gopt_f_methods, ONLY: gopt_f_ii,&
gopt_f_io,&
gopt_f_io_finalize,&
gopt_f_io_init,&
print_geo_opt_header,&
print_geo_opt_nc
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_method_id,&
default_ts_method_id
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_type,&
section_vals_val_get,&
section_vals_val_set
USE kinds, ONLY: default_path_length,&
dp
USE machine, ONLY: m_flush,&
m_walltime
USE message_passing, ONLY: mp_min,&
mp_sum
USE particle_list_types, ONLY: particle_list_type
USE space_groups, ONLY: identify_space_group,&
print_spgr,&
spgr_apply_rotations_coord,&
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
USE atomic_kind_list_types, ONLY: atomic_kind_list_type
USE atomic_kind_types, ONLY: get_atomic_kind, &
get_atomic_kind_set
USE cell_types, ONLY: cell_type, &
pbc
USE constraint_fxd, ONLY: fix_atom_control
USE cp_blacs_env, ONLY: cp_blacs_env_create, &
cp_blacs_env_release, &
cp_blacs_env_type
USE cp_external_control, ONLY: external_control
USE cp_files, ONLY: close_file, &
open_file
USE cp_fm_basic_linalg, ONLY: cp_fm_column_scale, &
cp_fm_transpose
USE cp_fm_diag, ONLY: choose_eigv_solver
USE cp_fm_struct, ONLY: cp_fm_struct_create, &
cp_fm_struct_release, &
cp_fm_struct_type
USE cp_fm_types, ONLY: cp_fm_create, &
cp_fm_get_info, &
cp_fm_read_unformatted, &
cp_fm_release, &
cp_fm_set_all, &
cp_fm_to_fm, &
cp_fm_type, &
cp_fm_write_unformatted
USE cp_gemm_interface, ONLY: cp_gemm
USE cp_log_handling, ONLY: cp_get_default_logger, &
cp_logger_type, &
cp_to_string
USE cp_output_handling, ONLY: cp_iterate, &
cp_p_file, &
cp_print_key_finished_output, &
cp_print_key_should_output, &
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE cp_subsys_types, ONLY: cp_subsys_get, &
cp_subsys_type
USE force_env_types, ONLY: force_env_get, &
force_env_type
USE global_types, ONLY: global_environment_type
USE gopt_f_methods, ONLY: gopt_f_ii, &
gopt_f_io, &
gopt_f_io_finalize, &
gopt_f_io_init, &
print_geo_opt_header, &
print_geo_opt_nc
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_method_id, &
default_ts_method_id
USE input_section_types, ONLY: section_vals_get_subs_vals, &
section_vals_type, &
section_vals_val_get, &
section_vals_val_set
USE kinds, ONLY: default_path_length, &
dp
USE machine, ONLY: m_flush, &
m_walltime
USE message_passing, ONLY: mp_min, &
mp_sum
USE particle_list_types, ONLY: particle_list_type
USE space_groups, ONLY: identify_space_group, &
print_spgr, &
spgr_apply_rotations_coord, &
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
#include "../base/base_uses.f90"

IMPLICIT NONE
PRIVATE
#include "gopt_f77_methods.f90"

#:include "gopt_f77_methods.fypp"

CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'bfgs_optimizer'
LOGICAL, PARAMETER :: debug_this_module = .TRUE.
Expand Down
77 changes: 39 additions & 38 deletions src/motion/cg_optimizer.F
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,49 @@
! **************************************************************************************************
MODULE cg_optimizer

USE cell_types, ONLY: cell_type
USE cg_utils, ONLY: cg_linmin,&
get_conjugate_direction
USE cp_external_control, ONLY: external_control
USE cp_log_handling, ONLY: cp_get_default_logger,&
cp_logger_type
USE cp_output_handling, ONLY: cp_iterate,&
cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_subsys_types, ONLY: cp_subsys_type
USE force_env_types, ONLY: force_env_get,&
force_env_type
USE global_types, ONLY: global_environment_type
USE gopt_f_methods, ONLY: gopt_f_ii,&
gopt_f_io,&
gopt_f_io_finalize,&
gopt_f_io_init,&
print_geo_opt_header,&
print_geo_opt_nc
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_direct_id,&
default_cell_geo_opt_id,&
default_cell_md_id,&
default_cell_method_id,&
default_minimization_method_id,&
default_ts_method_id
USE input_section_types, ONLY: section_vals_type,&
section_vals_val_get,&
section_vals_val_set
USE kinds, ONLY: dp
USE machine, ONLY: m_walltime
USE space_groups, ONLY: identify_space_group,&
print_spgr,&
spgr_apply_rotations_coord,&
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
USE cell_types, ONLY: cell_type
USE cg_utils, ONLY: cg_linmin, &
get_conjugate_direction
USE cp_external_control, ONLY: external_control
USE cp_log_handling, ONLY: cp_get_default_logger, &
cp_logger_type
USE cp_output_handling, ONLY: cp_iterate, &
cp_print_key_finished_output, &
cp_print_key_unit_nr
USE cp_subsys_types, ONLY: cp_subsys_type
USE force_env_types, ONLY: force_env_get, &
force_env_type
USE global_types, ONLY: global_environment_type
USE gopt_f_methods, ONLY: gopt_f_ii, &
gopt_f_io, &
gopt_f_io_finalize, &
gopt_f_io_init, &
print_geo_opt_header, &
print_geo_opt_nc
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_direct_id, &
default_cell_geo_opt_id, &
default_cell_md_id, &
default_cell_method_id, &
default_minimization_method_id, &
default_ts_method_id
USE input_section_types, ONLY: section_vals_type, &
section_vals_val_get, &
section_vals_val_set
USE kinds, ONLY: dp
USE machine, ONLY: m_walltime
USE space_groups, ONLY: identify_space_group, &
print_spgr, &
spgr_apply_rotations_coord, &
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
#include "../base/base_uses.f90"

IMPLICIT NONE
PRIVATE
#include "gopt_f77_methods.f90"

#:include "gopt_f77_methods.fypp"

PUBLIC :: geoopt_cg
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
Expand Down
37 changes: 19 additions & 18 deletions src/motion/cg_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,29 @@
!> 10.2005
! **************************************************************************************************
MODULE cg_utils
USE cp_external_control, ONLY: external_control
USE dimer_types, ONLY: dimer_env_type
USE dimer_utils, ONLY: dimer_thrs,&
rotate_dimer
USE global_types, ONLY: global_environment_type
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_method_id,&
default_minimization_method_id,&
default_shellcore_method_id,&
default_ts_method_id,&
ls_2pnt,&
ls_fit,&
ls_gold
USE kinds, ONLY: dp
USE mathconstants, ONLY: pi
USE memory_utilities, ONLY: reallocate
USE cp_external_control, ONLY: external_control
USE dimer_types, ONLY: dimer_env_type
USE dimer_utils, ONLY: dimer_thrs, &
rotate_dimer
USE global_types, ONLY: global_environment_type
USE gopt_f_types, ONLY: gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_constants, ONLY: default_cell_method_id, &
default_minimization_method_id, &
default_shellcore_method_id, &
default_ts_method_id, &
ls_2pnt, &
ls_fit, &
ls_gold
USE kinds, ONLY: dp
USE mathconstants, ONLY: pi
USE memory_utilities, ONLY: reallocate
#include "../base/base_uses.f90"

IMPLICIT NONE
PRIVATE
#include "gopt_f77_methods.f90"

#:include "gopt_f77_methods.fypp"

PUBLIC :: cg_linmin, get_conjugate_direction
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
Expand Down
53 changes: 27 additions & 26 deletions src/motion/cp_lbfgs_optimizer_gopt.F
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,36 @@
!> @version 2.2002
! **************************************************************************************************
MODULE cp_lbfgs_optimizer_gopt
USE cp_lbfgs, ONLY: setulb
USE cp_log_handling, ONLY: cp_get_default_logger,&
cp_logger_type,&
cp_to_string
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_para_env, ONLY: cp_para_env_release,&
cp_para_env_retain
USE cp_para_types, ONLY: cp_para_env_type
USE cp_subsys_types, ONLY: cp_subsys_type
USE force_env_types, ONLY: force_env_get,&
force_env_type
USE gopt_f_methods, ONLY: gopt_f_io
USE gopt_f_types, ONLY: gopt_f_release,&
gopt_f_retain,&
gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_section_types, ONLY: section_vals_type
USE kinds, ONLY: dp
USE machine, ONLY: m_walltime
USE message_passing, ONLY: mp_bcast
USE space_groups, ONLY: spgr_apply_rotations_coord,&
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
USE cp_lbfgs, ONLY: setulb
USE cp_log_handling, ONLY: cp_get_default_logger, &
cp_logger_type, &
cp_to_string
USE cp_output_handling, ONLY: cp_print_key_finished_output, &
cp_print_key_unit_nr
USE cp_para_env, ONLY: cp_para_env_release, &
cp_para_env_retain
USE cp_para_types, ONLY: cp_para_env_type
USE cp_subsys_types, ONLY: cp_subsys_type
USE force_env_types, ONLY: force_env_get, &
force_env_type
USE gopt_f_methods, ONLY: gopt_f_io
USE gopt_f_types, ONLY: gopt_f_release, &
gopt_f_retain, &
gopt_f_type
USE gopt_param_types, ONLY: gopt_param_type
USE input_section_types, ONLY: section_vals_type
USE kinds, ONLY: dp
USE machine, ONLY: m_walltime
USE message_passing, ONLY: mp_bcast
USE space_groups, ONLY: spgr_apply_rotations_coord, &
spgr_apply_rotations_force
USE space_groups_types, ONLY: spgr_type
#include "../base/base_uses.f90"

IMPLICIT NONE
PRIVATE
#include "gopt_f77_methods.f90"

#:include "gopt_f77_methods.fypp"

LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_lbfgs_optimizer_gopt'
Expand Down Expand Up @@ -882,7 +883,7 @@ END SUBROUTINE cp_opt_gopt_stop
! files are almost the same (multi-line use change it a bit)
! [template(type1,nametype1,USE,type1_retain,type1_release,type1_eval_at)]
! ARGS:
! INTERFACE = "#include "gopt_f77_methods.f90""
! INTERFACE = "#:include "gopt_f77_methods.fypp""
! USE = "USE gopt_f_types, ONLY: gopt_f_type, gopt_f_release,gopt_f_retain"
! nametype1 = "gopt"
! type1 = "type(gopt_f_type)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
! Copyright 2000-2021 CP2K developers group <https://cp2k.org> !
! !
! SPDX-License-Identifier: GPL-2.0-or-later !
!--------------------------------------------------------------------------------------------------!
#!-------------------------------------------------------------------------------------------------!
#! CP2K: A general program to perform molecular dynamics simulations !
#! Copyright 2000-2021 CP2K developers group <https://cp2k.org> !
#! !
#! SPDX-License-Identifier: GPL-2.0-or-later !
#!-------------------------------------------------------------------------------------------------!

! *****************************************************************************
! **************************************************************************************************
!> \brief evaluete the potential energy and its gradients using an array
!> with same dimension as the particle_set
!> \param gopt_env the geometry optimization environment
Expand All @@ -17,7 +17,7 @@
!> \par History
!> none
!> \author Teodoro Laino [tlaino] - University of Zurich - 01.2008
! *****************************************************************************
! **************************************************************************************************
INTERFACE

RECURSIVE SUBROUTINE cp_eval_at(gopt_env, x, f, gradient, master, &
Expand Down

0 comments on commit bb3ff93

Please sign in to comment.