Skip to content
Draft
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
7 changes: 4 additions & 3 deletions applications/coupled/source/driver/coupled_driver_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ subroutine initialise( program_name, modeldb, calendar )
real(r_def) :: domain_bottom
real(r_def) :: domain_height
real(r_def) :: scaled_radius
logical :: apply_partition_check
logical :: check_partitions

integer(i_def) :: i
integer(i_def), parameter :: one_layer = 1_i_def
Expand Down Expand Up @@ -119,12 +119,13 @@ subroutine initialise( program_name, modeldb, calendar )

! Create the required meshes
stencil_depth = 1
apply_partition_check = .false.
check_partitions = .false.

call init_mesh( modeldb%configuration, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
base_mesh_names, extrusion, &
stencil_depth, apply_partition_check )
stencil_depth, check_partitions )

allocate( twod_names, source=base_mesh_names )
do i=1, size(twod_names)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ subroutine initialise(program_name, modeldb)
! ---------------------------------------------------------
stencil_depth = 1
check_partitions = .false.

call init_mesh( modeldb%configuration, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ subroutine initialise( program_name, modeldb)
! ---------------------------------------------------------
stencil_depth = 1
check_partitions = .false.

call init_mesh( modeldb%configuration, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
Expand Down
7 changes: 4 additions & 3 deletions applications/skeleton/source/driver/skeleton_driver_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ subroutine initialise(program_name, modeldb)
real(r_def) :: domain_bottom
real(r_def) :: domain_height
real(r_def) :: scaled_radius
logical :: apply_partition_check
logical :: check_partitions

integer(i_def) :: i
integer(i_def), parameter :: one_layer = 1_i_def
Expand Down Expand Up @@ -140,12 +140,13 @@ subroutine initialise(program_name, modeldb)
! Create the required meshes
!-----------------------------------------------------------------------
stencil_depth = 1
apply_partition_check = .false.
check_partitions = .false.

call init_mesh( modeldb%configuration, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
base_mesh_names, extrusion, &
stencil_depth, apply_partition_check )
stencil_depth, check_partitions )

allocate( twod_names, source=base_mesh_names )
do i=1, size(twod_names)
Expand Down
3 changes: 2 additions & 1 deletion components/driver/source/driver_mesh_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ subroutine init_mesh( configuration, &
decomposition, &
stencil_depths, &
generate_inner_halos, &
partitioner_ptr )
partitioner_ptr, &
enforce_constraints=check_partitions )


! 2.2f Read in the global intergrid mesh mappings,
Expand Down
29 changes: 21 additions & 8 deletions components/driver/source/mesh/runtime_partition_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ subroutine create_local_mesh( mesh_names, &
decomposition, &
stencil_depths, &
generate_inner_halos, &
partitioner_ptr )
partitioner_ptr, &
enforce_constraints )

implicit none

Expand All @@ -133,6 +134,8 @@ subroutine create_local_mesh( mesh_names, &

logical(l_def), intent(in) :: generate_inner_halos

logical(l_def), intent(in), optional :: enforce_constraints

procedure(partitioner_interface), intent(in), pointer :: partitioner_ptr

type(global_mesh_type), pointer :: global_mesh_ptr
Expand All @@ -142,21 +145,31 @@ subroutine create_local_mesh( mesh_names, &
integer(i_def) :: local_mesh_id, i
integer(i_def) :: mapping_factor

logical(l_def) :: enforce_constraints_choice

if (present(enforce_constraints)) then
enforce_constraints_choice = enforce_constraints
else
enforce_constraints_choice = .true.
end if

do i=1, size(mesh_names)

global_mesh_ptr => global_mesh_collection%get_global_mesh( mesh_names(i) )

mapping_factor = calc_mapping_factor( global_mesh_collection, global_mesh_ptr )

! Create partition
partition = partition_type( global_mesh_ptr, &
partitioner_ptr, &
decomposition, &
stencil_depths(i), &
generate_inner_halos, &
local_rank, &
total_ranks, &
partition = partition_type( global_mesh_ptr, &
partitioner_ptr, &
decomposition, &
stencil_depths(i), &
generate_inner_halos, &
enforce_constraints_choice, &
local_rank, &
total_ranks, &
mapping_factor )

! Create local_mesh
call local_mesh%initialise( global_mesh_ptr, partition )

Expand Down
4 changes: 4 additions & 0 deletions components/driver/unit-test/mesh/create_mesh_mod_test.pf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ contains
logical(l_def), intent(in) :: generate_inner_halos
integer(i_def), intent(in) :: local_rank
integer(i_def), intent(in) :: total_ranks

! Local variables
type(ugrid_mesh_data_type) :: ugrid_mesh_data
type(global_mesh_type) :: global_mesh
Expand All @@ -107,6 +108,8 @@ contains
procedure(partitioner_interface), pointer :: partitioner_ptr
integer(i_def) :: local_mesh_id

logical(l_def), parameter :: enforce_constraints = .true.

! Reset in case of repeated initialisation
call mesh_collection%clear()
call global_mesh_collection%clear()
Expand All @@ -129,6 +132,7 @@ contains
decomposition, &
max_stencil_depth, &
generate_inner_halos, &
enforce_constraints, &
local_rank, &
total_ranks )

Expand Down
Loading