Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
Expand Up @@ -27,6 +27,7 @@ module adjt_apply_helmholtz_op_lookup_alg_mod
use adj_lookup_table_mod, only: adj_lookup_table_type
use sci_r_solver_field_vector_mod, only: r_solver_field_vector_type
use si_operators_alg_mod, only: compute_si_operators, get_helmholtz_operator
use dycore_constants_mod, only: stepper_siqn

implicit none

Expand Down Expand Up @@ -120,9 +121,9 @@ module adjt_apply_helmholtz_op_lookup_alg_mod
end do

call compute_si_operators( config, init_op_t, init_op_d, init_op_p, &
model_clock, init_op_moist_dyn )
model_clock, init_op_moist_dyn, stepper_siqn )

Helmholtz_operator => get_helmholtz_operator(level)
Helmholtz_operator => get_helmholtz_operator(stepper_siqn, level)
lam_mesh = .false.

call vector_x%initialise(vector_space_w3_ptr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module adjt_mixed_operator_alg_mod
use moist_dyn_mod, only: num_moist_factors
use fs_continuity_mod, only: W2, W3, Wtheta
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use model_clock_mod, only: model_clock_type
use function_space_mod, only: function_space_type
Expand Down Expand Up @@ -116,7 +117,7 @@ contains
end do

call compute_si_operators( config, rhs(igh_t), rhs(igh_d), rhs(igh_p), &
model_clock, moist_dyn )
model_clock, moist_dyn, stepper_siqn )

! Input fields are r_def fields so preliminary work uses field_types

Expand Down Expand Up @@ -144,7 +145,7 @@ contains
call construct_solver_state( vector_mx, rhs_rsol, import_fields=.false. )
call construct_solver_state( vector_amx, rhs_rsol, import_fields=.false. )

mixed_op = mixed_operator_type()
mixed_op = mixed_operator_type(stepper_siqn)

call vector_mx%set_scalar(0.0_r_def)
call vector_amx%set_scalar(0.0_r_def)
Expand Down Expand Up @@ -184,7 +185,7 @@ contains
! Adjoint code
! --------------------------------------------------------------------------

adj_mixed_op = adj_mixed_operator_type()
adj_mixed_op = adj_mixed_operator_type(stepper_siqn)

call adj_mixed_op%apply( vector_mx, vector_amx )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module adjt_mixed_schur_preconditioner_alg_mod
use driver_modeldb_mod, only: modeldb_type
use fs_continuity_mod, only: W2, W3, Wtheta
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use model_clock_mod, only: model_clock_type
use function_space_mod, only: function_space_type
Expand Down Expand Up @@ -161,16 +162,17 @@ contains
ls_moist_dyn => ls_moist_dyn_array%bundle

call compute_si_operators( modeldb%config, ls_theta, ls_rho, ls_exner, &
model_clock, ls_moist_dyn )
model_clock, ls_moist_dyn, stepper_siqn )

call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner )
call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner, stepper_siqn )
call create_pressure_solver( pressure_operator, pressure_preconditioner, pressure_solver )
call create_mixed_preconditioner( rhs, pressure_solver, mixed_preconditioner )
call create_mixed_preconditioner( rhs, pressure_solver, mixed_preconditioner, stepper_siqn )

call create_adj_pressure_preconditioner( rhs, adj_lookup_table_cache, &
adj_pressure_operator, adj_pressure_preconditioner )
adj_pressure_operator, adj_pressure_preconditioner, &
stepper_siqn )
call create_adj_pressure_solver( adj_pressure_operator, adj_pressure_preconditioner, adj_pressure_solver )
call create_adj_mixed_preconditioner( rhs, adj_pressure_solver, adj_mixed_preconditioner )
call create_adj_mixed_preconditioner( rhs, adj_pressure_solver, adj_mixed_preconditioner, stepper_siqn )

call construct_solver_state( vector_x, rhs_rsol, import_fields=.true. )
call construct_solver_state( vector_mx, rhs_rsol, import_fields=.false. )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module adjt_mixed_solver_alg_mod
use solver_constants_mod, only: get_normalisation
use fs_continuity_mod, only: W2, W3, Wtheta
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use operator_mod, only: operator_type
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use model_clock_mod, only: model_clock_type
Expand Down Expand Up @@ -190,18 +191,19 @@ contains
ls_moist_dyn => ls_moist_dyn_array%bundle

call compute_si_operators( modeldb%config, ls_theta, ls_rho, ls_exner, &
model_clock, ls_moist_dyn )
model_clock, ls_moist_dyn, stepper_siqn )

call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner )
call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner, stepper_siqn )
call create_pressure_solver( pressure_operator, pressure_preconditioner, pressure_solver )
call create_mixed_preconditioner( rhs, pressure_solver, mixed_preconditioner )
call create_mixed_solver( mixed_preconditioner, mixed_operator, mixed_solver )
call create_mixed_preconditioner( rhs, pressure_solver, mixed_preconditioner, stepper_siqn )
call create_mixed_solver( mixed_preconditioner, mixed_operator, mixed_solver, stepper_siqn )

call create_adj_pressure_preconditioner( rhs, adj_lookup_table_cache, &
adj_pressure_operator, adj_pressure_preconditioner )
adj_pressure_operator, adj_pressure_preconditioner, &
stepper_siqn )
call create_adj_pressure_solver( adj_pressure_operator, adj_pressure_preconditioner, adj_pressure_solver )
call create_adj_mixed_preconditioner( rhs, adj_pressure_solver, adj_mixed_preconditioner )
call create_adj_mixed_solver( adj_mixed_preconditioner, adj_mixed_operator, adj_mixed_solver )
call create_adj_mixed_preconditioner( rhs, adj_pressure_solver, adj_mixed_preconditioner, stepper_siqn )
call create_adj_mixed_solver( adj_mixed_preconditioner, adj_mixed_operator, adj_mixed_solver, stepper_siqn )

call construct_solver_state( vector_x, rhs_rsol, import_fields=.true. )
call construct_solver_state( vector_mx, rhs_rsol, import_fields=.false. )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module adjt_pressure_precon_alg_mod
use driver_modeldb_mod, only: modeldb_type
use fs_continuity_mod, only: W2, W3, Wtheta
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use model_clock_mod, only: model_clock_type
use function_space_mod, only: function_space_type
Expand Down Expand Up @@ -150,14 +151,15 @@ contains
ls_moist_dyn => ls_moist_dyn_array%bundle

call compute_si_operators( modeldb%config, ls_theta, ls_rho, ls_exner, &
model_clock, ls_moist_dyn )
model_clock, ls_moist_dyn, stepper_siqn )

call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner )
call create_pressure_preconditioner( rhs, pressure_operator, pressure_preconditioner, stepper_siqn )

call create_adj_pressure_preconditioner( rhs, &
adj_lookup_table_cache, &
adj_pressure_operator, &
adj_pressure_preconditioner )
call create_adj_pressure_preconditioner( rhs, &
adj_lookup_table_cache, &
adj_pressure_operator, &
adj_pressure_preconditioner, &
stepper_siqn )

! Size = 1 as only P field needed
vector_x = r_solver_field_vector_type(1_i_def)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
! (C) Crown copyright 2025 Met Office. All rights reserved.
! The file LICENCE, distributed with this code, contains details of the terms
! under which the code may be used.
!
! Some of the content of this file has been produced with the assistance of
! Met Office GitHub Copilot Enterprise.
!-----------------------------------------------------------------------------

! @todo Causes failure of later test (mixed_schur_preconditioner); not calling until resolved (#616).
Expand All @@ -23,7 +26,9 @@ module adjt_scaled_matrix_vector_alg_mod
use operator_mod, only: r_solver_operator_type
use r_solver_field_mod, only: r_solver_field_type
use sci_r_solver_field_vector_mod, only: r_solver_field_vector_type
use si_operators_alg_mod, only: compute_si_operators, get_div_star, get_Hb_lumped_inv
use si_operators_alg_mod, only: compute_si_operators, get_div_star, get_Hb_lumped_inv, &
get_tau_u_dt_cp
use dycore_constants_mod, only: stepper_siqn
use solver_constants_mod, only: get_normalisation_r_solver

! Object types
Expand Down Expand Up @@ -83,6 +88,7 @@ module adjt_scaled_matrix_vector_alg_mod
real(kind=r_def) :: machine_tolerance
real(kind=r_def) :: relative_diff
real(kind=r_def), parameter :: overall_tolerance = 1500.0_r_def
real(kind=r_solver) :: const_u

! Setup

Expand All @@ -107,15 +113,17 @@ module adjt_scaled_matrix_vector_alg_mod
end do

call compute_si_operators( config, init_op_t, init_op_d, init_op_p, &
model_clock, init_op_moist_dyn )
model_clock, init_op_moist_dyn, stepper_siqn )

call vector_x%initialise(vector_space_w3_ptr)
call vector_mx%initialise(vector_space_w2_ptr)
call vector_x%copy_field_properties(vector_amx)

u_normalisation => get_normalisation_r_solver( W2, vector_mx%get_mesh_id() )
div_star => get_div_star()
Hb_lumped_inv => get_Hb_lumped_inv()
Hb_lumped_inv => get_Hb_lumped_inv(stepper_siqn)

const_u = get_tau_u_dt_cp(stepper_siqn)

call invoke( setval_random(vector_x), &
setval_c( vector_mx, 0.0_r_solver ), &
Expand All @@ -124,6 +132,7 @@ module adjt_scaled_matrix_vector_alg_mod
! Tangent linear (Mx)

scaled_matrix_vector_kernel_type( vector_mx, vector_x, div_star, u_normalisation, Hb_lumped_inv ), &
inc_a_times_X( const_u, vector_mx ), &

! <Mx,Mx>

Expand All @@ -144,6 +153,7 @@ module adjt_scaled_matrix_vector_alg_mod
! Adjoint (AMx)

adj_scaled_matrix_vector_kernel_type( vector_mx, vector_amx, div_star, u_normalisation, Hb_lumped_inv ), &
inc_a_times_X( const_u, vector_amx ), &

! <AMx,x>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module adjt_semi_implicit_solver_step_alg_mod
use fs_continuity_mod, only: W2, W3, Wtheta
use mr_indices_mod, only: nummr
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use operator_mod, only: operator_type
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use model_clock_mod, only: model_clock_type
Expand Down Expand Up @@ -164,8 +165,8 @@ contains
ls_moist_dyn => ls_moist_dyn_array%bundle

call compute_si_operators( modeldb%config, ls_theta, ls_rho, ls_exner, &
model_clock, ls_moist_dyn )
call adj_semi_implicit_solver%initialise(rhs, adj_lookup_table_cache)
model_clock, ls_moist_dyn, stepper_siqn )
call adj_semi_implicit_solver%initialise(rhs, adj_lookup_table_cache, stepper_siqn)

! Set up moist_dyn_gas_law & mr
call moist_dyn_gas_law%initialise(vector_space=vector_space_wtheta_ptr)
Expand Down Expand Up @@ -288,7 +289,7 @@ contains
! --------------------------------------------------------------------------

call semi_implicit_solver_alg_step( state, rhs, dry_flux_solver, &
moist_dyn_gas_law, mr, first_iteration )
moist_dyn_gas_law, mr, first_iteration, stepper_siqn )

! --------------------------------------------------------------------------
! Compute <Mx,Mx>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module atlt_si_timestep_alg_mod
use atl_si_timestep_alg_mod, only: atl_si_timestep_type
use driver_modeldb_mod, only: modeldb_type
use si_operators_alg_mod, only: compute_si_operators
use dycore_constants_mod, only: stepper_siqn
use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type
use field_array_mod, only: field_array_type

Expand Down Expand Up @@ -185,10 +186,10 @@ contains

call tl_semi_implicit_alg_init( mesh, u, rho, theta, exner, mr, &
ls_u, ls_rho, ls_theta, ls_exner, &
ls_mr, ls_moist_dyn, (num_steps == 1) )
ls_mr, ls_moist_dyn, modeldb, (num_steps == 1) )

call compute_si_operators( modeldb%config, ls_theta, ls_rho, ls_exner, &
modeldb%clock, ls_moist_dyn )
modeldb%clock, ls_moist_dyn, stepper_siqn )

do i = 1, num_steps
call tl_semi_implicit_alg_step( modeldb, u, rho, theta, exner, mr, moist_dyn, &
Expand Down
4 changes: 2 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ lfric_apps:
ref:

lfric_core:
source: git@github.com:MetOffice/lfric_core.git
ref: 2026.07.1
source: git@github.com:tommbendall/lfric_core.git
ref: 932de2756a609a4982ce34feb3f1911e0a2ee617

moci:
source: git@github.com:MetOffice/moci.git
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40DAA271B7D2549D
Inner product checksum theta = 42418E8247B61657
Inner product checksum u = 43F0A73C1317F206
Inner product checksum rho = 40DAA271B7D254AA
Inner product checksum theta = 42418E8247B61620
Inner product checksum u = 43F0A73C1317F263
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E2F2B22471284D
Inner product checksum theta = 4210411A3413C5A2
Inner product checksum u = 4501AC432273CA03
Inner product checksum rho = 40E2F2B2242AF118
Inner product checksum theta = 4210411A341E0453
Inner product checksum u = 4501AC431FED3CFB
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 4102EEF5FAAF36AB
Inner product checksum theta = 423041DD8254B694
Inner product checksum u = 45017CE3BDCC7471
Inner product checksum rho = 4102EEF5FA8E7F13
Inner product checksum theta = 423041DD8259BAF9
Inner product checksum u = 45017CE3BAE69359
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 4102EEF5FAAF36A3
Inner product checksum theta = 423041DD8254B695
Inner product checksum u = 45017CE3BDCC746C
Inner product checksum rho = 4102EEF5FA8E7F16
Inner product checksum theta = 423041DD8259BAF9
Inner product checksum u = 45017CE3BAE69366
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 4102EEF5FAAF36AA
Inner product checksum theta = 423041DD8254B693
Inner product checksum u = 45017CE3BDCC746C
Inner product checksum rho = 4102EEF5FA8E7F16
Inner product checksum theta = 423041DD8259BAFC
Inner product checksum u = 45017CE3BAE6936A
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E31B89B4F18C5A
Inner product checksum theta = 42104617DFB2BB0E
Inner product checksum u = 4500F65BA3091AE0
Inner product checksum rho = 40E31B57685FC942
Inner product checksum theta = 4210461EB3F32723
Inner product checksum u = 4500F5231DA5535E
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E2EB31AE9BB095
Inner product checksum theta = 42104262EDD0C3CB
Inner product checksum u = 4501DA5CB7431A79
Inner product checksum rho = 40E2EB31ADFD6F68
Inner product checksum theta = 42104262EDDA7DD4
Inner product checksum u = 4501DA5CB10C505E
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E2F33FFAE6F53C
Inner product checksum theta = 421041C1E2EA98E8
Inner product checksum u = 4501D86FAEA1FB4E
Inner product checksum rho = 40E2F340335FA448
Inner product checksum theta = 421041C1E108D985
Inner product checksum u = 4501D87A7956C1D6
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E2E6107980CF2C
Inner product checksum theta = 4210435EB2DDB805
Inner product checksum u = 4501348CFD6FF108
Inner product checksum rho = 40E2E6107980FA1D
Inner product checksum theta = 4210435EB2DE4D65
Inner product checksum u = 4501348CFD95684E
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40FE89845A99A3A0
Inner product checksum theta = 4210F00A9EEFED9B
Inner product checksum u = 42EF4B7C9D66048A
Inner product checksum rho = 40FE89845A9258B3
Inner product checksum theta = 4210F00A9EEFEC1A
Inner product checksum u = 42EF4B7C9D3BEF12
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E8EBCD2FEB4016
Inner product checksum theta = 4204E5A9894FB906
Inner product checksum u = 43F4FE3DAF7E7919
Inner product checksum rho = 40E8EBCD2FEB4063
Inner product checksum theta = 4204E5A9894FB99F
Inner product checksum u = 43F4FE3DAD48187A
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 41094CA3DACB8EB2
Inner product checksum theta = 4224DF7F73F04BA6
Inner product checksum u = 43C5208E2F479FE9
Inner product checksum rho = 41094CA3DACB8EDD
Inner product checksum theta = 4224DF7F73F04BB8
Inner product checksum u = 43C5208E2FA47CC1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40D3FF37BCAE74B3
Inner product checksum theta = 41EC4ACBE79A82E4
Inner product checksum u = 44176CD1D18E1CF0
Inner product checksum rho = 40D3FF37BCAE7457
Inner product checksum theta = 41EC4ACBE79A8386
Inner product checksum u = 44176CD1D18E33BA
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40EEEF267CFD70C4
Inner product checksum theta = 42E2AA885C6B5871
Inner product checksum u = 47563E0DE14081C8
Inner product checksum rho = 40EEEF267CFD6FB4
Inner product checksum theta = 42E2AA885C6B561D
Inner product checksum u = 47563E0DE14108BC
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40D56CA2970A6533
Inner product checksum theta = 42198C1F10A24A85
Inner product checksum u = 44E3E16E090FDE6D
Inner product checksum rho = 40D56CA2970A09FD
Inner product checksum theta = 42198C1F10A1CE70
Inner product checksum u = 44E3E16E089028C0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 40E34359B9A4055A
Inner product checksum theta = 421168C83D1FCA3C
Inner product checksum u = 45082CCFE158B801
Inner product checksum rho = 40E34359B1E29C24
Inner product checksum theta = 421168C83DA3C5BC
Inner product checksum u = 45082CCFA9D9C388
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Inner product checksum rho = 4122BF1AB11383BD
Inner product checksum theta = 4240B157AB726083
Inner product checksum u = 44FA82C80E829B57
Inner product checksum rho = 4122BF1AB1131A41
Inner product checksum theta = 4240B157AB6C8BBE
Inner product checksum u = 44FA82C80E7F38AB
Loading
Loading