26 #include "./base/base_uses.f90"
31 PUBLIC :: csvr_system_type, &
38 INTEGER :: degrees_of_freedom = 0
39 REAL(KIND=
dp) :: nkt = 0.0_dp
40 REAL(KIND=
dp) :: thermostat_energy = 0.0_dp
41 REAL(KIND=
dp) :: region_kin_energy = 0.0_dp
42 TYPE(rng_stream_type) :: gaussian_rng_stream = rng_stream_type()
43 END TYPE csvr_thermo_type
47 INTEGER :: region = 0, glob_num_csvr = 0, loc_num_csvr = 0
48 REAL(KIND=
dp) :: tau_csvr = 0.0_dp, dt_fact = 0.0_dp
49 TYPE(csvr_thermo_type),
POINTER :: nvt(:) => null()
50 TYPE(map_info_type),
POINTER :: map_info => null()
51 END TYPE csvr_system_type
54 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'csvr_system_types'
66 TYPE(csvr_system_type),
POINTER :: csvr
67 TYPE(simpar_type),
POINTER :: simpar
68 TYPE(section_vals_type),
POINTER :: section
71 NULLIFY (csvr%map_info)
73 csvr%glob_num_csvr = 0
80 csvr%tau_csvr = csvr%tau_csvr/(0.5_dp*simpar%dt)
91 TYPE(csvr_system_type),
POINTER :: csvr
93 CHARACTER(LEN=40) :: name
94 INTEGER :: i, ithermo, my_index
95 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: seed
96 REAL(kind=
dp),
DIMENSION(3, 2) :: initial_seed, my_seed
98 cpassert(
ASSOCIATED(csvr))
99 cpassert(.NOT.
ASSOCIATED(csvr%nvt))
101 ALLOCATE (csvr%nvt(csvr%loc_num_csvr))
102 DO i = 1, csvr%loc_num_csvr
103 csvr%nvt(i)%thermostat_energy = 0.0_dp
106 ALLOCATE (seed(3, 2, csvr%glob_num_csvr))
109 seed(:, :, 1) = initial_seed
110 DO ithermo = 2, csvr%glob_num_csvr
115 DO ithermo = 1, csvr%loc_num_csvr
116 my_index = csvr%map_info%index(ithermo)
117 my_seed = seed(:, :, my_index)
118 WRITE (unit=name, fmt=
"(A,I8)")
"Wiener process for Thermostat #", my_index
120 csvr%nvt(ithermo)%gaussian_rng_stream = rng_stream_type( &
121 name=name, distribution_type=
gaussian, extended_precision=.true., seed=my_seed)
133 TYPE(csvr_system_type),
POINTER :: csvr
135 IF (
ASSOCIATED(csvr))
THEN
136 CALL csvr_thermo_dealloc(csvr%nvt)
148 SUBROUTINE csvr_thermo_dealloc(nvt)
149 TYPE(csvr_thermo_type),
DIMENSION(:),
POINTER :: nvt
151 IF (
ASSOCIATED(nvt)) &
153 END SUBROUTINE csvr_thermo_dealloc
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public bussi2007
Type for the canonical sampling through velocity rescaling.
subroutine, public csvr_thermo_create(csvr)
Initialize NVT type for CSVR thermostat.
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 release_map_info_type(map_info)
release the map_info type
subroutine, public create_map_info_type(map_info)
create the map_info type
Defines the basic variable types.
integer, parameter, public dp
Parallel (pseudo)random number generator (RNG) for multiple streams and substreams of random numbers.
real(kind=dp) function, dimension(3, 2), public next_rng_seed(seed)
Get the seed for the next RNG stream w.r.t. a given seed.
integer, parameter, public gaussian
Type for storing MD parameters.
Utilities for string manipulations.
subroutine, public compress(string, full)
Eliminate multiple space characters in a string. If full is .TRUE., then all spaces are eliminated.