Skip to content

Commit

Permalink
Continue with cell_opt_types, gopt_f_types, gopt_param_types, helium_…
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
Frederick Stein authored and fstein93 committed Jun 24, 2023
1 parent e0c8a43 commit f657b0d
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 244 deletions.
14 changes: 7 additions & 7 deletions src/motion/cell_opt_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ MODULE cell_opt_types
! **************************************************************************************************
TYPE cell_opt_env_type
! Simulation cell optimization parameters
INTEGER :: constraint_id
LOGICAL :: keep_angles, &
keep_symmetry
REAL(KIND=dp) :: pres_ext, pres_int, pres_tol, pres_constr
REAL(KIND=dp), DIMENSION(3, 3) :: mtrx
REAL(KIND=dp), DIMENSION(3, 3) :: rot_matrix
TYPE(cell_type), POINTER :: ref_cell
INTEGER :: constraint_id = fix_none
LOGICAL :: keep_angles = .FALSE., &
keep_symmetry = .FALSE.
REAL(KIND=dp) :: pres_ext = 0.0_dp, pres_int = 0.0_dp, pres_tol = 0.0_dp, pres_constr = 0.0_dp
REAL(KIND=dp), DIMENSION(3, 3) :: mtrx = 0.0_dp
REAL(KIND=dp), DIMENSION(3, 3) :: rot_matrix = 0.0_dp
TYPE(cell_type), POINTER :: ref_cell => NULL()
END TYPE cell_opt_env_type

CONTAINS
Expand Down
22 changes: 11 additions & 11 deletions src/motion/cp_lbfgs_optimizer_gopt.F
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ MODULE cp_lbfgs_optimizer_gopt
!> @version 2.2002
! **************************************************************************************************
TYPE cp_lbfgs_opt_gopt_type
CHARACTER(len=60) :: task
CHARACTER(len=60) :: csave
LOGICAL :: lsave(4)
INTEGER :: m, print_every, master, max_f_per_iter, status, n_iter
INTEGER, DIMENSION(:), POINTER :: kind_of_bound, i_work_array, isave
REAL(kind=dp) :: f, wanted_relative_f_delta, wanted_projected_gradient, &
last_f, projected_gradient, eold, emin, trust_radius
REAL(kind=dp), DIMENSION(:), POINTER :: x, lower_bound, upper_bound, &
gradient, dsave, work_array
TYPE(mp_para_env_type), POINTER :: para_env
TYPE(gopt_f_type), POINTER :: obj_funct
CHARACTER(len=60) :: task = ""
CHARACTER(len=60) :: csave = ""
LOGICAL :: lsave(4) = .FALSE.
INTEGER :: m = 0, print_every = 0, master = 0, max_f_per_iter = 0, status = 0, n_iter = 0
INTEGER, DIMENSION(:), POINTER :: kind_of_bound => NULL(), i_work_array => NULL(), isave => NULL()
REAL(kind=dp) :: f = 0.0_dp, wanted_relative_f_delta = 0.0_dp, wanted_projected_gradient = 0.0_dp, &
last_f = 0.0_dp, projected_gradient = 0.0_dp, eold = 0.0_dp, emin = 0.0_dp, trust_radius = 0.0_dp
REAL(kind=dp), DIMENSION(:), POINTER :: x => NULL(), lower_bound => NULL(), upper_bound => NULL(), &
gradient => NULL(), dsave => NULL(), work_array => NULL()
TYPE(mp_para_env_type), POINTER :: para_env => NULL()
TYPE(gopt_f_type), POINTER :: obj_funct => NULL()
END TYPE cp_lbfgs_opt_gopt_type

CONTAINS
Expand Down
35 changes: 16 additions & 19 deletions src/motion/dimer_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ MODULE dimer_types
! **************************************************************************************************
TYPE dimer_rotational_type
! Rotational parameters
INTEGER :: rotation_step
LOGICAL :: interpolate_gradient
REAL(KIND=dp) :: angle_tol, angle1, angle2, dCdp, curvature
REAL(KIND=dp), POINTER, DIMENSION(:) :: g0, g1, g1p
INTEGER :: rotation_step = 0
LOGICAL :: interpolate_gradient = .FALSE.
REAL(KIND=dp) :: angle_tol = 0.0_dp, angle1 = 0.0_dp, angle2 = 0.0_dp, &
dCdp = 0.0_dp, curvature = 0.0_dp
REAL(KIND=dp), POINTER, DIMENSION(:) :: g0 => NULL(), g1 => NULL(), g1p => NULL()
END TYPE dimer_rotational_type

