BOUNDARIES: Use enumerator for the boundary type.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2022-02-02 09:54:05 -03:00
parent 9829505650
commit b1343baa30

View File

@ -47,23 +47,25 @@ 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()
! variable to store boundary type flags
! supported boundary types
!
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
@ -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
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
!