dense_operator object.
!>
+ !> @param[in] config Application configuration object
!> @param[in] fv A field_vector of size 2
!> @param[in] chi The coordinate field
!> @param[in] panel_id The field with mesh panel IDs
!> @param[in] qr The quadrature object
!> @return self The constructed dense operator
- function dense_operator_constructor( fv, qr, chi, panel_id ) result(self)
+ function dense_operator_constructor( config, fv, qr, chi, panel_id ) result(self)
implicit none
+ type(config_type), intent(in) :: config
+
class(abstract_vector_type), intent(in) :: fv
type( field_type ), dimension(3), intent(in) :: chi
type( field_type ), intent(in) :: panel_id
@@ -87,13 +92,23 @@ contains
type(dense_operator_type) :: self
+ type(mesh_type), pointer :: mesh
+
type(function_space_type), pointer :: fs_wa => null()
type(function_space_type), pointer :: fs_wb => null()
- type(mesh_type), pointer :: mesh => null()
+
integer(kind=i_def) :: element_order_h, element_order_v, fs_label
logical(kind=l_def) :: extended_mesh
+ logical(l_def) :: rehabilitate
+ integer(i_def) :: geometry, topology, coord_system
+ real(r_def) :: scaled_radius
+
+ rehabilitate = config%finite_element%rehabilitate()
+ coord_system = config%finite_element%coord_system()
+ scaled_radius = config%planet%scaled_radius()
+
select type (fv)
type is (field_vector_type)
@@ -105,6 +120,7 @@ contains
end if
mesh => fv%vector(1)%get_mesh()
+ call get_mesh_enums(mesh, geometry, topology)
! Make the mass_w0 operator
element_order_h = fv%vector(1)%get_element_order_h()
@@ -125,8 +141,12 @@ contains
extended_mesh = .false.
call invoke( &
compute_mass_matrix_kernel_w_scalar_type(self%mass_w0, chi, panel_id, &
- extended_mesh, qr), &
- compute_mass_matrix_kernel_w3_type(self%mass_w3, chi, panel_id, qr) )
+ extended_mesh, geometry, &
+ topology, coord_system, &
+ scaled_radius, qr), &
+ compute_mass_matrix_kernel_w3_type(self%mass_w3, chi, panel_id, &
+ geometry, topology, coord_system, &
+ scaled_radius, rehabilitate, qr) )
class default
@@ -141,15 +161,19 @@ contains
!> @brief Applies the LMA mass matrices to the vector, y = M x.
!>
- !> @param[in,out] self The dense operator
- !> @param[in] x Field vector to be read, size 2
- !> @param[in,out] y Field vector to be written, size 2
- subroutine apply_dense_op(self, x, y)
+ !> @param[in] config Application configuration object
+ !> @param[in] x Field vector to be read, size 2
+ !> @param[in,out] y Field vector to be written, size 2
+ subroutine apply_dense_op(self, config, x, y)
implicit none
- class(dense_operator_type), intent(inout) :: self
- class(abstract_vector_type), intent(in) :: x
- class(abstract_vector_type), intent(inout) :: y
+
+ class(dense_operator_type), intent(inout) :: self
+
+ type(config_type), intent(in) :: config
+ class(abstract_vector_type), intent(in) :: x
+ class(abstract_vector_type), intent(inout) :: y
+
type(field_type), pointer :: x_field1 => null(), &
y_field1 => null(), &
x_field2 => null(), &
diff --git a/components/science/source/algorithm/solver/sci_diagonal_preconditioner_alg_mod.x90 b/components/science/source/algorithm/solver/sci_diagonal_preconditioner_alg_mod.x90
index a04d49a95..fcaad004e 100644
--- a/components/science/source/algorithm/solver/sci_diagonal_preconditioner_alg_mod.x90
+++ b/components/science/source/algorithm/solver/sci_diagonal_preconditioner_alg_mod.x90
@@ -7,6 +7,7 @@
!> @brief Application of the diagonal of an operator.
module sci_diagonal_preconditioner_alg_mod
+ use config_mod, only: config_type
use constants_mod, only: i_def, r_def
use field_mod, only: field_type
use log_mod, only: log_event, &
@@ -65,16 +66,18 @@ contains
!> @brief Apply diagonal preconditioner to a field to obtain \f$y=D^-1x\f$.
!>
- !> @param[in] self Instance of diagonal_preconditioner_type
- !> @param[in] x Field \f$x\f$ to apply preconditioner to
- !> @param[in,out] y Resulting field \f$y=D^-1x\f$
- subroutine apply_diagonal_preconditioner(self, x, y)
+ !> @param[in] config Application configuration object
+ !> @param[in] x Field \f$x\f$ to apply preconditioner to
+ !> @param[in,out] y Resulting field \f$y=D^-1x\f$
+ subroutine apply_diagonal_preconditioner(self, config, x, y)
implicit none
class(diagonal_preconditioner_type), intent(inout) :: self
- class(abstract_vector_type), intent(in) :: x
- class(abstract_vector_type), intent(inout) :: y
+
+ type(config_type), intent(in) :: config
+ class(abstract_vector_type), intent(in) :: x
+ class(abstract_vector_type), intent(inout) :: y
integer(kind=i_def) :: i, nfields
! Workaround for PSyclone to get pointers of the correct type for x and y
diff --git a/components/science/source/algorithm/solver/sci_hori_mass_matrix_solver_alg_mod.x90 b/components/science/source/algorithm/solver/sci_hori_mass_matrix_solver_alg_mod.x90
index 366d22313..a5a4f31b8 100644
--- a/components/science/source/algorithm/solver/sci_hori_mass_matrix_solver_alg_mod.x90
+++ b/components/science/source/algorithm/solver/sci_hori_mass_matrix_solver_alg_mod.x90
@@ -12,6 +12,7 @@
module sci_hori_mass_matrix_solver_alg_mod
! Constants and types
+ use config_mod, only: config_type
use constants_mod, only: i_def
use integer_field_mod, only: integer_field_type
use field_mod, only: field_type
@@ -35,6 +36,7 @@ contains
! =======================================================
!> @brief Mass matrix solver for only the horizontal component of a W2 field
+ !> @param[in] config Application configuration object
!> @param[in,out] field_solve The W2 solved field
!> @param[in] field The W2 field to apply the horizontal mass
!! matrix solve
@@ -42,10 +44,12 @@ contains
!! not inputted then the vertical solved
!! component is set to zero
- subroutine hori_mass_matrix_solver_alg( field_solve, field, vert_field_solve )
+ subroutine hori_mass_matrix_solver_alg( config, field_solve, field, vert_field_solve )
implicit none
+ type(config_type), intent(in) :: config
+
! Arguments
type(field_type), intent(inout) :: field_solve
type(field_type), intent(in) :: field
@@ -76,7 +80,7 @@ contains
! Take horizontal part of field
call split_w2_field_alg( hori_field, vert_field, field )
! Mass matrix solve of horizontal part
- call mass_matrix_solver_alg(hori_field_solve, hori_field)
+ call mass_matrix_solver_alg(config, hori_field_solve, hori_field)
! Convert to W2 field
if (present(vert_field_solve)) then
@@ -100,4 +104,4 @@ contains
end subroutine hori_mass_matrix_solver_alg
-end module sci_hori_mass_matrix_solver_alg_mod
\ No newline at end of file
+end module sci_hori_mass_matrix_solver_alg_mod
diff --git a/components/science/source/algorithm/solver/sci_mass_matrix_operator_alg_mod.x90 b/components/science/source/algorithm/solver/sci_mass_matrix_operator_alg_mod.x90
index 8a56ff1e0..928ea0854 100644
--- a/components/science/source/algorithm/solver/sci_mass_matrix_operator_alg_mod.x90
+++ b/components/science/source/algorithm/solver/sci_mass_matrix_operator_alg_mod.x90
@@ -9,6 +9,7 @@
!> @details Applies the appropriate mass matrix operator to a field.
module sci_mass_matrix_operator_alg_mod
+ use config_mod, only: config_type
use constants_mod, only: i_def, r_def, l_def
use field_mod, only: field_type
use log_mod, only: log_event, &
@@ -66,10 +67,10 @@ contains
!> @brief Apply mass matrix operator to a pressure field to obtain \f$y=Mx\f$.
!>
- !> @param[in,out] self Instance of mass_matrix_operator_type
- !> @param[in] x Field \f$x\f$ to apply operator to
- !> @param[in,out] y Resulting field \f$y=Mx\f$
- subroutine apply_mass_matrix_operator(self, x, y)
+ !> @param[in] config Application configuration object
+ !> @param[in] x Field \f$x\f$ to apply operator to
+ !> @param[in,out] y Resulting field \f$y=Mx\f$
+ subroutine apply_mass_matrix_operator(self, config, x, y)
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use matrix_vector_kernel_mod, only: matrix_vector_kernel_type
@@ -77,8 +78,10 @@ contains
implicit none
class(mass_matrix_operator_type), intent(inout) :: self
- class(abstract_vector_type), intent(in) :: x
- class(abstract_vector_type), intent(inout) :: y
+
+ type(config_type), intent(in) :: config
+ class(abstract_vector_type), intent(in) :: x
+ class(abstract_vector_type), intent(inout) :: y
! Workaround for PSyclone to get pointers of the correct type for x and y
type(field_type), pointer :: x_vec => null(), &
diff --git a/components/science/source/algorithm/solver/sci_mass_matrix_solver_alg_mod.x90 b/components/science/source/algorithm/solver/sci_mass_matrix_solver_alg_mod.x90
index 20c1246b8..1c1ce9a4d 100644
--- a/components/science/source/algorithm/solver/sci_mass_matrix_solver_alg_mod.x90
+++ b/components/science/source/algorithm/solver/sci_mass_matrix_solver_alg_mod.x90
@@ -14,12 +14,14 @@
!> created when needed
module sci_mass_matrix_solver_alg_mod
+ use config_mod, only: config_type
use constants_mod, only: i_def, r_def, l_def
use log_mod, only: log_event, &
log_scratch_space, &
LOG_LEVEL_DEBUG, &
LOG_LEVEL_ERROR, &
LOG_LEVEL_TRACE
+ use mesh_mod, only: mesh_type
! Derived Types
use field_mod, only: field_type
@@ -54,11 +56,13 @@ module sci_mass_matrix_solver_alg_mod
contains
!=============================================================================!
!> @details Combined initialisation, run and finalise procedure for the mass matrix solver to solve My = x
+ !> @param[in] config Application configuration object
!> @param[inout] y result field
!> @param[in] x input field
!> @param[in] bc_flag optional flag to overide the default application of
!> boundary conditions
- subroutine mass_matrix_solver_alg(y, x, bc_flag)
+ subroutine mass_matrix_solver_alg(config, y, x, bc_flag)
+
use solver_config_mod, only: maximum_iterations, &
tolerance, &
method, &
@@ -91,9 +95,12 @@ contains
only: operator_tri_solve_kernel_type
implicit none
+ type(config_type), intent(in) :: config
+
! Prognostic fields
- type( field_type), intent(inout) :: y
- type( field_type), intent(in) :: x
+ type( field_type), intent(inout) :: y
+ type( field_type), intent(in) :: x
+
! Optional flag to overide default boundary condition application
logical(kind=l_def), optional, intent(in) :: bc_flag
@@ -111,7 +118,9 @@ contains
integer(kind=i_def) :: fs
logical(kind=l_def) :: apply_bc
logical(kind=l_def) :: lowest_order
- integer(kind=i_def) :: mesh_id
+
+ type(mesh_type), pointer :: mesh
+
type(operator_type), pointer :: mass_matrix => null()
type(field_type), pointer :: mass_matrix_diagonal => null()
type(field_vector_type) :: vec_mm_diagonal
@@ -121,7 +130,7 @@ contains
if ( LPROF ) call start_timing( id, 'mass_matrix_solver_alg' )
- mesh_id = y%get_mesh_id()
+ mesh => y%get_mesh()
lowest_order = x%get_element_order_h() == 0 .and. &
x%get_element_order_v() == 0
@@ -131,14 +140,14 @@ contains
! Direct solve for fully discontinuous spaces
!> todo this needs to be extended to all DG spaces
if ( lowest_order ) then
- mass_matrix => get_inverse_mass_matrix_fv(fs, mesh_id)
+ mass_matrix => get_inverse_mass_matrix_fv(config, mesh, fs)
else
- mass_matrix => get_inverse_mass_matrix_fe(fs, mesh_id)
+ mass_matrix => get_inverse_mass_matrix_fe(config, mesh, fs)
end if
call invoke( dg_matrix_vector_kernel_type(y, x, mass_matrix) )
else if ( fs == Wtheta .and. lowest_order ) then
- mass_matrix => get_mass_matrix_fv(fs, mesh_id)
+ mass_matrix => get_mass_matrix_fv(config, mesh, fs)
call invoke( operator_tri_solve_kernel_type(y, x, mass_matrix) )
else
! Iterative solve for (semi-)continuous spaces
@@ -192,12 +201,12 @@ contains
if ( lowest_order ) then
! Use mass matrix operator for FV spaces
- mass_matrix => get_mass_matrix_fv(fs, mesh_id)
- mass_matrix_diagonal => get_mass_matrix_diagonal_fv(fs, mesh_id)
+ mass_matrix => get_mass_matrix_fv(config, mesh, fs)
+ mass_matrix_diagonal => get_mass_matrix_diagonal_fv(config, mesh, fs)
else
! Use mass matrix operator for higher order spaces
- mass_matrix => get_mass_matrix_fe(fs, mesh_id)
- mass_matrix_diagonal => get_mass_matrix_diagonal_fe(fs, mesh_id)
+ mass_matrix => get_mass_matrix_fe(config, mesh, fs)
+ mass_matrix_diagonal => get_mass_matrix_diagonal_fe(config, mesh, fs)
end if
select case ( fs )
@@ -307,7 +316,7 @@ contains
vec_y = field_vector_type(1)
call vec_x%import_field(x, 1)
call vec_y%import_field(y, 1)
- call mass_matrix_solver%apply(vec_y, vec_x)
+ call mass_matrix_solver%apply(config, vec_y, vec_x)
call vec_y%export_field(y, 1)
end if ! direct or iterative solve
diff --git a/components/science/source/algorithm/solver/sci_null_preconditioner_alg_mod.x90 b/components/science/source/algorithm/solver/sci_null_preconditioner_alg_mod.x90
index c229fff55..e2e9b6321 100644
--- a/components/science/source/algorithm/solver/sci_null_preconditioner_alg_mod.x90
+++ b/components/science/source/algorithm/solver/sci_null_preconditioner_alg_mod.x90
@@ -11,6 +11,7 @@
module sci_null_preconditioner_alg_mod
+ use config_mod, only : config_type
use constants_mod, only : i_def, r_def
use log_mod, only : log_event, &
LOG_LEVEL_INFO, &
@@ -67,15 +68,18 @@ contains
!>
!>@details Apply the trivial (null) preconditioner by setting \f$y=x\f$
!>
- !>@param[inout] self instance of type null_preconditioner_type
- !>@param[inout] x field-vector containing the right hand side of the pressure
- !>@param[inout] y field-vector containing the solution
- subroutine apply_null_preconditioner(self, x, y)
+ !>@param[in] config Application configuration object
+ !>@param[inout] x field-vector containing the right hand side of the pressure
+ !>@param[inout] y field-vector containing the solution
+ subroutine apply_null_preconditioner(self, config, x, y)
implicit none
+
class(null_preconditioner_type), intent(inout) :: self
- class(abstract_vector_type), intent(in) :: x
- class(abstract_vector_type), intent(inout) :: y
+
+ type(config_type), intent(in) :: config
+ class(abstract_vector_type), intent(in) :: x
+ class(abstract_vector_type), intent(inout) :: y
select type(x)
type is(field_vector_type)
diff --git a/components/science/source/kernel/fem/sci_compute_broken_div_operator_kernel_mod.F90 b/components/science/source/kernel/fem/sci_compute_broken_div_operator_kernel_mod.F90
index 3d00ff143..f09402ef7 100644
--- a/components/science/source/kernel/fem/sci_compute_broken_div_operator_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_broken_div_operator_kernel_mod.F90
@@ -7,21 +7,19 @@
module sci_compute_broken_div_operator_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_1, &
+ GH_REAL, GH_INTEGER, &
+ GH_LOGICAL, ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
- use constants_mod, only: r_def, i_def
+ use constants_mod, only: r_def, i_def, l_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use fs_continuity_mod, only: W2broken, 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
@@ -32,10 +30,15 @@ module sci_compute_broken_div_operator_kernel_mod
type, public, extends(kernel_type) :: compute_broken_div_operator_kernel_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2broken), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(8) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2broken), & ! broken_div
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! scaled_radius
+ arg_type(GH_SCALAR, GH_LOGICAL, GH_READ) & ! rehabilitate
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(W3, GH_BASIS), &
@@ -64,6 +67,11 @@ module sci_compute_broken_div_operator_kernel_mod
!! @param[in] chi2 2nd coordinate field in Wchi
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels.
+ !! @param[in] geometry Mesh geometry enumeration
+ !! @param[in] topology Mesh topology enumeration
+ !! @param[in] coord_system Finite-element coordinate system enumeration
+ !! @param[in] scaled_radius Scaled planet radius
+ !! @param[in] rehabilitate Apply rehabilitation
!! @param[in] ndf_w3 Number of degrees of freedom per cell for W3 space.
!! @param[in] basis_w3 Scalar basis functions evaluated at quadrature points
!! for W3 space.
@@ -89,6 +97,9 @@ module sci_compute_broken_div_operator_kernel_mod
subroutine compute_broken_div_operator_code(cell, nlayers, ncell_3d, &
broken_div, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ rehabilitate, &
ndf_w3, basis_w3, &
ndf_w2b, diff_basis_w2b, &
ndf_chi, undf_chi, map_chi, &
@@ -122,6 +133,12 @@ subroutine compute_broken_div_operator_code(cell, nlayers, ncell_3d, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+ logical(kind=l_def), intent(in) :: rehabilitate
+
! Internal variables
integer(kind=i_def) :: df, df2, df3, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_curl_operator_kernel_mod.F90 b/components/science/source/kernel/fem/sci_compute_curl_operator_kernel_mod.F90
index ddcb67d05..b504249fd 100644
--- a/components/science/source/kernel/fem/sci_compute_curl_operator_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_curl_operator_kernel_mod.F90
@@ -6,21 +6,20 @@
module sci_compute_curl_operator_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_1, &
+ GH_REAL, GH_INTEGER, &
+ ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
+
use constants_mod, only: r_def, i_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
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
@@ -31,10 +30,14 @@ module sci_compute_curl_operator_kernel_mod
type, public, extends(kernel_type) :: compute_curl_operator_kernel_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W1), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), &
- 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, W2, W1), & ! curl
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(W2, GH_BASIS), &
@@ -63,6 +66,10 @@ module sci_compute_curl_operator_kernel_mod
!! @param[in] chi2 2nd component of coordinate field
!! @param[in] chi3 3rd component of coordinate field
!! @param[in] panel_id A field giving the ID for mesh panels.
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w2 Number of degrees of freedom per cell for W2.
!! @param[in] basis_w2 W2 vector basis functions evaluated at quadrature points.
!! @param[in] ndf_w1 Number of degrees of freedom per cell for W1.
@@ -83,6 +90,8 @@ module sci_compute_curl_operator_kernel_mod
subroutine compute_curl_operator_code(cell, nlayers, ncell_3d, &
curl, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w2, basis_w2, &
ndf_w1, diff_basis_w1, &
ndf_chi, undf_chi, map_chi, &
@@ -115,6 +124,11 @@ subroutine compute_curl_operator_code(cell, nlayers, ncell_3d, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df1, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_derham_matrices_kernel_mod.F90 b/components/science/source/kernel/fem/sci_compute_derham_matrices_kernel_mod.F90
index dcbf2607b..45ada61c4 100644
--- a/components/science/source/kernel/fem/sci_compute_derham_matrices_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_derham_matrices_kernel_mod.F90
@@ -16,9 +16,11 @@
module sci_compute_derham_matrices_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
- GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_9, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
+ GH_READ, GH_WRITE, &
+ GH_REAL, GH_INTEGER, &
+ ANY_SPACE_9, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
@@ -28,10 +30,6 @@ 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
@@ -42,19 +40,23 @@ module sci_compute_derham_matrices_kernel_mod
type, public, extends(kernel_type) :: compute_derham_matrices_kernel_type
private
- type(arg_type) :: meta_args(12) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W0, W0), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W1), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W2), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W2broken), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, Wtheta), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W0), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W1), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2broken), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(16) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W0, W0), & ! mm0
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W1), & ! mm1
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W2), & ! mm2
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W2broken), & ! mm2b
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), & ! mm3
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, Wtheta), & ! mmt
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W0), & ! grad
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W1), & ! curl
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), & ! div
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2broken), & ! broken_div
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(7) = (/ &
func_type(W0, GH_BASIS, GH_DIFF_BASIS), &
@@ -105,6 +107,11 @@ module sci_compute_derham_matrices_kernel_mod
!! @param[in] chi2 Physical coordinates in the 2nd dir.
!! @param[in] chi3 Physical coordinates in the 3rd dir.
!! @param[in] panel_id Field giving the ID for mesh panels.
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
+!! @param[in] rehabilitate Apply rehabilitation
!! @param[in] ndf_w0 Number of degrees of freedom per cell for W0 space.
!! @param[in] basis_w0 Basis functions evaluated at quadrature points for W0 space.
!! @param[in] diff_basis_w0 Differential of basis functions evaluated at quadrature points for W0 space.
@@ -148,6 +155,8 @@ subroutine compute_derham_matrices_code(cell, nlayers, &
ncell_3d7, broken_div, &
chi1, chi2, chi3, &
panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w0, basis_w0, diff_basis_w0, &
ndf_w1, basis_w1, diff_basis_w1, &
ndf_w2, basis_w2, diff_basis_w2, &
@@ -205,6 +214,11 @@ subroutine compute_derham_matrices_code(cell, nlayers, &
real(kind=r_def), intent(in) :: wqp_h(nqp_h)
real(kind=r_def), intent(in) :: wqp_v(nqp_v)
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, ik
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_div_operator_kernel_mod.F90 b/components/science/source/kernel/fem/sci_compute_div_operator_kernel_mod.F90
index 05b84b344..93eec65a7 100644
--- a/components/science/source/kernel/fem/sci_compute_div_operator_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_div_operator_kernel_mod.F90
@@ -6,21 +6,19 @@
module sci_compute_div_operator_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_1, &
+ GH_REAL, GH_INTEGER, &
+ GH_LOGICAL, ANY_SPACE_1, &
GH_BASIS, GH_DIFF_BASIS, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_QUADRATURE_XYoZ, CELL_COLUMN
- use constants_mod, only: r_def, i_def
+ use constants_mod, only: r_def, i_def, l_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use fs_continuity_mod, only: W2, 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
@@ -31,10 +29,16 @@ module sci_compute_div_operator_kernel_mod
type, public, extends(kernel_type) :: compute_div_operator_kernel_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(8) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), & ! div
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! scaled_radius
+ arg_type(GH_SCALAR, GH_LOGICAL, GH_READ) & ! rehabilitate
+
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(W3, GH_BASIS), &
@@ -63,6 +67,11 @@ module sci_compute_div_operator_kernel_mod
!! @param[in] chi_2 2nd coordinate field in Wchi
!! @param[in] chi_3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels.
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
+!! @param[in] rehabilitate Apply rehabilitation
!! @param[in] ndf_w3 Number of degrees of freedom per cell.
!! @param[in] basis_w3 Scalar basis functions
!! evaluated at quadrature points.
@@ -87,6 +96,9 @@ subroutine compute_div_operator_code(cell, nlayers, ncell_3d, &
div, &
chi1, chi2, chi3, &
panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ rehabilitate, &
ndf_w3, &
basis_w3, &
ndf_w2, diff_basis_w2, &
@@ -124,6 +136,12 @@ subroutine compute_div_operator_code(cell, nlayers, ncell_3d, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+ logical(kind=l_def), intent(in) :: rehabilitate
+
! Internal variables
integer(kind=i_def) :: df, df2, df3, k, ik
integer(kind=i_def) :: qp1, qp2, ipanel
diff --git a/components/science/source/kernel/fem/sci_compute_grad_operator_kernel_mod.F90 b/components/science/source/kernel/fem/sci_compute_grad_operator_kernel_mod.F90
index 9c06d929f..2006ebc4a 100644
--- a/components/science/source/kernel/fem/sci_compute_grad_operator_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_grad_operator_kernel_mod.F90
@@ -6,9 +6,11 @@
module sci_compute_grad_operator_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_1, &
+ GH_REAL, GH_INTEGER, &
+ ANY_SPACE_1, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
@@ -19,10 +21,6 @@ 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
@@ -33,10 +31,14 @@ module sci_compute_grad_operator_kernel_mod
type, public, extends(kernel_type) :: compute_grad_operator_kernel_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W0), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), &
- 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, W1, W0), & ! grad
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_1), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(W1, GH_BASIS), &
@@ -65,6 +67,10 @@ module sci_compute_grad_operator_kernel_mod
!! @param[in] chi2 2nd coordinate field in Wchi
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w1 Number of degrees of freedom per cell
!! @param[in] basis_w1 Vector basis functions
!! evaluated at quadrature points
@@ -85,14 +91,16 @@ module sci_compute_grad_operator_kernel_mod
!! @param[in] nqp_v Number of vertical quadrature points
!! @param[in] wqp_h Horizontal quadrature weights
!! @param[in] wqp_v Vertical quadrature weights
-subroutine compute_grad_operator_code(cell, nlayers, ncell_3d, &
- grad, &
- chi1, chi2, chi3, panel_id, &
- ndf_w1, basis_w1, &
- ndf_w0, diff_basis_w0, &
- ndf_chi, undf_chi, map_chi, &
- basis_chi, diff_basis_chi, &
- ndf_pid, undf_pid, map_pid, &
+subroutine compute_grad_operator_code(cell, nlayers, ncell_3d, &
+ grad, &
+ chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ ndf_w1, basis_w1, &
+ ndf_w0, diff_basis_w0, &
+ ndf_chi, undf_chi, map_chi, &
+ basis_chi, diff_basis_chi, &
+ ndf_pid, undf_pid, map_pid, &
nqp_h, nqp_v, wqp_h, wqp_v )
implicit none
@@ -120,6 +128,11 @@ subroutine compute_grad_operator_code(cell, nlayers, ncell_3d, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df0, df1, k, ik
integer(kind=i_def) :: qp1, qp2, ipanel
diff --git a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w1_mod.F90 b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w1_mod.F90
index b0beabbbb..045c228fd 100644
--- a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w1_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w1_mod.F90
@@ -11,22 +11,21 @@
module sci_compute_mass_matrix_kernel_w1_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_9, &
+ GH_REAL, GH_INTEGER, &
+ ANY_SPACE_9, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
+
use sci_coordinate_jacobian_mod, only: coordinate_jacobian, &
coordinate_jacobian_inverse
use constants_mod, only: r_def, i_def
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
@@ -37,10 +36,14 @@ module sci_compute_mass_matrix_kernel_w1_mod
type, public, extends(kernel_type) :: compute_mass_matrix_kernel_w1_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, W1), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- 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, W1, W1), & ! mm
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(2) = (/ &
func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS), &
@@ -68,6 +71,10 @@ module sci_compute_mass_matrix_kernel_w1_mod
!! @param[in] chi2 2nd coordinate field in Wchi
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w1 Number of degrees of freedom per cell
!! @param[in] basis_w1 Vector basis functions evaluated at quadrature points
!! @param[in] ndf_chi Number of degrees of freedom per cell for chi field
@@ -88,6 +95,8 @@ module sci_compute_mass_matrix_kernel_w1_mod
subroutine compute_mass_matrix_w1_code(cell, nlayers, ncell_3d, &
mm, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w1, basis_w1, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -116,6 +125,11 @@ subroutine compute_mass_matrix_w1_code(cell, nlayers, ncell_3d, &
real(kind=r_def), intent(in) :: wqp_h(nqp_h)
real(kind=r_def), intent(in) :: wqp_v(nqp_v)
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w2_mod.F90 b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w2_mod.F90
index f1ebbcaae..a97369886 100644
--- a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w2_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w2_mod.F90
@@ -10,22 +10,19 @@
!>
module sci_compute_mass_matrix_kernel_w2_mod
- use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
- GH_READ, GH_WRITE, &
- GH_REAL, ANY_W2, &
- ANY_DISCONTINUOUS_SPACE_3, &
- ANY_SPACE_9, &
- GH_BASIS, GH_DIFF_BASIS, &
+ use argument_mod, only: arg_type, func_type, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
+ GH_READ, GH_WRITE, &
+ GH_REAL, GH_INTEGER, ANY_W2, &
+ ANY_DISCONTINUOUS_SPACE_3, &
+ ANY_SPACE_9, &
+ GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
use constants_mod, only: i_def, r_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
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
@@ -36,10 +33,14 @@ module sci_compute_mass_matrix_kernel_w2_mod
type, public, extends(kernel_type) :: compute_mass_matrix_kernel_w2_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, ANY_W2, ANY_W2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- 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, ANY_W2, ANY_W2), & ! mm
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(2) = (/ &
func_type(ANY_W2, GH_BASIS), &
@@ -68,6 +69,10 @@ module sci_compute_mass_matrix_kernel_w2_mod
!! @param[in] chi2 2nd coordinate field in Wchi
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w2 Degrees of freedom per cell
!! @param[in] basis_w2 Vector basis functions evaluated at quadrature points
!! @param[in] ndf_chi Degrees of freedom per cell for chi field
@@ -88,6 +93,8 @@ subroutine compute_mass_matrix_w2_code(cell, nlayers, ncell_3d, &
mm, &
chi1, chi2, chi3, &
panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w2, basis_w2, &
ndf_chi, undf_chi, map_chi, &
basis_chi, &
@@ -120,6 +127,11 @@ subroutine compute_mass_matrix_w2_code(cell, nlayers, ncell_3d, &
real(kind=r_def), intent(in) :: wqp_h(nqp_h)
real(kind=r_def), intent(in) :: wqp_v(nqp_v)
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w3_mod.F90 b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w3_mod.F90
index ac030d6be..27590f8bc 100644
--- a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w3_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w3_mod.F90
@@ -9,21 +9,19 @@
!>
module sci_compute_mass_matrix_kernel_w3_mod
- use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
- GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_9, &
- ANY_DISCONTINUOUS_SPACE_3, &
- GH_BASIS, GH_DIFF_BASIS, &
- CELL_COLUMN, GH_QUADRATURE_XYoZ
+ use argument_mod, only: arg_type, func_type, &
+ GH_OPERATOR, GH_FIELD, GH_SCALAR, &
+ GH_READ, GH_WRITE, &
+ GH_REAL, GH_INTEGER, GH_LOGICAL, &
+ ANY_SPACE_9, &
+ ANY_DISCONTINUOUS_SPACE_3, &
+ GH_BASIS, GH_DIFF_BASIS, &
+ CELL_COLUMN, GH_QUADRATURE_XYoZ
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
- use constants_mod, only: i_def, r_single, r_double
- 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
+ use constants_mod, only: i_def, r_def, l_def, &
+ r_single, r_double
+ use fs_continuity_mod, only: W3
+ use kernel_mod, only: kernel_type
implicit none
@@ -34,10 +32,15 @@ module sci_compute_mass_matrix_kernel_w3_mod
!---------------------------------------------------------------------------
type, public, extends(kernel_type) :: compute_mass_matrix_kernel_w3_type
private
- type(arg_type) :: meta_args(3) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(8) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), & ! mm
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! scaled_radius
+ arg_type(GH_SCALAR, GH_LOGICAL, GH_READ) & ! rehabilitate
/)
type(func_type) :: meta_funcs(2) = (/ &
func_type(W3, GH_BASIS), &
@@ -70,6 +73,11 @@ module sci_compute_mass_matrix_kernel_w3_mod
!! @param[in] chi2 2nd coordinate field in Wchi
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels
+ !! @param[in] geometry Mesh geometry enumeration
+ !! @param[in] topology Mesh topology enumeration
+ !! @param[in] coord_system Finite-element coordinate system enumeration
+ !! @param[in] scaled_radius Scaled planet radius
+ !! @param[in] rehabilitate Apply rehabilitation
!! @param[in] ndf_w3 Number of degrees of freedom per cell for the operator space
!! @param[in] basis_w3 Scalar basis functions evaluated at quadrature points
!! @param[in] ndf_chi Number of degrees of freedom per cell for the coordinate field
@@ -88,9 +96,12 @@ module sci_compute_mass_matrix_kernel_w3_mod
! R_SINGLE PRECISION
! ==================
- subroutine compute_mass_matrix_w3_code_r_single( &
+ subroutine compute_mass_matrix_w3_code_r_single( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ rehabilitate, &
ndf_w3, basis_w3, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -120,6 +131,12 @@ subroutine compute_mass_matrix_w3_code_r_single( &
real(kind=r_single), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_single), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+ logical(kind=l_def), intent(in) :: rehabilitate
+
!Internal variables
integer(kind=i_def) :: df, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
@@ -184,6 +201,9 @@ end subroutine compute_mass_matrix_w3_code_r_single
subroutine compute_mass_matrix_w3_code_mixed_precision( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ rehabilitate, &
ndf_w3, basis_w3, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -213,6 +233,12 @@ subroutine compute_mass_matrix_w3_code_mixed_precision( &
real(kind=r_double), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_double), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+ logical, intent(in) :: rehabilitate
+
!Internal variables
integer(kind=i_def) :: df, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
@@ -277,6 +303,9 @@ end subroutine compute_mass_matrix_w3_code_mixed_precision
subroutine compute_mass_matrix_w3_code_r_double( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
+ rehabilitate, &
ndf_w3, basis_w3, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -306,6 +335,12 @@ subroutine compute_mass_matrix_w3_code_r_double( &
real(kind=r_double), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_double), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+ logical, intent(in) :: rehabilitate
+
!Internal variables
integer(kind=i_def) :: df, df2, k, ik, ipanel
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w_scalar_mod.F90 b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w_scalar_mod.F90
index 346ab1731..e020abafd 100644
--- a/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w_scalar_mod.F90
+++ b/components/science/source/kernel/fem/sci_compute_mass_matrix_kernel_w_scalar_mod.F90
@@ -15,20 +15,16 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod
GH_OPERATOR, GH_FIELD, &
GH_LOGICAL, GH_SCALAR, &
GH_READ, GH_WRITE, &
- GH_REAL, ANY_SPACE_2, &
- ANY_SPACE_9, &
+ GH_REAL, GH_INTEGER, &
+ ANY_SPACE_2, ANY_SPACE_9, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
- use constants_mod, only: i_def, r_single, r_double, l_def
+ use constants_mod, only: i_def, r_def, r_single, r_double, l_def
use sci_coordinate_jacobian_mod, only: coordinate_jacobian
use fs_continuity_mod, only: W0, 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
@@ -38,11 +34,15 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod
!---------------------------------------------------------------------------
type, public, extends(kernel_type) :: compute_mass_matrix_kernel_w_scalar_type
private
- type(arg_type) :: meta_args(4) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, ANY_SPACE_2, ANY_SPACE_2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), &
- arg_type(GH_SCALAR, GH_LOGICAL, GH_READ) &
+ type(arg_type) :: meta_args(8) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, ANY_SPACE_2, ANY_SPACE_2), & ! mm
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_LOGICAL, GH_READ), & ! extended_mesh
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(2) = (/ &
func_type(ANY_SPACE_2, GH_BASIS), &
@@ -76,6 +76,10 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod
!! @param[in] chi3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels.
!! @param[in] extended_mesh Compute on an extended mesh
+ !! @param[in] geometry Mesh geometry enumeration
+ !! @param[in] topology Mesh topology enumeration
+ !! @param[in] coord_system Finite-element coordinate system enumeration
+ !! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w_scalar The number of degrees of freedom per cell for w_scalar.
!! @param[in] ndf_chi The number of degrees of freedom per cell for chi.
!! @param[in] basis_w_scalar 4-dim array holding SCALAR basis functions evaluated at
@@ -101,6 +105,8 @@ subroutine compute_mass_matrix_w_scalar_code_r32( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
extended_mesh, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w_scalar, basis_w_scalar, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -121,6 +127,11 @@ subroutine compute_mass_matrix_w_scalar_code_r32( &
logical(kind=l_def), intent(in) :: extended_mesh
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
real(kind=r_single), dimension(ncell_3d,ndf_w_scalar,ndf_w_scalar), &
intent(inout) :: mm
@@ -201,6 +212,8 @@ subroutine compute_mass_matrix_w_scalar_code_r32r64( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
extended_mesh, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w_scalar, basis_w_scalar, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -221,6 +234,11 @@ subroutine compute_mass_matrix_w_scalar_code_r32r64( &
logical(kind=l_def), intent(in) :: extended_mesh
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
real(kind=r_single), dimension(ncell_3d,ndf_w_scalar,ndf_w_scalar), &
intent(inout) :: mm
@@ -300,6 +318,8 @@ subroutine compute_mass_matrix_w_scalar_code_r64( &
cell, nlayers, ncell_3d, mm, &
chi1, chi2, chi3, panel_id, &
extended_mesh, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w_scalar, basis_w_scalar, &
ndf_chi, undf_chi, map_chi, &
basis_chi, diff_basis_chi, &
@@ -320,6 +340,11 @@ subroutine compute_mass_matrix_w_scalar_code_r64( &
logical(kind=l_def), intent(in) :: extended_mesh
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
real(kind=r_double), dimension(ncell_3d,ndf_w_scalar,ndf_w_scalar), &
intent(inout) :: mm
diff --git a/components/science/source/kernel/fem/sci_gp_rhs_kernel_mod.F90 b/components/science/source/kernel/fem/sci_gp_rhs_kernel_mod.F90
index ca6d73d1e..9323af616 100644
--- a/components/science/source/kernel/fem/sci_gp_rhs_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_gp_rhs_kernel_mod.F90
@@ -7,14 +7,16 @@
!> @brief Kernel which projects a field into into a given space
module sci_gp_rhs_kernel_mod
+
use kernel_mod, only : kernel_type
use constants_mod, only : r_def, i_def
-use argument_mod, only : arg_type, func_type, &
- GH_FIELD, GH_REAL, GH_INC, &
- GH_READ, ANY_SPACE_9, &
- ANY_SPACE_1, ANY_SPACE_2, &
- ANY_DISCONTINUOUS_SPACE_3, &
- GH_BASIS, GH_DIFF_BASIS, &
+use argument_mod, only : arg_type, func_type, &
+ GH_FIELD, GH_SCALAR, &
+ GH_REAL, GH_INTEGER, &
+ GH_INC, GH_READ, ANY_SPACE_9, &
+ ANY_SPACE_1, ANY_SPACE_2, &
+ ANY_DISCONTINUOUS_SPACE_3, &
+ GH_BASIS, GH_DIFF_BASIS, &
CELL_COLUMN, GH_QUADRATURE_XYoZ
implicit none
@@ -27,11 +29,15 @@ module sci_gp_rhs_kernel_mod
!> The type declaration for the kernel. Contains the metadata needed by the Psy layer
type, public, extends(kernel_type) :: gp_rhs_kernel_type
private
- type(arg_type) :: meta_args(4) = (/ &
- arg_type(GH_FIELD, GH_REAL, GH_INC, ANY_SPACE_1), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(8) = (/ &
+ arg_type(GH_FIELD, GH_REAL, GH_INC, ANY_SPACE_1), & ! rhs
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_2), & ! field
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(ANY_SPACE_1, GH_BASIS), &
@@ -63,6 +69,10 @@ module sci_gp_rhs_kernel_mod
!! @param[in] chi_2 2nd coordinate field in Wchi
!! @param[in] chi_3 3rd coordinate field in Wchi
!! @param[in] panel_id Field giving the ID for mesh panels
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf Number of degrees of freedom per cell
!! @param[in] undf Number of (local) unique degrees of freedom of the field rhs
!! @param[in] map Dofmap for the cell at the base of the column
@@ -87,6 +97,8 @@ module sci_gp_rhs_kernel_mod
subroutine gp_rhs_code(nlayers, &
rhs, field, &
chi_1, chi_2, chi_3, panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf, undf, map, basis, &
ndf_f, undf_f, map_f, f_basis, &
ndf_chi, undf_chi, map_chi, &
@@ -96,10 +108,6 @@ 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
@@ -124,6 +132,11 @@ subroutine gp_rhs_code(nlayers, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, qp1, qp2, ipanel
real(kind=r_def), dimension(nqp_h,nqp_v) :: dj
diff --git a/components/science/source/kernel/fem/sci_gp_vector_rhs_kernel_mod.F90 b/components/science/source/kernel/fem/sci_gp_vector_rhs_kernel_mod.F90
index 38a827c21..2b31d7d64 100644
--- a/components/science/source/kernel/fem/sci_gp_vector_rhs_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_gp_vector_rhs_kernel_mod.F90
@@ -8,8 +8,10 @@
module sci_gp_vector_rhs_kernel_mod
use argument_mod, only : arg_type, func_type, &
- GH_FIELD, GH_REAL, GH_INC, &
- GH_READ, ANY_SPACE_1, &
+ GH_FIELD, GH_SCALAR, &
+ GH_REAL, GH_INTEGER, &
+ GH_INC, GH_READ, &
+ ANY_SPACE_1, &
ANY_SPACE_2, ANY_SPACE_9, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
@@ -21,11 +23,7 @@ module sci_gp_vector_rhs_kernel_mod
use coord_transform_mod, only : cart2sphere_vector
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
+ use sci_mesh_enums_mod, only : geometry_spherical
implicit none
@@ -39,12 +37,16 @@ module sci_gp_vector_rhs_kernel_mod
!>
type, public, extends(kernel_type) :: gp_vector_rhs_kernel_type
private
- type(arg_type) :: meta_args(5) = (/ &
- arg_type(GH_FIELD*3, GH_REAL, GH_INC, ANY_SPACE_1), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, W2) &
+ type(arg_type) :: meta_args(9) = (/ &
+ arg_type(GH_FIELD*3, GH_REAL, GH_INC, ANY_SPACE_1), & ! rhs1, rhs2, rhs3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_2), & ! field
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! w2_field
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(3) = (/ &
func_type(ANY_SPACE_1, GH_BASIS), &
@@ -82,6 +84,10 @@ module sci_gp_vector_rhs_kernel_mod
!! @param[in] chi_3 3rd coordinate field
!! @param[in] panel_id Field giving the ID for mesh panels.
!! @param[in] w2_field W2_field needed to get function space components
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf Number of degrees of freedom per cell
!! @param[in] undf Number of degrees of freedom
!! @param[in] map Dofmap for the cell at the base of the column
@@ -111,6 +117,8 @@ subroutine gp_vector_rhs_code(nlayers, &
rhs1, rhs2, rhs3, field, &
chi_1, chi_2, chi_3, &
panel_id, w2_field, &
+ geometry, topology, coord_system, &
+ scaled_radius, &
ndf, undf, map, basis, &
ndf_f, undf_f, map_f, f_basis, &
ndf_chi, undf_chi, &
@@ -149,6 +157,11 @@ subroutine gp_vector_rhs_code(nlayers, &
real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h
real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, qp1, qp2
real(kind=r_def), dimension(nqp_h,nqp_v) :: dj
diff --git a/components/science/source/kernel/fem/sci_mg_derham_mat_kernel_mod.F90 b/components/science/source/kernel/fem/sci_mg_derham_mat_kernel_mod.F90
index 04329bd5b..3143289f2 100644
--- a/components/science/source/kernel/fem/sci_mg_derham_mat_kernel_mod.F90
+++ b/components/science/source/kernel/fem/sci_mg_derham_mat_kernel_mod.F90
@@ -15,8 +15,10 @@
module sci_mg_derham_mat_kernel_mod
use argument_mod, only: arg_type, func_type, &
- GH_OPERATOR, GH_FIELD, &
- GH_REAL, GH_READ, GH_WRITE, &
+ GH_OPERATOR, &
+ GH_FIELD, GH_SCALAR, &
+ GH_REAL, GH_INTEGER, &
+ GH_READ, GH_WRITE, &
ANY_SPACE_1, ANY_SPACE_9, &
ANY_DISCONTINUOUS_SPACE_3, &
GH_BASIS, GH_DIFF_BASIS, &
@@ -27,10 +29,6 @@ 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
@@ -41,13 +39,17 @@ module sci_mg_derham_mat_kernel_mod
type, public, extends(kernel_type) :: mg_derham_mat_kernel_type
private
- type(arg_type) :: meta_args(6) = (/ &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W2), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, Wtheta), &
- arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), &
- arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), &
- arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) &
+ type(arg_type) :: meta_args(10) = (/ &
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W2), & ! mm2
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W3), & ! mm3
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, Wtheta), & ! mmt
+ arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), & ! div
+ arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & ! chi1, chi2, chi3
+ arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & ! panel_id
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! geometry
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! topology
+ arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & ! coord_system
+ arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! scaled_radius
/)
type(func_type) :: meta_funcs(4) = (/ &
func_type(W2, GH_BASIS, GH_DIFF_BASIS), &
@@ -83,6 +85,10 @@ module sci_mg_derham_mat_kernel_mod
!! @param[in] chi2 Physical coordinates in the 2nd dir
!! @param[in] chi3 Physical coordinates in the 3rd dir
!! @param[in] panel_id Field giving the ID for mesh panels
+!! @param[in] geometry Mesh geometry enumeration
+!! @param[in] topology Mesh topology enumeration
+!! @param[in] coord_system Finite-element coordinate system enumeration
+!! @param[in] scaled_radius Scaled planet radius
!! @param[in] ndf_w2 Number of degrees of freedom per cell for W2 space
!! @param[in] basis_w2 Basis functions evaluated at quadrature points for W2 space
!! @param[in] diff_basis_w2 Differential of basis functions evaluated at
@@ -112,6 +118,8 @@ subroutine mg_derham_mat_code(cell, nlayers, &
ncell_3d6, div, &
chi1, chi2, chi3, &
panel_id, &
+ geometry, topology, &
+ coord_system, scaled_radius, &
ndf_w2, basis_w2, diff_basis_w2, &
ndf_w3, basis_w3, &
ndf_wt, basis_wt, &
@@ -149,6 +157,11 @@ subroutine mg_derham_mat_code(cell, nlayers, &
real(kind=r_def), intent(in) :: wqp_h(nqp_h)
real(kind=r_def), intent(in) :: wqp_v(nqp_v)
+ integer(kind=i_def), intent(in) :: geometry
+ integer(kind=i_def), intent(in) :: topology
+ integer(kind=i_def), intent(in) :: coord_system
+ real(kind=r_def), intent(in) :: scaled_radius
+
! Internal variables
integer(kind=i_def) :: df, df2, k, ik
integer(kind=i_def) :: qp1, qp2
diff --git a/components/science/source/kernel/geometry/sci_chi_transform_mod.F90 b/components/science/source/kernel/geometry/sci_chi_transform_mod.F90
index 22e5bd04b..caad47efb 100644
--- a/components/science/source/kernel/geometry/sci_chi_transform_mod.F90
+++ b/components/science/source/kernel/geometry/sci_chi_transform_mod.F90
@@ -30,10 +30,11 @@ module sci_chi_transform_mod
LOG_LEVEL_WARNING
use matrix_invert_mod, only : matrix_invert_3x3
+use sci_mesh_enums_mod, only: geometry_spherical, &
+ geometry_planar, &
+ topology_fully_periodic
+
! Configuration modules
-use base_mesh_config_mod, only: geometry_spherical, &
- geometry_planar, &
- topology_fully_periodic
use finite_element_config_mod, only: coord_system_xyz, &
coord_system_native
diff --git a/components/science/source/kernel/geometry/sci_coordinate_jacobian_mod.F90 b/components/science/source/kernel/geometry/sci_coordinate_jacobian_mod.F90
index c0c0d4524..15ee48564 100644
--- a/components/science/source/kernel/geometry/sci_coordinate_jacobian_mod.F90
+++ b/components/science/source/kernel/geometry/sci_coordinate_jacobian_mod.F90
@@ -22,10 +22,10 @@ module sci_coordinate_jacobian_mod
get_to_stretch, &
get_to_rotate, &
get_stretch_factor
+ use sci_mesh_enums_mod, only: geometry_planar, &
+ topology_fully_periodic
! Configuration modules
- use base_mesh_config_mod, only: geometry_planar, &
- topology_fully_periodic
use finite_element_config_mod, only: coord_system_xyz, &
coord_system_native
diff --git a/components/science/source/kernel/geometry/sci_height_continuous_kernel_mod.F90 b/components/science/source/kernel/geometry/sci_height_continuous_kernel_mod.F90
index 4964cb6aa..247a2e8a2 100644
--- a/components/science/source/kernel/geometry/sci_height_continuous_kernel_mod.F90
+++ b/components/science/source/kernel/geometry/sci_height_continuous_kernel_mod.F90
@@ -15,10 +15,10 @@ module sci_height_continuous_kernel_mod
GH_READ, GH_INC, &
ANY_SPACE_1, ANY_SPACE_9, &
CELL_COLUMN, GH_BASIS, GH_EVALUATOR
- use base_mesh_config_mod, only: geometry_spherical
use constants_mod, only: r_def, i_def, l_def
use finite_element_config_mod, only: coord_system_xyz
use kernel_mod, only: kernel_type
+ use sci_mesh_enums_mod, only: geometry_spherical
implicit none
private
diff --git a/components/science/source/kernel/geometry/sci_height_discontinuous_kernel_mod.F90 b/components/science/source/kernel/geometry/sci_height_discontinuous_kernel_mod.F90
index 101e8aa4b..f25dd4c6e 100644
--- a/components/science/source/kernel/geometry/sci_height_discontinuous_kernel_mod.F90
+++ b/components/science/source/kernel/geometry/sci_height_discontinuous_kernel_mod.F90
@@ -16,10 +16,10 @@ module sci_height_discontinuous_kernel_mod
GH_READ, GH_WRITE, &
ANY_DISCONTINUOUS_SPACE_1, ANY_SPACE_9, &
CELL_COLUMN, GH_BASIS, GH_EVALUATOR
- use base_mesh_config_mod, only: geometry_spherical
use constants_mod, only: r_def, i_def, l_def
use finite_element_config_mod, only: coord_system_xyz
use kernel_mod, only: kernel_type
+ use sci_mesh_enums_mod, only: geometry_spherical
implicit none
private
diff --git a/components/science/source/kernel/geometry/sci_native_jacobian_mod.F90 b/components/science/source/kernel/geometry/sci_native_jacobian_mod.F90
index 9e6b7446e..bec2de68b 100644
--- a/components/science/source/kernel/geometry/sci_native_jacobian_mod.F90
+++ b/components/science/source/kernel/geometry/sci_native_jacobian_mod.F90
@@ -24,11 +24,11 @@ module sci_native_jacobian_mod
get_to_stretch, &
get_to_rotate, &
get_stretch_factor
+ use sci_mesh_enums_mod, only: geometry_planar, &
+ topology_fully_periodic
use finite_element_config_mod, only: coord_system_xyz, &
coord_system_native
- use base_mesh_config_mod, only: geometry_planar, &
- topology_fully_periodic
implicit none
diff --git a/components/science/source/kernel/inter_function_space/sci_compute_map_u_operators_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_compute_map_u_operators_kernel_mod.F90
index f05d600f8..dbaddf300 100644
--- a/components/science/source/kernel/inter_function_space/sci_compute_map_u_operators_kernel_mod.F90
+++ b/components/science/source/kernel/inter_function_space/sci_compute_map_u_operators_kernel_mod.F90
@@ -28,8 +28,7 @@ module sci_compute_map_u_operators_kernel_mod
use fs_continuity_mod, only : W2, W3, Wtheta
use kernel_mod, only : kernel_type
use log_mod, only : log_event, LOG_LEVEL_ERROR, LOG_LEVEL_INFO
-
- use base_mesh_config_mod, only: geometry_spherical, geometry_planar
+ use sci_mesh_enums_mod, only : geometry_spherical, geometry_planar
implicit none
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 eb8514b3c..9a1dc06f3 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
@@ -28,14 +28,14 @@ module sci_compute_sample_u_ops_kernel_mod
use constants_mod, only : r_def, i_def
use fs_continuity_mod, only : W2broken, W3, Wtheta
use kernel_mod, only : kernel_type
+
use sci_chi_transform_mod, only : chi2llr
use sci_coordinate_jacobian_mod, only : coordinate_jacobian, &
coordinate_jacobian_inverse
+ use sci_mesh_enums_mod, only : geometry_spherical, geometry_planar
use coord_transform_mod, only : sphere2cart_vector
use reference_element_mod, only : W, S, N, E, T, B
- use base_mesh_config_mod, only: geometry_spherical, geometry_planar
-
implicit none
private
diff --git a/components/science/source/kernel/inter_function_space/sci_convert_phys_to_hdiv_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_convert_phys_to_hdiv_kernel_mod.F90
index 2888e3577..9db530d0d 100644
--- a/components/science/source/kernel/inter_function_space/sci_convert_phys_to_hdiv_kernel_mod.F90
+++ b/components/science/source/kernel/inter_function_space/sci_convert_phys_to_hdiv_kernel_mod.F90
@@ -21,8 +21,7 @@ module sci_convert_phys_to_hdiv_kernel_mod
use constants_mod, only : r_def, i_def
use fs_continuity_mod, only : W2
use kernel_mod, only : kernel_type
-
- use base_mesh_config_mod, only: geometry_spherical
+ use sci_mesh_enums_mod, only : geometry_spherical
implicit none
diff --git a/components/science/source/kernel/inter_function_space/sci_project_ws_to_w1_operator_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_project_ws_to_w1_operator_kernel_mod.F90
index d00964b45..d8e569f88 100644
--- a/components/science/source/kernel/inter_function_space/sci_project_ws_to_w1_operator_kernel_mod.F90
+++ b/components/science/source/kernel/inter_function_space/sci_project_ws_to_w1_operator_kernel_mod.F90
@@ -26,8 +26,7 @@ module sci_project_ws_to_w1_operator_kernel_mod
use constants_mod, only : r_def, i_def
use fs_continuity_mod, only : W1
use log_mod, only : log_event, LOG_LEVEL_ERROR
-
-use base_mesh_config_mod, only: geometry_spherical, geometry_planar
+use sci_mesh_enums_mod, only : geometry_spherical, geometry_planar
implicit none
diff --git a/components/science/source/solver/sci_hierarchical_linear_operator_mod.f90 b/components/science/source/solver/sci_hierarchical_linear_operator_mod.f90
index 69cb77928..39dd957bc 100644
--- a/components/science/source/solver/sci_hierarchical_linear_operator_mod.f90
+++ b/components/science/source/solver/sci_hierarchical_linear_operator_mod.f90
@@ -12,6 +12,7 @@
module sci_hierarchical_linear_operator_mod
use sci_linear_operator_mod, only : abstract_linear_operator_type
+ use config_mod, only: config_type
implicit none
@@ -28,12 +29,15 @@ module sci_hierarchical_linear_operator_mod
!> Abstract interface defined for the coarsening linear operator to the
!> next level of the multigrid hierarchy.
!>
- !>@param[in] self a hierarchical linear operator
- !>@param[in] fs_coarse coarse level function space
- !>@param[inout] coarse_operator coarsened version on the next multigrid level
- subroutine coarsen_interface(self,coarse_operator)
+ !>@param[in] config Application configuration object
+ !>@param[inout] coarse_operator Coarsened version on the next multigrid level
+ subroutine coarsen_interface(self, config, coarse_operator)
import :: abstract_hierarchical_linear_operator_type
+ import :: config_type
+
class(abstract_hierarchical_linear_operator_type), intent(in) :: self
+
+ type(config_type), intent(in) :: config
class(abstract_hierarchical_linear_operator_type), allocatable, intent(inout) :: coarse_operator
end subroutine coarsen_interface
end interface
diff --git a/components/science/source/solver/sci_hierarchical_preconditioner_mod.f90 b/components/science/source/solver/sci_hierarchical_preconditioner_mod.f90
index e63d8f42f..040be6cf7 100644
--- a/components/science/source/solver/sci_hierarchical_preconditioner_mod.f90
+++ b/components/science/source/solver/sci_hierarchical_preconditioner_mod.f90
@@ -14,6 +14,7 @@
module sci_hierarchical_preconditioner_mod
use sci_preconditioner_mod, only: abstract_preconditioner_type
+ use config_mod, only: config_type
implicit none
private
@@ -29,11 +30,15 @@ module sci_hierarchical_preconditioner_mod
!> Abstract interface defined for the coarsening preconditioner to the
!> next level of the multigrid hierarchy.
!>
- !>@param[inout] self a hierarchical preconditioner
- !>@param[inout] other coarsened version on the next multigrid level
- subroutine coarsen_interface(self, other)
+ !>@param[in] config Application configuration object
+ !>@param[inout] other Coarsened version on the next multigrid level
+ subroutine coarsen_interface(self, config, other)
import :: abstract_hierarchical_preconditioner_type
+ import :: config_type
+
class(abstract_hierarchical_preconditioner_type), intent(inout) :: self
+
+ type(config_type), intent(in) :: config
class(abstract_hierarchical_preconditioner_type), allocatable, intent(inout) :: other
end subroutine coarsen_interface
end interface
diff --git a/components/science/source/solver/sci_iterative_solver_mod.f90 b/components/science/source/solver/sci_iterative_solver_mod.f90
index f85ef074f..b955242f2 100644
--- a/components/science/source/solver/sci_iterative_solver_mod.f90
+++ b/components/science/source/solver/sci_iterative_solver_mod.f90
@@ -14,6 +14,7 @@
module sci_iterative_solver_mod
+ use config_mod, only : config_type
use constants_mod, only : r_def, i_def, EPS, l_def
use vector_mod, only : abstract_vector_type
use sci_linear_operator_mod, &
@@ -63,15 +64,22 @@ module sci_iterative_solver_mod
!> @details Apply the iterative solver for a given right hand side
!> \f$b\f$.
!>
- !> @param[inout] x Resulting solution \f$x\f$
- !> @param[in] b Right hand side vector \f$b\f$
+ !> @param[in] config Application configuration object
+ !> @param[inout] x Resulting solution \f$x\f$
+ !> @param[in] b Right hand side vector \f$b\f$
!>
- subroutine apply_interface(self, x, b)
+ subroutine apply_interface(self, config, x, b)
+
import :: abstract_vector_type
import :: abstract_iterative_solver_type
+ import :: config_type
+
class(abstract_iterative_solver_type), intent(inout) :: self
+
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
+
end subroutine apply_interface
end interface
@@ -113,8 +121,9 @@ module function cg_constructor( lin_op, prec, r_tol, a_tol, max_iter, &
end interface
interface
- module subroutine cg_solve(self, x, b)
+ module subroutine cg_solve(self, config, x, b)
class(conjugate_gradient_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine
@@ -149,8 +158,9 @@ module function bicgstab_constructor( lin_op, prec, r_tol, a_tol, max_iter, &
end interface
interface
- module subroutine bicgstab_solve(self, x, b)
+ module subroutine bicgstab_solve(self, config, x, b)
class(bicgstab_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine
@@ -188,8 +198,9 @@ end function gmres_constructor
end interface
interface
- module subroutine gmres_solve(self, x, b)
+ module subroutine gmres_solve(self, config, x, b)
class(gmres_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine gmres_solve
@@ -226,8 +237,9 @@ end function fgmres_constructor
end interface
interface
- module subroutine fgmres_solve(self, x, b)
- class(fgmres_type), intent(inout) :: self
+ module subroutine fgmres_solve(self, config, x, b)
+ class(fgmres_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine fgmres_solve
@@ -264,8 +276,9 @@ end function gcr_constructor
end interface
interface
- module subroutine gcr_solve(self, x, b)
+ module subroutine gcr_solve(self, config, x, b)
class(gcr_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine gcr_solve
@@ -304,8 +317,9 @@ end function block_gcr_constructor
end interface
interface
- module subroutine block_gcr_solve(self, x, b)
+ module subroutine block_gcr_solve(self, config, x, b)
class(block_gcr_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine block_gcr_solve
@@ -339,8 +353,9 @@ module function precondition_only_constructor( lin_op, prec, &
end interface
interface
- module subroutine precondition_only_solve(self, x, b)
+ module subroutine precondition_only_solve(self, config, x, b)
class(precondition_only_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine
@@ -380,10 +395,11 @@ module function jacobi_constructor( lin_op, prec, r_tol, a_tol, max_iter,
end interface
interface
- module subroutine jacobi_solve(self, x, b)
- class(jacobi_type), intent(inout) :: self
- class(abstract_vector_type), intent(inout) :: x
- class(abstract_vector_type), intent(inout) :: b
+ module subroutine jacobi_solve(self, config, x, b)
+ class(jacobi_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
+ class(abstract_vector_type), intent(inout) :: x
+ class(abstract_vector_type), intent(inout) :: b
end subroutine
end interface
@@ -421,8 +437,9 @@ module function chebyshev_constructor( lin_op, prec, r_tol, a_tol, max_iter, &
end interface
interface
- module subroutine chebyshev_solve(self, x, b)
+ module subroutine chebyshev_solve(self, config, x, b)
class(chebyshev_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
end subroutine
@@ -490,12 +507,16 @@ module function cg_constructor(lin_op, prec, r_tol, a_tol, max_iter, &
!>
!> Over-rides the abstract interface to do the actual solve.
!>
- !> @param[inout] b "RHS" or boundary conditions.
- !> @param[inout] x Solution.
+ !> @param[in] config Application configuration object
+ !> @param[inout] b "RHS" or boundary conditions.
+ !> @param[inout] x Solution.
!>
- module subroutine cg_solve(self, x, b)
+ module subroutine cg_solve(self, config, x, b)
+
implicit none
+
class(conjugate_gradient_type), intent(inout) :: self
+ type(config_type), intent(in) :: config
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: b
@@ -519,7 +540,7 @@ module subroutine cg_solve(self, x, b)
converged=.false.
!set up the algorithm
- call self%lin_op%apply(x,r) ! r = A.x
+ call self%lin_op%apply(config, x, r) ! r = A.x
call r%scale(-1.0_r_def) ! r = -A.x
call r%axpy(1.0_r_def, b) ! r = b - A.x
r_nrm_0 = r%norm() ! r_0 = ||r||_2
@@ -539,8 +560,8 @@ module subroutine cg_solve(self, x, b)
end if
call z%set_scalar(0.0_r_def)
- call self%prec%apply(r,z) ! z = P^{-1}.r
- rz = r%dot(z) ! rz =
- call x%axpy(alpha,p) ! x -> x + alpha*p
- call r%axpy(-alpha,z) ! r -> r - alpha*A.p
+ call self%lin_op%apply(config, p, z) ! z = A.p
+ alpha = rz / p%dot(z) ! alpha =
+ call x%axpy(alpha,p) ! x -> x + alpha*p
+ call r%axpy(-alpha,z) ! r -> r - alpha*A.p
if ( self%monitor_convergence ) then
r_nrm = r%norm() ! r = ||r||_2
@@ -567,10 +588,10 @@ module subroutine cg_solve(self, x, b)
exit
end if
end if
- call self%prec%apply(r,z) ! z = P^{-1}.r
- rz_new = r%dot(z) ! rz_new =