47 CHARACTER(len=*),
PARAMETER :: routinen =
'topology_muc'
49 CHARACTER(LEN=default_string_length) :: unit_str
50 INTEGER :: handle, i, ind, j, k, m, n, natoms, nrep
51 INTEGER,
DIMENSION(:),
POINTER :: iwork, multiple_unit_cell
52 LOGICAL :: check, explicit, scale
53 REAL(kind=
dp),
DIMENSION(3) :: trsl, trsl_i, trsl_j, trsl_k
57 CALL timeset(routinen, handle)
59 NULLIFY (multiple_unit_cell, iwork, cell)
65 i_vals=multiple_unit_cell)
68 IF (any(multiple_unit_cell <= 0))
THEN
69 CALL cp_abort(__location__,
"SUBSYS%TOPOLOGY%MULTIPLE_UNIT_CELL accepts "// &
70 "only integer values greater than zero.")
73 IF (any(multiple_unit_cell /= 1))
THEN
78 IF (any(iwork /= multiple_unit_cell))
THEN
79 CALL cp_abort(__location__,
"The input parameters for "// &
80 "SUBSYS%TOPOLOGY%MULTIPLE_UNIT_CELL and "// &
81 "SUBSYS%CELL%MULTIPLE_UNIT_CELL have to agree.")
85 natoms =
topology%natoms*product(multiple_unit_cell)
92 check = nrep == natoms
94 CALL cp_abort(__location__,
"The number of available entries in the "// &
95 "VELOCITY section is not compatible with the number of atoms.")
111 DO k = 1, multiple_unit_cell(3)
112 trsl_k = cell%hmat(:, 3)*real(k - 1, kind=
dp)
113 DO j = 1, multiple_unit_cell(2)
114 trsl_j = cell%hmat(:, 2)*real(j - 1, kind=
dp)
115 DO i = 1, multiple_unit_cell(1)
116 trsl_i = cell%hmat(:, 1)*real(i - 1, kind=
dp)
117 trsl = trsl_i + trsl_j + trsl_k
154 CALL timestop(handle)