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
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,12 @@ contains
!> @return A height field
function get_height_fe(space_id, mesh_id) result(height)

use sci_get_height_kernel_mod, only: get_height_kernel_type
use planet_config_mod, only: scaled_radius
use sci_height_continuous_kernel_mod, only: height_continuous_kernel_type
use sci_height_discontinuous_kernel_mod, &
only: height_discontinuous_kernel_type
use base_mesh_config_mod, only: geometry
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

Expand All @@ -1175,6 +1179,9 @@ contains
type(function_space_type), pointer :: space
type(field_type), pointer :: chi(:)
type(field_type), pointer :: height
type(field_type) :: rmultiplicity
type(field_type) :: nodal_multiplicity
type(field_type) :: ones
character(len=str_def) :: inventory_name

! If running at lowest order, use finite volume
Expand Down Expand Up @@ -1219,11 +1226,37 @@ contains

if ( subroutine_timers ) call timer('runtime_constants.geometric')

space => function_space_collection%get_fs(mesh, element_order_h, &
element_order_v, space_id)
space => function_space_collection%get_fs( &
mesh, element_order_h, element_order_v, space_id &
)
call inventory%add_field(height, space, mesh)

call invoke( get_height_kernel_type(height, chi, scaled_radius) )
select case (space_id)
case (W3, Wtheta)
call invoke( &
height_discontinuous_kernel_type( &
height, chi, geometry, coord_system, scaled_radius &
) &
)

case default
! Can't import multiplicity, so must calculate it
call ones%initialise( space )
call nodal_multiplicity%initialise( space )
call rmultiplicity%initialise( space )

call invoke( &
setval_c(ones, 1.0_r_def), &
setval_c(nodal_multiplicity, 0.0_r_def), &
multiplicity_kernel_type(nodal_multiplicity), &
X_divideby_Y(rmultiplicity, ones, nodal_multiplicity), &
setval_c(height, 0.0_r_def), &
height_continuous_kernel_type( &
height, chi, rmultiplicity, &
geometry, coord_system, scaled_radius &
) &
)
end select

if ( subroutine_timers ) call timer('runtime_constants.geometric')
else
Expand All @@ -1238,8 +1271,12 @@ contains
!> @return A height field
function get_height_fv(space_id, mesh_id) result(height)

use sci_get_height_kernel_mod, only: get_height_kernel_type
use planet_config_mod, only: scaled_radius
use sci_height_continuous_kernel_mod, only: height_continuous_kernel_type
use sci_height_discontinuous_kernel_mod, &
only: height_discontinuous_kernel_type
use base_mesh_config_mod, only: geometry
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

Expand All @@ -1251,6 +1288,9 @@ contains
type(function_space_type), pointer :: space
type(field_type), pointer :: chi(:)
type(field_type), pointer :: height
type(field_type) :: rmultiplicity
type(field_type) :: nodal_multiplicity
type(field_type) :: ones
character(len=str_def) :: inventory_name

! Determine inventory based on space
Expand Down Expand Up @@ -1292,7 +1332,32 @@ contains
space => function_space_collection%get_fs(mesh, 0, 0, space_id)
call inventory%add_field(height, space, mesh)

call invoke( get_height_kernel_type(height, chi, scaled_radius) )
select case (space_id)
case (W3, Wtheta)
call invoke( &
height_discontinuous_kernel_type( &
height, chi, geometry, coord_system, scaled_radius &
) &
)

case default
! Can't import multiplicity, so must calculate it
call ones%initialise( space )
call nodal_multiplicity%initialise( space )
call rmultiplicity%initialise( space )

call invoke( &
setval_c(ones, 1.0_r_def), &
setval_c(nodal_multiplicity, 0.0_r_def), &
multiplicity_kernel_type(nodal_multiplicity), &
X_divideby_Y(rmultiplicity, ones, nodal_multiplicity), &
setval_c(height, 0.0_r_def), &
height_continuous_kernel_type( &
height, chi, rmultiplicity, &
geometry, coord_system, scaled_radius &
) &
)
end select

if ( subroutine_timers ) call timer('runtime_constants.geometric')
else
Expand Down

This file was deleted.

Loading
Loading