22 #include "../base/base_uses.f90"
28 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'tmc_analysis_types'
30 PUBLIC :: tmc_analysis_env, tmc_ana_list_type
39 CHARACTER(LEN=default_path_length),
PARAMETER, &
41 CHARACTER(LEN=default_path_length),
PARAMETER, &
48 TYPE tmc_ana_list_type
49 TYPE(tmc_analysis_env),
POINTER :: temp => null()
50 END TYPE tmc_ana_list_type
53 INTEGER :: io_unit = -1
54 CHARACTER(len=default_string_length), &
55 DIMENSION(:),
POINTER :: dirs => null()
56 CHARACTER(LEN=default_path_length) :: out_file_prefix =
""
57 INTEGER :: conf_offset = 0
58 TYPE(cell_type),
POINTER :: cell => null()
59 TYPE(tmc_atom_type),
DIMENSION(:),
POINTER :: atoms => null()
60 INTEGER :: dim_per_elem = 3
61 INTEGER :: nr_dim = -1
62 REAL(kind=
dp) :: temperature = 0.0_dp
63 TYPE(tree_type),
POINTER :: last_elem => null()
64 INTEGER :: from_elem = -1, to_elem = -1
65 INTEGER :: id_traj = -1, id_cell = -1, id_frc = -1, id_dip = -1, id_ener = -1
66 INTEGER :: lc_traj = 0, lc_cell = 0, lc_frc = 0, lc_dip = 0, lc_ener = 0
67 CHARACTER(LEN=default_path_length) :: costum_pos_file_name =
""
68 CHARACTER(LEN=default_path_length) :: costum_dip_file_name =
""
69 CHARACTER(LEN=default_path_length) :: costum_cell_file_name =
""
70 LOGICAL :: restart = .true., restarted = .false.
71 LOGICAL :: print_test_output = .false.
73 TYPE(density_3d_type),
POINTER :: density_3d => null()
74 TYPE(pair_correl_type),
POINTER :: pair_correl => null()
75 TYPE(dipole_moment_type),
POINTER :: dip_mom => null()
76 TYPE(dipole_analysis_type),
POINTER :: dip_ana => null()
77 TYPE(displacement_type),
POINTER :: displace => null()
78 END TYPE tmc_analysis_env
81 INTEGER :: conf_counter = 0
82 INTEGER,
DIMENSION(3) :: nr_bins = 0
83 REAL(kind=
dp) :: sum_vol = 0.0_dp
84 REAL(kind=
dp) :: sum_vol2 = 0.0_dp
85 REAL(kind=
dp),
DIMENSION(3) :: sum_box_length = 0.0_dp
86 REAL(kind=
dp),
DIMENSION(3) :: sum_box_length2 = 0.0_dp
87 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: sum_density => null(), sum_dens2 => null()
88 LOGICAL :: print_dens = .true.
89 END TYPE density_3d_type
92 INTEGER :: conf_counter = 0
93 INTEGER :: nr_bins = 0
94 REAL(kind=
dp) :: step_length = -1.0_dp
95 TYPE(atom_pairs_type),
DIMENSION(:),
POINTER :: pairs => null()
96 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: g_r => null()
97 REAL(kind=
dp) :: sum_box_scale(3) = 0.0_dp
98 END TYPE pair_correl_type
101 CHARACTER(LEN=default_string_length) :: f_n =
""
102 CHARACTER(LEN=default_string_length) :: s_n =
""
103 INTEGER :: pair_count = 0
104 END TYPE atom_pairs_type
106 TYPE dipole_moment_type
107 INTEGER :: conf_counter = 0
108 TYPE(tmc_atom_type),
DIMENSION(:),
POINTER :: charges_inp => null()
109 REAL(kind=
dp),
DIMENSION(:),
POINTER :: charges => null()
110 REAL(kind=
dp),
DIMENSION(:),
POINTER :: last_dip_cl => null()
111 LOGICAL :: print_cl_dip = .true.
112 END TYPE dipole_moment_type
114 TYPE dipole_analysis_type
115 REAL(kind=
dp) :: conf_counter = 0
116 INTEGER :: ana_type = -1
117 LOGICAL :: print_diel_const_traj = .true.
119 REAL(kind=
dp) :: mu2_pv_s = 0.0_dp
121 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mu_psv => null(), mu_pv => null(), mu2_pv => null()
123 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: mu2_pv_mat => null()
125 END TYPE dipole_analysis_type
127 TYPE displacement_type
128 INTEGER :: conf_counter = 0
129 REAL(kind=
dp) :: disp = 0.0_dp
130 LOGICAL :: print_disp = .true.
131 END TYPE displacement_type
141 TYPE(tmc_analysis_env),
POINTER :: tmc_ana
143 cpassert(.NOT.
ASSOCIATED(tmc_ana))
155 TYPE(tmc_analysis_env),
POINTER :: tmc_ana
157 cpassert(
ASSOCIATED(tmc_ana))
159 IF (
ASSOCIATED(tmc_ana%dirs)) &
160 DEALLOCATE (tmc_ana%dirs)
162 IF (
ASSOCIATED(tmc_ana%density_3d)) &
163 CALL tmc_ana_dens_release(tmc_ana%density_3d)
164 IF (
ASSOCIATED(tmc_ana%pair_correl)) &
165 CALL tmc_ana_pair_correl_release(tmc_ana%pair_correl)
167 IF (
ASSOCIATED(tmc_ana%dip_mom)) &
168 CALL tmc_ana_dipole_moment_release(tmc_ana%dip_mom)
170 IF (
ASSOCIATED(tmc_ana%dip_ana)) &
171 CALL tmc_ana_dipole_analysis_release(tmc_ana%dip_ana)
173 IF (
ASSOCIATED(tmc_ana%displace)) &
174 CALL tmc_ana_displacement_release(ana_disp=tmc_ana%displace)
191 TYPE(density_3d_type),
POINTER :: ana_dens
192 INTEGER,
DIMENSION(3) :: nr_bins
194 cpassert(.NOT.
ASSOCIATED(ana_dens))
198 ana_dens%nr_bins(:) = nr_bins(:)
200 ALLOCATE (ana_dens%sum_density(nr_bins(1), nr_bins(2), nr_bins(3)))
201 ALLOCATE (ana_dens%sum_dens2(nr_bins(1), nr_bins(2), nr_bins(3)))
202 ana_dens%sum_density = 0.0_dp
203 ana_dens%sum_dens2 = 0.0_dp
211 SUBROUTINE tmc_ana_dens_release(ana_dens)
212 TYPE(density_3d_type),
POINTER :: ana_dens
214 cpassert(
ASSOCIATED(ana_dens))
216 DEALLOCATE (ana_dens%sum_density)
217 DEALLOCATE (ana_dens%sum_dens2)
218 DEALLOCATE (ana_dens)
219 END SUBROUTINE tmc_ana_dens_release
233 TYPE(pair_correl_type),
POINTER :: ana_pair_correl
236 cpassert(.NOT.
ASSOCIATED(ana_pair_correl))
237 ALLOCATE (ana_pair_correl)
239 ana_pair_correl%nr_bins = nr_bins
248 SUBROUTINE tmc_ana_pair_correl_release(ana_pair_correl)
249 TYPE(pair_correl_type),
POINTER :: ana_pair_correl
251 cpassert(
ASSOCIATED(ana_pair_correl))
253 DEALLOCATE (ana_pair_correl%g_r)
254 DEALLOCATE (ana_pair_correl%pairs)
255 DEALLOCATE (ana_pair_correl)
256 END SUBROUTINE tmc_ana_pair_correl_release
268 TYPE(atom_pairs_type),
DIMENSION(:),
POINTER :: pair_list
269 CHARACTER(LEN=default_string_length) :: n1, n2
270 INTEGER,
OPTIONAL :: list_end
273 INTEGER :: last, list_nr
275 cpassert(
ASSOCIATED(pair_list))
276 IF (
PRESENT(list_end))
THEN
277 cpassert(list_end .LE.
SIZE(pair_list))
280 last =
SIZE(pair_list)
285 list_search:
DO list_nr = 1, last
286 IF ((pair_list(list_nr)%f_n .EQ. n1 .AND. &
287 pair_list(list_nr)%s_n .EQ. n2) .OR. &
288 (pair_list(list_nr)%f_n .EQ. n2 .AND. &
289 pair_list(list_nr)%s_n .EQ. n1))
THEN
311 TYPE(dipole_moment_type),
POINTER :: ana_dip_mom
312 CHARACTER(LEN=default_string_length),
POINTER :: charge_atm(:)
313 REAL(kind=
dp),
POINTER :: charge(:)
314 INTEGER :: dim_per_elem
318 cpassert(.NOT.
ASSOCIATED(ana_dip_mom))
319 ALLOCATE (ana_dip_mom)
321 ALLOCATE (ana_dip_mom%charges_inp(
SIZE(charge)))
322 DO i = 1,
SIZE(charge)
323 ana_dip_mom%charges_inp(i)%name = charge_atm(i)
324 ana_dip_mom%charges_inp(i)%mass = charge(i)
327 ALLOCATE (ana_dip_mom%last_dip_cl(dim_per_elem))
338 SUBROUTINE tmc_ana_dipole_moment_release(ana_dip_mom)
339 TYPE(dipole_moment_type),
POINTER :: ana_dip_mom
341 cpassert(
ASSOCIATED(ana_dip_mom))
343 IF (
ASSOCIATED(ana_dip_mom%charges_inp))
DEALLOCATE (ana_dip_mom%charges_inp)
344 IF (
ASSOCIATED(ana_dip_mom%charges))
DEALLOCATE (ana_dip_mom%charges)
345 DEALLOCATE (ana_dip_mom%last_dip_cl)
346 DEALLOCATE (ana_dip_mom)
347 END SUBROUTINE tmc_ana_dipole_moment_release
356 TYPE(dipole_analysis_type),
POINTER :: ana_dip_ana
358 cpassert(.NOT.
ASSOCIATED(ana_dip_ana))
359 ALLOCATE (ana_dip_ana)
361 ALLOCATE (ana_dip_ana%mu_psv(3))
362 ana_dip_ana%mu_psv = 0.0_dp
363 ALLOCATE (ana_dip_ana%mu_pv(3))
364 ana_dip_ana%mu_pv = 0.0_dp
365 ALLOCATE (ana_dip_ana%mu2_pv(3))
366 ana_dip_ana%mu2_pv = 0.0_dp
367 ALLOCATE (ana_dip_ana%mu2_pv_mat(3, 3))
368 ana_dip_ana%mu2_pv_mat = 0.0_dp
377 SUBROUTINE tmc_ana_dipole_analysis_release(ana_dip_ana)
378 TYPE(dipole_analysis_type),
POINTER :: ana_dip_ana
380 cpassert(
ASSOCIATED(ana_dip_ana))
382 DEALLOCATE (ana_dip_ana%mu_psv)
383 DEALLOCATE (ana_dip_ana%mu_pv)
384 DEALLOCATE (ana_dip_ana%mu2_pv)
385 DEALLOCATE (ana_dip_ana%mu2_pv_mat)
387 DEALLOCATE (ana_dip_ana)
388 END SUBROUTINE tmc_ana_dipole_analysis_release
402 TYPE(displacement_type),
POINTER :: ana_disp
403 INTEGER :: dim_per_elem
405 cpassert(.NOT.
ASSOCIATED(ana_disp))
406 cpassert(dim_per_elem .GT. 0)
407 mark_used(dim_per_elem)
419 SUBROUTINE tmc_ana_displacement_release(ana_disp)
420 TYPE(displacement_type),
POINTER :: ana_disp
422 cpassert(
ASSOCIATED(ana_disp))
424 DEALLOCATE (ana_disp)
425 END SUBROUTINE tmc_ana_displacement_release
Handles all functions related to the CELL.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
module provides variables for the TMC analysis tool
integer function, public search_pair_in_list(pair_list, n1, n2, list_end)
search the pair of two atom types in list
subroutine, public tmc_ana_displacement_create(ana_disp, dim_per_elem)
creates a new structure environment for TMC analysis
subroutine, public tmc_ana_dipole_analysis_create(ana_dip_ana)
creates a new structure environment for TMC analysis
subroutine, public tmc_ana_dipole_moment_create(ana_dip_mom, charge_atm, charge, dim_per_elem)
creates a new structure environment for TMC analysis
subroutine, public tmc_ana_env_create(tmc_ana)
creates a new structure environment for TMC analysis
subroutine, public tmc_ana_env_release(tmc_ana)
releases the structure environment for TMC analysis
integer, parameter, public ana_type_default
integer, parameter, public ana_type_ice
character(len=default_path_length), parameter, public tmc_ana_pair_correl_file_name
character(len=default_path_length), parameter, public tmc_ana_density_file_name
integer, parameter, public ana_type_sym_xyz
subroutine, public tmc_ana_density_create(ana_dens, nr_bins)
creates a new structure environment for TMC analysis
subroutine, public tmc_ana_pair_correl_create(ana_pair_correl, nr_bins)
creates a new structure environment for TMC analysis
module handles definition of the tree nodes for the global and the subtrees binary tree parent elemen...
module handles definition of the tree nodes for the global and the subtrees binary tree parent elemen...