Skip to content
Open
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
5 changes: 5 additions & 0 deletions applications/adjoint_tests/example/configuration.nml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ n_coarsesmooth=4,
n_postsmooth=2,
n_presmooth=2,
smooth_relaxation=0.8,
coarsen_multigrid_tiles=.false.
max_tiled_multigrid_level=1
/
&esm_couple
l_esm_couple_test=.false.,
Expand All @@ -290,6 +292,9 @@ panel_decomposition='auto',
panel_xproc=1,
panel_yproc=1,
partitioner='cubedsphere',
inner_halo_tiles=.false.
tile_size_x=1
tile_size_y=1
/
&physics
bl_segment=0,
Expand Down
4 changes: 3 additions & 1 deletion applications/adjoint_tests/source/adjoint_tests.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ program adjoint_tests
call init_config( filename, gungho_required_namelists, &
config=modeldb%config )

call init_logger( modeldb%mpi%get_comm(), application_name )
call init_logger( modeldb%config, &
modeldb%mpi%get_comm(), &
application_name )

subroutine_timers = modeldb%config%io%subroutine_timers()
timer_output_path = modeldb%config%io%timer_output_path()
Expand Down
5 changes: 5 additions & 0 deletions applications/gravity_wave/example/configuration.nml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ smooth_relaxation = 0.8
n_presmooth = 2
n_postsmooth = 2
n_coarsesmooth = 4
coarsen_multigrid_tiles = .false.
max_tiled_multigrid_level = 1
/

&timestepping
Expand All @@ -200,6 +202,9 @@ partitioner = 'cubedsphere'
panel_decomposition = 'auto'
panel_xproc = 1
panel_yproc = 1
tile_size_x = 1
tile_size_y = 1
inner_halo_tiles = .false.
/

&boundaries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module gw_pressure_operator_alg_mod
b_space_w0, &
b_space_w3, &
b_space_wtheta
use function_space_chain_mod, only: multigrid_function_space_chain
use multigrid_mod, only: multigrid_function_space_chain

implicit none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module gravity_wave_infrastructure_mod

