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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| 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 | 2026-01-27 |
| mike-hobson | Mike Hobson | Met Office | 2025-12-17 |
| MatthewHambley | Matthew Hambley | Met Office | 2025-12-15 |
| tommbendall | Thomas Bendall | Met Office | 2026-01-23 |
Expand Down
5 changes: 4 additions & 1 deletion components/driver/source/driver_fem_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module driver_fem_mod
use mesh_mod, only: mesh_type
use mesh_collection_mod, only: mesh_collection_type

use base_mesh_config_mod, only: geometry, topology

implicit none

private
Expand Down Expand Up @@ -78,7 +80,8 @@ subroutine init_fem( mesh_collection, chi_inventory, panel_id_inventory )
! ======================================================================== !

! Initialise coordinate transformations
call init_chi_transforms(mesh_collection)
call init_chi_transforms( geometry, topology, &
mesh_collection=mesh_collection )

! To loop through mesh collection, get all mesh names
! Then get mesh from collection using these names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ module sci_compute_broken_div_operator_kernel_mod
use constants_mod, only: r_def, i_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use fs_continuity_mod, only: W2broken, W3
use finite_element_config_mod, only: rehabilitate
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system, rehabilitate
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -141,7 +144,8 @@ subroutine compute_broken_div_operator_code(cell, nlayers, ncell_3d, &
end do

! Compute Jacobian
call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)

