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
21 changes: 2 additions & 19 deletions applications/io_demo/source/driver/io_demo_checkpoint_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ module io_demo_checkpoint_mod
LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type

use base_mesh_config_mod, only: geometry_spherical, &
geometry_planar, &
topology_fully_periodic, &
topology_non_periodic

implicit none

private
Expand Down Expand Up @@ -71,21 +66,9 @@ subroutine setup_checkpoint_io(modeldb, chi, panel_id)
call log_event( 'io_demo: Setting up checkpoint I/O', LOG_LEVEL_DEBUG )

mesh => chi(1)%get_mesh()
if (mesh%is_geometry_spherical()) then
geometry = geometry_spherical
else
geometry = geometry_planar
end if

if (mesh%is_topology_periodic()) then
topology = topology_fully_periodic
else if (mesh%is_topology_non_periodic()) then
topology = topology_non_periodic
else
call log_event( 'Unsupported mesh topology', &
log_level_error )
end if

geometry = mesh%geometry()
topology = mesh%topology()
coord_system = modeldb%config%finite_element%coord_system()
scaled_radius = modeldb%config%planet%scaled_radius()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module set_lbc_int_kernel_mod
use constants_mod, only: r_def, i_def, l_def, radians_to_degrees
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry_spherical
use mesh_mod, only: geometry_spherical

implicit none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module set_lbc_real_kernel_mod
use constants_mod, only: r_def, i_def, l_def, radians_to_degrees
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry_spherical
use mesh_mod, only: geometry_spherical

implicit none

Expand Down
35 changes: 13 additions & 22 deletions components/driver/source/driver_coordinates_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ module driver_coordinates_mod
schmidt_transform_xyz, &
inverse_schmidt_transform_xyz

use mesh_mod, only: geometry_planar, &
geometry_spherical, &
topology_periodic, &
topology_non_periodic

! Configuration modules
use base_mesh_config_mod, only: geometry_planar, &
geometry_spherical, &
topology_fully_periodic, &
topology_non_periodic
use finite_element_config_mod, only: coord_system_xyz

implicit none
Expand Down Expand Up @@ -64,7 +65,7 @@ subroutine assign_coordinate_field(config, mesh, chi, panel_id)
implicit none

type(config_type), intent(in) :: config
type(mesh_type), intent(in), pointer :: mesh
type(mesh_type), intent(in) :: mesh
type(field_type), intent(inout) :: chi(3)
type(field_type), intent(inout) :: panel_id

Expand Down Expand Up @@ -108,18 +109,8 @@ subroutine assign_coordinate_field(config, mesh, chi, panel_id)

nullify( map, map_pid, dof_coords, reference_element )

if (mesh%is_geometry_spherical()) then
geometry = geometry_spherical
else
geometry = geometry_planar
end if

if (mesh%is_topology_periodic()) then
topology = topology_fully_periodic
else
topology = topology_non_periodic
end if

geometry = mesh%geometry()
topology = mesh%topology()
coord_system = config%finite_element%coord_system()
scaled_radius = config%planet%scaled_radius()

Expand Down Expand Up @@ -178,7 +169,7 @@ subroutine assign_coordinate_field(config, mesh, chi, panel_id)
! Throw an error if stretching factor is not 1 and not on cubed-sphere
if ( abs(stretch_factor - 1.0_r_def) > eps .and. .not. &
(geometry == geometry_spherical .and. &
topology == topology_fully_periodic) ) then
topology == topology_periodic) ) then
call log_event( &
'driver_coordinates: Cannot determine coordinates if Schmidt ' // &
'stretching factor is not 1 and mesh is not cubed-sphere', &
Expand Down Expand Up @@ -228,7 +219,7 @@ subroutine assign_coordinate_field(config, mesh, chi, panel_id)
end do

else if ( geometry == geometry_spherical .and. &
topology /= topology_fully_periodic ) then
topology /= topology_periodic ) then

do cell = 1,chi_proxy(1)%vspace%get_ncell()

