(git:1155b05)
Loading...
Searching...
No Matches
cp_realspace_grid_openpmd.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 A wrapper around pw_to_openpmd() which accepts particle_list_type
10!> \author Ole Schuett, Franz Poeschel
11! **************************************************************************************************
14 USE kinds, ONLY: dp
16 USE pw_types, ONLY: pw_r3d_rs_type
18#include "./base/base_uses.f90"
19
20 IMPLICIT NONE
21
22 PRIVATE
23
24 PUBLIC :: cp_pw_to_openpmd
25
26 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_realspace_grid_openpmd'
27
28CONTAINS
29
30! **************************************************************************************************
31!> \brief ...
32!> \param pw ...
33!> \param unit_nr ...
34!> \param title ...
35!> \param particles ...
36!> \param zeff ...
37!> \param stride ...
38!> \param zero_tails ...
39!> \param silent ...
40!> \param mpi_io ...
41! **************************************************************************************************
42 SUBROUTINE cp_pw_to_openpmd( &
43 pw, &
44 unit_nr, &
45 title, &
46 particles, &
47 zeff, &
48 stride, &
49 zero_tails, &
50 silent, &
51 mpi_io &
52 )
53 TYPE(pw_r3d_rs_type), INTENT(IN) :: pw
54 INTEGER, INTENT(IN) :: unit_nr
55 CHARACTER(*), INTENT(IN), OPTIONAL :: title
56 TYPE(particle_list_type), POINTER :: particles
57 REAL(kind=dp), DIMENSION(:), OPTIONAL :: zeff
58 INTEGER, DIMENSION(:), OPTIONAL, POINTER :: stride
59 LOGICAL, INTENT(IN), OPTIONAL :: zero_tails, silent, mpi_io
60
61 INTEGER :: i, n
62 INTEGER, ALLOCATABLE, DIMENSION(:) :: particles_z
63 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: particles_r
64 TYPE(particle_list_type), POINTER :: my_particles
65
66 NULLIFY (my_particles)
67 my_particles => particles
68 IF (ASSOCIATED(my_particles)) THEN
69 n = my_particles%n_els
70 ALLOCATE (particles_z(n))
71 ALLOCATE (particles_r(3, n))
72 DO i = 1, n
73 CALL get_atomic_kind(my_particles%els(i)%atomic_kind, z=particles_z(i))
74 particles_r(:, i) = my_particles%els(i)%r(:)
75 END DO
76
77 CALL pw_to_openpmd(pw=pw, unit_nr=unit_nr, title=title, &
78 particles_z=particles_z, particles_r=particles_r, &
79 particles_zeff=zeff, &
80 stride=stride, zero_tails=zero_tails, &
81 silent=silent, mpi_io=mpi_io)
82 ELSE
83 CALL pw_to_openpmd(pw=pw, unit_nr=unit_nr, title=title, &
84 stride=stride, zero_tails=zero_tails, &
85 silent=silent, mpi_io=mpi_io)
86 END IF
87
88 END SUBROUTINE cp_pw_to_openpmd
89
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.
A wrapper around pw_to_openpmd() which accepts particle_list_type.
subroutine, public cp_pw_to_openpmd(pw, unit_nr, title, particles, zeff, stride, zero_tails, silent, mpi_io)
...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
represent a simple array based list of the given type
Generate Gaussian cube files.
subroutine, public pw_to_openpmd(pw, unit_nr, title, particles_r, particles_z, particles_zeff, stride, zero_tails, silent, mpi_io)
...