LCOV - code coverage report
Current view: top level - src - input_cp2k_neb.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:936074a) Lines: 100.0 % 176 176
Test Date: 2025-12-04 06:27:48 Functions: 100.0 % 2 2

            Line data    Source code
       1              : !--------------------------------------------------------------------------------------------------!
       2              : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3              : !   Copyright 2000-2025 CP2K developers group <https://cp2k.org>                                   !
       4              : !                                                                                                  !
       5              : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6              : !--------------------------------------------------------------------------------------------------!
       7              : 
       8              : ! **************************************************************************************************
       9              : !> \par History
      10              : !>      - taken out of input_cp2k_motion
      11              : !> \author Ole Schuett
      12              : ! **************************************************************************************************
      13              : 
      14              : MODULE input_cp2k_neb
      15              :    USE bibliography,                    ONLY: Elber1987,&
      16              :                                               Jonsson1998,&
      17              :                                               Jonsson2000_1,&
      18              :                                               Jonsson2000_2,&
      19              :                                               Wales2004
      20              :    USE cp_output_handling,              ONLY: add_last_numeric,&
      21              :                                               cp_print_key_section_create,&
      22              :                                               high_print_level,&
      23              :                                               low_print_level,&
      24              :                                               medium_print_level
      25              :    USE cp_units,                        ONLY: cp_unit_to_cp2k
      26              :    USE input_constants,                 ONLY: &
      27              :         band_diis_opt, band_md_opt, do_b_neb, do_ci_neb, do_d_neb, do_eb, do_it_neb, &
      28              :         do_rep_blocked, do_rep_interleaved, do_sm, pot_neb_fe, pot_neb_full, pot_neb_me
      29              :    USE input_cp2k_thermostats,          ONLY: create_coord_section,&
      30              :                                               create_velocity_section
      31              :    USE input_keyword_types,             ONLY: keyword_create,&
      32              :                                               keyword_release,&
      33              :                                               keyword_type
      34              :    USE input_section_types,             ONLY: section_add_keyword,&
      35              :                                               section_add_subsection,&
      36              :                                               section_create,&
      37              :                                               section_release,&
      38              :                                               section_type
      39              :    USE input_val_types,                 ONLY: real_t
      40              :    USE kinds,                           ONLY: dp
      41              :    USE string_utilities,                ONLY: s2a
      42              : #include "./base/base_uses.f90"
      43              : 
      44              :    IMPLICIT NONE
      45              :    PRIVATE
      46              : 
      47              :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      48              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_neb'
      49              : 
      50              :    PUBLIC :: create_band_section
      51              : 
      52              : CONTAINS
      53              : 
      54              : ! **************************************************************************************************
      55              : !> \brief creates the section for a BAND run
      56              : !> \param section will contain the pint section
      57              : !> \author Teodoro Laino 09.2006 [tlaino]
      58              : ! **************************************************************************************************
      59         9573 :    SUBROUTINE create_band_section(section)
      60              :       TYPE(section_type), POINTER                        :: section
      61              : 
      62              :       TYPE(keyword_type), POINTER                        :: keyword
      63              :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
      64              : 
      65         9573 :       CPASSERT(.NOT. ASSOCIATED(section))
      66              :       CALL section_create(section, __LOCATION__, name="band", &
      67              :                           description="The section that controls a BAND run", &
      68              :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
      69        57438 :                           citations=[Elber1987, Jonsson1998, Jonsson2000_1, Jonsson2000_2, Wales2004])
      70         9573 :       NULLIFY (keyword, print_key, subsection, subsubsection)
      71              : 
      72              :       CALL keyword_create(keyword, __LOCATION__, name="NPROC_REP", &
      73              :                           description="Specify the number of processors to be used per replica "// &
      74              :                           "environment (for parallel runs)", &
      75         9573 :                           default_i_val=1)
      76         9573 :       CALL section_add_keyword(section, keyword)
      77         9573 :       CALL keyword_release(keyword)
      78              : 
      79              :       CALL keyword_create(keyword, __LOCATION__, name="PROC_DIST_TYPE", &
      80              :                           description="Specify the topology of the mapping of processors into replicas.", &
      81              :                           usage="PROC_DIST_TYPE (INTERLEAVED|BLOCKED)", &
      82              :                           enum_c_vals=s2a("INTERLEAVED", &
      83              :                                           "BLOCKED"), &
      84              :                           enum_desc=s2a("Interleaved distribution", &
      85              :                                         "Blocked distribution"), &
      86              :                           enum_i_vals=[do_rep_interleaved, do_rep_blocked], &
      87         9573 :                           default_i_val=do_rep_blocked)
      88         9573 :       CALL section_add_keyword(section, keyword)
      89         9573 :       CALL keyword_release(keyword)
      90              : 
      91              :       CALL keyword_create(keyword, __LOCATION__, name="BAND_TYPE", &
      92              :                           description="Specifies the type of BAND calculation", &
      93              :                           usage="BAND_TYPE (B-NEB|IT-NEB|CI-NEB|D-NEB|SM|EB)", &
      94              :                           default_i_val=do_it_neb, &
      95              :                           enum_c_vals=s2a("B-NEB", &
      96              :                                           "IT-NEB", &
      97              :                                           "CI-NEB", &
      98              :                                           "D-NEB", &
      99              :                                           "SM", &
     100              :                                           "EB"), &
     101              :                           enum_desc=s2a("Bisection nudged elastic band", &
     102              :                                         "Improved tangent nudged elastic band", &
     103              :                                         "Climbing image nudged elastic band", &
     104              :                                         "Doubly nudged elastic band", &
     105              :                                         "String Method", &
     106              :                                         "Elastic band (Hamiltonian formulation)"), &
     107         9573 :                           enum_i_vals=[do_b_neb, do_it_neb, do_ci_neb, do_d_neb, do_sm, do_eb])
     108         9573 :       CALL section_add_keyword(section, keyword)
     109         9573 :       CALL keyword_release(keyword)
     110              : 
     111              :       CALL keyword_create(keyword, __LOCATION__, name="NUMBER_OF_REPLICA", &
     112              :                           description="Specify the number of Replica to use in the BAND", &
     113         9573 :                           default_i_val=10)
     114         9573 :       CALL section_add_keyword(section, keyword)
     115         9573 :       CALL keyword_release(keyword)
     116              : 
     117              :       CALL keyword_create(keyword, __LOCATION__, name="USE_COLVARS", &
     118              :                           description="Uses a version of the band scheme projected in a subspace of colvars.", &
     119         9573 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     120         9573 :       CALL section_add_keyword(section, keyword)
     121         9573 :       CALL keyword_release(keyword)
     122              : 
     123              :       CALL keyword_create(keyword, __LOCATION__, name="POT_TYPE", &
     124              :                           description="Specifies the type of potential used in the BAND calculation", &
     125              :                           usage="POT_TYPE (FULL|FE|ME)", &
     126              :                           default_i_val=pot_neb_full, &
     127              :                           enum_c_vals=s2a("FULL", &
     128              :                                           "FE", &
     129              :                                           "ME"), &
     130              :                           enum_desc=s2a("Full potential (no projections in a subspace of colvars)", &
     131              :                                         "Free energy (requires a projections in a subspace of colvars)", &
     132              :                                         "Minimum energy (requires a projections in a subspace of colvars)"), &
     133         9573 :                           enum_i_vals=[pot_neb_full, pot_neb_fe, pot_neb_me])
     134         9573 :       CALL section_add_keyword(section, keyword)
     135         9573 :       CALL keyword_release(keyword)
     136              : 
     137              :       CALL keyword_create(keyword, __LOCATION__, name="ROTATE_FRAMES", &
     138              :                           description="Compute at each BAND step the RMSD and rotate the frames in order"// &
     139              :                           " to minimize it.", &
     140         9573 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     141         9573 :       CALL section_add_keyword(section, keyword)
     142         9573 :       CALL keyword_release(keyword)
     143              : 
     144              :       CALL keyword_create(keyword, __LOCATION__, name="ALIGN_FRAMES", &
     145              :                           description="Enables the alignment of the frames at the beginning of a BAND calculation. "// &
     146              :                           "This keyword does not affect the rotation of the replicas during a BAND calculation.", &
     147         9573 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     148         9573 :       CALL section_add_keyword(section, keyword)
     149         9573 :       CALL keyword_release(keyword)
     150              : 
     151              :       CALL keyword_create(keyword, __LOCATION__, name="K_SPRING", &
     152              :                           variants=["K"], &
     153              :                           description="Specify the value of the spring constant", &
     154        19146 :                           default_r_val=0.02_dp)
     155         9573 :       CALL section_add_keyword(section, keyword)
     156         9573 :       CALL keyword_release(keyword)
     157              : 
     158              :       ! Convergence_control
     159              :       CALL section_create(subsection, __LOCATION__, name="CONVERGENCE_CONTROL", &
     160              :                           description="Setup parameters to control the convergence criteria for BAND", &
     161         9573 :                           repeats=.FALSE.)
     162              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_DR", &
     163              :                           description="Tolerance on the maximum value of the displacement on the BAND.", &
     164              :                           usage="MAX_DR {real}", &
     165         9573 :                           default_r_val=0.0002_dp)
     166         9573 :       CALL section_add_keyword(subsection, keyword)
     167         9573 :       CALL keyword_release(keyword)
     168              : 
     169              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_FORCE", &
     170              :                           description="Tolerance on the maximum value of Forces on the BAND.", &
     171              :                           usage="MAX_FORCE {real}", &
     172         9573 :                           default_r_val=0.00045_dp)
     173         9573 :       CALL section_add_keyword(subsection, keyword)
     174         9573 :       CALL keyword_release(keyword)
     175              : 
     176              :       CALL keyword_create(keyword, __LOCATION__, name="RMS_DR", &
     177              :                           description="Tolerance on RMS displacements on the BAND.", &
     178              :                           usage="RMS_DR {real}", &
     179         9573 :                           default_r_val=0.0001_dp)
     180         9573 :       CALL section_add_keyword(subsection, keyword)
     181         9573 :       CALL keyword_release(keyword)
     182              : 
     183              :       CALL keyword_create(keyword, __LOCATION__, name="RMS_FORCE", &
     184              :                           description="Tolerance on RMS Forces on the BAND.", &
     185              :                           usage="RMS_FORCE {real}", &
     186         9573 :                           default_r_val=0.00030_dp)
     187         9573 :       CALL section_add_keyword(subsection, keyword)
     188         9573 :       CALL keyword_release(keyword)
     189         9573 :       CALL section_add_subsection(section, subsection)
     190         9573 :       CALL section_release(subsection)
     191              : 
     192         9573 :       NULLIFY (subsection, subsubsection)
     193              :       ! CI-NEB section
     194              :       CALL section_create(subsection, __LOCATION__, name="CI_NEB", &
     195              :                           description="Controls parameters for CI-NEB type calculation only.", &
     196         9573 :                           repeats=.FALSE.)
     197              :       CALL keyword_create(keyword, __LOCATION__, name="NSTEPS_IT", &
     198              :                           description="Specify the number of steps of IT-NEB to perform before "// &
     199              :                           "switching on the CI algorithm", &
     200         9573 :                           default_i_val=5)
     201         9573 :       CALL section_add_keyword(subsection, keyword)
     202         9573 :       CALL keyword_release(keyword)
     203         9573 :       CALL section_add_subsection(section, subsection)
     204         9573 :       CALL section_release(subsection)
     205              : 
     206              :       ! String Method section
     207              :       CALL section_create(subsection, __LOCATION__, name="STRING_METHOD", &
     208              :                           description="Controls parameters for String Method type calculation only.", &
     209         9573 :                           repeats=.FALSE.)
     210              : 
     211              :       CALL keyword_create(keyword, __LOCATION__, name="SPLINE_ORDER", &
     212              :                           description="Specify the oder of the spline used in the String Method.", &
     213         9573 :                           default_i_val=1)
     214         9573 :       CALL section_add_keyword(subsection, keyword)
     215         9573 :       CALL keyword_release(keyword)
     216              :       CALL keyword_create(keyword, __LOCATION__, name="SMOOTHING", &
     217              :                           description="Smoothing parameter for the reparametrization of the frames.", &
     218         9573 :                           default_r_val=0.2_dp)
     219         9573 :       CALL section_add_keyword(subsection, keyword)
     220         9573 :       CALL keyword_release(keyword)
     221              : 
     222         9573 :       CALL section_add_subsection(section, subsection)
     223         9573 :       CALL section_release(subsection)
     224              : 
     225              :       ! Optimization section
     226              :       CALL section_create(subsection, __LOCATION__, name="optimize_band", &
     227              :                           description="Specify the optimization method for the band", &
     228         9573 :                           repeats=.TRUE.)
     229         9573 :       CALL create_opt_band_section(subsection)
     230         9573 :       CALL section_add_subsection(section, subsection)
     231         9573 :       CALL section_release(subsection)
     232              : 
     233              :       ! replica section: to specify coordinates and velocities (possibly) of the
     234              :       ! different replica used in the BAND
     235              :       CALL section_create(subsection, __LOCATION__, name="replica", &
     236              :                           description="Specify coordinates and velocities (possibly) of the replica", &
     237         9573 :                           repeats=.TRUE.)
     238              :       ! Colvar
     239              :       CALL keyword_create(keyword, __LOCATION__, name="COLLECTIVE", &
     240              :                           description="Specifies the value of the collective variables used in the projected"// &
     241              :                           " BAND method. The order of the values is the order of the COLLECTIVE section in the"// &
     242              :                           " constraints/restraints section", &
     243              :                           usage="COLLECTIVE {real} .. {real}", &
     244         9573 :                           type_of_var=real_t, n_var=-1)
     245         9573 :       CALL section_add_keyword(subsection, keyword)
     246         9573 :       CALL keyword_release(keyword)
     247              :       ! Coordinates read through an external file
     248              :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
     249              :                           description="Name of the xyz file with coordinates (alternative to &COORD section)", &
     250              :                           usage="COORD_FILE_NAME <CHAR>", &
     251         9573 :                           default_lc_val="")
     252         9573 :       CALL section_add_keyword(subsection, keyword)
     253         9573 :       CALL keyword_release(keyword)
     254              :       ! Coordinates and velocities
     255         9573 :       CALL create_coord_section(subsubsection, "BAND")
     256         9573 :       CALL section_add_subsection(subsection, subsubsection)
     257         9573 :       CALL section_release(subsubsection)
     258         9573 :       CALL create_velocity_section(subsubsection, "BAND")
     259         9573 :       CALL section_add_subsection(subsection, subsubsection)
     260         9573 :       CALL section_release(subsubsection)
     261              : 
     262         9573 :       CALL section_add_subsection(section, subsection)
     263         9573 :       CALL section_release(subsection)
     264              : 
     265              :       ! Print key section
     266              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
     267              :                                        description="Controls the printing basic info about the BAND run", &
     268         9573 :                                        print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     269              : 
     270              :       CALL keyword_create(keyword, __LOCATION__, name="INITIAL_CONFIGURATION_INFO", &
     271              :                           description="Print information for the setup of the initial configuration.", &
     272              :                           usage="INITIAL_CONFIGURATION_INFO <LOGICAL>", &
     273         9573 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     274         9573 :       CALL section_add_keyword(print_key, keyword)
     275         9573 :       CALL keyword_release(keyword)
     276              : 
     277         9573 :       CALL section_add_subsection(section, print_key)
     278         9573 :       CALL section_release(print_key)
     279              : 
     280              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "convergence_info", &
     281              :                                        description="Controls the printing of the convergence criteria during a BAND run", &
     282         9573 :                                        print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     283         9573 :       CALL section_add_subsection(section, print_key)
     284         9573 :       CALL section_release(print_key)
     285              : 
     286              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "replica_info", &
     287              :                                        description="Controls the printing of each replica info during a BAND run", &
     288         9573 :                                        print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     289         9573 :       CALL section_add_subsection(section, print_key)
     290         9573 :       CALL section_release(print_key)
     291              : 
     292              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY", &
     293              :                                        description="Controls the printing of the ENER file in a BAND run", &
     294              :                                        print_level=low_print_level, common_iter_levels=1, &
     295         9573 :                                        filename="")
     296         9573 :       CALL section_add_subsection(section, print_key)
     297         9573 :       CALL section_release(print_key)
     298              : 
     299              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "BANNER", &
     300              :                                        description="Controls the printing of the BAND banner", &
     301              :                                        print_level=low_print_level, common_iter_levels=1, &
     302         9573 :                                        filename="__STD_OUT__")
     303         9573 :       CALL section_add_subsection(section, print_key)
     304         9573 :       CALL section_release(print_key)
     305         9573 :    END SUBROUTINE create_band_section
     306              : 
     307              : ! **************************************************************************************************
     308              : !> \brief creates the optimization section for a BAND run
     309              : !> \param section will contain the pint section
     310              : !> \author Teodoro Laino 02.2007 [tlaino]
     311              : ! **************************************************************************************************
     312         9573 :    SUBROUTINE create_opt_band_section(section)
     313              :       TYPE(section_type), POINTER                        :: section
     314              : 
     315              :       TYPE(keyword_type), POINTER                        :: keyword
     316              :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
     317              : 
     318         9573 :       CPASSERT(ASSOCIATED(section))
     319         9573 :       NULLIFY (keyword, print_key, subsection, subsubsection)
     320              : 
     321              :       CALL keyword_create(keyword, __LOCATION__, name="OPT_TYPE", &
     322              :                           description="Specifies the type optimizer used for the band", &
     323              :                           usage="OPT_TYPE (MD|DIIS)", &
     324              :                           default_i_val=band_diis_opt, &
     325              :                           enum_c_vals=s2a("MD", &
     326              :                                           "DIIS"), &
     327              :                           enum_desc=s2a("Molecular dynamics-based optimizer", &
     328              :                                         "Coupled steepest descent / direct inversion in the iterative subspace"), &
     329         9573 :                           enum_i_vals=[band_md_opt, band_diis_opt])
     330         9573 :       CALL section_add_keyword(section, keyword)
     331         9573 :       CALL keyword_release(keyword)
     332              : 
     333              :       CALL keyword_create(keyword, __LOCATION__, name="OPTIMIZE_END_POINTS", &
     334              :                           description="Performs also an optimization of the end points of the band.", &
     335         9573 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     336         9573 :       CALL section_add_keyword(section, keyword)
     337         9573 :       CALL keyword_release(keyword)
     338              : 
     339              :       ! MD optimization section
     340              :       CALL section_create(subsection, __LOCATION__, name="MD", &
     341              :                           description="Activate the MD based optimization procedure for BAND", &
     342         9573 :                           repeats=.FALSE.)
     343              : 
     344              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_STEPS", &
     345              :                           description="Specify the maximum number of MD steps", &
     346         9573 :                           default_i_val=100)
     347         9573 :       CALL section_add_keyword(subsection, keyword)
     348         9573 :       CALL keyword_release(keyword)
     349              : 
     350              :       CALL keyword_create( &
     351              :          keyword, __LOCATION__, &
     352              :          name="timestep", &
     353              :          description="The length of an integration step", &
     354              :          usage="timestep 1.0", &
     355              :          default_r_val=cp_unit_to_cp2k(value=0.5_dp, &
     356              :                                        unit_str="fs"), &
     357         9573 :          unit_str="fs")
     358         9573 :       CALL section_add_keyword(subsection, keyword)
     359         9573 :       CALL keyword_release(keyword)
     360              : 
     361              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     362              :                           description="Specify the initial temperature", &
     363              :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, &
     364              :                                                         unit_str="K"), &
     365         9573 :                           unit_str="K")
     366         9573 :       CALL section_add_keyword(subsection, keyword)
     367         9573 :       CALL keyword_release(keyword)
     368              : 
     369              :       ! Temp_control
     370              :       CALL section_create(subsubsection, __LOCATION__, name="TEMP_CONTROL", &
     371              :                           description="Setup parameters to control the temperature during a BAND MD run.", &
     372         9573 :                           repeats=.FALSE.)
     373              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     374              :                           description="Specify the target temperature", &
     375         9573 :                           type_of_var=real_t, unit_str="K")
     376         9573 :       CALL section_add_keyword(subsubsection, keyword)
     377         9573 :       CALL keyword_release(keyword)
     378              : 
     379              :       CALL keyword_create(keyword, __LOCATION__, name="TEMP_TOL", &
     380              :                           description="Specify the tolerance on the temperature for rescaling", &
     381              :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, &
     382              :                                                         unit_str="K"), &
     383         9573 :                           unit_str="K")
     384         9573 :       CALL section_add_keyword(subsubsection, keyword)
     385         9573 :       CALL keyword_release(keyword)
     386              : 
     387              :       CALL keyword_create(keyword, __LOCATION__, name="TEMP_TOL_STEPS", &
     388              :                           description="Specify the number of steps to apply a temperature control", &
     389         9573 :                           default_i_val=0)
     390         9573 :       CALL section_add_keyword(subsubsection, keyword)
     391         9573 :       CALL keyword_release(keyword)
     392         9573 :       CALL section_add_subsection(subsection, subsubsection)
     393         9573 :       CALL section_release(subsubsection)
     394              : 
     395              :       ! Vel_control
     396              :       CALL section_create(subsubsection, __LOCATION__, name="VEL_CONTROL", &
     397              :                           description="Setup parameters to control the velocity during a BAND MD run.", &
     398         9573 :                           repeats=.FALSE.)
     399              :       CALL keyword_create(keyword, __LOCATION__, name="ANNEALING", &
     400              :                           description="Specify the annealing coefficient", &
     401         9573 :                           default_r_val=1.0_dp)
     402         9573 :       CALL section_add_keyword(subsubsection, keyword)
     403         9573 :       CALL keyword_release(keyword)
     404              :       CALL keyword_create(keyword, __LOCATION__, name="PROJ_VELOCITY_VERLET", &
     405              :                           description="Uses a Projected Velocity Verlet instead of a normal Velocity Verlet."// &
     406              :                           " Every time the cosine between velocities and forces is < 0 velocities are"// &
     407              :                           " zeroed.", &
     408              :                           usage="PROJ_VELOCITY_VERLET <LOGICAL>", &
     409         9573 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     410         9573 :       CALL section_add_keyword(subsubsection, keyword)
     411         9573 :       CALL keyword_release(keyword)
     412              :       CALL keyword_create(keyword, __LOCATION__, name="SD_LIKE", &
     413              :                           description="Zeros velocity at each MD step emulating a steepest descent like "// &
     414              :                           "(SD_LIKE) approach", &
     415              :                           usage="SD_LIKE <LOGICAL>", &
     416         9573 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     417         9573 :       CALL section_add_keyword(subsubsection, keyword)
     418         9573 :       CALL keyword_release(keyword)
     419         9573 :       CALL section_add_subsection(subsection, subsubsection)
     420         9573 :       CALL section_release(subsubsection)
     421              :       ! End of MD
     422         9573 :       CALL section_add_subsection(section, subsection)
     423         9573 :       CALL section_release(subsection)
     424              : 
     425              :       ! DIIS optimization section
     426              :       CALL section_create(subsection, __LOCATION__, name="DIIS", &
     427              :                           description="Activate the DIIS based optimization procedure for BAND", &
     428         9573 :                           repeats=.FALSE.)
     429              : 
     430              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_SD_STEPS", &
     431              :                           description="Specify the maximum number of SD steps to perform"// &
     432              :                           " before switching on DIIS (the minimum number will always be equal to N_DIIS).", &
     433         9573 :                           default_i_val=1)
     434         9573 :       CALL section_add_keyword(subsection, keyword)
     435         9573 :       CALL keyword_release(keyword)
     436              : 
     437              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_STEPS", &
     438              :                           description="Specify the maximum number of optimization steps", &
     439         9573 :                           default_i_val=100)
     440         9573 :       CALL section_add_keyword(subsection, keyword)
     441         9573 :       CALL keyword_release(keyword)
     442              : 
     443              :       CALL keyword_create(keyword, __LOCATION__, name="N_DIIS", &
     444              :                           variants=["NDIIS"], &
     445              :                           description="Number of history vectors to be used with DIIS", &
     446              :                           usage="N_DIIS 4", &
     447        19146 :                           default_i_val=7)
     448         9573 :       CALL section_add_keyword(subsection, keyword)
     449         9573 :       CALL keyword_release(keyword)
     450              : 
     451              :       CALL keyword_create(keyword, __LOCATION__, name="STEPSIZE", &
     452              :                           description="Initial stepsize used for the line search, sometimes this parameter "// &
     453              :                           "can be reduced to stabilize DIIS", &
     454              :                           usage="STEPSIZE <REAL>", &
     455         9573 :                           default_r_val=1.0_dp)
     456         9573 :       CALL section_add_keyword(subsection, keyword)
     457         9573 :       CALL keyword_release(keyword)
     458              : 
     459              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_STEPSIZE", &
     460              :                           description="Maximum stepsize used for the line search, sometimes this parameter "// &
     461              :                           "can be reduced to stabilize the LS for particularly difficult initial geometries", &
     462              :                           usage="MAX_STEPSIZE <REAL>", &
     463         9573 :                           default_r_val=2.0_dp)
     464         9573 :       CALL section_add_keyword(subsection, keyword)
     465         9573 :       CALL keyword_release(keyword)
     466              : 
     467              :       CALL keyword_create(keyword, __LOCATION__, name="NP_LS", &
     468              :                           description="Number of points used in the line search SD.", &
     469              :                           usage="NP_LS <INTEGER>", &
     470         9573 :                           default_i_val=2)
     471         9573 :       CALL section_add_keyword(subsection, keyword)
     472         9573 :       CALL keyword_release(keyword)
     473              : 
     474              :       CALL keyword_create(keyword, __LOCATION__, name="NO_LS", &
     475              :                           description="Does not perform LS during SD. Useful in combination with a proper STEPSIZE"// &
     476              :                           " for particularly out of equilibrium starting geometries.", &
     477         9573 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     478         9573 :       CALL section_add_keyword(subsection, keyword)
     479         9573 :       CALL keyword_release(keyword)
     480              : 
     481              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_DIIS", &
     482              :                           description="Performs a series of checks on the DIIS solution in order to accept the DIIS step."// &
     483              :                           " If set to .FALSE. the only check performed is that the angle between the DIIS solution and the"// &
     484              :                           " reference vector is less than Pi/2. Can be useful if many DIIS steps are rejected.", &
     485         9573 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     486         9573 :       CALL section_add_keyword(subsection, keyword)
     487         9573 :       CALL keyword_release(keyword)
     488              : 
     489              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "diis_info", &
     490              :                                        description="Controls the printing of DIIS info during a BAND run", &
     491         9573 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     492         9573 :       CALL section_add_subsection(subsection, print_key)
     493         9573 :       CALL section_release(print_key)
     494              : 
     495         9573 :       CALL section_add_subsection(section, subsection)
     496         9573 :       CALL section_release(subsection)
     497         9573 :    END SUBROUTINE create_opt_band_section
     498              : 
     499              : END MODULE input_cp2k_neb
        

Generated by: LCOV version 2.0-1