Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/post_process/m_checker.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ contains
!> Checks compatibility of parameters in the input file.
!! Used by the post_process stage
impure subroutine s_check_inputs

call s_check_inputs_output_format

end subroutine s_check_inputs

!> Checks constraints on output format parameters
impure subroutine s_check_inputs_output_format
@:PROHIBIT(precision == 2 .and. wp == sp)
end subroutine s_check_inputs_output_format

!> Checks constraints on fft_wrt
impure subroutine s_check_inputs_fft
integer :: num_procs_y, num_procs_z
Expand Down
5 changes: 1 addition & 4 deletions src/post_process/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,6 @@ contains

num_dims = 1 + min(1, n) + min(1, p)

#ifdef MFC_MPI
! Initialization of the MPI environment
call s_mpi_initialize()

Expand All @@ -1167,14 +1166,12 @@ contains

! Broadcasting the user inputs to all of the processors and performing the
! parallel computational domain decomposition. Neither procedure has to be
! carried out if the simulation is in fact not truly executed in parallel.
! carried out if the post-process is in fact not truly executed in parallel.
call s_mpi_bcast_user_inputs()
call s_initialize_parallel_io()
call s_mpi_decompose_computational_domain()
call s_check_inputs_fft()

#endif

end subroutine s_initialize_mpi_domain

!> @brief Destroy FFTW plans, free MPI communicators, and finalize all post-process sub-modules.
Expand Down
10 changes: 0 additions & 10 deletions src/pre_process/m_checker.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ contains
!> Checks compatibility of parameters in the input file.
!! Used by the pre_process stage
impure subroutine s_check_inputs

call s_check_parallel_io

end subroutine s_check_inputs

!> Checks if mpi is enabled with parallel_io
impure subroutine s_check_parallel_io
#ifndef MFC_MPI
@:PROHIBIT(parallel_io, "MFC built with --no-mpi requires parallel_io=F")
#endif
end subroutine s_check_parallel_io

end module m_checker
9 changes: 0 additions & 9 deletions src/simulation/m_checker.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ contains
else if (recon_type == MUSCL_TYPE) then
call s_check_inputs_muscl
end if
call s_check_inputs_geometry_precision
end if

call s_check_inputs_time_stepping
Expand Down Expand Up @@ -76,14 +75,6 @@ contains
"For 3D simulation, p must be greater than or equal to (num_stcls_min*muscl_order - 1), whose value is "//trim(numStr))
end subroutine s_check_inputs_muscl

!> Checks constraints on geometry and precision
impure subroutine s_check_inputs_geometry_precision
! Prevent spherical geometry in single precision
#ifdef MFC_SINGLE_PRECISION
@:PROHIBIT(.not. (cyl_coord .neqv. .true. .or. (cyl_coord .and. p == 0)), "Fully 3D cylindrical grid (geometry = 3) is not supported in single precision.")
#endif
end subroutine s_check_inputs_geometry_precision

!> Checks constraints on time stepping parameters
impure subroutine s_check_inputs_time_stepping
if (.not. cfl_dt) then
Expand Down
34 changes: 34 additions & 0 deletions toolchain/mfc/case_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from functools import lru_cache
from .common import MFCException
from .params.definitions import CONSTRAINTS
from .state import CFG


# Physics documentation for check methods.
Expand Down Expand Up @@ -1794,6 +1795,10 @@ def check_output_format(self):
if precision is not None:
self.prohibit(precision not in [1, 2],
"precision must be 1 or 2")
self.prohibit(
precision == 2 and CFG().single,
"precision = 2 (double output) requires MFC built without --single"
)

def check_vorticity(self):
"""Checks vorticity parameters (post-process)"""
Expand Down Expand Up @@ -2330,13 +2335,41 @@ def check_velocity_components(self):
self.prohibit(vel3 != 0,
f"patch_icpp({i})%vel(3) = {vel3} but p = 0 (1D/2D simulation)")

# ===================================================================
# Build-Flag Compatibility Checks
# ===================================================================

def check_build_flags(self):
"""Checks case parameters against the active build configuration.

These catch incompatibilities between case settings and how the
MFC binaries were compiled (--mpi/--no-mpi, --single, etc.)
before any binary is invoked.
"""
parallel_io = self.get('parallel_io', 'F') == 'T'
self.prohibit(
parallel_io and not CFG().mpi,
"parallel_io = T requires MFC built with --mpi"
)

def check_geometry_precision_simulation(self):
"""Checks that 3D cylindrical geometry is not used with --single builds."""
cyl_coord = self.get('cyl_coord', 'F') == 'T'
p = self.get('p', 0)
self.prohibit(
CFG().single and cyl_coord and p > 0,
"Fully 3D cylindrical geometry (cyl_coord = T, p > 0) is not supported "
"in single precision (--single)"
)

# ===================================================================
# Main Validation Entry Points
# ===================================================================

def validate_common(self):
"""Validate parameters common to all stages"""
self.check_parameter_types() # Type validation first
self.check_build_flags()
self.check_simulation_domain()
self.check_domain_bounds()
self.check_model_eqns_and_num_fluids()
Expand All @@ -2359,6 +2392,7 @@ def validate_common(self):
def validate_simulation(self):
"""Validate simulation-specific parameters"""
self.validate_common()
self.check_geometry_precision_simulation()
self.check_finite_difference()
self.check_time_stepping()
self.check_riemann_solver()
Expand Down
2 changes: 2 additions & 0 deletions toolchain/mfc/lint_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ def check_physics_docs_coverage(repo_root: Path) -> list[str]:
"check_output_format", # output format selection
"check_restart", # restart file logistics
"check_parallel_io_pre_process", # parallel I/O settings
"check_build_flags", # build-flag compatibility (no physics meaning)
"check_geometry_precision_simulation", # build-flag compatibility (no physics meaning)
"check_misc_pre_process", # miscellaneous pre-process flags
"check_bc_patches", # boundary patch geometry
"check_grid_stretching", # grid stretching parameters
Expand Down
Loading