diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 330823d6e..f6f35502e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,26 +1,28 @@ # Contributors -| GitHub user | Real Name | Affiliation | Date | -| ---------------- | ---------------------- | ----------- | ---------- | -| andrewcoughtrie | Andrew Coughtrie | Met Office | 2025.12.12 | -| james-bruten-mo | James Bruten | Met Office | 2025-12-09 | -| jedbakerMO | Jed Baker | Met Office | 2025-12-29 | -| jennyhickson | Jenny Hickson | Met Office | 2025-12-10 | -| mo-marqh | Mark Hedley | Met Office | 2025-12-11 | -| mo-rickywong | Ricky Wong | Met Office | 2025-01-30 | -| mike-hobson | Mike Hobson | Met Office | 2025-12-17 | -| MatthewHambley | Matthew Hambley | Met Office | 2025-12-15 | -| mo-lottieturner | Lottie Turner | Met Office | 2025-12-16 | -| tommbendall | Thomas Bendall | Met Office | 2026-01-23 | -| yaswant | Yaswant Pradhan | Met Office | 2025-12-16 | -| stevemullerworth | Steve Mullerworth | Met Office | 2026-01-08 | -| harry-shepherd | Harry Shepherd | Met Office | 2026-01-08 | -| EdHone | Ed Hone | Met Office | 2026-01-09 | -| tom-j-h | Tom Hill | Met Office | 2026-01-19 | -| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-12 | -| t00sa | Sam Clarke-Green | Met Office | 2026-01-27 | -| MetBenjaminWent | Benjamin Went | Met Office | 2026-01-30 | -| jcsmeto | James Cunningham-Smith | Met Office | 2026-02-06 | -| thomasmelvin | Thomas Melvin | Met Office | 2026-01-15 | -| ericaneininger | Erica Neininger | Met Office | 2026-03-02 | -| mo-lucy-gordon | Lucy Gordon | Met Office | 2026-03-18 | \ No newline at end of file +| GitHub user | Real Name | Affiliation | Date | +| ------------------- | ---------------------- | ----------- | ---------- | +| andrewcoughtrie | Andrew Coughtrie | Met Office | 2025.12.12 | +| james-bruten-mo | James Bruten | Met Office | 2025-12-09 | +| jedbakerMO | Jed Baker | Met Office | 2025-12-29 | +| jennyhickson | Jenny Hickson | Met Office | 2025-12-10 | +| mo-marqh | Mark Hedley | Met Office | 2025-12-11 | +| mo-rickywong | Ricky Wong | Met Office | 2025-01-30 | +| mike-hobson | Mike Hobson | Met Office | 2025-12-17 | +| MatthewHambley | Matthew Hambley | Met Office | 2025-12-15 | +| mo-lottieturner | Lottie Turner | Met Office | 2025-12-16 | +| tommbendall | Thomas Bendall | Met Office | 2026-01-23 | +| yaswant | Yaswant Pradhan | Met Office | 2025-12-16 | +| stevemullerworth | Steve Mullerworth | Met Office | 2026-01-08 | +| harry-shepherd | Harry Shepherd | Met Office | 2026-01-08 | +| EdHone | Ed Hone | Met Office | 2026-01-09 | +| tom-j-h | Tom Hill | Met Office | 2026-01-19 | +| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-12 | +| t00sa | Sam Clarke-Green | Met Office | 2026-01-27 | +| MetBenjaminWent | Benjamin Went | Met Office | 2026-01-30 | +| jcsmeto | James Cunningham-Smith | Met Office | 2026-02-06 | +| thomasmelvin | Thomas Melvin | Met Office | 2026-01-15 | +| ericaneininger | Erica Neininger | Met Office | 2026-03-02 | +| mo-lucy-gordon | Lucy Gordon | Met Office | 2026-03-18 | +| ukmo-juan-castillo | Juan M. Castillo | Met Office | 2026-03-24 | + diff --git a/components/science/source/algorithm/sci_mapping_constants_mod.x90 b/components/science/source/algorithm/sci_mapping_constants_mod.x90 index ffa819aa1..7e2a4d6e0 100644 --- a/components/science/source/algorithm/sci_mapping_constants_mod.x90 +++ b/components/science/source/algorithm/sci_mapping_constants_mod.x90 @@ -43,6 +43,10 @@ module sci_mapping_constants_mod tik, LPROF ! Configuration + use base_mesh_config_mod, only: geometry_spherical, & + geometry_planar, & + topology_fully_periodic, & + topology_non_periodic use finite_element_config_mod, only: element_order_h, & element_order_v @@ -273,6 +277,8 @@ contains type(operator_type), pointer :: u_lat_sample type(operator_type), pointer :: u_up_sample integer(tik) :: id + integer(kind=i_def) :: geometry + integer(kind=i_def) :: topology if (.not. u_lon_sample_inventory%is_initialised()) then call u_lon_sample_inventory%initialise(name='u_lon_sample') @@ -288,6 +294,17 @@ contains chi => get_coordinates(mesh_id) panel_id => get_panel_id(mesh_id) + if (mesh%is_geometry_planar()) then + geometry = geometry_planar + else if (mesh%is_geometry_spherical()) then + geometry = geometry_spherical + end if + if (mesh%is_topology_non_periodic()) then + topology = topology_non_periodic + else if (mesh%is_topology_periodic()) then + topology = topology_fully_periodic + end if + if ( LPROF ) call start_timing( id, 'runtime_constants.mapping' ) ! Kernels only work for lowest order spaces so use finite volume @@ -303,7 +320,8 @@ contains compute_sample_u_ops_kernel_type(u_lon_sample, & u_lat_sample, & u_up_sample, & - chi, panel_id) ) + chi, panel_id, & + geometry, topology) ) if ( LPROF ) call stop_timing( id, 'runtime_constants.mapping' ) diff --git a/components/science/source/kernel/inter_function_space/sci_compute_sample_u_ops_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_compute_sample_u_ops_kernel_mod.F90 index 4bfbb79e1..2faaf701f 100644 --- a/components/science/source/kernel/inter_function_space/sci_compute_sample_u_ops_kernel_mod.F90 +++ b/components/science/source/kernel/inter_function_space/sci_compute_sample_u_ops_kernel_mod.F90 @@ -15,8 +15,8 @@ module sci_compute_sample_u_ops_kernel_mod use argument_mod, only : arg_type, func_type, & - GH_FIELD, GH_REAL, & - GH_OPERATOR, & + GH_FIELD, GH_SCALAR, GH_REAL,& + GH_INTEGER, GH_OPERATOR, & GH_INC, GH_READ, GH_WRITE, & ANY_DISCONTINUOUS_SPACE_3, & GH_BASIS, GH_DIFF_BASIS, & @@ -33,8 +33,7 @@ module sci_compute_sample_u_ops_kernel_mod use reference_element_mod, only : W, S, N, E, T, B use finite_element_config_mod, only: coord_system - use base_mesh_config_mod, only: geometry, topology, & - geometry_spherical, & + use base_mesh_config_mod, only: geometry_spherical, & geometry_planar use planet_config_mod, only: scaled_radius @@ -50,12 +49,14 @@ module sci_compute_sample_u_ops_kernel_mod !> type, public, extends(kernel_type) :: compute_sample_u_ops_kernel_type private - type(arg_type) :: meta_args(5) = (/ & - arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & - arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & - arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, WTHETA), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & - arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) & + type(arg_type) :: meta_args(7) = (/ & + arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & + arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & + arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, WTHETA), & + arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ) & /) type(func_type) :: meta_funcs(1) = (/ & func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & @@ -89,6 +90,8 @@ module sci_compute_sample_u_ops_kernel_mod !> @param[in] chi2 Coordinates in the second direction !> @param[in] chi3 Coordinates in the third direction !> @param[in] panel_id A field giving the ID for mesh panels +!> @param[in] geometry Mesh geometry type +!> @param[in] topology Mesh topology type !> @param[in] ndf_w2b Number of DoFs per cell for broken W2 !> @param[in] ndf_w3 Number of DoFs per cell for W3 !> @param[in] ndf_wt Number of DoFs per cell for Wtheta @@ -110,6 +113,7 @@ subroutine compute_sample_u_ops_code( col, nlayers, & ncell_3d_3, u_rad_op, & chi1, chi2, chi3, & panel_id, & + geometry, topology, & ndf_w2b, ndf_w3, ndf_wt, & ndf_chi, undf_chi, map_chi, & chi_basis, chi_diff_basis, & @@ -137,6 +141,8 @@ subroutine compute_sample_u_ops_code( col, nlayers, & ! Fields real(kind=r_def), dimension(undf_pid), intent(in) :: panel_id real(kind=r_def), dimension(undf_chi), intent(in) :: chi1, chi2, chi3 + integer(kind=i_def), intent(in) :: geometry + integer(kind=i_def), intent(in) :: topology ! Operators real(kind=r_def), dimension(ncell_3d_1,ndf_w2b,ndf_w3), intent(inout) :: u_lon_op diff --git a/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf index f5fda906e..cc79bb19d 100644 --- a/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf @@ -85,6 +85,8 @@ contains @test subroutine test_all() + use base_mesh_config_mod, only : geometry_spherical, & + topology_non_periodic use matrix_vector_kernel_mod, only : matrix_vector_code use sci_average_w2b_to_w2_kernel_mod, only : average_w2b_to_w2_code use sci_compute_sample_u_ops_kernel_mod, only : compute_sample_u_ops_code @@ -275,6 +277,8 @@ contains chi_data(:,2), & chi_data(:,3), & panel_id_data, & + geometry_spherical, & + topology_non_periodic, & ndf_w2b, ndf_w3, ndf_wt, & ndf_wchi, undf_wchi, map_wchi(:,cell), & basis_wchi, diff_basis_wchi, &