! **************************************************************************************************
Expand All @@ -70,7 +71,7 @@ MODULE dimer_types
! **************************************************************************************************
TYPE dimer_translational_type
! Translational parameters
REAL(KIND=dp), POINTER, DIMENSION(:) :: tls_vec
REAL(KIND=dp), POINTER, DIMENSION(:) :: tls_vec => NULL()
END TYPE dimer_translational_type

! **************************************************************************************************
Expand All @@ -80,8 +81,8 @@ MODULE dimer_types
!> \author Luca Bellucci and Teodoro Laino - created [tlaino] - 01.2008
! **************************************************************************************************
TYPE dimer_cg_rot_type
REAL(KIND=dp) :: norm_theta, norm_theta_old, norm_h
REAL(KIND=dp), POINTER, DIMENSION(:) :: nvec_old
REAL(KIND=dp) :: norm_theta = 0.0_dp, norm_theta_old = 0.0_dp, norm_h = 0.0_dp
REAL(KIND=dp), POINTER, DIMENSION(:) :: nvec_old => NULL()
END TYPE dimer_cg_rot_type

! **************************************************************************************************
Expand All @@ -91,14 +92,14 @@ MODULE dimer_types
!> \author Luca Bellucci and Teodoro Laino - created [tlaino] - 01.2008
! **************************************************************************************************
TYPE dimer_env_type
INTEGER :: ref_count
REAL(KIND=dp) :: dr
REAL(KIND=dp), POINTER, DIMENSION(:) :: nvec
REAL(KIND=dp) :: beta
TYPE(dimer_rotational_type) :: rot
TYPE(dimer_translational_type) :: tsl
TYPE(dimer_cg_rot_type) :: cg_rot
LOGICAL :: kdimer
INTEGER :: ref_count = 0
REAL(KIND=dp) :: dr = 0.0_dp
REAL(KIND=dp), POINTER, DIMENSION(:) :: nvec => NULL()
REAL(KIND=dp) :: beta = 0.0_dp
TYPE(dimer_rotational_type) :: rot = dimer_rotational_type()
TYPE(dimer_translational_type) :: tsl = dimer_translational_type()
TYPE(dimer_cg_rot_type) :: cg_rot = dimer_cg_rot_type()
LOGICAL :: kdimer = .FALSE.
END TYPE dimer_env_type