use add_mesh_map_mod, only : assign_mesh_maps
use driver_modeldb_mod, only : modeldb_type
use constants_mod, only : i_def, &
use constants_mod, only : i_def, imdi, &
PRECISION_REAL, &
r_def, r_second, &
l_def, str_def
Expand All @@ -20,6 +20,8 @@ module gravity_wave_infrastructure_mod
use extrusion_mod, only : extrusion_type, &
uniform_extrusion_type, &
TWOD, PRIME_EXTRUSION
use multigrid_mod, only : get_multigrid_tile_size, &
init_multigrid_fs_chain
use sci_geometric_constants_mod, &
only : get_chi_inventory, &
get_panel_id_inventory
Expand All @@ -30,7 +32,7 @@ module gravity_wave_infrastructure_mod
LOG_LEVEL_ERROR
use mesh_collection_mod, only : mesh_collection
use field_mod, only : field_type
use driver_fem_mod, only : init_fem, init_function_space_chains
use driver_fem_mod, only : init_fem
use driver_io_mod, only : init_io, final_io
use driver_mesh_mod, only : init_mesh
use runtime_constants_mod, only : create_runtime_constants
Expand Down Expand Up @@ -77,17 +79,23 @@ subroutine initialise_infrastructure( program_name, &

logical(l_def) :: l_multigrid
logical(l_def) :: prepartitioned
logical :: apply_partition_check

logical(l_def) :: check_partitions
logical(l_def) :: inner_halo_tiles
integer(i_def) :: stencil_depth(1)

integer(i_def) :: geometry
integer(i_def) :: topology
integer(i_def) :: method
integer(i_def) :: number_of_layers
integer(i_def) :: tile_size_x
integer(i_def) :: tile_size_y

real(r_def) :: domain_bottom
real(r_def) :: domain_height
real(r_def) :: scaled_radius

integer(i_def), allocatable :: tile_size(:,:)
integer(i_def), allocatable :: multigrid_tile_size(:,:)

integer(i_def) :: i
integer(i_def), parameter :: one_layer = 1_i_def

Expand All @@ -101,12 +109,23 @@ subroutine initialise_infrastructure( program_name, &

prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name()
geometry = modeldb%config%base_mesh%geometry()
topology = modeldb%config%base_mesh%topology()
prepartitioned = modeldb%config%base_mesh%prepartitioned()
method = modeldb%config%extrusion%method()
domain_height = modeldb%config%extrusion%domain_height()
number_of_layers = modeldb%config%extrusion%number_of_layers()
scaled_radius = modeldb%config%planet%scaled_radius()

if (prepartitioned) then
inner_halo_tiles = .false.
tile_size_x = 1
tile_size_y = 1
else
inner_halo_tiles = modeldb%config%partitioning%inner_halo_tiles()
tile_size_x = maxval([1,modeldb%config%partitioning%tile_size_x()])
tile_size_y = maxval([1,modeldb%config%partitioning%tile_size_y()])
end if

!-------------------------------------------------------------------------
! Initialise infrastructure
!-------------------------------------------------------------------------
Expand Down Expand Up @@ -158,12 +177,12 @@ subroutine initialise_infrastructure( program_name, &
call log_event("Invalid geometry for mesh initialisation", LOG_LEVEL_ERROR)
end select
allocate( extrusion, source=create_extrusion( method, &
domain_height, &
domain_height, &
domain_bottom, &
number_of_layers, &
PRIME_EXTRUSION ) )

extrusion_2d = uniform_extrusion_type( domain_height, &
extrusion_2d = uniform_extrusion_type( domain_height, &
domain_bottom, &
one_layer, TWOD )

Expand All @@ -172,23 +191,46 @@ subroutine initialise_infrastructure( program_name, &
! 1.3 Initialise mesh objects and assign InterGrid maps
!=======================================================================
stencil_depth = 2
apply_partition_check = .false.
check_partitions = .false.
if ( .not. prepartitioned .and. l_multigrid ) then
apply_partition_check = .true.
check_partitions = .true.
end if

if (allocated(tile_size)) deallocate(tile_size)
allocate(tile_size(2, size(base_mesh_names)))
tile_size(1,:) = tile_size_x
tile_size(2,:) = tile_size_y
if (l_multigrid) then
multigrid_tile_size = get_multigrid_tile_size( modeldb%config, &
base_mesh_names, &
extrusion )
where (multigrid_tile_size /= imdi) tile_size = multigrid_tile_size
end if

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

allocate( twod_names, source=base_mesh_names )
do i=1, size(twod_names)
twod_names(i) = trim(twod_names(i))//'_2d'
end do

if (allocated(tile_size)) deallocate(tile_size)
allocate(tile_size(2, size(base_mesh_names)))
tile_size(1,:) = tile_size_x
tile_size(2,:) = tile_size_y
if (l_multigrid) then
multigrid_tile_size = get_multigrid_tile_size( modeldb%config, &
base_mesh_names, &
extrusion_2d )
where (multigrid_tile_size /= imdi) tile_size = multigrid_tile_size
end if
call create_mesh( base_mesh_names, extrusion_2d, &
inner_halo_tiles, tile_size, &
alt_name=twod_names )
call assign_mesh_maps(twod_names)

Expand All @@ -197,16 +239,17 @@ subroutine initialise_infrastructure( program_name, &
!=======================================================================
chi_inventory => get_chi_inventory()
panel_id_inventory => get_panel_id_inventory()
call init_fem( mesh_collection, chi_inventory, panel_id_inventory )
call init_fem( modeldb%config, chi_inventory, panel_id_inventory )
if ( l_multigrid ) then
call init_function_space_chains( mesh_collection, chain_mesh_tags )
call init_multigrid_fs_chain(chain_mesh_tags)
end if

!-------------------------------------------------------------------------
! Initialise aspects of output
!-------------------------------------------------------------------------
call init_io( program_name, prime_mesh_name, &
modeldb, chi_inventory, panel_id_inventory)
call init_io( program_name, prime_mesh_name, modeldb, &
chi_inventory, panel_id_inventory, &
geometry, topology )

!-------------------------------------------------------------------------
! Setup constants
Expand Down
4 changes: 3 additions & 1 deletion applications/gravity_wave/source/gravity_wave.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ program gravity_wave

deallocate( filename )

call init_logger( modeldb%mpi%get_comm(), program_name )
call init_logger( modeldb%config, &
modeldb%mpi%get_comm(), &
program_name )

subroutine_timers = modeldb%config%io%subroutine_timers()
timer_output_path = modeldb%config%io%timer_output_path()
Expand Down
Loading
Loading