Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[namelist:transport]
consistent_metric=.true.
16 changes: 16 additions & 0 deletions rose-stem/site/common/gungho_model/tasks_gungho_model.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,22 @@
"plot_str": "cartesian_mountain_plot.py diagGungho $NODAL_DATA_DIR u 3 T000900 2 2 8 schar zoom_1 lines $PLOT_DIR",
}) %}

{% elif task_ns.conf_name == "schar_cart-consistent-BiP200x8-500x500" %}

{% do task_dict.update({
"opt_confs": ["schar_cart", "consistent_metric"],
"resolution": "BiP200x8-500x500",
"DT": 20,
"mpi_parts": 5,
"tsteps": 900,
"threads": 3,
"panel_decomp": "row",
"wallclock": 30,
"use_xios": false,
"plot_str": "cartesian_mountain_plot.py diagGungho $NODAL_DATA_DIR u 3 T000900 2 2 8 schar zoom_1 lines $PLOT_DIR",
}) %}


{% elif task_ns.conf_name == "schar_cart-alt2-BiP100x4-1000x1000" %}

{% do task_dict.update({
Expand Down
1 change: 1 addition & 0 deletions rose-stem/site/meto/groups/groups_gungho_model.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"gungho_model_sbr_lam-n96_MG_lam_azspice_gnu_fast-debug-64bit",
"gungho_model_sbr_lam-n96_MG_lam_rotate_azspice_gnu_fast-debug-64bit",
"gungho_model_schar_cart-BiP200x8-500x500_azspice_gnu_fast-debug-64bit",
"gungho_model_schar_cart-consistent-BiP200x8-500x500_azspice_gnu_fast-debug-64bit",
"gungho_model_schar_cart-alt2-BiP100x4-1000x1000_azspice_gnu_fast-debug-64bit",
"gungho_model_semi-implicit-for-linear-C12_azspice_gnu_fast-debug-64bit",
"gungho_model_shallow-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40C1E40C4086849A
Inner product checksum theta = 41F1395D4034FE76
Inner product checksum u = 4393B67691E55F6A
Inner product checksum rho = 40C1E4433CA1DC11
Inner product checksum theta = 41F13951C1547028
Inner product checksum u = 4393B5A758E1AA4A
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40FA16E969D82696
Inner product checksum theta = 42069BF1BB6EBF3E
Inner product checksum u = 42FFC30F4FBB102B
Inner product checksum rho = 40FA16E969D85AAC
Inner product checksum theta = 42069BF1BB6EB372
Inner product checksum u = 42FFC30F4FCF542B
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40C1E40C40869417
Inner product checksum theta = 41F1395D4034FF38
Inner product checksum u = 4393B67691E550BA
Inner product checksum rho = 40C1E4433CA1EF89
Inner product checksum theta = 41F13951C1546C60
Inner product checksum u = 4393B5A758E14822
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40FA16E968D7D432
Inner product checksum theta = 42069BF1BC3DF21E
Inner product checksum u = 42FFC30DC52E5C94
Inner product checksum rho = 40FA16E968D7D9F7
Inner product checksum theta = 42069BF1BC3EC677
Inner product checksum u = 42FFC30DC4F57FAF
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
!-----------------------------------------------------------------------------
! (c) Crown copyright 2026
!-----------------------------------------------------------------------------
!> @brief Compute the consistent vertical wind

module consistent_wind_alg_mod

use config_mod, only: config_type
use constants_mod, only: i_def, l_def, r_def
use log_mod, only: log_event, LOG_LEVEL_INFO
use transport_metadata_collection_mod, only: transport_metadata_collection
use transport_metadata_mod, only: transport_metadata_type
use transport_controller_mod, only: transport_controller_type
use sci_geometric_constants_mod, only: get_coordinates, &
get_height_fv, &
get_face_selector_ew, &
get_face_selector_ns
use consistent_wind_kernel_mod, only: consistent_wind_kernel_type
use fs_continuity_mod, only: Wtheta, W2v, W2h
use model_clock_mod, only: model_clock_type
use combine_w2_field_kernel_mod, only: combine_w2_field_kernel_type
use split_w2_field_kernel_mod, only: split_w2_field_kernel_type
use integer_field_mod, only: integer_field_type
use field_mod, only: field_type
use r_tran_field_mod, only: r_tran_field_type
use function_space_mod, only: function_space_type
use function_space_collection_mod, only: function_space_collection
use wt_advective_update_alg_mod, only: hori_wt_update_alg
use transport_enumerated_types_mod, only: split_method_mol
use horizontal_cubic_sl_metric_kernel_mod, &
only: horizontal_cubic_sl_metric_kernel_type

implicit none

private

! Contained suroutines
public :: consistent_wind_alg


contains

!=============================================================================
!> @brief Compute a consistent vertical wind for the current transport step.
!> @details Modifies the vertical advecting wind so that the component that comes
!! from the horizontal wind over terrain uses the transport scheme reconstruction
!! to compute the orographic gradient instead of the finite element scheme. This
!! results in the correct cancellation with the horizontal transport of the field
!! over terrain.
!> @param[in] config Application namelist configuration object
!> @param[in,out] transport_controller Encapsulating object containing the
!! transport counter and precomputations
!> @param[in] rho_d_latest Dry density at the latest time level
!> @param[in] wind_n Wind at the start of the step
!> @param[in] wind_np1 Wind at the end of the step
!> @param[in] model_clock Model time information
!> @param[in] outer Outer iteration index
!> @param[in] cheap_update_step Whether a cheap controller update is used
subroutine consistent_wind_alg(config, &
transport_controller, &
rho_d_latest, &
wind_n, &
wind_np1, &
model_clock, &
outer, &
cheap_update_step)

implicit none

type(config_type), intent(in) :: config
integer(kind=i_def), intent(in) :: outer
logical(kind=l_def), intent(in) :: cheap_update_step
class(model_clock_type), intent(in) :: model_clock
type(field_type), intent(in) :: rho_d_latest, wind_n, wind_np1
type(transport_controller_type), intent(inout) :: transport_controller

type(field_type) :: chi3_inc, chi3
type(field_type), pointer :: chi3_default
type(transport_metadata_type), pointer :: transport_metadata

integer(kind=i_def) :: mesh_id

type(field_type), pointer :: chi(:)
type(field_type), pointer :: wind_adv_ptr
type(field_type), target :: wind_adv
type(field_type) :: wind_v, wind_h

type(r_tran_field_type) :: chi3_inc_r_tran, wind_h_r_tran, chi3_r_tran

type(integer_field_type), pointer :: face_selector_ew
type(integer_field_type), pointer :: face_selector_ns

type(function_space_type), pointer :: w2h_fs, w2v_fs

integer(kind=i_def), parameter :: stencil_depth = 2

! Get the height field with a big halo
mesh_id = rho_d_latest%get_mesh_id()
chi3_default => get_height_fv(config, rho_d_latest%get_mesh(), Wtheta)
call chi3%initialise( chi3_default%get_function_space(), halo_depth = stencil_depth )
call invoke( setval_X( chi3, chi3_default ) )


! Transport the height field
call log_event( "Computing consistent vertical wind...", LOG_LEVEL_INFO)
transport_metadata => &
transport_metadata_collection%get_transport_metadata('potential_temperature')
call chi3_inc%initialise( chi3%get_function_space() )

! Split out the horzontal and vertical components of the wind
w2h_fs => function_space_collection%get_fs( wind_n%get_mesh(), &
wind_n%get_element_order_h(), &
wind_n%get_element_order_v(), W2h )
w2v_fs => function_space_collection%get_fs( wind_n%get_mesh(), &
wind_n%get_element_order_h(), &
wind_n%get_element_order_v(), W2v )
call wind_h%initialise( w2h_fs )
call wind_v%initialise( w2v_fs )
call wind_adv%initialise( wind_n%get_function_space() )
face_selector_ew => get_face_selector_ew( wind_n%get_mesh() )
face_selector_ns => get_face_selector_ns( wind_n%get_mesh() )
call invoke( aX_plus_bY( wind_adv, 0.5_r_def, wind_n, 0.5_r_def, wind_np1 ), &
split_w2_field_kernel_type( wind_h, wind_v, wind_adv, &
face_selector_ew, &
face_selector_ns ) )

! Compute u.grad(chi3)
if ( transport_metadata%get_horizontal_method() == split_method_mol ) then
! With MoL
call chi3_inc_r_tran%initialise( chi3_inc%get_function_space() )
call wind_h_r_tran%initialise( wind_h%get_function_space() )
call chi3_r_tran%initialise( chi3%get_function_space() )
call invoke( real_to_real_X( chi3_inc_r_tran, chi3_inc ), &
real_to_real_X( wind_h_r_tran, wind_h ), &
real_to_real_X( chi3_r_tran, chi3 ) )
call hori_wt_update_alg(config, chi3_inc_r_tran, wind_h_r_tran, wind_h_r_tran, &
chi3_r_tran, transport_metadata)
call invoke( real_to_real_X( chi3_inc, chi3_inc_r_tran ) )
else
! With SL
call invoke(horizontal_cubic_sl_metric_kernel_type(chi3_inc, chi3, stencil_depth, wind_h) )
end if
Comment thread
thomasmelvin marked this conversation as resolved.

! Modify the vertical componenet of the transporting wind
chi => get_coordinates( wind_n%get_mesh() )
call invoke( consistent_wind_kernel_type(wind_v, wind_adv, &
chi3_inc, chi(3)) )

! Combine the modified vertical wind with the horizontal wind to form a new consistent wind
call invoke( combine_w2_field_kernel_type( wind_adv, wind_h, wind_v, &
face_selector_ew, &
face_selector_ns ) )

! Recompute controller object (departure points etc) using new consistent wind
call log_event( "Recomputing transport controller with consistent wind...", LOG_LEVEL_INFO)
wind_adv_ptr => wind_adv
call transport_controller%finalise()
call transport_controller%initialise( &
config, model_clock, rho_d_latest, wind_adv, wind_adv_ptr, outer, &
cheap_update_step &
)
end subroutine consistent_wind_alg

end module consistent_wind_alg_mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module gungho_transport_control_alg_mod
use multires_coupling_config_mod, only: coarse_aerosol_transport, &
aerosol_mesh_name
use r_tran_field_mod, only: r_tran_field_type
use transport_config_mod, only: transport_ageofair
use transport_config_mod, only: transport_ageofair, &
consistent_metric
use transport_controller_mod, only: transport_controller_type
use transport_metadata_mod, only: transport_metadata_type
use transport_metadata_collection_mod, only: transport_metadata_collection_type, &
Expand Down Expand Up @@ -213,6 +214,7 @@ contains
coarse_collection_transport_alg
use transport_field_mod, only: transport_field
use wind_transport_alg_mod, only: wind_transport_alg
use consistent_wind_alg_mod, only: consistent_wind_alg

implicit none

Expand Down Expand Up @@ -323,6 +325,16 @@ contains
! TRANSPORT OF PROGNOSTICS: EVERY OUTER LOOP
! ======================================================================== !

! Modify winds to use consistent metrics if required
if (consistent_metric) call consistent_wind_alg(config, &
transport_controller, &
rho_d_latest_ptr, &
wind_for_adv, &
wind_np1, &
model_clock, &
outer, &
cheap_update_step)
Comment thread
thomasmelvin marked this conversation as resolved.

! ------------------------------------------------------------------------ !
! Transport dry density
call log_event( "Transporting density...", LOG_LEVEL_DEBUG)
Expand Down
Loading
Loading