38 #include "../../base/base_uses.f90"
43 PUBLIC :: thermostats_type, &
49 thermostat_info_type, &
62 TYPE(thermostat_info_type),
POINTER :: thermostat_info_part => null()
63 TYPE(thermostat_info_type),
POINTER :: thermostat_info_shell => null()
65 TYPE(thermostat_info_type),
POINTER :: thermostat_info_fast => null()
66 TYPE(thermostat_type),
POINTER :: thermostat_fast => null()
67 TYPE(thermostat_info_type),
POINTER :: thermostat_info_slow => null()
68 TYPE(thermostat_type),
POINTER :: thermostat_slow => null()
70 TYPE(thermostat_type),
POINTER :: thermostat_part => null()
71 TYPE(thermostat_type),
POINTER :: thermostat_coef => null()
72 TYPE(thermostat_type),
POINTER :: thermostat_shell => null()
73 TYPE(thermostat_type),
POINTER :: thermostat_baro => null()
74 END TYPE thermostats_type
80 CHARACTER(LEN=default_string_length) :: label =
""
81 TYPE(lnhc_parameters_type),
POINTER :: nhc => null()
82 TYPE(csvr_system_type),
POINTER :: csvr => null()
83 TYPE(al_system_type),
POINTER :: al => null()
84 TYPE(gle_type),
POINTER :: gle => null()
85 TYPE(section_vals_type),
POINTER :: section => null()
86 END TYPE thermostat_type
90 TYPE thermostat_info_type
91 INTEGER :: sum_of_thermostats = 0
92 INTEGER :: number_of_thermostats = 0
94 INTEGER,
POINTER,
DIMENSION(:) :: map_loc_thermo_gen => null()
95 END TYPE thermostat_info_type
97 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'thermostat_types'
109 TYPE(thermostats_type),
INTENT(OUT) :: thermostats
112 ALLOCATE (thermostats%thermostat_info_part)
113 ALLOCATE (thermostats%thermostat_info_shell)
115 ALLOCATE (thermostats%thermostat_info_fast)
116 ALLOCATE (thermostats%thermostat_info_slow)
129 TYPE(thermostats_type),
INTENT(INOUT) :: thermostats
131 IF (
ASSOCIATED(thermostats%thermostat_info_part))
THEN
133 DEALLOCATE (thermostats%thermostat_info_part)
135 IF (
ASSOCIATED(thermostats%thermostat_info_shell))
THEN
137 DEALLOCATE (thermostats%thermostat_info_shell)
139 IF (
ASSOCIATED(thermostats%thermostat_info_fast))
THEN
141 DEALLOCATE (thermostats%thermostat_info_fast)
143 IF (
ASSOCIATED(thermostats%thermostat_info_slow))
THEN
145 DEALLOCATE (thermostats%thermostat_info_slow)
147 IF (
ASSOCIATED(thermostats%thermostat_fast))
THEN
149 DEALLOCATE (thermostats%thermostat_fast)
151 IF (
ASSOCIATED(thermostats%thermostat_slow))
THEN
153 DEALLOCATE (thermostats%thermostat_slow)
155 IF (
ASSOCIATED(thermostats%thermostat_part))
THEN
157 DEALLOCATE (thermostats%thermostat_part)
159 IF (
ASSOCIATED(thermostats%thermostat_shell))
THEN
161 DEALLOCATE (thermostats%thermostat_shell)
163 IF (
ASSOCIATED(thermostats%thermostat_baro))
THEN
165 DEALLOCATE (thermostats%thermostat_baro)
167 IF (
ASSOCIATED(thermostats%thermostat_coef))
THEN
169 DEALLOCATE (thermostats%thermostat_coef)
186 TYPE(thermostat_type),
INTENT(OUT) :: thermostat
187 TYPE(simpar_type),
POINTER :: simpar
188 TYPE(section_vals_type),
POINTER :: section
189 LOGICAL,
INTENT(IN),
OPTIONAL :: skip_region
190 CHARACTER(LEN=*),
INTENT(IN) :: label
193 LOGICAL :: skip_region_loc
194 TYPE(section_vals_type),
POINTER :: al_section, csvr_section, gle_section, &
197 skip_region_loc = .false.
198 IF (
PRESENT(skip_region)) skip_region_loc = skip_region
199 thermostat%section => section
200 thermostat%label = label
207 ALLOCATE (thermostat%nhc)
208 CALL lnhc_init(thermostat%nhc, nose_section)
209 thermostat%nhc%region = region
212 ALLOCATE (thermostat%csvr)
213 CALL csvr_init(thermostat%csvr, simpar, csvr_section)
214 thermostat%csvr%region = region
215 ELSE IF (thermostat%type_of_thermostat ==
do_thermo_al)
THEN
217 ALLOCATE (thermostat%al)
218 CALL al_init(thermostat%al, simpar, al_section)
219 thermostat%al%region = region
220 ELSE IF (thermostat%type_of_thermostat ==
do_thermo_gle)
THEN
222 ALLOCATE (thermostat%gle)
223 CALL gle_init(thermostat%gle, dt=simpar%dt, temp=simpar%temp_ext, &
225 thermostat%gle%region = region
239 TYPE(thermostat_info_type),
INTENT(INOUT) :: thermostat_info
241 IF (
ASSOCIATED(thermostat_info%map_loc_thermo_gen))
THEN
242 DEALLOCATE (thermostat_info%map_loc_thermo_gen)
255 TYPE(thermostat_type),
INTENT(INOUT) :: thermostat
257 NULLIFY (thermostat%section)
258 IF (
ASSOCIATED(thermostat%nhc))
THEN
261 IF (
ASSOCIATED(thermostat%csvr))
THEN
264 IF (
ASSOCIATED(thermostat%al))
THEN
267 IF (
ASSOCIATED(thermostat%gle))
THEN
282 TYPE(thermostats_type),
POINTER :: thermostats
283 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: dt_fact
285 IF (
ASSOCIATED(thermostats))
THEN
286 IF (
PRESENT(dt_fact))
THEN
289 IF (
ASSOCIATED(thermostats%thermostat_fast))
THEN
290 SELECT CASE (thermostats%thermostat_fast%type_of_thermostat)
292 thermostats%thermostat_fast%nhc%dt_fact = dt_fact
295 IF (
ASSOCIATED(thermostats%thermostat_slow))
THEN
296 SELECT CASE (thermostats%thermostat_slow%type_of_thermostat)
298 thermostats%thermostat_slow%nhc%dt_fact = dt_fact
302 IF (
ASSOCIATED(thermostats%thermostat_part))
THEN
303 SELECT CASE (thermostats%thermostat_part%type_of_thermostat)
305 thermostats%thermostat_part%nhc%dt_fact = dt_fact
307 thermostats%thermostat_part%csvr%dt_fact = dt_fact
309 thermostats%thermostat_part%al%dt_fact = dt_fact
311 thermostats%thermostat_part%gle%dt_fact = dt_fact
315 IF (
ASSOCIATED(thermostats%thermostat_coef))
THEN
316 SELECT CASE (thermostats%thermostat_coef%type_of_thermostat)
318 thermostats%thermostat_coef%nhc%dt_fact = dt_fact
320 thermostats%thermostat_coef%csvr%dt_fact = dt_fact
324 IF (
ASSOCIATED(thermostats%thermostat_shell))
THEN
325 SELECT CASE (thermostats%thermostat_shell%type_of_thermostat)
327 thermostats%thermostat_shell%nhc%dt_fact = dt_fact
329 thermostats%thermostat_shell%csvr%dt_fact = dt_fact
333 IF (
ASSOCIATED(thermostats%thermostat_baro))
THEN
334 SELECT CASE (thermostats%thermostat_baro%type_of_thermostat)
336 thermostats%thermostat_baro%nhc%dt_fact = dt_fact
338 thermostats%thermostat_baro%csvr%dt_fact = dt_fact
Type for the canonical sampling through velocity rescaling.
subroutine, public al_dealloc(al)
Deallocate type for AD_LANGEVIN thermostat.
subroutine, public al_init(al, simpar, section)
Initialize type for Adaptive Langevin (AD_LANGEVIN)
Type for the canonical sampling through velocity rescaling.
subroutine, public csvr_dealloc(csvr)
Deallocate type for CSVR thermostat.
subroutine, public csvr_init(csvr, simpar, section)
Initialize type for Canonical Sampling through Velocity Rescaling (CSVR)
Lumps all possible extended system variables into one type for easy access and passing.
subroutine, public lnhc_dealloc(lnhc)
Deallocate type for Nose-Hoover thermostat.
subroutine, public lnhc_init(lnhc, section)
Initialize type for Nose-Hoover thermostat.
subroutine, public gle_dealloc(gle)
Deallocate type for GLE thermostat.
subroutine, public gle_init(gle, dt, temp, section)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Type for storing MD parameters.
Thermostat structure: module containing thermostat available for MD.
subroutine, public allocate_thermostats(thermostats)
...
subroutine, public release_thermostat_info(thermostat_info)
...
subroutine, public release_thermostat_type(thermostat)
...
subroutine, public create_thermostat_type(thermostat, simpar, section, skip_region, label)
Create a thermostat type.
subroutine, public set_thermostats(thermostats, dt_fact)
access internal structures of thermostats
subroutine, public release_thermostats(thermostats)
...