LCOV - code coverage report
Current view: top level - src/motion - thermal_region_types.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:3db43b4) Lines: 90.9 % 11 10
Test Date: 2026-04-03 06:55:30 Functions: 50.0 % 4 2

            Line data    Source code
       1              : !--------------------------------------------------------------------------------------------------!
       2              : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3              : !   Copyright 2000-2026 CP2K developers group <https://cp2k.org>                                   !
       4              : !                                                                                                  !
       5              : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6              : !--------------------------------------------------------------------------------------------------!
       7              : 
       8              : ! **************************************************************************************************
       9              : !> \brief Thermal regions type: to initialize and control the temperature of
      10              : !>        different regions
      11              : !> \par History
      12              : !>   - Added support for langevin regions (2014/01/08, LT)
      13              : !> \author MI
      14              : ! **************************************************************************************************
      15              : MODULE thermal_region_types
      16              : 
      17              :    USE input_section_types,             ONLY: section_vals_type
      18              :    USE kinds,                           ONLY: default_path_length,&
      19              :                                               default_string_length,&
      20              :                                               dp
      21              : #include "../base/base_uses.f90"
      22              : 
      23              :    IMPLICIT NONE
      24              : 
      25              :    PRIVATE
      26              :    PUBLIC :: thermal_regions_type, &
      27              :              thermal_region_type, &
      28              :              allocate_thermal_regions, &
      29              :              release_thermal_regions
      30              : 
      31              :    TYPE thermal_regions_type
      32              :       INTEGER :: nregions = 0
      33              :       LOGICAL :: force_rescaling = .FALSE.
      34              :       REAL(KIND=dp) :: temp_reg0 = 0.0_dp
      35              :       LOGICAL, DIMENSION(:), POINTER                   :: do_langevin => NULL()
      36              :       TYPE(section_vals_type), POINTER                 :: section => NULL()
      37              :       TYPE(thermal_region_type), DIMENSION(:), POINTER :: thermal_region => NULL()
      38              :    END TYPE thermal_regions_type
      39              : 
      40              :    TYPE thermal_region_type
      41              :       CHARACTER(len=default_path_length) :: temperature_function = ""
      42              :       CHARACTER(len=default_string_length), POINTER, DIMENSION(:) :: temperature_function_parameters => NULL()
      43              :       INTEGER :: region_index = 0, npart = 0
      44              :       INTEGER, DIMENSION(:), POINTER :: part_index => NULL()
      45              :       REAL(KIND=dp) :: ekin = 0.0_dp, noisy_gamma_region = 0.0_dp, temperature = 0.0_dp, temp_expected = 0.0_dp, temp_tol = 0.0_dp
      46              :       REAL(KIND=dp), DIMENSION(:), POINTER :: temperature_function_values => NULL()
      47              :    END TYPE thermal_region_type
      48              : 
      49              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'thermal_region_types'
      50              : CONTAINS
      51              : 
      52              : ! **************************************************************************************************
      53              : !> \brief allocate thermal_regions
      54              : !> \param thermal_regions ...
      55              : !> \author
      56              : ! **************************************************************************************************
      57         1788 :    SUBROUTINE allocate_thermal_regions(thermal_regions)
      58              :       TYPE(thermal_regions_type), INTENT(OUT)            :: thermal_regions
      59              : 
      60              :       MARK_USED(thermal_regions)
      61         1788 :    END SUBROUTINE allocate_thermal_regions
      62              : 
      63              : ! **************************************************************************************************
      64              : !> \brief release thermal_regions
      65              : !> \param thermal_regions ...
      66              : !> \author
      67              : ! **************************************************************************************************
      68         1788 :    SUBROUTINE release_thermal_regions(thermal_regions)
      69              : 
      70              :       TYPE(thermal_regions_type), INTENT(INOUT)          :: thermal_regions
      71              : 
      72              :       INTEGER                                            :: ireg
      73              : 
      74         1788 :       IF (ASSOCIATED(thermal_regions%thermal_region)) THEN
      75           34 :          DO ireg = 1, SIZE(thermal_regions%thermal_region)
      76           34 :             DEALLOCATE (thermal_regions%thermal_region(ireg)%part_index)
      77              :          END DO
      78           14 :          DEALLOCATE (thermal_regions%thermal_region)
      79              :       END IF
      80         1788 :       IF (ASSOCIATED(thermal_regions%do_langevin)) THEN
      81           12 :          DEALLOCATE (thermal_regions%do_langevin)
      82              :       END IF
      83              : 
      84         1788 :    END SUBROUTINE release_thermal_regions
      85              : 
      86            0 : END MODULE thermal_region_types
        

Generated by: LCOV version 2.0-1