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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rose-stem/app/linear_model/opt/rose-app-ffsl.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[namelist:transport]
ffsl_vertical_order=5*1
horizontal_method=2,1,2,2,2
log_space=.false.,.true.,.false.,.false.,.false.
log_space=5*.false.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just note here why this has changed from true to false. Is it because the target is to have 5*false and this is a permanent change, or is it because the log-space code is still to be created and this is temporary.

reversible=.false.,.true.,.false.,.false.,.false.
vertical_method=2,1,2,2,2
vertical_method=2,3,2,2,2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 3F202FBD547CFA2D
Inner product checksum theta = 403285E05B4CEE85
Inner product checksum u = 432FFEFCD1E82680
Inner product checksum rho = 3F2019E259693832
Inner product checksum theta = 4031F066852F6E6E
Inner product checksum u = 432F625A30D467E1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 3FB292C1A8DEAC36
Inner product checksum theta = 4170C7E80A07EB51
Inner product checksum u = 456DDD0B26100D01
Inner product checksum mr1 = 3F96D21A5BF1ED5C
Inner product checksum mr2 = 3F73B1D0D7B555A1
Inner product checksum mr3 = 3EF232F1B59B8986
Inner product checksum mr4 = 3EF2CFD7D89D0460
Inner product checksum rho = 3FB2CA8556C55BB7
Inner product checksum theta = 41797208FAB6082E
Inner product checksum u = 45701C36CF132A6E
Inner product checksum mr1 = 3F96CFC5AE7C887E
Inner product checksum mr2 = 3F73B1BC0FE7F5D3
Inner product checksum mr3 = 3EF232F5C6451F32
Inner product checksum mr4 = 3EF2CFC507886DA2
Inner product checksum mr5 = 0
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 3F202FBE9989F062
Inner product checksum theta = 403285DFD9BCF1D0
Inner product checksum u = 432FFEF63CBF50AD
Inner product checksum rho = 3F2019E2F24B8D66
Inner product checksum theta = 4031F066379053E7
Inner product checksum u = 432F6254B8B7054B
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 3FB292B6ABD3E01E
Inner product checksum theta = 4170C7E8288381C8
Inner product checksum u = 456DDD0B80AF63F2
Inner product checksum mr1 = 3F96D2137D2B27E5
Inner product checksum mr2 = 3F73B1D0D7B6CD3A
Inner product checksum mr3 = 3EF232F1B44659C0
Inner product checksum mr4 = 3EF2CFD7E1969965
Inner product checksum rho = 3FB2CA785066B264
Inner product checksum theta = 41797208F3830022
Inner product checksum u = 45701C36A8FED04A
Inner product checksum mr1 = 3F96CFBC6DB7C8DE
Inner product checksum mr2 = 3F73B1BC0FE0A525
Inner product checksum mr3 = 3EF232F5C6381B6C
Inner product checksum mr4 = 3EF2CFC505737AA9
Inner product checksum mr5 = 0
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ contains
use tl_mol_conservative_alg_mod, only: tl_mol_conservative_alg
use tl_mol_advective_alg_mod, only: tl_mol_advective_alg
use tl_ffsl_control_alg_mod, only: tl_ffsl_control_alg
use tl_vertical_sl_advective_alg_mod, only: tl_vertical_sl_advective_alg

implicit none

Expand Down Expand Up @@ -303,19 +304,14 @@ contains
! Choose form of transport equation for vertical
select case ( transport_metadata%get_equation_form() )

case ( equation_form_conservative )
call log_event( &
'TL: Vertical SL conservative not coded yet', &
LOG_LEVEL_ERROR &
)
case ( equation_form_advective )
call log_event( &
'TL: Vertical SL advective not coded yet', &
LOG_LEVEL_ERROR &
)
call tl_vertical_sl_advective_alg( &
field_np1, field_n, ls_field_n, tl_transport_controller &
)