! Run over dof extent of W2Broken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module sci_compute_curl_operator_kernel_mod
use fs_continuity_mod, only: W1, W2
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -129,7 +133,8 @@ subroutine compute_curl_operator_code(cell, nlayers, ncell_3d, &
chi2_e(df) = chi2(map_chi(df) + k)
chi3_e(df) = chi3(map_chi(df) + k)
end do
call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)
do df1 = 1, ndf_w1
do df2 = 1, ndf_w2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module sci_compute_derham_matrices_kernel_mod
use fs_continuity_mod, only: W0, W1, W2, W2broken, W3, Wtheta
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -241,7 +245,9 @@ subroutine compute_derham_matrices_code(cell, nlayers, &
do qp2 = 1, nqp_v
do qp1 = 1, nqp_h
! Precompute some frequently used terms
call pointwise_coordinate_jacobian(ndf_chi, chi1_e, chi2_e, chi3_e, &
call pointwise_coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi(:,:,qp1,qp2), &
diff_basis_chi(:,:,qp1,qp2), &
jac, dj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ module sci_compute_div_operator_kernel_mod
use constants_mod, only: r_def, i_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use fs_continuity_mod, only: W2, W3
use finite_element_config_mod, only: rehabilitate
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system, rehabilitate
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -138,7 +141,8 @@ subroutine compute_div_operator_code(cell, nlayers, ncell_3d, &
chi2_e(df) = chi2(map_chi(df) + k)
chi3_e(df) = chi3(map_chi(df) + k)
end do
call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)

do df2 = 1, ndf_w2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ module sci_compute_grad_operator_kernel_mod
use fs_continuity_mod, only: W0, W1
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -134,7 +138,8 @@ subroutine compute_grad_operator_code(cell, nlayers, ncell_3d, &
chi2_e(df) = chi2(map_chi(df) + k)
chi3_e(df) = chi3(map_chi(df) + k)
end do
call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)
call coordinate_jacobian_inverse(nqp_h, nqp_v, jac, dj, jac_inv)
do qp2 = 1, nqp_v
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ module sci_compute_mass_matrix_kernel_w1_mod
use fs_continuity_mod, only: W1
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -134,7 +138,8 @@ subroutine compute_mass_matrix_w1_code(cell, nlayers, ncell_3d, &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)
call coordinate_jacobian_inverse(nqp_h, nqp_v, jac, dj, jac_inv)
do df2 = 1, ndf_w1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ module sci_compute_mass_matrix_kernel_w2_mod
use fs_continuity_mod, only: Wchi
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -138,7 +142,8 @@ subroutine compute_mass_matrix_w2_code(cell, nlayers, ncell_3d, &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
call coordinate_jacobian(coord_system, geometry, topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jac, dj)

do df2 = 1, ndf_w2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ module sci_compute_mass_matrix_kernel_w3_mod
CELL_COLUMN, GH_QUADRATURE_XYoZ
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use constants_mod, only: i_def, r_single, r_double
use finite_element_config_mod, only: rehabilitate
use fs_continuity_mod, only: W3
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system, rehabilitate
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -138,7 +141,9 @@ subroutine compute_mass_matrix_w3_code_r_single( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, &
diff_basis_chi, jac, dj)
Expand Down Expand Up @@ -229,7 +234,9 @@ subroutine compute_mass_matrix_w3_code_mixed_precision( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, &
diff_basis_chi, jac, dj)
Expand Down Expand Up @@ -320,7 +327,9 @@ subroutine compute_mass_matrix_w3_code_r_double( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, &
diff_basis_chi, jac, dj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod
use fs_continuity_mod, only: W0, Wtheta, Wchi
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -161,7 +165,9 @@ subroutine compute_mass_matrix_w_scalar_code_r32( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, ipanel, &
basis_chi, diff_basis_chi, &
jac, dj)
Expand Down Expand Up @@ -257,7 +263,9 @@ subroutine compute_mass_matrix_w_scalar_code_r32r64( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, ipanel, &
basis_chi, diff_basis_chi, &
jac, dj)
Expand Down Expand Up @@ -356,7 +364,9 @@ subroutine compute_mass_matrix_w_scalar_code_r64( &
chi3_e(df) = chi3(map_chi(df) + k - 1)
end do

call coordinate_jacobian(ndf_chi, nqp_h, nqp_v, &
call coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, nqp_h, nqp_v, &
chi1_e, chi2_e, chi3_e, ipanel, &
basis_chi, diff_basis_chi, &
jac, dj)
Expand Down
10 changes: 9 additions & 1 deletion components/science/source/kernel/fem/sci_gp_rhs_kernel_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ subroutine gp_rhs_code(nlayers, &

use sci_coordinate_jacobian_mod, only: coordinate_jacobian

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

! Arguments
Expand Down Expand Up @@ -135,7 +139,11 @@ subroutine gp_rhs_code(nlayers, &
chi_2_cell(df) = chi_2( map_chi(df) + k )
chi_3_cell(df) = chi_3( map_chi(df) + k )
end do
call coordinate_jacobian(ndf_chi, &
call coordinate_jacobian(coord_system, &
geometry, &
topology, &
scaled_radius, &
ndf_chi, &
nqp_h, &
nqp_v, &
chi_1_cell, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ module sci_gp_vector_rhs_kernel_mod
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
use base_mesh_config_mod, only : geometry, &
geometry_spherical
use sci_chi_transform_mod, only : chi2xyz
use constants_mod, only : r_def, i_def
use sci_coordinate_jacobian_mod, only : coordinate_jacobian, &
Expand All @@ -24,6 +22,11 @@ module sci_gp_vector_rhs_kernel_mod
use fs_continuity_mod, only : W0, W2
use kernel_mod, only : kernel_type

use base_mesh_config_mod, only: geometry, topology, &
geometry_spherical
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -171,7 +174,11 @@ subroutine gp_vector_rhs_code(nlayers, &
chi_2_cell(df) = chi_2( map_chi(df) + k )
chi_3_cell(df) = chi_3( map_chi(df) + k )
end do
call coordinate_jacobian(ndf_chi, &
call coordinate_jacobian(coord_system, &
geometry, &
topology, &
scaled_radius, &
ndf_chi, &
nqp_h, &
nqp_v, &
chi_1_cell, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module sci_mg_derham_mat_kernel_mod
use fs_continuity_mod, only: W2, W3, wtheta
use kernel_mod, only: kernel_type

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

private
Expand Down Expand Up @@ -178,7 +182,9 @@ subroutine mg_derham_mat_code(cell, nlayers, &
do qp2 = 1, nqp_v
do qp1 = 1, nqp_h
! Precompute some frequently used terms
call pointwise_coordinate_jacobian(ndf_chi, chi1_e, chi2_e, chi3_e, &
call pointwise_coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi(:,:,qp1,qp2), &
diff_basis_chi(:,:,qp1,qp2), &
jac, dj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ subroutine calc_dA_at_w2_code( nlayers, &

use sci_coordinate_jacobian_mod, only: coordinate_jacobian, coordinate_jacobian_inverse

use finite_element_config_mod, only: coord_system
use base_mesh_config_mod, only: geometry, topology
use planet_config_mod, only: scaled_radius

implicit none

! Arguments
Expand Down Expand Up @@ -120,8 +124,9 @@ subroutine calc_dA_at_w2_code( nlayers, &
chi2_e(df) = chi2(map_chi(df) + k)
chi3_e(df) = chi3(map_chi(df) + k)
end do
call coordinate_jacobian(ndf_chi, ndf_w2, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jacobian, dj)
call coordinate_jacobian( coord_system, geometry, topology, scaled_radius, &
ndf_chi, ndf_w2, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi, diff_basis_chi, jacobian, dj)

call coordinate_jacobian_inverse(ndf_w2, jacobian, dj, jac_inv)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ subroutine calc_detj_at_w2_code( nlayers, &

use sci_coordinate_jacobian_mod, only: pointwise_coordinate_jacobian

use base_mesh_config_mod, only: geometry, topology
use finite_element_config_mod, only: coord_system
use planet_config_mod, only: scaled_radius

implicit none

! Arguments
Expand Down Expand Up @@ -119,7 +123,9 @@ subroutine calc_detj_at_w2_code( nlayers, &
end do

do df = 1,ndf_w2
call pointwise_coordinate_jacobian(ndf_chi, chi1_e, chi2_e, chi3_e, &
call pointwise_coordinate_jacobian(coord_system, geometry, &
topology, scaled_radius, &
ndf_chi, chi1_e, chi2_e, chi3_e, &
ipanel, basis_chi(:,:,df), &
diff_basis_chi(:,:,df), &
jacobian, detj)
Expand Down
Loading