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

            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              : !> \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         9300 :    SUBROUTINE create_harris_section(section)
      39              :       TYPE(section_type), POINTER                        :: section
      40              : 
      41              :       TYPE(keyword_type), POINTER                        :: keyword
      42              : 
      43         9300 :       CPASSERT(.NOT. ASSOCIATED(section))
      44              : 
      45         9300 :       NULLIFY (keyword)
      46              :       CALL section_create(section, __LOCATION__, name="HARRIS_METHOD", &
      47              :                           description="Sets the various options for the Harris method", &
      48         9300 :                           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         9300 :                           lone_keyword_l_val=.TRUE.)
      55         9300 :       CALL section_add_keyword(section, keyword)
      56         9300 :       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         9300 :                           enum_i_vals=[hfun_harris])
      65         9300 :       CALL section_add_keyword(section, keyword)
      66         9300 :       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         9300 :                           enum_i_vals=[hden_atomic])
      75         9300 :       CALL section_add_keyword(section, keyword)
      76         9300 :       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         9300 :                           enum_i_vals=[horb_default])
      84         9300 :       CALL section_add_keyword(section, keyword)
      85         9300 :       CALL keyword_release(keyword)
      86              : 
      87              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_FORCES", &
      88              :                           description="Additional output to debug Harris method forces.", &
      89         9300 :                           usage="DEBUG_FORCES T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      90         9300 :       CALL section_add_keyword(section, keyword)
      91         9300 :       CALL keyword_release(keyword)
      92              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_STRESS", &
      93              :                           description="Additional output to debug Harris method stress.", &
      94         9300 :                           usage="DEBUG_STRESS T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      95         9300 :       CALL section_add_keyword(section, keyword)
      96         9300 :       CALL keyword_release(keyword)
      97              : 
      98         9300 :    END SUBROUTINE create_harris_section
      99              : 
     100              : END MODULE input_cp2k_harris
        

Generated by: LCOV version 2.0-1