Expand Down Expand Up @@ -263,7 +254,7 @@ subroutine assign_coordinate_field(config, mesh, chi, panel_id)
end do

else if ( geometry == geometry_spherical .and. &
topology == topology_fully_periodic ) then
topology == topology_periodic ) then

do cell = 1,chi_proxy(1)%vspace%get_ncell()

Expand Down Expand Up @@ -352,7 +343,7 @@ subroutine calc_panel_id( nlayers, &
integer(kind=i_def) :: vert, k

if ( geometry == geometry_spherical .and. &
topology == topology_fully_periodic ) then
topology == topology_periodic ) then

! The following code assumes that the mesh generator has ordered the
! global cell ids panel-by-panel. If this is ever not the case, the
Expand Down Expand Up @@ -451,7 +442,7 @@ subroutine assign_coordinate_xyz( nlayers, &
end if
! Domain does not have N-S boundaries only if topology completely periodic
if ( column_coords(2,SWB,k+1) > column_coords(2,NWB,k+1) .and. &
topology == topology_fully_periodic ) then
topology == topology_periodic ) then
! On y boundary
vertex_local_coords(2,SWB) = domain_y
vertex_local_coords(2,SEB) = domain_y
Expand Down
21 changes: 6 additions & 15 deletions components/driver/source/driver_fem_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ module driver_fem_mod
use sci_chi_transform_mod, only: init_chi_transforms, &
final_chi_transforms

use mesh_mod, only: geometry_spherical, &
geometry_planar, &
topology_non_periodic

! Object types
use config_mod, only: config_type
use field_mod, only: field_type
use mesh_mod, only: mesh_type
use inventory_by_mesh_mod, only: inventory_by_mesh_type

! Configuration modules
use base_mesh_config_mod, only: geometry_spherical, &
geometry_planar, &
topology_non_periodic, &
topology_fully_periodic
use finite_element_config_mod, only: coord_system_xyz, &
coord_space_W0, &
coord_space_Wchi, &
Expand Down Expand Up @@ -121,17 +121,8 @@ subroutine init_fem(config, chi_inventory, panel_id_inventory)
mesh => mesh_collection%get_mesh(all_mesh_names(i))
mesh_name = mesh%get_mesh_name()

if (mesh%is_geometry_spherical()) then
geometry = geometry_spherical
else
geometry = geometry_planar
end if

if (mesh%is_topology_periodic()) then
topology = topology_fully_periodic
else
topology = topology_non_periodic
end if
geometry = mesh%geometry()
topology = mesh%topology()

