Skip to content

Commit

Permalink
Merge pull request #331 from sfiligoi/swapfg_231026
Browse files Browse the repository at this point in the history
Swap f and g comm order in NL
  • Loading branch information
sfiligoi authored Oct 30, 2023
2 parents cf685fe + 506a513 commit a1684b3
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 293 deletions.
8 changes: 4 additions & 4 deletions cgyro/src/cgyro_cleanup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ subroutine cgyro_cleanup
if(allocated(gx)) deallocate(gx)
if(allocated(fy)) deallocate(fy)
if(allocated(gy)) deallocate(gy)
if(allocated(uxmany)) deallocate(uxmany)
if(allocated(uymany)) deallocate(uymany)
if(allocated(vx)) deallocate(vx)
if(allocated(vy)) deallocate(vy)
if(allocated(vxmany)) deallocate(vxmany)
if(allocated(vymany)) deallocate(vymany)
if(allocated(ux)) deallocate(ux)
if(allocated(uy)) deallocate(uy)
if(allocated(uv)) deallocate(uv)
#endif

Expand Down
8 changes: 4 additions & 4 deletions cgyro/src/cgyro_globals.F90
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ module cgyro_globals
!
! 2D FFT work arrays
#ifndef CGYRO_GPU_FFT
real, dimension(:,:,:), allocatable :: uxmany
real, dimension(:,:,:), allocatable :: uymany
real, dimension(:,:,:), allocatable :: vx
real, dimension(:,:,:), allocatable :: vy
real, dimension(:,:,:), allocatable :: vxmany
real, dimension(:,:,:), allocatable :: vymany
real, dimension(:,:,:), allocatable :: ux
real, dimension(:,:,:), allocatable :: uy
real, dimension(:,:,:), allocatable :: uv
complex, dimension(:,:,:),allocatable :: fx
complex, dimension(:,:,:),allocatable :: fy
Expand Down
10 changes: 5 additions & 5 deletions cgyro/src/cgyro_init_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,14 @@ subroutine cgyro_init_manager
allocate(fy(0:ny2,0:nx-1,n_omp))
allocate(gy(0:ny2,0:nx-1,n_omp))

allocate(uxmany(0:ny-1,0:nx-1,nsplit))
allocate(uymany(0:ny-1,0:nx-1,nsplit))
allocate(vx(0:ny-1,0:nx-1,n_omp))
allocate(vy(0:ny-1,0:nx-1,n_omp))
allocate(vxmany(0:ny-1,0:nx-1,nsplit))
allocate(vymany(0:ny-1,0:nx-1,nsplit))
allocate(ux(0:ny-1,0:nx-1,n_omp))
allocate(uy(0:ny-1,0:nx-1,n_omp))
allocate(uv(0:ny-1,0:nx-1,n_omp))

! Create plans once and for all, with global arrays fx,ux
plan_c2r = fftw_plan_dft_c2r_2d(nx,ny,gx(:,:,1),vx(:,:,1),FFTW_PATIENT)
plan_c2r = fftw_plan_dft_c2r_2d(nx,ny,fx(:,:,1),ux(:,:,1),FFTW_PATIENT)
plan_r2c = fftw_plan_dft_r2c_2d(nx,ny,uv(:,:,1),fx(:,:,1),FFTW_PATIENT)
#endif

Expand Down
Loading

0 comments on commit a1684b3

Please sign in to comment.