(git:30099c3)
Loading...
Searching...
No Matches
particle_methods.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Define methods related to particle_type
10!> \par History
11!> 10.2014 Move routines out of particle_types.F [Ole Schuett]
12!> \author Ole Schuett
13! **************************************************************************************************
18 USE cell_methods, ONLY: cell_create,&
20 USE cell_types, ONLY: cell_clone,&
22 cell_type,&
23 get_cell,&
24 pbc,&
34 USE input_constants, ONLY: dump_atomic,&
35 dump_dcd,&
38 dump_pdb,&
43 USE kinds, ONLY: default_string_length,&
44 dp,&
45 sp
46 USE mathconstants, ONLY: degree
47 USE mathlib, ONLY: angle,&
52 USE physcon, ONLY: massunit
54 USE qs_kind_types, ONLY: get_qs_kind,&
59 USE util, ONLY: sort,&
61#include "./base/base_uses.f90"
62
63 IMPLICIT NONE
64
65 PRIVATE
66
67 ! Public subroutines
68
76
77 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'particle_methods'
78
79CONTAINS
80
81! **************************************************************************************************
82!> \brief Get the components of a particle set.
83!> \param particle_set ...
84!> \param qs_kind_set ...
85!> \param first_sgf ...
86!> \param last_sgf ...
87!> \param nsgf ...
88!> \param nmao ...
89!> \param basis ...
90!> \date 14.01.2002
91!> \par History
92!> - particle type cleaned (13.10.2003,MK)
93!> - refactoring and add basis set option (17.08.2010,jhu)
94!> \author MK
95!> \version 1.0
96! **************************************************************************************************
97 SUBROUTINE get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, &
98 nmao, basis)
99
100 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
101 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
102 INTEGER, DIMENSION(:), INTENT(INOUT), OPTIONAL :: first_sgf, last_sgf, nsgf, nmao
103 TYPE(gto_basis_set_p_type), DIMENSION(:), OPTIONAL :: basis
104
105 INTEGER :: ikind, iparticle, isgf, nparticle, ns
106
107 cpassert(ASSOCIATED(particle_set))
108
109 nparticle = SIZE(particle_set)
110 IF (PRESENT(first_sgf)) THEN
111 cpassert(SIZE(first_sgf) >= nparticle)
112 END IF
113 IF (PRESENT(last_sgf)) THEN
114 cpassert(SIZE(last_sgf) >= nparticle)
115 END IF
116 IF (PRESENT(nsgf)) THEN
117 cpassert(SIZE(nsgf) >= nparticle)
118 END IF
119 IF (PRESENT(nmao)) THEN
120 cpassert(SIZE(nmao) >= nparticle)
121 END IF
122
123 IF (PRESENT(first_sgf) .OR. PRESENT(last_sgf) .OR. PRESENT(nsgf)) THEN
124 isgf = 0
125 DO iparticle = 1, nparticle
126 CALL get_atomic_kind(particle_set(iparticle)%atomic_kind, kind_number=ikind)
127 IF (PRESENT(basis)) THEN
128 IF (ASSOCIATED(basis(ikind)%gto_basis_set)) THEN
129 CALL get_gto_basis_set(gto_basis_set=basis(ikind)%gto_basis_set, nsgf=ns)
130 ELSE
131 ns = 0
132 END IF
133 ELSE
134 CALL get_qs_kind(qs_kind_set(ikind), nsgf=ns)
135 END IF
136 IF (PRESENT(nsgf)) nsgf(iparticle) = ns
137 IF (PRESENT(first_sgf)) first_sgf(iparticle) = isgf + 1
138 isgf = isgf + ns
139 IF (PRESENT(last_sgf)) last_sgf(iparticle) = isgf
140 END DO
141 END IF
142
143 IF (PRESENT(first_sgf)) THEN
144 IF (SIZE(first_sgf) > nparticle) first_sgf(nparticle + 1) = isgf + 1
145 END IF
146
147 IF (PRESENT(nmao)) THEN
148 DO iparticle = 1, nparticle
149 CALL get_atomic_kind(particle_set(iparticle)%atomic_kind, kind_number=ikind)
150 CALL get_qs_kind(qs_kind_set(ikind), mao=ns)
151 nmao(iparticle) = ns
152 END DO
153 END IF
154
155 END SUBROUTINE get_particle_set
156
157! **************************************************************************************************
158!> \brief Should be able to write a few formats e.g. xmol, and some binary
159!> format (dcd) some format can be used for x,v,f
160!>
161!> FORMAT CONTENT UNITS x, v, f
162!> XMOL POS, VEL, FORCE, POS_VEL, POS_VEL_FORCE Angstrom, a.u., a.u.
163!>
164!> \param particle_set ...
165!> \param iunit ...
166!> \param output_format ...
167!> \param content ...
168!> \param title ...
169!> \param cell ...
170!> \param array ...
171!> \param unit_conv ...
172!> \param charge_occup ...
173!> \param charge_beta ...
174!> \param charge_extended ...
175!> \param print_kind ...
176!> \date 14.01.2002
177!> \author MK
178!> \version 1.0
179! **************************************************************************************************
180 SUBROUTINE write_particle_coordinates(particle_set, iunit, output_format, &
181 content, title, cell, array, unit_conv, &
182 charge_occup, charge_beta, &
183 charge_extended, print_kind)
184
185 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
186 INTEGER :: iunit, output_format
187 CHARACTER(LEN=*) :: content, title
188 TYPE(cell_type), OPTIONAL, POINTER :: cell
189 REAL(kind=dp), DIMENSION(:), INTENT(IN), OPTIONAL :: array
190 REAL(kind=dp), INTENT(IN), OPTIONAL :: unit_conv
191 LOGICAL, INTENT(IN), OPTIONAL :: charge_occup, charge_beta, &
192 charge_extended, print_kind
193
194 CHARACTER(len=*), PARAMETER :: routinen = 'write_particle_coordinates'
195
196 CHARACTER(LEN=120) :: line
197 CHARACTER(LEN=2) :: element_symbol
198 CHARACTER(LEN=4) :: name
199 CHARACTER(LEN=default_string_length) :: atm_name, my_format
200 INTEGER :: handle, iatom, natom
201 LOGICAL :: dummy, my_charge_beta, &
202 my_charge_extended, my_charge_occup, &
203 my_print_kind
204 REAL(kind=dp) :: angle_alpha, angle_beta, angle_gamma, &
205 factor, qeff
206 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: arr
207 REAL(kind=dp), DIMENSION(3) :: abc, angles, f, r, v
208 REAL(kind=dp), DIMENSION(3, 3) :: h
209 REAL(kind=sp), ALLOCATABLE, DIMENSION(:) :: x4, y4, z4
210 TYPE(cell_type), POINTER :: cell_dcd
211 TYPE(fist_potential_type), POINTER :: fist_potential
212 TYPE(shell_kind_type), POINTER :: shell
213
214 CALL timeset(routinen, handle)
215
216 natom = SIZE(particle_set)
217 IF (PRESENT(array)) THEN
218 SELECT CASE (trim(content))
219 CASE ("POS_VEL", "POS_VEL_FORCE")
220 cpabort("Illegal usage")
221 END SELECT
222 END IF
223 factor = 1.0_dp
224 IF (PRESENT(unit_conv)) THEN
225 factor = unit_conv
226 END IF
227 SELECT CASE (output_format)
228 CASE (dump_xmol, dump_extxyz)
229 my_print_kind = .false.
230 IF (PRESENT(print_kind)) my_print_kind = print_kind
231 WRITE (iunit, "(I8)") natom
232 WRITE (iunit, "(A)") trim(title)
233 DO iatom = 1, natom
234 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
235 element_symbol=element_symbol)
236 IF (len_trim(element_symbol) == 0 .OR. my_print_kind) THEN
237 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
238 name=atm_name)
239 dummy = qmmm_ff_precond_only_qm(id1=atm_name)
240 my_format = "(A,"
241 atm_name = trim(atm_name)
242 ELSE
243 my_format = "(T2,A2,"
244 atm_name = trim(element_symbol)
245 END IF
246 SELECT CASE (trim(content))
247 CASE ("POS")
248 IF (PRESENT(array)) THEN
249 r(1:3) = get_particle_pos_or_vel(iatom, particle_set, array)
250 ELSE
251 r(:) = particle_set(iatom)%r(:)
252 END IF
253 WRITE (iunit, trim(my_format)//"1X,3F20.10)") trim(atm_name), r(1:3)*factor
254 CASE ("VEL")
255 IF (PRESENT(array)) THEN
256 v(1:3) = get_particle_pos_or_vel(iatom, particle_set, array)
257 ELSE
258 v(:) = particle_set(iatom)%v(:)
259 END IF
260 WRITE (iunit, trim(my_format)//"1X,3F20.10)") trim(atm_name), v(1:3)*factor
261 CASE ("FORCE")
262 IF (PRESENT(array)) THEN
263 f(:) = array((iatom - 1)*3 + 1:(iatom - 1)*3 + 3)
264 ELSE
265 f(:) = particle_set(iatom)%f(:)
266 END IF
267 WRITE (iunit, trim(my_format)//"1X,3F20.10)") trim(atm_name), f(1:3)*factor
268 CASE ("FORCE_MIXING_LABELS")
269 IF (PRESENT(array)) THEN
270 f(:) = array((iatom - 1)*3 + 1:(iatom - 1)*3 + 3)
271 ELSE
272 f(:) = particle_set(iatom)%f(:)
273 END IF
274 WRITE (iunit, trim(my_format)//"1X,3F20.10)") trim(atm_name), f(1:3)*factor
275 END SELECT
276 END DO
277 CASE (dump_atomic)
278 DO iatom = 1, natom
279 SELECT CASE (trim(content))
280 CASE ("POS")
281 IF (PRESENT(array)) THEN
282 r(1:3) = get_particle_pos_or_vel(iatom, particle_set, array)
283 ELSE
284 r(:) = particle_set(iatom)%r(:)
285 END IF
286 WRITE (iunit, "(3F20.10)") r(1:3)*factor
287 CASE ("VEL")
288 IF (PRESENT(array)) THEN
289 v(1:3) = get_particle_pos_or_vel(iatom, particle_set, array)
290 ELSE
291 v(:) = particle_set(iatom)%v(:)
292 END IF
293 WRITE (iunit, "(3F20.10)") v(1:3)*factor
294 CASE ("FORCE")
295 IF (PRESENT(array)) THEN
296 f(:) = array((iatom - 1)*3 + 1:(iatom - 1)*3 + 3)
297 ELSE
298 f(:) = particle_set(iatom)%f(:)
299 END IF
300 WRITE (iunit, "(3F20.10)") f(1:3)*factor
301 CASE ("FORCE_MIXING_LABELS")
302 IF (PRESENT(array)) THEN
303 f(:) = array((iatom - 1)*3 + 1:(iatom - 1)*3 + 3)
304 ELSE
305 f(:) = particle_set(iatom)%f(:)
306 END IF
307 WRITE (iunit, "(3F20.10)") f(1:3)*factor
308 END SELECT
309 END DO
311 IF (.NOT. (PRESENT(cell))) THEN
312 cpabort("Cell is not present! Report this bug!")
313 END IF
314 CALL get_cell(cell, alpha=angle_alpha, beta=angle_beta, gamma=angle_gamma, &
315 abc=abc)
316 IF (.NOT. cell%orthorhombic .AND. (output_format == dump_dcd_aligned_cell)) THEN
317 ! In the case of a non-orthorhombic cell adopt a common convention
318 ! for the orientation of the cell with respect to the Cartesian axes:
319 ! Cell vector a is aligned with the x axis and the cell vector b lies
320 ! in the xy plane.
321 NULLIFY (cell_dcd)
322 CALL cell_create(cell_dcd)
323 CALL cell_clone(cell, cell_dcd, tag="CELL_DCD")
324 angles(1) = angle_alpha/degree
325 angles(2) = angle_beta/degree
326 angles(3) = angle_gamma/degree
327 CALL set_cell_param(cell_dcd, abc, angles, &
328 do_init_cell=.true.)
329 h(1:3, 1:3) = matmul(cell_dcd%hmat(1:3, 1:3), cell%h_inv(1:3, 1:3))
330 CALL cell_release(cell_dcd)
331 END IF
332 ALLOCATE (arr(3, natom))
333 IF (PRESENT(array)) THEN
334 arr(1:3, 1:natom) = reshape(array, [3, natom])
335 ELSE
336 SELECT CASE (trim(content))
337 CASE ("POS")
338 DO iatom = 1, natom
339 arr(1:3, iatom) = particle_set(iatom)%r(1:3)
340 END DO
341 CASE ("VEL")
342 DO iatom = 1, natom
343 arr(1:3, iatom) = particle_set(iatom)%v(1:3)
344 END DO
345 CASE ("FORCE")
346 DO iatom = 1, natom
347 arr(1:3, iatom) = particle_set(iatom)%f(1:3)
348 END DO
349 CASE DEFAULT
350 cpabort("Illegal DCD dump type")
351 END SELECT
352 END IF
353 ALLOCATE (x4(natom))
354 ALLOCATE (y4(natom))
355 ALLOCATE (z4(natom))
356 IF (.NOT. cell%orthorhombic .AND. (output_format == dump_dcd_aligned_cell)) THEN
357 x4(1:natom) = real(matmul(h(1, 1:3), arr(1:3, 1:natom)), kind=sp)
358 y4(1:natom) = real(matmul(h(2, 1:3), arr(1:3, 1:natom)), kind=sp)
359 z4(1:natom) = real(matmul(h(3, 1:3), arr(1:3, 1:natom)), kind=sp)
360 ELSE
361 x4(1:natom) = real(arr(1, 1:natom), kind=sp)
362 y4(1:natom) = real(arr(2, 1:natom), kind=sp)
363 z4(1:natom) = real(arr(3, 1:natom), kind=sp)
364 END IF
365 WRITE (iunit) abc(1)*factor, angle_gamma, abc(2)*factor, &
366 angle_beta, angle_alpha, abc(3)*factor
367 WRITE (iunit) x4*real(factor, kind=sp)
368 WRITE (iunit) y4*real(factor, kind=sp)
369 WRITE (iunit) z4*real(factor, kind=sp)
370 ! Release work storage
371 DEALLOCATE (arr)
372 DEALLOCATE (x4)
373 DEALLOCATE (y4)
374 DEALLOCATE (z4)
375 CASE (dump_pdb)
376 my_charge_occup = .false.
377 IF (PRESENT(charge_occup)) my_charge_occup = charge_occup
378 my_charge_beta = .false.
379 IF (PRESENT(charge_beta)) my_charge_beta = charge_beta
380 my_charge_extended = .false.
381 IF (PRESENT(charge_extended)) my_charge_extended = charge_extended
382 IF (len_trim(title) > 0) THEN
383 WRITE (unit=iunit, fmt="(A6,T11,A)") &
384 "REMARK", trim(title)
385 END IF
386 CALL get_cell(cell, alpha=angle_alpha, beta=angle_beta, gamma=angle_gamma, abc=abc)
387 ! COLUMNS DATA TYPE CONTENTS
388 ! --------------------------------------------------
389 ! 1 - 6 Record name "CRYST1"
390 ! 7 - 15 Real(9.3) a (Angstroms)
391 ! 16 - 24 Real(9.3) b (Angstroms)
392 ! 25 - 33 Real(9.3) c (Angstroms)
393 ! 34 - 40 Real(7.2) alpha (degrees)
394 ! 41 - 47 Real(7.2) beta (degrees)
395 ! 48 - 54 Real(7.2) gamma (degrees)
396 ! 56 - 66 LString Space group
397 ! 67 - 70 Integer Z value
398 WRITE (unit=iunit, fmt="(A6,3F9.3,3F7.2)") &
399 "CRYST1", abc(1:3)*factor, angle_alpha, angle_beta, angle_gamma
400 WRITE (unit=line(1:6), fmt="(A6)") "ATOM "
401 DO iatom = 1, natom
402 line = ""
403 ! COLUMNS DATA TYPE CONTENTS
404 ! 1 - 6 Record name "ATOM "
405 ! 7 - 11 Integer Atom serial number
406 ! 13 - 16 Atom Atom name
407 ! 17 Character Alternate location indicator
408 ! 18 - 20 Residue name Residue name
409 ! 22 Character Chain identifier
410 ! 23 - 26 Integer Residue sequence number
411 ! 27 AChar Code for insertion of residues
412 ! 31 - 38 Real(8.3) Orthogonal coordinates for X in Angstrom
413 ! 39 - 46 Real(8.3) Orthogonal coordinates for Y in Angstrom
414 ! 47 - 54 Real(8.3) Orthogonal coordinates for Z in Angstrom
415 ! 55 - 60 Real(6.2) Occupancy
416 ! 61 - 66 Real(6.2) Temperature factor (Default = 0.0)
417 ! 73 - 76 LString(4) Segment identifier, left-justified
418 ! 77 - 78 LString(2) Element symbol, right-justified
419 ! 79 - 80 LString(2) Charge on the atom
420 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
421 element_symbol=element_symbol, name=atm_name, &
422 fist_potential=fist_potential, shell=shell)
423 IF (len_trim(element_symbol) == 0) THEN
424 dummy = qmmm_ff_precond_only_qm(id1=atm_name)
425 END IF
426 name = trim(atm_name)
427 IF (ASSOCIATED(fist_potential)) THEN
428 CALL get_potential(potential=fist_potential, qeff=qeff)
429 ELSE
430 qeff = 0.0_dp
431 END IF
432 IF (ASSOCIATED(shell)) CALL get_shell(shell=shell, charge=qeff)
433 WRITE (unit=line(1:6), fmt="(A6)") "ATOM "
434 WRITE (unit=line(7:11), fmt="(I5)") modulo(iatom, 100000)
435 WRITE (unit=line(13:16), fmt="(A4)") adjustl(name)
436 ! WRITE (UNIT=line(18:20),FMT="(A3)") TRIM(resname)
437 ! WRITE (UNIT=line(23:26),FMT="(I4)") MODULO(idres,10000)
438 SELECT CASE (trim(content))
439 CASE ("POS")
440 IF (PRESENT(array)) THEN
441 r(1:3) = get_particle_pos_or_vel(iatom, particle_set, array)
442 ELSE
443 r(:) = particle_set(iatom)%r(:)
444 END IF
445 WRITE (unit=line(31:54), fmt="(3F8.3)") r(1:3)*factor
446 CASE DEFAULT
447 cpabort("PDB dump only for trajectory available")
448 END SELECT
449 IF (my_charge_occup) THEN
450 WRITE (unit=line(55:60), fmt="(F6.2)") qeff
451 ELSE
452 WRITE (unit=line(55:60), fmt="(F6.2)") 0.0_dp
453 END IF
454 IF (my_charge_beta) THEN
455 WRITE (unit=line(61:66), fmt="(F6.2)") qeff
456 ELSE
457 WRITE (unit=line(61:66), fmt="(F6.2)") 0.0_dp
458 END IF
459 ! WRITE (UNIT=line(73:76),FMT="(A4)") ADJUSTL(TRIM(molname))
460 WRITE (unit=line(77:78), fmt="(A2)") adjustr(trim(element_symbol))
461 IF (my_charge_extended) THEN
462 WRITE (unit=line(81:), fmt="(SP,F0.8)") qeff
463 END IF
464 WRITE (unit=iunit, fmt="(A)") trim(line)
465 END DO
466 WRITE (unit=iunit, fmt="(A)") "END"
467 CASE DEFAULT
468 cpabort("Illegal dump type")
469 END SELECT
470
471 CALL timestop(handle)
472
473 END SUBROUTINE write_particle_coordinates
474
475! **************************************************************************************************
476!> \brief Write the atomic coordinates to the output unit.
477!> \param particle_set ...
478!> \param subsys_section ...
479!> \param charges ...
480!> \date 05.06.2000
481!> \author MK
482!> \version 1.0
483! **************************************************************************************************
484 SUBROUTINE write_fist_particle_coordinates(particle_set, subsys_section, charges)
485 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
486 TYPE(section_vals_type), POINTER :: subsys_section
487 REAL(kind=dp), DIMENSION(:), OPTIONAL :: charges
488
489 CHARACTER(LEN=default_string_length) :: name, unit_str
490 INTEGER :: iatom, ikind, iw, natom
491 REAL(kind=dp) :: conv, mass, qcore, qeff, qshell
492 TYPE(cp_logger_type), POINTER :: logger
493 TYPE(shell_kind_type), POINTER :: shell_kind
494
495 NULLIFY (logger)
496 NULLIFY (shell_kind)
497
498 logger => cp_get_default_logger()
499 iw = cp_print_key_unit_nr(logger, subsys_section, &
500 "PRINT%ATOMIC_COORDINATES", extension=".coordLog")
501
502 CALL section_vals_val_get(subsys_section, "PRINT%ATOMIC_COORDINATES%UNIT", c_val=unit_str)
503 conv = cp_unit_from_cp2k(1.0_dp, trim(unit_str))
504 CALL uppercase(unit_str)
505 IF (iw > 0) THEN
506 WRITE (unit=iw, fmt="(/,/,T2,A)") &
507 "MODULE FIST: ATOMIC COORDINATES IN "//trim(unit_str)
508 WRITE (unit=iw, fmt="(/,T4,A,T30,A,T44,A,T58,A,T66,A,T77,A)") &
509 "Atom Kind Name", "X", "Y", "Z", "q(eff)", "Mass"
510 natom = SIZE(particle_set)
511 DO iatom = 1, natom
512 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
513 kind_number=ikind, &
514 name=name, &
515 mass=mass, &
516 qeff=qeff, &
517 shell=shell_kind)
518 IF (PRESENT(charges)) qeff = charges(iatom)
519 IF (ASSOCIATED(shell_kind)) THEN
520 CALL get_shell(shell=shell_kind, &
521 charge_core=qcore, &
522 charge_shell=qshell)
523 qeff = qcore + qshell
524 END IF
525 WRITE (unit=iw, fmt="(T2,I6,1X,I4,1X,A7,3(1X,F13.6),2(1X,F8.4))") &
526 iatom, ikind, name, particle_set(iatom)%r(1:3)*conv, qeff, mass/massunit
527 END DO
528 WRITE (iw, "(A)") ""
529 END IF
530
531 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
532 "PRINT%ATOMIC_COORDINATES")
533
535
536! **************************************************************************************************
537!> \brief Write the atomic coordinates to the output unit.
538!> \param particle_set ...
539!> \param qs_kind_set ...
540!> \param subsys_section ...
541!> \param label ...
542!> \date 05.06.2000
543!> \author MK
544!> \version 1.0
545! **************************************************************************************************
546 SUBROUTINE write_qs_particle_coordinates(particle_set, qs_kind_set, subsys_section, label)
547
548 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
549 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
550 TYPE(section_vals_type), POINTER :: subsys_section
551 CHARACTER(LEN=*), INTENT(IN) :: label
552
553 CHARACTER(len=*), PARAMETER :: routinen = 'write_qs_particle_coordinates'
554
555 CHARACTER(LEN=2) :: element_symbol
556 CHARACTER(LEN=default_string_length) :: unit_str
557 INTEGER :: handle, iatom, ikind, iw, natom, z
558 REAL(kind=dp) :: conv, mass, zeff
559 TYPE(cp_logger_type), POINTER :: logger
560
561 CALL timeset(routinen, handle)
562
563 NULLIFY (logger)
564 logger => cp_get_default_logger()
565 iw = cp_print_key_unit_nr(logger, subsys_section, &
566 "PRINT%ATOMIC_COORDINATES", extension=".coordLog")
567
568 CALL section_vals_val_get(subsys_section, "PRINT%ATOMIC_COORDINATES%UNIT", c_val=unit_str)
569 conv = cp_unit_from_cp2k(1.0_dp, trim(unit_str))
570 CALL uppercase(unit_str)
571 IF (iw > 0) THEN
572 WRITE (unit=iw, fmt="(/,/,T2,A)") &
573 "MODULE "//trim(label)//": ATOMIC COORDINATES IN "//trim(unit_str)
574 WRITE (unit=iw, fmt="(/,T4,A,T30,A,T44,A,T58,A,T66,A,T77,A)") &
575 "Atom Kind Element", "X", "Y", "Z", "Z(eff)", "Mass"
576 natom = SIZE(particle_set)
577 DO iatom = 1, natom
578 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, &
579 kind_number=ikind, &
580 element_symbol=element_symbol, &
581 mass=mass, &
582 z=z)
583 CALL get_qs_kind(qs_kind_set(ikind), zeff=zeff)
584 WRITE (unit=iw, fmt="(T2,I6,1X,I4,1X,A2,1X,I4,3(1X,F13.6),2(1X,F8.4))") &
585 iatom, ikind, element_symbol, z, particle_set(iatom)%r(1:3)*conv, zeff, mass/massunit
586 END DO
587 WRITE (iw, "(A)") ""
588 END IF
589
590 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
591 "PRINT%ATOMIC_COORDINATES")
592
593 CALL timestop(handle)
594
595 END SUBROUTINE write_qs_particle_coordinates
596
597! **************************************************************************************************
598!> \brief Write the matrix of the particle distances to the output unit.
599!> \param particle_set ...
600!> \param cell ...
601!> \param subsys_section ...
602!> \date 06.10.2000
603!> \author Matthias Krack
604!> \version 1.0
605! **************************************************************************************************
606 SUBROUTINE write_particle_distances(particle_set, cell, subsys_section)
607
608 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
609 TYPE(cell_type), POINTER :: cell
610 TYPE(section_vals_type), POINTER :: subsys_section
611
612 CHARACTER(len=*), PARAMETER :: routinen = 'write_particle_distances'
613
614 CHARACTER(LEN=default_string_length) :: unit_str
615 INTEGER :: handle, iatom, iw, jatom, natom
616 INTEGER, DIMENSION(3) :: periodic
617 LOGICAL :: explicit
618 REAL(kind=dp) :: conv, dab, dab_abort, dab_min, dab_warn
619 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: distance_matrix
620 REAL(kind=dp), DIMENSION(3) :: rab
621 TYPE(cp_logger_type), POINTER :: logger
622
623 CALL timeset(routinen, handle)
624
625 cpassert(ASSOCIATED(particle_set))
626 cpassert(ASSOCIATED(cell))
627 cpassert(ASSOCIATED(subsys_section))
628
629 NULLIFY (logger)
630 logger => cp_get_default_logger()
631 iw = cp_print_key_unit_nr(logger, subsys_section, &
632 "PRINT%INTERATOMIC_DISTANCES", extension=".distLog")
633
634 CALL section_vals_val_get(subsys_section, "PRINT%INTERATOMIC_DISTANCES%UNIT", c_val=unit_str)
635 conv = cp_unit_from_cp2k(1.0_dp, trim(unit_str))
636 CALL section_vals_val_get(subsys_section, "PRINT%INTERATOMIC_DISTANCES%CHECK_INTERATOMIC_DISTANCES", &
637 r_val=dab_min, explicit=explicit)
638
639 dab_abort = 0.0_dp
640 dab_warn = 0.0_dp
641 natom = SIZE(particle_set)
642
643 ! Compute interatomic distances only if their printout or check is explicitly requested
644 ! Disable the default check for systems with more than 3000 atoms
645 IF (explicit .OR. (iw > 0) .OR. (natom <= 2000)) THEN
646 IF (dab_min > 0.0_dp) THEN
647 dab_warn = dab_min*conv
648 ELSE IF (dab_min < 0.0_dp) THEN
649 dab_abort = abs(dab_min)*conv
650 END IF
651 END IF
652
653 IF ((iw > 0) .OR. (dab_abort > 0.0_dp) .OR. (dab_warn > 0.0_dp)) THEN
654 CALL get_cell(cell=cell, periodic=periodic)
655 IF (iw > 0) THEN
656 ALLOCATE (distance_matrix(natom, natom))
657 distance_matrix(:, :) = 0.0_dp
658 END IF
659 DO iatom = 1, natom
660 DO jatom = iatom + 1, natom
661 rab(:) = pbc(particle_set(iatom)%r(:), &
662 particle_set(jatom)%r(:), cell)
663 dab = sqrt(rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3))*conv
664 IF (dab_abort > 0.0_dp) THEN
665 ! Stop the run for interatomic distances smaller than the requested threshold
666 IF (dab < dab_abort) THEN
667 CALL cp_abort(__location__, "The distance between the atoms "// &
668 trim(adjustl(cp_to_string(iatom, fmt="(I8)")))//" and "// &
669 trim(adjustl(cp_to_string(jatom, fmt="(I8)")))//" is only "// &
670 trim(adjustl(cp_to_string(dab, fmt="(F6.3)")))//" "// &
671 trim(adjustl(unit_str))//" and thus smaller than the requested threshold of "// &
672 trim(adjustl(cp_to_string(dab_abort, fmt="(F6.3)")))//" "// &
673 trim(adjustl(unit_str)))
674 END IF
675 END IF
676 IF (dab < dab_warn) THEN
677 ! Print warning for interatomic distances smaller than the requested threshold
678 CALL cp_warn(__location__, "The distance between the atoms "// &
679 trim(adjustl(cp_to_string(iatom, fmt="(I8)")))//" and "// &
680 trim(adjustl(cp_to_string(jatom, fmt="(I8)")))//" is only "// &
681 trim(adjustl(cp_to_string(dab, fmt="(F6.3)")))//" "// &
682 trim(adjustl(unit_str))//" and thus smaller than the threshold of "// &
683 trim(adjustl(cp_to_string(dab_warn, fmt="(F6.3)")))//" "// &
684 trim(adjustl(unit_str)))
685 END IF
686 IF (iw > 0) THEN
687 distance_matrix(iatom, jatom) = dab
688 distance_matrix(jatom, iatom) = distance_matrix(iatom, jatom)
689 END IF
690 END DO
691 END DO
692 IF (iw > 0) THEN
693 ! Print the distance matrix
694 WRITE (unit=iw, fmt="(/,/,T2,A)") &
695 "INTERATOMIC DISTANCES IN "//trim(unit_str)
696 CALL write_particle_matrix(distance_matrix, particle_set, iw)
697 IF (ALLOCATED(distance_matrix)) DEALLOCATE (distance_matrix)
698 END IF
699 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
700 "PRINT%INTERATOMIC_DISTANCES")
701 END IF
702
703 CALL timestop(handle)
704
705 END SUBROUTINE write_particle_distances
706
707! **************************************************************************************************
708!> \brief ...
709!> \param matrix ...
710!> \param particle_set ...
711!> \param iw ...
712!> \param el_per_part ...
713!> \param Ilist ...
714!> \param parts_per_line : number of particle columns to be printed in one line
715! **************************************************************************************************
716 SUBROUTINE write_particle_matrix(matrix, particle_set, iw, el_per_part, Ilist, parts_per_line)
717 REAL(kind=dp), DIMENSION(:, :) :: matrix
718 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
719 INTEGER, INTENT(IN) :: iw
720 INTEGER, INTENT(IN), OPTIONAL :: el_per_part
721 INTEGER, DIMENSION(:), OPTIONAL, POINTER :: ilist
722 INTEGER, INTENT(IN), OPTIONAL :: parts_per_line
723
724 CHARACTER(LEN=2) :: element_symbol
725 CHARACTER(LEN=default_string_length) :: fmt_string1, fmt_string2
726 INTEGER :: from, i, iatom, icol, jatom, katom, &
727 my_el_per_part, my_parts_per_line, &
728 natom, to
729 INTEGER, DIMENSION(:), POINTER :: my_list
730
731 my_el_per_part = 1
732 IF (PRESENT(el_per_part)) my_el_per_part = el_per_part
733 my_parts_per_line = 5
734 IF (PRESENT(parts_per_line)) my_parts_per_line = max(parts_per_line, 1)
735 WRITE (fmt_string1, fmt='(A,I0,A)') &
736 "(/,T2,11X,", my_parts_per_line, "(4X,I5,4X))"
737 WRITE (fmt_string2, fmt='(A,I0,A)') &
738 "(T2,I5,2X,A2,2X,", my_parts_per_line, "(1X,F12.6))"
739 IF (PRESENT(ilist)) THEN
740 natom = SIZE(ilist)
741 ELSE
742 natom = SIZE(particle_set)
743 END IF
744 ALLOCATE (my_list(natom))
745 IF (PRESENT(ilist)) THEN
746 my_list = ilist
747 ELSE
748 DO i = 1, natom
749 my_list(i) = i
750 END DO
751 END IF
752 natom = natom*my_el_per_part
753 DO jatom = 1, natom, my_parts_per_line
754 from = jatom
755 to = min(from + my_parts_per_line - 1, natom)
756 WRITE (unit=iw, fmt=trim(fmt_string1)) (icol, icol=from, to)
757 DO iatom = 1, natom
758 katom = iatom/my_el_per_part
759 IF (mod(iatom, my_el_per_part) /= 0) katom = katom + 1
760 CALL get_atomic_kind(atomic_kind=particle_set(my_list(katom))%atomic_kind, &
761 element_symbol=element_symbol)
762 WRITE (unit=iw, fmt=trim(fmt_string2)) &
763 iatom, element_symbol, &
764 (matrix(iatom, icol), icol=from, to)
765 END DO
766 END DO
767
768 DEALLOCATE (my_list)
769
770 END SUBROUTINE write_particle_matrix
771
772! **************************************************************************************************
773!> \brief Write structure data requested by a separate structure data input
774!> section to the output unit.
775!> input_section can be either motion_section or subsys_section.
776!>
777!> \param particle_set ...
778!> \param cell ...
779!> \param input_section ...
780!> \date 11.03.04
781!> \par History
782!> Recovered (23.03.06,MK)
783!> \author MK
784!> \version 1.0
785! **************************************************************************************************
786 SUBROUTINE write_structure_data(particle_set, cell, input_section)
787 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
788 TYPE(cell_type), POINTER :: cell
789 TYPE(section_vals_type), POINTER :: input_section
790
791 CHARACTER(LEN=*), PARAMETER :: routinen = 'write_structure_data'
792
793 CHARACTER(LEN=default_string_length) :: string, unit_str
794 INTEGER :: handle, i, i_rep, iw, n, n_rep, n_vals, &
795 natom, new_size, old_size, wrk2(2), &
796 wrk3(3), wrk4(4)
797 INTEGER, ALLOCATABLE, DIMENSION(:) :: work
798 INTEGER, DIMENSION(:), POINTER :: atomic_indices, index_list
799 LOGICAL :: unique
800 REAL(kind=dp) :: conv, dab
801 REAL(kind=dp), DIMENSION(3) :: r, rab, rbc, rcd, s
802 TYPE(cp_logger_type), POINTER :: logger
803 TYPE(section_vals_type), POINTER :: section
804
805 CALL timeset(routinen, handle)
806 NULLIFY (atomic_indices)
807 NULLIFY (index_list)
808 NULLIFY (logger)
809 NULLIFY (section)
810 string = ""
811
812 logger => cp_get_default_logger()
813 iw = cp_print_key_unit_nr(logger=logger, &
814 basis_section=input_section, &
815 print_key_path="PRINT%STRUCTURE_DATA", &
816 extension=".coordLog")
817
818 CALL section_vals_val_get(input_section, "PRINT%STRUCTURE_DATA%UNIT", c_val=unit_str)
819 conv = cp_unit_from_cp2k(1.0_dp, trim(unit_str))
820 CALL uppercase(unit_str)
821 IF (iw > 0) THEN
822 natom = SIZE(particle_set)
823 section => section_vals_get_subs_vals(section_vals=input_section, &
824 subsection_name="PRINT%STRUCTURE_DATA")
825
826 WRITE (unit=iw, fmt="(/,T2,A)") "REQUESTED STRUCTURE DATA"
827 ! Print the requested atomic position vectors
828 CALL section_vals_val_get(section_vals=section, &
829 keyword_name="POSITION", &
830 n_rep_val=n_rep)
831 IF (n_rep > 0) THEN
832 WRITE (unit=iw, fmt="(/,T3,A,/)") &
833 "Position vectors r(i) of the atoms i in "//trim(unit_str)
834 old_size = 0
835 DO i_rep = 1, n_rep
836 CALL section_vals_val_get(section_vals=section, &
837 keyword_name="POSITION", &
838 i_rep_val=i_rep, &
839 i_vals=atomic_indices)
840 n_vals = SIZE(atomic_indices)
841 new_size = old_size + n_vals
842 CALL reallocate(index_list, 1, new_size)
843 index_list(old_size + 1:new_size) = atomic_indices(1:n_vals)
844 old_size = new_size
845 END DO
846 ALLOCATE (work(new_size))
847 CALL sort(index_list, new_size, work)
848 DEALLOCATE (work)
849 DO i = 1, new_size
850 WRITE (unit=string, fmt="(A,I0,A)") "(", index_list(i), ")"
851 IF ((index_list(i) < 1) .OR. (index_list(i) > natom)) THEN
852 WRITE (unit=iw, fmt="(T3,A)") &
853 "Invalid atomic index "//trim(string)//" specified. Print request is ignored."
854 cycle
855 END IF
856 IF (i > 1) THEN
857 ! Skip redundant indices
858 IF (index_list(i) == index_list(i - 1)) cycle
859 END IF
860 WRITE (unit=iw, fmt="(T3,A,T20,A,3F13.6)") &
861 "r"//trim(string), "=", pbc(particle_set(index_list(i))%r(1:3), cell)*conv
862 END DO
863 DEALLOCATE (index_list)
864 END IF
865
866 ! Print the requested atomic position vectors in scaled coordinates
867 CALL section_vals_val_get(section_vals=section, &
868 keyword_name="POSITION_SCALED", &
869 n_rep_val=n_rep)
870 IF (n_rep > 0) THEN
871 WRITE (unit=iw, fmt="(/,T3,A,/)") &
872 "Position vectors s(i) of the atoms i in scaled coordinates"
873 old_size = 0
874 DO i_rep = 1, n_rep
875 CALL section_vals_val_get(section_vals=section, &
876 keyword_name="POSITION_SCALED", &
877 i_rep_val=i_rep, &
878 i_vals=atomic_indices)
879 n_vals = SIZE(atomic_indices)
880 new_size = old_size + n_vals
881 CALL reallocate(index_list, 1, new_size)
882 index_list(old_size + 1:new_size) = atomic_indices(1:n_vals)
883 old_size = new_size
884 END DO
885 ALLOCATE (work(new_size))
886 CALL sort(index_list, new_size, work)
887 DEALLOCATE (work)
888 DO i = 1, new_size
889 WRITE (unit=string, fmt="(A,I0,A)") "(", index_list(i), ")"
890 IF ((index_list(i) < 1) .OR. (index_list(i) > natom)) THEN
891 WRITE (unit=iw, fmt="(T3,A)") &
892 "Invalid atomic index "//trim(string)//" specified. Print request is ignored."
893 cycle
894 END IF
895 IF (i > 1) THEN
896 ! Skip redundant indices
897 IF (index_list(i) == index_list(i - 1)) cycle
898 END IF
899 r(1:3) = pbc(particle_set(index_list(i))%r(1:3), cell)
900 CALL real_to_scaled(s, r, cell)
901 WRITE (unit=iw, fmt="(T3,A,T20,A,3F13.6)") &
902 "s"//trim(string), "=", s(1:3)
903 END DO
904 DEALLOCATE (index_list)
905 END IF
906
907 ! Print the requested distances
908 CALL section_vals_val_get(section_vals=section, &
909 keyword_name="DISTANCE", &
910 n_rep_val=n)
911 IF (n > 0) THEN
912 WRITE (unit=iw, fmt="(/,T3,A,/)") &
913 "Distance vector r(i,j) between the atom i and j in "// &
914 trim(unit_str)
915 DO i = 1, n
916 CALL section_vals_val_get(section_vals=section, &
917 keyword_name="DISTANCE", &
918 i_rep_val=i, &
919 i_vals=atomic_indices)
920 string = ""
921 WRITE (unit=string, fmt="(A,2(I0,A))") &
922 "(", atomic_indices(1), ",", atomic_indices(2), ")"
923 wrk2 = atomic_indices
924 CALL sort_unique(wrk2, unique)
925 IF (((wrk2(1) >= 1) .AND. (wrk2(SIZE(wrk2)) <= natom)) .AND. unique) THEN
926 rab(:) = pbc(particle_set(atomic_indices(1))%r(:), &
927 particle_set(atomic_indices(2))%r(:), cell)
928 dab = sqrt(rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3))
929 WRITE (unit=iw, fmt="(T3,A,T20,A,3F13.6,3X,A,F13.6)") &
930 "r"//trim(string), "=", rab(:)*conv, &
931 "|r| =", dab*conv
932 ELSE
933 WRITE (unit=iw, fmt="(T3,A)") &
934 "Invalid atomic indices "//trim(string)//" specified. Print request is ignored."
935 END IF
936 END DO
937 END IF
938
939 ! Print the requested angles
940 CALL section_vals_val_get(section_vals=section, &
941 keyword_name="ANGLE", &
942 n_rep_val=n)
943 IF (n > 0) THEN
944 WRITE (unit=iw, fmt="(/,T3,A,/)") &
945 "Angle a(i,j,k) between the atomic distance vectors r(j,i) and "// &
946 "r(j,k) in DEGREE"
947 DO i = 1, n
948 CALL section_vals_val_get(section_vals=section, &
949 keyword_name="ANGLE", &
950 i_rep_val=i, &
951 i_vals=atomic_indices)
952 string = ""
953 WRITE (unit=string, fmt="(A,3(I0,A))") &
954 "(", atomic_indices(1), ",", atomic_indices(2), ",", atomic_indices(3), ")"
955 wrk3 = atomic_indices
956 CALL sort_unique(wrk3, unique)
957 IF (((wrk3(1) >= 1) .AND. (wrk3(SIZE(wrk3)) <= natom)) .AND. unique) THEN
958 rab(:) = pbc(particle_set(atomic_indices(1))%r(:), &
959 particle_set(atomic_indices(2))%r(:), cell)
960 rbc(:) = pbc(particle_set(atomic_indices(2))%r(:), &
961 particle_set(atomic_indices(3))%r(:), cell)
962 WRITE (unit=iw, fmt="(T3,A,T26,A,F9.3)") &
963 "a"//trim(string), "=", angle(-rab, rbc)*degree
964 ELSE
965 WRITE (unit=iw, fmt="(T3,A)") &
966 "Invalid atomic indices "//trim(string)//" specified. Print request is ignored."
967 END IF
968 END DO
969 END IF
970
971 ! Print the requested dihedral angles
972 CALL section_vals_val_get(section_vals=section, &
973 keyword_name="DIHEDRAL_ANGLE", &
974 n_rep_val=n)
975 IF (n > 0) THEN
976 WRITE (unit=iw, fmt="(/,T3,A,/)") &
977 "Dihedral angle d(i,j,k,l) between the planes (i,j,k) and (j,k,l) "// &
978 "in DEGREE"
979 DO i = 1, n
980 CALL section_vals_val_get(section_vals=section, &
981 keyword_name="DIHEDRAL_ANGLE", &
982 i_rep_val=i, &
983 i_vals=atomic_indices)
984 string = ""
985 WRITE (unit=string, fmt="(A,4(I0,A))") &
986 "(", atomic_indices(1), ",", atomic_indices(2), ",", &
987 atomic_indices(3), ",", atomic_indices(4), ")"
988 wrk4 = atomic_indices
989 CALL sort_unique(wrk4, unique)
990 IF (((wrk4(1) >= 1) .AND. (wrk4(SIZE(wrk4)) <= natom)) .AND. unique) THEN
991 rab(:) = pbc(particle_set(atomic_indices(1))%r(:), &
992 particle_set(atomic_indices(2))%r(:), cell)
993 rbc(:) = pbc(particle_set(atomic_indices(2))%r(:), &
994 particle_set(atomic_indices(3))%r(:), cell)
995 rcd(:) = pbc(particle_set(atomic_indices(3))%r(:), &
996 particle_set(atomic_indices(4))%r(:), cell)
997 WRITE (unit=iw, fmt="(T3,A,T26,A,F9.3)") &
998 "d"//trim(string), "=", dihedral_angle(rab, rbc, rcd)*degree
999 ELSE
1000 WRITE (unit=iw, fmt="(T3,A)") &
1001 "Invalid atomic indices "//trim(string)//" specified. Print request is ignored."
1002 END IF
1003 END DO
1004 END IF
1005 END IF
1006 CALL cp_print_key_finished_output(iw, logger, input_section, &
1007 "PRINT%STRUCTURE_DATA")
1008
1009 CALL timestop(handle)
1010
1011 END SUBROUTINE write_structure_data
1012
1013END MODULE particle_methods
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
Handles all functions related to the CELL.
subroutine, public set_cell_param(cell, cell_length, cell_angle, periodic, do_init_cell)
Sets the cell using the internal parameters (a,b,c) (alpha,beta,gamma) using the convention: a parall...
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
Definition cell_types.F:15
subroutine, public real_to_scaled(s, r, cell)
Transform real to scaled cell coordinates. s=h_inv*r.
Definition cell_types.F:491
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
Definition cell_types.F:564
subroutine, public cell_clone(cell_in, cell_out, tag)
Clone cell variable.
Definition cell_types.F:112
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
Definition cell_types.F:200
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Definition cp_units.F:1178
Definition of the atomic potential types.
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Definition gamma.F:15
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public dump_xmol
integer, parameter, public dump_pdb
integer, parameter, public dump_extxyz
integer, parameter, public dump_atomic
integer, parameter, public dump_dcd_aligned_cell
integer, parameter, public dump_dcd
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public sp
Definition kinds.F:33
Definition of mathematical constants and functions.
real(kind=dp), parameter, public degree
Collection of simple mathematical functions and subroutines.
Definition mathlib.F:15
pure real(kind=dp) function, public angle(a, b)
Calculation of the angle between the vectors a and b. The angle is returned in radians.
Definition mathlib.F:184
pure real(kind=dp) function, public dihedral_angle(ab, bc, cd)
Returns the dihedral angle, i.e. the angle between the planes defined by the vectors (-ab,...
Definition mathlib.F:476
Utility routines for the memory handling.
Define methods related to particle_type.
subroutine, public write_qs_particle_coordinates(particle_set, qs_kind_set, subsys_section, label)
Write the atomic coordinates to the output unit.
subroutine, public write_fist_particle_coordinates(particle_set, subsys_section, charges)
Write the atomic coordinates to the output unit.
subroutine, public write_particle_matrix(matrix, particle_set, iw, el_per_part, ilist, parts_per_line)
...
subroutine, public write_structure_data(particle_set, cell, input_section)
Write structure data requested by a separate structure data input section to the output unit....
subroutine, public write_particle_distances(particle_set, cell, subsys_section)
Write the matrix of the particle distances to the output unit.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis)
Get the components of a particle set.
subroutine, public write_particle_coordinates(particle_set, iunit, output_format, content, title, cell, array, unit_conv, charge_occup, charge_beta, charge_extended, print_kind)
Should be able to write a few formats e.g. xmol, and some binary format (dcd) some format can be used...
Define the data structure for the particle information.
pure real(kind=dp) function, dimension(3), public get_particle_pos_or_vel(iatom, particle_set, vector)
Return the atomic position or velocity of atom iatom in x from a packed vector even if core-shell par...
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public massunit
Definition physcon.F:141
logical function, public qmmm_ff_precond_only_qm(id1, id2, id3, id4, is_link)
This function handles the atom names and modifies the "_QM_" prefix, in order to find the parameters ...
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
elemental subroutine, public get_shell(shell, charge, charge_core, charge_shell, mass_core, mass_shell, k2_spring, k4_spring, max_dist, shell_cutoff)
...
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.
Definition util.F:14
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Provides all information about a quickstep kind.