surfaces_implementation Submodule

Implement procedures for exchanging information with halo blocks in block-structured grid


Uses

  • module~~surfaces_implementation~~UsesGraph module~surfaces_implementation surfaces_implementation module~surfaces_interface surfaces_interface module~surfaces_implementation->module~surfaces_interface module~assertions_interface assertions_interface module~surfaces_implementation->module~assertions_interface module~emulated_intrinsics_interface emulated_intrinsics_interface module~surfaces_implementation->module~emulated_intrinsics_interface module~kind_parameters kind_parameters module~surfaces_interface->module~kind_parameters module~package_interface package_interface module~surfaces_interface->module~package_interface iso_c_binding iso_c_binding module~surfaces_interface->iso_c_binding iso_fortran_env iso_fortran_env module~kind_parameters->iso_fortran_env module~package_interface->module~kind_parameters

Contents


Variables

TypeVisibility AttributesNameInitial
integer, private, allocatable, dimension(:):: global_block_partitions
type(surfaces), private :: singleton[*]

Singleton pattern: one instance per image. Design: using a derived-type coarray instead of component coarrays is both simpler and facilitates setting different component array bounds on different images, which facilitates using the global block_identifier as the first index.

integer, private, parameter:: success =0

Functions

pure function first_index(block_id) result(outbox_1st_index)

result is the halo_outbox first index corresponding to the block identifier block_id

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: block_id

Return Value integer


Module Procedures

module procedure get_block_image pure module function get_block_image(block_id) result(image)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: block_id

Return Value integer

module procedure get_global_block_partitions pure module function get_global_block_partitions() result(block_partitions)

Arguments

None

Return Value integer, allocatable, dimension(:)

module procedure get_halo_outbox module function get_halo_outbox() result(singleton_halo_outbox)

Arguments

None

Return Value type(package), dimension(:,:,:), allocatable

module procedure get_neighbor_block_id pure module function get_neighbor_block_id(my_block_id, coordinate_direction, face_direction) result(neighbor_block_id)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: my_block_id
integer, intent(in) :: coordinate_direction
integer, intent(in) :: face_direction

Return Value integer

module procedure get_normal_scalar_fluxes pure module function get_normal_scalar_fluxes(image, block_id, coordinate_direction, face_direction, scalar_id) result(fluxes)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: image
integer, intent(in) :: block_id
integer, intent(in) :: coordinate_direction
integer, intent(in) :: face_direction
integer, intent(in) :: scalar_id

Return Value real(kind=r8k), allocatable, dimension(:,:)

surface-normal scalar flux components: shape = [Ny, Nz] or [Nx, Nz] or [Nx, Ny] depending on orientation

module procedure get_surface_normal_spacing pure module function get_surface_normal_spacing(image, block_id, coordinate_direction, face_direction) result(dx_normal)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: image
integer, intent(in) :: block_id
integer, intent(in) :: coordinate_direction
integer(kind=enumeration), intent(in) :: face_direction

Return Value real(kind=r8k)

module procedure get_surface_positions pure module function get_surface_positions(image, block_id, coordinate_direction, face_direction) result(positions)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: image
integer, intent(in) :: block_id
integer, intent(in) :: coordinate_direction
integer, intent(in) :: face_direction

Return Value real(kind=r8k), allocatable, dimension(:,:,:,:)

surface vertices: shape=[Nx,Ny,Nz,space_dim] where findloc(shape(positions, value=1)) designates surface-normal direction

module procedure is_external_boundary elemental module function is_external_boundary(block_id, coordinate_direction, face) result(is_external)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: block_id
integer, intent(in) :: coordinate_direction
integer(kind=enumeration), intent(in) :: face

Return Value logical

module procedure set_halo_outbox module subroutine set_halo_outbox(my_halo_outbox, block_partitions)

parentheses prevent GCC 8.3 internal compiler error for actual arguments for which any lbound /= 1

Arguments

Type IntentOptional AttributesName
type(package), intent(in), dimension(:,:,:):: my_halo_outbox
integer, intent(in), dimension(:):: block_partitions

module procedure set_normal_scalar_fluxes module subroutine set_normal_scalar_fluxes(block_id, coordinate_direction, face, s_flux_normal, scalar_id)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: block_id
integer, intent(in) :: coordinate_direction
integer(kind=enumeration), intent(in) :: face
real(kind=r8k), intent(in), dimension(:,:):: s_flux_normal

surface-normal scalar flux components: shape = [Ny, Nz] or [Nx, Nz] or [Nx, Ny]

integer, intent(in) :: scalar_id

module procedure set_num_scalars module subroutine set_num_scalars(num_scalars)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: num_scalars