! Initialise coordinate transformations
call init_chi_transforms( geometry, topology, &
Expand Down
6 changes: 3 additions & 3 deletions components/driver/source/driver_mesh_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ module driver_mesh_mod

use global_mesh_collection_mod, only: global_mesh_collection
use local_mesh_collection_mod, only: local_mesh_collection
use mesh_mod, only: geometry_spherical, &
topology_periodic

! Configuration modules
use finite_element_config_mod, only: cellshape_quadrilateral
use base_mesh_config_mod, only: geometry_spherical, &
topology_fully_periodic

implicit none

Expand Down Expand Up @@ -287,7 +287,7 @@ subroutine init_mesh( config, &
generate_inner_halos = config%partitioning%generate_inner_halos()

if ( geometry == geometry_spherical .and. &
topology == topology_fully_periodic ) then
topology == topology_periodic ) then
mesh_selection = mesh_cubedsphere
call log_event( "Setting up cubed-sphere partition mesh(es)", &
log_level_debug )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module assign_coordinate_xyz_mod_test

use constants_mod, only : r_def, i_def

use base_mesh_config_mod, only: geometry_planar, topology_fully_periodic
use mesh_mod, only: geometry_planar, topology_periodic
use funit

implicit none
Expand All @@ -33,7 +33,7 @@ contains
one = 1.0_r_def

integer(i_def), parameter :: geometry = geometry_planar
integer(i_def), parameter :: topology = topology_fully_periodic
integer(i_def), parameter :: topology = topology_periodic
real(r_def), parameter :: scaled_radius = 1.0_r_def

integer(kind=i_def) :: nlayers, ndf, nverts, i, undf, ndf_pid, undf_pid
Expand Down
20 changes: 13 additions & 7 deletions components/science/source/algorithm/sci_fem_constants_mod.x90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module sci_fem_constants_mod
use inventory_by_mesh_mod, only: inventory_by_mesh_type
use log_mod, only: log_event, LOG_LEVEL_ERROR
use mesh_collection_mod, only: mesh_collection
use mesh_mod, only: mesh_type
use mesh_mod, only: mesh_type, topology_periodic
use operator_mod, only: operator_type
use quadrature_xyoz_mod, only: quadrature_xyoz_type
use quadrature_rule_gaussian_mod, only: quadrature_rule_gaussian_type
Expand Down Expand Up @@ -210,7 +210,6 @@ contains
only: compute_mass_matrix_kernel_w1_type
use sci_edge_lump_w2_mass_matrix_kernel_mod, &
only: edge_lump_w2_mass_matrix_kernel_type
use base_mesh_config_mod, only: topology, topology_fully_periodic

implicit none

Expand All @@ -230,6 +229,11 @@ contains
integer(kind=i_def), parameter :: stencil_depth = 1_i_def
integer(tik) :: id

integer(i_def) :: topology

mesh => mesh_collection%get_mesh(mesh_id)
topology = mesh%topology()

! If running at lowest order, use finite volume
if (element_order_h == 0 .and. element_order_v == 0) then
mm_op => get_mass_matrix_fv(space, mesh_id)
Expand Down Expand Up @@ -266,7 +270,6 @@ contains
call inventory%initialise(name=inventory_name)
end if

mesh => mesh_collection%get_mesh(mesh_id)
constant_exists = inventory%paired_object_exists(mesh_id)

if (.not. constant_exists) then
Expand Down Expand Up @@ -299,7 +302,7 @@ contains
end select
! Lump W2 mass matrix along the edge of the domain to avoid boundary
! errors propagating into the domain with each iteration
if ( (space == W2 .or. space == W2h) .and. topology /= topology_fully_periodic ) then
if ( (space == W2 .or. space == W2h) .and. topology /= topology_periodic ) then
call dummy_field%initialise( fs, halo_depth=2 )
call invoke( edge_lump_w2_mass_matrix_kernel_type(mm_op, &
dummy_field, &
Expand Down Expand Up @@ -328,7 +331,6 @@ contains
only: compute_mass_matrix_kernel_w1_type
use sci_edge_lump_w2_mass_matrix_kernel_mod, &
only: edge_lump_w2_mass_matrix_kernel_type
use base_mesh_config_mod, only: topology, topology_fully_periodic

implicit none

Expand All @@ -348,6 +350,11 @@ contains
integer(kind=i_def), parameter :: stencil_depth = 1_i_def
integer(tik) :: id

integer(i_def) :: topology

mesh => mesh_collection%get_mesh(mesh_id)
topology = mesh%topology()

! Point to appropriate inventory for this space
select case (space)
case (W1)
Expand Down Expand Up @@ -378,7 +385,6 @@ contains
call inventory%initialise(name=inventory_name)
end if

mesh => mesh_collection%get_mesh(mesh_id)
constant_exists = inventory%paired_object_exists(mesh_id)

if (.not. constant_exists) then
Expand Down Expand Up @@ -410,7 +416,7 @@ contains
end select
! Lump W2 mass matrix along the edge of the domain to avoid boundary
! errors propagating into the domain with each iteration
if ( (space == W2 .or. space == W2h) .and. topology /= topology_fully_periodic ) then
if ( (space == W2 .or. space == W2h) .and. topology /= topology_periodic ) then
call dummy_field%initialise( fs, halo_depth=2 )
call invoke( edge_lump_w2_mass_matrix_kernel_type(mm_op, &
dummy_field, &
Expand Down
Loading
Loading