diff --git a/applications/coupled/example/configuration_glo.nml b/applications/coupled/example/configuration_glo.nml index e212a5e2a..a838184c6 100644 --- a/applications/coupled/example/configuration_glo.nml +++ b/applications/coupled/example/configuration_glo.nml @@ -21,6 +21,8 @@ element_order_h=0, element_order_v=0, rehabilitate=.true., coord_order=1 +coord_order_multigrid=1 +coord_space='Wchi' coord_system='native' / diff --git a/applications/coupled/example/configuration_lam.nml b/applications/coupled/example/configuration_lam.nml index 5e92d9fe9..92fdb3a65 100644 --- a/applications/coupled/example/configuration_lam.nml +++ b/applications/coupled/example/configuration_lam.nml @@ -20,6 +20,8 @@ element_order_h=0, element_order_v=0, rehabilitate=.true., coord_order=1 +coord_order_multigrid=1 +coord_space='Wchi' coord_system='native' / diff --git a/applications/io_demo/example/configuration.nml b/applications/io_demo/example/configuration.nml index db34d0e36..8bc5ff794 100644 --- a/applications/io_demo/example/configuration.nml +++ b/applications/io_demo/example/configuration.nml @@ -21,6 +21,8 @@ element_order_h=0, element_order_v=0, rehabilitate=.true., coord_order=1 +coord_order_multigrid=1 +coord_space='Wchi' coord_system='native' / diff --git a/applications/lbc_demo/example/configuration.nml b/applications/lbc_demo/example/configuration.nml index 469f85736..b5bfd60d7 100644 --- a/applications/lbc_demo/example/configuration.nml +++ b/applications/lbc_demo/example/configuration.nml @@ -21,6 +21,8 @@ coord_order=1, coord_system='native', element_order_h=0, element_order_v=0, +coord_order_multigrid=1 +coord_space='Wchi' rehabilitate=.true., / diff --git a/applications/simple_diffusion/example/configuration.nml b/applications/simple_diffusion/example/configuration.nml index 4694f1750..963784242 100644 --- a/applications/simple_diffusion/example/configuration.nml +++ b/applications/simple_diffusion/example/configuration.nml @@ -21,6 +21,8 @@ element_order_h=0, element_order_v=0, rehabilitate=.true., coord_order=1 +coord_order_multigrid=1 +coord_space='Wtheta' coord_system='native' / diff --git a/applications/skeleton/example/configuration.nml b/applications/skeleton/example/configuration.nml index 1f1175e64..02eeb8094 100644 --- a/applications/skeleton/example/configuration.nml +++ b/applications/skeleton/example/configuration.nml @@ -21,6 +21,8 @@ element_order_h=0, element_order_v=0, rehabilitate=.true., coord_order=1 +coord_order_multigrid=1 +coord_space='Wchi' coord_system='native' / diff --git a/components/driver/rose-meta/lfric-driver/HEAD/rose-meta.conf b/components/driver/rose-meta/lfric-driver/HEAD/rose-meta.conf index 980ecd18b..7230f33c7 100644 --- a/components/driver/rose-meta/lfric-driver/HEAD/rose-meta.conf +++ b/components/driver/rose-meta/lfric-driver/HEAD/rose-meta.conf @@ -326,17 +326,48 @@ values='triangle', 'quadrilateral' [namelist:finite_element=coord_order] compulsory=true -description=Order of the coordinate space. -fail-if=this < 0 ; -help=Order of the coordinate space. If 0 is chosen, this will be the continuous - =W0 space, with the order set by the element order. This option is only - =possible for certain geometries and topologies. Otherwise, this will be - =a discontinuous space. +description=Horizontal polynomial order of the coordinate space. +fail-if=this < 1 ; +help=Horizontal order of the polynomials used to describe the coordinate space. + =The vertical order is determined by the coordinate system. If a native + =coordinates system is chosen, the vertical coordinates are linear. + =If Cartesian coordinates are chosen, the vertical coordinates have the same + =order as the horizontal. !kind=default -range=0: +range=1: +sort-key=Panel-A03 +type=integer + +[namelist:finite_element=coord_order_multigrid] +compulsory=true +description=Horizontal polynomial order of coordinates for multigrid meshes. +fail-if=this < 1 ; +help=The order of the coordinate spaces can be set separately for the prime + =mesh and the others in a multigrid chain. For instance it may not be + =necessary to use higher order coordinates on coarser meshes. + =The vertical order is set as for the coord_order option. +!kind=default +range=1: sort-key=Panel-A03 type=integer +[namelist:finite_element=coord_space] +compulsory=true +description=The finite element space to use to hold the coordinate fields. +!enumeration=true +fail-if= +help=Different spaces have different continuity properties: + =Wchi: fully discontinuous. + =Wtheta: discontinuous in the horizontal, but continuous in the vertical. + = This is only appropriate for native coordinate systems, which + = separate the horizontal and vertical coordinates. + =W0: fully continuous. This is only appropriate for non-periodic planar + = domains, or when using the 'xyz' coordinate system on spherical + = domains. +sort-key=Panel-A04 +value-titles='Wchi', 'Wtheta', 'W0' +values='Wchi', 'Wtheta', 'W0' + [namelist:finite_element=coord_system] compulsory=true description=The coordinate system that will be stored in the chi coordinate diff --git a/components/driver/rose-meta/lfric-driver/versions.py b/components/driver/rose-meta/lfric-driver/versions.py index 152c043d0..c342142c5 100644 --- a/components/driver/rose-meta/lfric-driver/versions.py +++ b/components/driver/rose-meta/lfric-driver/versions.py @@ -31,3 +31,23 @@ def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ + +class vn30_t238(MacroUpgrade): + """Upgrade macro for PR #238 by Thomas Bendall.""" + + BEFORE_TAG = "vn3.0" + AFTER_TAG = "vn3.0_t238" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-driver + self.add_setting( + config, ["namelist:finite_element", "coord_space"], "'Wchi'" + ) + coord_order = self.get_setting_value( + config, ["namelist:finite_element", "coord_order"] + ) + self.add_setting( + config, ["namelist:finite_element", "coord_order_multigrid"], + coord_order + ) + return config, self.reports diff --git a/components/driver/source/driver_fem_mod.f90 b/components/driver/source/driver_fem_mod.f90 index 715786011..126bb0c79 100644 --- a/components/driver/source/driver_fem_mod.f90 +++ b/components/driver/source/driver_fem_mod.f90 @@ -12,11 +12,24 @@ !> * Initialises function space chains for use by the model. module driver_fem_mod + use base_mesh_config_mod, only: prime_mesh_name, & + geometry, & + geometry_spherical, & + geometry_planar, & + topology, & + topology_non_periodic use sci_chi_transform_mod, only: init_chi_transforms, & final_chi_transforms use constants_mod, only: i_def, l_def, str_def use extrusion_mod, only: TWOD, PRIME_EXTRUSION - use finite_element_config_mod, only: coord_order + use finite_element_config_mod, only: coord_order, & + coord_order_multigrid, & + coord_system, & + coord_system_xyz, & + coord_space, & + coord_space_W0, & + coord_space_Wchi, & + coord_space_Wtheta use field_mod, only: field_type use fs_continuity_mod, only: W0, W2, W3, Wtheta, Wchi, W2v, W2h use function_space_mod, only: function_space_type @@ -68,6 +81,10 @@ subroutine init_fem( mesh_collection, chi_inventory, panel_id_inventory ) type(field_type) :: panel_id type(function_space_type), pointer :: fs => null() integer(kind=i_def) :: chi_space, coord, i + integer(kind=i_def) :: coord_order_h, coord_order_v + integer(kind=i_def) :: this_coord_order + integer(kind=i_def) :: halo_depth + logical(kind=l_def) :: is_valid character(str_def) :: mesh_name @@ -98,27 +115,78 @@ subroutine init_fem( mesh_collection, chi_inventory, panel_id_inventory ) ! Only create coordinates for 3D meshes if (mesh%get_extrusion_id() /= TWOD) then - ! Initialise panel ID field object --------------------------------------- + ! Initialise panel ID field object ------------------------------------- twod_mesh => mesh_collection%get_mesh(mesh, TWOD) fs => function_space_collection%get_fs(twod_mesh, 0, 0, W3) - call panel_id%initialise( vector_space = fs, halo_depth = twod_mesh%get_halo_depth() ) + halo_depth = twod_mesh%get_halo_depth() + call panel_id%initialise(fs, halo_depth=halo_depth) - ! Initialise chi field object -------------------------------------------- - if ( coord_order == 0 ) then - chi_space = W0 - write(log_scratch_space,'(A)') & - 'Computing W0 coordinate fields for ' // trim(mesh_name) // 'mesh' - call log_event( log_scratch_space, log_level_info ) + ! Initialise chi field object ------------------------------------------ + ! Set coordinate order for this mesh + if (all_mesh_names(i) == prime_mesh_name) then + this_coord_order = coord_order else + this_coord_order = coord_order_multigrid + end if + + ! Determine coordinate space + select case (coord_space) + case (coord_space_W0) + ! Check domain/topology is valid + is_valid = ( & + geometry == geometry_spherical & + .and. coord_system == coord_system_xyz & + ) .or. ( & + geometry == geometry_planar & + .and. topology == topology_non_periodic & + ) + if (.not. is_valid) then + call log_event( & + 'Coordinate space W0 is only valid for non-periodic ' // & + 'planar domains or when using the xyz coordinate system.', & + LOG_LEVEL_ERROR & + ) + end if + + ! Correct the coord_order for W0 polynomials being 1 order above W3 + this_coord_order = this_coord_order - 1 + chi_space = W0 + + case (coord_space_Wchi) chi_space = Wchi - write(log_scratch_space,'(A)') & - 'Computing Wchi coordinate fields for ' // trim(mesh_name) // 'mesh' - call log_event( log_scratch_space, log_level_info ) + + case (coord_space_Wtheta) + chi_space = Wtheta + + case default + call log_event('Invalid value for coord_space', LOG_LEVEL_ERROR) + end select + + ! Set horizontal and vertical coordinate orders separately + if (coord_system == coord_system_xyz) then + ! Geocentric Cartesian coordinates - same order in all directions + coord_order_h = this_coord_order + coord_order_v = this_coord_order + + else + ! For native coordinates, we separate horizontal and vertical coords + ! and can still accurately represent space with linear vertical coords + coord_order_h = this_coord_order + + if (coord_space == coord_space_Wchi) then + coord_order_v = 1 ! Linear vertical coords for Wchi + else + coord_order_v = 0 ! Linear vertical coords for Wtheta + end if end if - fs => function_space_collection%get_fs(mesh, coord_order, coord_order, chi_space) + + ! Create coordinate space + fs => function_space_collection%get_fs( & + mesh, coord_order_h, coord_order_v, chi_space & + ) do coord = 1, size(chi) - call chi(coord)%initialise(vector_space = fs, halo_depth = twod_mesh%get_halo_depth() ) + call chi(coord)%initialise(fs, halo_depth=halo_depth) end do ! Set coordinate fields -------------------------------------------------- diff --git a/components/driver/unit-test/assign_coordinate_xyz_mod_test.pf b/components/driver/unit-test/assign_coordinate_xyz_mod_test.pf index 8cf102568..0e49af743 100644 --- a/components/driver/unit-test/assign_coordinate_xyz_mod_test.pf +++ b/components/driver/unit-test/assign_coordinate_xyz_mod_test.pf @@ -34,7 +34,7 @@ contains use feign_config_mod, only : feign_base_mesh_config, & feign_finite_element_config use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi implicit none @@ -49,6 +49,8 @@ contains call feign_finite_element_config( cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/lfric-xios/integration-test/configs/context.nml b/components/lfric-xios/integration-test/configs/context.nml index f07068c66..9bd07c149 100644 --- a/components/lfric-xios/integration-test/configs/context.nml +++ b/components/lfric-xios/integration-test/configs/context.nml @@ -21,6 +21,8 @@ element_order_v = 0 rehabilitate =.true. coord_order = 1 + coord_order_multigrid = 1 + coord_space = 'Wchi' coord_system ='native' / diff --git a/components/lfric-xios/integration-test/configs/non_cyclic_base.nml b/components/lfric-xios/integration-test/configs/non_cyclic_base.nml index 073eaddf5..e06f4874f 100644 --- a/components/lfric-xios/integration-test/configs/non_cyclic_base.nml +++ b/components/lfric-xios/integration-test/configs/non_cyclic_base.nml @@ -21,6 +21,8 @@ element_order_v = 0 rehabilitate =.true. coord_order = 1 + coord_order_multigrid = 1 + coord_space = 'Wchi' coord_system ='native' / diff --git a/components/lfric-xios/integration-test/resources/configs/context.nml b/components/lfric-xios/integration-test/resources/configs/context.nml index f07068c66..9bd07c149 100644 --- a/components/lfric-xios/integration-test/resources/configs/context.nml +++ b/components/lfric-xios/integration-test/resources/configs/context.nml @@ -21,6 +21,8 @@ element_order_v = 0 rehabilitate =.true. coord_order = 1 + coord_order_multigrid = 1 + coord_space = 'Wchi' coord_system ='native' / diff --git a/components/lfric-xios/integration-test/resources/configs/non_cyclic_base.nml b/components/lfric-xios/integration-test/resources/configs/non_cyclic_base.nml index 073eaddf5..e06f4874f 100644 --- a/components/lfric-xios/integration-test/resources/configs/non_cyclic_base.nml +++ b/components/lfric-xios/integration-test/resources/configs/non_cyclic_base.nml @@ -21,6 +21,8 @@ element_order_v = 0 rehabilitate =.true. coord_order = 1 + coord_order_multigrid = 1 + coord_space = 'Wchi' coord_system ='native' / diff --git a/components/lfric-xios/source/lfric_xios_setup_mod.x90 b/components/lfric-xios/source/lfric_xios_setup_mod.x90 index 9c762d7bb..67fa6e638 100644 --- a/components/lfric-xios/source/lfric_xios_setup_mod.x90 +++ b/components/lfric-xios/source/lfric_xios_setup_mod.x90 @@ -310,8 +310,9 @@ contains coord_dim_owned = proxy_coord_output(1)%vspace%get_last_dof_owned() / nfull_levels ! Obtain sample_chi, which will be used for setting up XIOS coordinates - if ( mesh%is_geometry_spherical() ) then + if ( mesh%is_geometry_spherical() .or. chi(1)%which_function_space() == Wtheta ) then ! Sample chi on W0 function space to prevent "unzipping" of cubed-sphere mesh + ! This also avoids issues when Wtheta is used as the coordinate space do i = 1,3 call sample_chi(i)%initialise( vector_space = output_field_fs ) end do @@ -322,7 +323,10 @@ contains do i = 1,3 call chi(i)%copy_field_serial(sample_chi(i)) end do - ! Tell downstream output processing that the mesh is planar + end if + + ! Tell downstream output processing that the mesh is planar + if ( .not. mesh%is_geometry_spherical() ) then call set_xios_geometry_planar() end if diff --git a/components/science/source/algorithm/sci_geometric_constants_mod.x90 b/components/science/source/algorithm/sci_geometric_constants_mod.x90 index 744700203..85c9430fd 100644 --- a/components/science/source/algorithm/sci_geometric_constants_mod.x90 +++ b/components/science/source/algorithm/sci_geometric_constants_mod.x90 @@ -1162,8 +1162,12 @@ contains !> @return A height field function get_height_fe(space_id, mesh_id) result(height) - use sci_get_height_kernel_mod, only: get_height_kernel_type - use planet_config_mod, only: scaled_radius + use sci_height_continuous_kernel_mod, only: height_continuous_kernel_type + use sci_height_discontinuous_kernel_mod, & + only: height_discontinuous_kernel_type + use base_mesh_config_mod, only: geometry + use finite_element_config_mod, only: coord_system + use planet_config_mod, only: scaled_radius implicit none @@ -1175,6 +1179,9 @@ contains type(function_space_type), pointer :: space type(field_type), pointer :: chi(:) type(field_type), pointer :: height + type(field_type) :: rmultiplicity + type(field_type) :: nodal_multiplicity + type(field_type) :: ones character(len=str_def) :: inventory_name ! If running at lowest order, use finite volume @@ -1219,11 +1226,37 @@ contains if ( subroutine_timers ) call timer('runtime_constants.geometric') - space => function_space_collection%get_fs(mesh, element_order_h, & - element_order_v, space_id) + space => function_space_collection%get_fs( & + mesh, element_order_h, element_order_v, space_id & + ) call inventory%add_field(height, space, mesh) - call invoke( get_height_kernel_type(height, chi, scaled_radius) ) + select case (space_id) + case (W3, Wtheta) + call invoke( & + height_discontinuous_kernel_type( & + height, chi, geometry, coord_system, scaled_radius & + ) & + ) + + case default + ! Can't import multiplicity, so must calculate it + call ones%initialise( space ) + call nodal_multiplicity%initialise( space ) + call rmultiplicity%initialise( space ) + + call invoke( & + setval_c(ones, 1.0_r_def), & + setval_c(nodal_multiplicity, 0.0_r_def), & + multiplicity_kernel_type(nodal_multiplicity), & + X_divideby_Y(rmultiplicity, ones, nodal_multiplicity), & + setval_c(height, 0.0_r_def), & + height_continuous_kernel_type( & + height, chi, rmultiplicity, & + geometry, coord_system, scaled_radius & + ) & + ) + end select if ( subroutine_timers ) call timer('runtime_constants.geometric') else @@ -1238,8 +1271,12 @@ contains !> @return A height field function get_height_fv(space_id, mesh_id) result(height) - use sci_get_height_kernel_mod, only: get_height_kernel_type - use planet_config_mod, only: scaled_radius + use sci_height_continuous_kernel_mod, only: height_continuous_kernel_type + use sci_height_discontinuous_kernel_mod, & + only: height_discontinuous_kernel_type + use base_mesh_config_mod, only: geometry + use finite_element_config_mod, only: coord_system + use planet_config_mod, only: scaled_radius implicit none @@ -1251,6 +1288,9 @@ contains type(function_space_type), pointer :: space type(field_type), pointer :: chi(:) type(field_type), pointer :: height + type(field_type) :: rmultiplicity + type(field_type) :: nodal_multiplicity + type(field_type) :: ones character(len=str_def) :: inventory_name ! Determine inventory based on space @@ -1292,7 +1332,32 @@ contains space => function_space_collection%get_fs(mesh, 0, 0, space_id) call inventory%add_field(height, space, mesh) - call invoke( get_height_kernel_type(height, chi, scaled_radius) ) + select case (space_id) + case (W3, Wtheta) + call invoke( & + height_discontinuous_kernel_type( & + height, chi, geometry, coord_system, scaled_radius & + ) & + ) + + case default + ! Can't import multiplicity, so must calculate it + call ones%initialise( space ) + call nodal_multiplicity%initialise( space ) + call rmultiplicity%initialise( space ) + + call invoke( & + setval_c(ones, 1.0_r_def), & + setval_c(nodal_multiplicity, 0.0_r_def), & + multiplicity_kernel_type(nodal_multiplicity), & + X_divideby_Y(rmultiplicity, ones, nodal_multiplicity), & + setval_c(height, 0.0_r_def), & + height_continuous_kernel_type( & + height, chi, rmultiplicity, & + geometry, coord_system, scaled_radius & + ) & + ) + end select if ( subroutine_timers ) call timer('runtime_constants.geometric') else 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 351086a38..668abfd17 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 @@ -15,11 +15,11 @@ module sci_compute_mass_matrix_kernel_w2_mod GH_READ, GH_WRITE, & GH_REAL, 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 fs_continuity_mod, only: Wchi use kernel_mod, only: kernel_type implicit none @@ -34,12 +34,12 @@ module sci_compute_mass_matrix_kernel_w2_mod 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, Wchi), & + 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(func_type) :: meta_funcs(2) = (/ & - func_type(ANY_W2, GH_BASIS), & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(ANY_W2, GH_BASIS), & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_QUADRATURE_XYoZ 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 f63540f33..e1bc09d43 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 @@ -16,12 +16,13 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod GH_LOGICAL, GH_SCALAR, & GH_READ, GH_WRITE, & GH_REAL, 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 sci_coordinate_jacobian_mod, only: coordinate_jacobian - use fs_continuity_mod, only: W0, Wtheta, Wchi + use fs_continuity_mod, only: W0, Wtheta use kernel_mod, only: kernel_type implicit none @@ -35,13 +36,13 @@ module sci_compute_mass_matrix_kernel_w_scalar_mod 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, Wchi), & + 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(func_type) :: meta_funcs(2) = (/ & func_type(ANY_SPACE_2, GH_BASIS), & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_QUADRATURE_XYoZ diff --git a/components/science/source/kernel/geometry/sci_get_height_kernel_mod.F90 b/components/science/source/kernel/geometry/sci_get_height_kernel_mod.F90 deleted file mode 100644 index 9778fdc6f..000000000 --- a/components/science/source/kernel/geometry/sci_get_height_kernel_mod.F90 +++ /dev/null @@ -1,144 +0,0 @@ -!----------------------------------------------------------------------------- -! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer -! For further details please refer to the file LICENCE which you -! should have received as part of this distribution. -!----------------------------------------------------------------------------- -!> @brief Returns a height field (r or z) from the chi array. -!> -!> @details Returns a height field (r or z) from the chi array -!> -module sci_get_height_kernel_mod - - use argument_mod, only: arg_type, func_type, & - GH_FIELD, GH_REAL, & - GH_SCALAR, & - GH_WRITE, GH_READ, GH_INC, & - ANY_DISCONTINUOUS_SPACE_1, & - ANY_SPACE_9, GH_BASIS, & - CELL_COLUMN, GH_EVALUATOR - use base_mesh_config_mod, only: geometry, & - geometry_spherical - use constants_mod, only: r_def, i_def - use finite_element_config_mod, only: coord_system, & - coord_system_xyz - use kernel_mod, only: kernel_type - - implicit none - private - - !--------------------------------------------------------------------------- - ! Public types - !--------------------------------------------------------------------------- - !> The type declaration for the kernel. Contains the metadata needed by the - !> Psy layer. - !> - type, public, extends(kernel_type) :: get_height_kernel_type - private - type(arg_type) :: meta_args(3) = (/ & - arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & - /) - type(func_type) :: meta_funcs(1) = (/ & - func_type(ANY_SPACE_9, GH_BASIS) & - /) - integer :: operates_on = CELL_COLUMN - integer :: gh_shape = GH_EVALUATOR - contains - procedure, nopass :: get_height_code - end type - - !--------------------------------------------------------------------------- - ! Contained functions/subroutines - !--------------------------------------------------------------------------- - public :: get_height_code - -contains - -!> @brief Returns a height field (r or z) from the chi array -!> Will only work at lowest order for now -!! @param[in] nlayers Number of layers -!! @param[in,out] height The height field -!! @param[in] chi_1 1st component of the coordinate -!! @param[in] chi_2 2nd component of the coordinate -!! @param[in] chi_3 3rd component of the coordinate -!! @param[in] planet_radius The planet radius -!! @param[in] ndf_x Number of degrees of freedom per cell for height -!! @param[in] undf_x Number of unique degrees of freedom for height -!! @param[in] map_x Dofmap for the cell at the base of the column for height -!! @param[in] ndf_chi The number of degrees of freedom per cell for chi -!! @param[in] undf_chi The number of unique degrees of freedom for chi -!! @param[in] map_chi Dofmap for the cell at the base of the column for chi -!! @param[in] basis_chi Basis functions evaluated at nodal points for height -subroutine get_height_code(nlayers, & - height, & - chi_1, chi_2, chi_3, & - planet_radius, & - ndf_x, undf_x, map_x, & - ndf_chi, undf_chi, map_chi, & - basis_chi & - ) - implicit none - - ! Arguments - integer(kind=i_def), intent(in) :: nlayers - - integer(kind=i_def), intent(in) :: ndf_x, undf_x - integer(kind=i_def), intent(in) :: ndf_chi, undf_chi - real(kind=r_def), dimension(undf_x), intent(inout) :: height - real(kind=r_def), dimension(undf_chi), intent(in) :: chi_1, chi_2, chi_3 - real(kind=r_def), intent(in) :: planet_radius - - integer(kind=i_def), dimension(ndf_x), intent(in) :: map_x - integer(kind=i_def), dimension(ndf_chi), intent(in) :: map_chi - real(kind=r_def), dimension(1,ndf_chi,ndf_x), intent(in) :: basis_chi - - ! Internal variables - integer(kind=i_def) :: df_chi, df_x, k - real(kind=r_def) :: coord(3), coord_radius, height_at_dof - - if ( (geometry == geometry_spherical) .and. & - (coord_system == coord_system_xyz) ) then - ! NB This will result in the height above - ! the spherical representation of the planet - ! but not necessarily the height above the bottom - ! of the mesh - ! This should be reviewed with ticket #562 - - do k = 0, nlayers-1 - do df_x = 1, ndf_x - coord(:) = 0.0_r_def - do df_chi = 1, ndf_chi - coord(1) = coord(1) + chi_1(map_chi(df_chi)+k)*basis_chi(1,df_chi,df_x) - coord(2) = coord(2) + chi_2(map_chi(df_chi)+k)*basis_chi(1,df_chi,df_x) - coord(3) = coord(3) + chi_3(map_chi(df_chi)+k)*basis_chi(1,df_chi,df_x) - end do - - coord_radius = sqrt(coord(1)**2 + coord(2)**2 + coord(3)**2) - - height( map_x(df_x) + k ) = coord_radius - planet_radius - - end do - end do - - else - - ! Either the domain is Cartesian or we are using a non-Cartesian spherical - ! coordinate system. In both these cases, chi_3 will be the height. - do k = 0, nlayers-1 - do df_x = 1, ndf_x - height_at_dof = 0.0_r_def - do df_chi = 1, ndf_chi - height_at_dof = height_at_dof + & - chi_3(map_chi(df_chi)+k)*basis_chi(1,df_chi,df_x) - end do - - height( map_x(df_x) + k ) = height_at_dof - - end do - end do - end if - -end subroutine get_height_code - -end module sci_get_height_kernel_mod 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 new file mode 100644 index 000000000..4964cb6aa --- /dev/null +++ b/components/science/source/kernel/geometry/sci_height_continuous_kernel_mod.F90 @@ -0,0 +1,179 @@ +!------------------------------------------------------------------------------- +! (C) Crown copyright 2026 Met Office. All rights reserved. +! The file LICENCE, distributed with this code, contains details of the terms +! under which the code may be used. +!------------------------------------------------------------------------------- +!> @brief Computes the height above the Earth's mean radius at the degrees of +!! freedom for a continuous function space. +!> @details Uses the chi coordinate fields to determine the height of nodes +!! above the Earth's mean radius, for continuous function spaces. +module sci_height_continuous_kernel_mod + + use argument_mod, only: arg_type, func_type, & + GH_FIELD, GH_SCALAR, & + GH_REAL, GH_INTEGER, & + 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 + + implicit none + private + + !----------------------------------------------------------------------------- + ! Public types + !----------------------------------------------------------------------------- + !> The type declaration for the kernel. Contains the metadata needed by the + !! Psy layer. + type, public, extends(kernel_type) :: height_continuous_kernel_type + private + type(arg_type) :: meta_args(6) = (/ & + arg_type(GH_FIELD, GH_REAL, GH_INC, ANY_SPACE_1), & + arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & + arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_1), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & + arg_type(GH_SCALAR, GH_REAL, GH_READ) & + /) + type(func_type) :: meta_funcs(1) = (/ & + func_type(ANY_SPACE_9, GH_BASIS) & + /) + integer :: operates_on = CELL_COLUMN + integer :: gh_shape = GH_EVALUATOR + contains + procedure, nopass :: height_continuous_code + end type + + !----------------------------------------------------------------------------- + ! Contained functions/subroutines + !----------------------------------------------------------------------------- + public :: height_continuous_code + +contains + +!> @brief Computes the height above the Earth's mean radius at the degrees of +!! freedom for a continuous function space. +!> @param[in] nlayers Number of layers in the mesh +!> @param[in,out] height The height field to compute +!> @param[in] chi_1 1st component of the coordinate fields +!> @param[in] chi_2 2nd component of the coordinate fields +!> @param[in] chi_3 3rd component of the coordinate fields +!> @param[in] rmultiplicity Reciprocal of DoF multiplicity for height field +!> @param[in] geometry The geometry of the domain +!> @param[in] coord_system The coordinate system of the domain +!> @param[in] planet_radius The planet radius +!> @param[in] ndf_h Num DoFs per cell for height field +!> @param[in] undf_h Num DoFs in this partition for height field +!> @param[in] map_h DoF index map for height field +!> @param[in] ndf_chi Num DoFs per cell for chi fields +!> @param[in] undf_chi Num DoFs in this partition for chi fields +!> @param[in] map_chi DoF index map for chi fields +!> @param[in] basis_chi Chi basis functions evaluated at height DoFs +subroutine height_continuous_code( & + nlayers, & + height, & + chi_1, chi_2, chi_3, & + rmultiplicity, & + geometry, coord_system, planet_radius, & + ndf_h, undf_h, map_h, & + ndf_chi, undf_chi, map_chi, & + basis_chi & +) + implicit none + + ! Arguments + integer(kind=i_def), intent(in) :: nlayers + integer(kind=i_def), intent(in) :: ndf_h, undf_h + integer(kind=i_def), intent(in) :: ndf_chi, undf_chi + integer(kind=i_def), intent(in) :: geometry, coord_system + integer(kind=i_def), intent(in) :: map_h(ndf_h) + integer(kind=i_def), intent(in) :: map_chi(ndf_chi) + real(kind=r_def), intent(in) :: planet_radius + real(kind=r_def), intent(in) :: basis_chi(1,ndf_chi,ndf_h) + real(kind=r_def), intent(inout) :: height(undf_h) + real(kind=r_def), intent(in) :: rmultiplicity(undf_h) + real(kind=r_def), intent(in) :: chi_1(undf_chi) + real(kind=r_def), intent(in) :: chi_2(undf_chi) + real(kind=r_def), intent(in) :: chi_3(undf_chi) + + ! Internal variables + logical(kind=l_def) :: is_spherical_xyz + integer(kind=i_def) :: df_chi, df_h + integer(kind=i_def) :: h_b_idx, h_t_idx, chi_b_idx, chi_t_idx + real(kind=r_def) :: coord_1(nlayers), coord_2(nlayers), coord_3(nlayers) + real(kind=r_def) :: coord_radius(nlayers), basis_val + + ! Two cases: if the geometry is spherical with geocentric Cartesian coords, + ! all three chi components are needed to compute the height. Otherwise, only + ! the last chi component is needed, as this is already the vertical coordinate + + is_spherical_xyz = ( & + geometry == geometry_spherical .and. coord_system == coord_system_xyz & + ) + + ! -------------------------------------------------------------------------- ! + ! Cartesian system and spherical + ! -------------------------------------------------------------------------- ! + if (is_spherical_xyz) then + + do df_h = 1, ndf_h + ! Indices for bottom and top height DoFs in this column + h_b_idx = map_h(df_h) + h_t_idx = map_h(df_h) + nlayers - 1 + + ! Determine coordinates at this DoF using chi basis functions + coord_1(:) = 0.0_r_def + coord_2(:) = 0.0_r_def + coord_3(:) = 0.0_r_def + do df_chi = 1, ndf_chi + ! Indices for bottom and top chi DoFs in this column + chi_b_idx = map_chi(df_chi) + chi_t_idx = map_chi(df_chi) + nlayers - 1 + basis_val = basis_chi(1, df_chi, df_h) + + coord_1(:) = coord_1(:) + chi_1(chi_b_idx:chi_t_idx)*basis_val + coord_2(:) = coord_2(:) + chi_2(chi_b_idx:chi_t_idx)*basis_val + coord_3(:) = coord_3(:) + chi_3(chi_b_idx:chi_t_idx)*basis_val + end do + + ! Convert to radial coordinate + coord_radius(:) = sqrt(coord_1(:)**2 + coord_2(:)**2 + coord_3(:)**2) + + ! Increment height field at this DoF + height(h_b_idx:h_t_idx) = ( & + height(h_b_idx:h_t_idx) & + + rmultiplicity(h_b_idx:h_t_idx)*(coord_radius(:) - planet_radius) & + ) + end do + + ! -------------------------------------------------------------------------- ! + ! Native coordinates, or planar domain + ! -------------------------------------------------------------------------- ! + else + ! Third coordinate already gives the height above the Earth's mean radius + do df_h = 1, ndf_h + ! Indices for bottom and top height DoFs in this column + h_b_idx = map_h(df_h) + h_t_idx = map_h(df_h) + nlayers - 1 + + do df_chi = 1, ndf_chi + ! Indices for bottom and top chi DoFs in this column + chi_b_idx = map_chi(df_chi) + chi_t_idx = map_chi(df_chi) + nlayers - 1 + basis_val = basis_chi(1, df_chi, df_h) + + ! Increment height field at this DoF + height(h_b_idx:h_t_idx) = ( & + height(h_b_idx:h_t_idx) + rmultiplicity(h_b_idx:h_t_idx) & + * chi_3(chi_b_idx:chi_t_idx)*basis_val & + ) + end do + end do + end if + +end subroutine height_continuous_code + +end module sci_height_continuous_kernel_mod 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 new file mode 100644 index 000000000..101e8aa4b --- /dev/null +++ b/components/science/source/kernel/geometry/sci_height_discontinuous_kernel_mod.F90 @@ -0,0 +1,173 @@ +!------------------------------------------------------------------------------- +! (C) Crown copyright 2026 Met Office. All rights reserved. +! The file LICENCE, distributed with this code, contains details of the terms +! under which the code may be used. +!------------------------------------------------------------------------------- +!> @brief Computes the height above the Earth's mean radius at the degrees of +!! freedom for a discontinuous function space. +!> @details Uses the chi coordinate fields to determine the height of nodes +!! above the Earth's mean radius, for discontinuous function spaces. + +module sci_height_discontinuous_kernel_mod + + use argument_mod, only: arg_type, func_type, & + GH_FIELD, GH_SCALAR, & + GH_REAL, GH_INTEGER, & + 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 + + implicit none + private + + !----------------------------------------------------------------------------- + ! Public types + !----------------------------------------------------------------------------- + !> The type declaration for the kernel. Contains the metadata needed by the + !! Psy layer. + type, public, extends(kernel_type) :: height_discontinuous_kernel_type + private + type(arg_type) :: meta_args(5) = (/ & + arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1), & + arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & + arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & + arg_type(GH_SCALAR, GH_REAL, GH_READ) & + /) + type(func_type) :: meta_funcs(1) = (/ & + func_type(ANY_SPACE_9, GH_BASIS) & + /) + integer :: operates_on = CELL_COLUMN + integer :: gh_shape = GH_EVALUATOR + contains + procedure, nopass :: height_discontinuous_code + end type + + !----------------------------------------------------------------------------- + ! Contained functions/subroutines + !----------------------------------------------------------------------------- + public :: height_discontinuous_code + +contains + +!> @brief Computes the height above the Earth's mean radius at the degrees of +!! freedom for a discontinuous function space. +!> @param[in] nlayers Number of layers in the mesh +!> @param[in,out] height The height field to compute +!> @param[in] chi_1 1st component of the coordinate fields +!> @param[in] chi_2 2nd component of the coordinate fields +!> @param[in] chi_3 3rd component of the coordinate fields +!> @param[in] geometry The geometry of the domain +!> @param[in] coord_system The coordinate system of the domain +!> @param[in] planet_radius The planet radius +!> @param[in] ndf_h Num DoFs per cell for height field +!> @param[in] undf_h Num DoFs in this partition for height field +!> @param[in] map_h DoF index map for height field +!> @param[in] ndf_chi Num DoFs per cell for chi fields +!> @param[in] undf_chi Num DoFs in this partition for chi fields +!> @param[in] map_chi DoF index map for chi fields +!> @param[in] basis_chi Chi basis functions evaluated at height DoFs +subroutine height_discontinuous_code( & + nlayers, & + height, & + chi_1, chi_2, chi_3, & + geometry, coord_system, planet_radius, & + ndf_h, undf_h, map_h, & + ndf_chi, undf_chi, map_chi, & + basis_chi & +) + implicit none + + ! Arguments + integer(kind=i_def), intent(in) :: nlayers + integer(kind=i_def), intent(in) :: ndf_h, undf_h + integer(kind=i_def), intent(in) :: ndf_chi, undf_chi + integer(kind=i_def), intent(in) :: geometry, coord_system + integer(kind=i_def), intent(in) :: map_h(ndf_h) + integer(kind=i_def), intent(in) :: map_chi(ndf_chi) + real(kind=r_def), intent(in) :: planet_radius + real(kind=r_def), intent(in) :: basis_chi(1,ndf_chi,ndf_h) + real(kind=r_def), intent(inout) :: height(undf_h) + real(kind=r_def), intent(in) :: chi_1(undf_chi) + real(kind=r_def), intent(in) :: chi_2(undf_chi) + real(kind=r_def), intent(in) :: chi_3(undf_chi) + + ! Internal variables + logical(kind=l_def) :: is_spherical_xyz + integer(kind=i_def) :: df_chi, df_h + integer(kind=i_def) :: h_b_idx, h_t_idx, chi_b_idx, chi_t_idx + real(kind=r_def) :: coord_1(nlayers), coord_2(nlayers), coord_3(nlayers) + real(kind=r_def) :: coord_radius(nlayers), basis_val + + ! Two cases: if the geometry is spherical with geocentric Cartesian coords, + ! all three chi components are needed to compute the height. Otherwise, only + ! the last chi component is needed, as this is already the vertical coordinate + + is_spherical_xyz = ( & + geometry == geometry_spherical .and. coord_system == coord_system_xyz & + ) + + ! -------------------------------------------------------------------------- ! + ! Cartesian system and spherical + ! -------------------------------------------------------------------------- ! + if (is_spherical_xyz) then + + do df_h = 1, ndf_h + ! Indices for bottom and top height DoFs in this column + h_b_idx = map_h(df_h) + h_t_idx = map_h(df_h) + nlayers - 1 + + ! Determine coordinates at this DoF using chi basis functions + coord_1(:) = 0.0_r_def + coord_2(:) = 0.0_r_def + coord_3(:) = 0.0_r_def + do df_chi = 1, ndf_chi + ! Indices for bottom and top chi DoFs in this column + chi_b_idx = map_chi(df_chi) + chi_t_idx = map_chi(df_chi) + nlayers - 1 + basis_val = basis_chi(1, df_chi, df_h) + + coord_1(:) = coord_1(:) + chi_1(chi_b_idx:chi_t_idx)*basis_val + coord_2(:) = coord_2(:) + chi_2(chi_b_idx:chi_t_idx)*basis_val + coord_3(:) = coord_3(:) + chi_3(chi_b_idx:chi_t_idx)*basis_val + end do + + ! Convert to radial coordinate + coord_radius(:) = sqrt(coord_1(:)**2 + coord_2(:)**2 + coord_3(:)**2) + + ! Increment height field at this DoF + height(h_b_idx:h_t_idx) = coord_radius(:) - planet_radius + end do + + ! -------------------------------------------------------------------------- ! + ! Native coordinates, or planar domain + ! -------------------------------------------------------------------------- ! + else + ! Third coordinate already gives the height above the Earth's mean radius + do df_h = 1, ndf_h + ! Indices for bottom and top height DoFs in this column + h_b_idx = map_h(df_h) + h_t_idx = map_h(df_h) + nlayers - 1 + height(h_b_idx:h_t_idx) = 0.0_r_def + + do df_chi = 1, ndf_chi + ! Indices for bottom and top chi DoFs in this column + chi_b_idx = map_chi(df_chi) + chi_t_idx = map_chi(df_chi) + nlayers - 1 + basis_val = basis_chi(1, df_chi, df_h) + + ! Increment height field at this DoF + height(h_b_idx:h_t_idx) = ( & + height(h_b_idx:h_t_idx) + chi_3(chi_b_idx:chi_t_idx)*basis_val & + ) + end do + end do + end if + +end subroutine height_discontinuous_code + +end module sci_height_discontinuous_kernel_mod 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 c6426b267..9bc5c7d26 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 @@ -19,12 +19,13 @@ module sci_compute_sample_u_ops_kernel_mod GH_OPERATOR, & GH_INC, GH_READ, GH_WRITE, & ANY_DISCONTINUOUS_SPACE_3, & + ANY_SPACE_9, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_EVALUATOR, & reference_element_data_type, & normals_to_faces use constants_mod, only : r_def, i_def - use fs_continuity_mod, only : W2broken, W3, Wtheta, Wchi + use fs_continuity_mod, only : W2broken, W3, Wtheta use kernel_mod, only : kernel_type use base_mesh_config_mod, only : geometry, geometry_spherical, & geometry_planar @@ -50,11 +51,11 @@ module sci_compute_sample_u_ops_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, WTHETA), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) & /) type(func_type) :: meta_funcs(1) = (/ & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) type(reference_element_data_type), dimension(1) :: & meta_reference_element = & diff --git a/components/science/source/kernel/inter_function_space/sci_project_w3_to_w2b_operator_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_project_w3_to_w2b_operator_kernel_mod.F90 index 426037eff..d19c970ad 100644 --- a/components/science/source/kernel/inter_function_space/sci_project_w3_to_w2b_operator_kernel_mod.F90 +++ b/components/science/source/kernel/inter_function_space/sci_project_w3_to_w2b_operator_kernel_mod.F90 @@ -16,11 +16,12 @@ module sci_project_w3_to_w2b_operator_kernel_mod GH_FIELD, GH_SCALAR, & GH_REAL, GH_INTEGER, & GH_READ, GH_WRITE, & + ANY_SPACE_9, & ANY_DISCONTINUOUS_SPACE_3, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ use constants_mod, only : r_def, i_def -use fs_continuity_mod, only : W2broken, W3, Wchi +use fs_continuity_mod, only : W2broken, W3 implicit none @@ -33,14 +34,14 @@ module sci_project_w3_to_w2b_operator_kernel_mod private type(arg_type) :: meta_args(4) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2broken, W3), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + 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_INTEGER, GH_READ) & /) type(func_type) :: meta_funcs(3) = (/ & - func_type(W2broken, GH_BASIS), & - func_type(W3, GH_BASIS), & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(W2broken, GH_BASIS), & + func_type(W3, GH_BASIS), & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_QUADRATURE_XYoZ 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 c8d849f7e..c2cc69c94 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 @@ -20,10 +20,11 @@ module sci_project_ws_to_w1_operator_kernel_mod GH_READ, GH_WRITE, & ANY_DISCONTINUOUS_SPACE_1, & ANY_DISCONTINUOUS_SPACE_3, & + ANY_SPACE_9, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ use constants_mod, only : r_def, i_def -use fs_continuity_mod, only : W1, Wchi +use fs_continuity_mod, only : W1 use log_mod, only : log_event, LOG_LEVEL_ERROR implicit none @@ -37,14 +38,14 @@ module sci_project_ws_to_w1_operator_kernel_mod private type(arg_type) :: meta_args(4) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W1, ANY_DISCONTINUOUS_SPACE_1), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + 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_INTEGER, GH_READ) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W1, GH_BASIS), & func_type(ANY_DISCONTINUOUS_SPACE_1, GH_BASIS), & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_QUADRATURE_XYoZ diff --git a/components/science/source/kernel/inter_function_space/sci_project_ws_to_w2_operator_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_project_ws_to_w2_operator_kernel_mod.F90 index 0d1f4ff08..3956b94e6 100644 --- a/components/science/source/kernel/inter_function_space/sci_project_ws_to_w2_operator_kernel_mod.F90 +++ b/components/science/source/kernel/inter_function_space/sci_project_ws_to_w2_operator_kernel_mod.F90 @@ -16,12 +16,13 @@ module sci_project_ws_to_w2_operator_kernel_mod GH_FIELD, GH_SCALAR, & GH_REAL, GH_INTEGER, & GH_READ, GH_WRITE, & + ANY_SPACE_9, & ANY_DISCONTINUOUS_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 fs_continuity_mod, only : W2, Wchi +use fs_continuity_mod, only : W2 implicit none @@ -34,14 +35,14 @@ module sci_project_ws_to_w2_operator_kernel_mod private type(arg_type) :: meta_args(4) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, ANY_DISCONTINUOUS_SPACE_1), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + 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_INTEGER, GH_READ) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS), & func_type(ANY_DISCONTINUOUS_SPACE_1, GH_BASIS), & - func_type(Wchi, GH_BASIS, GH_DIFF_BASIS) & + func_type(ANY_SPACE_9, GH_BASIS, GH_DIFF_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_QUADRATURE_XYoZ diff --git a/components/science/source/kernel/inter_function_space/sci_w3_to_w2_displacement_kernel_mod.F90 b/components/science/source/kernel/inter_function_space/sci_w3_to_w2_displacement_kernel_mod.F90 index 64cc4ad24..2dd83cf43 100644 --- a/components/science/source/kernel/inter_function_space/sci_w3_to_w2_displacement_kernel_mod.F90 +++ b/components/science/source/kernel/inter_function_space/sci_w3_to_w2_displacement_kernel_mod.F90 @@ -14,11 +14,12 @@ module sci_w3_to_w2_displacement_kernel_mod use argument_mod, only : arg_type, func_type, & GH_FIELD, GH_REAL, & GH_READ, GH_INC, & + ANY_SPACE_9, & ANY_DISCONTINUOUS_SPACE_3, & GH_BASIS, GH_EVALUATOR, & CELL_COLUMN, GH_SCALAR, & GH_LOGICAL - use fs_continuity_mod, only : W3, W2H, Wchi + use fs_continuity_mod, only : W3, W2H use constants_mod, only : r_def, i_def use kernel_mod, only : kernel_type use reference_element_mod, only : E, W, N, S @@ -35,12 +36,12 @@ module sci_w3_to_w2_displacement_kernel_mod private type(arg_type) :: meta_args(4) = (/ & arg_type(GH_FIELD, GH_REAL, GH_INC, W2H), & - arg_type(GH_FIELD*3, GH_REAL, GH_READ, Wchi), & + 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, W3) & /) type(func_type) :: meta_funcs(1) = (/ & - func_type(Wchi, GH_BASIS) & + func_type(ANY_SPACE_9, GH_BASIS) & /) integer :: operates_on = CELL_COLUMN integer :: gh_shape = GH_EVALUATOR diff --git a/components/science/unit-test/kernel/fem/compute_broken_div_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/compute_broken_div_operator_kernel_mod_test.pf index 65f37e6fc..68e580c56 100644 --- a/components/science/unit-test/kernel/fem/compute_broken_div_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_broken_div_operator_kernel_mod_test.pf @@ -47,7 +47,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -58,6 +58,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=1_i_def, & element_order_v=1_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_curl_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/compute_curl_operator_kernel_mod_test.pf index 50888b180..3842ce3af 100644 --- a/components/science/unit-test/kernel/fem/compute_curl_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_curl_operator_kernel_mod_test.pf @@ -45,7 +45,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -61,6 +61,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_derham_matrices_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/compute_derham_matrices_kernel_mod_test.pf index 50dd756d5..d036b9c26 100644 --- a/components/science/unit-test/kernel/fem/compute_derham_matrices_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_derham_matrices_kernel_mod_test.pf @@ -31,7 +31,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -42,6 +42,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_div_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/compute_div_operator_kernel_mod_test.pf index 53474e517..8e11000ae 100644 --- a/components/science/unit-test/kernel/fem/compute_div_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_div_operator_kernel_mod_test.pf @@ -48,7 +48,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -59,6 +59,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=1_i_def, & element_order_v=1_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_grad_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/compute_grad_operator_kernel_mod_test.pf index da1dd8b61..ff34a19cc 100644 --- a/components/science/unit-test/kernel/fem/compute_grad_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_grad_operator_kernel_mod_test.pf @@ -42,7 +42,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -53,6 +53,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w0_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w0_mod_test.pf index f4f2296a8..f4d516ef9 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w0_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w0_mod_test.pf @@ -44,7 +44,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config implicit none @@ -54,6 +54,8 @@ contains call feign_finite_element_config( & cellshape = cellshape_quadrilateral, & coord_order = 0_i_def, & + coord_order_multigrid = 1_i_def, & + coord_space = coord_space_wchi, & coord_system = coord_system_xyz, & element_order_h =0_i_def, & element_order_v =0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w1_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w1_mod_test.pf index 1d85c8213..8b12cb4de 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w1_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w1_mod_test.pf @@ -44,7 +44,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -55,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2_mod_test.pf index 3e499f697..96fcd3e99 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2_mod_test.pf @@ -44,7 +44,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -55,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2b_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2b_mod_test.pf index de1500edb..e637e107d 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2b_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w2b_mod_test.pf @@ -41,7 +41,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config implicit none @@ -51,6 +51,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w3_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w3_mod_test.pf index 550e039c9..c771932e7 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w3_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_w3_mod_test.pf @@ -44,7 +44,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -55,6 +55,8 @@ contains call feign_finite_element_config( & cellshape = cellshape_quadrilateral, & coord_order = 0_i_def, & + coord_order_multigrid = 1_i_def, & + coord_space = coord_space_wchi, & coord_system = coord_system_xyz, & element_order_h = 0_i_def, & element_order_v = 0_i_def, & diff --git a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_wtheta_mod_test.pf b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_wtheta_mod_test.pf index e214ebfb4..05e9164a4 100644 --- a/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_wtheta_mod_test.pf +++ b/components/science/unit-test/kernel/fem/compute_mass_matrix_kernel_wtheta_mod_test.pf @@ -50,7 +50,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -61,6 +61,8 @@ contains call feign_finite_element_config( & cellshape = cellshape_quadrilateral, & coord_order = 0_i_def, & + coord_order_multigrid = 1_i_def, & + coord_space = coord_space_wchi, & coord_system = coord_system_xyz, & element_order_h = 0_i_def, & element_order_v = 0_i_def, & diff --git a/components/science/unit-test/kernel/fem/gp_rhs_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/gp_rhs_kernel_mod_test.pf index eee93bfa4..81a8019c6 100644 --- a/components/science/unit-test/kernel/fem/gp_rhs_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/gp_rhs_kernel_mod_test.pf @@ -43,7 +43,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -60,6 +60,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/gp_vector_rhs_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/gp_vector_rhs_kernel_mod_test.pf index 20f623a67..8d62ab49c 100644 --- a/components/science/unit-test/kernel/fem/gp_vector_rhs_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/gp_vector_rhs_kernel_mod_test.pf @@ -42,7 +42,7 @@ contains topology_fully_periodic use sci_chi_transform_mod, only : init_chi_transforms use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config, & feign_base_mesh_config @@ -66,6 +66,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/fem/mg_derham_mat_kernel_mod_test.pf b/components/science/unit-test/kernel/fem/mg_derham_mat_kernel_mod_test.pf index 11bc64083..e903f77d7 100644 --- a/components/science/unit-test/kernel/fem/mg_derham_mat_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/fem/mg_derham_mat_kernel_mod_test.pf @@ -31,7 +31,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -42,6 +42,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/calc_da_at_w2_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/calc_da_at_w2_kernel_mod_test.pf index fee5e8bbb..2a2221874 100644 --- a/components/science/unit-test/kernel/geometry/calc_da_at_w2_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/calc_da_at_w2_kernel_mod_test.pf @@ -43,7 +43,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -54,6 +54,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/calc_detj_at_w2_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/calc_detj_at_w2_kernel_mod_test.pf index 75650dd78..8d9d79197 100644 --- a/components/science/unit-test/kernel/geometry/calc_detj_at_w2_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/calc_detj_at_w2_kernel_mod_test.pf @@ -44,7 +44,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -55,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/calc_detj_at_w3_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/calc_detj_at_w3_kernel_mod_test.pf index 4d69854d1..246d2f934 100644 --- a/components/science/unit-test/kernel/geometry/calc_detj_at_w3_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/calc_detj_at_w3_kernel_mod_test.pf @@ -43,7 +43,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -54,6 +54,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/calc_directional_detj_at_w2_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/calc_directional_detj_at_w2_kernel_mod_test.pf index 963c6ecff..f57dfbaeb 100644 --- a/components/science/unit-test/kernel/geometry/calc_directional_detj_at_w2_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/calc_directional_detj_at_w2_kernel_mod_test.pf @@ -42,7 +42,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -53,6 +53,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/chi_transform_mod_test.pf b/components/science/unit-test/kernel/geometry/chi_transform_mod_test.pf index a72fce3f5..26bd3a92d 100644 --- a/components/science/unit-test/kernel/geometry/chi_transform_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/chi_transform_mod_test.pf @@ -229,7 +229,8 @@ contains stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & coord_system_native, & - coord_system_xyz + coord_system_xyz, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -276,6 +277,8 @@ contains element_order_v=0_i_def, & rehabilitate=.true., & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system ) call feign_planet_config( scaling_factor=scaling ) diff --git a/components/science/unit-test/kernel/geometry/compute_latlon_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/compute_latlon_kernel_mod_test.pf index 4b686f674..a66c2d810 100644 --- a/components/science/unit-test/kernel/geometry/compute_latlon_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/compute_latlon_kernel_mod_test.pf @@ -38,7 +38,7 @@ contains use sci_chi_transform_mod, only : init_chi_transforms use feign_config_mod, only : feign_finite_element_config use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use extrusion_config_mod, only: method_uniform @@ -52,6 +52,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/coordinate_jacobian_alphabetaz_mod_test.pf b/components/science/unit-test/kernel/geometry/coordinate_jacobian_alphabetaz_mod_test.pf index 083909300..52c188977 100644 --- a/components/science/unit-test/kernel/geometry/coordinate_jacobian_alphabetaz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/coordinate_jacobian_alphabetaz_mod_test.pf @@ -27,7 +27,8 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -54,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/coordinate_jacobian_lonlatz_mod_test.pf b/components/science/unit-test/kernel/geometry/coordinate_jacobian_lonlatz_mod_test.pf index f4f5fd353..aeaf92183 100644 --- a/components/science/unit-test/kernel/geometry/coordinate_jacobian_lonlatz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/coordinate_jacobian_lonlatz_mod_test.pf @@ -27,7 +27,8 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -54,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/coordinate_jacobian_stretched_mod_test.pf b/components/science/unit-test/kernel/geometry/coordinate_jacobian_stretched_mod_test.pf index a560eaaff..b4f9b3a04 100644 --- a/components/science/unit-test/kernel/geometry/coordinate_jacobian_stretched_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/coordinate_jacobian_stretched_mod_test.pf @@ -26,7 +26,8 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -52,6 +53,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/coordinate_jacobian_xyz_mod_test.pf b/components/science/unit-test/kernel/geometry/coordinate_jacobian_xyz_mod_test.pf index 3f3379bbe..2fc997e9a 100644 --- a/components/science/unit-test/kernel/geometry/coordinate_jacobian_xyz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/coordinate_jacobian_xyz_mod_test.pf @@ -29,7 +29,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -40,6 +40,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/get_dz_w3_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/get_dz_w3_kernel_mod_test.pf index b633343d3..7777b52de 100644 --- a/components/science/unit-test/kernel/geometry/get_dz_w3_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/get_dz_w3_kernel_mod_test.pf @@ -38,7 +38,7 @@ contains use base_mesh_config_mod, only : geometry_planar, & topology_fully_periodic use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config, & feign_base_mesh_config @@ -56,6 +56,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/height_continuous_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/height_continuous_kernel_mod_test.pf new file mode 100644 index 000000000..b3e3d31e6 --- /dev/null +++ b/components/science/unit-test/kernel/geometry/height_continuous_kernel_mod_test.pf @@ -0,0 +1,267 @@ +!----------------------------------------------------------------------------- +! (C) Crown copyright 2026 Met Office. All rights reserved. +! The file LICENCE, distributed with this code, contains details of the terms +! under which the code may be used. +!----------------------------------------------------------------------------- +!> Test the height_continuous kernel +!! This test is parametrised to test both planar and spherical geometries. +module height_continuous_kernel_mod_test + + use base_mesh_config_mod, only : geometry_planar, & + geometry_spherical + use constants_mod, only : i_def, r_def, str_long + use funit + use get_unit_test_w2nodal_basis_mod, only : get_w0_w2nodal_basis + use get_unit_test_m3x3_q3x3x3_sizes_mod, only : get_w0_m3x3_q3x3x3_size, & + get_w2_m3x3_q3x3x3_size + use get_unit_test_m3x3_dofmap_mod, only : get_w0_m3x3_dofmap, & + get_w2_m3x3_dofmap + + implicit none + + private + public :: test_all, get_height_parameters, test_height_constructor, & + height_continuous_kernel_test_type + + @testParameter + type, public, extends(AbstractTestParameter) :: height_parameters_type + integer(kind=i_def) :: geometry + contains + procedure :: toString + end type height_parameters_type + + @TestCase(testParameters={get_height_parameters()}, constructor=test_height_constructor) + type, extends(ParameterizedTestCase) :: height_continuous_kernel_test_type + private + integer(kind=i_def) :: geometry + contains + procedure test_all + end type height_continuous_kernel_test_type + +contains + + function test_height_constructor(test_parameter) result (new_test) + + implicit none + + type(height_parameters_type), intent(in) :: test_parameter + type(height_continuous_kernel_test_type) :: new_test + + new_test%geometry = test_parameter%geometry + + end function test_height_constructor + + !> @brief A routine to convert test parameters to a string + function toString(this) result(output_string) + + implicit none + + class( height_parameters_type ), intent(in) :: this + character(:), allocatable :: output_string + character(str_long) :: geometry_string + + select case (this%geometry) + case (geometry_spherical ) + write(geometry_string, '(A)') 'spherical' + case (geometry_planar) + write(geometry_string, '(A)') 'planar' + end select + + output_string = trim(geometry_string) + + end function toString + + !> @brief Sets the parameters to be tested + function get_height_parameters() result (height_parameters) + + implicit none + + type(height_parameters_type) :: height_parameters(2) + + height_parameters = [ & + height_parameters_type(geometry_planar), & + height_parameters_type(geometry_spherical) & + ] + + end function get_height_parameters + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + @Test + subroutine test_all(this) + + use sci_height_continuous_kernel_mod, only : height_continuous_code + use finite_element_config_mod, only : coord_system_xyz + + implicit none + + class(height_continuous_kernel_test_type), intent(inout) :: this + + real(kind=r_def), parameter :: tol = 1.0e-3_r_def + + integer(kind=i_def) :: i, j, k, idx + integer(kind=i_def) :: nlayers, cell + integer(kind=i_def) :: ndf_w0, undf_w0 + integer(kind=i_def) :: ndf_w2, undf_w2 + integer(kind=i_def) :: ncells, dim_space, dim_space_diff + integer(kind=i_def) :: nqp_h, nqp_v + real(kind=r_def) :: dx, dy, dz, radius + real(kind=r_def) :: lon, lat, dlon, dlat, lon0, lat0, r + + integer(kind=i_def), allocatable :: map_w0(:,:) + integer(kind=i_def), allocatable :: map_w2(:,:) + real(kind=r_def), allocatable :: basis_w0_on_w2(:,:,:) + real(kind=r_def), allocatable :: chi_1(:), chi_2(:), chi_3(:) + real(kind=r_def), allocatable :: rmultiplicity(:) + real(kind=r_def), allocatable :: height_w2(:) + real(kind=r_def), allocatable :: height_w2_answer(:) + + ! ------------------------------------------------------------------------ ! + ! Set up domain + ! ------------------------------------------------------------------------ ! + ! Set number of layers + nlayers = 3 + + ! Set up degrees of freedom information + call get_w0_m3x3_q3x3x3_size( & + ndf_w0, undf_w0, ncells, dim_space, dim_space_diff, & + nqp_h, nqp_v, nlayers & + ) + call get_w2_m3x3_q3x3x3_size( & + ndf_w2, undf_w2, ncells, dim_space, dim_space_diff, & + nqp_h, nqp_v, nlayers & + ) + + ! Set up dof maps + call get_w0_m3x3_dofmap(map_w0) + call get_w2_m3x3_dofmap(map_w2) + + ! chi basis + call get_w0_w2nodal_basis(basis_w0_on_w2) + + ! Allocate height arrays + allocate(height_w2(undf_w2)) + allocate(height_w2_answer(undf_w2)) + + ! ------------------------------------------------------------------------ ! + ! Set up coordinates + ! ------------------------------------------------------------------------ ! + + ! Set up chi coefficients with quadratic extrusion + allocate(chi_1(undf_w0)) + allocate(chi_2(undf_w0)) + allocate(chi_3(undf_w0)) + + dz = 2.0_r_def + + if (this%geometry == geometry_planar) then + radius = 0.0_r_def + dx = 4.0_r_def + dy = 3.0_r_def + + ! Final coordinate field is height + cell = 1 + do j = 1, 3 + do i = 1, 3 + do k = 0, nlayers + chi_1(map_w0(1,cell)+k) = real(i-1)*dx + chi_2(map_w0(1,cell)+k) = real(j-1)*dy + chi_3(map_w0(1,cell)+k) = (real(k)**2)*dz + end do + cell = cell + 1 + end do + end do + + else + radius = 6.0_r_def + lon0 = 0.05_r_def + lat0 = 0.04_r_def + dlon = 0.01_r_def + dlat = 0.01_r_def + + ! Convert from spherical coordinates + cell = 1 + do j = 1, 3 + lat = lat0 + real(j-1)*dlat + do i = 1, 3 + lon = lon0 + real(i-1)*dlon + do k = 0, nlayers + r = radius + (real(k)**2)*dz + ! Spherical polar coordinates + chi_1(map_w0(1,cell)+k) = r*cos(lat)*cos(lon) + chi_2(map_w0(1,cell)+k) = r*cos(lat)*sin(lon) + chi_3(map_w0(1,cell)+k) = r*sin(lat) + end do + cell = cell + 1 + end do + end do + end if + + ! ------------------------------------------------------------------------ ! + ! Set rmultiplicity + ! ------------------------------------------------------------------------ ! + + allocate(rmultiplicity(undf_w2)) + rmultiplicity(:) = 0.5_r_def ! default value + ! Top and bottom DoFs need setting to 1 + do cell = 1, 9 + rmultiplicity(map_w2(5,cell)) = 1.0_r_def + rmultiplicity(map_w2(5,cell)+nlayers) = 1.0_r_def + end do + + ! ------------------------------------------------------------------------ ! + ! Set answer + ! ------------------------------------------------------------------------ ! + + ! Set answer for central cell: horizontal DoFs + cell = 5 + do i = 1, 4 + do k = 0, nlayers-1 + height_w2_answer(map_w2(i,cell)+k) = & + 0.5_r_def*dz*(real(k)**2 + real(k+1)**2) + end do + end do + + ! Set answer for central cell: vertical DoFs + cell = 5 + i = 5 + do k = 0, nlayers + height_w2_answer(map_w2(i,cell)+k) = (real(k)**2)*dz + end do + + ! ------------------------------------------------------------------------ ! + ! Test kernel + ! ------------------------------------------------------------------------ ! + + height_w2(:) = 0.0_r_def + + do cell = 1, ncells + call height_continuous_code( & + nlayers, & + height_w2, & + chi_1, chi_2, chi_3, & + rmultiplicity, & + this%geometry, coord_system_xyz, radius, & + ndf_w2, undf_w2, map_w2(:,cell), & + ndf_w0, undf_w0, map_w0(:,cell), & + basis_w0_on_w2(:,:,:) & + ) + end do + + cell = 5 + do i = 1, ndf_w2 + do k = 0, nlayers-1 + idx = map_w2(i,cell)+k + @assertEqual(height_w2_answer(idx), height_w2(idx), tol) + end do + end do + + deallocate(chi_1, chi_2, chi_3) + deallocate(rmultiplicity) + deallocate(height_w2, height_w2_answer) + deallocate(map_w0) + deallocate(map_w2) + deallocate(basis_w0_on_w2) + + end subroutine test_all + +end module height_continuous_kernel_mod_test diff --git a/components/science/unit-test/kernel/geometry/get_height_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/height_discontinuous_kernel_mod_test.pf similarity index 73% rename from components/science/unit-test/kernel/geometry/get_height_kernel_mod_test.pf rename to components/science/unit-test/kernel/geometry/height_discontinuous_kernel_mod_test.pf index 066d58f8d..400f083eb 100644 --- a/components/science/unit-test/kernel/geometry/get_height_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/height_discontinuous_kernel_mod_test.pf @@ -7,7 +7,7 @@ !> Test the get height kernel. Sets up a planar domain with quadratic height !> extrusion, and tests answer in W3 and Wtheta spaces !> -module get_height_kernel_mod_test +module height_discontinuous_kernel_mod_test use constants_mod, only : i_def, r_def use funit @@ -26,69 +26,25 @@ module get_height_kernel_mod_test public :: test_all @TestCase - type, extends(TestCase), public :: get_height_kernel_test_type + type, extends(TestCase), public :: height_discontinuous_kernel_test_type private contains - procedure setUp - procedure tearDown procedure test_all - end type get_height_kernel_test_type + end type height_discontinuous_kernel_test_type contains - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine setUp( this ) - - use base_mesh_config_mod, only : geometry_planar, & - topology_fully_periodic - use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz - use feign_config_mod, only : feign_finite_element_config, & - feign_base_mesh_config - - implicit none - - class(get_height_kernel_test_type), intent(inout) :: this - - call feign_base_mesh_config( file_prefix='foo', & - prime_mesh_name='unit_test', & - geometry=geometry_planar, & - prepartitioned=.false., & - topology=topology_fully_periodic, & - fplane=.false., f_lat_deg=45.0_r_def ) - - call feign_finite_element_config( & - cellshape=cellshape_quadrilateral, & - coord_order=0_i_def, & - coord_system=coord_system_xyz, & - element_order_h=0_i_def, & - element_order_v=0_i_def, & - rehabilitate=.true. ) - - end subroutine setUp - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine tearDown( this ) - - use configuration_mod, only: final_configuration - - implicit none - - class(get_height_kernel_test_type), intent(inout) :: this - - call final_configuration() - - end subroutine tearDown - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @Test subroutine test_all( this ) - use sci_get_height_kernel_mod, only : get_height_code + use base_mesh_config_mod, only : geometry_planar + use finite_element_config_mod, only : coord_system_xyz + use sci_height_discontinuous_kernel_mod, only : height_discontinuous_code implicit none - class(get_height_kernel_test_type), intent(inout) :: this + class(height_discontinuous_kernel_test_type), intent(inout) :: this real(r_def), parameter :: dx = 4.0_r_def, & dy = 3.0_r_def, & @@ -172,17 +128,19 @@ contains height_w3(:) = 0.0_r_def height_wtheta(:) = 0.0_r_def - call get_height_code(nlayers, & + call height_discontinuous_code(nlayers, & height_w3, & chi_1, chi_2, chi_3, & + geometry_planar, coord_system_xyz, & radius, & ndf_w3, undf_w3, map_w3(:,cell), & ndf_w0, undf_w0, map_w0(:,cell), & basis_w0_on_w3(:,:,:) ) - call get_height_code(nlayers, & + call height_discontinuous_code(nlayers, & height_wtheta, & chi_1, chi_2, chi_3, & + geometry_planar, coord_system_xyz, & radius, & ndf_wtheta, undf_wtheta, map_wtheta(:,cell), & ndf_w0, undf_w0, map_w0(:,cell), & @@ -216,4 +174,4 @@ contains end subroutine test_all -end module get_height_kernel_mod_test +end module height_discontinuous_kernel_mod_test diff --git a/components/science/unit-test/kernel/geometry/native_jacobian_alphabetaz_mod_test.pf b/components/science/unit-test/kernel/geometry/native_jacobian_alphabetaz_mod_test.pf index 74df5e0fe..242cdcf8e 100644 --- a/components/science/unit-test/kernel/geometry/native_jacobian_alphabetaz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/native_jacobian_alphabetaz_mod_test.pf @@ -27,7 +27,8 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -54,6 +55,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/native_jacobian_lonlatz_mod_test.pf b/components/science/unit-test/kernel/geometry/native_jacobian_lonlatz_mod_test.pf index 7497009b6..7d26f0ccc 100644 --- a/components/science/unit-test/kernel/geometry/native_jacobian_lonlatz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/native_jacobian_lonlatz_mod_test.pf @@ -27,7 +27,7 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -54,6 +54,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/native_jacobian_stretched_mod_test.pf b/components/science/unit-test/kernel/geometry/native_jacobian_stretched_mod_test.pf index ae02ad272..20027da38 100644 --- a/components/science/unit-test/kernel/geometry/native_jacobian_stretched_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/native_jacobian_stretched_mod_test.pf @@ -26,7 +26,7 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -52,6 +52,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/native_jacobian_xyz_mod_test.pf b/components/science/unit-test/kernel/geometry/native_jacobian_xyz_mod_test.pf index 4ccd5b67a..5ec29230e 100644 --- a/components/science/unit-test/kernel/geometry/native_jacobian_xyz_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/native_jacobian_xyz_mod_test.pf @@ -29,7 +29,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -40,6 +40,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/nodal_xyz_coordinates_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/nodal_xyz_coordinates_kernel_mod_test.pf index abebdd0af..066285ea7 100644 --- a/components/science/unit-test/kernel/geometry/nodal_xyz_coordinates_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/nodal_xyz_coordinates_kernel_mod_test.pf @@ -47,7 +47,7 @@ contains use sci_chi_transform_mod, only : init_chi_transforms use feign_config_mod, only : feign_finite_element_config use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi implicit none @@ -56,6 +56,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/geometry/scale_by_detj_kernel_mod_test.pf b/components/science/unit-test/kernel/geometry/scale_by_detj_kernel_mod_test.pf index d65dd97f0..399796b45 100644 --- a/components/science/unit-test/kernel/geometry/scale_by_detj_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/geometry/scale_by_detj_kernel_mod_test.pf @@ -33,7 +33,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -44,6 +44,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/compute_map_u_operators_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/compute_map_u_operators_kernel_mod_test.pf index 1d218ac27..f95fcccc3 100644 --- a/components/science/unit-test/kernel/inter_function_space/compute_map_u_operators_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/compute_map_u_operators_kernel_mod_test.pf @@ -28,7 +28,7 @@ contains stretching_method_linear use sci_chi_transform_mod, only : init_chi_transforms use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, coord_space_wchi use feign_config_mod, only : feign_extrusion_config, & feign_finite_element_config, & feign_base_mesh_config, & @@ -57,6 +57,8 @@ contains element_order_v=0_i_def, & rehabilitate=.true., & coord_order = 0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native ) call feign_planet_config( scaling_factor=1.0_r_def ) diff --git a/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf index 20d9ce641..a8d9632c4 100644 --- a/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/compute_sample_u_ops_kernel_mod_test.pf @@ -29,7 +29,7 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -59,6 +59,8 @@ contains element_order_v=0_i_def, & rehabilitate=.true., & coord_order = 0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native ) call feign_planet_config( scaling_factor=scaling ) diff --git a/components/science/unit-test/kernel/inter_function_space/convert_hcurl_field_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/convert_hcurl_field_kernel_mod_test.pf index 563bcdab7..84abdbce1 100644 --- a/components/science/unit-test/kernel/inter_function_space/convert_hcurl_field_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/convert_hcurl_field_kernel_mod_test.pf @@ -39,7 +39,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -50,6 +50,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/convert_hdiv_field_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/convert_hdiv_field_kernel_mod_test.pf index 28e712d54..45e730210 100644 --- a/components/science/unit-test/kernel/inter_function_space/convert_hdiv_field_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/convert_hdiv_field_kernel_mod_test.pf @@ -39,7 +39,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -50,6 +50,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/convert_hdiv_native_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/convert_hdiv_native_kernel_mod_test.pf index 60ce7e2f2..7c4706d53 100644 --- a/components/science/unit-test/kernel/inter_function_space/convert_hdiv_native_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/convert_hdiv_native_kernel_mod_test.pf @@ -39,7 +39,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -50,6 +50,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/convert_phys_to_hdiv_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/convert_phys_to_hdiv_kernel_mod_test.pf index 61802bbd0..f99967f7b 100644 --- a/components/science/unit-test/kernel/inter_function_space/convert_phys_to_hdiv_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/convert_phys_to_hdiv_kernel_mod_test.pf @@ -33,7 +33,7 @@ contains topology_fully_periodic use sci_chi_transform_mod, only : init_chi_transforms use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config, & feign_base_mesh_config @@ -51,6 +51,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_field_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_field_kernel_mod_test.pf index 27cf34cda..838d70e85 100644 --- a/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_field_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_field_kernel_mod_test.pf @@ -42,7 +42,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -53,6 +53,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_native_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_native_kernel_mod_test.pf index 7c263835e..8d112c93a 100644 --- a/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_native_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/dg_convert_hdiv_native_kernel_mod_test.pf @@ -40,7 +40,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -51,6 +51,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_function_space/project_w3_to_w2b_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/project_w3_to_w2b_operator_kernel_mod_test.pf index 0f2f906e9..b1f80f786 100644 --- a/components/science/unit-test/kernel/inter_function_space/project_w3_to_w2b_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/project_w3_to_w2b_operator_kernel_mod_test.pf @@ -30,7 +30,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -41,6 +41,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & element_order_h=0_i_def, & element_order_v=0_i_def, & rehabilitate=.true., & diff --git a/components/science/unit-test/kernel/inter_function_space/project_ws_to_w1_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/project_ws_to_w1_operator_kernel_mod_test.pf index 1e15845ee..8060685c8 100644 --- a/components/science/unit-test/kernel/inter_function_space/project_ws_to_w1_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/project_ws_to_w1_operator_kernel_mod_test.pf @@ -43,7 +43,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use base_mesh_config_mod, only : geometry_planar, & topology_fully_periodic @@ -63,6 +63,8 @@ contains call feign_finite_element_config( cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & element_order_h=0_i_def, & element_order_v=0_i_def, & rehabilitate=.true., & diff --git a/components/science/unit-test/kernel/inter_function_space/project_ws_to_w2_operator_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/project_ws_to_w2_operator_kernel_mod_test.pf index bd5b4ae33..3cd94867f 100644 --- a/components/science/unit-test/kernel/inter_function_space/project_ws_to_w2_operator_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/project_ws_to_w2_operator_kernel_mod_test.pf @@ -30,7 +30,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -41,6 +41,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & element_order_h=0_i_def, & element_order_v=0_i_def, & rehabilitate=.true., & diff --git a/components/science/unit-test/kernel/inter_function_space/w3_to_w2_displacement_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_function_space/w3_to_w2_displacement_kernel_mod_test.pf index 79a9b86c9..aa12e8446 100644 --- a/components/science/unit-test/kernel/inter_function_space/w3_to_w2_displacement_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_function_space/w3_to_w2_displacement_kernel_mod_test.pf @@ -27,7 +27,8 @@ contains use extrusion_config_mod, only : method_uniform, & stretching_method_linear use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_native + coord_system_native, & + coord_space_wchi use feign_config_mod, only : feign_base_mesh_config, & feign_extrusion_config, & feign_finite_element_config, & @@ -57,6 +58,8 @@ contains element_order_v=0_i_def, & rehabilitate=.true., & coord_order = 0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_native ) call feign_planet_config( scaling_factor=1.0_r_def ) diff --git a/components/science/unit-test/kernel/inter_mesh/consist_w3_to_sh_w3_op_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_mesh/consist_w3_to_sh_w3_op_kernel_mod_test.pf index 67dbf5a5e..67fe988f6 100644 --- a/components/science/unit-test/kernel/inter_mesh/consist_w3_to_sh_w3_op_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_mesh/consist_w3_to_sh_w3_op_kernel_mod_test.pf @@ -31,7 +31,7 @@ contains subroutine setUp( this ) use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config use sci_chi_transform_mod, only : init_chi_transforms @@ -43,6 +43,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/components/science/unit-test/kernel/inter_mesh/proj_mr_to_sh_rho_rhs_op_kernel_mod_test.pf b/components/science/unit-test/kernel/inter_mesh/proj_mr_to_sh_rho_rhs_op_kernel_mod_test.pf index 82aeebcc4..cbdfd7242 100644 --- a/components/science/unit-test/kernel/inter_mesh/proj_mr_to_sh_rho_rhs_op_kernel_mod_test.pf +++ b/components/science/unit-test/kernel/inter_mesh/proj_mr_to_sh_rho_rhs_op_kernel_mod_test.pf @@ -44,7 +44,7 @@ contains use sci_chi_transform_mod, only : init_chi_transforms use finite_element_config_mod, only : cellshape_quadrilateral, & - coord_system_xyz + coord_system_xyz, coord_space_wchi use feign_config_mod, only : feign_finite_element_config implicit none @@ -54,6 +54,8 @@ contains call feign_finite_element_config( & cellshape=cellshape_quadrilateral, & coord_order=0_i_def, & + coord_order_multigrid=1_i_def, & + coord_space=coord_space_wchi, & coord_system=coord_system_xyz, & element_order_h=0_i_def, & element_order_v=0_i_def, & diff --git a/infrastructure/source/function_space/function_space_constructor_helper_functions_mod.F90 b/infrastructure/source/function_space/function_space_constructor_helper_functions_mod.F90 index 792fb2ebf..2f6442a1d 100644 --- a/infrastructure/source/function_space/function_space_constructor_helper_functions_mod.F90 +++ b/infrastructure/source/function_space/function_space_constructor_helper_functions_mod.F90 @@ -581,9 +581,11 @@ subroutine basis_setup( element_order_h, element_order_v, gungho_fs, & if (k_h == 0) then x2h(1) = 0.5_r_def else - if (gungho_fs == W3 .or. gungho_fs == Wtheta) then + if (gungho_fs == W3) then ! Evenly space the points away from the element edges for high order ! spaces - this helps with visualising the output + ! TODO: this used to be the case for Wtheta until it was also used for + ! storing coordinate fields. Issue #250 records this. do i = 1, k_h + 1 x2h(i) = real(i, r_def) / real(k_h + 2, r_def) end do @@ -602,7 +604,7 @@ subroutine basis_setup( element_order_h, element_order_v, gungho_fs, & if (k_v == 0) then x2v(1) = 0.5_r_def else - if (gungho_fs == W3 .or. gungho_fs == Wtheta) then + if (gungho_fs == W3) then ! Evenly space the points away from the element edges for high order ! spaces - this helps with visualising the output do i = 1, k_v + 1 diff --git a/rose-stem/app/lbc_demo/rose-app.conf b/rose-stem/app/lbc_demo/rose-app.conf index d979a47c6..567d1b2d9 100644 --- a/rose-stem/app/lbc_demo/rose-app.conf +++ b/rose-stem/app/lbc_demo/rose-app.conf @@ -44,6 +44,8 @@ planet_radius=6371229.0 [namelist:finite_element] cellshape='quadrilateral' coord_order=1 +coord_order_multigrid=1 +coord_space='Wchi' coord_system='native' element_order_h=0 element_order_v=0