case default
call log_event( &
'Trying to solve unrecognised form of transport equation', &
'TL vertical SL is only coded for advective form transport', &
LOG_LEVEL_ERROR &
)
end select
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
!-----------------------------------------------------------------------------
! (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 An algorithm for performing 1D vertical semi-Lagrangian advective TL transport.
!> @details The algorithm performs a 1D vertical semi-Lagrangian advective
!! transport of a field for the linear model. It computes the perturbation field
!! at the departure point using linear or cubic interpolation, and the
!! derivative of the ls field interpolation at the departure point.

module tl_vertical_sl_advective_alg_mod

! Constants and types
use constants_mod, only: r_tran, i_def, l_def
use integer_field_mod, only: integer_field_type
use log_mod, only: log_event, LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type
use r_tran_field_mod, only: r_tran_field_type
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF

! Transport control
use tl_transport_controller_mod, only: tl_transport_controller_type
use transport_controller_mod, only: transport_controller_type
use transport_counter_mod, only: transport_counter_type
use transport_metadata_mod, only: transport_metadata_type
use wind_precomputations_alg_mod, only: wind_precomputations_type

! Algorithms and kernels
use tl_end_of_transport_step_alg_mod, only: tl_end_of_advective_step_alg
use tl_vertical_cubic_sl_kernel_mod, only: tl_vertical_cubic_sl_kernel_type

! Configs
use transport_config_mod, only: vertical_sl_order, &
vertical_sl_order_cubic, &
vertical_sl_order_cubic_hermite

implicit none

private

public :: tl_vertical_sl_advective_alg

contains

!-----------------------------------------------------------------------------
!> @brief An algorithm to perform 1D vertical advection in the linear model
!! by interpolating data to departure points (SL-advection) and
!! computing the ls field gradient.
!> @param[in,out] field_np1 ACTIVE Perturbation field at the end of
!! the transport step
!> @param[in] field ACTIVE Perturbation field at the start
!! of the transport step
!> @param[in] ls_field PASSIVE Linearisation state field at the
!! start of the transport step
!> @param[in,out] tl_transport_controller
!! Object controlling the transport
subroutine tl_vertical_sl_advective_alg( field_np1, field_n, ls_field_n, &
tl_transport_controller )

implicit none

! Arguments
type(r_tran_field_type), intent(inout) :: field_np1
type(r_tran_field_type), intent(in) :: field_n
type(r_tran_field_type), intent(in) :: ls_field_n
type(tl_transport_controller_type), intent(inout) :: tl_transport_controller

! Mesh and transport objects
type(mesh_type), pointer :: mesh
type(wind_precomputations_type), pointer :: ls_wind_precomputations
type(wind_precomputations_type), pointer :: pert_wind_precomputations
type(transport_controller_type), pointer :: ls_transport_controller
type(transport_controller_type), pointer :: pert_transport_controller
type(transport_counter_type), pointer :: transport_counter
type(transport_metadata_type), pointer :: transport_metadata
integer(kind=i_def) :: sl_order
integer(kind=i_def) :: mesh_id
integer(kind=i_def) :: space
integer(kind=i_def) :: step
integer(kind=i_def) :: splitting
logical(kind=l_def) :: reversibility
integer(tik) :: id

! Interpolation coefficients
type(r_tran_field_type), pointer :: interp_coeffs(:)
type(integer_field_type), pointer :: interp_indices(:)
type(r_tran_field_type), pointer :: dep_dist_pert

if ( LPROF ) call start_timing( id, 'transport.tl_sl_vertical' )

! Get transport objects
ls_transport_controller => tl_transport_controller%get_ls_wind_pert_rho_controller()
pert_transport_controller => tl_transport_controller%get_pert_wind_ls_rho_controller()
ls_wind_precomputations => ls_transport_controller%get_wind_precomputations()
pert_wind_precomputations => pert_transport_controller%get_wind_precomputations()
transport_counter => pert_transport_controller%get_transport_counter()
transport_metadata => pert_transport_controller%get_transport_metadata()

! Get mesh and transport options
mesh => field_n%get_mesh()
mesh_id = mesh%get_id()
space = field_n%which_function_space()
reversibility = transport_metadata%get_reversible()
step = transport_counter%get_split_step_of_substep_counter()
splitting = transport_metadata%get_splitting()

select case ( vertical_sl_order )
! Note TL only set up for cubic coefficients
case ( vertical_sl_order_cubic )
sl_order = vertical_sl_order
if ( reversibility ) then
sl_order = vertical_sl_order_cubic_hermite
end if
case default
call log_event('TL vertical semi-Lagrangian only compatible with cubic coefficients', LOG_LEVEL_ERROR)
end select

! Set field_np1 = field_n and compute TL transport as
! field_np1 = field_n_D - dt u grad ls_field
call invoke( setval_X(field_np1, field_n) )

! Get the SL interpolation coefficients and indices
interp_coeffs => ls_wind_precomputations%get_vert_sl_coeff( &
mesh_id, space, sl_order, splitting, step &
)
interp_indices => ls_wind_precomputations%get_vert_sl_index( &
mesh_id, space, sl_order, splitting, step &
)
! Require departure distance from perturbation wind
dep_dist_pert => pert_wind_precomputations%get_dep_dist_z( &
mesh_id, splitting, step &
)

! Cubic (Lagrange or Hermite) interpolation of field
call invoke( tl_vertical_cubic_sl_kernel_type( field_np1, &
ls_field_n, &
dep_dist_pert, &
interp_coeffs(1), &
interp_coeffs(2), &
interp_coeffs(3), &
interp_coeffs(4), &
interp_indices(1), &
interp_indices(2), &
interp_indices(3), &
interp_indices(4) ) )

! End of step: if necessary enforce min val and overwrite in blending zone
call tl_end_of_advective_step_alg( &
field_np1, field_n, transport_counter, transport_metadata &
)

if ( LPROF ) call stop_timing( id, 'transport.tl_sl_vertical' )

end subroutine tl_vertical_sl_advective_alg

end module tl_vertical_sl_advective_alg_mod
Loading
Loading