diff --git a/applications/lfric2lfric/example/configuration.nml b/applications/lfric2lfric/example/configuration.nml
index 24bcc89ed..d25b8274c 100644
--- a/applications/lfric2lfric/example/configuration.nml
+++ b/applications/lfric2lfric/example/configuration.nml
@@ -28,6 +28,15 @@ stretching_height = 17507.0,
stretching_method = 'smooth',
/
+&extrusion_dst
+domain_height = 80000.0,
+method = 'um_L70_50t_20s_80km',
+number_of_layers = 70,
+planet_radius = 6371229.0,
+stretching_height = 17507.0,
+stretching_method = 'smooth',
+/
+
&files
diag_stem_name = 'lfric2lfric_diag',
start_dump_filename = 'mesh_C12_MG_dump',
@@ -97,3 +106,7 @@ coord_space = 'Wchi',
&planet
scaling_factor = 125.0,
/
+
+&orography
+ orog_init_option = 'none'
+/
diff --git a/applications/lfric2lfric/rose-meta/lfric-lfric2lfric/HEAD/rose-meta.conf b/applications/lfric2lfric/rose-meta/lfric-lfric2lfric/HEAD/rose-meta.conf
index bfde8cee4..f392e31b3 100644
--- a/applications/lfric2lfric/rose-meta/lfric-lfric2lfric/HEAD/rose-meta.conf
+++ b/applications/lfric2lfric/rose-meta/lfric-lfric2lfric/HEAD/rose-meta.conf
@@ -7,6 +7,121 @@ compulsory=false
compulsory=false
!!trigger=namelist:partitioning: .false.;
+[namelist:extrusion_dst]
+compulsory=true
+description=Vertical extrusion settings for the destination mesh.
+help=
+ns=namelist/Model/Mesh/Extrusion
+sort-key=Section-A03
+
+[namelist:extrusion_dst=domain_height]
+compulsory=true
+description=Height of domain above the surface [m]
+fail-if=this < 0.0 ;
+help=Height of the model domain above the surface.
+ =Surface is 0m for planar domains and planet_radius for spherical.
+!kind=default
+range=this > 0.0:
+sort-key=Panel-A02
+type=real
+
+[namelist:extrusion_dst=eta_values]
+!bounds=namelist:extrusion_dst=number_of_layers-1
+compulsory=true
+description=Eta values, excluding 0 and 1
+help=Non-dimensional height values defining the model vertical levels.
+ =The length should be smaller by number_of_layers by one.
+ =
+ =The values must strictly be between 0 and 1:
+ =0 < eta_values < 1
+ =because 0 and 1 are appended to the list automatically.
+!kind=default
+length=:
+range=0.0:1.0
+sort-key=Panel-A04
+type=real
+
+[namelist:extrusion_dst=method]
+compulsory=true
+description=Method for generating eta coordinate
+!enumeration=true
+fail-if=this == 'um_L38_29t_9s_40km' and namelist:extrusion_dst=number_of_layers != 38 ;
+ =this == 'um_L70_50t_20s_80km' and namelist:extrusion_dst=number_of_layers != 70 ;
+ =this == 'um_L85_50t_35s_85km' and namelist:extrusion_dst=number_of_layers != 85 ;
+ =this == 'um_L70_61t_9s_40km' and namelist:extrusion_dst=number_of_layers != 70 ;
+ =this == 'um_L120_99t_21s_40km' and namelist:extrusion_dst=number_of_layers != 120 ;
+ =this == 'um_L140_122t_18s_40km' and namelist:extrusion_dst=number_of_layers != 140 ;
+help=Available extrusion methods are (\f$n$ is number of layers):
+ =0) Specified by user;
+ =1) Uniform eta spacing (\f$\frac{k}{n}\f$);
+ =2) Quadratic eta spacing (\f$\frac{k}{n}^2\f$);
+ =3) Geometric eta spacing (\f$d\eta = \frac{(s - 1)}{(s^{n} - 1)}$)
+ = with stretching factor prescribed (\f$s=1.03$);
+ =4) DCMIP eta spacing (Ullrich et al. (2012) DCMIP documentation, Appendix F.2.)
+ = with flattening parameter prescribed.
+ =5) L38 40km UM specific eta spacing;
+ =6) L70 80km UM specific eta spacing;
+ =7) L85 85km UM specific eta spacing;
+ =8) L70 40km UM specific eta spacing
+ =9) L120 40km UM specific eta spacing
+ =10) L140 40km UM specific eta spacing
+sort-key=Panel-A01
+trigger=namelist:extrusion_dst=eta_values: 'specified_values';
+value-titles=Uniform, Quadratic, Geometric, DCMIP,
+ = um_L38_29t_9s_40km, um_L70_50t_20s_80km, um_L85_50t_35s_85km, um_L70_61t_9s_40km,
+ = um_L120_99t_21s_40km, um_L140_122t_18s_40km
+values='uniform', 'quadratic', 'geometric', 'dcmip',
+ ='um_L38_29t_9s_40km', 'um_L70_50t_20s_80km', 'um_L85_50t_35s_85km', 'um_L70_61t_9s_40km',
+ ='um_L120_99t_21s_40km', 'um_L140_122t_18s_40km'
+
+[namelist:extrusion_dst=number_of_layers]
+compulsory=true
+description=Number of layers in the vertical
+fail-if=this < 1 ;
+help=Setting for number of layers of 3D-mesh in vertical.
+!kind=default
+range=1:
+sort-key=Panel-A03
+type=integer
+
+[namelist:extrusion_dst=planet_radius]
+compulsory=true
+description=Radius of the planet surface [m]
+fail-if=this <= 0.0 ;
+help=Radius of domain bottom. Note: Orography not included.
+!kind=default
+range=this > 0.0:
+sort-key=Panel-A02
+type=real
+
+[namelist:extrusion_dst=stretching_height]
+compulsory=false
+description=Physical height above which surface altitude does not
+ = influence layer height
+fail-if=this < 0.0 ;
+help=Physical height above which surface altitude does not
+ =influence layer height.
+ =Note that in order to reproduce the vertical stretching used in
+ =the UM 'smooth' extrusion, this value should be set to
+ =the value of eta_rho corresponding to the UM level
+ =first_constant_r_rho_level and multiplied by domain_height.
+!kind=default
+range=0:
+sort-key=Panel-A02 ;1
+type=real
+
+[namelist:extrusion_dst=stretching_method]
+compulsory=false
+description=Method of generating stretching
+!enumeration=true
+help=Available stretching methods are:
+ =1) Linear (linear multiple of physical depth)
+ =2) Smooth (quadratic below stretching_height, linear above)
+sort-key=Panel-A01
+trigger=namelist:extrusion_dst=stretching_height: 'smooth' ;
+value-titles=Linear, Smooth
+values='linear', 'smooth'
+
[namelist:lfric2lfric]
compulsory=true
description=
@@ -28,7 +143,6 @@ values='planar', 'spherical'
[namelist:lfric2lfric=destination_mesh_name]
compulsory=true
description=Tag-name for destination-mesh
-fail-if=this == namelist:lfric2lfric=source_mesh_name ;
help=Mesh topologies are held in UGRID conformant NetCDF files which
=may contain more than one mesh topology. This tag-name identifies
=the mesh topology to use from the mesh file namelist:lfric2lfric=destination_meshfile_prefix.
@@ -183,7 +297,6 @@ values='planar', 'spherical'
[namelist:lfric2lfric=source_mesh_name]
compulsory=true
description=Tag-name for source-mesh
-fail-if=this == namelist:lfric2lfric=destination_mesh_name ;
help=Mesh topologies are held in UGRID conformant NetCDF files which
=may contain more than one mesh topology. This tag-name identifies
=the mesh topology to use from the mesh file namelist:lfric2lfric=source_meshfile_prefix.
diff --git a/applications/lfric2lfric/source/algorithm/lfric2lfric_vert_mod.x90 b/applications/lfric2lfric/source/algorithm/lfric2lfric_vert_mod.x90
new file mode 100644
index 000000000..dbbd966d0
--- /dev/null
+++ b/applications/lfric2lfric/source/algorithm/lfric2lfric_vert_mod.x90
@@ -0,0 +1,94 @@
+!-----------------------------------------------------------------------------
+! (C) Crown copyright 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 Apply vertical regridding using the vertical regridding kernels
+!! and height values for the source and target vertically extruded
+!! meshes.
+module lfric2lfric_vert_mod
+
+ use constants_mod, only: str_def, i_def
+ use driver_modeldb_mod, only: modeldb_type
+ use field_parent_mod, only: field_parent_type
+ use field_mod, only: field_type
+ use field_collection_mod, only: field_collection_type
+ use field_collection_iterator_mod, &
+ only: field_collection_iterator_type
+ use sci_geometric_constants_mod, &
+ only: get_height_fv
+ use mesh_mod, only: mesh_type
+ use log_mod, only: log_event, &
+ log_level_info, &
+ log_scratch_space
+
+ implicit none
+
+ private
+ public :: lfric2lfric_vert
+
+contains
+
+ !> @brief Apply vertical regridding
+ !> @details Loop over the fields in the source_fields collection,
+ !! and apply the vertical regridding kernels to obtain the regridded
+ !! field in the target_fields collection.
+ !> @param modeldb Model state object
+ !> @param source_fields The collection of fields to be regridded
+ !> @param target_fields The collection of regridded fields
+ subroutine lfric2lfric_vert( modeldb, source_fields, target_fields )
+
+ implicit none
+
+ type(modeldb_type), intent(inout) :: modeldb
+ type(field_collection_type), intent(inout) :: source_fields
+ type(field_collection_type), intent(inout) :: target_fields
+
+ type(field_collection_iterator_type) :: iter
+
+ class(field_parent_type), pointer :: field
+ type(field_type), pointer :: field_src
+ type(field_type), pointer :: field_dst
+ type(field_type), pointer :: height_src
+ type(field_type), pointer :: height_dst
+ type(mesh_type), pointer :: mesh_src
+ type(mesh_type), pointer :: mesh_dst
+
+ character(len=str_def) :: field_name
+ integer(kind=i_def) :: fs_src, fs_dst
+
+ ! Main loop over fields to be processed
+ call iter%initialise(source_fields)
+ do
+ ! Locate the field to be processed in the field collections
+ if ( .not.iter%has_next() ) exit
+ field => iter%next()
+ field_name = field%get_name()
+
+ call source_fields%get_field(field_name, field_src)
+ call target_fields%get_field(field_name, field_dst)
+
+ write(log_scratch_space, '(A,A)') "Processing lfric field ", &
+ trim(field_name)
+ call log_event(log_scratch_space, log_level_info)
+
+ mesh_src => field_src%get_mesh()
+ mesh_dst => field_dst%get_mesh()
+ fs_src = field_src%which_function_space()
+ fs_dst = field_dst%which_function_space()
+
+ ! Get the associated heights, ready for vertical interpolation kernels
+ height_src => get_height_fv(modeldb%config, mesh_src, fs_src)
+ height_dst => get_height_fv(modeldb%config, mesh_dst, fs_dst)
+
+ ! Dummy initialisation - just writing out the heights
+ ! TODO Replaced the dummy initialisation with actual
+ ! vertical regridding from #253. i.e.
+ ! call invoke( lfric2lfric_vert_lin_interp_lin_extrap_code_r_single( &
+ ! field_dst, field_src, height_dst, height_src))
+ call invoke(setval_X(field_dst, height_dst))
+ enddo
+
+ end subroutine lfric2lfric_vert
+
+end module lfric2lfric_vert_mod
diff --git a/applications/lfric2lfric/source/driver/lfric2lfric_driver_mod.F90 b/applications/lfric2lfric/source/driver/lfric2lfric_driver_mod.F90
index a5ac9addd..0e5f16b00 100644
--- a/applications/lfric2lfric/source/driver/lfric2lfric_driver_mod.F90
+++ b/applications/lfric2lfric/source/driver/lfric2lfric_driver_mod.F90
@@ -8,7 +8,7 @@
module lfric2lfric_driver_mod
use constants_mod, only: str_def, str_max_filename, &
- i_def, l_def, r_second
+ i_def, r_def, l_def, r_second
use driver_fem_mod, only: final_fem
use driver_io_mod, only: final_io
use driver_modeldb_mod, only: modeldb_type
@@ -24,6 +24,9 @@ module lfric2lfric_driver_mod
use sci_checksum_alg_mod, only: checksum_alg
use xios, only: xios_date, xios_get_current_date, &
xios_date_convert_to_string
+ use orography_config_mod, only: orog_init_option_analytic, &
+ orog_init_option_ancil, &
+ orog_init_option_start_dump
!------------------------------------
! lfric2lfric modules
@@ -32,8 +35,11 @@ module lfric2lfric_driver_mod
use lfric2lfric_infrastructure_mod, only: initialise_infrastructure, &
context_dst, context_src, &
source_collection_name, &
- target_collection_name
+ target_collection_name, &
+ interm_collection_name, &
+ src, dst
use lfric2lfric_regrid_mod, only: lfric2lfric_regrid
+ use lfric2lfric_vert_mod, only: lfric2lfric_vert
implicit none
@@ -98,10 +104,41 @@ subroutine run( modeldb, oasis_clock )
type(field_collection_type), pointer :: source_fields
type(field_collection_type), pointer :: target_fields
+ type(field_collection_type), pointer :: interm_fields
type(lfric_xios_context_type), pointer :: io_context
+ character(len=str_def) :: mesh_names(2)
+ integer(kind=i_def) :: src_extrusion_method
+ integer(kind=i_def) :: dst_extrusion_method
+ integer(kind=i_def) :: src_number_of_layers
+ integer(kind=i_def) :: dst_number_of_layers
+ integer(kind=i_def) :: src_stretching_method
+ integer(kind=i_def) :: dst_stretching_method
+ integer(kind=i_def) :: orog_init_option
+ real(kind=r_def) :: src_domain_height
+ real(kind=r_def) :: dst_domain_height
+ real(kind=r_def) :: src_stretching_height
+ real(kind=r_def) :: dst_stretching_height
+
+ logical(kind=l_def), pointer :: vertical_change
+ logical(kind=l_def), pointer :: horizontal_change
+
! Extract configuration variables
+ src_extrusion_method = modeldb%config%extrusion%method()
+ src_number_of_layers = modeldb%config%extrusion%number_of_layers()
+ src_domain_height = modeldb%config%extrusion%domain_height()
+ src_stretching_height = modeldb%config%extrusion%stretching_height()
+ src_stretching_method = modeldb%config%extrusion%stretching_method()
+ dst_extrusion_method = modeldb%config%extrusion_dst%method()
+ dst_number_of_layers = modeldb%config%extrusion_dst%number_of_layers()
+ dst_domain_height = modeldb%config%extrusion_dst%domain_height()
+ dst_stretching_height = modeldb%config%extrusion_dst%stretching_height()
+ dst_stretching_method = modeldb%config%extrusion_dst%stretching_method()
+ orog_init_option = modeldb%config%orography%orog_init_option()
+
+ mesh_names(dst) = modeldb%config%lfric2lfric%destination_mesh_name()
+ mesh_names(src) = modeldb%config%lfric2lfric%source_mesh_name()
start_dump_filename = modeldb%config%files%start_dump_filename()
checkpoint_stem_name = modeldb%config%files%checkpoint_stem_name()
@@ -112,12 +149,30 @@ subroutine run( modeldb, oasis_clock )
source_fields => modeldb%fields%get_field_collection(source_collection_name)
target_fields => modeldb%fields%get_field_collection(target_collection_name)
+ call modeldb%values%get_value("vertical_change", vertical_change)
+ call modeldb%values%get_value("horizontal_change", horizontal_change)
+
+ if (horizontal_change .and. vertical_change) then
+ interm_fields => modeldb%fields%get_field_collection(interm_collection_name)
+
+ else if (horizontal_change .and. .not. vertical_change) then
+ interm_fields => modeldb%fields%get_field_collection(target_collection_name)
+
+ else if (vertical_change .and. .not. horizontal_change) then
+ interm_fields => modeldb%fields%get_field_collection(source_collection_name)
+ end if
+
! Read fields and perform the regridding
if (mode == mode_ics) then
call read_state(source_fields, prefix='restart_')
- call lfric2lfric_regrid(modeldb, oasis_clock, source_fields, &
- target_fields, regrid_method)
+ if (horizontal_change) then
+ call lfric2lfric_regrid(modeldb, oasis_clock, source_fields, &
+ interm_fields, regrid_method)
+ end if
+ if (vertical_change) then
+ call lfric2lfric_vert(modeldb, interm_fields, target_fields)
+ end if
! Write output
call modeldb%io_contexts%get_io_context(context_dst, io_context)
@@ -139,8 +194,13 @@ subroutine run( modeldb, oasis_clock )
call read_state(source_fields)
- call lfric2lfric_regrid(modeldb, oasis_clock, source_fields, &
- target_fields, regrid_method)
+ if (horizontal_change) then
+ call lfric2lfric_regrid(modeldb, oasis_clock, source_fields, &
+ interm_fields, regrid_method)
+ end if
+ if (vertical_change) then
+ call lfric2lfric_vert(modeldb, interm_fields, target_fields)
+ end if
is_running = modeldb%clock%tick()
diff --git a/applications/lfric2lfric/source/driver/lfric2lfric_init_mod.f90 b/applications/lfric2lfric/source/driver/lfric2lfric_init_mod.f90
index ab2a73b09..c6be9c365 100644
--- a/applications/lfric2lfric/source/driver/lfric2lfric_init_mod.f90
+++ b/applications/lfric2lfric/source/driver/lfric2lfric_init_mod.f90
@@ -11,7 +11,7 @@
module lfric2lfric_init_mod
- use constants_mod, only: i_def, r_def, str_def
+ use constants_mod, only: i_def, r_def, str_def, l_def
use driver_modeldb_mod, only: modeldb_type
use field_collection_mod, only: field_collection_type
use lfric_xios_context_mod, only: lfric_xios_context_type
@@ -19,6 +19,10 @@ module lfric2lfric_init_mod
log_level_info
use mesh_mod, only: mesh_type
use netcdf, only: nf90_max_name
+ use orography_config_mod, only: orog_init_option, &
+ orog_init_option_analytic, &
+ orog_init_option_ancil, &
+ orog_init_option_start_dump
! lfric2lfric mods
use lfric2lfric_config_mod, only: mode_ics, mode_lbc
@@ -43,14 +47,19 @@ module lfric2lfric_init_mod
!> @param [in] origin_collection_name Holds the origin fields
!> @param [in] origin_mesh Mesh to initialise 3D fields
!> @param [in] origin_twod_mesh Mesh to initialise 2D fields
+ !> @param [in] interm_collection_name Holds the intermediate fields
+ !> @param [in] interm_mesh Mesh for intermediate 3D fields
+ !> @param [in] interm_twod_mesh Mesh for intermediate 2D fields
!> @param [in] target_collection_name Holds target fields
!> @param [in] target_mesh Mesh for target 3D fields
!> @param [in] target_twod_mesh Mesh for target 2D fields
- subroutine init_lfric2lfric( modeldb, context_src, context_dst, &
- start_dump_filename, mode, &
- origin_collection_name, &
- origin_mesh, origin_twod_mesh, &
- target_collection_name, &
+ subroutine init_lfric2lfric( modeldb, context_src, context_dst, &
+ start_dump_filename, mode, &
+ origin_collection_name, &
+ origin_mesh, origin_twod_mesh, &
+ interm_collection_name, &
+ interm_mesh, interm_twod_mesh, &
+ target_collection_name, &
target_mesh, target_twod_mesh )
implicit none
@@ -63,11 +72,16 @@ subroutine init_lfric2lfric( modeldb, context_src, context_dst, &
character(len=*), intent(in) :: origin_collection_name
type(mesh_type), intent(in), pointer :: origin_mesh
type(mesh_type), intent(in), pointer :: origin_twod_mesh
- ! Optionals
+ character(len=*), intent(in) :: interm_collection_name
+ type(mesh_type), intent(in), pointer :: interm_mesh
+ type(mesh_type), intent(in), pointer :: interm_twod_mesh
character(len=*), intent(in) :: target_collection_name
type(mesh_type), intent(in), pointer :: target_mesh
type(mesh_type), intent(in), pointer :: target_twod_mesh
+ logical(l_def), pointer :: horizontal_change
+ logical(l_def), pointer :: vertical_change
+
! For field creation and storage
type(field_collection_type), pointer :: field_collection
@@ -84,6 +98,9 @@ subroutine init_lfric2lfric( modeldb, context_src, context_dst, &
call log_event( 'lfric2lfric: Initialising miniapp ...', log_level_info )
+ call modeldb%values%get_value("vertical_change", vertical_change)
+ call modeldb%values%get_value("horizontal_change", horizontal_change)
+
if (mode == mode_ics) then
prefix = 'restart_'
else if (mode == mode_lbc) then
@@ -133,6 +150,40 @@ subroutine init_lfric2lfric( modeldb, context_src, context_dst, &
prefix )
end do
+ if ( orog_init_option == orog_init_option_analytic .or. &
+ orog_init_option == orog_init_option_ancil .or. &
+ orog_init_option == orog_init_option_start_dump ) then
+ if ( mode == mode_ics ) then
+
+ call field_maker(field_collection, trim('surface_altitude'), &
+ target_mesh, target_twod_mesh, prefix)
+
+ end if
+ end if
+
+ !--------------------------------------------------------------------------
+ ! Initialise Intermediate Fields
+ !--------------------------------------------------------------------------
+ if (horizontal_change .and. vertical_change) then
+ call modeldb%fields%add_empty_field_collection(interm_collection_name)
+ field_collection => &
+ modeldb%fields%get_field_collection(interm_collection_name)
+
+ if (mode == mode_ics) then
+ prefix = 'checkpoint_'
+ else if (mode == mode_lbc) then
+ prefix = 'lbc_'
+ end if
+
+ do i = 1, num_fields
+ call field_maker( field_collection, &
+ config_list(i), &
+ interm_mesh, &
+ interm_twod_mesh, &
+ prefix )
+ end do
+ end if
+
call modeldb%io_contexts%get_io_context(context_src, io_context)
call io_context%set_current()
diff --git a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90
index 9a090f634..7d68aedde 100644
--- a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90
+++ b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90
@@ -16,8 +16,7 @@ module lfric2lfric_infrastructure_mod
use blend_orography_alg_mod, only: blend_orography
use constants_mod, only: str_def, str_max_filename, &
r_def, i_def, l_def, r_second
- use create_mesh_mod, only: create_extrusion, &
- create_mesh
+ use create_mesh_mod, only: create_mesh
use driver_modeldb_mod, only: modeldb_type
use driver_fem_mod, only: init_fem
use driver_io_mod, only: init_io, &
@@ -31,13 +30,7 @@ module lfric2lfric_infrastructure_mod
use fs_continuity_mod, only: W3
use function_space_collection_mod,only: function_space_collection
use function_space_mod, only: function_space_type
- use gungho_extrusion_mod, only: dcmip_extrusion_type, &
- um_L38_29t_9s_40km_extrusion_type, &
- um_L85_50t_35s_85km_extrusion_type, &
- um_L70_61t_9s_40km_extrusion_type, &
- um_L120_99t_21s_40km_extrusion_type, &
- um_L140_122t_18s_40km_extrusion_type, &
- um_L70_50t_20s_80km_extrusion_type
+ use gungho_extrusion_mod, only: create_extrusion
use sci_geometric_constants_mod, only: get_chi_inventory, &
get_panel_id_inventory
use init_altitude_mod, only: init_altitude
@@ -47,6 +40,7 @@ module lfric2lfric_infrastructure_mod
use lfric_xios_action_mod, only: advance
use log_mod, only: log_event, &
log_scratch_space, &
+ log_level_info, &
log_level_error, &
log_level_debug
use mesh_mod, only: mesh_type
@@ -71,6 +65,8 @@ module lfric2lfric_infrastructure_mod
use lfric2lfric_init_coupler_mod,only: lfric2lfric_init_coupler_src, &
lfric2lfric_init_coupler_dst, &
lfric2lfric_end_coupler_init
+ use lfric2lfric_field_init_mod, only: field_maker
+ use netcdf, only: nf90_max_name
#ifdef MCT
use coupling_mod, only: coupling_type, &
get_coupling_from_collection
@@ -103,6 +99,9 @@ module lfric2lfric_infrastructure_mod
source_topology_non_periodic, &
source_geometry_planar, &
source_geometry_spherical
+ use orography_config_mod, only: orog_init_option_analytic, &
+ orog_init_option_ancil, &
+ orog_init_option_start_dump
implicit none
@@ -117,6 +116,10 @@ module lfric2lfric_infrastructure_mod
! Source and destination field collection names
character(len=*), public, parameter :: source_collection_name = "source_fields"
character(len=*), public, parameter :: target_collection_name = "target_fields"
+ character(len=*), public, parameter :: interm_collection_name = "intermediate_fields"
+
+ integer(kind=i_def), public, parameter :: dst = 1 ! destination mesh, destination extrusion
+ integer(kind=i_def), public, parameter :: src = 2 ! source mesh, source extrusion
contains
@@ -156,16 +159,20 @@ contains
type(mesh_type), pointer :: twod_mesh_src
type(mesh_type), pointer :: mesh_dst
type(mesh_type), pointer :: twod_mesh_dst
- type(mesh_type), pointer :: orography_twod_mesh
- type(mesh_type), pointer :: orography_mesh
-
- class(extrusion_type), allocatable :: extrusion
+ type(mesh_type), pointer :: mesh_interm
+ type(mesh_type), pointer :: orography_twod_mesh_src
+ type(mesh_type), pointer :: orography_mesh_src
+ type(mesh_type), pointer :: orography_twod_mesh_dst
+ type(mesh_type), pointer :: orography_mesh_dst
+
+ class(extrusion_type), allocatable :: src_extrusion
+ class(extrusion_type), allocatable :: dst_extrusion
type(uniform_extrusion_type), allocatable :: extrusion_2d
! Namelist parameters
- character(len=str_def) :: mesh_names(2)
- character(len=str_def), allocatable :: twod_names(:)
-
+ character(len=str_def) :: mesh_names(2)
+ character(len=str_def), allocatable :: mesh_names_dst_ext(:)
+ character(len=str_def), allocatable :: twod_names(:)
character(len=str_max_filename) :: start_dump_filename
character(len=str_max_filename) :: source_file_lbc
@@ -179,9 +186,20 @@ contains
integer(kind=i_def) :: element_order_h
integer(kind=i_def) :: element_order_v
- integer(kind=i_def) :: extrusion_method
- integer(kind=i_def) :: number_of_layers
- real(kind=r_def) :: domain_height
+ integer(kind=i_def) :: src_extrusion_method
+ integer(kind=i_def) :: dst_extrusion_method
+ integer(kind=i_def) :: src_number_of_layers
+ integer(kind=i_def) :: dst_number_of_layers
+ integer(kind=i_def) :: src_stretching_method
+ integer(kind=i_def) :: dst_stretching_method
+ integer(kind=i_def) :: orog_init_option
+ real(kind=r_def) :: src_domain_height
+ real(kind=r_def) :: dst_domain_height
+ real(kind=r_def) :: src_stretching_height
+ real(kind=r_def) :: dst_stretching_height
+
+ logical(kind=l_def) :: vertical_change
+ logical(kind=l_def) :: horizontal_change
integer(i_def) :: tile_size_x
integer(i_def) :: tile_size_y
@@ -191,9 +209,6 @@ contains
integer(kind=i_def) :: i
integer(kind=i_def), parameter :: one_layer = 1_i_def
- integer(kind=i_def), parameter :: dst = 1
- integer(kind=i_def), parameter :: src = 2
-
type(coupling_type), pointer :: coupling_ptr
type(field_collection_type), pointer :: cpl_snd_2d
type(field_collection_type), pointer :: cpl_rcv_2d
@@ -202,6 +217,9 @@ contains
integer(kind=i_def) :: ierror
logical(kind=l_def) :: is_running
+ type(field_collection_type), pointer :: target_collection
+ type(field_type), pointer :: field
+
!------------------------
! XIOS contexts
!------------------------
@@ -228,9 +246,17 @@ contains
scaled_radius = modeldb%config%planet%scaled_radius()
- extrusion_method = modeldb%config%extrusion%method()
- number_of_layers = modeldb%config%extrusion%number_of_layers()
- domain_height = modeldb%config%extrusion%domain_height()
+ src_extrusion_method = modeldb%config%extrusion%method()
+ src_number_of_layers = modeldb%config%extrusion%number_of_layers()
+ src_domain_height = modeldb%config%extrusion%domain_height()
+ src_stretching_height = modeldb%config%extrusion%stretching_height()
+ src_stretching_method = modeldb%config%extrusion%stretching_method()
+ dst_extrusion_method = modeldb%config%extrusion_dst%method()
+ dst_number_of_layers = modeldb%config%extrusion_dst%number_of_layers()
+ dst_domain_height = modeldb%config%extrusion_dst%domain_height()
+ dst_stretching_height = modeldb%config%extrusion_dst%stretching_height()
+ dst_stretching_method = modeldb%config%extrusion_dst%stretching_method()
+ orog_init_option = modeldb%config%orography%orog_init_option()
mode = modeldb%config%lfric2lfric%mode()
regrid_method = modeldb%config%lfric2lfric%regrid_method()
@@ -249,6 +275,46 @@ contains
tile_size_y = 1
inner_halo_tiles = .false.
+ ! Vertical interpolation is required if there is a change in the vertical
+ ! extrusion, or a change in the orography
+ vertical_change = .false.
+ if ( src_extrusion_method /= dst_extrusion_method .or. &
+ src_number_of_layers /= dst_number_of_layers .or. &
+ src_domain_height /= dst_domain_height .or. &
+ src_stretching_height /= dst_stretching_height .or. &
+ src_stretching_method /= dst_stretching_method ) then
+ vertical_change = .true.
+ end if
+ if ( orog_init_option == orog_init_option_analytic .or. &
+ orog_init_option == orog_init_option_ancil .or. &
+ orog_init_option == orog_init_option_start_dump ) then
+ vertical_change = .true.
+ end if
+
+ ! Horizontal interpolation is required if there is a change
+ ! in the mesh (horizontal grid)
+ horizontal_change = .false.
+ if ( mesh_names(dst) /= mesh_names(src) ) then
+ horizontal_change = .true.
+ end if
+
+ call modeldb%values%add_key_value('vertical_change', vertical_change)
+ call modeldb%values%add_key_value('horizontal_change', horizontal_change)
+
+ if ( horizontal_change ) then
+ call log_event("Horizontal interpolation logical set to TRUE", &
+ log_level_info)
+ else
+ call log_event("Horizontal interpolation logical set to FALSE", &
+ log_level_info)
+ end if
+ if ( vertical_change ) then
+ call log_event("Vertical interpolation logical set to TRUE", &
+ log_level_info)
+ else
+ call log_event("Vertical interpolation logical set to FALSE", &
+ log_level_info)
+ end if
!=======================================================================
! Mesh
!=======================================================================
@@ -283,56 +349,23 @@ contains
log_level_error)
end select
- select case (extrusion_method)
- case (method_uniform, method_quadratic, method_geometric)
- allocate( extrusion, source=create_extrusion( &
- extrusion_method, domain_height, &
- domain_bottom, number_of_layers, &
- prime_extrusion ) )
-
- case (method_dcmip)
- allocate( extrusion, source=dcmip_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L38_29t_9s_40km)
- allocate( extrusion, source=um_l38_29t_9s_40km_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L85_50t_35s_85km)
- allocate( extrusion, source=um_l85_50t_35s_85km_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L70_50t_20s_80km)
- allocate( extrusion, source=um_l70_50t_20s_80km_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L70_61t_9s_40km)
- allocate( extrusion, source=um_l70_61t_9s_40km_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L120_99t_21s_40km)
- allocate( extrusion, source=um_L120_99t_21s_40km_extrusion_type( &
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
-
- case (method_um_L140_122t_18s_40km)
- allocate( extrusion, source=um_L140_122t_18s_40km_extrusion_type(&
- domain_bottom, domain_height, &
- number_of_layers, prime_extrusion ) )
+ allocate( src_extrusion, source = &
+ create_extrusion( src_extrusion_method, &
+ geometry, &
+ src_number_of_layers, &
+ src_domain_height, &
+ scaled_radius ))
- case default
- write( log_scratch_space, '(A)' ) &
- "lfric2lfric_infrastructure_mod" // &
- ': Unrecognised extrusion method: ' // &
- trim(key_from_method( extrusion_method ))
- call log_event( log_scratch_space, log_level_error )
+ if (vertical_change) then
- end select
+ allocate( dst_extrusion, source = &
+ create_extrusion( dst_extrusion_method, &
+ geometry, &
+ dst_number_of_layers, &
+ dst_domain_height, &
+ scaled_radius ))
+
+ end if
extrusion_2d = uniform_extrusion_type( domain_bottom, &
domain_bottom, &
@@ -349,10 +382,27 @@ contains
call init_mesh( modeldb%config, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
- mesh_names, extrusion, &
+ mesh_names, src_extrusion, &
inner_halo_tiles, tile_size, &
stencil_depth, regrid_method )
+
+ allocate( mesh_names_dst_ext, source=mesh_names )
+
+ if (vertical_change) then
+ do i=1, size(mesh_names)
+ mesh_names_dst_ext(i) = trim(mesh_names(i))//'_dst_ext'
+ end do
+ call create_mesh( mesh_names, &
+ dst_extrusion, &
+ inner_halo_tiles, tile_size, &
+ alt_name=mesh_names_dst_ext )
+ else
+ do i=1, size(mesh_names)
+ mesh_names_dst_ext(i) = trim(mesh_names(i))
+ end do
+ end if
+
allocate( twod_names, source=mesh_names )
do i=1, size(twod_names)
twod_names(i) = trim(twod_names(i))//'_2d'
@@ -375,9 +425,23 @@ contains
!-----------------------------------------------------------------------
! Assign pointers to the correct meshes
!-----------------------------------------------------------------------
+ ! If the source extrusion is the same as the destination extrusion,
+ ! mesh_dst = mesh_interm and only horizontal interpolation is applied.
+ !
+ ! If the source mesh is the same as the destination mesh,
+ ! mesh_src = mesh_interm and only vertical interpolation is applied.
+ !
+ ! The source meshes
mesh_src => mesh_collection%get_mesh(trim(mesh_names(src)))
twod_mesh_src => mesh_collection%get_mesh(trim(twod_names(src)))
- mesh_dst => mesh_collection%get_mesh(trim(mesh_names(dst)))
+
+ ! The interim mesh (horizontal interpolation of mesh_names(src)
+ ! to mesh_names(dst))
+ mesh_interm => mesh_collection%get_mesh(trim(mesh_names(dst)))
+
+ ! The destination mesh (vertical interpolation of mesh_names(dst) to
+ ! mesh_names_dst_ext(dst)
+ mesh_dst => mesh_collection%get_mesh(trim(mesh_names_dst_ext(dst)))
twod_mesh_dst => mesh_collection%get_mesh(trim(twod_names(dst)))
! Log this change
@@ -385,10 +449,12 @@ contains
log_level_debug)
call log_event('Source 2D mesh set to: ' // twod_names(src), &
log_level_debug)
- call log_event('Destination mesh set to: ' // mesh_names(dst), &
+ call log_event('Destination mesh set to: ' // mesh_names_dst_ext(dst), &
log_level_debug)
call log_event('Destination 2D mesh set to: ' // twod_names(dst), &
log_level_debug)
+ call log_event('Intermediate mesh set to: ' // mesh_names(dst), &
+ log_level_debug)
!=======================================================================
! Setup I/O system
@@ -401,14 +467,15 @@ contains
files_init_ptr => init_lfric2lfric_dst_files
! Initialise the IO context with all the required info
- call init_io( context_dst, &
- mesh_names(dst), &
- modeldb, &
- chi_inventory, &
- panel_id_inventory, &
- geometry, topology, &
+ call init_io( context_dst, &
+ mesh_names_dst_ext(dst), &
+ modeldb, &
+ chi_inventory, &
+ panel_id_inventory, &
+ geometry, topology, &
populate_filelist=files_init_ptr )
+
call modeldb%io_contexts%get_io_context(context_dst, io_context_dst)
if (mode == mode_ics) then
@@ -441,11 +508,11 @@ contains
halo_depth = twod_mesh_dst%get_halo_depth())
! Get pointers to the destination mesh:
- orography_mesh => mesh_collection%get_mesh(mesh_names(dst))
- orography_twod_mesh => mesh_collection%get_mesh(orography_mesh, TWOD)
+ orography_mesh_dst => mesh_collection%get_mesh(mesh_names(dst))
+ orography_twod_mesh_dst => mesh_collection%get_mesh(orography_mesh_dst, TWOD)
! Set up surface altitude field - this will be used to generate orography
- call init_altitude( orography_twod_mesh, surface_altitude_dst )
+ call init_altitude( orography_twod_mesh_dst, surface_altitude_dst )
end if
!-----------------------------------------------------------------------
@@ -485,34 +552,36 @@ contains
orog_init_option == orog_init_option_start_dump ) then
! Get pointers to the source mesh:
- orography_mesh => mesh_collection%get_mesh(mesh_names(src))
- orography_twod_mesh => mesh_collection%get_mesh(orography_mesh, TWOD)
+ orography_mesh_src => mesh_collection%get_mesh(mesh_names(src))
+ orography_twod_mesh_src => mesh_collection%get_mesh(orography_mesh_src, TWOD)
call surface_altitude_src%initialise(vector_space, &
name='surface_altitude_src', &
halo_depth = twod_mesh_src%get_halo_depth())
! Set up surface altitude field - this will be used to generate orography
- call init_altitude( orography_twod_mesh, surface_altitude_src )
+ call init_altitude( orography_twod_mesh_src, surface_altitude_src )
end if
!=======================================================================
! Create and initialise prognostic fields
!=======================================================================
if (mode == mode_ics) then
- call init_lfric2lfric( modeldb, context_src, context_dst, &
- start_dump_filename, mode, &
- source_collection_name, mesh_src, twod_mesh_src, &
- target_collection_name, mesh_dst, twod_mesh_dst )
+ call init_lfric2lfric( modeldb, context_src, context_dst, &
+ start_dump_filename, mode, &
+ source_collection_name, mesh_src, twod_mesh_src, &
+ interm_collection_name, mesh_interm, twod_mesh_dst, &
+ target_collection_name, mesh_dst, twod_mesh_dst )
else if (mode == mode_lbc) then
- call init_lfric2lfric( modeldb, context_src, context_dst, &
- source_file_lbc, mode, &
- source_collection_name, mesh_src, twod_mesh_src, &
- target_collection_name, mesh_dst, twod_mesh_dst )
+ call init_lfric2lfric( modeldb, context_src, context_dst, &
+ source_file_lbc, mode, &
+ source_collection_name, mesh_src, twod_mesh_src, &
+ interm_collection_name, mesh_interm, twod_mesh_dst, &
+ target_collection_name, mesh_dst, twod_mesh_dst )
end if
!=======================================================================
- ! Initialize variables for each regrid method
+ ! Initialize variables for each horizontal regrid method
!=======================================================================
select case (regrid_method)
case (regrid_method_map)
@@ -601,15 +670,48 @@ contains
call blend_orography(surface_altitude_dst, surface_altitude_src_on_dst, &
mesh_names(dst))
- call setup_orography_alg( mesh_names(dst:dst), &
- orography_mesh%get_mesh_name(), &
- chi_inventory, &
- panel_id_inventory, &
+ ! Copy the destination (possibly blended) orography to the output fields
+ ! --------------------------------------------------------
+
+ if (mode == mode_ics) then
+ target_collection => modeldb%fields%get_field_collection(target_collection_name)
+ call target_collection%get_field("surface_altitude", field)
+ call invoke(setval_X(field,surface_altitude_dst))
+ end if
+
+ ! Adjust the chi fields to account for the orography
+ ! --------------------------------------------------------
+ ! source mesh, source extrusion, source orography
+ call setup_orography_alg( mesh_names(src:src), &
+ orography_mesh_src%get_mesh_name(), &
+ chi_inventory, &
+ panel_id_inventory, &
+ src_stretching_height, &
+ src_stretching_method, &
+ surface_altitude_src )
+
+ ! destination mesh, source extrusion, source orog on destination mesh
+ call setup_orography_alg( mesh_names(dst:dst), &
+ orography_mesh_dst%get_mesh_name(), &
+ chi_inventory, &
+ panel_id_inventory, &
+ src_stretching_height, &
+ src_stretching_method, &
+ surface_altitude_src_on_dst )
+
+ ! destination mesh, destination extrusion, destination orog
+ call setup_orography_alg( mesh_names_dst_ext(dst:dst), &
+ orography_mesh_dst%get_mesh_name(), &
+ chi_inventory, &
+ panel_id_inventory, &
+ dst_stretching_height, &
+ dst_stretching_method, &
surface_altitude_dst )
end if
deallocate(twod_names)
- deallocate(extrusion)
+ deallocate(src_extrusion)
+ if (allocated(dst_extrusion)) deallocate(dst_extrusion)
end subroutine initialise_infrastructure
diff --git a/rose-stem/app/lfric2lfric/file/iodef_orography.xml b/rose-stem/app/lfric2lfric/file/iodef_orography.xml
index 787a8bb18..8cc65056a 100644
--- a/rose-stem/app/lfric2lfric/file/iodef_orography.xml
+++ b/rose-stem/app/lfric2lfric/file/iodef_orography.xml
@@ -63,6 +63,8 @@
+
+
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-C12.conf b/rose-stem/app/lfric2lfric/opt/rose-app-C12.conf
new file mode 100644
index 000000000..87cbe9951
--- /dev/null
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-C12.conf
@@ -0,0 +1,5 @@
+[namelist:lfric2lfric]
+destination_mesh_name='dynamics'
+destination_meshfile_prefix='${MESH_DIR}/C12/mesh_C12'
+source_mesh_name='dynamics'
+source_meshfile_prefix='${MESH_DIR}/C12/mesh_C12'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-C12_C16_lam.conf b/rose-stem/app/lfric2lfric/opt/rose-app-C12_C16_lam.conf
index 330c8f6e2..6facf3930 100644
--- a/rose-stem/app/lfric2lfric/opt/rose-app-C12_C16_lam.conf
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-C12_C16_lam.conf
@@ -1,9 +1,6 @@
[file:iodef.xml]
source=$ROSE_SUITE_DIR/app/lfric2lfric/file/iodef_orography.xml
-[namelist:files]
-orography_mean_ancil_path=''
-
[namelist:lfric2lfric]
destination_mesh_name='dynamics'
destination_meshfile_prefix='${MESH_DIR}/seuk_MG/mesh_seuk_MG'
@@ -14,6 +11,3 @@ source_mesh_name='C12'
source_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12'
src_ancil_directory='$BIG_DATA_DIR/ancils/basic-gagl/Puku/C12/n96e'
src_orography_mean_ancil_path='orography/globe30/qrparm.orog.ugrid'
-
-[namelist:orography]
-orog_init_option='ancil'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9.conf b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9.conf
index 723f79bc3..4cb909333 100644
--- a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9.conf
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9.conf
@@ -8,6 +8,13 @@ number_of_layers=70
stretching_height=17507.0
stretching_method='smooth'
+[namelist:extrusion_dst]
+domain_height=80000.0
+method='um_L70_50t_20s_80km'
+number_of_layers=70
+stretching_height=17507.0
+stretching_method='smooth'
+
[namelist:files]
checkpoint_stem_name='restart_lfric2lfric_clim_gal9_C12_MG'
start_dump_filename='lfric2lfric_clim_gal9_C12_MG'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf
index c9a253632..4af46b881 100644
--- a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf
@@ -1,6 +1,17 @@
[file:lfric2lfric_clim_gal9_C12_MG.nc]
source="$BIG_DATA_DIR/start_dumps/proto-ral/AppsTicket110/lfric_atm_clim_gal9_C12_dt-1800p0_intel_64-bit_fast-debug_000072.nc"
+[namelist:boundaries]
+blend_frequency='inner'
+blending_weights=1.0,1.0,1.0,1.0,0.9,0.7,0.5,0.3,0.1
+blending_weights_w2v=1.0,1.0,1.0,1.0,0.9,0.7,0.5,0.3,0.1
+lbc_eos_height=10
+lbc_method='onion_layer'
+limited_area=.true.
+normal_only=.true.
+output_lbcs=.true.
+solver_boundary_depth=4
+
[namelist:extrusion]
domain_height=80000.0
method='um_L70_50t_20s_80km'
@@ -8,6 +19,13 @@ number_of_layers=70
stretching_height=17507.0
stretching_method='smooth'
+[namelist:extrusion_dst]
+domain_height=80000.0
+method='um_L70_50t_20s_80km'
+number_of_layers=70
+stretching_height=17507.0
+stretching_method='smooth'
+
[namelist:files]
checkpoint_stem_name='restart_lfric2lfric_ral_seuk_MG'
start_dump_filename='lfric2lfric_clim_gal9_C12_MG'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-dst_L38_40km.conf b/rose-stem/app/lfric2lfric/opt/rose-app-dst_L38_40km.conf
new file mode 100644
index 000000000..ae8fce007
--- /dev/null
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-dst_L38_40km.conf
@@ -0,0 +1,6 @@
+[namelist:extrusion_dst]
+domain_height=39254.833575999997
+method='um_L38_29t_9s_40km'
+number_of_layers=38
+planet_radius=6371229.0
+stretching_method='linear'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-ral3.conf b/rose-stem/app/lfric2lfric/opt/rose-app-ral3.conf
index 4235bafd0..5d9d3e097 100644
--- a/rose-stem/app/lfric2lfric/opt/rose-app-ral3.conf
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-ral3.conf
@@ -11,6 +11,13 @@ number_of_layers=70
stretching_height=16641.984
stretching_method='smooth'
+[namelist:extrusion_dst]
+domain_height=40000.0
+method='um_L70_61t_9s_40km'
+number_of_layers=70
+stretching_height=16641.984
+stretching_method='smooth'
+
[namelist:files]
checkpoint_stem_name='restart_lfric2lfric_ral3_seuk'
!!lbc_directory='$BIG_DATA_DIR/lbcs/proto-ral/Ticket3510/seuk'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-ral_seuk.conf b/rose-stem/app/lfric2lfric/opt/rose-app-ral_seuk.conf
index 558c0e578..1def0d95c 100644
--- a/rose-stem/app/lfric2lfric/opt/rose-app-ral_seuk.conf
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-ral_seuk.conf
@@ -11,6 +11,13 @@ number_of_layers=70
stretching_height=16641.984
stretching_method='smooth'
+[namelist:extrusion_dst]
+domain_height=40000.0
+method='um_L70_61t_9s_40km'
+number_of_layers=70
+stretching_height=16641.984
+stretching_method='smooth'
+
[namelist:files]
checkpoint_stem_name='restart_lfric2lfric_ral_seuk_MG'
start_dump_filename='lfric2lfric_ral_seuk_MG'
diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-src_L70_80km.conf b/rose-stem/app/lfric2lfric/opt/rose-app-src_L70_80km.conf
new file mode 100644
index 000000000..d97fabaeb
--- /dev/null
+++ b/rose-stem/app/lfric2lfric/opt/rose-app-src_L70_80km.conf
@@ -0,0 +1,6 @@
+[namelist:extrusion]
+domain_height=80000.0
+method='um_L70_50t_20s_80km'
+number_of_layers=70
+stretching_height=17507.0
+stretching_method='smooth'
diff --git a/rose-stem/app/lfric2lfric/rose-app.conf b/rose-stem/app/lfric2lfric/rose-app.conf
index ad82ed449..468f1fd6e 100644
--- a/rose-stem/app/lfric2lfric/rose-app.conf
+++ b/rose-stem/app/lfric2lfric/rose-app.conf
@@ -1,4 +1,4 @@
-meta=lfric-lfric2lfric/vn3.2
+meta=lfric-lfric2lfric/HEAD
[command]
default=$CORE_ROOT_DIR/bin/tweak_iodef; \
@@ -18,6 +18,8 @@ mode=mkdir
[file:configuration.nml]
mode=auto
source=namelist:extrusion
+ =namelist:extrusion_dst
+ =namelist:boundaries
= namelist:finite_element
= namelist:io
= (namelist:jules_hydrology)
@@ -103,28 +105,28 @@ sg_orog_mixing='none'
!!zhloc_depth_fac=0
[namelist:boundaries]
-!!blend_frequency='inner'
-!!blending_weights=0
-!!blending_weights_w2v=0
-!!boundary_e=0
-!!boundary_n=0
-!!boundary_s=0
-!!boundary_w=0
-!!edge_cells_ew=0
-!!edge_cells_ns=0
-!!inner_width_ew=0
-!!inner_width_ns=0
-!!lbc_eos_height=0
-!!lbc_method='onion_layer'
+!!blend_frequency='final'
+!!blending_weights=0.0
+!!blending_weights_w2v=0.0
+!!boundary_e=1
+!!boundary_n=1
+!!boundary_s=1
+!!boundary_w=1
+!!edge_cells_ew=1
+!!edge_cells_ns=1
+!!inner_width_ew=1
+!!inner_width_ns=1
+!!lbc_eos_height=100
+!!lbc_method='coordinate_based'
limited_area=.false.
-!!normal_only=.false.
-!!outer_width_ew=0
-!!outer_width_ns=0
+!!normal_only=.true.
+!!outer_width_ew=1
+!!outer_width_ns=1
!!output_lbcs=.false.
-!!rim_width_ew=0
-!!rim_width_ns=0
-!!solver_boundary_depth=0
-!!transport_boundary_depth=0
+!!rim_width_ew=1
+!!rim_width_ns=1
+!!solver_boundary_depth=1
+!!transport_boundary_depth=6
transport_overwrite_freq='final'
[namelist:checks]
@@ -269,6 +271,14 @@ number_of_layers=38
planet_radius=6371229.0
stretching_method='linear'
+[namelist:extrusion_dst]
+domain_height=39254.833575999997
+!!eta_values=''
+method='um_L38_29t_9s_40km'
+number_of_layers=38
+planet_radius=6371229.0
+stretching_method='linear'
+
[namelist:files]
!!aerosols_ancil_path=''
!!albedo_nir_ancil_path=''
diff --git a/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc b/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc
index 535f73523..07019d9b2 100644
--- a/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc
+++ b/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc
@@ -137,6 +137,32 @@
"src_type": "global",
}) %}
+{% elif task_ns.conf_name == "oasis_C12L70_to_seukL38" %}
+
+ {% do task_dict.update({
+ "opt_confs": ["clim_gal9_ral_seuk","oasis","src_L70_80km","dst_L38_40km"],
+ "resolution": "C12_C16_lam",
+ "dst_mesh": "seuk_MG",
+ "dst_name": "dynamics",
+ "dst_type": "regional",
+ "src_mesh": "C24_C12",
+ "src_name": "C12",
+ "src_type": "global",
+ }) %}
+
+{% elif task_ns.conf_name == "oasis_C12L70_to_C12L38" %}
+
+ {% do task_dict.update({
+ "opt_confs": ["clim_gal9","oasis","src_L70_80km","dst_L38_40km"],
+ "resolution": "C12",
+ "dst_mesh": "C12",
+ "dst_name": "dynamics",
+ "dst_type": "global",
+ "src_mesh": "C12",
+ "src_name": "dynamics",
+ "src_type": "global",
+ }) %}
+
{% elif task_ns.conf_name == "oasis_clim_gal9-C24_C12_6cpu" %}
{% do task_dict.update({
diff --git a/rose-stem/site/meto/groups/groups_lfric2lfric.cylc b/rose-stem/site/meto/groups/groups_lfric2lfric.cylc
index 8ccdff807..4fcf2f7d5 100644
--- a/rose-stem/site/meto/groups/groups_lfric2lfric.cylc
+++ b/rose-stem/site/meto/groups/groups_lfric2lfric.cylc
@@ -15,6 +15,8 @@
"lfric2lfric_oasis_clim_gal9-C24_C12_1cpu_azspice_gnu_fast-debug-64bit",
"lfric2lfric_oasis_clim_gal9_C12-ral_seuk_C16_lam_1cpu_azspice_gnu_fast-debug-64bit",
"lfric2lfric_oasis_clim_gal9_C12-ral_seuk_C16_lam-lbc_1cpu_azspice_gnu_fast-debug-64bit",
+ "lfric2lfric_oasis_C12L70_to_seukL38_azspice_gnu_fast-debug-64bit",
+ "lfric2lfric_oasis_C12L70_to_C12L38_azspice_gnu_fast-debug-64bit",
"lfric2lfric_azspice_canned",
],
"lfric2lfric_azspice_extra": [
@@ -50,6 +52,8 @@
"lfric2lfric_oasis_clim_gal9-C24_C12_6cpu_ex1a_cce_fast-debug-64bit",
"lfric2lfric_oasis_clim_gal9_C12-ral_seuk_C16_lam_1cpu_ex1a_cce_fast-debug-64bit",
"lfric2lfric_oasis_clim_gal9_C12-ral_seuk_C16_lam-lbc_1cpu_ex1a_cce_fast-debug-64bit",
+ "lfric2lfric_oasis_C12L70_to_seukL38_ex1a_cce_fast-debug-64bit",
+ "lfric2lfric_oasis_C12L70_to_C12L38_ex1a_cce_fast-debug-64bit",
"lfric2lfric_ex1a_canned",
],
"lfric2lfric_ex1a_extra": [
diff --git a/science/gungho/source/algorithm/limited_area/limited_area_masks_alg_mod.x90 b/science/gungho/source/algorithm/limited_area/limited_area_masks_alg_mod.x90
index a5cbfb514..4a0be42d8 100644
--- a/science/gungho/source/algorithm/limited_area/limited_area_masks_alg_mod.x90
+++ b/science/gungho/source/algorithm/limited_area/limited_area_masks_alg_mod.x90
@@ -21,6 +21,7 @@ module limited_area_masks_alg_mod
log_scratch_space, &
LOG_LEVEL_ERROR, &
LOG_LEVEL_INFO, &
+ LOG_LEVEL_DEBUG, &
LOG_LEVEL_WARNING
use function_space_mod, only: function_space_type
use function_space_collection_mod, only: function_space_collection
@@ -532,6 +533,8 @@ contains
if ( lbc_method == lbc_method_onion_layer )then
+ call log_event('Creating blend mask using onion layers', LOG_LEVEL_DEBUG)
+
fs_enum = mask%which_function_space()
select case(fs_enum)
@@ -555,6 +558,8 @@ contains
else
+ call log_event('Creating blend mask using coordinates', LOG_LEVEL_DEBUG)
+
! |<-------------rim_width------------>|
! | | | |
! |<--outer--> |<--inner-->| |
diff --git a/science/gungho/source/driver/gungho_model_mod.F90 b/science/gungho/source/driver/gungho_model_mod.F90
index b89f3f2ab..f488c7df4 100644
--- a/science/gungho/source/driver/gungho_model_mod.F90
+++ b/science/gungho/source/driver/gungho_model_mod.F90
@@ -563,6 +563,8 @@ subroutine initialise_infrastructure( io_context_name, modeldb )
character(str_def), allocatable :: twod_names(:)
character(str_def), allocatable :: shifted_names(:)
character(str_def), allocatable :: double_names(:)
+ integer(i_def) :: stretching_method
+ real(r_def) :: stretching_height
character(str_def), allocatable :: meshes_to_check(:)
@@ -620,14 +622,16 @@ subroutine initialise_infrastructure( io_context_name, modeldb )
chain_mesh_tags = modeldb%config%multigrid%chain_mesh_tags()
end if
- prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name()
- geometry = modeldb%config%base_mesh%geometry()
- topology = modeldb%config%base_mesh%topology()
- prepartitioned = modeldb%config%base_mesh%prepartitioned()
- domain_height = modeldb%config%extrusion%domain_height()
- extrusion_method = modeldb%config%extrusion%method()
- number_of_layers = modeldb%config%extrusion%number_of_layers()
- scaled_radius = modeldb%config%planet%scaled_radius()
+ prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name()
+ geometry = modeldb%config%base_mesh%geometry()
+ topology = modeldb%config%base_mesh%topology()
+ prepartitioned = modeldb%config%base_mesh%prepartitioned()
+ domain_height = modeldb%config%extrusion%domain_height()
+ extrusion_method = modeldb%config%extrusion%method()
+ stretching_method = modeldb%config%extrusion%stretching_method()
+ stretching_height = modeldb%config%extrusion%stretching_height()
+ number_of_layers = modeldb%config%extrusion%number_of_layers()
+ scaled_radius = modeldb%config%planet%scaled_radius()
if (prepartitioned) then
tile_size_x = 1
@@ -1046,6 +1050,8 @@ subroutine initialise_infrastructure( io_context_name, modeldb )
orography_mesh%get_mesh_name(), &
chi_inventory, &
panel_id_inventory, &
+ stretching_height, &
+ stretching_method, &
surface_altitude )
diff --git a/science/gungho/source/orography/assign_orography_field_mod.F90 b/science/gungho/source/orography/assign_orography_field_mod.F90
index 9b9e4299e..06c2e3101 100644
--- a/science/gungho/source/orography/assign_orography_field_mod.F90
+++ b/science/gungho/source/orography/assign_orography_field_mod.F90
@@ -29,9 +29,7 @@ module assign_orography_field_mod
eta2z_linear, &
eta2z_smooth
use analytic_orography_mod, only : orography_profile
- use extrusion_config_mod, only : stretching_height, &
- stretching_method, &
- stretching_method_linear
+ use extrusion_config_mod, only : stretching_method_linear
use log_mod, only : log_event, &
LOG_LEVEL_INFO, &
LOG_LEVEL_ERROR
@@ -67,6 +65,8 @@ subroutine analytic_orography_interface(nlayers, &
ndf_chi, undf_chi, map_chi, &
ndf_pid, undf_pid, map_pid, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1, chi_2, chi_3, panel_id)
@@ -77,6 +77,8 @@ subroutine analytic_orography_interface(nlayers, &
integer(kind=i_def), intent(in) :: nlayers, undf_chi, undf_pid
integer(kind=i_def), intent(in) :: ndf_chi, ndf_pid
integer(kind=i_def), intent(in) :: map_chi(ndf_chi), map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: domain_surface, domain_height
real(kind=r_def), intent(in) :: chi_1_in(undf_chi)
real(kind=r_def), intent(in) :: chi_2_in(undf_chi)
@@ -98,6 +100,8 @@ subroutine ancil_orography_interface(nlayers, &
panel_id, &
surface_altitude, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
ndf_chi, undf_chi, map_chi, &
ndf_pid, undf_pid, map_pid, &
ndf, undf, map, basis)
@@ -110,6 +114,8 @@ subroutine ancil_orography_interface(nlayers, &
integer(kind=i_def), intent(in) :: ndf_chi, ndf_pid, ndf
integer(kind=i_def), intent(in) :: map_chi(ndf_chi), map_pid(ndf_pid)
integer(kind=i_def), intent(in) :: map(ndf)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: basis(ndf,ndf_chi)
real(kind=r_def), intent(in) :: domain_surface, domain_height
real(kind=r_def), intent(in) :: surface_altitude(undf)
@@ -143,10 +149,14 @@ end subroutine ancil_orography_interface
!> @param[in] panel_id_inventory Contains all of the model's panel ID
!! fields, itemised by mesh
!> @param[in] mesh Mesh to apply orography to
+ !> @param[in] stretching_height Physical height above which surface altitude
+ !! does not influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] surface_altitude Field containing the surface altitude
!=============================================================================
- subroutine assign_orography_field(chi_inventory, panel_id_inventory, &
- mesh, surface_altitude)
+ subroutine assign_orography_field(chi_inventory, panel_id_inventory, &
+ mesh, stretching_height, &
+ stretching_method, surface_altitude)
use inventory_by_mesh_mod, only : inventory_by_mesh_type
use field_mod, only : field_type, field_proxy_type
@@ -164,6 +174,8 @@ subroutine assign_orography_field(chi_inventory, panel_id_inventory, &
type(inventory_by_mesh_type), intent(inout) :: chi_inventory
type(inventory_by_mesh_type), intent(in) :: panel_id_inventory
type(mesh_type), pointer, intent(in) :: mesh
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
! We keep the surface_altitude as an optional argument since it is
! not needed for miniapps that only want analytic orography
@@ -261,6 +273,7 @@ subroutine assign_orography_field(chi_inventory, panel_id_inventory, &
nlayers, ndf_chi, undf_chi, map_chi(:,cell), &
ndf_pid, undf_pid, map_pid(:,cell), &
domain_surface, domain_height, &
+ stretching_height, stretching_method, &
chi_in_proxy(1)%data, chi_in_proxy(2)%data, &
chi_in_proxy(3)%data, &
chi_proxy(1)%data, chi_proxy(2)%data, chi_proxy(3)%data, &
@@ -337,6 +350,7 @@ subroutine assign_orography_field(chi_inventory, panel_id_inventory, &
chi_in_proxy(1)%data, chi_in_proxy(2)%data, chi_in_proxy(3)%data, &
panel_id_proxy%data, sfc_alt_proxy%data, &
domain_surface, domain_height, &
+ stretching_height, stretching_method, &
ndf_chi, undf_chi, map_chi(:,cell), &
ndf_pid, undf_pid, map_pid(:,cell), &
ndf_sf, undf_sf, map_sf(:,cell), basis_sf_on_chi &
@@ -370,6 +384,9 @@ end subroutine assign_orography_field
!> @param[in] map_pid Indirection map for panel_id
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] chi_1_in 1st coordinate field in Wchi (input)
!> @param[in] chi_2_in 2nd coordinate field in Wchi (input)
!> @param[in] chi_3_in 3rd coordinate field in Wchi (input)
@@ -382,6 +399,8 @@ subroutine analytic_orography_spherical_xyz(nlayers, &
ndf_chi, undf_chi, map_chi, &
ndf_pid, undf_pid, map_pid, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1, chi_2, chi_3, panel_id)
@@ -392,6 +411,8 @@ subroutine analytic_orography_spherical_xyz(nlayers, &
integer(kind=i_def), intent(in) :: ndf_chi, ndf_pid
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: domain_surface, domain_height
real(kind=r_def), intent(in) :: chi_1_in(undf_chi), chi_2_in(undf_chi)
real(kind=r_def), intent(in) :: chi_3_in(undf_chi)
@@ -465,6 +486,9 @@ end subroutine analytic_orography_spherical_xyz
!> @param[in] map_pid Indirection map for panel_id
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] chi_1_in 1st coordinate field in Wchi (input)
!> @param[in] chi_2_in 2nd coordinate field in Wchi (input)
!> @param[in] chi_3_in 3rd coordinate field in Wchi (input)
@@ -478,6 +502,8 @@ subroutine analytic_orography_spherical_native(nlayers, &
ndf_pid, undf_pid, map_pid, &
domain_surface, &
domain_height, &
+ stretching_height, &
+ stretching_method, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1, chi_2, chi_3, &
panel_id)
@@ -489,6 +515,8 @@ subroutine analytic_orography_spherical_native(nlayers, &
integer(kind=i_def), intent(in) :: ndf_chi, ndf_pid
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: domain_surface, domain_height
real(kind=r_def), intent(in) :: chi_1_in(undf_chi), chi_2_in(undf_chi)
real(kind=r_def), intent(in) :: chi_3_in(undf_chi)
@@ -557,6 +585,9 @@ end subroutine analytic_orography_spherical_native
!> @param[in] map_pid Indirection map for panel_id
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] chi_1_in 1st coordinate field in Wchi (input)
!> @param[in] chi_2_in 2nd coordinate field in Wchi (input)
!> @param[in] chi_3_in 3rd coordinate field in Wchi (input)
@@ -570,6 +601,8 @@ subroutine analytic_orography_cartesian(nlayers, &
ndf_pid, undf_pid, map_pid, &
domain_surface, &
domain_height, &
+ stretching_height, &
+ stretching_method, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1, chi_2, chi_3, &
panel_id)
@@ -581,6 +614,8 @@ subroutine analytic_orography_cartesian(nlayers, &
integer(kind=i_def), intent(in) :: ndf_chi, ndf_pid
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: domain_surface, domain_height
real(kind=r_def), intent(in) :: chi_1_in(undf_chi), chi_2_in(undf_chi)
real(kind=r_def), intent(in) :: chi_3_in(undf_chi)
@@ -639,6 +674,9 @@ end subroutine analytic_orography_cartesian
!> @param[in] surface_altitude Surface altitude field data
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] ndf_chi Num DoFs per cell for map_chi
!> @param[in] undf_chi Column coords' num DoFs this partition
!> @param[in] map_chi Indirection map for coordinate field
@@ -656,6 +694,8 @@ subroutine ancil_orography_spherical_xyz(nlayers, &
panel_id, &
surface_altitude, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
ndf_chi, undf_chi, &
map_chi, &
ndf_pid, undf_pid, &
@@ -672,6 +712,8 @@ subroutine ancil_orography_spherical_xyz(nlayers, &
integer(kind=i_def), intent(in) :: map(ndf)
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: basis(ndf, ndf_chi)
real(kind=r_def), intent(inout) :: chi_1(undf_chi)
real(kind=r_def), intent(inout) :: chi_2(undf_chi)
@@ -752,6 +794,9 @@ end subroutine ancil_orography_spherical_xyz
!> @param[in] surface_altitude Surface altitude field data
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] ndf_chi Num DoFs per cell for map_chi
!> @param[in] undf_chi Column coords' num DoFs this partition
!> @param[in] map_chi Indirection map for coordinate field
@@ -769,6 +814,8 @@ subroutine ancil_orography_spherical_sph(nlayers, &
panel_id, &
surface_altitude, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
ndf_chi, undf_chi, &
map_chi, &
ndf_pid, undf_pid, &
@@ -785,6 +832,8 @@ subroutine ancil_orography_spherical_sph(nlayers, &
integer(kind=i_def), intent(in) :: map(ndf)
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: basis(ndf, ndf_chi)
real(kind=r_def), intent(inout) :: chi_1(undf_chi)
real(kind=r_def), intent(inout) :: chi_2(undf_chi)
@@ -850,6 +899,9 @@ end subroutine ancil_orography_spherical_sph
!> @param[in] surface_altitude Surface altitude field data
!> @param[in] domain_surface Physical height of flat domain surface (m)
!> @param[in] domain_height Physical height of domain top (m)
+ !> @param[in] stretching_height Physical height above which surface altitude does not
+ !! influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] ndf_chi Num DoFs per cell for map_chi
!> @param[in] undf_chi Column coords' num DoFs this partition
!> @param[in] map_chi Indirection map for coordinate field
@@ -867,6 +919,8 @@ subroutine ancil_orography_cartesian(nlayers, &
panel_id, &
surface_altitude, &
domain_surface, domain_height, &
+ stretching_height, &
+ stretching_method, &
ndf_chi, undf_chi, &
map_chi, &
ndf_pid, undf_pid, &
@@ -883,6 +937,8 @@ subroutine ancil_orography_cartesian(nlayers, &
integer(kind=i_def), intent(in) :: map(ndf)
integer(kind=i_def), intent(in) :: map_chi(ndf_chi)
integer(kind=i_def), intent(in) :: map_pid(ndf_pid)
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
real(kind=r_def), intent(in) :: basis(ndf, ndf_chi)
real(kind=r_def), intent(inout) :: chi_1(undf_chi)
real(kind=r_def), intent(inout) :: chi_2(undf_chi)
diff --git a/science/gungho/source/orography/blend_orography_alg_mod.x90 b/science/gungho/source/orography/blend_orography_alg_mod.x90
index c5e498de3..58815a7ba 100644
--- a/science/gungho/source/orography/blend_orography_alg_mod.x90
+++ b/science/gungho/source/orography/blend_orography_alg_mod.x90
@@ -15,6 +15,11 @@ module blend_orography_alg_mod
use limited_area_constants_mod, only: get_blend_mask, &
get_lbc_mask_fv
use mesh_mod, only: mesh_type
+ use log_mod, only: log_event, &
+ LOG_LEVEL_INFO, &
+ LOG_LEVEL_DEBUG, &
+ LOG_LEVEL_ERROR
+
implicit none
public :: blend_orography
@@ -43,6 +48,9 @@ contains
integer(kind=i_def) :: fs_enum
type(mesh_type), pointer :: mesh
+ call log_event( "Creating the blended orography (for LAMs)", &
+ LOG_LEVEL_DEBUG )
+
! Define the function space required for masks.
fs_enum = lam_orog%which_function_space()
mesh => lam_orog%get_mesh()
diff --git a/science/gungho/source/orography/setup_orography_alg_mod.x90 b/science/gungho/source/orography/setup_orography_alg_mod.x90
index 94ebcca3c..fe68dd423 100644
--- a/science/gungho/source/orography/setup_orography_alg_mod.x90
+++ b/science/gungho/source/orography/setup_orography_alg_mod.x90
@@ -56,11 +56,16 @@ contains
!! paired with their mesh.
!> @param[in] panel_id_inventory Contains the model's panel ID fields
!! paired with their mesh.
+ !> @param[in] stretching_height Physical height above which surface altitude
+ !! does not influence layer height (m)
+ !> @param[in] stretching_method Method of generating stretching
!> @param[in] surf_alt_w3 Surface altitude on the orography mesh
subroutine setup_orography_alg( all_mesh_names, &
orography_mesh_name, &
chi_inventory, &
panel_id_inventory, &
+ stretching_height, &
+ stretching_method, &
surf_alt_w3 )
use assign_orography_field_mod, only: assign_orography_field
@@ -77,6 +82,8 @@ contains
type(inventory_by_mesh_type), intent(inout) :: chi_inventory
type(inventory_by_mesh_type), intent(in) :: panel_id_inventory
type(field_type), intent(in) :: surf_alt_w3
+ integer(kind=i_def), intent(in) :: stretching_method
+ real(kind=r_def), intent(in) :: stretching_height
! local variables
integer(kind=i_def) :: i, fs_id
@@ -185,21 +192,24 @@ contains
! Assignment of orography from surface_altitude on orography mesh
call assign_orography_field( &
- chi_inventory, panel_id_inventory, source_mesh, surf_alt_w0 &
+ chi_inventory, panel_id_inventory, source_mesh, &
+ stretching_height, stretching_method, surf_alt_w0 &
)
! Assign for shifted and double level meshes if they exist
if (mesh_collection%check_for(source_mesh, SHIFTED)) then
shifted_mesh => mesh_collection%get_mesh(source_mesh, SHIFTED)
call assign_orography_field( &
- chi_inventory, panel_id_inventory, shifted_mesh, surf_alt_w0 &
+ chi_inventory, panel_id_inventory, shifted_mesh, &
+ stretching_height, stretching_method, surf_alt_w0 &
)
end if
if (mesh_collection%check_for(source_mesh, DOUBLE_LEVEL)) then
double_level_mesh => mesh_collection%get_mesh(source_mesh, DOUBLE_LEVEL)
call assign_orography_field( &
- chi_inventory, panel_id_inventory, double_level_mesh, surf_alt_w0 &
+ chi_inventory, panel_id_inventory, double_level_mesh, &
+ stretching_height, stretching_method, surf_alt_w0 &
)
end if
@@ -301,14 +311,16 @@ contains
! Adjust coordinates
! ---------------------------------------------------------------------- !
call assign_orography_field( &
- chi_inventory, panel_id_inventory, target_mesh, surf_alt_w0_ptr &
+ chi_inventory, panel_id_inventory, target_mesh, &
+ stretching_height, stretching_method, surf_alt_w0_ptr &
)
! Assign for shifted and double level meshes if they exist
if (mesh_collection%check_for(target_mesh, SHIFTED)) then
shifted_mesh => mesh_collection%get_mesh(target_mesh, SHIFTED)
call assign_orography_field( &
- chi_inventory, panel_id_inventory, shifted_mesh, surf_alt_w0_ptr &
+ chi_inventory, panel_id_inventory, shifted_mesh, &
+ stretching_height, stretching_method, surf_alt_w0_ptr &
)
end if
@@ -316,7 +328,7 @@ contains
double_level_mesh => mesh_collection%get_mesh(target_mesh, DOUBLE_LEVEL)
call assign_orography_field( &
chi_inventory, panel_id_inventory, double_level_mesh, &
- surf_alt_w0_ptr &
+ stretching_height, stretching_method, surf_alt_w0_ptr &
)
end if
end do
diff --git a/science/gungho/unit-test/orography/analytic_orography_field_cartesian_mod_test.pf b/science/gungho/unit-test/orography/analytic_orography_field_cartesian_mod_test.pf
index c38cf9bd3..2e43fae74 100644
--- a/science/gungho/unit-test/orography/analytic_orography_field_cartesian_mod_test.pf
+++ b/science/gungho/unit-test/orography/analytic_orography_field_cartesian_mod_test.pf
@@ -12,6 +12,7 @@ module analytic_orography_field_cartesian_mod_test
use global_mesh_mod, only : global_mesh_type
use analytic_orography_mod, only : orography_profile
use ugrid_mesh_data_mod, only : ugrid_mesh_data_type
+ use extrusion_config_mod, only : method_uniform, stretching_method_linear
use funit
@@ -40,6 +41,7 @@ module analytic_orography_field_cartesian_mod_test
real(r_def), parameter :: domain_bottom = 0.0_r_def
real(r_def), parameter :: domain_height = 10000.0_r_def
+ real(r_def), parameter :: stretching_height = 1.0_r_def
real(r_def), parameter :: surface_pressure = 1000.0e2_r_def
integer(i_def), parameter :: nlayers = 10_i_def
@@ -71,7 +73,6 @@ contains
feign_orography_schar_cartesian_config
use orography_schar_cartesian_config_mod, &
only : direction_x
- use extrusion_config_mod, only : method_uniform, stretching_method_linear
use initial_pressure_config_mod, only : method_balanced
@@ -93,7 +94,7 @@ contains
planet_radius=6000.0_r_def, &
domain_height=domain_height, &
number_of_layers=nlayers, &
- stretching_height=1.0_r_def, &
+ stretching_height=stretching_height, &
stretching_method=stretching_method_linear, &
eta_values=(/0.5_r_def/) )
@@ -253,6 +254,8 @@ contains
ndf, undf, map, &
height_flat_surface, &
height_domain_top, &
+ stretching_height, &
+ stretching_method_linear, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1, chi_2, chi_3, &
panel_id )
diff --git a/science/gungho/unit-test/orography/analytic_orography_field_spherical_mod_test.pf b/science/gungho/unit-test/orography/analytic_orography_field_spherical_mod_test.pf
index 9d1571fc7..8d76cdba7 100644
--- a/science/gungho/unit-test/orography/analytic_orography_field_spherical_mod_test.pf
+++ b/science/gungho/unit-test/orography/analytic_orography_field_spherical_mod_test.pf
@@ -13,6 +13,8 @@ module analytic_orography_field_spherical_mod_test
use global_mesh_mod, only : global_mesh_type
use analytic_orography_mod, only : orography_profile
use ugrid_mesh_data_mod, only : ugrid_mesh_data_type
+ use extrusion_config_mod, only : method_uniform, &
+ stretching_method_linear
use funit
@@ -40,6 +42,7 @@ module analytic_orography_field_spherical_mod_test
real(r_def), parameter :: radius = 6371229.0_r_def
real(r_def), parameter :: domain_height = 10000.0_r_def
+ real(r_def), parameter :: stretching_height = 1.0_r_def
integer(i_def), parameter :: nlayers = 10_i_def
integer(i_def), parameter :: total_ranks = 1_i_def
@@ -60,8 +63,6 @@ contains
use agnesi_orography_spherical_mod, only : agnesi_spherical_type
use base_mesh_config_mod, only : geometry_spherical, &
topology_fully_periodic
- use extrusion_config_mod, only : method_uniform, &
- stretching_method_linear
use finite_element_config_mod, only : cellshape_quadrilateral, &
coord_system_xyz, &
coord_space_wchi
@@ -95,7 +96,7 @@ contains
planet_radius=radius, &
domain_height=domain_height, &
number_of_layers=nlayers, &
- stretching_height=1.0_r_def, &
+ stretching_height=stretching_height, &
stretching_method=stretching_method_linear, &
eta_values=(/0.5_r_def/) )
@@ -270,6 +271,8 @@ contains
ndf, undf, map, &
height_flat_surface, &
height_domain_top, &
+ stretching_height, &
+ stretching_method_linear, &
chi_1_in, chi_2_in, chi_3_in, &
chi_1_cart, chi_2_cart, chi_3_cart, &
panel_id )
diff --git a/science/gungho/unit-test/orography/ancil_orography_cartesian_mod_test.pf b/science/gungho/unit-test/orography/ancil_orography_cartesian_mod_test.pf
index 0d8031b07..5b4f51bcf 100644
--- a/science/gungho/unit-test/orography/ancil_orography_cartesian_mod_test.pf
+++ b/science/gungho/unit-test/orography/ancil_orography_cartesian_mod_test.pf
@@ -6,6 +6,8 @@
module ancil_orography_cartesian_mod_test
use constants_mod, only : i_def, r_def
+ use extrusion_config_mod, only : method_uniform, &
+ stretching_method_linear
use funit
implicit none
@@ -17,6 +19,7 @@ module ancil_orography_cartesian_mod_test
real(r_def), parameter :: dx = 6000.0_r_def
real(r_def), parameter :: dy = 1000.0_r_def
real(r_def), parameter :: dz = 2000.0_r_def
+ real(r_def), parameter :: stretching_height = 1.0_r_def
real(r_def), parameter :: domain_height = nlayers*dz
real(r_def), parameter :: domain_surface = 0.0_r_def
@@ -30,8 +33,6 @@ contains
use base_mesh_config_mod, only : geometry_planar, &
topology_fully_periodic
- use extrusion_config_mod, only : method_uniform, &
- stretching_method_linear
use finite_element_config_mod, only : cellshape_quadrilateral, &
coord_system_xyz, coord_space_wchi
use feign_config_mod, only : feign_finite_element_config, &
@@ -54,7 +55,7 @@ contains
planet_radius = 0.0_r_def, &
domain_height = domain_height, &
number_of_layers = nlayers, &
- stretching_height= 1.0_r_def, &
+ stretching_height= stretching_height, &
stretching_method= stretching_method_linear,&
eta_values=(/0.5_r_def/) )
@@ -213,6 +214,8 @@ contains
srf_alt_w0, &
domain_surface, &
domain_height, &
+ stretching_height, &
+ stretching_method_linear, &
ndf_wchi, &
undf_wchi, &
map_wchi(:, cell), &
diff --git a/science/gungho/unit-test/orography/ancil_orography_spherical_mod_test.pf b/science/gungho/unit-test/orography/ancil_orography_spherical_mod_test.pf
index ad8625391..255e20237 100644
--- a/science/gungho/unit-test/orography/ancil_orography_spherical_mod_test.pf
+++ b/science/gungho/unit-test/orography/ancil_orography_spherical_mod_test.pf
@@ -6,6 +6,8 @@
module ancil_orography_spherical_mod_test
use constants_mod, only : i_def, r_def
+ use extrusion_config_mod, only : method_uniform, &
+ stretching_method_linear
use funit
implicit none
@@ -17,6 +19,7 @@ module ancil_orography_spherical_mod_test
real(r_def), parameter :: dlat = 1.0_r_def/180.0_r_def
real(r_def), parameter :: dlon = 1.0_r_def/180.0_r_def
real(r_def), parameter :: dr = 1000.0_r_def
+ real(r_def), parameter :: stretching_height = 1.0_r_def
real(r_def), parameter :: domain_height = nlayers*dr
real(r_def), parameter :: radius = 6371229.0_r_def
real(r_def), parameter :: domain_surface = radius
@@ -31,8 +34,6 @@ contains
use base_mesh_config_mod, only : geometry_spherical, &
topology_fully_periodic
- use extrusion_config_mod, only : method_uniform, &
- stretching_method_linear
use finite_element_config_mod, only : cellshape_quadrilateral, &
coord_system_xyz, coord_space_wchi
use feign_config_mod, only : feign_finite_element_config, &
@@ -55,7 +56,7 @@ contains
planet_radius = radius, &
domain_height = domain_height, &
number_of_layers = nlayers, &
- stretching_height= 1.0_r_def, &
+ stretching_height= stretching_height, &
stretching_method= stretching_method_linear,&
eta_values=(/0.5_r_def/) )
@@ -217,6 +218,8 @@ contains
srf_alt_w0, &
domain_surface, &
domain_height, &
+ stretching_height, &
+ stretching_method_linear, &
ndf_wchi, &
undf_wchi, &
map_wchi(:, cell), &