81 SUBROUTINE psolver(geocode, iproc, nproc, n01, n02, n03, hx, hy, hz, &
82 rhopot, karray, pw_grid)
83 CHARACTER(len=1),
INTENT(in) :: geocode
84 INTEGER,
INTENT(in) :: iproc, nproc, n01, n02, n03
85 REAL(kind=
dp),
INTENT(in) :: hx, hy, hz
86 REAL(kind=
dp),
DIMENSION(*),
INTENT(inout) :: rhopot
87 REAL(kind=
dp),
DIMENSION(*),
INTENT(in) :: karray
90 INTEGER :: i1, i2, i3, iend, istart, j2, m1, m2, &
91 m3, md1, md2, md3, n1, n2, n3, nd1, &
92 nd2, nd3, nlim, nwb, nwbl, nwbr, nxc, &
94 REAL(kind=
dp) :: factor, hgrid, red_fact, scal
95 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: zf
100 IF (geocode ==
'P')
THEN
101 CALL p_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
102 ELSE IF (geocode ==
'S')
THEN
103 CALL s_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
104 ELSE IF (geocode ==
'F')
THEN
105 CALL f_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
107 cpabort(
"PSolver: geometry code not admitted")
110 ALLOCATE (zf(md1, md3, md2/nproc))
126 istart = iproc*(md2/nproc)
127 iend = min((iproc + 1)*md2/nproc, m2)
135 nwb = nxcl + nxc + nxcr - 2
136 nxt = nwbr + nwb + nwbl
139 IF (geocode ==
'P')
THEN
141 ELSE IF (geocode ==
'S')
THEN
143 ELSE IF (geocode ==
'F')
THEN
147 IF (istart + 1 <= m2)
THEN
149 CALL scale_and_distribute(m1, m3, md1, md2, md3, nxc, rhopot, zf, nproc, red_fact)
150 ELSE IF (istart + 1 <= nlim)
THEN
151 DO i2 = istart + 1, min(nlim, istart + md2/nproc)
155 zf(i1, i3, j2) = 0._dp
162 IF (geocode ==
'P')
THEN
164 scal = 1._dp/real(n1*n2*n3, kind=
dp)
165 CALL p_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, zf, &
166 scal, hx, hy, hz, pw_grid%para%group)
167 ELSE IF (geocode ==
'S')
THEN
169 scal = hy/real(n1*n2*n3, kind=
dp)
170 CALL s_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
171 scal, pw_grid%para%group)
172 ELSE IF (geocode ==
'F')
THEN
173 hgrid = max(hx, hy, hz)
174 scal = hgrid**3/real(n1*n2*n3, kind=
dp)
175 CALL f_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
176 scal, pw_grid%para%group)
177 factor = 0.5_dp*hgrid**3
181 IF (geocode ==
'F')
THEN
187 CALL scale_and_distribute(m1, m3, md1, md2, md3, nxc, zf, rhopot, nproc, red_fact)
subroutine, public p_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the convolution for the periodic syste...
subroutine, public psolver(geocode, iproc, nproc, n01, n02, n03, hx, hy, hz, rhopot, karray, pw_grid)
Calculate the Poisson equation $\nabla^2 V(x,y,z)=-4 \pi \rho(x,y,z)$ from a given $\rho$,...
subroutine, public s_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the convolution for the surface system...
subroutine, public f_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the zero-padded convolution.