(git:495eafe)
Loading...
Searching...
No Matches
thermal_region_types.F
Go to the documentation of this file.
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! **************************************************************************************************
16
18 USE kinds, ONLY: default_path_length,&
20 dp
21#include "../base/base_uses.f90"
22
23 IMPLICIT NONE
24
25 PRIVATE
26 PUBLIC :: thermal_regions_type, &
30
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()
39
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'
50CONTAINS
51
52! **************************************************************************************************
53!> \brief allocate thermal_regions
54!> \param thermal_regions ...
55!> \author
56! **************************************************************************************************
57 SUBROUTINE allocate_thermal_regions(thermal_regions)
58 TYPE(thermal_regions_type), INTENT(OUT) :: thermal_regions
59
60 mark_used(thermal_regions)
61 END SUBROUTINE allocate_thermal_regions
62
63! **************************************************************************************************
64!> \brief release thermal_regions
65!> \param thermal_regions ...
66!> \author
67! **************************************************************************************************
68 SUBROUTINE release_thermal_regions(thermal_regions)
69
70 TYPE(thermal_regions_type), INTENT(INOUT) :: thermal_regions
71
72 INTEGER :: ireg
73
74 IF (ASSOCIATED(thermal_regions%thermal_region)) THEN
75 DO ireg = 1, SIZE(thermal_regions%thermal_region)
76 IF (ASSOCIATED(thermal_regions%thermal_region(ireg)%part_index)) THEN
77 DEALLOCATE (thermal_regions%thermal_region(ireg)%part_index)
78 END IF
79 END DO
80 DEALLOCATE (thermal_regions%thermal_region)
81 END IF
82 IF (ASSOCIATED(thermal_regions%do_langevin)) THEN
83 DEALLOCATE (thermal_regions%do_langevin)
84 END IF
85
86 END SUBROUTINE release_thermal_regions
87
88END MODULE thermal_region_types
objects that represent the structure of input sections and the data contained in an input section
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public default_path_length
Definition kinds.F:58
Thermal regions type: to initialize and control the temperature of different regions.
subroutine, public release_thermal_regions(thermal_regions)
release thermal_regions
subroutine, public allocate_thermal_regions(thermal_regions)
allocate thermal_regions