LCOV - code coverage report
Current view: top level - src - input_cp2k_harris.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 23 23 100.0 %
Date: 2024-11-21 06:45:46 Functions: 1 1 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief Harris input section
      10             : ! **************************************************************************************************
      11             : MODULE input_cp2k_harris
      12             :    USE input_constants,                 ONLY: hden_atomic,&
      13             :                                               hfun_harris,&
      14             :                                               horb_default
      15             :    USE input_keyword_types,             ONLY: keyword_create,&
      16             :                                               keyword_release,&
      17             :                                               keyword_type
      18             :    USE input_section_types,             ONLY: section_add_keyword,&
      19             :                                               section_create,&
      20             :                                               section_type
      21             :    USE string_utilities,                ONLY: s2a
      22             : #include "./base/base_uses.f90"
      23             : 
      24             :    IMPLICIT NONE
      25             :    PRIVATE
      26             : 
      27             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_harris'
      28             : 
      29             :    PUBLIC :: create_harris_section
      30             : 
      31             : CONTAINS
      32             : 
      33             : ! **************************************************************************************************
      34             : !> \brief creates the HARRIS_METHOD section
      35             : !> \param section ...
      36             : !> \author JGH
      37             : ! **************************************************************************************************
      38        8546 :    SUBROUTINE create_harris_section(section)
      39             :       TYPE(section_type), POINTER                        :: section
      40             : 
      41             :       TYPE(keyword_type), POINTER                        :: keyword
      42             : 
      43        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
      44             : 
      45        8546 :       NULLIFY (keyword)
      46             :       CALL section_create(section, __LOCATION__, name="HARRIS_METHOD", &
      47             :                           description="Sets the various options for the Harris method", &
      48        8546 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
      49             : 
      50             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
      51             :                           description="Controls the activation of the Harris method", &
      52             :                           usage="&HARRIS_METHOD T", &
      53             :                           default_l_val=.FALSE., &
      54        8546 :                           lone_keyword_l_val=.TRUE.)
      55        8546 :       CALL section_add_keyword(section, keyword)
      56        8546 :       CALL keyword_release(keyword)
      57             : 
      58             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_FUNCTIONAL", &
      59             :                           description="Functional used in energy correction", &
      60             :                           usage="ENERGY_FUNCTIONAL HARRIS", &
      61             :                           default_i_val=hfun_harris, &
      62             :                           enum_c_vals=s2a("HARRIS"), &
      63             :                           enum_desc=s2a("Harris functional"), &
      64        8546 :                           enum_i_vals=(/hfun_harris/))
      65        8546 :       CALL section_add_keyword(section, keyword)
      66        8546 :       CALL keyword_release(keyword)
      67             : 
      68             :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY_SOURCE", &
      69             :                           description="Method to create the input density", &
      70             :                           usage="DENSITY_SOURCE ATOMIC", &
      71             :                           default_i_val=hden_atomic, &
      72             :                           enum_c_vals=s2a("ATOMIC"), &
      73             :                           enum_desc=s2a("Atomic densities"), &
      74        8546 :                           enum_i_vals=(/hden_atomic/))
      75        8546 :       CALL section_add_keyword(section, keyword)
      76        8546 :       CALL keyword_release(keyword)
      77             : 
      78             :       CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_BASIS", &
      79             :                           description="Specifies the type of basis to be used for the energy functional. ", &
      80             :                           default_i_val=horb_default, &
      81             :                           enum_c_vals=s2a("ATOMIC_KIND_BASIS"), &
      82             :                           enum_desc=s2a("Atomic kind orbital basis"), &
      83        8546 :                           enum_i_vals=(/horb_default/))
      84        8546 :       CALL section_add_keyword(section, keyword)
      85        8546 :       CALL keyword_release(keyword)
      86             : 
      87             :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_FORCES", &
      88             :                           description="Additional output to debug Harris method forces.", &
      89        8546 :                           usage="DEBUG_FORCES T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      90        8546 :       CALL section_add_keyword(section, keyword)
      91        8546 :       CALL keyword_release(keyword)
      92             :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_STRESS", &
      93             :                           description="Additional output to debug Harris method stress.", &
      94        8546 :                           usage="DEBUG_STRESS T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      95        8546 :       CALL section_add_keyword(section, keyword)
      96        8546 :       CALL keyword_release(keyword)
      97             : 
      98        8546 :    END SUBROUTINE create_harris_section
      99             : 
     100             : END MODULE input_cp2k_harris

Generated by: LCOV version 1.15