36#include "../base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'tmc_tree_types'
81 TYPE(
tree_type),
POINTER :: acc => null(), nacc => null()
83 INTEGER :: move_type = -1
86 REAL(kind=
dp),
DIMENSION(:),
POINTER :: subbox_center => null()
87 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pos => null()
88 INTEGER,
DIMENSION(:),
POINTER :: mol => null()
89 REAL(kind=
dp),
DIMENSION(:),
POINTER :: vel => null()
90 REAL(kind=
dp),
DIMENSION(:),
POINTER :: frc => null()
91 REAL(kind=
dp),
DIMENSION(:),
POINTER :: dipole => null()
92 INTEGER,
DIMENSION(:),
POINTER :: elem_stat => null()
94 REAL(kind=
dp),
DIMENSION(3, 2, 3) :: rng_seed = 0
96 INTEGER :: sub_tree_nr = -1
98 INTEGER :: temp_created = 0
100 INTEGER,
POINTER :: next_elem_nr => null()
102 REAL(kind=
dp),
DIMENSION(:),
POINTER :: box_scale => null()
103 REAL(kind=
dp) :: potential = 0.0_dp
105 REAL(kind=
dp) :: e_pot_approx = 0.0_dp
107 REAL(kind=
dp) :: ekin = 0.0_dp
109 REAL(kind=
dp) :: ekin_before_md = 0.0_dp
111 REAL(kind=
dp),
DIMENSION(4) :: scf_energies = 0.0_dp
113 INTEGER :: scf_energies_count = 0
128 INTEGER :: temp_ind = 0
135 LOGICAL :: busy = .false.
136 LOGICAL :: canceled = .false.
137 REAL(kind=
dp) :: start_time = 0.0_dp
147 INTEGER :: stat = -99
149 LOGICAL :: swaped = .false.
152 INTEGER :: mv_conf = -54321
154 INTEGER :: mv_next_conf = -2345
161 LOGICAL,
DIMENSION(:),
ALLOCATABLE :: conf_n_acc
163 REAL(kind=
dp),
DIMENSION(3, 2, 3) :: rng_seed = 0.0_dp
165 REAL(kind=
dp) :: rnd_nr = 0.0_dp
167 REAL(kind=
dp) :: prob_acc = 0.0_dp
168 REAL(kind=
dp) :: temp = 0.0_dp
184 INTEGER,
OPTIONAL :: temp_ind, nr
188 NULLIFY (list_elem_tmp, last)
190 cpassert(
ASSOCIATED(elem))
192 ALLOCATE (list_elem_tmp)
193 list_elem_tmp%elem => elem
194 list_elem_tmp%next => null()
195 IF (
PRESENT(temp_ind))
THEN
196 list_elem_tmp%temp_ind = temp_ind
198 list_elem_tmp%temp_ind = -1
201 IF (
PRESENT(nr))
THEN
202 list_elem_tmp%nr = nr
204 list_elem_tmp%nr = -1
207 IF (
ASSOCIATED(
list) .EQV. .false.)
THEN
208 list => list_elem_tmp
211 DO WHILE (
ASSOCIATED(last%next))
214 last%next => list_elem_tmp
229 NULLIFY (list_elem_tmp)
231 DO WHILE (
ASSOCIATED(
list))
232 list_elem_tmp =>
list%next
234 list => list_elem_tmp
249 cpassert(
ASSOCIATED(elem))
250 cpassert(io_unit > 0)
251 WRITE (io_unit) elem%nr, &
261 CALL write_subtree_elem_darray(elem%pos, io_unit)
262 CALL write_subtree_elem_darray(elem%vel, io_unit)
263 CALL write_subtree_elem_darray(elem%frc, io_unit)
264 CALL write_subtree_elem_darray(elem%box_scale, io_unit)
265 CALL write_subtree_elem_darray(elem%dipole, io_unit)
279 cpassert(
ASSOCIATED(elem))
280 cpassert(io_unit > 0)
282 READ (io_unit) elem%nr, &
292 CALL read_subtree_elem_darray(elem%pos, io_unit)
293 CALL read_subtree_elem_darray(elem%vel, io_unit)
294 CALL read_subtree_elem_darray(elem%frc, io_unit)
295 CALL read_subtree_elem_darray(elem%box_scale, io_unit)
296 CALL read_subtree_elem_darray(elem%dipole, io_unit)
304 SUBROUTINE write_subtree_elem_darray(array, io_unit)
305 REAL(kind=
dp),
DIMENSION(:),
POINTER :: array
308 WRITE (io_unit)
ASSOCIATED(array)
309 IF (
ASSOCIATED(array))
THEN
310 WRITE (io_unit)
SIZE(array)
311 WRITE (io_unit) array
313 END SUBROUTINE write_subtree_elem_darray
320 SUBROUTINE read_subtree_elem_darray(array, io_unit)
321 REAL(kind=
dp),
DIMENSION(:),
POINTER :: array
330 IF (
ASSOCIATED(array))
THEN
331 cpassert(
SIZE(array) == i_tmp)
333 ALLOCATE (array(i_tmp))
337 END SUBROUTINE read_subtree_elem_darray
Defines the basic variable types.
integer, parameter, public dp
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
module handles definition of the tree nodes for the global and
integer, parameter, public status_deleted
integer, parameter, public status_accepted
integer, parameter, public status_calculate_energy
integer, parameter, public status_calculate_md
subroutine, public add_to_list(elem, list, temp_ind, nr)
add a certain element to the specified element list at the beginning
subroutine, public read_subtree_elem_unformated(elem, io_unit)
reads the TMC sub tree structure element unformated in file
integer, parameter, public status_canceled_ener
integer, parameter, public status_proton_disorder
integer, parameter, public status_calculated
integer, parameter, public status_cancel_ener
integer, parameter, public status_cancel_nmc
integer, parameter, public status_canceled_nmc
subroutine, public clean_list(list)
clean a certain element element list
integer, parameter, public status_calc_approx_ener
integer, parameter, public status_ok
integer, parameter, public status_rejected
integer, parameter, public status_frozen
integer, parameter, public status_calculate_nmc_steps
subroutine, public write_subtree_elem_unformated(elem, io_unit)
prints out the TMC sub tree structure element unformated in file
integer, parameter, public status_accepted_result
integer, parameter, public status_deleted_result
integer, parameter, public status_created
integer, parameter, public status_rejected_result