Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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 @@ -1177,8 +1177,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 @@ -1190,6 +1194,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
integer(tik) :: id

Expand Down Expand Up @@ -1238,11 +1245,37 @@ contains

if ( LPROF ) call start_timing( id, '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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be helpful to put a comment here saying that this is for continuous spaces (or continuous horizontal spaces, hence wtheta using the discontinuous kernel)

! 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 ( LPROF ) call stop_timing( id, 'runtime_constants.geometric' )
else
Expand All @@ -1257,8 +1290,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 @@ -1270,6 +1307,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
integer(tik) :: id

Expand Down Expand Up @@ -1315,7 +1355,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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, maybe a comment about continuous spaces

! 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 ( LPROF ) call stop_timing( id, 'runtime_constants.geometric' )
else
Expand Down

This file was deleted.

Loading
Loading