Skip to content

Commit 3e94297

Browse files
authored
Fixed bug for z-pencils with z-implicit diffusion on CPUs. (CaNS-World#150)
Missed removing some pre-processor macros.
1 parent 1327244 commit 3e94297

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/solver.f90

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,24 @@ subroutine solver(n,ng,arrplan,normfft,lambdaxy,a,b,c,bc,c_or_f,p)
7474
call transpose_y_to_x(py,px)
7575
call fft(arrplan(2,1),px) ! bwd transform in x
7676
!
77-
#if !defined(_DECOMP_Y) && !defined(_DECOMP_Z)
78-
!$OMP PARALLEL WORKSHARE
79-
p(1:n(1),1:n(2),1:n(3)) = px(:,:,:)*normfft
80-
!$OMP END PARALLEL WORKSHARE
81-
#elif defined(_DECOMP_Y)
82-
call transpose_x_to_y(px,py)
83-
!$OMP PARALLEL WORKSHARE
84-
p(1:n(1),1:n(2),1:n(3)) = py(:,:,:)*normfft
85-
!$OMP END PARALLEL WORKSHARE
86-
#elif defined(_DECOMP_Z)
87-
!call transpose_x_to_z(px,pz)
88-
call transpose_x_to_y(px,py)
89-
call transpose_y_to_z(py,pz)
90-
!$OMP PARALLEL WORKSHARE
91-
p(1:n(1),1:n(2),1:n(3)) = pz(:,:,:)*normfft
92-
!$OMP END PARALLEL WORKSHARE
93-
#endif
77+
select case(ipencil_axis)
78+
case(1)
79+
!$OMP PARALLEL WORKSHARE
80+
p(1:n(1),1:n(2),1:n(3)) = px(:,:,:)*normfft
81+
!$OMP END PARALLEL WORKSHARE
82+
case(2)
83+
call transpose_x_to_y(px,py)
84+
!$OMP PARALLEL WORKSHARE
85+
p(1:n(1),1:n(2),1:n(3)) = py(:,:,:)*normfft
86+
!$OMP END PARALLEL WORKSHARE
87+
case(3)
88+
!call transpose_x_to_z(px,pz)
89+
call transpose_x_to_y(px,py)
90+
call transpose_y_to_z(py,pz)
91+
!$OMP PARALLEL WORKSHARE
92+
p(1:n(1),1:n(2),1:n(3)) = pz(:,:,:)*normfft
93+
!$OMP END PARALLEL WORKSHARE
94+
end select
9495
end subroutine solver
9596
!
9697
subroutine gaussel(nx,ny,n,nh,a,b,c,p,lambdaxy)

0 commit comments

Comments
 (0)