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))
127 istart = iproc*(md2/nproc)
128 iend = min((iproc + 1)*md2/nproc, m2)
136 nwb = nxcl + nxc + nxcr - 2
137 nxt = nwbr + nwb + nwbl
140 IF (geocode ==
'P')
THEN
142 ELSE IF (geocode ==
'S')
THEN
144 ELSE IF (geocode ==
'F')
THEN
151 IF (istart + 1 <= m2)
THEN
153 CALL scale_and_distribute(m1, m3, md1, md2, md3, nxc, rhopot, zf, nproc, red_fact)
154 ELSE IF (istart + 1 <= nlim)
THEN
155 DO i2 = istart + 1, min(nlim, istart + md2/nproc)
159 zf(i1, i3, j2) = 0._dp
166 IF (geocode ==
'P')
THEN
168 scal = 1._dp/real(n1*n2*n3, kind=
dp)
169 CALL p_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, zf, &
170 scal, hx, hy, hz, pw_grid%para%group)
171 ELSE IF (geocode ==
'S')
THEN
173 scal = hy/real(n1*n2*n3, kind=
dp)
174 CALL s_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
175 scal, pw_grid%para%group)
176 ELSE IF (geocode ==
'F')
THEN
177 hgrid = max(hx, hy, hz)
178 scal = hgrid**3/real(n1*n2*n3, kind=
dp)
179 CALL f_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
180 scal, pw_grid%para%group)
181 factor = 0.5_dp*hgrid**3
187 IF (geocode ==
'F')
THEN
193 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.