Skip to content

Commit a655546

Browse files
author
Anand
committed
Add appropriate size checkers for fft and format
1 parent 0da3b44 commit a655546

File tree

3 files changed

+199
-194
lines changed

3 files changed

+199
-194
lines changed

src/common/m_mpi_common.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ contains
11651165
if (p > 0) then
11661166
11671167
#ifdef MFC_POST_PROCESS
1168-
if(fft_wrt .and. (.not. file_per_process)) then
1168+
if (fft_wrt .and. (.not. file_per_process)) then
11691169
11701170
! Initial estimate of optimal processor topology
11711171
num_procs_x = 1
@@ -1269,7 +1269,7 @@ contains
12691269
end if
12701270
12711271
end do
1272-
end if
1272+
end if
12731273
#else
12741274
if (cyl_coord .and. p > 0) then
12751275
! Implement pencil processor blocking if using cylindrical coordinates so

src/post_process/m_checker.fpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module m_checker
1717

1818
implicit none
1919

20-
private; public :: s_check_inputs
20+
private; public :: s_check_inputs, s_check_inputs_fft
2121

2222
contains
2323

@@ -32,7 +32,6 @@ contains
3232
call s_check_inputs_flux_limiter
3333
call s_check_inputs_volume_fraction
3434
call s_check_inputs_vorticity
35-
call s_check_inputs_fft
3635
call s_check_inputs_qm
3736
call s_check_inputs_liutex
3837
call s_check_inputs_schlieren
@@ -112,11 +111,19 @@ contains
112111
@:PROHIBIT(any(omega_wrt) .and. fd_order == dflt_int, "fd_order must be set for omega_wrt")
113112
end subroutine s_check_inputs_vorticity
114113

115-
!> Checks constraints on fft_wrt
114+
!> Checks constraints on fft_wrt
116115
impure subroutine s_check_inputs_fft
116+
integer :: num_procs_x, num_procs_y, num_procs_z
117+
117118
@:PROHIBIT(fft_wrt .and. file_per_process, "Turn off file_per_process with fft_wrt")
118119
@:PROHIBIT(fft_wrt .and. (n == 0 .or. p == 0), "FFT WRT only in 3D")
119120
@:PROHIBIT(fft_wrt .and. (MOD(m+1,2) == 1 .or. MOD(n+1,2) == 1 .or. MOD(p+1,2) == 1), "FFT WRT requires local dimensions divisible by 2")
121+
num_procs_x = (m_glb + 1)/(m + 1)
122+
num_procs_y = (n_glb + 1)/(n + 1)
123+
num_procs_z = (p_glb + 1)/(p + 1)
124+
@:PROHIBIT(fft_wrt .and. (MOD(m_glb+1,num_procs_y) /= 0 .or. MOD(m_glb+1,num_procs_z) /= 0), "FFT WRT requires m_glb to be divisble by num_procs_y and num_procs_z")
125+
@:PROHIBIT(fft_wrt .and. (MOD(n_glb+1,num_procs_y) /= 0 .or. MOD(n_glb+1,num_procs_z) /= 0), "FFT WRT requires n_glb to be divisble by num_procs_y and num_procs_z")
126+
@:PROHIBIT(fft_wrt .and. (MOD(p_glb+1,num_procs_y) /= 0 .or. MOD(p_glb+1,num_procs_z) /= 0), "FFT WRT requires p_glb to be divisble by num_procs_y and num_procs_z")
120127
end subroutine s_check_inputs_fft
121128

122129
!> Checks constraints on Q-criterion parameters

0 commit comments

Comments
 (0)