CONTAINS
Expand Down Expand Up @@ -131,8 +132,6 @@ SUBROUTINE dimer_env_create(dimer_env, subsys, globenv, dimer_section)
ALLOCATE (dimer_env)
dimer_env%ref_count = 1
! Setup NVEC
NULLIFY (dimer_env%nvec, dimer_env%rot%g0, dimer_env%rot%g1, dimer_env%rot%g1p, &
dimer_env%tsl%tls_vec)
! get natom
CALL cp_subsys_get(subsys=subsys, natom=natom)
! Allocate the working arrays
Expand Down Expand Up @@ -195,8 +194,6 @@ SUBROUTINE dimer_env_create(dimer_env, subsys, globenv, dimer_section)
r_val=dimer_env%beta)
! initialise values
dimer_env%cg_rot%norm_h = 1.0_dp
dimer_env%cg_rot%norm_theta = 0.0_dp
dimer_env%cg_rot%norm_theta_old = 0.0_dp
dimer_env%rot%g0 = 0.0_dp
dimer_env%rot%g1 = 0.0_dp
dimer_env%rot%g1p = 0.0_dp
Expand Down
30 changes: 15 additions & 15 deletions src/motion/gopt_f_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ MODULE gopt_f_types
!> none
! **************************************************************************************************
TYPE gopt_f_type
INTEGER :: ref_count
INTEGER :: nfree
INTEGER :: type_id, ts_method_id, cell_method_id, shellcore_method_id
LOGICAL :: dimer_rotation, do_line_search, eval_opt_geo
CHARACTER(LEN=default_string_length) :: label, tag
TYPE(force_env_type), POINTER :: force_env
TYPE(global_environment_type), POINTER :: globenv
INTEGER :: ref_count = 0
INTEGER :: nfree = 0
INTEGER :: type_id=default_cell_method_id, ts_method_id=0, cell_method_id=0, shellcore_method_id=0
LOGICAL :: dimer_rotation = .FALSE., do_line_search = .FALSE., eval_opt_geo = .FALSE.
CHARACTER(LEN=default_string_length) :: label = "", tag = ""
TYPE(force_env_type), POINTER :: force_env => NULL()
TYPE(global_environment_type), POINTER :: globenv => NULL()
! Motion section must be references only for IO of the MOTION%PRINT..
TYPE(section_vals_type), POINTER :: motion_section, geo_section
TYPE(dimer_env_type), POINTER :: dimer_env
TYPE(gopt_f_type), POINTER :: gopt_dimer_env
TYPE(gopt_param_type), POINTER :: gopt_dimer_param
TYPE(cell_opt_env_type), POINTER :: cell_env
TYPE(spgr_type), POINTER :: spgr
REAL(KIND=dp), DIMENSION(3, 3) :: h_ref
LOGICAL :: require_consistent_energy_force
TYPE(section_vals_type), POINTER :: motion_section => NULL(), geo_section => NULL()
TYPE(dimer_env_type), POINTER :: dimer_env => NULL()
TYPE(gopt_f_type), POINTER :: gopt_dimer_env => NULL()
TYPE(gopt_param_type), POINTER :: gopt_dimer_param => NULL()
TYPE(cell_opt_env_type), POINTER :: cell_env => NULL()
TYPE(spgr_type), POINTER :: spgr => NULL()
REAL(KIND=dp), DIMENSION(3, 3) :: h_ref = 0.0_dp
LOGICAL :: require_consistent_energy_force = .FALSE.
END TYPE gopt_f_type

CONTAINS
Expand Down
26 changes: 13 additions & 13 deletions src/motion/gopt_param_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ MODULE gopt_param_types
!> \author Fawzi Mohamed
! **************************************************************************************************
TYPE cg_ls_param_type
INTEGER :: brent_max_iter, type_id
REAL(KIND=dp) :: brent_tol, brack_limit, initial_step, max_step
LOGICAL :: grad_only
INTEGER :: brent_max_iter = 0, type_id = default_cell_method_id
REAL(KIND=dp) :: brent_tol = 0.0_dp, brack_limit = 0.0_dp, initial_step = 0.0_dp, max_step = 0.0_dp
LOGICAL :: grad_only = .FALSE.
END TYPE cg_ls_param_type

! **************************************************************************************************
TYPE gopt_param_type
LOGICAL :: Fletcher_Reeves
INTEGER :: method_id, type_id
INTEGER :: ts_method_id, cell_method_id, shellcore_method_id
INTEGER :: max_f_per_iter, max_iter, max_h_rank
INTEGER :: max_steep_steps
REAL(KIND=dp) :: restart_limit
REAL(KIND=dp) :: wanted_proj_gradient, wanted_rel_f_error
REAL(KIND=dp) :: max_dr, max_force, rms_dr, rms_force
REAL(KIND=dp) :: dimer_angle_tol
TYPE(cg_ls_param_type) :: cg_ls
LOGICAL :: Fletcher_Reeves = .FALSE.
INTEGER :: method_id = default_cell_method_id, type_id = default_cell_method_id
INTEGER :: ts_method_id = 0, cell_method_id = 0, shellcore_method_id = 0
INTEGER :: max_f_per_iter = 0, max_iter = 0, max_h_rank = 0
INTEGER :: max_steep_steps = 0
REAL(KIND=dp) :: restart_limit = 0.0_dp
REAL(KIND=dp) :: wanted_proj_gradient = 0.0_dp, wanted_rel_f_error = 0.0_dp
REAL(KIND=dp) :: max_dr = 0.0_dp, max_force = 0.0_dp, rms_dr = 0.0_dp, rms_force = 0.0_dp
REAL(KIND=dp) :: dimer_angle_tol = 0.0_dp
TYPE(cg_ls_param_type) :: cg_ls = cg_ls_param_type()
END TYPE gopt_param_type

CONTAINS
Expand Down

0 comments on commit f657b0d

Please sign in to comment.