From b1343baa30875e80a377a9a4b842ef27f7b383a5 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Wed, 2 Feb 2022 09:54:05 -0300 Subject: [PATCH] BOUNDARIES: Use enumerator for the boundary type. Signed-off-by: Grzegorz Kowal --- sources/boundaries.F90 | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/sources/boundaries.F90 b/sources/boundaries.F90 index e5ff805..921e9e3 100644 --- a/sources/boundaries.F90 +++ b/sources/boundaries.F90 @@ -47,25 +47,27 @@ module boundaries end subroutine end interface -! parameters corresponding to the boundary type -! - integer, parameter :: bnd_periodic = 0 - integer, parameter :: bnd_open = 1 - integer, parameter :: bnd_outflow = 2 - integer, parameter :: bnd_reflective = 3 - integer, parameter :: bnd_gravity = 4 - integer, parameter :: bnd_user = 5 - -! pointers to the custom boundary conditions, one per direction +! pointers to custom boundary conditions, one per direction handling both sides ! procedure(custom_boundary_iface), pointer, save :: & - custom_boundary_x => null(), & - custom_boundary_y => null(), & - custom_boundary_z => null() + custom_boundary_x => null(), & + custom_boundary_y => null(), & + custom_boundary_z => null() -! variable to store boundary type flags +! supported boundary types ! - integer, dimension(3,2), save :: bnd_type = bnd_periodic + enum, bind(c) + enumerator bnd_user + enumerator bnd_periodic + enumerator bnd_open + enumerator bnd_outflow + enumerator bnd_reflective + enumerator bnd_gravity + end enum + +! the boundary type array for both sides along all directions +! + integer, dimension(3,2), save :: bnd_type = bnd_periodic #ifdef MPI ! arrays to store information about blocks which need to be exchange between @@ -80,7 +82,6 @@ module boundaries public :: initialize_boundaries, finalize_boundaries, print_boundaries public :: boundary_variables, boundary_fluxes public :: custom_boundary_x, custom_boundary_y, custom_boundary_z - public :: bnd_type, bnd_periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - !