diff --git a/applications/adjoint_tests/example/configuration.nml b/applications/adjoint_tests/example/configuration.nml index 1ad3e8b7b4..fbf4d2ea39 100644 --- a/applications/adjoint_tests/example/configuration.nml +++ b/applications/adjoint_tests/example/configuration.nml @@ -374,7 +374,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=1, +inner_iterations_si=1,1 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/adjoint_tests/source/algorithm/core_dynamics/atlt_rhs_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/core_dynamics/atlt_rhs_alg_mod.x90 index 0a674b796a..9c374d175d 100644 --- a/applications/adjoint_tests/source/algorithm/core_dynamics/atlt_rhs_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/core_dynamics/atlt_rhs_alg_mod.x90 @@ -29,6 +29,7 @@ module atlt_rhs_alg_mod use adjoint_test_parameters_mod, only : ls_u_range, ls_theta_range, & ls_rho_range, ls_exner_range, & ls_md1_range, ls_md2_range, ls_md3_range + use dycore_constants_mod, only : stepper_siqn implicit none @@ -208,7 +209,7 @@ module atlt_rhs_alg_mod ! Tangent linear call tl_rhs_alg( rhs, alpha_dt, base_state, state, moist_dyn, & ls_state, ls_moist_dyn, compute_eos, & - dlayer_rhs, model_clock ) + dlayer_rhs, stepper_siqn, model_clock ) ! < Mx, Mx > call invoke( x_innerproduct_x( base_state_inner_prod(igh_u), base_state(igh_u) ), & @@ -312,7 +313,7 @@ module atlt_rhs_alg_mod ! Adjoint call atl_rhs_alg( rhs, alpha_dt, base_state, state, moist_dyn, & ls_state, ls_moist_dyn, compute_eos, & - dlayer_rhs, model_clock ) + dlayer_rhs, stepper_siqn, model_clock ) ! < AMx, x > call invoke( x_innerproduct_y( base_state_base_state_input_inner_prod(igh_u), & diff --git a/applications/adjoint_tests/source/algorithm/lookup/solver/adjt_apply_helmholtz_op_lookup_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/lookup/solver/adjt_apply_helmholtz_op_lookup_alg_mod.x90 index e4cedd9ee0..734ee4c721 100644 --- a/applications/adjoint_tests/source/algorithm/lookup/solver/adjt_apply_helmholtz_op_lookup_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/lookup/solver/adjt_apply_helmholtz_op_lookup_alg_mod.x90 @@ -26,7 +26,10 @@ module adjt_apply_helmholtz_op_lookup_alg_mod use integer_field_mod, only: integer_field_type 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_operators, & + get_helmholtz_operator + use dycore_constants_mod, only: stepper_siqn implicit none @@ -119,10 +122,11 @@ module adjt_apply_helmholtz_op_lookup_alg_mod call invoke(setval_random(init_op_moist_dyn(idx))) end do - call compute_si_operators( config, init_op_t, init_op_d, init_op_p, & - model_clock, init_op_moist_dyn ) + call compute_si_operators_common( config, init_op_t, init_op_d, init_op_p, & + init_op_moist_dyn ) + call compute_helmholtz_operators( model_clock, 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) diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_operator_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_operator_alg_mod.x90 index 142a8b2415..58c960d421 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_operator_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_operator_alg_mod.x90 @@ -32,7 +32,9 @@ module adjt_mixed_operator_alg_mod use function_space_collection_mod, only: function_space_collection 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -115,8 +117,9 @@ contains call invoke(setval_random(moist_dyn(idx))) end do - call compute_si_operators( config, rhs(igh_t), rhs(igh_d), rhs(igh_p), & - model_clock, moist_dyn ) + call compute_si_operators_common( config, rhs(igh_t), rhs(igh_d), rhs(igh_p), & + moist_dyn ) + call compute_helmholtz_operators( model_clock, stepper_siqn ) ! Input fields are r_def fields so preliminary work uses field_types @@ -144,7 +147,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) @@ -184,7 +187,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 ) diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_schur_preconditioner_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_schur_preconditioner_alg_mod.x90 index 494787d7f6..b6a10c4eaa 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_schur_preconditioner_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_schur_preconditioner_alg_mod.x90 @@ -29,7 +29,9 @@ module adjt_mixed_schur_preconditioner_alg_mod use function_space_collection_mod, only: function_space_collection 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -160,17 +162,19 @@ contains call moisture_fields%get_field( "ls_moist_dyn", ls_moist_dyn_array ) 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 compute_si_operators_common( modeldb%config, ls_theta, ls_rho, ls_exner, & + ls_moist_dyn ) + call compute_helmholtz_operators( model_clock, 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. ) diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_solver_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_solver_alg_mod.x90 index 15a107d50d..f3ed73e501 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_solver_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_mixed_solver_alg_mod.x90 @@ -34,7 +34,9 @@ module adjt_mixed_solver_alg_mod use driver_modeldb_mod, only: modeldb_type 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -189,19 +191,21 @@ contains call moisture_fields%get_field( "ls_moist_dyn", ls_moist_dyn_array ) 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 compute_si_operators_common( modeldb%config, ls_theta, ls_rho, ls_exner, & + ls_moist_dyn ) + call compute_helmholtz_operators( model_clock, 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. ) diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_pressure_precon_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_pressure_precon_alg_mod.x90 index 54ddc36203..ffbe3441f2 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_pressure_precon_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_pressure_precon_alg_mod.x90 @@ -27,7 +27,9 @@ module adjt_pressure_precon_alg_mod use function_space_collection_mod, only: function_space_collection 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -149,15 +151,17 @@ contains call moisture_fields%get_field( "ls_moist_dyn", ls_moist_dyn_array ) 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 compute_si_operators_common( modeldb%config, ls_theta, ls_rho, ls_exner, & + ls_moist_dyn ) + call compute_helmholtz_operators( model_clock, 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) diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_scaled_matrix_vector_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_scaled_matrix_vector_alg_mod.x90 index d90f8db2e6..1ae491af2b 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_scaled_matrix_vector_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_scaled_matrix_vector_alg_mod.x90 @@ -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). @@ -23,7 +26,11 @@ 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_common, & + compute_helmholtz_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 @@ -83,6 +90,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 @@ -106,8 +114,9 @@ module adjt_scaled_matrix_vector_alg_mod call invoke(setval_random(init_op_moist_dyn(idx))) end do - call compute_si_operators( config, init_op_t, init_op_d, init_op_p, & - model_clock, init_op_moist_dyn ) + call compute_si_operators_common( config, init_op_t, init_op_d, init_op_p, & + init_op_moist_dyn ) + call compute_helmholtz_operators( model_clock, stepper_siqn ) call vector_x%initialise(vector_space_w3_ptr) call vector_mx%initialise(vector_space_w2_ptr) @@ -115,7 +124,9 @@ module adjt_scaled_matrix_vector_alg_mod 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 ), & @@ -123,7 +134,8 @@ 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 ), & + scaled_matrix_vector_kernel_type( vector_mx, vector_x, div_star, u_normalisation, Hb_lumped_inv, & + const_u ), & ! @@ -143,7 +155,8 @@ 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 ), & + adj_scaled_matrix_vector_kernel_type( vector_mx, vector_amx, div_star, u_normalisation, & + Hb_lumped_inv, const_u ), & ! diff --git a/applications/adjoint_tests/source/algorithm/solver/adjt_semi_implicit_solver_step_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/solver/adjt_semi_implicit_solver_step_alg_mod.x90 index b2196002c1..52eae82ba3 100644 --- a/applications/adjoint_tests/source/algorithm/solver/adjt_semi_implicit_solver_step_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/solver/adjt_semi_implicit_solver_step_alg_mod.x90 @@ -28,7 +28,9 @@ module adjt_semi_implicit_solver_step_alg_mod use driver_modeldb_mod, only: modeldb_type use fs_continuity_mod, only: W2, W3, Wtheta use mr_indices_mod, only: nummr - use si_operators_alg_mod, only: compute_si_operators + use si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -163,9 +165,10 @@ contains call moisture_fields%get_field( "ls_moist_dyn", ls_moist_dyn_array ) 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) + call compute_si_operators_common( modeldb%config, ls_theta, ls_rho, ls_exner, & + ls_moist_dyn ) + call compute_helmholtz_operators( model_clock, 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) @@ -288,7 +291,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 diff --git a/applications/adjoint_tests/source/algorithm/timestepping/atlt_si_timestep_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/timestepping/atlt_si_timestep_alg_mod.x90 index 5cf80dcd52..75044d343b 100644 --- a/applications/adjoint_tests/source/algorithm/timestepping/atlt_si_timestep_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/timestepping/atlt_si_timestep_alg_mod.x90 @@ -35,7 +35,9 @@ module atlt_si_timestep_alg_mod tl_semi_implicit_alg_final 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 si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_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 @@ -185,10 +187,11 @@ 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 ) + call compute_si_operators_common( modeldb%config, ls_theta, ls_rho, ls_exner, & + ls_moist_dyn ) + call compute_helmholtz_operators( modeldb%clock, stepper_siqn ) do i = 1, num_steps call tl_semi_implicit_alg_step( modeldb, u, rho, theta, exner, mr, moist_dyn, & diff --git a/applications/adjoint_tests/source/algorithm/transport/control/adjt_transport_controller_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/transport/control/adjt_transport_controller_alg_mod.x90 index bde20b358f..3dd6b3cd19 100644 --- a/applications/adjoint_tests/source/algorithm/transport/control/adjt_transport_controller_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/transport/control/adjt_transport_controller_alg_mod.x90 @@ -23,6 +23,7 @@ module adjt_transport_controller_alg_mod use finite_element_config_mod, only : element_order_h, & element_order_v use fs_continuity_mod, only : W2, W3 + use dycore_constants_mod, only : stepper_siqn use init_from_controller_alg_mod, only : init_ctrlr_fieldvals use inner_from_controller_rdef_alg_mod, only : ctrlr_ref_field_prod_rdef, & ctrlr_ref_field_inp_prod_rdef, & @@ -166,6 +167,7 @@ module adjt_transport_controller_alg_mod ref_field_inner_prod = 0.0_r_def call ls_wind_pert_rho_controller%initialise( config, & model_clock, & + stepper_siqn, & ref_field_rdef, & ls_wind_n_rdef, & ls_wind_np1_rdef, & @@ -355,6 +357,7 @@ module adjt_transport_controller_alg_mod wind_np1_inner_prod = 0.0_r_def call pert_wind_ls_rho_controller%initialise( config, & model_clock, & + stepper_siqn, & ls_ref_field_rdef, & wind_n_rdef, & wind_np1_rdef, & diff --git a/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_control_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_control_alg_mod.x90 index 894cb54b3a..61d813b038 100644 --- a/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_control_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_control_alg_mod.x90 @@ -11,6 +11,7 @@ module atlt_transport_control_alg_mod use field_mod, only : field_type use function_space_mod, only : function_space_type use constants_mod, only : r_def, i_def, l_def + use dycore_constants_mod, only : stepper_siqn use log_mod, only : log_event, & log_scratch_space, & LOG_LEVEL_INFO, & @@ -276,7 +277,7 @@ module atlt_transport_control_alg_mod wind_np1, wind_n, mr_out, mr_in, & ls_advected_fields, & ls_wind_np1, ls_wind_n, ls_mr_in, & - model_clock, outer ) + model_clock, outer, stepper_siqn ) ! < Mx, Mx > adv_inc_inner_prod = 0.0_r_def @@ -385,7 +386,8 @@ module atlt_transport_control_alg_mod wind_np1, wind_n, mr_out, mr_in, & ls_advected_fields, & ls_wind_np1, ls_wind_n, ls_mr_in, & - model_clock, outer, adj_lookup_table_cache ) + model_clock, outer, stepper_siqn, & + adj_lookup_table_cache ) ! < AMx, x > ai_ai_inp_inner_prod = 0.0_r_def diff --git a/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_controller_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_controller_alg_mod.x90 index 10e66cb437..c43e6e9016 100644 --- a/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_controller_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_controller_alg_mod.x90 @@ -9,6 +9,7 @@ module atlt_transport_controller_alg_mod use config_mod, only : config_type use constants_mod, only : i_def, r_def, l_def + use dycore_constants_mod, only : stepper_siqn use field_mod, only : field_type use r_tran_field_mod, only : r_tran_field_type use log_mod, only : log_event, & @@ -197,7 +198,7 @@ module atlt_transport_controller_alg_mod setval_X( wind_np1_rdef_inp, wind_np1_rdef ) ) ! Initialise tl_transport_controller object - call tl_transport_controller%initialise( config, model_clock, & + call tl_transport_controller%initialise( config, model_clock, stepper_siqn, & ref_field_rdef, ls_ref_field_rdef, & wind_n_rdef, wind_np1_rdef, & ls_wind_n_rdef, ls_wind_np1_rdef, & diff --git a/applications/adjoint_tests/source/algorithm/transport/setup_test_alg_mod.x90 b/applications/adjoint_tests/source/algorithm/transport/setup_test_alg_mod.x90 index 1c2d4d4651..d93074f823 100644 --- a/applications/adjoint_tests/source/algorithm/transport/setup_test_alg_mod.x90 +++ b/applications/adjoint_tests/source/algorithm/transport/setup_test_alg_mod.x90 @@ -25,6 +25,7 @@ module setup_test_alg_mod use transport_metadata_collection_mod, only : transport_metadata_collection use transport_controller_mod, only : transport_controller_type use transport_counter_mod, only : transport_counter_type + use dycore_constants_mod, only : stepper_siqn implicit none @@ -167,7 +168,7 @@ module setup_test_alg_mod outer = 1_i_def ! Initialise tl_transport_controller object - call tl_transport_controller%initialise( config, model_clock, & + call tl_transport_controller%initialise( config, model_clock, stepper_siqn, & ref_field_rdef, ls_ref_field_rdef, & wind_n_rdef, wind_np1_rdef, & ls_wind_n_rdef, ls_wind_np1_rdef, & diff --git a/applications/gravity_wave/example/configuration.nml b/applications/gravity_wave/example/configuration.nml index 9422c87aea..261a42fd4f 100644 --- a/applications/gravity_wave/example/configuration.nml +++ b/applications/gravity_wave/example/configuration.nml @@ -188,7 +188,7 @@ max_tiled_multigrid_level = 1 ×tepping alpha = 0.5 dt = 100.0 -inner_iterations = 2 +inner_iterations_si = 2,2 method = 'semi_implicit' outer_iterations = 2 runge_kutta_method = 'ssp3' diff --git a/applications/gungho_model/example/configuration.nml b/applications/gungho_model/example/configuration.nml index a289608b11..7d34ee6dbe 100644 --- a/applications/gungho_model/example/configuration.nml +++ b/applications/gungho_model/example/configuration.nml @@ -284,7 +284,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=3600, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/gungho_model/lam_example/baroclinic/config_driver.nml b/applications/gungho_model/lam_example/baroclinic/config_driver.nml index 37e927597e..2c1db1c255 100644 --- a/applications/gungho_model/lam_example/baroclinic/config_driver.nml +++ b/applications/gungho_model/lam_example/baroclinic/config_driver.nml @@ -189,7 +189,7 @@ calendar_start='2016-01-01 15:00:00', ×tepping alpha=0.5, dt=1000.0, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='ssp5', diff --git a/applications/gungho_model/lam_example/baroclinic/config_lam.nml b/applications/gungho_model/lam_example/baroclinic/config_lam.nml index f4c433a3d2..7de928f7b1 100644 --- a/applications/gungho_model/lam_example/baroclinic/config_lam.nml +++ b/applications/gungho_model/lam_example/baroclinic/config_lam.nml @@ -205,7 +205,7 @@ calendar_start='2016-01-01 15:00:00', ×tepping alpha=0.5, dt=1000.0, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='ssp5', diff --git a/applications/gungho_model/lam_example/straka/config_driver.nml b/applications/gungho_model/lam_example/straka/config_driver.nml index 5d66c1cdbb..fdd68907b2 100644 --- a/applications/gungho_model/lam_example/straka/config_driver.nml +++ b/applications/gungho_model/lam_example/straka/config_driver.nml @@ -190,7 +190,7 @@ calendar_start='2016-01-01 15:00:00', ×tepping alpha=0.5, dt=10.0, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='ssp5', diff --git a/applications/gungho_model/lam_example/straka/config_lam.nml b/applications/gungho_model/lam_example/straka/config_lam.nml index 9acf174831..fdab423e5b 100644 --- a/applications/gungho_model/lam_example/straka/config_lam.nml +++ b/applications/gungho_model/lam_example/straka/config_lam.nml @@ -202,7 +202,7 @@ calendar_start='2016-01-01 15:00:00', ×tepping alpha=0.5, dt=10.0, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='ssp5', diff --git a/applications/jedi_lfric_tests/example/configuration.nml b/applications/jedi_lfric_tests/example/configuration.nml index 1d5c54cd59..2ac45263c8 100644 --- a/applications/jedi_lfric_tests/example/configuration.nml +++ b/applications/jedi_lfric_tests/example/configuration.nml @@ -357,7 +357,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=1, +inner_iterations_si=1,1 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/jedi_lfric_tests/example_forecast/configuration.nml b/applications/jedi_lfric_tests/example_forecast/configuration.nml index 5cd7cf6842..fd18173612 100644 --- a/applications/jedi_lfric_tests/example_forecast/configuration.nml +++ b/applications/jedi_lfric_tests/example_forecast/configuration.nml @@ -305,7 +305,7 @@ timestep_start='1', ×tepping alpha=0.5, dt=90, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/jedi_lfric_tests/example_id_tlm_tests/configuration.nml b/applications/jedi_lfric_tests/example_id_tlm_tests/configuration.nml index 0744592c20..1f7beb7c82 100644 --- a/applications/jedi_lfric_tests/example_id_tlm_tests/configuration.nml +++ b/applications/jedi_lfric_tests/example_id_tlm_tests/configuration.nml @@ -402,7 +402,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=1, +inner_iterations_si=1,1 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration.nml b/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration.nml index 4ddd6423f3..0a1d693485 100644 --- a/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration.nml +++ b/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration.nml @@ -401,7 +401,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=1, +inner_iterations_si=1, method='semi_implicit', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration_op.nml b/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration_op.nml index 0df951baeb..66c837258c 100644 --- a/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration_op.nml +++ b/applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration_op.nml @@ -342,7 +342,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=3600, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/jedi_lfric_tests/example_tlm_tests/configuration.nml b/applications/jedi_lfric_tests/example_tlm_tests/configuration.nml index ccef538775..16c460b6db 100644 --- a/applications/jedi_lfric_tests/example_tlm_tests/configuration.nml +++ b/applications/jedi_lfric_tests/example_tlm_tests/configuration.nml @@ -401,7 +401,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=1, +inner_iterations_si=1, method='semi_implicit', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/jules/example/configuration.nml b/applications/jules/example/configuration.nml index 6c353e5b12..fcc72e1960 100644 --- a/applications/jules/example/configuration.nml +++ b/applications/jules/example/configuration.nml @@ -771,7 +771,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=600, -inner_iterations=2, +inner_iterations_si=2, method='jules', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/lfric_atm/example/configuration.nml b/applications/lfric_atm/example/configuration.nml index 1e117100ae..185a2fdc98 100644 --- a/applications/lfric_atm/example/configuration.nml +++ b/applications/lfric_atm/example/configuration.nml @@ -967,7 +967,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1200, -inner_iterations=2, +inner_iterations_si=2 method='semi_implicit', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/lfric_coupled/example/configuration.nml b/applications/lfric_coupled/example/configuration.nml index eb063ce2e9..0164870e56 100644 --- a/applications/lfric_coupled/example/configuration.nml +++ b/applications/lfric_coupled/example/configuration.nml @@ -698,7 +698,7 @@ calendar_origin='2016-01-01 15:00:00', ×tepping alpha=0.55, dt=600.0, -inner_iterations=2, +inner_iterations_si=2 method='semi_implicit', outer_iterations=1, runge_kutta_method='ssp3', diff --git a/applications/name_transport/example/configuration.nml b/applications/name_transport/example/configuration.nml index 2770871591..1afb5a9a42 100644 --- a/applications/name_transport/example/configuration.nml +++ b/applications/name_transport/example/configuration.nml @@ -127,7 +127,7 @@ calendar_origin='2016-01-01 15:00:00' ×tepping alpha=0.5, dt=4050.0, -inner_iterations=2, +inner_iterations_si=2,2 method='rk', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/name_transport/source/algorithm/name_transport_control_alg_mod.x90 b/applications/name_transport/source/algorithm/name_transport_control_alg_mod.x90 index d54229b705..4f988e9de6 100644 --- a/applications/name_transport/source/algorithm/name_transport_control_alg_mod.x90 +++ b/applications/name_transport/source/algorithm/name_transport_control_alg_mod.x90 @@ -192,6 +192,7 @@ contains subroutine name_transport_step( config, model_clock, wind, tracer_con, & rho, transport_density ) + use dycore_constants_mod, only: stepper_rk use init_gungho_prognostics_alg_mod, only: init_u_field use model_clock_mod, only: model_clock_type use sci_mass_matrix_solver_alg_mod, only: mass_matrix_solver_alg @@ -226,7 +227,7 @@ contains primary_mesh => wind%get_mesh() ! Initialise the main transport controller --------------------------------- - call transport_controller%initialise( config, model_clock, rho, wind ) + call transport_controller%initialise( config, model_clock, stepper_rk, rho, wind ) ! Transport dry density if (transport_density) then diff --git a/applications/ngarch/example/configuration_bl.nml b/applications/ngarch/example/configuration_bl.nml index 26a2b3789f..510d36c84e 100644 --- a/applications/ngarch/example/configuration_bl.nml +++ b/applications/ngarch/example/configuration_bl.nml @@ -475,7 +475,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=600, -inner_iterations=2, +inner_iterations_si=2, method='semi_implicit', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/ngarch/example/configuration_casim.nml b/applications/ngarch/example/configuration_casim.nml index 306c8bc8cf..307668037f 100644 --- a/applications/ngarch/example/configuration_casim.nml +++ b/applications/ngarch/example/configuration_casim.nml @@ -536,7 +536,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=600, -inner_iterations=2, +inner_iterations_si=2, method='semi_implicit', outer_iterations=1, runge_kutta_method='forward_euler', diff --git a/applications/shallow_water/example/configuration.nml b/applications/shallow_water/example/configuration.nml index 8f5e9f735c..d07c80fede 100644 --- a/applications/shallow_water/example/configuration.nml +++ b/applications/shallow_water/example/configuration.nml @@ -167,7 +167,7 @@ dt = 0.001 ! O(500) for thermal double vortex test case (res 120: 486 s) alpha = 0.5 outer_iterations = 2 -inner_iterations = 2 +inner_iterations_si = 2,2 runge_kutta_method = 'ssp3' ! This runge_kutta_method does not affect the shallow water miniapp spinup_alpha = .false. diff --git a/applications/shallow_water/source/algorithm/swe_timestep_alg_mod.x90 b/applications/shallow_water/source/algorithm/swe_timestep_alg_mod.x90 index 0acc86c13d..2a877a02ac 100644 --- a/applications/shallow_water/source/algorithm/swe_timestep_alg_mod.x90 +++ b/applications/shallow_water/source/algorithm/swe_timestep_alg_mod.x90 @@ -15,6 +15,7 @@ module swe_timestep_alg_mod ! Constants use constants_mod, only: i_def, r_def + use dycore_constants_mod, only: stepper_siqn, stepper_rk use field_indices_mod, only: isw_u, & isw_g, & isw_b, & @@ -36,7 +37,7 @@ module swe_timestep_alg_mod tik, LPROF use timestepping_config_mod, only: alpha, & outer_iterations, & - inner_iterations + inner_iterations_si use transport_config_mod, only: cheap_update ! Derived Types @@ -486,13 +487,14 @@ contains outer_dynamics_loop: do outer = 1,outer_iterations ! Advect quantities - call swe_transport_control_alg_step( config, & - rhs_adv, & - adv_fields, & - state_n, & - state, & - model_clock, & - outer, & + call swe_transport_control_alg_step( config, & + rhs_adv, & + adv_fields, & + state_n, & + state, & + model_clock, & + outer, & + stepper_siqn, & wind_prev ) ! Set wind_prev to be latest estimate of wind @@ -530,7 +532,7 @@ contains !============================================================================ ! Start the inner loop !============================================================================ - inner_dynamics_loop: do inner = 1,inner_iterations + inner_dynamics_loop: do inner = 1,inner_iterations_si(outer) ! Build residual: -R = -( rhs(state, alpha) - rhs(state_n, alpha-1) - rhs_adv) call swe_rhs_alg( rhs_np1, alpha_dt, state, s_geopot ) @@ -668,13 +670,14 @@ contains ! Advect quantities outer_iteration = 1_i_def call rhs_adv%set_scalar(0.0_r_def) - call swe_transport_control_alg_step( config, & - rhs_adv, & - adv_fields, & - state_n, & - state, & - model_clock, & - outer_iteration ) + call swe_transport_control_alg_step( config, & + rhs_adv, & + adv_fields, & + state_n, & + state, & + model_clock, & + outer_iteration, & + stepper_rk ) ! Put RHS together call rhs_n%axpy(1.0_r_def, rhs_adv) diff --git a/applications/shallow_water/source/algorithm/swe_transport_control_alg_mod.x90 b/applications/shallow_water/source/algorithm/swe_transport_control_alg_mod.x90 index 5b397f3b22..a1f4f2ec9c 100644 --- a/applications/shallow_water/source/algorithm/swe_transport_control_alg_mod.x90 +++ b/applications/shallow_water/source/algorithm/swe_transport_control_alg_mod.x90 @@ -12,6 +12,7 @@ module swe_transport_control_alg_mod use combine_w2_field_kernel_mod, only: combine_w2_field_kernel_type use constants_mod, only: i_def, r_def, l_def, r_tran use derived_config_mod, only: bundle_size + use dycore_constants_mod, only: stepper_siqn use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type use flux_precomputations_alg_mod, only: flux_precomputations_type use field_mod, only: field_type @@ -138,6 +139,7 @@ contains !> @param[in] state_np1 Estimate of fields at time n+1 !> @param[in] model_clock Time within the model !> @param[in] outer Outer (advection) iteration number + !> @param[in] stepper Enumerator for timestepper !> @param[in] wind_prev (Optional) Estimate of end of timestep wind !! from previous outer iteration subroutine swe_transport_control_alg_step( config, & @@ -147,6 +149,7 @@ contains state_np1, & model_clock, & outer, & + stepper, & wind_prev ) use sci_fem_constants_mod, only: get_mass_matrix_fe @@ -165,6 +168,7 @@ contains type(field_vector_type), target, intent(in) :: state_n class(model_clock_type), intent(in) :: model_clock integer(kind=i_def), intent(in) :: outer + integer(kind=i_def), intent(in) :: stepper type(field_type), intent(in), optional :: wind_prev ! Fields from advected_fields, state_n and state_np1 vector @@ -239,8 +243,9 @@ contains prev_inc = advection_inc ! Create transport_controller object (advecting wind etc) - call transport_controller%initialise(config, & - model_clock, q, wind_for_adv, wind_np1, & + call transport_controller%initialise( & + config, model_clock, stepper, & + q, wind_for_adv, wind_np1, & outer=outer, cheap_update_step=cheap_update_step & ) @@ -434,7 +439,7 @@ contains if ( LPROF ) call start_timing( id_swe_tracer, 'swe_tracer_transport_alg' ) ! Initialise the main transport controller --------------------------------- - call transport_controller%initialise( config, model_clock, & + call transport_controller%initialise( config, model_clock, stepper_siqn, & mass_n, wind_n, wind_np1 ) ! Initialise transported variables diff --git a/applications/transport/example/configuration.nml b/applications/transport/example/configuration.nml index 282eeb2af7..6e21496196 100644 --- a/applications/transport/example/configuration.nml +++ b/applications/transport/example/configuration.nml @@ -193,7 +193,7 @@ tolerance=1.0e-6, ×tepping alpha=0.5, dt=4050.0, -inner_iterations=2, +inner_iterations_si=2,2 method='rk', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/applications/transport/source/algorithm/transport_control_alg_mod.x90 b/applications/transport/source/algorithm/transport_control_alg_mod.x90 index a7c151dc55..a6760fa561 100644 --- a/applications/transport/source/algorithm/transport_control_alg_mod.x90 +++ b/applications/transport/source/algorithm/transport_control_alg_mod.x90 @@ -260,6 +260,7 @@ contains wt_aerosol, aerosol_wind, & nummr_to_transport ) + use dycore_constants_mod, only: stepper_rk use sci_field_bundle_builtins_mod, only: clone_bundle, copy_bundle use formulation_config_mod, only: use_multires_coupling use init_gungho_prognostics_alg_mod, only: init_u_field @@ -325,10 +326,13 @@ contains call map_rho_intermesh(aerosol_reference_rho, rho) ! Initialise the main transport controller --------------------------------- - call transport_controller%initialise( config, model_clock, rho, wind ) - call aerosol_transport_controller%initialise( config, model_clock, & - aerosol_reference_rho, & - aerosol_wind ) + call transport_controller%initialise( & + config, model_clock, stepper_rk, rho, wind & + ) + call aerosol_transport_controller%initialise( & + config, model_clock, stepper_rk, & + aerosol_reference_rho, aerosol_wind & + ) ! Transport dry density call log_event( "Transporting density...", LOG_LEVEL_INFO) diff --git a/dependencies.yaml b/dependencies.yaml index c1313e4d75..dbf75bc9ba 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -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 diff --git a/documentation/source/science_guide/references.bib b/documentation/source/science_guide/references.bib new file mode 100644 index 0000000000..c9c4227734 --- /dev/null +++ b/documentation/source/science_guide/references.bib @@ -0,0 +1,43 @@ +@article{melvin2019mixed, + title={A mixed finite-element, finite-volume, semi-implicit discretization for atmospheric dynamics: Cartesian geometry}, + author={Melvin, Thomas and Benacchio, Tommaso and Shipway, Ben and Wood, Nigel and Thuburn, John and Cotter, Colin}, + journal={Quarterly Journal of the Royal Meteorological Society}, + volume={145}, + number={724}, + pages={2835--2853}, + year={2019}, + publisher={Wiley Online Library} +} + +@article{melvin2024mixed, + title={A mixed finite-element, finite-volume, semi-implicit discretisation for atmospheric dynamics: spherical geometry}, + author={Melvin, Thomas and Shipway, Ben and Wood, Nigel and Benacchio, Tommaso and Bendall, Thomas and Boutle, Ian and Brown, Alex and Johnson, Christine and Kent, James and Pring, Stephen and others}, + journal={Quarterly Journal of the Royal Meteorological Society}, + volume={150}, + number={764}, + pages={4252--4269}, + year={2024}, + publisher={Wiley Online Library} +} + +@article{wood2014inherently, + title={An inherently mass-conserving semi-implicit semi-{L}agrangian discretization of the deep-atmosphere global non-hydrostatic equations}, + author={Wood, Nigel and Staniforth, Andrew and White, Andy and Allen, Thomas and Diamantakis, Michail and Gross, Markus and Melvin, Thomas and Smith, Chris and Vosper, Simon and Zerroukat, Mohamed and others}, + journal={Quarterly Journal of the Royal Meteorological Society}, + volume={140}, + number={682}, + pages={1505--1520}, + year={2014}, + publisher={Wiley Online Library} +} + +@article{tumolo2015semi, + title={A semi-implicit, semi-{L}agrangian discontinuous {G}alerkin framework for adaptive numerical weather prediction}, + author={Tumolo, Giovanni and Bonaventura, Luca}, + journal={Quarterly Journal of the Royal Meteorological Society}, + volume={141}, + number={692}, + pages={2582--2601}, + year={2015}, + publisher={Wiley Online Library} +} \ No newline at end of file diff --git a/documentation/source/science_guide/timestepping/index.rst b/documentation/source/science_guide/timestepping/index.rst new file mode 100644 index 0000000000..63b72aa876 --- /dev/null +++ b/documentation/source/science_guide/timestepping/index.rst @@ -0,0 +1,36 @@ +.. ----------------------------------------------------------------------------- + (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. + Some of the content of this file has been produced with the assistance of + Met Office GitHub Copilot Enterprise. + ----------------------------------------------------------------------------- + +.. _science_guide_timestepping: + +Timestepping +============ + +GungHo's dynamical core can be advanced in time using one of several +timestepping schemes (see the :ref:`User Guide ` for +how these are configured). This section describes +the numerical formulation of each scheme: + +.. toctree:: + :maxdepth: 2 + + semi_implicit + runge_kutta + tr_bdf2 + +.. attention:: + + The formulations below use the notation of a state vector + :math:`\boldsymbol{X}`, an operator :math:`\mathcal{F}` representing the + evaluation of forces (such as the pressure gradient, Coriolis and + gravitational forces), and a transport operator + :math:`\mathcal{T}^{\Delta t}_{\boldsymbol{u}}`, relating to a velocity + :math:`\boldsymbol{u}`, over a time step :math:`\Delta t`. The transport + operator returns a transported field (rather than a transport increment). + Increments from physics parametrisation schemes are represented by + :math:`\mathcal{P}`. diff --git a/documentation/source/science_guide/timestepping/runge_kutta.rst b/documentation/source/science_guide/timestepping/runge_kutta.rst new file mode 100644 index 0000000000..f918961ca6 --- /dev/null +++ b/documentation/source/science_guide/timestepping/runge_kutta.rst @@ -0,0 +1,55 @@ +.. ----------------------------------------------------------------------------- + (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. + Some of the content of this file has been produced with the assistance of + Met Office GitHub Copilot Enterprise. + ----------------------------------------------------------------------------- + +.. _science_guide_timestepping_runge_kutta: + +Runge-Kutta +=========== + +The Runge-Kutta timestepping method is an explicit, +multi-stage scheme. It can be used either to timestep +the whole dynamical core, or in combination with the Method-of-Lines +transport scheme. The Strong Stability Preserving (SSP) variants +are explicit multi-stage methods +which combine the values computed over multiple stages as a weighted linear +sum, in order to provide stability. A simple forward Euler option is also +available. + +Runge-Kutta timestepping of the whole dynamical core has not been implemented +in combination with physics parametrization schemes. + +Rather than splitting terms as in the Quasi-Newton schemes, the Runge-Kutta +treats the whole equation set for the state vector :math:`\boldsymbol{X}` as one: + +.. math:: + + \frac{\partial\boldsymbol{X}}{\partial t} + \mathcal{G}(\boldsymbol{X}) = \boldsymbol{0}, + +where :math:`\mathcal{G}` encompasses forcing and transport terms. +An explicit Runge-Kutta scheme advances one timestep by evaluating a sequence of +:math:`M` stages, + +.. math:: + + \begin{aligned} + \boldsymbol{X}^{(0)} &= \boldsymbol{X}^{n}, \\ + \boldsymbol{X}^{(m)} &= \boldsymbol{X}^{(0)} + - \Delta t\sum_{i=1}^{m} c_{m,i}\mathcal{G}[\boldsymbol{X}^{(i-1)}], \qquad \forall m = 1, \ldots, M, \\ + \boldsymbol{X}^{n+1} &= \boldsymbol{X}^{(M)}. + \end{aligned} + +The scheme is explicit because each stage :math:`i` depends only on +previous stages so no implicit solve is required. +In practice this means a +Runge-Kutta step is a sequence of tendency evaluations and weighted sums, +with higher-order SSP variants using more stages than Forward Euler to +improve stability and accuracy. + +In GungHo, this same stage-update pattern is used whether Runge-Kutta is +applied to the whole dynamical core, or used inside Method-of-Lines +transport where :math:`\mathcal{G}` is the transport tendency operator. diff --git a/documentation/source/science_guide/timestepping/semi_implicit.rst b/documentation/source/science_guide/timestepping/semi_implicit.rst new file mode 100644 index 0000000000..5f153134fe --- /dev/null +++ b/documentation/source/science_guide/timestepping/semi_implicit.rst @@ -0,0 +1,450 @@ +.. ----------------------------------------------------------------------------- + (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. + Some of the content of this file has been produced with the assistance of + Met Office GitHub Copilot Enterprise. + ----------------------------------------------------------------------------- + +.. _science_guide_timestepping_semi_implicit: + +Semi-Implicit +============= + +Overview +-------- + +The Semi-Implicit Quasi-Newton (SIQN) scheme is GungHo's default timestepping +scheme. It belongs to the family of +Semi-Implicit Semi-Lagrangian (SISL) schemes, which have been used +successfully in operational numerical weather prediction for several decades. +The appeal of SISL schemes is that they permit a large, stable timestep while +retaining good accuracy. This is achieved by combining two ideas: + +* a Crank-Nicolson-like (trapezoidal) treatment of the wave-like and forcing + terms, which is unconditionally stable with respect to the timestep for + wave equations; and +* a transport scheme with some Semi-Lagrangian aspect so that stability does + not depend on the Courant number. + +In a classical SISL scheme, the explicit :math:`n`-level values are evaluated +at the departure points, while the implicit :math:`(n+1)`-level values are +evaluated at the arrival points. This results in a discretisation of the +material derivative which preserves the numerical properties of the +Crank-Nicolson scheme: low frequency waves (such as Rossby waves) are +represented accurately, while high frequency (acoustic) waves can be damped +through off-centering. + +GungHo builds on the classical SISL picture by providing local mass conservation +through the use of conservative transport schemes. Like the ENDGame dynamical +core of [Wood2014]_ used by the Unified Model, GungHo uses a +Quasi-Newton iteration to solve the non-linear system of equations arising from +the implicit treatment of the wave-like and forcing terms. + +For a full description of the formulation of GungHo, see [Melvin2019]_ +and [Melvin2024]_. + +Details +------- + +Basic formulation +~~~~~~~~~~~~~~~~~~ + +Given the off-centering parameter :math:`\alpha`, the SIQN scheme advances +the state from time level :math:`n` to time level :math:`n+1` according to: + +.. math:: :label: siqn_eqn + + \boldsymbol{X}^{n+1} + \alpha\Delta t \mathcal{F}(\boldsymbol{X}^{n+1}) + = \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1}} + \left[\boldsymbol{X}^n - (1-\alpha)\Delta t \mathcal{F}(\boldsymbol{X}^n)\right], + +where the transporting velocity is the average of the start- and +end-of-timestep winds, + +.. math:: :label: siqn_transport_velocity + + \overline{\boldsymbol{u}}_n^{n+1} = \tfrac{1}{2}\left(\boldsymbol{u}^n + \boldsymbol{u}^{n+1}\right). + +The forcing terms are handled with a weighting of :math:`\alpha` on the +implicit (:math:`n+1`)-th time level and :math:`(1-\alpha)` on the explicit +:math:`n`-th time level. + +A value of :math:`\alpha=0.5` corresponds to a centred Crank-Nicolson scheme, +which is formally second-order accurate in time but does not damp any waves. +If orography is present, it can generate spurious small-scale waves which, +without any damping, may persist and pollute the solution, potentially leading +to instability; centred SISL schemes can also suffer from orographic resonance. +For these reasons the scheme is run slightly off-centred +(:math:`\alpha > 0.5`), which introduces damping of high-frequency (typically +acoustic) modes at the cost of reducing the formal accuracy to first order. +A value of :math:`\alpha=1.0` corresponds to a fully implicit scheme. + +Quasi-Newton iteration +~~~~~~~~~~~~~~~~~~~~~~~ + +Equation :eq:`siqn_eqn` is non-linear in the unknown state +:math:`\boldsymbol{X}^{n+1}`, and is solved iteratively. Let us use :math:`k` +to index the iteration, so that :math:`k`-th iteration of +:math:`\boldsymbol{X}^{n+1}` is :math:`\boldsymbol{X}^{n+1}_{(k)}`, where +:math:`\boldsymbol{X}^{n+1}_{(0)} = \boldsymbol{X}^n` is the first guess. +The :math:`k`-th transported state :math:`\boldsymbol{X}^T_{(k)}` is introduced as: + +.. math:: + + \boldsymbol{X}^T_{(k)} = \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1,(k)}} + \left[\boldsymbol{X}^n - (1-\alpha)\Delta t \mathcal{F}(\boldsymbol{X}^n)\right], + +which depends upon the latest value of the end-of-timestep transporting velocity. +Then the residual of the :math:`k`-th iterate :math:`\boldsymbol{X}^{n+1}_{(k)}` is + +.. math:: :label: siqn_residual + + \boldsymbol{R}_{(k)} = -\left(\boldsymbol{X}^{n+1}_{(k)} + + \alpha\Delta t \mathcal{F}(\boldsymbol{X}^{n+1}_{(k)}) - \boldsymbol{X}^T_{(k)}\right). + +A full Newton method would drive this residual to zero by solving + +.. math:: + + \mathcal{J}\left[\boldsymbol{X}^{n+1}_{(k)}\right] + \left(\boldsymbol{X}^{n+1}_{(k+1)} - \boldsymbol{X}^{n+1}_{(k)}\right) + = \boldsymbol{R}_{(k)}, + +where :math:`\mathcal{J}` is the Jacobian of the residual with respect to +:math:`\boldsymbol{X}^{n+1}`. Forming and inverting the exact Jacobian is +expensive, so (like ENDGame) GungHo instead uses a *Quasi-Newton* method: the Jacobian is +approximated by a fixed linearisation :math:`\mathcal{S}` of the equation set +about a reference state. Writing the increment as +:math:`\boldsymbol{X}' = \boldsymbol{X}^{n+1}_{(k+1)} - \boldsymbol{X}^{n+1}_{(k)}`, +each iteration then solves the linear system + +.. math:: :label: siqn_linear_system + + \mathcal{S}\,\boldsymbol{X}' = \boldsymbol{R}_{(k)}. + +This "incremental" form is the one used in GungHo, and the scheme is not +iterated to convergence: a small, fixed number of iterations is taken. Although +this can still be accurate, it can be unstable for certain numbers of iterations. + +Outer and inner iterations +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In practice, the change to transport increments from one iteration to the next +is smaller than the change from the implicit forcing terms. This allows us +to split the Quasi-Newton iteration into two nested loops: + +* an **outer loop**, which is iterated :math:`n_o` times, + in which the transporting velocity + is updated with the latest estimate of :math:`\boldsymbol{u}^{n+1}` and the + prognostic variables are transported. The transport scheme is therefore + called :math:`n_o` times per timestep. +* an **inner loop**, which is iterated :math:`n^j_i` times, where :math:`j` + is the outer-loop index. + In the inner loop, implicit forcing terms + are evaluated to form the residual :eq:`siqn_residual`, and the linear + system :eq:`linear_solver_eqn` is assembled and solved for the increment. + The number of inner iterations can be varied between outer iterations, but + has historically been kept the same at :math:`n_i` for each outer iteration, + so that the linear solve is performed :math:`n_o \times n_i` times per + timestep. + +Like ENDGame, GungHo uses a default of :math:`n_o=2` outer iterations and +:math:`n_i=2` inner iterations, for a total of 4 linear solves per timestep. + +The density and potential temperature fields do not receive updates from the +forcings evaluated in the inner loop, and are only updated in the outer loop. +Thus, when using more than one inner iteration, the density and potential +temperature contributions to the residual are set to zero for any inner +iteration after the first. This is why it is recommended to set the density and +potential-temperature relaxation parameters to 1 when more than one inner +iteration is used. + +Linear solver +~~~~~~~~~~~~~ + +The linearised operator :math:`\mathcal{S}` in Equation +:eq:`siqn_linear_system` is obtained by linearising the residuals about a +reference state :math:`\boldsymbol{X}^* = (\boldsymbol{0}, \rho^*, \theta^*, +\Pi^*)^\mathrm{T}`. The resulting linear problem takes the general form + +.. math:: :label: linear_solver_eqn + + \boldsymbol{X}' + \sigma \mathcal{I}[\boldsymbol{X}'] + + \tau_i \Delta t \mathcal{L}[\boldsymbol{X}'] = \boldsymbol{R}, + +where :math:`\mathcal{I}` is an implicit operator (corresponding to the +damping layer) and :math:`\mathcal{L}` is the linear operator corresponding +to the forcing and transport terms. The relaxation parameters +:math:`\sigma` and :math:`\tau_i` control the implicit weighting; the +:math:`\tau_i` may differ between the momentum, density and +potential-temperature variables :math:`i`. The implicit terms in the +continuity and thermodynamic equations correspond to linearisations of the +transport terms, :math:`\nabla\cdot(\rho^*\boldsymbol{u}')` and +:math:`\boldsymbol{u}'\cdot\nabla\theta^*` respectively. + +For the SIQN scheme, the relaxation parameters are typically chosen as: + +.. math:: + + \tau_u = \alpha, \qquad \tau_\rho=\tau_\theta=1, \qquad \sigma=1. + +Right-Hand Side and Predictors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As GungHo uses a finite element discretisation, the right-hand side of the +linear system :eq:`linear_solver_eqn` is actually calculated by assembling the +residual in weak form. When field values are needed, for instance for the +transport operator or physics parametrisations, it may be necessary to +solve a mass matrix system to obtain the field. This is known as calculating +the "predictors". + +Dynamical Core Algorithm +~~~~~~~~~~~~~~~~~~~~~~~~ + +We now bring together the outer loop (indexed by :math:`j=1,\dots,n_o`) and +inner loop (indexed by :math:`k=1,\dots,n^j_i`) to summarise the whole +Semi-Implicit Quasi-Newton timestep as a sequence of equations. The state +:math:`\boldsymbol{X}^{n+1}_{(j,k)}` denotes the :math:`k`-th inner-loop +estimate of the end-of-timestep state within the :math:`j`-th outer loop, with +:math:`\boldsymbol{X}^{n+1}_{(j,0)} = \boldsymbol{X}^{n+1}_{(j-1)}`. +The state :math:`\boldsymbol{X}^{n+1}_{(j)}` is the final inner-loop estimate of the +end-of-timestep state within the :math:`j`-th outer loop, and is used for +carrying the final state of the previous outer loop forward. +Similarly, :math:`\boldsymbol{X}^T_{(j)}` is the transported state formed +within outer loop :math:`j`. + +The first guess for the end-of-timestep state is simply the start-of-timestep +state, + +.. math:: :label: dyn_core_first_guess + + \boldsymbol{X}^{n+1}_{(0)} = \boldsymbol{X}^n. + +The explicit forcing contribution only depends on the start-of-timestep state, +so it is evaluated once (in weak form), before the outer loop begins, + +.. math:: :label: dyn_core_explicit_forcing + + \boldsymbol{X}^n_{FE} = \boldsymbol{X}^n - (1-\alpha)\Delta t\,\mathcal{F}(\boldsymbol{X}^n). + +As :math:`\boldsymbol{X}^n_{FE}` is generally calculated in weak form, a +mass matrix system is solved to obtain the "predictor" values that are +subsequently transported. + +Each outer loop :math:`j` begins by updating the transporting velocity using +the latest outer-loop estimate of the end-of-timestep wind, +:math:`\boldsymbol{u}^{n+1}_{(j-1)}`, + +.. math:: :label: dyn_core_transport_velocity + + \overline{\boldsymbol{u}}_n^{n+1,(j)} = \tfrac{1}{2}\left(\boldsymbol{u}^n + \boldsymbol{u}^{n+1}_{(j-1)}\right). + +The transport step is then performed using this updated velocity, + +.. math:: :label: dyn_core_transport + + \boldsymbol{X}^T_{(j)} = \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1,(j)}} + \left[\boldsymbol{X}^n_{FE}\right]. + +Note that :math:`\boldsymbol{X}^T_{(j)}` is also generally calculated in weak +form. + +Within outer loop :math:`j`, each inner iteration :math:`k` first calculates +the implicit forcing contribution in weak form, + +.. math:: :label: dyn_core_implicit_forcing + + \boldsymbol{X}^{n+1}_{(j,k-1),FI} = \boldsymbol{X}^{n+1}_{(j,k-1)} + + \alpha\Delta t\,\mathcal{F}\!\left(\boldsymbol{X}^{n+1}_{(j,k-1)}\right). + +The residual of the current iterate against this fixed transported state is then + +.. math:: :label: dyn_core_residual + + \boldsymbol{R}_{(j,k)} = -\left(\boldsymbol{X}^{n+1}_{(j,k-1),FI} + - \boldsymbol{X}^T_{(j)}\right), + +solves the linearised system for the increment :math:`\boldsymbol{X}'`, + +.. math:: :label: dyn_core_linear_solve + + \mathcal{S}\left[\boldsymbol{X}'\right] = \boldsymbol{R}_{(j,k)}, + +and updates the state accordingly, + +.. math:: :label: dyn_core_increment + + \boldsymbol{X}^{n+1}_{(j,k)} = \boldsymbol{X}^{n+1}_{(j,k-1)} + \boldsymbol{X}'. + +Once all :math:`n_o` outer loops have completed, the timestep is advanced by +setting + +.. math:: :label: dyn_core_advance + + \boldsymbol{X}^n = \boldsymbol{X}^{n+1}_{(n_o)}. + +This process is summarised by the pseudo-code below: + +.. code-block:: text + + Set the first guess: + X^{n+1}_(0) = X^n + Explicit forcing: + X_FE = X^n - (1 - alpha) * dt * F(X^n) + Calculate transport predictor from X_FE + + # Outer Loop ---------------------------------------------------------------- + for j = 1 to n_o: + Update transporting velocity: + u_bar^(j) = 0.5 * (u_n + u_{n+1}^(j-1)) + Transport: + X^T_(j) = T_{u_bar^(j)}(X_FE) + + X^{n+1}_(j,0) = X^{n+1}_(j-1) + + # Inner Loop ------------------------------------------------------------ + for k = 1 to n_i^j: + Implicit forcing: + X_FI^(j,k-1) = X^{n+1}_(j,k-1) + alpha * dt * F(X^{n+1}_(j,k-1)) + Form the residual: + R_(j,k) = -( X_FI^(j,k-1) - X^T_(j) ) + Solve the linear system for the increment: + S[X'] = R_(j,k) + Increment the state: + X^{n+1}_(j,k) = X^{n+1}_(j,k-1) + X' + + Set final estimate: + X^{n+1}_(j) = X^{n+1}_(j,n_i^j) + + Advance the timestep: + X^n = X^{n+1}_(n_o) + + +Inclusion of Physics Parametrisations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +So far the description of the timestep has been limited to the dynamical core. +We now describe how physics parametrisation schemes are included. +Physics parametrisations can be divided into three categories: + +1. **Slow Physics**: denoted :math:`\mathcal{P}_S`. This is evaluated on the + start-of-timestep state :math:`\boldsymbol{X}^n`. It represents explicit + physics processes which are not strongly coupled to the dynamics. Note that + explicit forcing terms are not evaluated on the slow physics increments. +2. **Fast Physics**: denoted :math:`\mathcal{P}_F`. This is evaluated on the + "physics predictor", which is the latest estimate of the end-of-timestep + state following the evaluation of transport terms. It describes implicit + physics processes that are strongly coupled to the dynamics, and is called + within the outer loop of the Quasi-Newton iteration. +3. **End-of-step Physics**: denoted :math:`\mathcal{P}_E`. Evaluated after the + Quasi-Newton iteration has completed, it also represents explicit physics + processes. + +The whole system of equations then becomes: + +.. math:: :label: siqn_with_physics_eqn + + \begin{aligned} + \boldsymbol{X}^\dagger &= \boldsymbol{X}^n - \Delta t\,\mathcal{P}_S(\boldsymbol{X}^n), \\ + \boldsymbol{X}^{n+1} + \alpha\Delta t \mathcal{F}(\boldsymbol{X}^{n+1}) + + \mathcal{P}_F(\boldsymbol{X}^{n+1}) + &= \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1}} + \left[\boldsymbol{X}^\dagger - (1-\alpha)\Delta t \mathcal{F}(\boldsymbol{X}^n) + \right], \\ + \boldsymbol{X}^{n+1} &= \boldsymbol{X}^{n+1} - \Delta t\,\mathcal{P}_E(\boldsymbol{X}^{n+1}). + \end{aligned} + +With the inclusion of these physics parametrisation schemes, the full timestep +can be summarised by the following pseudocode. + +.. code-block:: text + + Set the first guess: + X^{n+1}_(0) = X^n + Slow physics: + X^dag = X^n + dt * P_S(X^n) + Explicit forcing: + X_FE = X^dag - (1 - alpha) * dt * F(X^n) + Calculate transport predictor (X_FE) + + # Outer Loop ---------------------------------------------------------------- + for j = 1 to n_o: + Update transporting velocity: + u_bar^(j) = 0.5 * (u_n + u_{n+1}^(j-1)) + Transport: + X^T_(j) = T_{u_bar^(j)}(X_FE) + Implicit forcing: + X_FI^(j,1) = X^{n+1}_(j-1) + alpha * dt * F(X^{n+1}_(j-1)) + Fast physics predictor: + X_star^(j) = X^T_(j) + (X_FI^(j,0) - X^{n+1}_(j-1)) + Fast physics increment: + dX_F^(j) = dt * P_F(X_star^(j)) + + X^{n+1}_(j,0) = X^{n+1}_(j-1) + + # Inner Loop ------------------------------------------------------------ + for k = 1 to n_i^j: + if k > 1: + Implicit forcing: + X_FI^(j,k) = X^{n+1}_(j,k) + alpha * dt * F(X^{n+1}_(j,k-1)) + Form the residual: + R_(j,k) = -( X_FI^(j,k) - X^T_(j) - dX_F^(j) ) + Solve the linear system for the increment: + S[X'] = R_(j,k) + Increment the state: + X^{n+1}_(j,k) = X^{n+1}_(j,k-1) + X' + + Set final estimate: + X^{n+1}_(j) = X^{n+1}_(j,n_i^j) + + End-of-step physics: + X^{n+1} = X^{n+1}_(n_o) + dt * P_E(X^{n+1}_(n_o)) + Advance the timestep: + X^n = X^{n+1} + +Tracers +~~~~~~~ + +Some tracers (for instance chemical or aerosol species) do not feed back directly +onto the dynamical core and therefore do not need including in the Quasi-Newton +iteration. These tracers are transported in only the final outer iteration of +the timestep. + +These tracers may also be updated by physics parametrisations (or for example a +chemical or aerosol scheme, which for now can be considered as a physics +parametrisation). Let tracers be represented by the state vector +:math:`\boldsymbol{Y}`. The evolution of tracers through the timestep is given by: + +.. math:: :label: tracer_eqn + + \begin{aligned} + \boldsymbol{Y}^\dagger &= \boldsymbol{Y}^n + - \Delta t\,\mathcal{P}_S(\boldsymbol{X}^n; \boldsymbol{Y}^n), \\ + \boldsymbol{Y}^T &= \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1}} + \left[\boldsymbol{Y}^\dagger \right] + \mathcal{P}_F(\boldsymbol{X}^{n+1}; \boldsymbol{Y}^\dagger), \\ + \boldsymbol{Y}^{n+1} &= \boldsymbol{Y}^T - \Delta t\,\mathcal{P}_E(\boldsymbol{X}^{n+1};\boldsymbol{Y}^T). + \end{aligned} + +References +---------- + +.. [Wood2014] Wood, N., Staniforth, A., White, A., Allen, T., Diamantakis, M., + Gross, M., Melvin, T., Smith, C., Vosper, S., Zerroukat, M., and Thuburn, J. + (2014). An inherently mass-conserving semi-implicit semi-Lagrangian + discretization of the deep-atmosphere global non-hydrostatic equations. + *Quarterly Journal of the Royal Meteorological Society*, 140(682), 1505-1520. + https://doi.org/10.1002/qj.2235 + +.. [Melvin2019] Melvin, T., Benacchio, T., Shipway, B., Wood, N., Thuburn, J., + and Cotter, C. (2019). A mixed finite-element, finite-volume, semi-implicit + discretization for atmospheric dynamics: Cartesian geometry. + *Quarterly Journal of the Royal Meteorological Society*, 145(724), 2835-2853. + https://doi.org/10.1002/qj.3501 + +.. [Melvin2024] Melvin, T., Shipway, B., Wood, N., Benacchio, T., Bendall, T., + Boutle, I., Brown, A., Johnson, C., Kent, J., Pring, S., et al. (2024). A + mixed finite-element, finite-volume, semi-implicit discretisation for + atmospheric dynamics: spherical geometry. + *Quarterly Journal of the Royal Meteorological Society*, 150(764), 4252-4269. + https://doi.org/10.1002/qj.4887 \ No newline at end of file diff --git a/documentation/source/science_guide/timestepping/tr_bdf2.rst b/documentation/source/science_guide/timestepping/tr_bdf2.rst new file mode 100644 index 0000000000..c1c5b8db3c --- /dev/null +++ b/documentation/source/science_guide/timestepping/tr_bdf2.rst @@ -0,0 +1,430 @@ +.. ----------------------------------------------------------------------------- + (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. + Some of the content of this file has been produced with the assistance of + Met Office GitHub Copilot Enterprise. + ----------------------------------------------------------------------------- + +.. _science_guide_timestepping_tr_bdf2: + +TR-BDF2 +======= + +Overview +-------- + +The Trapezoidal Backwards-Difference-2 (TR-BDF2) timestepper +is a two-stage semi-implicit method, using a +Quasi-Newton iterative structure like the :ref:`Semi-Implicit +` scheme. The Trapezoidal (TR) and +Backwards Difference (BDF2) stages each take the form of a Semi-Implicit +step. Unlike the Semi-Implicit Quasi-Newton (SIQN) scheme, TR-BDF2 has no +off-centering parameter. + +A TR-BDF2 timestepper may have several advantages over the SIQN scheme: + +* **Numerical stability and accuracy**: the SIQN scheme does not damp wave modes + unless it uses an implicit off-centering. The solution can then become + polluted by high-frequency waves (typically acoustic modes) triggered by + small-scale features such as those from physics parametrizations or orography. + The growth of these waves can cause numerical instabilities. In contrast, the + TR-BDF2 scheme is inherently damping of high-frequency waves, and in fact + is more damping of the highest frequencies than an off-centred SIQN scheme. + However, the TR-BDF2 scheme maintains second-order accuracy in time, which is + lost when off-centering is used in the SIQN scheme. +* **Computational efficiency**: the TR-BDF2 scheme consists of two stages, and + involves calculating a "midpoint" value. A single timestep with the TR-BDF2 + scheme involves approximately twice as much computational work as a SIQN + timestep, so it is natural to take twice the timestep length with TR-BDF2. + The TR-BDF2 formulation also provides the mathematical basis for calling some + schemes (physics parametrizations, or the transport of some variables) less + frequently, reducing the computational cost. Further, the improved stability + of the scheme may allow it to run stably with fewer Quasi-Newton iterations, + again improving the computational efficiency. + +The inspiration for much of this formulation comes from [Tumolo2015]_, +who presented a semi-Lagrangian formulation of the compressible Euler +equations using a TR-BDF2 timestepper with Discontinuous Galerkin spatial +discretisations. + +Details +------- + +Basic formulation +~~~~~~~~~~~~~~~~~~ + +The TR-BDF2 scheme is a two-stage scheme with a "midpoint" level denoted by +:math:`m`. Using the off-centering-free implicit weight :math:`\gamma`, it +follows: + +.. math:: :label: trbdf2_tr_stage + + \boldsymbol{X}^{m} + \gamma\Delta t \mathcal{F}(\boldsymbol{X}^m) + = \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m} + \left[\boldsymbol{X}^n - \gamma\Delta t \mathcal{F}(\boldsymbol{X}^n)\right], + +.. math:: :label: trbdf2_bdf2_stage + + \boldsymbol{X}^{n+1} + \gamma_2\Delta t \mathcal{F}(\boldsymbol{X}^{n+1}) + = (1-\gamma_3)\mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1}} + \left[\boldsymbol{X}^n\right] + + \gamma_3\mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}} + \left[\boldsymbol{X}^m\right], + +with transporting velocities: + +.. math:: + + \overline{\boldsymbol{u}}_n^{m} = \tfrac{1}{2}\left(\boldsymbol{u}^n + \boldsymbol{u}^{m}\right), \qquad + \overline{\boldsymbol{u}}_n^{n+1} = \boldsymbol{u}^{n+1}, \qquad + \overline{\boldsymbol{u}}_m^{n+1} = \boldsymbol{u}^{n+1}. + +The parameters :math:`\gamma_2` and :math:`\gamma_3` are given by + +.. math:: + + \gamma_2 = \frac{1-2\gamma}{2(1-\gamma)}, \qquad + \gamma_3 = \frac{1-\gamma_2}{2\gamma}. + +GungHo takes :math:`\gamma=1-\sqrt{2}/2\approx 0.293`, which gives +:math:`\gamma_2=1-\sqrt{2}/2\approx 0.293` and +:math:`\gamma_3=(1+\sqrt{2})/2\approx 1.207`. The TR stage has an effective +timestep length of :math:`2\gamma\Delta t\approx 0.586\Delta t`, while the +BDF2 stage has an effective timestep length of +:math:`(1-2\gamma)\Delta t \approx 0.414\Delta t`. +Both stages take the same basic form as the Semi-Implicit scheme. + + +Combining BDF2 Transport Steps +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The BDF2 stage appears to require two separate transport calls. However, +these can be combined to develop a more efficient scheme. + +Introduce the intermediate variables: +.. math:: + + \boldsymbol{X}^\ast=\boldsymbol{X}^n - \gamma\Delta t \mathcal{F}(\boldsymbol{X}^n), \qquad + \boldsymbol{X}^p = \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m}\left[\boldsymbol{X}^\ast\right], \qquad + \boldsymbol{X}^q = \boldsymbol{X}^n + \boldsymbol{X}^p - \boldsymbol{X}^\ast. + +The TR step gives an approximation to the transport of :math:`\boldsymbol{X}^n` +over :math:`2\gamma\Delta t`: + +.. math:: + + \boldsymbol{X}^q + = \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m}\left[\boldsymbol{X}^n - \gamma\Delta t \mathcal{F}(\boldsymbol{X}^n)\right] + \gamma\Delta t \mathcal{F}(\boldsymbol{X}^n) + \approx \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m}\left[\boldsymbol{X}^n\right]. + +In the BDF2 stage, rather than transporting :math:`\boldsymbol{X}^n` over +:math:`\Delta t` from time level :math:`n` to :math:`n+1`, the approximation +from the TR stage can be used and transported over the remaining +:math:`(1-2\gamma)\Delta t`. Since the transporting velocity and length of +timestep is then the same as that used for :math:`\boldsymbol{X}^m`, these +fields can be added together and transported once: + +.. math:: + + \mathcal{T}^{\Delta t}_{\overline{\boldsymbol{u}}_n^{n+1}}\left[\boldsymbol{X}^n\right] + \approx \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}} + \left[\mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^{m}}\left[\boldsymbol{X}^n \right]\right], + +and + +.. math:: + + (1-\gamma_3)\mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}}\left[\boldsymbol{X}^q\right] + + \gamma_3 \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}}\left[\boldsymbol{X}^m\right] + \approx + \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}}\left[(1-\gamma_3)\boldsymbol{X}^q+ \gamma_3 \boldsymbol{X}^m\right]. + +The whole scheme is then written as: + +.. math:: :label: cheaper_trbdf2 + + \boldsymbol{X}^{m} + \gamma\Delta t \mathcal{F}(\boldsymbol{X}^m) = \boldsymbol{X}^p, \qquad + \boldsymbol{X}^{n+1} + \gamma_2\Delta t \mathcal{F}(\boldsymbol{X}^{n+1}) + = \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}}\left[(1-\gamma_3)\boldsymbol{X}^q+ \gamma_3 \boldsymbol{X}^m\right]. + +This is the form of the TR-BDF2 scheme implemented in GungHo. Pseudo-code for +this "cheaper" version of the whole scheme is given in the +:ref:`Algorithm ` section +below. + +Transport +~~~~~~~~~ + +* The transport operator for dynamical prognostics in the TR stage is + :math:`\mathcal{T}_{\overline{u}_{n}^{m}}^{2\gamma\Delta t}`, where + :math:`\overline{u}_{n}^{m}=\tfrac{1}{2}(u^n+u^m)`; +* The transport operator for dynamical prognostics in the BDF2 stage is + :math:`\mathcal{T}_{\overline{u}_{m}^{n+1}}^{(1-2\gamma)\Delta t}`, where + :math:`\overline{u}_m^{n+1}=u^{n+1}`; +* The transport operator for tracers in the BDF2 stage is + :math:`\mathcal{T}_{\overline{u}_{n}^{n+1}}^{\Delta t}`, where + :math:`\overline{u}_{n}^{n+1}=\tfrac{1}{2}(u^n+u^{n+1})`. + +Linear solver +~~~~~~~~~~~~~ + +As for the Semi-Implicit scheme, each stage's implicit problem is solved +using the linear problem of the form + +.. math:: + + \boldsymbol{X}' + \sigma \mathcal{I}[\boldsymbol{X}'] + \tau_i \Delta t \mathcal{L}[\boldsymbol{X}'] = \boldsymbol{R}, + +with relaxation parameters :math:`\sigma` and :math:`\tau_i`. For the TR +stage, these are + +.. math:: + + \tau_u = \gamma, \qquad \tau_\rho=\tau_\theta=2\gamma, \qquad \sigma=2\gamma, + +while for the BDF2 stage they are + +.. math:: + + \tau_u = \gamma_2, \qquad \tau_\rho=\tau_\theta=1, \qquad \sigma=1. + +Physics coupling +~~~~~~~~~~~~~~~~~ + +Physics parametrisation schemes are included using the same slow physics +:math:`\mathcal{P}_S`, fast physics :math:`\mathcal{P}_F`, and end-of-step +physics :math:`\mathcal{P}_E` operators defined for the +:ref:`Semi-Implicit ` scheme. + +1. **Slow Physics**: This is evaluated on the + start-of-timestep state :math:`\boldsymbol{X}^n` before the TR step. +2. **Fast Physics**: This is evaluated within the outer loop of the BDF2 step. +3. **End-of-step Physics**: denoted :math:`\mathcal{P}_E`. Evaluated after the + Quasi-Newton iteration has completed for the BDF2 step. + +All three physics operators can be included simultaneously, giving intermediate +states :math:`\boldsymbol{X}^\dagger`, :math:`\boldsymbol{X}^{q+\dagger}` and +:math:`\boldsymbol{X}^{n+\dagger}` in addition to the +:math:`\boldsymbol{X}^\ast`, :math:`\boldsymbol{X}^p` and +:math:`\boldsymbol{X}^q` defined above, + +.. math:: :label: trbdf2_physics_coupling + + \begin{aligned} + \boldsymbol{X}^\dagger &= \boldsymbol{X}^n - \Delta t\,\mathcal{P}_S(\boldsymbol{X}^n), \\ + \boldsymbol{X}^\ast &= \boldsymbol{X}^\dagger - \gamma\Delta t\,\mathcal{F}(\boldsymbol{X}^n), \\ + \boldsymbol{X}^p &= \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m}\left[\boldsymbol{X}^\ast\right], \\ + \boldsymbol{X}^{m} + \gamma\Delta t\,\mathcal{F}(\boldsymbol{X}^m) &= \boldsymbol{X}^p, \\ + \boldsymbol{X}^q &= \boldsymbol{X}^\dagger + \boldsymbol{X}^p-\boldsymbol{X}^\ast, \\ + \boldsymbol{X}^{q+\dagger} &= \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}} + \left[(1-\gamma_3)\boldsymbol{X}^q+ \gamma_3 \boldsymbol{X}^m\right], \\ + \boldsymbol{X}^{n+\dagger} + \gamma_2\Delta t\,\mathcal{F}(\boldsymbol{X}^{n+\dagger}) + + \Delta t\,\mathcal{P}_F(\boldsymbol{X}^{n+\dagger}) + &= \boldsymbol{X}^{q+\dagger}, \\ + \boldsymbol{X}^{n+1} &= \boldsymbol{X}^{n+\dagger} - \Delta t\,\mathcal{P}_E(\boldsymbol{X}^{n+\dagger}). + \end{aligned} + +Moisture +~~~~~~~~~ + +To ensure correlation between water vapour and potential temperature, +moisture needs careful handling through the TR-BDF2 timestep. Post-solver +conservation corrections to moisture are included, which can be re-used to +update the moisture to be transported in the BDF2 stage. + +Moist receives a conservative correction at the beginning of the BDF step, using +the dry flux used to update the dry density from the linear solver. Since + +.. math:: + + \rho^{BDF}=(1-\gamma_3)\rho^p + \gamma_3\rho^m \equiv \rho^p -\gamma_3\boldsymbol{\nabla\cdot}\boldsymbol{F}^d_{TR}, + +where :math:`\boldsymbol{F}^d_{TR}` is the dry density flux from the TR solver, +the moisture mixing ratio is updated to be consistent with the dry density: + +.. math:: + + m^{BDF} = \dfrac{1}{\rho^{BDF}}\left[\rho^p m^p - \gamma_3\boldsymbol{\nabla\cdot}\boldsymbol{F}^m_{TR} \right]. + +where :math:`\boldsymbol{F}^m_{TR}` is the moisture flux calculated from +:math:`\boldsymbol{F}^d_{TR}` and the upwind values of :math:`m^p`. + +.. _science_guide_timestepping_tr_bdf2_algorithm: + +Algorithm +--------- + +Equation :eq:`cheaper_trbdf2` above summarises the whole TR-BDF2 +scheme, as implemented in GungHo. We now describe this in more detail as a +sequence of equations, using the same intermediate states +:math:`\boldsymbol{X}^\ast`, :math:`\boldsymbol{X}^p` and +:math:`\boldsymbol{X}^q` introduced above. + +Both of the TR and BDF2 stages are solved using the outer/inner Quasi-Newton +structure described in the :ref:`Semi-Implicit ` section. +The outer loop includes transport and fast physics terms, while the inner loop +calls the implicit forcing terms and the linear solver. + +The explicit forcing contribution is evaluated once, using forces at time +level :math:`n`, before the TR stage begins, + +.. math:: :label: trbdf2_alg_explicit_forcing + + \boldsymbol{X}^\ast = \boldsymbol{X}^n - \gamma\Delta t\,\mathcal{F}(\boldsymbol{X}^n). + +This is transported over :math:`2\gamma\Delta t`, using the velocity +:math:`\overline{\boldsymbol{u}}_n^m`, to give the TR-stage transported +state, + +.. math:: :label: trbdf2_alg_tr_transport + + \boldsymbol{X}^p = \mathcal{T}^{2\gamma\Delta t}_{\overline{\boldsymbol{u}}_n^m}\left[\boldsymbol{X}^\ast\right]. + +The TR-stage implicit problem is then solved for :math:`\boldsymbol{X}^m`, +using the outer/inner Quasi-Newton iteration with relaxation parameters +:math:`\tau_u=\gamma`, :math:`\tau_\rho=\tau_\theta=2\gamma`, +:math:`\sigma=2\gamma`, + +.. math:: :label: trbdf2_alg_tr_solve + + \boldsymbol{X}^{m} + \gamma\Delta t\,\mathcal{F}(\boldsymbol{X}^m) = \boldsymbol{X}^p. + +An approximation to the transport of :math:`\boldsymbol{X}^n` over +:math:`2\gamma\Delta t` is then formed, + +.. math:: :label: trbdf2_alg_q + + \boldsymbol{X}^q = \boldsymbol{X}^n + \boldsymbol{X}^p-\boldsymbol{X}^\ast. + +Convergence of the BDF2 stage can be accelerated by extrapolating from the +TR solution and the previous timestep, to give the first guess for the BDF2 +stage, via + +.. math:: :label: trbdf2_alg_bdf_first_guess + + \boldsymbol{X}^{n+1}_{(0)} = (1-1/(2\gamma))\boldsymbol{X}^n + 1/(2\gamma)\boldsymbol{X}^m. + +Finally, the combination :math:`(1-\gamma_3)\boldsymbol{X}^q+ \gamma_3 +\boldsymbol{X}^m` is transported over the remaining +:math:`(1-2\gamma)\Delta t`, using the velocity +:math:`\overline{\boldsymbol{u}}_m^{n+1}`, and the BDF2-stage implicit +problem is solved for :math:`\boldsymbol{X}^{n+1}`, using the outer/inner +Quasi-Newton iteration with relaxation parameters :math:`\tau_u=\gamma_2`, +:math:`\tau_\rho=\tau_\theta=1`, :math:`\sigma=1`, + +.. math:: :label: trbdf2_alg_bdf_solve + + \boldsymbol{X}^{n+1} + \gamma_2\Delta t\,\mathcal{F}(\boldsymbol{X}^{n+1}) + = \mathcal{T}^{(1-2\gamma)\Delta t}_{\overline{\boldsymbol{u}}_m^{n+1}} + \left[(1-\gamma_3)\boldsymbol{X}^q+ \gamma_3 \boldsymbol{X}^m\right]. + +This process is summarised by the pseudo-code below: + +.. code-block:: text + + Slow physics: + X^dag = X^n - dt * P_S(X^n) + + # TR Stage ------------------------------------------------------------------ + Explicit forcing: + X_FE = X^dag - gamma * dt * F(X^n) + Calculate transport predictor (X_FE) + + Set the first guess: + X^m_(0) = X^dag + + # Outer Loop ---------------------------------------------------------------- + for j = 1 to n_o_TR: + Update transporting velocity: + u_bar_n_m^(j) = 0.5 * (u_n + u_m^(j-1)) + Transport: + X^p_(j) = T_{u_bar_n_m^(j)}(X_FE) + Implicit forcing: + X_FI^(j,1) = X^{m}_(j-1) + gamma * dt * F(X^{m}_(j-1)) + + X^m_(j,0) = X^m_(j-1) + + # Inner Loop ------------------------------------------------------------ + for k = 1 to n_i_TR^j: + if k > 1: + Implicit forcing: + X^m_FI^(j,k) = X^m_(j,k-1) + gamma * dt * F(X^m_(j,k-1)) + Form the residual: + R_(j,k) = -( X^m_FI^(j,k) - X^p_(j) ) + Solve the linear system for the increment: + S_TR[X'] = R_(j,k) + Increment the state: + X^m_(j,k) = X^m_(j,k-1) + X' + + Set final estimate: + X^m_(j) = X^m_(j,n_i_TR^j) + + Advance the TR stage: + X^m = X^m_(n_o_TR) + X^p = X^p_(n_o_TR) + + # BDF2 Stage ---------------------------------------------------------------- + Form the approximate transport of X^n: + X^q = X^dag + X^p - X_FE + Set BDF2 pre-transport state: + X_BDF = (1 - gamma3) * X^q + gamma3 * X^m + + Set the first guess: + X^{n+1}_(0) = (1-1/(2*gamma)) * X^n + 1/(2*gamma) * X^m + + # Outer Loop ---------------------------------------------------------------- + for j = 1 to n_o_BDF: + Update transporting velocity: + u_bar_m_np1^(j) = u_{n+1}^(j-1) + Transport: + X^q_dag_(j) = T_{u_bar_m_np1^(j)}(X_BDF) + Implicit forcing: + X^{n+1}_FI^(j,1) = X^{n+1}_(j-1) + gamma2 * dt * F(X^{n+1}_(j-1)) + Fast physics predictor: + X^star_(j) = X^q_dag_(j) + (X^{n+1}_FI^(j,1) - X^{n+1}_(j-1)) + Fast physics increment: + dX_F^(j) = dt * P_F(X^star_(j)) + + X^{n+1}_(j,0) = X^{n+1}_(j-1) + + # Inner Loop ------------------------------------------------------------ + for k = 1 to n_i_BDF^j: + if k > 1: + Implicit forcing: + X^{n+1}_FI^(j,k) = \ + X^{n+1}_(j,k-1) + gamma2 * dt * F(X^{n+1}_(j,k-1)) + Form the residual: + R_(j,k) = -( X^{n+1}_FI^(j,k) - X^q_dag_(j) - dX_F^(j) ) + Solve the linear system for the increment: + S_BDF[X'] = R_(j,k) + Increment the state: + X^{n+1}_(j,k) = X^{n+1}_(j,k-1) + X' + + Set final estimate: + X^{n+1}_(j) = X^{n+1}_(j,n_i_BDF^j) + + End-of-step physics: + X^{n+1} = X^{n+1}_(n_o_BDF) - dt * P_E(X^{n+1}_(n_o_BDF)) + Advance the timestep: + X^n = X^{n+1} + +Tracer Transport +----------------- + +Tracers that do not feed back onto the dynamical core can be transported in +just the final outer iteration of the BDF2 stage. If following the advective +form of the transport equation, tracers can be transported using the +time-centered wind +:math:`\overline{\boldsymbol{u}}_n^{n+1} = \tfrac{1}{2}(\boldsymbol{u}^n + \boldsymbol{u}^{n+1})`. +Tracers that are transported conservatively can use the mass flux used to +transport the dry density over the combination of the TR and BDF2 steps. + +References +---------- + +.. [Tumolo2015] Tumolo, G. and Bonaventura, L. (2015). A semi-implicit, + semi-Lagrangian discontinuous Galerkin framework for adaptive numerical + weather prediction. + *Quarterly Journal of the Royal Meteorological Society*, 141(692), 2582-2601. + https://doi.org/10.1002/qj.2544 diff --git a/documentation/source/user_guide/index.rst b/documentation/source/user_guide/index.rst index 91834ca41e..cdbba8fc78 100644 --- a/documentation/source/user_guide/index.rst +++ b/documentation/source/user_guide/index.rst @@ -13,3 +13,4 @@ User Guide applications/index checkpointing/index + timestepping/index diff --git a/documentation/source/user_guide/timestepping/index.rst b/documentation/source/user_guide/timestepping/index.rst new file mode 100644 index 0000000000..26384207ba --- /dev/null +++ b/documentation/source/user_guide/timestepping/index.rst @@ -0,0 +1,105 @@ +.. ------------------------------------------------------------------------------ + (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. + Some of the content of this file has been produced with the assistance of + Met Office GitHub Copilot Enterprise. + ------------------------------------------------------------------------------ + +.. _user_guide_timestepping: + +Timestepping +============ + +This page describes the namelist options in the ``timestepping`` namelist, +found in the ``lfric-gungho`` rose-meta metadata +(``science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf``), which control +how the GungHo dynamical core (and its coupling to physics schemes) is advanced +in time. A description of the underlying numerical schemes can be found in the +:ref:`Science Guide `. + +Choosing a timestepping method +------------------------------- + +The ``method`` option selects the overall timestepping algorithm. The +available values are: + +* ``semi_implicit``: the Semi-Implicit Quasi-Newton (SIQN) scheme. This is + GungHo's default timestepping scheme, evolved from the ENDGame dynamical + core's timestepping scheme. It combines an off-centred Crank-Nicolson scheme + with a Semi-Lagrangian treatment of transport (although in GungHo transport + has an Eulerian formulation). The scheme consists of a nested outer loop + (which includes transport and fast physics), and an inner loop which calls + the linear solver. An off-centering parameter, ``alpha``, controls the + implicitness of the scheme. +* ``tr_bdf2``: a two-stage semi-implicit method (Trapezoidal, then Backwards + Difference), using a Quasi-Newton iterative structure like the + Semi-Implicit scheme. Each of the two stages takes the form of a + Semi-Implicit step. There is no off-centering parameter, which improves the + accuracy of the scheme relative to Semi-Implicit. +* ``rk``: an explicit multi-stage Runge-Kutta method. This has not been + implemented with physics schemes. +* ``jules``: a timestepping scheme which calls the standalone JULES surface + scheme without coupling to a dynamical core. +* ``no_timestepping``: a null timestepping scheme, which does not call the + dynamics or physics schemes. Time-varying fields such as ancillaries and + LBCs are still updated on each timestep, and diagnostics are output. + +Iteration counts +----------------- + +The Semi-Implicit and TR-BDF2 schemes both involve nested outer and inner +iterative loops. The outer loop includes transport and fast physics terms; the +inner loop calls the implicit forcing terms and the linear solver. + +* ``outer_iterations``: the number of outer iterations to perform. This + applies to both the Semi-Implicit and TR-BDF2 schemes (and to the ``jules`` + method). +* ``inner_iterations_si``: the number of inner Newton iterations to perform + within the Semi-Implicit scheme. +* ``inner_iterations_tr``: the number of inner Newton iterations to perform in + the Trapezoidal (TR) stage of the TR-BDF2 scheme. +* ``inner_iterations_bdf2``: the number of inner Newton iterations to perform + in the Backwards Difference (BDF2) stage of the TR-BDF2 scheme. + +Semi-Implicit off-centering and relaxation parameters +------------------------------------------------------- + +These options are only relevant when ``method='semi_implicit'``. + +* ``alpha``: the off-centering parameter for the Semi-Implicit scheme, in the + range ``0.0`` to ``1.0``. A value of ``0.5`` corresponds to a + Crank-Nicolson scheme, while a value of ``1.0`` corresponds to a fully + implicit scheme. A value of ``0.5`` can be appropriate for dynamics-only + runs, but can lead to noisy solutions when orography and physics are included. + For this reason, the model is typically run with a value slightly above + ``0.5``. +* ``spinup_alpha``: if ``.true.``, the off-centering parameter is set to + ``1`` (fully implicit) during the spin-up period, to improve stability. + +The relaxation parameters give the implicitness weighting of semi-implicit +terms (for example transport or forcing terms) on the left-hand side of the +linear solver. See the :ref:`Science Guide ` for +the role that these parameters play in the linear solver formulation. + +* ``tau_u``: relaxation parameter for the momentum equation. It is + recommended to set ``tau_u=alpha``. +* ``tau_r``: relaxation parameter for density. When using more than one + Quasi-Newton inner iteration, it is recommended to set ``tau_r=1``, as the + density transport term is not updated between inner iterations. +* ``tau_t``: relaxation parameter for potential temperature. When using more + than one Quasi-Newton inner iteration, it is recommended to set + ``tau_t=1``, as the potential temperature transport term is not updated + between inner iterations. + +Runge-Kutta options +-------------------- + +This option is only relevant when ``method='rk'``. + +* ``runge_kutta_method``: selects the choice of explicit Runge-Kutta scheme + used either to timestep the whole dynamical core, or for use with the + Method-of-Lines transport scheme. The Strong Stability Preserving (SSP) + methods are explicit multi-stage methods which combine the values over + multiple stages as a weighted linear sum to provide stability. Available + values are ``forward_euler``, ``ssp2``, ``ssp3``, ``ssp4`` and ``ssp5``. diff --git a/rose-stem/app/gungho_model/opt/rose-app-schar_cart.conf b/rose-stem/app/gungho_model/opt/rose-app-schar_cart.conf index c5f027b994..23ecc66546 100644 --- a/rose-stem/app/gungho_model/opt/rose-app-schar_cart.conf +++ b/rose-stem/app/gungho_model/opt/rose-app-schar_cart.conf @@ -27,7 +27,7 @@ smp_init_wind=.true. u0=10.0 [namelist:io] -diagnostic_frequency=900 +diagnostic_frequency=450 [namelist:orography] orog_init_option='analytic' diff --git a/rose-stem/app/gungho_model/opt/rose-app-skamarock_klemp_gw_p0.conf b/rose-stem/app/gungho_model/opt/rose-app-skamarock_klemp_gw_p0.conf index f3b1c3d13d..9c14f09289 100644 --- a/rose-stem/app/gungho_model/opt/rose-app-skamarock_klemp_gw_p0.conf +++ b/rose-stem/app/gungho_model/opt/rose-app-skamarock_klemp_gw_p0.conf @@ -14,7 +14,7 @@ profile='constant_uv' u0=20.0 [namelist:io] -diagnostic_frequency=100 +diagnostic_frequency=50 [namelist:partitioning] partitioner='planar' diff --git a/rose-stem/app/gungho_model/opt/rose-app-tr_bdf2.conf b/rose-stem/app/gungho_model/opt/rose-app-tr_bdf2.conf new file mode 100644 index 0000000000..81751d204e --- /dev/null +++ b/rose-stem/app/gungho_model/opt/rose-app-tr_bdf2.conf @@ -0,0 +1,4 @@ +[namelist:timestepping] +inner_iterations_bdf2=1,1 +inner_iterations_tr=2,1 +method='tr_bdf2' diff --git a/rose-stem/app/lfric_atm/opt/README b/rose-stem/app/lfric_atm/opt/README index 30874e6ad7..4e8e6b37c5 100644 --- a/rose-stem/app/lfric_atm/opt/README +++ b/rose-stem/app/lfric_atm/opt/README @@ -58,6 +58,11 @@ Science settings - ral_mixmol_opts - extra options for regional models when using the MoL transport scheme and mixed solver configuration - ral_opts - extra options for regional models, including LBC blending weights +- tr_bdf2 - using the TR-BDF2 timestepper +- tr_bdf2_big - using the TR-BDF2 timestepper and a larger stencil extent +- tr_bdf2_big_ral - using the TR-BDF2 timestepper, a larger stencil extent and + an alternative radiation timestep, appropriate to a 2 min + overall timestep - ukca - UKCA Glomap aerosol scheme - urban2t - 2-tile urban scheme - dry_atm - a dry atmosphere diff --git a/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2.conf b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2.conf new file mode 100644 index 0000000000..848f702c65 --- /dev/null +++ b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2.conf @@ -0,0 +1,7 @@ +[namelist:formulation] +solver_moisture_conservation=.true. + +[namelist:timestepping] +inner_iterations_bdf2=1,1 +inner_iterations_tr=2,1 +method='tr_bdf2' diff --git a/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big.conf b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big.conf new file mode 100644 index 0000000000..4bb06ef223 --- /dev/null +++ b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big.conf @@ -0,0 +1,17 @@ +[namelist:formulation] +solver_moisture_conservation=.true. + +[namelist:timestepping] +inner_iterations_bdf2=1,1 +!!inner_iterations_si=2,2 +inner_iterations_tr=2,1 +method='tr_bdf2' +!!tau_r=1.0 +!!tau_t=1.0 +!!tau_u=0.55 + +[namelist:radiation] +n_radstep=3 + +[namelist:transport] +dep_pt_stencil_extent=10 diff --git a/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big_ral.conf b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big_ral.conf new file mode 100644 index 0000000000..447f966c76 --- /dev/null +++ b/rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big_ral.conf @@ -0,0 +1,18 @@ +[namelist:formulation] +solver_moisture_conservation=.true. + +[namelist:timestepping] +inner_iterations_bdf2=1,1 +!!inner_iterations_si=2,2 +inner_iterations_tr=2,1 +method='tr_bdf2' +!!tau_r=1.0 +!!tau_t=1.0 +!!tau_u=0.55 + +[namelist:radiation] +n_inc_radstep=2 +n_radstep=6 + +[namelist:transport] +dep_pt_stencil_extent=10 diff --git a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc index b446910a07..c2092cedd0 100644 --- a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc +++ b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc @@ -127,6 +127,18 @@ "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", }) %} +{% elif task_ns.conf_name == "baroclinic-tr_bdf2-C24_MG" %} + + {% do task_dict.update({ + "opt_confs": ["baroclinic", "tr_bdf2"], + "resolution": "C24_MG", + "DT": 3600, + "threads": 4, + "mpi_parts": 6, + "tsteps": 240, + "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", + }) %} + {% elif task_ns.conf_name == "baroclinic-no_io-C24_MG" %} {% do task_dict.update({ @@ -235,6 +247,17 @@ "plot_str": "plot_zonal.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR held-suarez earth dcmip 30 31" }) %} +{% elif task_ns.conf_name == "held-suarez-tr_bdf2-C24_MG" %} + + {% do task_dict.update({ + "opt_confs": ["held-suarez", "io_nwp", "tr_bdf2"], + "resolution": "C24_MG", + "DT": 3600, + "mpi_parts": 6, + "tsteps": 480, + "plot_str": "plot_zonal.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR held-suarez earth dcmip 30 31" + }) %} + {% elif task_ns.conf_name == "lfric-real-domain-C48_MG" %} {% do task_dict.update({ @@ -360,6 +383,18 @@ "plot_str": "sbr.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR um70 80 71 sbr", }) %} +{% elif task_ns.conf_name == "sbr-tr_bdf2-C24_MG" %} + + {% do task_dict.update({ + "opt_confs": ["sbr", "tr_bdf2"], + "resolution": "C24_MG", + "DT": 3600, + "mpi_parts": 6, + "tsteps": 240, + "threads": 4, + "plot_str": "sbr.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR um70 80 71 sbr", + }) %} + {% elif task_ns.conf_name == "sbr_lam-n96_MG_lam" %} {% do task_dict.update({ @@ -414,6 +449,21 @@ "plot_str": "cartesian_mountain_plot.py diagGungho $NODAL_DATA_DIR u 3 T000900 2 2 4 schar zoom_1 lines $PLOT_DIR", }) %} +{% elif task_ns.conf_name == "schar_cart-tr_bdf2-BiP200x8-500x500" %} + + {% do task_dict.update({ + "opt_confs": ["schar_cart", "tr_bdf2"], + "resolution": "BiP200x8-500x500", + "DT": 40, + "mpi_parts": 5, + "tsteps": 450, + "threads": 3, + "panel_decomp": "row", + "wallclock": 30, + "use_xios": false, + "plot_str": "cartesian_mountain_plot.py diagGungho $NODAL_DATA_DIR u 3 T000450 2 2 8 schar zoom_1 lines $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "semi-implicit-for-linear-C12" %} {% do task_dict.update({ @@ -449,6 +499,17 @@ "plot_str": "gw_cart_plot.py diagGungho $NODAL_DATA_DIR 300 8 theta T000000:T000100:T000200:T000300 $PLOT_DIR", }) %} +{% elif task_ns.conf_name == "skamarock_klemp_gw-tr_bdf2-BiP300x8-1000x2000" %} + + {% do task_dict.update({ + "opt_confs": ["skamarock_klemp_gw_p0", "tr_bdf2"], + "resolution": "BiP300x8-1000x2000", + "DT": 20, + "tsteps": 150, + "use_xios": false, + "plot_str": "gw_cart_plot.py diagGungho $NODAL_DATA_DIR 300 8 theta T000000:T000050:T000100:T000150 $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "skamarock_klemp_gw_p1-BiP75x4-4000x2000" %} {% do task_dict.update({ @@ -546,6 +607,19 @@ "plot_str": "straka_plot_x.py diagGungho $NODAL_DATA_DIR 256 8 theta T000180 $PLOT_DIR", }) %} +{% elif task_ns.conf_name == "straka_200m-tr_bdf2-BiP256x8-200x200" %} + + {% do task_dict.update({ + "opt_confs": ["straka_200m", "tr_bdf2"], + "resolution": "BiP256x8-200x200", + "DT": 10, + "mpi_parts": 8, + "tsteps": 90, + "panel_decomp": "row", + "use_xios": false, + "plot_str": "straka_plot_x.py diagGungho $NODAL_DATA_DIR 256 8 theta T000090 $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "tidally-locked-earth-C24s_rot_MG" %} {% do task_dict.update({ diff --git a/rose-stem/site/common/gungho_model/tasks_gungho_model_weekly.cylc b/rose-stem/site/common/gungho_model/tasks_gungho_model_weekly.cylc index 5f8ee5d23c..3768101007 100644 --- a/rose-stem/site/common/gungho_model/tasks_gungho_model_weekly.cylc +++ b/rose-stem/site/common/gungho_model/tasks_gungho_model_weekly.cylc @@ -63,6 +63,19 @@ "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", }) %} +{% elif task_ns.conf_name == "baroclinic-tr_bdf2-C192_MG" %} + + {% do task_dict.update({ + "opt_confs": ["baroclinic", "tr_bdf2"], + "resolution": "C192_MG", + "DT": 1800, + "mpi_parts": 384, + "tsteps": 480, + "wallclock": 30, + "kgo_checks": [], + "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", + }) %} + {% elif task_ns.conf_name == "baroclinic-no_io-C192_MG" %} {% do task_dict.update({ diff --git a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc index a37b78aceb..8f836a6931 100644 --- a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc +++ b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc @@ -91,6 +91,21 @@ theta", }) %} +{% elif task_ns.conf_name == "nwp_gal10-tr_bdf2-C12" %} + + {% do task_dict.update({ + "opt_confs": ["tr_bdf2", "um_dump"], + "resolution": "C12", + "DT": 1800, + "tsteps": 144, + "crun": 2, + "crun_compare": false, + "metadata_test": true, + "mpi_parts": 6, + "kgo_checks": ["checksum"], + "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "nwp_gal9_1T-C12" %} {% do task_dict.update({ "opt_confs": ["physics_segmentation","um_dump","no_diags"], @@ -237,6 +252,22 @@ "memory_plot_ex": true, }) %} +{% elif task_ns.conf_name == "nwp_gal10-tr_bdf2-C224_MG" %} + + {% do task_dict.update({ + "opt_confs": ["tr_bdf2_big", "um_dump","june_case"], + "resolution": "C224_MG", + "DT": 1200, + "tsteps": 72, + "mpi_parts": 588, + "xios_nodes": 1, + "mpi_parts_xios" : 64, + "log_level": "info", + "xios_info_level": 1, + "xios_print_file": ".true.", + "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "nwp_gal9_debug-C224_MG" %} {% do task_dict.update({ @@ -637,6 +668,20 @@ "plot_str": "plot_map.py -encorr $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", }) %} +{% elif task_ns.conf_name == "clim_gal10_chem-tr_bdf2-C12" %} + + {% do task_dict.update({ + "opt_confs": ["climate","chemistry","tr_bdf2","lowres_stp","um_dump"], + "resolution": "C12", + "DT": 1800, + "tsteps": 144, + "crun": 2, + "crun_compare": false, + "mpi_parts": 6, + "kgo_checks": ["checksum"], + "plot_str": "plot_map.py -encorr $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "clim_gal9_chem_1T-C12" %} {% do task_dict.update({ "opt_confs": ["climate","chemistry", "lowres_stp","physics_segmentation","um_dump","no_diags"], @@ -790,6 +835,18 @@ "plot_str": "plot_map.py -ral $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", }) %} +{% elif task_ns.conf_name == "ral3-tr_bdf2-seuk_MG" %} + + {% do task_dict.update({ + "opt_confs": ["l70_40km","ral3","ral_opts","hh_solve","tr_bdf2_big_ral"], + "resolution": "seuk_MG", + "DT": 150, + "tsteps": 48, + "mpi_parts": 16, + "kgo_checks": ["checksum"], + "plot_str": "plot_map.py -ral $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", + }) %} + {% elif task_ns.conf_name == "ral3_mixmol-uk_MG" %} {% do task_dict.update({ diff --git a/rose-stem/site/meto/groups/groups_gungho_model.cylc b/rose-stem/site/meto/groups/groups_gungho_model.cylc index 0704f11adc..8d4008b238 100644 --- a/rose-stem/site/meto/groups/groups_gungho_model.cylc +++ b/rose-stem/site/meto/groups/groups_gungho_model.cylc @@ -10,6 +10,7 @@ "gungho_model_azspice_developer": [ "gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit", + "gungho_model_baroclinic-tr_bdf2-C24_MG_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit", @@ -26,6 +27,7 @@ "gungho_model_force_profile-BiP4x4-600x400_azspice_gnu_fast-debug-64bit", "gungho_model_geostrophic-BiP4x4-600x400_azspice_gnu_fast-debug-64bit", "gungho_model_held-suarez-C24_MG_azspice_gnu_fast-debug-64bit", + "gungho_model_held-suarez-tr_bdf2-C24_MG_azspice_gnu_fast-debug-64bit", "gungho_model_lfric-real-domain-C48_MG_azspice_gnu_fast-debug-64bit", "gungho_model_no-timestep-method-C12_azspice_gnu_fast-debug-64bit", "gungho_model_relax_theta-BiP4x4-600x400_azspice_gnu_fast-debug-64bit", @@ -34,15 +36,18 @@ "gungho_model_robert-moist-smag-BiP100x8-10x10_azspice_gnu_fast-debug-64bit", "gungho_model_runge-kutta-for-linear-C12_azspice_gnu_fast-debug-64bit", "gungho_model_sbr-C24_MG_azspice_gnu_fast-debug-64bit", + "gungho_model_sbr-tr_bdf2-C24_MG_azspice_gnu_fast-debug-64bit", "gungho_model_sbr-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit", "gungho_model_sbr-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32", "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-tr_bdf2-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", "gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit", + "gungho_model_skamarock_klemp_gw-tr_bdf2-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit", @@ -50,6 +55,7 @@ "gungho_model_straka_200m-alt1-BiP256x4-200x200_azspice_gnu_fast-debug-64bit", "gungho_model_straka_200m-alt2-BiP256x16-200x50_op_azspice_gnu_fast-debug-64bit", "gungho_model_straka_200m-alt3-BiP256x8-200x200_azspice_gnu_fast-debug-64bit-rtran32", + "gungho_model_straka_200m-tr_bdf2-BiP256x8-200x200_azspice_gnu_fast-debug-64bit", "gungho_model_tidally-locked-earth-C24s_rot_MG_azspice_gnu_fast-debug-64bit", "gungho_model_tidally-locked-earth-C24_MG_azspice_gnu_fast-debug-64bit", "gungho_model_azspice_canned", @@ -77,6 +83,7 @@ "gungho_model_baroclinic-alt1-C24s_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_baroclinic-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit", "gungho_model_baroclinic-alt3-C24_MG_ex1a_gnu_fast-debug-64bit", + "gungho_model_baroclinic-tr_bdf2-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_baroclinic-profile_perf-C24_MG_ex1a_perftools-gnu_fast-debug-64bit", "gungho_model_bryan_fritsch-dry-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit", "gungho_model_dcmip200-C24_MG_ex1a_gnu_fast-debug-64bit", @@ -87,6 +94,7 @@ "gungho_model_force_profile-BiP4x4-600x400_ex1a_gnu_fast-debug-64bit", "gungho_model_geostrophic-BiP4x4-600x400_ex1a_gnu_fast-debug-64bit", "gungho_model_held-suarez-C24_MG_ex1a_gnu_fast-debug-64bit", + "gungho_model_held-suarez-tr_bdf2-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_lfric-real-domain-C48_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_no-timestep-method-C12_ex1a_gnu_fast-debug-64bit", "gungho_model_rk-dcmip301-C24_ex1a_gnu_fast-debug-64bit", @@ -96,13 +104,16 @@ "gungho_model_sbr-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_sbr-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit", "gungho_model_sbr-alt3-C24_MG_ex1a_gnu_fast-debug-64bit-rtran32", + "gungho_model_sbr-tr_bdf2-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_sbr_lam-n96_MG_lam_ex1a_gnu_fast-debug-64bit", "gungho_model_sbr_lam-n96_MG_lam_rotate_ex1a_gnu_fast-debug-64bit", "gungho_model_schar_cart-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit", "gungho_model_schar_cart-alt2-BiP100x4-1000x1000_ex1a_gnu_fast-debug-64bit", + "gungho_model_schar_cart-tr_bdf2-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit", "gungho_model_semi-implicit-for-linear-C12_ex1a_gnu_fast-debug-64bit", "gungho_model_shallow-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit", + "gungho_model_skamarock_klemp_gw-tr_bdf2-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit", "gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit", @@ -110,6 +121,7 @@ "gungho_model_straka_200m-alt1-BiP256x4-200x200_ex1a_gnu_fast-debug-64bit", "gungho_model_straka_200m-alt2-BiP256x16-200x50_op_ex1a_gnu_fast-debug-64bit", "gungho_model_straka_200m-alt3-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit", + "gungho_model_straka_200m-tr_bdf2-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit", "gungho_model_tidally-locked-earth-C24s_rot_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_tidally-locked-earth-C24_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_ex1a_canned", @@ -247,6 +259,7 @@ "gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_baroclinic-C96_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_baroclinic-C192_MG_ex1a_gnu_fast-debug-64bit", + "gungho_model_baroclinic-tr_bdf2-C192_MG_ex1a_gnu_fast-debug-64bit", "gungho_model_bell_3d_cart-BiP300x200-200x200_ex1a_gnu_fast-debug-64bit", "gungho_model_bryan_fritsch-moist-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit", "gungho_model_earth-like-C48_MG_ex1a_gnu_fast-debug-64bit", diff --git a/rose-stem/site/meto/groups/groups_lfric_atm.cylc b/rose-stem/site/meto/groups/groups_lfric_atm.cylc index 17717320f0..2da201d1f3 100644 --- a/rose-stem/site/meto/groups/groups_lfric_atm.cylc +++ b/rose-stem/site/meto/groups/groups_lfric_atm.cylc @@ -25,6 +25,7 @@ "lfric_atm_nwp_gal9_eda_jada-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_nwp_gal9_ls_and_jedi-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_nwp_gal9-pert-C12_azspice_gnu_fast-debug-32bit", + "lfric_atm_nwp_gal10-tr_bdf2-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_nwp_casim-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_nwp_coma9-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit", @@ -38,6 +39,7 @@ "lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit", "lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit", "lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit", + "lfric_atm_ral3-tr_bdf2-seuk_MG_azspice_gnu_fast-debug-32bit", ], "lfric_atm_scm_azspice_developer": [ "lfric_atm_scm_gal9_bomex-BiP2x2-50000x50000_azspice_gnu_fast-debug-32bit", @@ -78,6 +80,7 @@ "lfric_atm_azspice_extra": [ "lfric_atm_nwp_azspice_extra", "lfric_atm_clim_gal9_chem-C12_azspice_gnu_fast-debug-32bit", + "lfric_atm_clim_gal10_chem-tr_bdf2-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_ral3-seuk_ls_and_jedi_azspice_gnu_fast-debug-32bit", "lfric_atm_aquaplanet-C12_azspice_gnu_fast-debug-32bit", "lfric_atm_thai_ben1-C48_MG_azspice_gnu_fast-debug-32bit", @@ -127,6 +130,7 @@ "lfric_atm_nwp_gal9_eda_jada-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_nwp_gal9_ls_and_jedi-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_nwp_gal9-pert-C12_ex1a_cce_fast-debug-32bit", + "lfric_atm_nwp_gal10-tr_bdf2-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_nwp_casim-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_nwp_coma9-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_nwp_comorph_tb-C12_ex1a_cce_fast-debug-32bit", @@ -141,6 +145,7 @@ "lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit", "lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit", "lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit", + "lfric_atm_ral3-tr_bdf2-seuk_MG_ex1a_cce_fast-debug-32bit", ], "lfric_atm_ral_ex1a_weekly": [ "lfric_atm_ral3-uk_MG_ex1a_cce_production-32bit", @@ -189,6 +194,7 @@ "lfric_atm_ex1a_extra": [ "lfric_atm_nwp_ex1a_extra", "lfric_atm_clim_gal9_chem-C12_ex1a_cce_fast-debug-32bit", + "lfric_atm_clim_gal10_chem-tr_bdf2-C12_ex1a_cce_fast-debug-32bit", "lfric_atm_ral3-seuk_ls_and_jedi_ex1a_cce_fast-debug-32bit", "lfric_atm_comp_tran_ref_3d_l120-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit", "lfric_atm_aquaplanet-C12_ex1a_cce_fast-debug-32bit", @@ -199,6 +205,7 @@ ], "lfric_atm_ex1a_weekly": [ "lfric_atm_nwp_gal9-C224_MG_ex1a_cce_production-32bit", + "lfric_atm_nwp_gal10-tr_bdf2-C224_MG_ex1a_cce_production-32bit", "lfric_atm_nwp_gal9_oper-C224_MG_ex1a_cce_production-32bit", "lfric_atm_nwp_gal9_debug-C224_MG_ex1a_cce_full-debug-32bit", "lfric_atm_nwp_gal9_ls_and_jedi-C224_MG_ex1a_cce_production-32bit", diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit.txt index 0bf3da4267..701a3729de 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40DAA271B7D2549D -Inner product checksum theta = 42418E8247B61657 -Inner product checksum u = 43F0A73C1317F206 +Inner product checksum rho = 40DAA271B7D254AF +Inner product checksum theta = 42418E8247B61632 +Inner product checksum u = 43F0A73C1317F297 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit.txt index ea4103f3dd..578e70b8cf 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2F2B22471284D -Inner product checksum theta = 4210411A3413C5A2 -Inner product checksum u = 4501AC432273CA03 +Inner product checksum rho = 40E2F2B224494971 +Inner product checksum theta = 4210411A341A1A2D +Inner product checksum u = 4501AC43210280BA diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt index 9b280ca459..ab76fe1a71 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAAF36AB -Inner product checksum theta = 423041DD8254B694 -Inner product checksum u = 45017CE3BDCC7471 +Inner product checksum rho = 4102EEF5FA87CBE1 +Inner product checksum theta = 423041DD825A8404 +Inner product checksum u = 45017CE3BA63F0FA diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt index a1ac70afd8..26609ab794 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAAF36A3 -Inner product checksum theta = 423041DD8254B695 -Inner product checksum u = 45017CE3BDCC746C +Inner product checksum rho = 4102EEF5FA87CBE2 +Inner product checksum theta = 423041DD825A8403 +Inner product checksum u = 45017CE3BA63F106 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt index 12b47fedf3..ee32a6f3c3 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAAF36AA -Inner product checksum theta = 423041DD8254B693 -Inner product checksum u = 45017CE3BDCC746C +Inner product checksum rho = 4102EEF5FA87CBE0 +Inner product checksum theta = 423041DD825A8404 +Inner product checksum u = 45017CE3BA63F10A diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt1-C24s_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt1-C24s_MG_azspice_gnu_fast-debug-64bit.txt index 7062e4bfa0..2efc7c4ce8 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt1-C24s_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt1-C24s_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E31B89B4F18C5A -Inner product checksum theta = 42104617DFB2BB0E -Inner product checksum u = 4500F65BA3091AE0 +Inner product checksum rho = 40E31B568E5A4E4A +Inner product checksum theta = 4210461E78734A26 +Inner product checksum u = 4500F54C439B1A5A diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt index 491ff4a7cb..4191114fb1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2EB31AE9BB095 -Inner product checksum theta = 42104262EDD0C3CB -Inner product checksum u = 4501DA5CB7431A79 +Inner product checksum rho = 40E2EB31AEBFEF72 +Inner product checksum theta = 42104262EDD13B2E +Inner product checksum u = 4501DA5CAEFE8D62 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt index 9c05a0ff35..0e1b0287c1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2F33FFAE6F53C -Inner product checksum theta = 421041C1E2EA98E8 -Inner product checksum u = 4501D86FAEA1FB4E +Inner product checksum rho = 40E2F33ECC41D4C6 +Inner product checksum theta = 421041C2141EB09C +Inner product checksum u = 4501D8686FA69115 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-pert-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-pert-C24_MG_azspice_gnu_fast-debug-64bit.txt index 1999361d4c..3307a4cda5 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-pert-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-pert-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2E6107980CF2C -Inner product checksum theta = 4210435EB2DDB805 -Inner product checksum u = 4501348CFD6FF108 +Inner product checksum rho = 40E2E6107980EB72 +Inner product checksum theta = 4210435EB2DE4CFF +Inner product checksum u = 4501348CFD9635F1 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_azspice_gnu_fast-debug-64bit.txt index 74c6b988a8..7b1ca10773 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40FE89845A99A3A0 -Inner product checksum theta = 4210F00A9EEFED9B -Inner product checksum u = 42EF4B7C9D66048A +Inner product checksum rho = 40FE89845A92A5D4 +Inner product checksum theta = 4210F00A9EEFEBF2 +Inner product checksum u = 42EF4B7C9D369238 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200-C24_MG_azspice_gnu_fast-debug-64bit.txt index 4673c02ece..b2376609f2 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E8EBCD2FEB4016 -Inner product checksum theta = 4204E5A9894FB906 -Inner product checksum u = 43F4FE3DAF7E7919 +Inner product checksum rho = 40E8EBCD2FEB406C +Inner product checksum theta = 4204E5A9894FB9AC +Inner product checksum u = 43F4FE3DAD801312 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200_realorog-C48_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200_realorog-C48_MG_azspice_gnu_fast-debug-64bit.txt index 299e17ba3e..3e020b051c 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200_realorog-C48_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip200_realorog-C48_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41094CA3DACB8EB2 -Inner product checksum theta = 4224DF7F73F04BA6 -Inner product checksum u = 43C5208E2F479FE9 +Inner product checksum rho = 41094CA3DACB8ED5 +Inner product checksum theta = 4224DF7F73F04BB9 +Inner product checksum u = 43C5208E3070690A diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip301-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip301-C24_MG_azspice_gnu_fast-debug-64bit.txt index d740669e22..df4457f603 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip301-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_dcmip301-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D3FF37BCAE74B3 -Inner product checksum theta = 41EC4ACBE79A82E4 -Inner product checksum u = 44176CD1D18E1CF0 +Inner product checksum rho = 40D3FF37BCAE74AE +Inner product checksum theta = 41EC4ACBE79A8188 +Inner product checksum u = 44176CD1D18E1EB6 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_deep-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_deep-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt index 9de138dcd4..36b0d21db1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_deep-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_deep-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EEEF267CFD70C4 -Inner product checksum theta = 42E2AA885C6B5871 -Inner product checksum u = 47563E0DE14081C8 +Inner product checksum rho = 40EEEF267CFD6FA9 +Inner product checksum theta = 42E2AA885C6B533D +Inner product checksum u = 47563E0DE1413441 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_earth-like-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_earth-like-C24_MG_azspice_gnu_fast-debug-64bit.txt index d8c38c66b5..c3a835c5ac 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_earth-like-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_earth-like-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D56CA2970A6533 -Inner product checksum theta = 42198C1F10A24A85 -Inner product checksum u = 44E3E16E090FDE6D +Inner product checksum rho = 40D56CA2970A1056 +Inner product checksum theta = 42198C1F10A1CBA1 +Inner product checksum u = 44E3E16E089A407A diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_held-suarez-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_held-suarez-C24_MG_azspice_gnu_fast-debug-64bit.txt index 667d88d634..a8b6d20f31 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_held-suarez-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_held-suarez-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E34359B9A4055A -Inner product checksum theta = 421168C83D1FCA3C -Inner product checksum u = 45082CCFE158B801 +Inner product checksum rho = 40E34359B5D3BACF +Inner product checksum theta = 421168C83CF099D4 +Inner product checksum u = 45082CCFE403BADD diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_lfric-real-domain-C48_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_lfric-real-domain-C48_MG_azspice_gnu_fast-debug-64bit.txt index 17b248bfdd..f4e0f6b166 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_lfric-real-domain-C48_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_lfric-real-domain-C48_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4122BF1AB11383BD -Inner product checksum theta = 4240B157AB726083 -Inner product checksum u = 44FA82C80E829B57 +Inner product checksum rho = 4122BF1AB1152006 +Inner product checksum theta = 4240B157AB6EBABE +Inner product checksum u = 44FA82C80EBBDD64 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt index c403abfb03..c71a2fa1dd 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt @@ -1,7 +1,7 @@ -Inner product checksum rho = 41002A013B9CED3F -Inner product checksum theta = 4204AB10C072D40A -Inner product checksum u = 42173616BAD0AE40 -Inner product checksum mr1 = 40477A3CFF479A5B +Inner product checksum rho = 41002A01281D2476 +Inner product checksum theta = 4204AB10C2A15A2A +Inner product checksum u = 421735ED68D1EE98 +Inner product checksum mr1 = 40477A3D560B2573 Inner product checksum mr2 = 0 Inner product checksum mr3 = 0 Inner product checksum mr4 = 0 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt index 8157b57448..cb021cc6f0 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_azspice_gnu_fast-debug-64bit.txt @@ -1,7 +1,7 @@ -Inner product checksum rho = 41002981506890F0 -Inner product checksum theta = 4204AB14AEBC204E -Inner product checksum u = 421830A1C1298F13 -Inner product checksum mr1 = 4047D6E0067DA92E +Inner product checksum rho = 4100297FC4CCE65A +Inner product checksum theta = 4204AB14B0961053 +Inner product checksum u = 4218334F25231FFF +Inner product checksum mr1 = 4047D6DA32F7E62D Inner product checksum mr2 = 0 Inner product checksum mr3 = 0 Inner product checksum mr4 = 0 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-C24_MG_azspice_gnu_fast-debug-64bit.txt index 27fce147f0..c49a764530 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030D58C35888B7 -Inner product checksum theta = 42475B42A25CFDB4 -Inner product checksum u = 456062CEF50A5320 +Inner product checksum rho = 41030D58C35B14EA +Inner product checksum theta = 42475B42A2447514 +Inner product checksum u = 456062CEF5186C38 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt index 944142cdaa..58db3776bf 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030D6C136CE3C9 -Inner product checksum theta = 42476BF6F9CB1344 -Inner product checksum u = 4560B547977004F5 +Inner product checksum rho = 41030D6C134F15A7 +Inner product checksum theta = 42476BF6F9CB89CD +Inner product checksum u = 4560B54797517381 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt index 484ebe073f..16cd406e7a 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr-alt3-C24_MG_azspice_gnu_fast-debug-64bit-rtran32.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030F18BEB1D30D -Inner product checksum theta = 42476C698F6100AD -Inner product checksum u = 4560A0F4749A4F32 +Inner product checksum rho = 41030F18BC6C23FF +Inner product checksum theta = 42476C698C45D058 +Inner product checksum u = 4560A0F4B555EFC1 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_azspice_gnu_fast-debug-64bit.txt index a8d7d291e2..014adff5d8 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E316DD570FC012 -Inner product checksum theta = 420BC551F61B3573 -Inner product checksum u = 44FD3CA2A8580431 +Inner product checksum rho = 40E316DD570F15E0 +Inner product checksum theta = 420BC551F619D7E6 +Inner product checksum u = 44FD3CA2A86C955B diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_azspice_gnu_fast-debug-64bit.txt index 06d5767897..d7d6a42023 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E3144534D14747 -Inner product checksum theta = 420BC6A55E4A864A -Inner product checksum u = 44FDCE146C2763C8 +Inner product checksum rho = 40E3144534D0EDA0 +Inner product checksum theta = 420BC6A55E4A7377 +Inner product checksum u = 44FDCE146C1E7408 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-BiP200x8-500x500_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-BiP200x8-500x500_azspice_gnu_fast-debug-64bit.txt index 28e909f514..bc6931dd58 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-BiP200x8-500x500_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-BiP200x8-500x500_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E1E482F503968A -Inner product checksum theta = 421139234E97D4C7 -Inner product checksum u = 4393A629664DCE34 +Inner product checksum rho = 40E1E482F5039AEA +Inner product checksum theta = 421139234E97D1B8 +Inner product checksum u = 4393A62966481E11 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_azspice_gnu_fast-debug-64bit.txt index 4435714977..b85fa3e7e1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40C1E40C4086849A -Inner product checksum theta = 41F1395D4034FE76 -Inner product checksum u = 4393B67691E55F6A +Inner product checksum rho = 40C1E40C40867E1F +Inner product checksum theta = 41F1395D4034F4D5 +Inner product checksum u = 4393B67691E48894 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_semi-implicit-for-linear-C12_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_semi-implicit-for-linear-C12_azspice_gnu_fast-debug-64bit.txt index 828ae15bb8..eee5b193e2 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_semi-implicit-for-linear-C12_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_semi-implicit-for-linear-C12_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ Inner product checksum rho = 40A3EC6A14AC6571 Inner product checksum theta = 41BEDEE1880FB476 -Inner product checksum u = 4316BFB1C0D84161 +Inner product checksum u = 4316BFB1C35F04AF diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_shallow-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_shallow-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt index d9610c381b..bd299544c0 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_shallow-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_shallow-hot-jupiter-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 400CE3D8ABAC3C98 -Inner product checksum theta = 426EFB40626C06CA -Inner product checksum u = 46E90B3144C6C0BA +Inner product checksum rho = 400CE3D8ABA244ED +Inner product checksum theta = 426EFB40626A4702 +Inner product checksum u = 46E90B314876CB75 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit.txt index 9be2b8d89d..0478fd9549 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40CBD086E89B5CBB -Inner product checksum theta = 41E3A4D10A00A1E1 -Inner product checksum u = 4400A7C1E61414B3 +Inner product checksum rho = 40CBD086E89B5D29 +Inner product checksum theta = 41E3A4D10A00A20A +Inner product checksum u = 4400A7C1E61414AB diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt index 8b2dc98cfa..3ce97cd8ec 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40BBCBB6EF2139D7 -Inner product checksum theta = 41D3A4D0913523F8 -Inner product checksum u = 42800064533EA343 +Inner product checksum rho = 40BBCBB6EF213C04 +Inner product checksum theta = 41D3A4D0913520FC +Inner product checksum u = 42800064C385A97A diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt index 4ebd8f779a..132ed5d6a1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 409BCBB6ED8BDF4E -Inner product checksum theta = 41B3A4D092286D36 -Inner product checksum u = 425BD28986EDD706 +Inner product checksum rho = 409BCBB6ED8BDDE2 +Inner product checksum theta = 41B3A4D0922875DE +Inner product checksum u = 425BD288E8B57F6C diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt index 00c34172f6..f41dfd7326 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40ABB3332F2E4662 -Inner product checksum theta = 41C56FE12C8956A8 -Inner product checksum u = 42703CCCA2F5E548 +Inner product checksum rho = 40ABB3332F2E46CC +Inner product checksum theta = 41C56FE12C8956A0 +Inner product checksum u = 42703CCC6D800D15 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-BiP256x8-200x200_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-BiP256x8-200x200_azspice_gnu_fast-debug-64bit.txt index 2ea706a66b..9c358fefa0 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-BiP256x8-200x200_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-BiP256x8-200x200_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EA1721E2B15F97 -Inner product checksum theta = 41F69B200F92BE38 -Inner product checksum u = 432D54F6E82FD815 +Inner product checksum rho = 40EA1721E2B18188 +Inner product checksum theta = 41F69B200F924130 +Inner product checksum u = 432D54F6E7636766 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_azspice_gnu_fast-debug-64bit.txt index 330b695966..aa6e5a0882 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40DA171CE5E100B5 -Inner product checksum theta = 41E69B0DA695041C -Inner product checksum u = 431CEA8D80263E2B +Inner product checksum rho = 40DA171CE5602F1A +Inner product checksum theta = 41E69B0DAA970520 +Inner product checksum u = 431CEA8137F7E5CD diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_azspice_gnu_fast-debug-64bit.txt index 5d4f80517e..f75fd4cc88 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40FA16E969D82696 -Inner product checksum theta = 42069BF1BB6EBF3E -Inner product checksum u = 42FFC30F4FBB102B +Inner product checksum rho = 40FA16E968D8AE95 +Inner product checksum theta = 42069BF1BC3B92F1 +Inner product checksum u = 42FFC30DC927BAFE diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_azspice_gnu_fast-debug-64bit-rtran32.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_azspice_gnu_fast-debug-64bit-rtran32.txt index 9f4b67a4a5..27a632a105 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_azspice_gnu_fast-debug-64bit-rtran32.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_azspice_gnu_fast-debug-64bit-rtran32.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EA1719B768F3AC -Inner product checksum theta = 41F69B1F28A3BFA5 -Inner product checksum u = 432E6916F4076749 +Inner product checksum rho = 40EA1719BC3DAA6E +Inner product checksum theta = 41F69B1F2437F436 +Inner product checksum u = 432E6913A2F84E9E diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24_MG_azspice_gnu_fast-debug-64bit.txt index 3ff5382810..2b3904c86d 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D4230A1478666B -Inner product checksum theta = 421AE83CAB516462 -Inner product checksum u = 44D53ED8DE21877F +Inner product checksum rho = 40D4230A1413567C +Inner product checksum theta = 421AE83CAB06035D +Inner product checksum u = 44D53EC0952BFCA0 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_azspice_gnu_fast-debug-64bit.txt index ba0bf78e7a..f8d618a46f 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D3B0E3F253A58A -Inner product checksum theta = 421AFAEB05FFB702 -Inner product checksum u = 44D452237770E849 +Inner product checksum rho = 40D3B0E60B38BD64 +Inner product checksum theta = 421AFAE98265E324 +Inner product checksum u = 44D440D70B08F799 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_ex1a_gnu_fast-debug-64bit.txt index d78f727e8e..a578bb9be1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40DAA271B7D2549C -Inner product checksum theta = 42418E8247B61658 -Inner product checksum u = 43F0A73C1317F205 +Inner product checksum rho = 40DAA271B7D254AE +Inner product checksum theta = 42418E8247B61632 +Inner product checksum u = 43F0A73C1317F297 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C24_MG_ex1a_gnu_fast-debug-64bit.txt index ada3a1c66b..2b89db78c2 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2F2B2245C6EF0 -Inner product checksum theta = 4210411A341600F1 -Inner product checksum u = 4501AC4321EB0E76 +Inner product checksum rho = 40E2F2B2242F82BC +Inner product checksum theta = 4210411A341DFA6A +Inner product checksum u = 4501AC43203B4210 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt index 6c4cb08c4a..4dc9c99b2e 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAB5441A -Inner product checksum theta = 423041DD8253D5FC -Inner product checksum u = 45017CE3BDCE5214 +Inner product checksum rho = 4102EEF5FA84F12A +Inner product checksum theta = 423041DD825A2FE2 +Inner product checksum u = 45017CE3BAF00E78 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt1-C24s_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt1-C24s_MG_ex1a_gnu_fast-debug-64bit.txt index 56cb363bf6..b709e3e3cf 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt1-C24s_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt1-C24s_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E31B643340F144 -Inner product checksum theta = 4210461DA89B6FC4 -Inner product checksum u = 4500F5760268D47B +Inner product checksum rho = 40E31B53EF2B2D7C +Inner product checksum theta = 4210461EECBE9A76 +Inner product checksum u = 4500F524DBAB85BB diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt index 1bdca4b97e..2ed58c2256 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2EB31AEC2A8BB -Inner product checksum theta = 42104262EDD02E18 -Inner product checksum u = 4501DA5CB45FBE9C +Inner product checksum rho = 40E2EB31AE3E89BB +Inner product checksum theta = 42104262EDD53F96 +Inner product checksum u = 4501DA5CB10A8BD1 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt3-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt3-C24_MG_ex1a_gnu_fast-debug-64bit.txt index 3a966d1832..e5b320aa8a 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt3-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-alt3-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2F3443846D2F3 -Inner product checksum theta = 421041C0A412BCF8 -Inner product checksum u = 4501D87BC333BF10 +Inner product checksum rho = 40E2F34437F0351A +Inner product checksum theta = 421041C0A42D9B54 +Inner product checksum u = 4501D87BC4DF95EA diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-pert-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-pert-C24_MG_ex1a_gnu_fast-debug-64bit.txt index 7847386cb7..57bcf3c862 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-pert-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-pert-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E2E6107980F6AE -Inner product checksum theta = 4210435EB2DD9110 -Inner product checksum u = 4501348CFD7A98CA +Inner product checksum rho = 40E2E6107980BF3A +Inner product checksum theta = 4210435EB2DE3695 +Inner product checksum u = 4501348CFD97EF63 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit.txt index a838438232..7b1ca10773 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_bryan_fritsch-dry-BiP200x10-100x100_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40FE89845A99A3A1 -Inner product checksum theta = 4210F00A9EEFED9B -Inner product checksum u = 42EF4B7C9D66048B +Inner product checksum rho = 40FE89845A92A5D4 +Inner product checksum theta = 4210F00A9EEFEBF2 +Inner product checksum u = 42EF4B7C9D369238 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200-C24_MG_ex1a_gnu_fast-debug-64bit.txt index b7eed6f7c1..0f4952adc1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E8EBCD2FEB401B -Inner product checksum theta = 4204E5A9894FB902 -Inner product checksum u = 43F4FE3DAF7B3E30 +Inner product checksum rho = 40E8EBCD2FEB4056 +Inner product checksum theta = 4204E5A9894FB9B6 +Inner product checksum u = 43F4FE3DAD7A07B4 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200_realorog-C48_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200_realorog-C48_MG_ex1a_gnu_fast-debug-64bit.txt index 84357f5b2a..6a03a873ab 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200_realorog-C48_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip200_realorog-C48_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41094CA3DACB8EBD -Inner product checksum theta = 4224DF7F73F04BAC -Inner product checksum u = 43C5208E2E7E176F +Inner product checksum rho = 41094CA3DACB8EDD +Inner product checksum theta = 4224DF7F73F04BBA +Inner product checksum u = 43C5208E30AD65C7 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip301-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip301-C24_MG_ex1a_gnu_fast-debug-64bit.txt index aac8febbdd..9ba6773a3e 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip301-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_dcmip301-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D3FF37BCAE7812 -Inner product checksum theta = 41EC4ACBE79A8394 -Inner product checksum u = 44176CD1D18E1FCA +Inner product checksum rho = 40D3FF37BCAE7257 +Inner product checksum theta = 41EC4ACBE79A8576 +Inner product checksum u = 44176CD1D18E3182 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_deep-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_deep-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt index d80f4a4f2c..8d9ecb38ac 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_deep-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_deep-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EEEF267CFD709D -Inner product checksum theta = 42E2AA885C6B50A2 -Inner product checksum u = 47563E0DE14080A8 +Inner product checksum rho = 40EEEF267CFD6FBC +Inner product checksum theta = 42E2AA885C6B4D70 +Inner product checksum u = 47563E0DE1414B6A diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_earth-like-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_earth-like-C24_MG_ex1a_gnu_fast-debug-64bit.txt index b71d368255..0e80b91878 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_earth-like-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_earth-like-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D56CA2970A568B -Inner product checksum theta = 42198C1F10A25514 -Inner product checksum u = 44E3E16E092323AA +Inner product checksum rho = 40D56CA2970A04BD +Inner product checksum theta = 42198C1F10A1CCA1 +Inner product checksum u = 44E3E16E089C09C6 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_held-suarez-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_held-suarez-C24_MG_ex1a_gnu_fast-debug-64bit.txt index 693e33de55..1700229e43 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_held-suarez-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_held-suarez-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E34359BE28D32E -Inner product checksum theta = 421168C83C70C4C8 -Inner product checksum u = 45082CD009C02E72 +Inner product checksum rho = 40E34359B52609FB +Inner product checksum theta = 421168C83D3188D0 +Inner product checksum u = 45082CCFD387C8E6 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_lfric-real-domain-C48_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_lfric-real-domain-C48_MG_ex1a_gnu_fast-debug-64bit.txt index bbb9c91e7c..eae67f0988 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_lfric-real-domain-C48_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_lfric-real-domain-C48_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4122BF1AB114A722 -Inner product checksum theta = 4240B157AB71BF54 -Inner product checksum u = 44FA82C80E9F3C45 +Inner product checksum rho = 4122BF1AB11446C4 +Inner product checksum theta = 4240B157AB6D6B74 +Inner product checksum u = 44FA82C80EB13CCC diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt index c403abfb03..c71a2fa1dd 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-lam-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt @@ -1,7 +1,7 @@ -Inner product checksum rho = 41002A013B9CED3F -Inner product checksum theta = 4204AB10C072D40A -Inner product checksum u = 42173616BAD0AE40 -Inner product checksum mr1 = 40477A3CFF479A5B +Inner product checksum rho = 41002A01281D2476 +Inner product checksum theta = 4204AB10C2A15A2A +Inner product checksum u = 421735ED68D1EE98 +Inner product checksum mr1 = 40477A3D560B2573 Inner product checksum mr2 = 0 Inner product checksum mr3 = 0 Inner product checksum mr4 = 0 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt index 8157b57448..35836929c5 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_robert-moist-smag-BiP100x8-10x10_ex1a_gnu_fast-debug-64bit.txt @@ -1,7 +1,7 @@ -Inner product checksum rho = 41002981506890F0 -Inner product checksum theta = 4204AB14AEBC204E -Inner product checksum u = 421830A1C1298F13 -Inner product checksum mr1 = 4047D6E0067DA92E +Inner product checksum rho = 41002981B7FF017C +Inner product checksum theta = 4204AB14B37E94E0 +Inner product checksum u = 42183285E86217A4 +Inner product checksum mr1 = 4047D6DA4CC9B43A Inner product checksum mr2 = 0 Inner product checksum mr3 = 0 Inner product checksum mr4 = 0 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-C24_MG_ex1a_gnu_fast-debug-64bit.txt index 5636f2de72..abaa2ddeff 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030D58C358E5B2 -Inner product checksum theta = 42475B42A2584218 -Inner product checksum u = 456062CEF518DF7E +Inner product checksum rho = 41030D58C35AA6D0 +Inner product checksum theta = 42475B42A2464EF6 +Inner product checksum u = 456062CEF514C319 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt index 023e3f169b..ef2353d26a 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt2-C24_MG_op_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030D6C13704C70 -Inner product checksum theta = 42476BF6F9C9A074 -Inner product checksum u = 4560B5479777FCB4 +Inner product checksum rho = 41030D6C134DAF9C +Inner product checksum theta = 42476BF6F9CA8BDE +Inner product checksum u = 4560B5479759DA53 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt3-C24_MG_ex1a_gnu_fast-debug-64bit-rtran32.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt3-C24_MG_ex1a_gnu_fast-debug-64bit-rtran32.txt index 1cc3356ddf..11c83527f4 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt3-C24_MG_ex1a_gnu_fast-debug-64bit-rtran32.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr-alt3-C24_MG_ex1a_gnu_fast-debug-64bit-rtran32.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 41030F18BD30F16D -Inner product checksum theta = 42476C69857F19F2 -Inner product checksum u = 4560A0F50666537B +Inner product checksum rho = 41030F18BBFCC4E1 +Inner product checksum theta = 42476C69813AD84E +Inner product checksum u = 4560A0F4C908DB70 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_ex1a_gnu_fast-debug-64bit.txt index b639b3c021..342c85420a 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E316DD570F9388 -Inner product checksum theta = 420BC551F61B236E -Inner product checksum u = 44FD3CA2A85EEACA +Inner product checksum rho = 40E316DD570F3D8C +Inner product checksum theta = 420BC551F619D88A +Inner product checksum u = 44FD3CA2A86D5AC1 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_ex1a_gnu_fast-debug-64bit.txt index 4e4102079a..6bd05a0b9b 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_sbr_lam-n96_MG_lam_rotate_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E3144534D1171C -Inner product checksum theta = 420BC6A55E4A8BBE -Inner product checksum u = 44FDCE146C2A3DB3 +Inner product checksum rho = 40E3144534D0B814 +Inner product checksum theta = 420BC6A55E4A6560 +Inner product checksum u = 44FDCE146C1F469A diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit.txt index 28e909f514..bc6931dd58 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-BiP200x8-500x500_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40E1E482F503968A -Inner product checksum theta = 421139234E97D4C7 -Inner product checksum u = 4393A629664DCE34 +Inner product checksum rho = 40E1E482F5039AEA +Inner product checksum theta = 421139234E97D1B8 +Inner product checksum u = 4393A62966481E11 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_ex1a_gnu_fast-debug-64bit.txt index 966e3d300f..bf4b39a3e1 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_schar_cart-alt2-BiP100x4-1000x1000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40C1E40C40869417 -Inner product checksum theta = 41F1395D4034FF38 -Inner product checksum u = 4393B67691E550BA +Inner product checksum rho = 40C1E40C40868A95 +Inner product checksum theta = 41F1395D4034F6B8 +Inner product checksum u = 4393B67691E3FBCA diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_semi-implicit-for-linear-C12_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_semi-implicit-for-linear-C12_ex1a_gnu_fast-debug-64bit.txt index 245caece85..66c798bb98 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_semi-implicit-for-linear-C12_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_semi-implicit-for-linear-C12_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ Inner product checksum rho = 40A3EC6A14AC6571 Inner product checksum theta = 41BEDEE1880FB476 -Inner product checksum u = 4316BFB1C0CA2C65 +Inner product checksum u = 4316BFB1C359090D diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_shallow-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_shallow-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt index 0e016e6e98..82c2eea871 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_shallow-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_shallow-hot-jupiter-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 400CE3D8AB9E8522 -Inner product checksum theta = 426EFB4062638E1B -Inner product checksum u = 46E90B3148D56BF0 +Inner product checksum rho = 400CE3D8AB9E3B3B +Inner product checksum theta = 426EFB4062686A28 +Inner product checksum u = 46E90B3149A8E6FC diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit.txt index 9be2b8d89d..0478fd9549 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p0-BiP300x8-1000x2000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40CBD086E89B5CBB -Inner product checksum theta = 41E3A4D10A00A1E1 -Inner product checksum u = 4400A7C1E61414B3 +Inner product checksum rho = 40CBD086E89B5D29 +Inner product checksum theta = 41E3A4D10A00A20A +Inner product checksum u = 4400A7C1E61414AB diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt index 8b2dc98cfa..dda37a4062 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_p1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40BBCBB6EF2139D7 -Inner product checksum theta = 41D3A4D0913523F8 -Inner product checksum u = 42800064533EA343 +Inner product checksum rho = 40BBCBB6EF213C2C +Inner product checksum theta = 41D3A4D091352102 +Inner product checksum u = 42800064C3436CDA diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt index b520009fe7..50870ce84f 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph0pv1-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 409BCBB6ED8BDF26 -Inner product checksum theta = 41B3A4D092286D94 -Inner product checksum u = 425BD28990164CAC +Inner product checksum rho = 409BCBB6ED8BDE16 +Inner product checksum theta = 41B3A4D092287267 +Inner product checksum u = 425BD2887B461A04 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt index 934dfe7965..564f5b6120 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_skamarock_klemp_gw_ph1pv0-BiP75x4-4000x2000_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40ABB3332F2E4660 -Inner product checksum theta = 41C56FE12C8956A9 -Inner product checksum u = 42703CCCA2F5E547 +Inner product checksum rho = 40ABB3332F2E46CA +Inner product checksum theta = 41C56FE12C89569C +Inner product checksum u = 42703CCC711E5244 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt index 20684c9deb..9c358fefa0 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EA1721E2B15F98 -Inner product checksum theta = 41F69B200F92BE38 -Inner product checksum u = 432D54F6E82FD816 +Inner product checksum rho = 40EA1721E2B18188 +Inner product checksum theta = 41F69B200F924130 +Inner product checksum u = 432D54F6E7636766 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_ex1a_gnu_fast-debug-64bit.txt index bd7eeab53a..46823e617c 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt1-BiP256x4-200x200_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40DA171CE5E0D8E0 -Inner product checksum theta = 41E69B0DA69613A4 -Inner product checksum u = 431CEA8D7FB83CC8 +Inner product checksum rho = 40DA171CE55FD5EE +Inner product checksum theta = 41E69B0DAA9776F1 +Inner product checksum u = 431CEA8137C0F651 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_ex1a_gnu_fast-debug-64bit.txt index 1f6a32d1ee..1f9e0e2573 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt2-BiP256x16-200x50_op_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40FA16E968D7D432 -Inner product checksum theta = 42069BF1BC3DF21E -Inner product checksum u = 42FFC30DC52E5C94 +Inner product checksum rho = 40FA16E969D84AAC +Inner product checksum theta = 42069BF1BB6DB28A +Inner product checksum u = 42FFC30F531CE6B6 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt index fe82d0c511..72fefc24ba 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_straka_200m-alt3-BiP256x8-200x200_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40EA171A1830AFAE -Inner product checksum theta = 41F69B1D66F904A1 -Inner product checksum u = 432E68AADCCA17BA +Inner product checksum rho = 40EA171A182FBE92 +Inner product checksum theta = 41F69B1D66FA3AF0 +Inner product checksum u = 432E68AAD5EDEAEC diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24_MG_ex1a_gnu_fast-debug-64bit.txt index d73579aaa3..fca6aef0db 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D4230A1404B217 -Inner product checksum theta = 421AE83CAB319131 -Inner product checksum u = 44D53EDA51FBE808 +Inner product checksum rho = 40D4230A141F4BDB +Inner product checksum theta = 421AE83CAB0BF0DD +Inner product checksum u = 44D53ECBB6B861BD diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_ex1a_gnu_fast-debug-64bit.txt index c264bfea9e..5e0497ac0e 100644 --- a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_tidally-locked-earth-C24s_rot_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 40D3B0E5DA3B9B82 -Inner product checksum theta = 421AFAEA28D94C62 -Inner product checksum u = 44D450F5CA068894 +Inner product checksum rho = 40D3B0E66FC47CFA +Inner product checksum theta = 421AFAE9ADAFF6CE +Inner product checksum u = 44D449855AF0C320 diff --git a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_fast-debug-64bit.txt index def85323e4..94394f2bc0 100644 --- a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_fast-debug-64bit.txt @@ -1 +1 @@ -Inner product checksum theta = 41F6D1230190116A +Inner product checksum theta = 41F6D1230190C9AA diff --git a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_full-debug-64bit.txt b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_full-debug-64bit.txt index def85323e4..94394f2bc0 100644 --- a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_full-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_azspice_gnu_full-debug-64bit.txt @@ -1 +1 @@ -Inner product checksum theta = 41F6D1230190116A +Inner product checksum theta = 41F6D1230190C9AA diff --git a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt index 22bf3285d1..6b0a145930 100644 --- a/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/jedi_lfric_tests/azspice/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA52EF77E49F0FF -Inner product checksum theta = 41601DBDA3369D5A -Inner product checksum u = 45674E3774E524EA -Inner product checksum mr1 = 3F35A63D679AE4B0 -Inner product checksum mr2 = 3EEB1DD4FF340ABA -Inner product checksum mr3 = 3EDF4E0C9252891B -Inner product checksum mr4 = 3EED721FE4FC621B +Inner product checksum rho = 3FA52EF730B5BD9D +Inner product checksum theta = 41601DBC724F5268 +Inner product checksum u = 45674E363523ABD6 +Inner product checksum mr1 = 3F35A63C3C45CFE6 +Inner product checksum mr2 = 3EEB1DD475D1BFC8 +Inner product checksum mr3 = 3EDF4E0CA425E74F +Inner product checksum mr4 = 3EED721FD85D794C Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_ex1a_cce_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_ex1a_cce_fast-debug-64bit.txt index a4abf87ad7..91afa6c96f 100644 --- a/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_ex1a_cce_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_forecast_gh-si-for-linear-C12_ex1a_cce_fast-debug-64bit.txt @@ -1 +1 @@ -Inner product checksum theta = 41F6D12301909934 +Inner product checksum theta = 41F6D123019014DC diff --git a/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt index 642231277a..fa81b82d37 100644 --- a/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/jedi_lfric_tests/ex1a/checksum_jedi_lfric_tests_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA52EF6ADA58274 -Inner product checksum theta = 41601DBD4534566A -Inner product checksum u = 45674E378323D408 -Inner product checksum mr1 = 3F35A638239F6F05 -Inner product checksum mr2 = 3EEB1DD4BC63F129 -Inner product checksum mr3 = 3EDF4E0CAF22AF37 -Inner product checksum mr4 = 3EED721F89296768 +Inner product checksum rho = 3FA52EF46F2B3ED8 +Inner product checksum theta = 41601DBC79A00648 +Inner product checksum u = 45674E3635705170 +Inner product checksum mr1 = 3F35A63DDE8BE246 +Inner product checksum mr2 = 3EEB1DD4BA44F6E6 +Inner product checksum mr3 = 3EDF4E0C9995530D +Inner product checksum mr4 = 3EED72201308D705 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_aquaplanet-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_aquaplanet-C12_azspice_gnu_fast-debug-32bit.txt index efd6c7a152..e53ac0c222 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_aquaplanet-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_aquaplanet-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 468AD867 -Inner product checksum theta = 4FD68864 -Inner product checksum u = 6A4E625C -Inner product checksum mr1 = 3F07E2A3 -Inner product checksum mr2 = 368B1274 -Inner product checksum mr3 = 340A5E74 -Inner product checksum mr4 = 369107AC +Inner product checksum rho = 468AD873 +Inner product checksum theta = 4FD68867 +Inner product checksum u = 6A4E6864 +Inner product checksum mr1 = 3F07DCA9 +Inner product checksum mr2 = 368528C1 +Inner product checksum mr3 = 340BD040 +Inner product checksum mr4 = 36959C58 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_camembert_case3_gj1214b-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_camembert_case3_gj1214b-C12_azspice_gnu_fast-debug-32bit.txt index 1336697b07..d6d2b03b35 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_camembert_case3_gj1214b-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_camembert_case3_gj1214b-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 44D95740 -Inner product checksum theta = 5504FC2C -Inner product checksum u = 74276D83 +Inner product checksum rho = 44D95743 +Inner product checksum theta = 5504FC2F +Inner product checksum u = 74276D8C diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9-C12_azspice_gnu_fast-debug-32bit.txt index 0b0299a998..ce3dfbfa5c 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D552C2 -Inner product checksum theta = 518ED761 -Inner product checksum u = 6AF9062A -Inner product checksum mr1 = 3FE1FDDC -Inner product checksum mr2 = 3741AD00 -Inner product checksum mr3 = 351684B6 -Inner product checksum mr4 = 36A099BE +Inner product checksum rho = 46D5567D +Inner product checksum theta = 518ED62D +Inner product checksum u = 6AF93A84 +Inner product checksum mr1 = 3FE1E6C4 +Inner product checksum mr2 = 372E20A6 +Inner product checksum mr3 = 350BF34C +Inner product checksum mr4 = 369BE96A Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_chem-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_chem-C12_azspice_gnu_fast-debug-32bit.txt index 8de3d841d6..e607d3f538 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_chem-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_chem-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D5578A -Inner product checksum theta = 518ED8FB -Inner product checksum u = 6AF94DEC -Inner product checksum mr1 = 3FE1FD6A -Inner product checksum mr2 = 3736FE04 -Inner product checksum mr3 = 350C5B3F -Inner product checksum mr4 = 36AF8892 +Inner product checksum rho = 46D55C0A +Inner product checksum theta = 518ED928 +Inner product checksum u = 6AF8670F +Inner product checksum mr1 = 3FE18B32 +Inner product checksum mr2 = 3732A3CC +Inner product checksum mr3 = 3521ABAC +Inner product checksum mr4 = 36B951BC Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt index 5ac113daf6..97ca7f9fc0 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_clim_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D6859D -Inner product checksum theta = 519A8C17 -Inner product checksum u = 6B2FD7B0 -Inner product checksum mr1 = 3FCB84C2 -Inner product checksum mr2 = 374F320C -Inner product checksum mr3 = 35DFD488 -Inner product checksum mr4 = 379DAF52 +Inner product checksum rho = 46D68588 +Inner product checksum theta = 519A8C1C +Inner product checksum u = 6B2FD569 +Inner product checksum mr1 = 3FCB7E4C +Inner product checksum mr2 = 37555200 +Inner product checksum mr3 = 35E0A4A0 +Inner product checksum mr4 = 379DF42C Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_hd209458b-C24_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_hd209458b-C24_azspice_gnu_fast-debug-32bit.txt index 90e67464e6..a00548eb75 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_hd209458b-C24_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_hd209458b-C24_azspice_gnu_fast-debug-32bit.txt @@ -1,3 +1,3 @@ Inner product checksum rho = 4798D8DD -Inner product checksum theta = 584061BB -Inner product checksum u = 79B9DF6B +Inner product checksum theta = 584061B9 +Inner product checksum u = 79B9E161 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_casim-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_casim-C12_azspice_gnu_fast-debug-32bit.txt index 219515be2c..ab5481d718 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_casim-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_casim-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D870E9 -Inner product checksum theta = 518CDC70 -Inner product checksum u = 6A8B6667 -Inner product checksum mr1 = 3FCC8CF3 -Inner product checksum mr2 = 3837FCDE -Inner product checksum mr3 = 35411158 -Inner product checksum mr4 = 369FE708 -Inner product checksum mr5 = 2EAC5C04 -Inner product checksum mr6 = 353FD98D +Inner product checksum rho = 46D873D8 +Inner product checksum theta = 518CDA3A +Inner product checksum u = 6A8A6781 +Inner product checksum mr1 = 3FCDAB45 +Inner product checksum mr2 = 382E1EF9 +Inner product checksum mr3 = 3556AB75 +Inner product checksum mr4 = 36A491BF +Inner product checksum mr5 = 2E624B30 +Inner product checksum mr6 = 354B77E7 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_coma9-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_coma9-C12_azspice_gnu_fast-debug-32bit.txt index 49ce1075f2..f6b9e1603e 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_coma9-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_coma9-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D868F4 -Inner product checksum theta = 518CDD4D -Inner product checksum u = 6A871B9A -Inner product checksum mr1 = 3FD03689 -Inner product checksum mr2 = 37F037E4 -Inner product checksum mr3 = 379AA00B -Inner product checksum mr4 = 37A424D9 -Inner product checksum mr5 = 36A77130 +Inner product checksum rho = 46D86843 +Inner product checksum theta = 518CDFEC +Inner product checksum u = 6A875117 +Inner product checksum mr1 = 3FD07D44 +Inner product checksum mr2 = 37EDEEC8 +Inner product checksum mr3 = 37A16D15 +Inner product checksum mr4 = 379B4FA3 +Inner product checksum mr5 = 36BE92AE Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit.txt index 69521dedf0..6f1360f35b 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D858B1 -Inner product checksum theta = 518CE449 -Inner product checksum u = 6A86DFFC -Inner product checksum mr1 = 3FD1B4B2 -Inner product checksum mr2 = 37ED7B41 -Inner product checksum mr3 = 377827F3 -Inner product checksum mr4 = 37BAAA06 -Inner product checksum mr5 = 36A37633 +Inner product checksum rho = 46D85980 +Inner product checksum theta = 518CE476 +Inner product checksum u = 6A86F70E +Inner product checksum mr1 = 3FD21066 +Inner product checksum mr2 = 37E8CF48 +Inner product checksum mr3 = 37730888 +Inner product checksum mr4 = 37CB19ED +Inner product checksum mr5 = 36AC204D Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-32bit.txt index 1edfec4885..363a642b68 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D85B40 -Inner product checksum theta = 518CDD3B -Inner product checksum u = 6A887414 -Inner product checksum mr1 = 3FD09281 -Inner product checksum mr2 = 37B99628 -Inner product checksum mr3 = 3584EEC7 -Inner product checksum mr4 = 36E7D8E4 +Inner product checksum rho = 46D859C6 +Inner product checksum theta = 518CDC37 +Inner product checksum u = 6A87CFC3 +Inner product checksum mr1 = 3FD0605D +Inner product checksum mr2 = 37CD8452 +Inner product checksum mr3 = 358CAD68 +Inner product checksum mr4 = 370BEDCC Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-64bit.txt index 28c5707576..b7b3138fc3 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C12_azspice_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 40DB0B7BF821E6F6 -Inner product checksum theta = 42319BC9DE8920CB -Inner product checksum u = 455112ADD5C47FA8 -Inner product checksum mr1 = 3FFA0825B436BB4B -Inner product checksum mr2 = 3EF8F041E2149B8A -Inner product checksum mr3 = 3EB2334BDC14D580 -Inner product checksum mr4 = 3EDE7F5A7D8378F0 +Inner product checksum rho = 40DB0B189CB4267C +Inner product checksum theta = 42319AEC5CE825A4 +Inner product checksum u = 455122178EDE86B9 +Inner product checksum mr1 = 3FFA080FFAFF30D0 +Inner product checksum mr2 = 3EF9518B8C183843 +Inner product checksum mr3 = 3EB2CB052796288E +Inner product checksum mr4 = 3EE0F347DC6E707C Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C48_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C48_MG_azspice_gnu_fast-debug-32bit.txt index dee6d7e916..250e69c601 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C48_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-C48_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D8018C -Inner product checksum theta = 5392FB13 -Inner product checksum u = 6A97BE9F -Inner product checksum mr1 = 41CCFFD6 -Inner product checksum mr2 = 39CE183C -Inner product checksum mr3 = 37AA2A89 -Inner product checksum mr4 = 395B8F94 +Inner product checksum rho = 48D8019B +Inner product checksum theta = 5392FADC +Inner product checksum u = 6A97B975 +Inner product checksum mr1 = 41CD034E +Inner product checksum mr2 = 39D0613A +Inner product checksum mr3 = 37A7A60B +Inner product checksum mr4 = 395BE5D9 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-pert-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-pert-C12_azspice_gnu_fast-debug-32bit.txt index 74dbe45ef9..5d29e80970 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-pert-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9-pert-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D83093 -Inner product checksum theta = 51946D1C -Inner product checksum u = 6B12D0D9 -Inner product checksum mr1 = 3FC8D0AC -Inner product checksum mr2 = 379C5134 -Inner product checksum mr3 = 3590547D -Inner product checksum mr4 = 378F98CC +Inner product checksum rho = 46D83078 +Inner product checksum theta = 51946D19 +Inner product checksum u = 6B12CF52 +Inner product checksum mr1 = 3FC8D0CF +Inner product checksum mr2 = 379FF52C +Inner product checksum mr3 = 35916958 +Inner product checksum mr4 = 378F5C33 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_azspice_gnu_fast-debug-32bit.txt index 78cd9367d5..037bf98b95 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D80202 -Inner product checksum theta = 5392FB27 -Inner product checksum u = 6A97BD7E -Inner product checksum mr1 = 41CD0563 -Inner product checksum mr2 = 39CEF093 -Inner product checksum mr3 = 37A8FE76 -Inner product checksum mr4 = 395E85FC +Inner product checksum rho = 48D80224 +Inner product checksum theta = 5392FB23 +Inner product checksum u = 6A97B74C +Inner product checksum mr1 = 41CD0378 +Inner product checksum mr2 = 39CD1B9D +Inner product checksum mr3 = 37A593EC +Inner product checksum mr4 = 395A211E Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_da-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_da-C12_azspice_gnu_fast-debug-32bit.txt index cbbf0e27dd..6d4b93b695 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_da-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_da-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82088 -Inner product checksum theta = 518A7526 -Inner product checksum u = 6A8DA149 -Inner product checksum mr1 = 3FD3CCFA -Inner product checksum mr2 = 37CA11A6 -Inner product checksum mr3 = 35AC24B6 -Inner product checksum mr4 = 36DD326D +Inner product checksum rho = 46D82434 +Inner product checksum theta = 518A76C7 +Inner product checksum u = 6A8D1F06 +Inner product checksum mr1 = 3FD4248B +Inner product checksum mr2 = 37C6B2CA +Inner product checksum mr3 = 359E5BDC +Inner product checksum mr4 = 36C78226 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C12_azspice_gnu_full-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C12_azspice_gnu_full-debug-32bit.txt index 9a0596bbf4..927d9a6a1c 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C12_azspice_gnu_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C12_azspice_gnu_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D824AF +Inner product checksum rho = 46D824BC Inner product checksum theta = 51952836 -Inner product checksum u = 6AD01B78 -Inner product checksum mr1 = 3FC89112 -Inner product checksum mr2 = 37B07EAC -Inner product checksum mr3 = 35202152 -Inner product checksum mr4 = 36A0C43E +Inner product checksum u = 6AD01BC5 +Inner product checksum mr1 = 3FC893CA +Inner product checksum mr2 = 37AF8588 +Inner product checksum mr3 = 351ED058 +Inner product checksum mr4 = 36A0EB4A Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C48_MG_azspice_gnu_full-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C48_MG_azspice_gnu_full-debug-32bit.txt index 48df79180d..60124837ab 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C48_MG_azspice_gnu_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_debug-C48_MG_azspice_gnu_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D81C6C +Inner product checksum rho = 48D81C6A Inner product checksum theta = 53952784 -Inner product checksum u = 6AA47E12 -Inner product checksum mr1 = 41C845F8 -Inner product checksum mr2 = 3999927E -Inner product checksum mr3 = 3779DAC2 -Inner product checksum mr4 = 392E263E +Inner product checksum u = 6AA47E1E +Inner product checksum mr1 = 41C845BF +Inner product checksum mr2 = 3999C55E +Inner product checksum mr3 = 37797187 +Inner product checksum mr4 = 392E5495 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda-C12_azspice_gnu_fast-debug-32bit.txt index ceb411dbae..5dec7d17c0 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82484 -Inner product checksum theta = 518A5967 -Inner product checksum u = 6A910A4E -Inner product checksum mr1 = 3FD0AF5C -Inner product checksum mr2 = 37F05781 -Inner product checksum mr3 = 3594AAC6 -Inner product checksum mr4 = 36DC48BA +Inner product checksum rho = 46D824CC +Inner product checksum theta = 518A5A7A +Inner product checksum u = 6A8FC4BE +Inner product checksum mr1 = 3FD0F2AA +Inner product checksum mr2 = 37D5A66C +Inner product checksum mr3 = 358D8236 +Inner product checksum mr4 = 36CDDCCC Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda_jada-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda_jada-C12_azspice_gnu_fast-debug-32bit.txt index 52ec8a2c7d..efb4d7362d 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda_jada-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_eda_jada-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D8212F -Inner product checksum theta = 518A731A -Inner product checksum u = 6A8CF5FA -Inner product checksum mr1 = 3FD3A181 -Inner product checksum mr2 = 37DF77FC -Inner product checksum mr3 = 35A013C2 -Inner product checksum mr4 = 36B312FE +Inner product checksum rho = 46D82101 +Inner product checksum theta = 518A709B +Inner product checksum u = 6A8CA1DD +Inner product checksum mr1 = 3FD3B5EF +Inner product checksum mr2 = 37D34762 +Inner product checksum mr3 = 35A3B0B4 +Inner product checksum mr4 = 3709AB18 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_mol-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_mol-C12_azspice_gnu_fast-debug-32bit.txt index 21a46c6448..eaee34dd8b 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_mol-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_mol-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D85E30 -Inner product checksum theta = 5193AF41 -Inner product checksum u = 6A86156B -Inner product checksum mr1 = 3FD04C1E -Inner product checksum mr2 = 37B337F6 -Inner product checksum mr3 = 3545CE28 -Inner product checksum mr4 = 36ECD0E0 +Inner product checksum rho = 46D861B8 +Inner product checksum theta = 5193B01F +Inner product checksum u = 6A860645 +Inner product checksum mr1 = 3FD03267 +Inner product checksum mr2 = 37BE03A0 +Inner product checksum mr3 = 35378487 +Inner product checksum mr4 = 36F4D139 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-C48_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-C48_MG_azspice_gnu_fast-debug-32bit.txt index 223e55a9fb..34fd3ce990 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-C48_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-C48_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D818B2 -Inner product checksum theta = 53948CAD -Inner product checksum u = 6AA1D21A -Inner product checksum mr1 = 41C960BC -Inner product checksum mr2 = 39A9CFF3 -Inner product checksum mr3 = 37844180 -Inner product checksum mr4 = 3923F952 +Inner product checksum rho = 48D818AA +Inner product checksum theta = 53948CA8 +Inner product checksum u = 6AA1D18B +Inner product checksum mr1 = 41C96018 +Inner product checksum mr2 = 39A8D124 +Inner product checksum mr3 = 37836BEC +Inner product checksum mr4 = 39240428 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-coarse-C48_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-coarse-C48_MG_azspice_gnu_fast-debug-32bit.txt index 223e55a9fb..34fd3ce990 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-coarse-C48_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_nudging-era-coarse-C48_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D818B2 -Inner product checksum theta = 53948CAD -Inner product checksum u = 6AA1D21A -Inner product checksum mr1 = 41C960BC -Inner product checksum mr2 = 39A9CFF3 -Inner product checksum mr3 = 37844180 -Inner product checksum mr4 = 3923F952 +Inner product checksum rho = 48D818AA +Inner product checksum theta = 53948CA8 +Inner product checksum u = 6AA1D18B +Inner product checksum mr1 = 41C96018 +Inner product checksum mr2 = 39A8D124 +Inner product checksum mr3 = 37836BEC +Inner product checksum mr4 = 39240428 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt index 99bebb35d1..f032d77280 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_nwp_gal9_short-C12_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82C3B -Inner product checksum theta = 5194F750 -Inner product checksum u = 6AE733CA -Inner product checksum mr1 = 3FC8CCD0 -Inner product checksum mr2 = 37A62CA6 -Inner product checksum mr3 = 35563F53 -Inner product checksum mr4 = 371D117F +Inner product checksum rho = 46D82C36 +Inner product checksum theta = 5194F751 +Inner product checksum u = 6AE73411 +Inner product checksum mr1 = 3FC8CCB6 +Inner product checksum mr2 = 37A84524 +Inner product checksum mr3 = 3554C060 +Inner product checksum mr4 = 371CC668 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit.txt index 60fdd1bb0a..4ada8381bb 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48399774 -Inner product checksum theta = 5135493E -Inner product checksum u = 612F454A -Inner product checksum mr1 = 4090F564 -Inner product checksum mr2 = 35AC3C55 -Inner product checksum mr3 = 2FA5F7C0 -Inner product checksum mr4 = 33F4FD5A -Inner product checksum mr5 = BEDD43D +Inner product checksum rho = 48399770 +Inner product checksum theta = 51354940 +Inner product checksum u = 612F4542 +Inner product checksum mr1 = 4090F54C +Inner product checksum mr2 = 35C3F364 +Inner product checksum mr3 = 2FA60BA4 +Inner product checksum mr4 = 33F4FD75 +Inner product checksum mr5 = BEDF810 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit.txt index d70fddbee3..5fe1c15c27 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48399985 -Inner product checksum theta = 51354898 -Inner product checksum u = 612F4B6A -Inner product checksum mr1 = 40916361 -Inner product checksum mr2 = 3684D2A0 -Inner product checksum mr3 = 2FAD3D2F -Inner product checksum mr4 = 33F4FE0F -Inner product checksum mr5 = BF85CFF +Inner product checksum rho = 48399984 +Inner product checksum theta = 51354895 +Inner product checksum u = 612F4B57 +Inner product checksum mr1 = 40916515 +Inner product checksum mr2 = 366D1654 +Inner product checksum mr3 = 2FADB862 +Inner product checksum mr4 = 33F4FE2A +Inner product checksum mr5 = BF85E8A Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit.txt index 080a10a1b2..ce3e205b99 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48398C72 +Inner product checksum rho = 48398C6E Inner product checksum theta = 513542FA -Inner product checksum u = 612EE1C7 -Inner product checksum mr1 = 40910314 -Inner product checksum mr2 = 358600ED -Inner product checksum mr3 = 3000FB73 -Inner product checksum mr4 = 3404ABEC -Inner product checksum mr5 = C1462BB +Inner product checksum u = 612EE1C2 +Inner product checksum mr1 = 409102D0 +Inner product checksum mr2 = 3594D694 +Inner product checksum mr3 = 300120CE +Inner product checksum mr4 = 3404AC0D +Inner product checksum mr5 = C1462C1 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_azspice_gnu_fast-debug-32bit.txt index fc6c27dff6..1d94d93c4d 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 4830B0D5 -Inner product checksum theta = 513FD9B7 -Inner product checksum u = 5F75AC21 -Inner product checksum mr1 = 4155EA69 -Inner product checksum mr2 = 3B0A93A7 -Inner product checksum mr3 = 322E87FD +Inner product checksum rho = 4830B0C0 +Inner product checksum theta = 513FD9D8 +Inner product checksum u = 5F75A9E5 +Inner product checksum mr1 = 4155E778 +Inner product checksum mr2 = 3B0A16BC +Inner product checksum mr3 = 322098D2 Inner product checksum mr4 = 0 -Inner product checksum mr5 = 129DB13B +Inner product checksum mr5 = 11D1B075 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_thai_ben1-C48_MG_azspice_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_thai_ben1-C48_MG_azspice_gnu_fast-debug-32bit.txt index e13a3a0a69..56b2aa579c 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_thai_ben1-C48_MG_azspice_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/azspice/checksum_lfric_atm_thai_ben1-C48_MG_azspice_gnu_fast-debug-32bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 486B498C -Inner product checksum theta = 51CABEE9 -Inner product checksum u = 63C8EFF2 +Inner product checksum rho = 486B498A +Inner product checksum theta = 51CABEEC +Inner product checksum u = 63C8F168 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_aquaplanet-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_aquaplanet-C12_ex1a_cce_fast-debug-32bit.txt index 941784e7a3..655e961a04 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_aquaplanet-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_aquaplanet-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 468AD872 -Inner product checksum theta = 4FD6888D -Inner product checksum u = 6A4E36BF -Inner product checksum mr1 = 3F081516 -Inner product checksum mr2 = 368518F6 -Inner product checksum mr3 = 34231A59 -Inner product checksum mr4 = 3694DF48 +Inner product checksum rho = 468AD88B +Inner product checksum theta = 4FD68891 +Inner product checksum u = 6A4E3FE6 +Inner product checksum mr1 = 3F081138 +Inner product checksum mr2 = 36814668 +Inner product checksum mr3 = 3423B35E +Inner product checksum mr4 = 3699F136 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_camembert_case3_gj1214b-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_camembert_case3_gj1214b-C12_ex1a_cce_fast-debug-32bit.txt index 0cc7383b82..6c0b5c227f 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_camembert_case3_gj1214b-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_camembert_case3_gj1214b-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 44D95799 -Inner product checksum theta = 5504FC48 -Inner product checksum u = 74276F0C +Inner product checksum rho = 44D95798 +Inner product checksum theta = 5504FC4B +Inner product checksum u = 74276EE6 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9-C12_ex1a_cce_fast-debug-32bit.txt index 1815adb106..6b7a3c725f 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D553CA -Inner product checksum theta = 518ECEB5 -Inner product checksum u = 6AFAE9D8 -Inner product checksum mr1 = 3FE14B20 -Inner product checksum mr2 = 370F9D84 -Inner product checksum mr3 = 3523C677 -Inner product checksum mr4 = 3696A781 +Inner product checksum rho = 46D55274 +Inner product checksum theta = 518ED2E2 +Inner product checksum u = 6AFA3B19 +Inner product checksum mr1 = 3FE1EA3A +Inner product checksum mr2 = 370F5A12 +Inner product checksum mr3 = 35203E70 +Inner product checksum mr4 = 36ABE224 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt index aa9c625d7c..35a122a2ef 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D66E11 -Inner product checksum theta = 5193C464 -Inner product checksum u = 6B198006 -Inner product checksum mr1 = 3FCF858E -Inner product checksum mr2 = 373E2E9C -Inner product checksum mr3 = 3541A34C -Inner product checksum mr4 = 369B731D +Inner product checksum rho = 46D66DC9 +Inner product checksum theta = 5193C4C0 +Inner product checksum u = 6B1971C7 +Inner product checksum mr1 = 3FCF7E67 +Inner product checksum mr2 = 372516C5 +Inner product checksum mr3 = 3537D056 +Inner product checksum mr4 = 368F19D2 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt index 6bc6e52e57..c8d4d4e769 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D660E1 -Inner product checksum theta = 539A0A3B -Inner product checksum u = 6B127765 -Inner product checksum mr1 = 41CC3BE8 -Inner product checksum mr2 = 396B3CEF -Inner product checksum mr3 = 37C4C8DA -Inner product checksum mr4 = 394747CD +Inner product checksum rho = 48D660E9 +Inner product checksum theta = 539A0A3E +Inner product checksum u = 6B1276EB +Inner product checksum mr1 = 41CC3CC4 +Inner product checksum mr2 = 396D8D8A +Inner product checksum mr3 = 37C04425 +Inner product checksum mr4 = 394634F8 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt index e0ac3a7f47..de2879363c 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D66D86 -Inner product checksum theta = 5193C44E -Inner product checksum u = 6B1966B5 -Inner product checksum mr1 = 3FCF8519 -Inner product checksum mr2 = 371FDDA6 -Inner product checksum mr3 = 35361069 -Inner product checksum mr4 = 368EFCD2 +Inner product checksum rho = 46D66D8E +Inner product checksum theta = 5193C3F6 +Inner product checksum u = 6B198E46 +Inner product checksum mr1 = 3FCF7844 +Inner product checksum mr2 = 372CD886 +Inner product checksum mr3 = 3544F278 +Inner product checksum mr4 = 36A1BCC7 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt index a7b72cb03a..6cd41c2b7e 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D660F4 -Inner product checksum theta = 539A0A42 -Inner product checksum u = 6B12765E -Inner product checksum mr1 = 41CC3E3B -Inner product checksum mr2 = 396BFB5A -Inner product checksum mr3 = 37C92E26 -Inner product checksum mr4 = 394763A2 +Inner product checksum rho = 48D660F5 +Inner product checksum theta = 539A0A3E +Inner product checksum u = 6B12773F +Inner product checksum mr1 = 41CC3CC4 +Inner product checksum mr2 = 39696F54 +Inner product checksum mr3 = 37C119AE +Inner product checksum mr4 = 3946F860 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt index 9309f7da94..cec3f5904b 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D660F6 -Inner product checksum theta = 539A0A3C -Inner product checksum u = 6B12774C -Inner product checksum mr1 = 41CC3A36 -Inner product checksum mr2 = 3966A9D6 -Inner product checksum mr3 = 37C15DC4 -Inner product checksum mr4 = 3946083E +Inner product checksum rho = 48D660EF +Inner product checksum theta = 539A0A3E +Inner product checksum u = 6B12773F +Inner product checksum mr1 = 41CC3C8B +Inner product checksum mr2 = 396BD5BA +Inner product checksum mr3 = 37C302CC +Inner product checksum mr4 = 39479EEB Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem-C12_ex1a_cce_fast-debug-32bit.txt index 578ea2b9fd..14b647ec26 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D55581 -Inner product checksum theta = 518ED2B5 -Inner product checksum u = 6AFB3227 -Inner product checksum mr1 = 3FE17762 -Inner product checksum mr2 = 3720F9CA -Inner product checksum mr3 = 35365C5C -Inner product checksum mr4 = 3690D5BE +Inner product checksum rho = 46D55957 +Inner product checksum theta = 518ED43E +Inner product checksum u = 6AFAA786 +Inner product checksum mr1 = 3FE19092 +Inner product checksum mr2 = 3727057C +Inner product checksum mr3 = 3523F007 +Inner product checksum mr4 = 36AAAEE3 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_1T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_1T-C12_ex1a_cce_fast-debug-32bit.txt index 20dff69335..eef2c72030 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_1T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_1T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D66D70 -Inner product checksum theta = 5193C3A6 -Inner product checksum u = 6B19E468 -Inner product checksum mr1 = 3FCF95B4 -Inner product checksum mr2 = 3739CE4A -Inner product checksum mr3 = 354B9996 -Inner product checksum mr4 = 369EF6F8 +Inner product checksum rho = 46D66DA8 +Inner product checksum theta = 5193C3B6 +Inner product checksum u = 6B19FBA5 +Inner product checksum mr1 = 3FCF8916 +Inner product checksum mr2 = 37412BE8 +Inner product checksum mr3 = 3541820C +Inner product checksum mr4 = 36942484 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_2T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_2T-C12_ex1a_cce_fast-debug-32bit.txt index ea9d93b3d5..12ce35a878 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_2T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_chem_2T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D66E4F -Inner product checksum theta = 5193C380 -Inner product checksum u = 6B1A173A -Inner product checksum mr1 = 3FCF734B -Inner product checksum mr2 = 372C9D8C -Inner product checksum mr3 = 353F4872 -Inner product checksum mr4 = 36A0B05A +Inner product checksum rho = 46D66D6C +Inner product checksum theta = 5193C35D +Inner product checksum u = 6B1A1692 +Inner product checksum mr1 = 3FCF9D0B +Inner product checksum mr2 = 37338CBE +Inner product checksum mr3 = 35478BFA +Inner product checksum mr4 = 3699DDFA Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt index c304b6b97b..a07e601957 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_clim_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D685A1 -Inner product checksum theta = 519A8C20 -Inner product checksum u = 6B2FD256 -Inner product checksum mr1 = 3FCB8241 -Inner product checksum mr2 = 374BE688 -Inner product checksum mr3 = 35D85CAE -Inner product checksum mr4 = 379FE0E5 +Inner product checksum rho = 46D685B2 +Inner product checksum theta = 519A8C21 +Inner product checksum u = 6B2FD454 +Inner product checksum mr1 = 3FCB846A +Inner product checksum mr2 = 37443A28 +Inner product checksum mr3 = 35D69FC4 +Inner product checksum mr4 = 37A0BBCB Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_comp_tran_ref_3d_l120-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_comp_tran_ref_3d_l120-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt index 8ed3079800..1674785c76 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_comp_tran_ref_3d_l120-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_comp_tran_ref_3d_l120-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 489A8583 -Inner product checksum theta = 51BA4F75 -Inner product checksum u = 5F119331 -Inner product checksum mr1 = 4187D366 -Inner product checksum mr2 = 3B04531F -Inner product checksum mr3 = 3502CD19 +Inner product checksum rho = 489A8527 +Inner product checksum theta = 51BA4F11 +Inner product checksum u = 5F117E49 +Inner product checksum mr1 = 4188715E +Inner product checksum mr2 = 3AEC1F3E +Inner product checksum mr3 = 34D968B8 Inner product checksum mr4 = 0 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_hd209458b-C24_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_hd209458b-C24_ex1a_cce_fast-debug-32bit.txt index e519db0ddf..f9cd6734d3 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_hd209458b-C24_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_hd209458b-C24_ex1a_cce_fast-debug-32bit.txt @@ -1,3 +1,3 @@ Inner product checksum rho = 4798D97E -Inner product checksum theta = 5840677A -Inner product checksum u = 79B9E883 +Inner product checksum theta = 5840677C +Inner product checksum u = 79B9EA0E diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_casim-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_casim-C12_ex1a_cce_fast-debug-32bit.txt index be1a31281d..8d560af3fe 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_casim-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_casim-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D8710C -Inner product checksum theta = 518CD914 -Inner product checksum u = 6A8AFB8B -Inner product checksum mr1 = 3FCD851A -Inner product checksum mr2 = 3827840A -Inner product checksum mr3 = 356DE64E -Inner product checksum mr4 = 3697321A -Inner product checksum mr5 = 2E218564 -Inner product checksum mr6 = 35597E65 +Inner product checksum rho = 46D87457 +Inner product checksum theta = 518CD82D +Inner product checksum u = 6A8AD17E +Inner product checksum mr1 = 3FCD7225 +Inner product checksum mr2 = 382CD4AD +Inner product checksum mr3 = 356145D2 +Inner product checksum mr4 = 3691FD8A +Inner product checksum mr5 = 2D0C9934 +Inner product checksum mr6 = 358BE696 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_coma9-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_coma9-C12_ex1a_cce_fast-debug-32bit.txt index c4a03fd2a8..6fa5111806 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_coma9-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_coma9-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D8692A -Inner product checksum theta = 518CDF94 -Inner product checksum u = 6A87F56D -Inner product checksum mr1 = 3FD0988D -Inner product checksum mr2 = 37E807AE -Inner product checksum mr3 = 37940152 -Inner product checksum mr4 = 379E9EA4 -Inner product checksum mr5 = 36AD8928 +Inner product checksum rho = 46D86854 +Inner product checksum theta = 518CDA30 +Inner product checksum u = 6A880AE8 +Inner product checksum mr1 = 3FD01054 +Inner product checksum mr2 = 37F9520E +Inner product checksum mr3 = 37A469E8 +Inner product checksum mr4 = 37A4DA2B +Inner product checksum mr5 = 36B6E215 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_dev-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_dev-C12_ex1a_cce_fast-debug-32bit.txt index b829f48f9d..16c802a464 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_dev-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_dev-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D85982 -Inner product checksum theta = 518CE388 -Inner product checksum u = 6A86EBB7 -Inner product checksum mr1 = 3FD1F86B -Inner product checksum mr2 = 37E77034 -Inner product checksum mr3 = 37817C8E -Inner product checksum mr4 = 37C0B965 -Inner product checksum mr5 = 36A437DA +Inner product checksum rho = 46D85716 +Inner product checksum theta = 518CE3EB +Inner product checksum u = 6A87A050 +Inner product checksum mr1 = 3FD18E3B +Inner product checksum mr2 = 37E70FE4 +Inner product checksum mr3 = 379D5901 +Inner product checksum mr4 = 37D15BD1 +Inner product checksum mr5 = 36CAFEA9 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_tb-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_tb-C12_ex1a_cce_fast-debug-32bit.txt index 26eff6ad86..b49491cdae 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_tb-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_comorph_tb-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D87623 -Inner product checksum theta = 518CE954 -Inner product checksum u = 6A84C677 -Inner product checksum mr1 = 3FCEBC3D -Inner product checksum mr2 = 37ECEE7D -Inner product checksum mr3 = 37943DBB -Inner product checksum mr4 = 3761CF82 -Inner product checksum mr5 = 35FC2E2C +Inner product checksum rho = 46D8762E +Inner product checksum theta = 518CE71C +Inner product checksum u = 6A84EDDF +Inner product checksum mr1 = 3FCE70A4 +Inner product checksum mr2 = 37E2D11E +Inner product checksum mr3 = 378AF921 +Inner product checksum mr4 = 37739952 +Inner product checksum mr5 = 361B9810 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-32bit.txt index 99cb6e9cfd..6d3e508500 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D85C5F -Inner product checksum theta = 518CDBDC -Inner product checksum u = 6A888B76 -Inner product checksum mr1 = 3FD08F0A -Inner product checksum mr2 = 37C3A28B -Inner product checksum mr3 = 358A0008 -Inner product checksum mr4 = 37034B0F +Inner product checksum rho = 46D85A7A +Inner product checksum theta = 518CDA4E +Inner product checksum u = 6A88628E +Inner product checksum mr1 = 3FD0804E +Inner product checksum mr2 = 37CAD0EC +Inner product checksum mr3 = 35B5CA8E +Inner product checksum mr4 = 36FE42E1 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-64bit.txt index fe0b07d47d..9846fe7404 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 40DB0B6B20E5C6E6 -Inner product checksum theta = 42319B6FA216915F -Inner product checksum u = 45512B02DB0B791A -Inner product checksum mr1 = 3FFA128EBA815383 -Inner product checksum mr2 = 3EF832568341E28E -Inner product checksum mr3 = 3EB297E4E4BB34AC -Inner product checksum mr4 = 3EE1D60B2F4EB2A3 +Inner product checksum rho = 40DB0B4776664F6A +Inner product checksum theta = 42319B3DF20AF765 +Inner product checksum u = 455125C600439CD0 +Inner product checksum mr1 = 3FFA105BC459DDA0 +Inner product checksum mr2 = 3EF7CE896B081428 +Inner product checksum mr3 = 3EB1BD58158773D7 +Inner product checksum mr4 = 3EE40977D90D9295 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C48_MG_ex1a_cce_fast-debug-32bit.txt index ba79d7fde3..f34ab665a8 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D802A2 -Inner product checksum theta = 5392FAEE -Inner product checksum u = 6A97BE98 -Inner product checksum mr1 = 41CD11B6 -Inner product checksum mr2 = 39D29CF4 -Inner product checksum mr3 = 37ABEABC -Inner product checksum mr4 = 395797DC +Inner product checksum rho = 48D80285 +Inner product checksum theta = 5392FAF4 +Inner product checksum u = 6A97C4A8 +Inner product checksum mr1 = 41CD0850 +Inner product checksum mr2 = 39CF5ACB +Inner product checksum mr3 = 37ABBAB4 +Inner product checksum mr4 = 395D5B5F Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-pert-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-pert-C12_ex1a_cce_fast-debug-32bit.txt index 59f98ffff9..c3aab6a790 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-pert-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9-pert-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D830AF -Inner product checksum theta = 51946D1A -Inner product checksum u = 6B12D2F4 -Inner product checksum mr1 = 3FC8D569 -Inner product checksum mr2 = 379F7E86 -Inner product checksum mr3 = 358B6A7C -Inner product checksum mr4 = 3792104C +Inner product checksum rho = 46D830A1 +Inner product checksum theta = 51946D16 +Inner product checksum u = 6B12D29A +Inner product checksum mr1 = 3FC8D134 +Inner product checksum mr2 = 37A41782 +Inner product checksum mr3 = 358F0DAC +Inner product checksum mr4 = 378F46FC Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt index e485be1736..8b9020e02d 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D813F2 -Inner product checksum theta = 518FB71F -Inner product checksum u = 6AF7C2FE -Inner product checksum mr1 = 3FCC0E8A -Inner product checksum mr2 = 37AE6078 -Inner product checksum mr3 = 34A914FC -Inner product checksum mr4 = 36D07B9B +Inner product checksum rho = 46D813E3 +Inner product checksum theta = 518FB73C +Inner product checksum u = 6AF78396 +Inner product checksum mr1 = 3FCC0740 +Inner product checksum mr2 = 37B0EDC0 +Inner product checksum mr3 = 34A0041B +Inner product checksum mr4 = 36DAA736 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt index ba79d7fde3..f34ab665a8 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_1T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D802A2 -Inner product checksum theta = 5392FAEE -Inner product checksum u = 6A97BE98 -Inner product checksum mr1 = 41CD11B6 -Inner product checksum mr2 = 39D29CF4 -Inner product checksum mr3 = 37ABEABC -Inner product checksum mr4 = 395797DC +Inner product checksum rho = 48D80285 +Inner product checksum theta = 5392FAF4 +Inner product checksum u = 6A97C4A8 +Inner product checksum mr1 = 41CD0850 +Inner product checksum mr2 = 39CF5ACB +Inner product checksum mr3 = 37ABBAB4 +Inner product checksum mr4 = 395D5B5F Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt index ebad551374..974b5831ab 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D81424 -Inner product checksum theta = 518FB734 -Inner product checksum u = 6AF79FAB -Inner product checksum mr1 = 3FCC17AC -Inner product checksum mr2 = 37AE9140 -Inner product checksum mr3 = 349255F8 -Inner product checksum mr4 = 36CFEC88 +Inner product checksum rho = 46D813CB +Inner product checksum theta = 518FB74E +Inner product checksum u = 6AF7859C +Inner product checksum mr1 = 3FCC0248 +Inner product checksum mr2 = 37AE3736 +Inner product checksum mr3 = 3494E54A +Inner product checksum mr4 = 36D281A2 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt index 9d3752b0a7..191cd99f5d 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D8027C -Inner product checksum theta = 5392FAE8 -Inner product checksum u = 6A97C83E -Inner product checksum mr1 = 41CD0E2D -Inner product checksum mr2 = 39CF4B62 -Inner product checksum mr3 = 37AED380 -Inner product checksum mr4 = 395C2AA8 +Inner product checksum rho = 48D80298 +Inner product checksum theta = 5392FAE6 +Inner product checksum u = 6A97C1B0 +Inner product checksum mr1 = 41CD0628 +Inner product checksum mr2 = 39CE5E57 +Inner product checksum mr3 = 37A8AEB5 +Inner product checksum mr4 = 395B4D79 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_full-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_full-debug-32bit.txt index 7f1e51d433..e60f20c2bc 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_2T-C48_MG_ex1a_cce_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D801A6 -Inner product checksum theta = 5392FB09 -Inner product checksum u = 6A97BA3E -Inner product checksum mr1 = 41CD0CA7 -Inner product checksum mr2 = 39CB19BA -Inner product checksum mr3 = 37A9F1CA -Inner product checksum mr4 = 395853D0 +Inner product checksum rho = 48D801A1 +Inner product checksum theta = 5392FB04 +Inner product checksum u = 6A97BD04 +Inner product checksum mr1 = 41CD102C +Inner product checksum mr2 = 39CD36B2 +Inner product checksum mr3 = 37A70DD6 +Inner product checksum mr4 = 3959407E Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt index c2e697ee79..bef733b44c 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_4T-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D802A2 -Inner product checksum theta = 5392FB04 -Inner product checksum u = 6A97BC6C -Inner product checksum mr1 = 41CD1036 -Inner product checksum mr2 = 39CE3BA5 -Inner product checksum mr3 = 37AC6552 -Inner product checksum mr4 = 3957937E +Inner product checksum rho = 48D802BE +Inner product checksum theta = 5392FAF2 +Inner product checksum u = 6A97BFD6 +Inner product checksum mr1 = 41CD1464 +Inner product checksum mr2 = 39CF2EDF +Inner product checksum mr3 = 37ABE262 +Inner product checksum mr4 = 3957E9A0 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_ex1a_cce_fast-debug-32bit.txt index edfe0be655..fae1ff2458 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ Inner product checksum rho = 48D8031D -Inner product checksum theta = 5392FB13 -Inner product checksum u = 6A97C2A5 -Inner product checksum mr1 = 41CD07A8 -Inner product checksum mr2 = 39CFD168 -Inner product checksum mr3 = 37AB6032 -Inner product checksum mr4 = 3958F610 +Inner product checksum theta = 5392FB26 +Inner product checksum u = 6A97BDB4 +Inner product checksum mr1 = 41CD04A9 +Inner product checksum mr2 = 39D0EBA2 +Inner product checksum mr3 = 37A8F67A +Inner product checksum mr4 = 395BAAE1 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_cce_fast-debug-32bit.txt index 1e37c7be49..fb96dde547 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D80106 -Inner product checksum theta = 5392FB2E -Inner product checksum u = 6A97BF93 -Inner product checksum mr1 = 41CCE6F0 -Inner product checksum mr2 = 39D2731B -Inner product checksum mr3 = 37A94579 -Inner product checksum mr4 = 39714EC6 +Inner product checksum rho = 48D80118 +Inner product checksum theta = 5392FB33 +Inner product checksum u = 6A97BFD0 +Inner product checksum mr1 = 41CCE786 +Inner product checksum mr2 = 39CEAEC2 +Inner product checksum mr3 = 37B3577E +Inner product checksum mr4 = 396FFCD0 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_gnu_fast-debug-32bit.txt index 1a865c06cf..3d33a1e6d8 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_coarse_aero_threaded-C48_MG_ex1a_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D8000F -Inner product checksum theta = 5392FB21 -Inner product checksum u = 6A97B84A -Inner product checksum mr1 = 41CCE7B3 -Inner product checksum mr2 = 39D0975E -Inner product checksum mr3 = 37A94691 -Inner product checksum mr4 = 396E515C +Inner product checksum rho = 48D7FFBB +Inner product checksum theta = 5392FB2B +Inner product checksum u = 6A97B372 +Inner product checksum mr1 = 41CCE94C +Inner product checksum mr2 = 39D3E690 +Inner product checksum mr3 = 37ADA641 +Inner product checksum mr4 = 396E46F6 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_da-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_da-C12_ex1a_cce_fast-debug-32bit.txt index 1420b16ba3..1e851f77e8 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_da-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_da-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D8216E -Inner product checksum theta = 518A762E -Inner product checksum u = 6A8CF11F -Inner product checksum mr1 = 3FD4046A -Inner product checksum mr2 = 37BF14E4 -Inner product checksum mr3 = 35A66CBD -Inner product checksum mr4 = 3702B356 +Inner product checksum rho = 46D82378 +Inner product checksum theta = 518A7746 +Inner product checksum u = 6A8CF0E4 +Inner product checksum mr1 = 3FD3F2D7 +Inner product checksum mr2 = 37C4DFE6 +Inner product checksum mr3 = 359BC4F7 +Inner product checksum mr4 = 36BE7CF2 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C12_ex1a_cce_full-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C12_ex1a_cce_full-debug-32bit.txt index 10557ee538..8f8c6ed88f 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C12_ex1a_cce_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C12_ex1a_cce_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D824C3 -Inner product checksum theta = 5195283B -Inner product checksum u = 6AD01B5F -Inner product checksum mr1 = 3FC894B8 -Inner product checksum mr2 = 37AFCAFA -Inner product checksum mr3 = 3520B790 -Inner product checksum mr4 = 36A0BEC3 +Inner product checksum rho = 46D824B4 +Inner product checksum theta = 5195283A +Inner product checksum u = 6AD01BC8 +Inner product checksum mr1 = 3FC891C2 +Inner product checksum mr2 = 37AFE748 +Inner product checksum mr3 = 351FE074 +Inner product checksum mr4 = 36A0A594 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C48_MG_ex1a_cce_full-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C48_MG_ex1a_cce_full-debug-32bit.txt index c2ca2273d3..e21b170192 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C48_MG_ex1a_cce_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_debug-C48_MG_ex1a_cce_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48D81C6A -Inner product checksum theta = 53952785 -Inner product checksum u = 6AA47DEC -Inner product checksum mr1 = 41C845DD -Inner product checksum mr2 = 3999D1AC -Inner product checksum mr3 = 377ACE28 -Inner product checksum mr4 = 392E3B81 +Inner product checksum rho = 48D81C6B +Inner product checksum theta = 53952784 +Inner product checksum u = 6AA47E12 +Inner product checksum mr1 = 41C845A7 +Inner product checksum mr2 = 399A11FA +Inner product checksum mr3 = 377B8DB0 +Inner product checksum mr4 = 392DF18F Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda-C12_ex1a_cce_fast-debug-32bit.txt index 78bb876a0a..ca30df405a 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82302 -Inner product checksum theta = 518A5565 -Inner product checksum u = 6A906F5F -Inner product checksum mr1 = 3FD0FD62 -Inner product checksum mr2 = 37E31AEA -Inner product checksum mr3 = 35A29AA7 -Inner product checksum mr4 = 36FC0A34 +Inner product checksum rho = 46D824D5 +Inner product checksum theta = 518A58FE +Inner product checksum u = 6A8FA266 +Inner product checksum mr1 = 3FD0FABF +Inner product checksum mr2 = 37DF0408 +Inner product checksum mr3 = 35934D12 +Inner product checksum mr4 = 36DB0C0F Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda_jada-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda_jada-C12_ex1a_cce_fast-debug-32bit.txt index d5cb4ee56c..9413419807 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda_jada-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_eda_jada-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82272 -Inner product checksum theta = 518A76EA -Inner product checksum u = 6A8CA7C6 -Inner product checksum mr1 = 3FD3D711 -Inner product checksum mr2 = 37B76C73 -Inner product checksum mr3 = 35A34C22 -Inner product checksum mr4 = 36DDD026 +Inner product checksum rho = 46D823E0 +Inner product checksum theta = 518A746A +Inner product checksum u = 6A8CB63A +Inner product checksum mr1 = 3FD3BF55 +Inner product checksum mr2 = 37C80188 +Inner product checksum mr3 = 35AC1B1E +Inner product checksum mr4 = 36C9CBE5 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_mol-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_mol-C12_ex1a_cce_fast-debug-32bit.txt index 8eff44da85..cb1ace9942 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_mol-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_mol-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D85F86 -Inner product checksum theta = 5193AFF4 -Inner product checksum u = 6A85CBD0 -Inner product checksum mr1 = 3FD062C8 -Inner product checksum mr2 = 37A81340 -Inner product checksum mr3 = 352DDFB0 -Inner product checksum mr4 = 36CCECD8 +Inner product checksum rho = 46D85EFA +Inner product checksum theta = 5193AF3C +Inner product checksum u = 6A85AF02 +Inner product checksum mr1 = 3FD06E90 +Inner product checksum mr2 = 37AA76C2 +Inner product checksum mr3 = 354E9EF8 +Inner product checksum mr4 = 36E2CB5C Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt index b63e7d9c44..3b295fed30 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_nwp_gal9_short-C12_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 46D82C2E +Inner product checksum rho = 46D82C30 Inner product checksum theta = 5194F74C -Inner product checksum u = 6AE739DF -Inner product checksum mr1 = 3FC8CA52 -Inner product checksum mr2 = 37A43F02 -Inner product checksum mr3 = 35571D4E -Inner product checksum mr4 = 371F5600 +Inner product checksum u = 6AE739F6 +Inner product checksum mr1 = 3FC8CADE +Inner product checksum mr2 = 37A36C68 +Inner product checksum mr3 = 3559050E +Inner product checksum mr4 = 371F663E Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit.txt index 1d1d7b6f1b..63b9524565 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 483997B2 -Inner product checksum theta = 51354962 -Inner product checksum u = 612F4912 -Inner product checksum mr1 = 4090FC04 -Inner product checksum mr2 = 35B167C4 -Inner product checksum mr3 = 2FA645AF -Inner product checksum mr4 = 33F4FE48 -Inner product checksum mr5 = BECFC33 +Inner product checksum rho = 483997BE +Inner product checksum theta = 51354960 +Inner product checksum u = 612F490B +Inner product checksum mr1 = 4090FAF4 +Inner product checksum mr2 = 35AC3186 +Inner product checksum mr3 = 2FA673FD +Inner product checksum mr4 = 33F4FE5A +Inner product checksum mr5 = BECD17B Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit.txt index d02beb6cb8..fbacc8606a 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 483997E0 +Inner product checksum rho = 483997DE Inner product checksum theta = 5135494E -Inner product checksum u = 612F4984 -Inner product checksum mr1 = 409110E8 -Inner product checksum mr2 = 35E540AB -Inner product checksum mr3 = 2FA98AF3 -Inner product checksum mr4 = 33F4FF5D -Inner product checksum mr5 = BF18191 +Inner product checksum u = 612F4983 +Inner product checksum mr1 = 4091105C +Inner product checksum mr2 = 35F5D644 +Inner product checksum mr3 = 2FA90FC5 +Inner product checksum mr4 = 33F4FF78 +Inner product checksum mr5 = BF1836E Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit.txt index 4a1ddd9a11..33924f856f 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 48398C6B +Inner product checksum rho = 48398C6A Inner product checksum theta = 51354302 -Inner product checksum u = 612EDCBC -Inner product checksum mr1 = 40910380 -Inner product checksum mr2 = 358489D6 -Inner product checksum mr3 = 3000F2CD -Inner product checksum mr4 = 3404AC27 -Inner product checksum mr5 = C14A272 +Inner product checksum u = 612EDCC2 +Inner product checksum mr1 = 409102F0 +Inner product checksum mr2 = 359C7095 +Inner product checksum mr3 = 3001059E +Inner product checksum mr4 = 3404AC2B +Inner product checksum mr5 = C14A271 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt index 848c845d97..9d8672e61f 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_rce-BiP64x64-1500x1500_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 4830B141 -Inner product checksum theta = 513FD93C -Inner product checksum u = 5F75B6A3 -Inner product checksum mr1 = 41561642 -Inner product checksum mr2 = 3B0861F6 -Inner product checksum mr3 = 3218ADCF +Inner product checksum rho = 4830B131 +Inner product checksum theta = 513FD941 +Inner product checksum u = 5F75B504 +Inner product checksum mr1 = 41560D37 +Inner product checksum mr2 = 3B090D74 +Inner product checksum mr3 = 32041A27 Inner product checksum mr4 = 0 -Inner product checksum mr5 = FB01098 +Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_thai_ben1-C48_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_thai_ben1-C48_MG_ex1a_cce_fast-debug-32bit.txt index 89124bde7d..caaa0094bc 100644 --- a/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_thai_ben1-C48_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/lfric_atm/ex1a/checksum_lfric_atm_thai_ben1-C48_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 486B4991 -Inner product checksum theta = 51CABEA1 -Inner product checksum u = 63C8D90F +Inner product checksum rho = 486B4990 +Inner product checksum theta = 51CABEA0 +Inner product checksum u = 63C8D8F9 diff --git a/rose-stem/site/meto/kgos/lfric_coupled/ex1a/checksum_lfric_coupled_nwp_gal9-C48_ex1a_cce_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/lfric_coupled/ex1a/checksum_lfric_coupled_nwp_gal9-C48_ex1a_cce_fast-debug-64bit.txt index e87a088567..b16dbfbc88 100644 --- a/rose-stem/site/meto/kgos/lfric_coupled/ex1a/checksum_lfric_coupled_nwp_gal9-C48_ex1a_cce_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/lfric_coupled/ex1a/checksum_lfric_coupled_nwp_gal9-C48_ex1a_cce_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 411B54EDFE88F36B -Inner product checksum theta = 42735B55E4723BB2 -Inner product checksum u = 456F12D1620AF46E -Inner product checksum mr1 = 403682F9FA8D2FF2 -Inner product checksum mr2 = 3F3F4DCDD3CCEC28 -Inner product checksum mr3 = 3F035046D05A7507 -Inner product checksum mr4 = 3F36F51E48AE691E +Inner product checksum rho = 411B54F3402B831A +Inner product checksum theta = 42735B571287C56A +Inner product checksum u = 456F1345F492410E +Inner product checksum mr1 = 403683FC490F50DB +Inner product checksum mr2 = 3F3F8BCE74D4EB8A +Inner product checksum mr3 = 3F03C29104089F47 +Inner product checksum mr4 = 3F37094D8F9E5909 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301-C24_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301-C24_azspice_gnu_fast-debug-64bit.txt index cf7cbc9777..d83c47477f 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301-C24_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301-C24_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3F2021022E9473F8 -Inner product checksum theta = 403304F06107797C -Inner product checksum u = 4330546F942A01BE +Inner product checksum rho = 3F2021022E2553C6 +Inner product checksum theta = 403304F060222FF7 +Inner product checksum u = 4330546F920A29CA diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301_ffsl-C24_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301_ffsl-C24_azspice_gnu_fast-debug-64bit.txt index 64697308e5..4e2562e938 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301_ffsl-C24_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_dcmip301_ffsl-C24_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3F206E3D410FBAA1 -Inner product checksum theta = 40336C44D1223058 -Inner product checksum u = 43315AD096E775C8 +Inner product checksum rho = 3F206E3D4B399D51 +Inner product checksum theta = 40336C44DED93EA5 +Inner product checksum u = 43315AD0A2179BA6 diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt index 43c97c4f2b..9f909347a6 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537DCC473EB48 -Inner product checksum theta = 4160EF697C82ED27 -Inner product checksum u = 4568491D5968F75F -Inner product checksum mr1 = 3F35AA30FD4C4FB5 -Inner product checksum mr2 = 3EEB2DAAAD17372C -Inner product checksum mr3 = 3EDF8ABA9DA4878C -Inner product checksum mr4 = 3EED80026CE7EF00 +Inner product checksum rho = 3FA537DE82CA41B6 +Inner product checksum theta = 4160EF68004A5B80 +Inner product checksum u = 4568491CCF78631B +Inner product checksum mr1 = 3F35AA32EF0F3D92 +Inner product checksum mr2 = 3EEB2DAAA36811F1 +Inner product checksum mr3 = 3EDF8ABAACBB484D +Inner product checksum mr4 = 3EED800243D7C675 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_production-32bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_production-32bit.txt index 9d7303b994..45fbc3f141 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_production-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9-C12_MG_azspice_gnu_production-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3D29E551 -Inner product checksum theta = 4B07799F -Inner product checksum u = 6B424688 -Inner product checksum mr1 = 39AD6323 -Inner product checksum mr2 = 375955A6 -Inner product checksum mr3 = 36FC52AC -Inner product checksum mr4 = 376C1B8F +Inner product checksum rho = 3D29E55E +Inner product checksum theta = 4B077999 +Inner product checksum u = 6B424674 +Inner product checksum mr1 = 39AD62A0 +Inner product checksum mr2 = 375955A3 +Inner product checksum mr3 = 36FC52A9 +Inner product checksum mr4 = 376C1B91 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_ffsl-C12_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_ffsl-C12_MG_azspice_gnu_fast-debug-64bit.txt index b8b7b70549..bfdf51b110 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_ffsl-C12_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_ffsl-C12_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FB39A87256EFBA4 -Inner product checksum theta = 4178F73E0895947C -Inner product checksum u = 4575A243D6EF5308 -Inner product checksum mr1 = 3F971B941E744F40 -Inner product checksum mr2 = 3F73B22CD9690E0F -Inner product checksum mr3 = 3EF2330E82B700E8 -Inner product checksum mr4 = 3EF2D46607B02008 +Inner product checksum rho = 3FB39A8202AF0879 +Inner product checksum theta = 4178F73E75B86936 +Inner product checksum u = 4575A243C2E3ACF1 +Inner product checksum mr1 = 3F971B8137FE940A +Inner product checksum mr2 = 3F73B22CDDF6DE79 +Inner product checksum mr3 = 3EF2330E85843473 +Inner product checksum mr4 = 3EF2D465F6CE7F01 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_random-C12_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_random-C12_MG_azspice_gnu_fast-debug-64bit.txt index 5c661f3746..96bf52a3e0 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_random-C12_MG_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_nwp_gal9_random-C12_MG_azspice_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 40B0960E77FDB63E -Inner product checksum theta = 43076FC8D77B7828 -Inner product checksum u = 4697A25B1548C862 -Inner product checksum mr1 = 40887EB179AFBF30 -Inner product checksum mr2 = 4069AB3CD24731A6 -Inner product checksum mr3 = 4069B44AEB7106DE -Inner product checksum mr4 = 406997D0AB3EBB36 +Inner product checksum rho = 40B0960D6B965E72 +Inner product checksum theta = 43076FC8D53DA585 +Inner product checksum u = 4697A25AEBBE10C8 +Inner product checksum mr1 = 40887EB19E6CE334 +Inner product checksum mr2 = 4069AB3CD25E4D67 +Inner product checksum mr3 = 4069B44AEB678E79 +Inner product checksum mr4 = 406997D0AB656036 Inner product checksum mr5 = 406997D0C9B8EEFB Inner product checksum mr6 = 40699547929283AC diff --git a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_semi-implicit-C12_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_semi-implicit-C12_azspice_gnu_fast-debug-64bit.txt index ccff50b5cc..2667877aa7 100644 --- a/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_semi-implicit-C12_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/azspice/checksum_linear_model_semi-implicit-C12_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3EED280BC777A4B6 -Inner product checksum theta = 4012F415A1A374C6 -Inner product checksum u = 43A4936A5FD712E3 +Inner product checksum rho = 3EED280BC776D4BA +Inner product checksum theta = 4012F415A1A2BA54 +Inner product checksum u = 43A4936A5FC310DB diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301-C24_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301-C24_ex1a_gnu_fast-debug-64bit.txt index e822c5ea41..a691b82170 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301-C24_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301-C24_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3F2021022E95673E -Inner product checksum theta = 403304F060F62B7A -Inner product checksum u = 4330546F9440888A +Inner product checksum rho = 3F2021022E2A0954 +Inner product checksum theta = 403304F060030645 +Inner product checksum u = 4330546F92125085 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301_ffsl-C24_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301_ffsl-C24_ex1a_gnu_fast-debug-64bit.txt index f5ab1ef336..e24af3032d 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301_ffsl-C24_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_dcmip301_ffsl-C24_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3F206E54AEF5C1B3 -Inner product checksum theta = 40336C41A6DDB3BE -Inner product checksum u = 43315AD6E24E5839 +Inner product checksum rho = 3F206E54BA3B2DB9 +Inner product checksum theta = 40336C41B5AF0BA8 +Inner product checksum u = 43315AD6ED894FA8 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-32bit.txt index f7461c8022..201048d689 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3D298D17 +Inner product checksum rho = 3D298D3A Inner product checksum theta = 4B077B02 -Inner product checksum u = 6B424907 -Inner product checksum mr1 = 39AD50BE -Inner product checksum mr2 = 3759683D -Inner product checksum mr3 = 36FC6E24 +Inner product checksum u = 6B42490A +Inner product checksum mr1 = 39AD5108 +Inner product checksum mr2 = 3759683C +Inner product checksum mr3 = 36FC6E26 Inner product checksum mr4 = 376C19BA Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt index 7635468a7a..58b6dbe1f0 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537D9C9AB1034 -Inner product checksum theta = 4160EF68C915C480 -Inner product checksum u = 4568491D8777F386 -Inner product checksum mr1 = 3F35AA3064936BAC -Inner product checksum mr2 = 3EEB2DAAB78C39BC -Inner product checksum mr3 = 3EDF8ABAADA84B14 -Inner product checksum mr4 = 3EED80023CF4F41C +Inner product checksum rho = 3FA537DA27319ECF +Inner product checksum theta = 4160EF67B0B11982 +Inner product checksum u = 4568491BD0940922 +Inner product checksum mr1 = 3F35AA369C54BDA9 +Inner product checksum mr2 = 3EEB2DAAFE794C5E +Inner product checksum mr3 = 3EDF8ABAA7C326A2 +Inner product checksum mr4 = 3EED8002A3A271BA Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-32bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-32bit.txt index c32af3dde2..2c23406545 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3D29A22D -Inner product checksum theta = 4B077A6B -Inner product checksum u = 6B424806 -Inner product checksum mr1 = 39AD4AC3 -Inner product checksum mr2 = 37598B7C +Inner product checksum rho = 3D29A238 +Inner product checksum theta = 4B077A6D +Inner product checksum u = 6B424810 +Inner product checksum mr1 = 39AD4A8A +Inner product checksum mr2 = 37598B78 Inner product checksum mr3 = 36FCA1F0 -Inner product checksum mr4 = 376C05E6 +Inner product checksum mr4 = 376C05E0 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-64bit.txt index dcbc8e73db..5f4ada612f 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_cce_production-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537DD5A0F065E -Inner product checksum theta = 4160EF69DC7C3D9C -Inner product checksum u = 4568491E4EC14145 -Inner product checksum mr1 = 3F35AA25645F1314 -Inner product checksum mr2 = 3EEB2DAA0D183BD9 -Inner product checksum mr3 = 3EDF8ABAB4585958 -Inner product checksum mr4 = 3EED800261C629E1 +Inner product checksum rho = 3FA537DC8BC68842 +Inner product checksum theta = 4160EF698F5EC3B3 +Inner product checksum u = 4568491DEACF4A86 +Inner product checksum mr1 = 3F35AA2ED4F6D96A +Inner product checksum mr2 = 3EEB2DAA5164D448 +Inner product checksum mr3 = 3EDF8ABAACFD1660 +Inner product checksum mr4 = 3EED800295511CA4 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-32bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-32bit.txt index 9e6a9cf163..64795111fe 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3D298E7C +Inner product checksum rho = 3D298E5B Inner product checksum theta = 4B0779CC -Inner product checksum u = 6B4246AE -Inner product checksum mr1 = 39AD5016 -Inner product checksum mr2 = 37596C21 -Inner product checksum mr3 = 36FC68EC +Inner product checksum u = 6B4246B7 +Inner product checksum mr1 = 39AD5038 +Inner product checksum mr2 = 37596C1F +Inner product checksum mr3 = 36FC68ED Inner product checksum mr4 = 376BFE0E Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-64bit.txt index dad5aa3886..da90a3156e 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537DBF0CC4F66 -Inner product checksum theta = 4160EF68D95572C1 -Inner product checksum u = 4568491C821DD340 -Inner product checksum mr1 = 3F35AA31FA691D44 -Inner product checksum mr2 = 3EEB2DAA5D4AD337 -Inner product checksum mr3 = 3EDF8ABAA16923B7 -Inner product checksum mr4 = 3EED800235D0256D +Inner product checksum rho = 3FA537DC5A9C3990 +Inner product checksum theta = 4160EF68016C882B +Inner product checksum u = 4568491C4C8A892B +Inner product checksum mr1 = 3F35AA2FC1549190 +Inner product checksum mr2 = 3EEB2DAA4EFE14B6 +Inner product checksum mr3 = 3EDF8ABAB272BFF4 +Inner product checksum mr4 = 3EED800253D900F8 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-32bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-32bit.txt index 9e6a9cf163..64795111fe 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-32bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3D298E7C +Inner product checksum rho = 3D298E5B Inner product checksum theta = 4B0779CC -Inner product checksum u = 6B4246AE -Inner product checksum mr1 = 39AD5016 -Inner product checksum mr2 = 37596C21 -Inner product checksum mr3 = 36FC68EC +Inner product checksum u = 6B4246B7 +Inner product checksum mr1 = 39AD5038 +Inner product checksum mr2 = 37596C1F +Inner product checksum mr3 = 36FC68ED Inner product checksum mr4 = 376BFE0E Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-64bit.txt index dad5aa3886..da90a3156e 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_full-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537DBF0CC4F66 -Inner product checksum theta = 4160EF68D95572C1 -Inner product checksum u = 4568491C821DD340 -Inner product checksum mr1 = 3F35AA31FA691D44 -Inner product checksum mr2 = 3EEB2DAA5D4AD337 -Inner product checksum mr3 = 3EDF8ABAA16923B7 -Inner product checksum mr4 = 3EED800235D0256D +Inner product checksum rho = 3FA537DC5A9C3990 +Inner product checksum theta = 4160EF68016C882B +Inner product checksum u = 4568491C4C8A892B +Inner product checksum mr1 = 3F35AA2FC1549190 +Inner product checksum mr2 = 3EEB2DAA4EFE14B6 +Inner product checksum mr3 = 3EDF8ABAB272BFF4 +Inner product checksum mr4 = 3EED800253D900F8 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-32bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-32bit.txt index bc9f325d89..bce6ffe54c 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-32bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-32bit.txt @@ -1,9 +1,9 @@ Inner product checksum rho = 3D29E536 -Inner product checksum theta = 4B07797E -Inner product checksum u = 6B42465C -Inner product checksum mr1 = 39AD59F6 -Inner product checksum mr2 = 37595486 -Inner product checksum mr3 = 36FC6A7A +Inner product checksum theta = 4B077974 +Inner product checksum u = 6B42465A +Inner product checksum mr1 = 39AD5A21 +Inner product checksum mr2 = 37595485 +Inner product checksum mr3 = 36FC6A77 Inner product checksum mr4 = 376C2ECA Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-64bit.txt index 20ac4f2305..4c6e700ddb 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9-C12_MG_ex1a_gnu_production-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FA537D7A3B96552 -Inner product checksum theta = 4160EF697E9E6E08 -Inner product checksum u = 4568491CC3B263EC -Inner product checksum mr1 = 3F35AA33AE372E7E -Inner product checksum mr2 = 3EEB2DAB080D9BAF -Inner product checksum mr3 = 3EDF8ABA99DCECEA -Inner product checksum mr4 = 3EED8002F8B2EC05 +Inner product checksum rho = 3FA537DBFB5FE882 +Inner product checksum theta = 4160EF6990D93211 +Inner product checksum u = 4568491C0CDD2860 +Inner product checksum mr1 = 3F35AA274E73BF58 +Inner product checksum mr2 = 3EEB2DABB7B56444 +Inner product checksum mr3 = 3EDF8ABAA5A9CC7C +Inner product checksum mr4 = 3EED8002E3166752 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_ffsl-C12_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_ffsl-C12_MG_ex1a_gnu_fast-debug-64bit.txt index 22fc337f3e..6ecd88d646 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_ffsl-C12_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_ffsl-C12_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 3FB39A8B517D5F2E -Inner product checksum theta = 4178F73E618D29F2 -Inner product checksum u = 4575A2441EFE8B68 -Inner product checksum mr1 = 3F971B9893A5643A -Inner product checksum mr2 = 3F73B22CD971A5AF -Inner product checksum mr3 = 3EF2330E8371FCB3 -Inner product checksum mr4 = 3EF2D4660B84F2F1 +Inner product checksum rho = 3FB39A8850E7D236 +Inner product checksum theta = 4178F73E4DC9CCF6 +Inner product checksum u = 4575A243A9CFE40B +Inner product checksum mr1 = 3F971B8C2B6BF604 +Inner product checksum mr2 = 3F73B22CE231C2EB +Inner product checksum mr3 = 3EF2330E83DA7A70 +Inner product checksum mr4 = 3EF2D465F802CA26 Inner product checksum mr5 = 0 Inner product checksum mr6 = 0 diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_random-C12_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_random-C12_MG_ex1a_gnu_fast-debug-64bit.txt index 91929bf889..30e8a0276b 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_random-C12_MG_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_nwp_gal9_random-C12_MG_ex1a_gnu_fast-debug-64bit.txt @@ -1,9 +1,9 @@ -Inner product checksum rho = 40B0960E14F4CCEE -Inner product checksum theta = 43076FC8D6701494 -Inner product checksum u = 4697A25B0E2167B2 -Inner product checksum mr1 = 40887EB14E45CD1F -Inner product checksum mr2 = 4069AB3CD26860E0 -Inner product checksum mr3 = 4069B44AEB7FF428 -Inner product checksum mr4 = 406997D0AB2F167D +Inner product checksum rho = 40B0960C3E8BF8F3 +Inner product checksum theta = 43076FC8D3AE6C51 +Inner product checksum u = 4697A25AF756FF36 +Inner product checksum mr1 = 40887EB19AD8D8D2 +Inner product checksum mr2 = 4069AB3CD29F8E94 +Inner product checksum mr3 = 4069B44AEB6E35BA +Inner product checksum mr4 = 406997D0AB580E8A Inner product checksum mr5 = 406997D0C9B8EEFC Inner product checksum mr6 = 40699547929283AD diff --git a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_semi-implicit-C12_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_semi-implicit-C12_ex1a_gnu_fast-debug-64bit.txt index 15aaab2b54..686338abbd 100644 --- a/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_semi-implicit-C12_ex1a_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/linear_model/ex1a/checksum_linear_model_semi-implicit-C12_ex1a_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 3EED280BC776A904 -Inner product checksum theta = 4012F415A1A39F11 -Inner product checksum u = 43A4936A5FDA0AEA +Inner product checksum rho = 3EED280BC7764B27 +Inner product checksum theta = 4012F415A1A2ECB2 +Inner product checksum u = 43A4936A5FC48189 diff --git a/rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc b/rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc index 5238590dfb..2a296aa358 100644 --- a/rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc +++ b/rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc @@ -46,12 +46,24 @@ "memory": [24, "GB"], }) %} +{% elif task_ns.conf_name == "clim_gal10_chem-tr_bdf2-C12" %} + + {% do task_dict.update({ + "memory": [24, "GB"], + }) %} + {% elif task_ns.conf_name == "ral3-seuk_MG" %} {% do task_dict.update({ "memory": [24, "GB"], }) %} +{% elif task_ns.conf_name == "ral3-tr_bdf2-seuk_MG" %} + + {% do task_dict.update({ + "memory": [24, "GB"], + }) %} + {% elif task_ns.conf_name == "ral3-seuk_ls_and_jedi" %} {% do task_dict.update({ diff --git a/science/adjoint/patches/algorithm/adjt_apply_elim_mixed_lp_operator_alg_mod.patch b/science/adjoint/patches/algorithm/adjt_apply_elim_mixed_lp_operator_alg_mod.patch index e1da8d95c5..c8032b76b2 100644 --- a/science/adjoint/patches/algorithm/adjt_apply_elim_mixed_lp_operator_alg_mod.patch +++ b/science/adjoint/patches/algorithm/adjt_apply_elim_mixed_lp_operator_alg_mod.patch @@ -1,4 +1,4 @@ -@@ -12,40 +12,46 @@ +@@ -12,42 +12,47 @@ use adj_apply_elim_mixed_lp_operator_kernel_mod, only : adj_apply_elim_mixed_lp_operator_kernel_type use finite_element_config_mod, only : element_order_h, element_order_v use fs_continuity_mod, only : w2, w3, wtheta @@ -24,8 +24,10 @@ - type(field_type) :: u - type(field_type) :: exner - type(operator_type) :: m3exner -- type(operator_type) :: q32 +- type(operator_type) :: q32_rho - type(operator_type) :: p3theta +- real(kind=r_def) :: const_r +- real(kind=r_def) :: const_r_input - type(field_type) :: lhs_exner_input - type(field_type) :: theta_input - type(field_type) :: u_input @@ -35,8 +37,9 @@ + type(r_solver_field_type) :: u + type(r_solver_field_type) :: exner + type(r_solver_operator_type) :: m3exner -+ type(r_solver_operator_type) :: q32 ++ type(r_solver_operator_type) :: q32_rho + type(r_solver_operator_type) :: p3theta ++ real(kind=r_solver) :: const_r + type(r_solver_field_type) :: lhs_exner_input + type(r_solver_field_type) :: theta_input + type(r_solver_field_type) :: u_input @@ -65,7 +68,16 @@ vector_space_w2_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w2) vector_space_w3_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w3) -@@ -65,19 +71,38 @@ +@@ -63,26 +68,45 @@ + call theta_input%initialise(vector_space=vector_space_wtheta_ptr, name='theta_input') + call u_input%initialise(vector_space=vector_space_w2_ptr, name='u_input') + call exner_input%initialise(vector_space=vector_space_w3_ptr, name='exner_input') +- call RANDOM_NUMBER(const_r) +- const_r_input = const_r ++ ! NOTE(JC): Known issue with scalar randomisation with MPI. Each process ++ ! generates a different number. See LFRic-apps ticket #765. ++ const_r = 1.0_r_def + lhs_exner_inner_prod = 0.0_r_def theta_inner_prod = 0.0_r_def u_inner_prod = 0.0_r_def exner_inner_prod = 0.0_r_def @@ -73,16 +85,17 @@ ! Initialise arguments and call the tangent-linear kernel. call invoke(setval_random(lhs_exner), setval_x(lhs_exner_input, lhs_exner), setval_random(theta), setval_x(theta_input, & -&theta), setval_random(u), setval_x(u_input, u), setval_random(exner), setval_x(exner_input, exner), & --&setop_random_kernel_type(m3exner), setop_random_kernel_type(q32), setop_random_kernel_type(p3theta), & --&apply_elim_mixed_lp_operator_kernel_type(lhs_exner, theta, u, exner, m3exner, q32, p3theta), & +-&setop_random_kernel_type(m3exner), setop_random_kernel_type(q32_rho), setop_random_kernel_type(p3theta), & +-&apply_elim_mixed_lp_operator_kernel_type(lhs_exner, theta, u, exner, m3exner, q32_rho, p3theta, const_r), & +&theta), setval_random(u), setval_x(u_input, u), setval_random(exner), setval_x(exner_input, exner)) + call setop_random_alg(m3exner) -+ call setop_random_alg(q32) ++ call setop_random_alg(q32_rho) + call setop_random_alg(p3theta) -+ call invoke(apply_elim_mixed_lp_operator_kernel_type(lhs_exner, theta, u, exner, m3exner, q32, p3theta), & ++ call invoke(apply_elim_mixed_lp_operator_kernel_type(lhs_exner, theta, u, exner, m3exner, q32_rho, p3theta, const_r), & &x_innerproduct_x(lhs_exner_inner_prod, lhs_exner), x_innerproduct_x(theta_inner_prod, theta), x_innerproduct_x(u_inner_prod, u), & &x_innerproduct_x(exner_inner_prod, exner)) - inner1 = 0.0_r_def +- inner1 = inner1 + const_r * const_r - inner1 = inner1 + lhs_exner_inner_prod - inner1 = inner1 + theta_inner_prod - inner1 = inner1 + u_inner_prod @@ -113,11 +126,12 @@ lhs_exner_lhs_exner_input_inner_prod = 0.0_r_def theta_theta_input_inner_prod = 0.0_r_def u_u_input_inner_prod = 0.0_r_def -@@ -86,12 +111,11 @@ +@@ -91,13 +115,11 @@ &x_innerproduct_y(lhs_exner_lhs_exner_input_inner_prod, lhs_exner, lhs_exner_input), & &x_innerproduct_y(theta_theta_input_inner_prod, theta, theta_input), x_innerproduct_y(u_u_input_inner_prod, u, u_input), & &x_innerproduct_y(exner_exner_input_inner_prod, exner, exner_input)) - inner2 = 0.0_r_def +- inner2 = inner2 + const_r * const_r_input - inner2 = inner2 + lhs_exner_lhs_exner_input_inner_prod - inner2 = inner2 + theta_theta_input_inner_prod - inner2 = inner2 + u_u_input_inner_prod diff --git a/science/adjoint/patches/algorithm/adjt_apply_mixed_lu_operator_alg_mod.patch b/science/adjoint/patches/algorithm/adjt_apply_mixed_lu_operator_alg_mod.patch index 3fd783af9f..8f4b19ce27 100644 --- a/science/adjoint/patches/algorithm/adjt_apply_mixed_lu_operator_alg_mod.patch +++ b/science/adjoint/patches/algorithm/adjt_apply_mixed_lu_operator_alg_mod.patch @@ -1,4 +1,4 @@ -@@ -12,44 +12,47 @@ +@@ -12,46 +12,48 @@ use adj_apply_mixed_lu_operator_kernel_mod, only : adj_apply_mixed_lu_operator_kernel_type use finite_element_config_mod, only : element_order_h, element_order_v use fs_continuity_mod, only : w2, w3, wtheta @@ -27,6 +27,8 @@ - type(operator_type) :: p2theta - type(operator_type) :: grad - type(field_type) :: norm_u +- real(kind=r_def) :: const_u +- real(kind=r_def) :: const_u_input - type(field_type) :: lhs_u_input - type(field_type) :: wind_input - type(field_type) :: theta_input @@ -40,6 +42,7 @@ + type(r_solver_operator_type) :: p2theta + type(r_solver_operator_type) :: grad + type(r_solver_field_type) :: norm_u ++ real(kind=r_solver) :: const_u + type(r_solver_field_type) :: lhs_u_input + type(r_solver_field_type) :: wind_input + type(r_solver_field_type) :: theta_input @@ -70,17 +73,22 @@ vector_space_w2_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w2) vector_space_w3_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w3) -@@ -66,42 +69,55 @@ +@@ -68,46 +70,58 @@ call wind_input%initialise(vector_space=vector_space_w2_ptr, name='wind_input') call theta_input%initialise(vector_space=vector_space_wtheta_ptr, name='theta_input') call exner_input%initialise(vector_space=vector_space_w3_ptr, name='exner_input') - call norm_u_input%initialise(vector_space=vector_space_w2_ptr, name='norm_u_input') +- call RANDOM_NUMBER(const_u) +- const_u_input = const_u - lhs_u_inner_prod = 0.0_r_def - wind_inner_prod = 0.0_r_def - theta_inner_prod = 0.0_r_def - exner_inner_prod = 0.0_r_def - norm_u_inner_prod = 0.0_r_def - ++ ! NOTE(JC): Known issue with scalar randomisation with MPI. Each process ++ ! generates a different number. See LFRic-apps ticket #765. ++ const_u = 1.0_r_def + lhs_u_inner_prod = 0.0_r_solver + wind_inner_prod = 0.0_r_solver + theta_inner_prod = 0.0_r_solver @@ -89,20 +97,22 @@ call invoke(setval_random(lhs_u), setval_x(lhs_u_input, lhs_u), setval_random(wind), setval_x(wind_input, wind), & -&setval_random(theta), setval_x(theta_input, theta), setval_random(exner), setval_x(exner_input, exner), setval_random(norm_u), & -&setval_x(norm_u_input, norm_u), setop_random_kernel_type(mu_cd), setop_random_kernel_type(p2theta), & --&setop_random_kernel_type(grad), apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u), & -+&setval_random(theta), setval_x(theta_input, theta), setval_random(exner), setval_x(exner_input, exner), setval_random(norm_u)) -+ call setop_random_alg(mu_cd) -+ call setop_random_alg(p2theta) -+ call setop_random_alg(grad) -+ call invoke(apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u), & - &x_innerproduct_x(lhs_u_inner_prod, lhs_u), x_innerproduct_x(wind_inner_prod, wind), x_innerproduct_x(theta_inner_prod, theta), & --&x_innerproduct_x(exner_inner_prod, exner), x_innerproduct_x(norm_u_inner_prod, norm_u)) +-&setop_random_kernel_type(grad), apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u, & +-&const_u), x_innerproduct_x(lhs_u_inner_prod, lhs_u), x_innerproduct_x(wind_inner_prod, wind), x_innerproduct_x(theta_inner_prod, & +-&theta), x_innerproduct_x(exner_inner_prod, exner), x_innerproduct_x(norm_u_inner_prod, norm_u)) - inner1 = 0.0_r_def +- inner1 = inner1 + const_u * const_u - inner1 = inner1 + lhs_u_inner_prod - inner1 = inner1 + wind_inner_prod - inner1 = inner1 + theta_inner_prod - inner1 = inner1 + exner_inner_prod - inner1 = inner1 + norm_u_inner_prod ++&setval_random(theta), setval_x(theta_input, theta), setval_random(exner), setval_x(exner_input, exner), setval_random(norm_u)) ++ call setop_random_alg(mu_cd) ++ call setop_random_alg(p2theta) ++ call setop_random_alg(grad) ++ call invoke(apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u, const_u), & ++&x_innerproduct_x(lhs_u_inner_prod, lhs_u), x_innerproduct_x(wind_inner_prod, wind), x_innerproduct_x(theta_inner_prod, theta), & +&x_innerproduct_x(exner_inner_prod, exner)) + write( log_scratch_space, * ) "adjt_apply_mixed_lu_operator inner products:" + call log_event( log_scratch_space, log_level_debug ) @@ -132,11 +142,12 @@ theta_theta_input_inner_prod = 0.0_r_def exner_exner_input_inner_prod = 0.0_r_def - norm_u_norm_u_input_inner_prod = 0.0_r_def - call invoke(adj_apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u), & + call invoke(adj_apply_mixed_lu_operator_kernel_type(lhs_u, wind, theta, exner, mu_cd, p2theta, grad, norm_u, const_u), & &x_innerproduct_y(lhs_u_lhs_u_input_inner_prod, lhs_u, lhs_u_input), x_innerproduct_y(wind_wind_input_inner_prod, wind, & &wind_input), x_innerproduct_y(theta_theta_input_inner_prod, theta, theta_input), x_innerproduct_y(exner_exner_input_inner_prod, & -&exner, exner_input), x_innerproduct_y(norm_u_norm_u_input_inner_prod, norm_u, norm_u_input)) - inner2 = 0.0_r_def +- inner2 = inner2 + const_u * const_u_input - inner2 = inner2 + lhs_u_lhs_u_input_inner_prod - inner2 = inner2 + wind_wind_input_inner_prod - inner2 = inner2 + theta_theta_input_inner_prod diff --git a/science/adjoint/patches/algorithm/adjt_apply_mixed_operator_alg_mod.patch b/science/adjoint/patches/algorithm/adjt_apply_mixed_operator_alg_mod.patch index 9a3b462816..cf03665078 100644 --- a/science/adjoint/patches/algorithm/adjt_apply_mixed_operator_alg_mod.patch +++ b/science/adjoint/patches/algorithm/adjt_apply_mixed_operator_alg_mod.patch @@ -9,7 +9,16 @@ real(kind=r_def), parameter :: overall_tolerance = 1500.0_r_def type(mesh_type), pointer, intent(in) :: mesh type(field_type), dimension(3), intent(in), optional :: chi -@@ -46,16 +46,18 @@ +@@ -43,25 +43,24 @@ + real(kind=r_def) :: const_u + real(kind=r_def) :: const_t + real(kind=r_def) :: const_r +- real(kind=r_def) :: const_u_input +- real(kind=r_def) :: const_t_input +- real(kind=r_def) :: const_r_input + type(field_type) :: lhs_uv_input + type(field_type) :: lhs_w_input + type(field_type) :: lhs_p_input type(field_type) :: wind_uv_input type(field_type) :: wind_w_input type(field_type) :: exner_input @@ -32,7 +41,7 @@ real(kind=r_def) :: inner1 real(kind=r_def) :: lhs_uv_lhs_uv_input_inner_prod real(kind=r_def) :: lhs_w_lhs_w_input_inner_prod -@@ -63,11 +65,10 @@ +@@ -69,11 +68,10 @@ real(kind=r_def) :: wind_uv_wind_uv_input_inner_prod real(kind=r_def) :: wind_w_wind_w_input_inner_prod real(kind=r_def) :: exner_exner_input_inner_prod @@ -45,12 +54,23 @@ vector_space_w2_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w2) vector_space_w2h_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w2h) -@@ -95,53 +96,73 @@ +@@ -101,75 +99,86 @@ call wind_uv_input%initialise(vector_space=vector_space_w2h_ptr, name='wind_uv_input') call wind_w_input%initialise(vector_space=vector_space_w2v_ptr, name='wind_w_input') call exner_input%initialise(vector_space=vector_space_w3_ptr, name='exner_input') - call mt_lumped_inv_input%initialise(vector_space=vector_space_wtheta_ptr, name='mt_lumped_inv_input') - call norm_u_input%initialise(vector_space=vector_space_w2_ptr, name='norm_u_input') +- call RANDOM_NUMBER(const_u) +- const_u_input = const_u +- call RANDOM_NUMBER(const_t) +- const_t_input = const_t +- call RANDOM_NUMBER(const_r) +- const_r_input = const_r ++ ! NOTE(JC): Known issue with scalar randomisation with MPI. Each process ++ ! generates a different number. See LFRic-apps ticket #765. ++ const_u = 1.0_r_def ++ const_t = 1.0_r_def ++ const_r = 1.0_r_def lhs_uv_inner_prod = 0.0_r_def lhs_w_inner_prod = 0.0_r_def lhs_p_inner_prod = 0.0_r_def @@ -68,7 +88,7 @@ -&norm_u), setop_random_kernel_type(pt2), setop_random_kernel_type(mu_cd), setop_random_kernel_type(p2t), & -&setop_random_kernel_type(grad), setop_random_kernel_type(m3p), setop_random_kernel_type(q32), setop_random_kernel_type(p3t), & -&apply_mixed_operator_kernel_type(lhs_uv, lhs_w, lhs_p, wind_uv, wind_w, exner, pt2, mt_lumped_inv, mu_cd, p2t, grad, norm_u, m3p, & --&q32, p3t), x_innerproduct_x(lhs_uv_inner_prod, lhs_uv), x_innerproduct_x(lhs_w_inner_prod, lhs_w), & +-&q32, p3t, const_u, const_t, const_r), x_innerproduct_x(lhs_uv_inner_prod, lhs_uv), x_innerproduct_x(lhs_w_inner_prod, lhs_w), & +&setval_random(mt_lumped_inv), setval_random(norm_u)) + call setop_random_alg(pt2) + call setop_random_alg(mu_cd) @@ -78,7 +98,8 @@ + call setop_random_alg(q32) + call setop_random_alg(p3t) + call invoke(apply_mixed_operator_kernel_type(lhs_uv, lhs_w, lhs_p, wind_uv, wind_w, exner, pt2, mt_lumped_inv, mu_cd, p2t, & -+&grad, norm_u, m3p, q32, p3t), x_innerproduct_x(lhs_uv_inner_prod, lhs_uv), x_innerproduct_x(lhs_w_inner_prod, lhs_w), & ++&grad, norm_u, m3p, q32, p3t, const_u, const_t, const_r), & ++&x_innerproduct_x(lhs_uv_inner_prod, lhs_uv), x_innerproduct_x(lhs_w_inner_prod, lhs_w), & &x_innerproduct_x(lhs_p_inner_prod, lhs_p), x_innerproduct_x(wind_uv_inner_prod, wind_uv), x_innerproduct_x(wind_w_inner_prod, & -&wind_w), x_innerproduct_x(exner_inner_prod, exner), x_innerproduct_x(mt_lumped_inv_inner_prod, mt_lumped_inv), & -&x_innerproduct_x(norm_u_inner_prod, norm_u)) @@ -104,6 +125,9 @@ + wind_w_sf = 1.0_r_def / (wind_w_inner_prod + eps) + exner_sf = 1.0_r_def / (exner_inner_prod + eps) inner1 = 0.0_r_def +- inner1 = inner1 + const_u * const_u +- inner1 = inner1 + const_t * const_t +- inner1 = inner1 + const_r * const_r - inner1 = inner1 + lhs_uv_inner_prod - inner1 = inner1 + lhs_w_inner_prod - inner1 = inner1 + lhs_p_inner_prod @@ -133,7 +157,7 @@ - mt_lumped_inv_mt_lumped_inv_input_inner_prod = 0.0_r_def - norm_u_norm_u_input_inner_prod = 0.0_r_def call invoke(adj_apply_mixed_operator_kernel_type(lhs_uv, lhs_w, lhs_p, wind_uv, wind_w, exner, pt2, mt_lumped_inv, mu_cd, p2t, & - &grad, norm_u, m3p, q32, p3t), x_innerproduct_y(lhs_uv_lhs_uv_input_inner_prod, lhs_uv, lhs_uv_input), & + &grad, norm_u, m3p, q32, p3t, const_u, const_t, const_r), x_innerproduct_y(lhs_uv_lhs_uv_input_inner_prod, lhs_uv, lhs_uv_input), & &x_innerproduct_y(lhs_w_lhs_w_input_inner_prod, lhs_w, lhs_w_input), x_innerproduct_y(lhs_p_lhs_p_input_inner_prod, lhs_p, & &lhs_p_input), x_innerproduct_y(wind_uv_wind_uv_input_inner_prod, wind_uv, wind_uv_input), & &x_innerproduct_y(wind_w_wind_w_input_inner_prod, wind_w, wind_w_input), x_innerproduct_y(exner_exner_input_inner_prod, exner, & @@ -141,9 +165,12 @@ -&x_innerproduct_y(norm_u_norm_u_input_inner_prod, norm_u, norm_u_input)) +&exner_input)) inner2 = 0.0_r_def +- inner2 = inner2 + const_u * const_u_input +- inner2 = inner2 + const_t * const_t_input +- inner2 = inner2 + const_r * const_r_input inner2 = inner2 + lhs_uv_lhs_uv_input_inner_prod inner2 = inner2 + lhs_w_lhs_w_input_inner_prod -@@ -149,9 +170,6 @@ + inner2 = inner2 + lhs_p_lhs_p_input_inner_prod inner2 = inner2 + wind_uv_wind_uv_input_inner_prod inner2 = inner2 + wind_w_wind_w_input_inner_prod inner2 = inner2 + exner_exner_input_inner_prod diff --git a/science/adjoint/patches/algorithm/adjt_opt_apply_variable_hx_alg_mod.patch b/science/adjoint/patches/algorithm/adjt_opt_apply_variable_hx_alg_mod.patch index 714bca630a..917924c95b 100644 --- a/science/adjoint/patches/algorithm/adjt_opt_apply_variable_hx_alg_mod.patch +++ b/science/adjoint/patches/algorithm/adjt_opt_apply_variable_hx_alg_mod.patch @@ -1,4 +1,4 @@ -@@ -13,46 +13,49 @@ +@@ -13,48 +13,50 @@ use finite_element_config_mod, only : element_order_h, element_order_v use fs_continuity_mod, only : w2, w3, wtheta use operator_mod, only : operator_type @@ -26,9 +26,11 @@ - type(operator_type) :: p3t - type(operator_type) :: pt2 - type(operator_type) :: m3 -- real(kind=r_def) :: sgn +- real(kind=r_def) :: const_div +- real(kind=r_def) :: const_theta - type(field_type) :: rhs_p -- real(kind=r_def) :: sgn_input +- real(kind=r_def) :: const_div_input +- real(kind=r_def) :: const_theta_input - type(field_type) :: lhs_input - type(field_type) :: x_input - type(field_type) :: mt_inv_input @@ -42,7 +44,8 @@ + type(r_solver_operator_type) :: p3t + type(r_solver_operator_type) :: pt2 + type(r_solver_operator_type) :: m3 -+ real(kind=r_solver) :: sgn ++ real(kind=r_solver) :: const_div ++ real(kind=r_solver) :: const_theta + type(r_solver_field_type) :: rhs_p + type(r_solver_field_type) :: lhs_input + type(r_solver_field_type) :: x_input @@ -74,18 +77,21 @@ vector_space_w2_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w2) vector_space_w3_ptr => function_space_collection%get_fs(mesh,element_order_h,element_order_v,w3) -@@ -68,48 +71,62 @@ +@@ -70,53 +72,63 @@ call m3%initialise(vector_space_w3_ptr, vector_space_w3_ptr) call lhs_input%initialise(vector_space=vector_space_w3_ptr, name='lhs_input') call x_input%initialise(vector_space=vector_space_w2_ptr, name='x_input') - call mt_inv_input%initialise(vector_space=vector_space_wtheta_ptr, name='mt_inv_input') call pressure_input%initialise(vector_space=vector_space_w3_ptr, name='pressure_input') call rhs_p_input%initialise(vector_space=vector_space_w3_ptr, name='rhs_p_input') -- call RANDOM_NUMBER(sgn) -- sgn_input = sgn +- call RANDOM_NUMBER(const_div) +- const_div_input = const_div +- call RANDOM_NUMBER(const_theta) +- const_theta_input = const_theta + ! NOTE(JC): Known issue with scalar randomisation with MPI. Each process + ! generates a different number. See LFRic-apps ticket #765. -+ sgn = 1.0_r_def ++ const_div = 1.0_r_def ++ const_theta = 1.0_r_def lhs_inner_prod = 0.0_r_def x_inner_prod = 0.0_r_def - mt_inv_inner_prod = 0.0_r_def @@ -96,24 +102,27 @@ call invoke(setval_random(lhs), setval_x(lhs_input, lhs), setval_random(x), setval_x(x_input, x), setval_random(mt_inv), & -&setval_x(mt_inv_input, mt_inv), setval_random(pressure), setval_x(pressure_input, pressure), setval_random(rhs_p), & -&setval_x(rhs_p_input, rhs_p), setop_random_kernel_type(div), setop_random_kernel_type(p3t), setop_random_kernel_type(pt2), & --&setop_random_kernel_type(m3), opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, sgn, rhs_p), & --&x_innerproduct_x(lhs_inner_prod, lhs), x_innerproduct_x(x_inner_prod, x), x_innerproduct_x(mt_inv_inner_prod, mt_inv), & +-&setop_random_kernel_type(m3), opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, const_div, & +-&const_theta, rhs_p), x_innerproduct_x(lhs_inner_prod, lhs), x_innerproduct_x(x_inner_prod, x), & +-&x_innerproduct_x(mt_inv_inner_prod, mt_inv), x_innerproduct_x(pressure_inner_prod, pressure), x_innerproduct_x(rhs_p_inner_prod, & +-&rhs_p)) +- inner1 = 0.0_r_def +- inner1 = inner1 + const_div * const_div +- inner1 = inner1 + const_theta * const_theta +- inner1 = inner1 + lhs_inner_prod +- inner1 = inner1 + x_inner_prod +- inner1 = inner1 + mt_inv_inner_prod +- inner1 = inner1 + pressure_inner_prod +- inner1 = inner1 + rhs_p_inner_prod +&setval_random(pressure), setval_x(pressure_input, pressure), setval_random(rhs_p), & +&setval_x(rhs_p_input, rhs_p)) + call setop_random_alg(div) + call setop_random_alg(p3t) + call setop_random_alg(pt2) + call setop_random_alg(m3) -+ call invoke(opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, sgn, rhs_p), & ++ call invoke(opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, const_div, const_theta, rhs_p), & +&x_innerproduct_x(lhs_inner_prod, lhs), x_innerproduct_x(x_inner_prod, x), & - &x_innerproduct_x(pressure_inner_prod, pressure), x_innerproduct_x(rhs_p_inner_prod, rhs_p)) -- inner1 = 0.0_r_def -- inner1 = inner1 + sgn * sgn -- inner1 = inner1 + lhs_inner_prod -- inner1 = inner1 + x_inner_prod -- inner1 = inner1 + mt_inv_inner_prod -- inner1 = inner1 + pressure_inner_prod -- inner1 = inner1 + rhs_p_inner_prod ++&x_innerproduct_x(pressure_inner_prod, pressure), x_innerproduct_x(rhs_p_inner_prod, rhs_p)) + write( log_scratch_space, * ) "adjt_opt_apply_variable_hx inner products:" + call log_event( log_scratch_space, log_level_debug ) + write( log_scratch_space, * ) "lhs inner product = ", lhs_inner_prod @@ -142,13 +151,14 @@ - mt_inv_mt_inv_input_inner_prod = 0.0_r_def pressure_pressure_input_inner_prod = 0.0_r_def rhs_p_rhs_p_input_inner_prod = 0.0_r_def - call invoke(adj_opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, sgn, rhs_p), & + call invoke(adj_opt_apply_variable_hx_kernel_type(lhs, x, mt_inv, pressure, div, p3t, pt2, m3, const_div, const_theta, rhs_p), & &x_innerproduct_y(lhs_lhs_input_inner_prod, lhs, lhs_input), x_innerproduct_y(x_x_input_inner_prod, x, x_input), & -&x_innerproduct_y(mt_inv_mt_inv_input_inner_prod, mt_inv, mt_inv_input), x_innerproduct_y(pressure_pressure_input_inner_prod, & +&x_innerproduct_y(pressure_pressure_input_inner_prod, & &pressure, pressure_input), x_innerproduct_y(rhs_p_rhs_p_input_inner_prod, rhs_p, rhs_p_input)) - inner2 = 0.0_r_def -- inner2 = inner2 + sgn * sgn_input +- inner2 = inner2 + const_div * const_div_input +- inner2 = inner2 + const_theta * const_theta_input - inner2 = inner2 + lhs_lhs_input_inner_prod - inner2 = inner2 + x_x_input_inner_prod - inner2 = inner2 + mt_inv_mt_inv_input_inner_prod diff --git a/science/adjoint/patches/kernel/adj_apply_mixed_operator_kernel_mod.patch b/science/adjoint/patches/kernel/adj_apply_mixed_operator_kernel_mod.patch index 8de9b745ba..a4ffad2526 100644 --- a/science/adjoint/patches/kernel/adj_apply_mixed_operator_kernel_mod.patch +++ b/science/adjoint/patches/kernel/adj_apply_mixed_operator_kernel_mod.patch @@ -1,6 +1,6 @@ @@ -7,7 +7,7 @@ type, public, extends(kernel_type) :: adj_apply_mixed_operator_kernel_type - type(ARG_TYPE) :: META_ARGS(15) = (/ & + type(ARG_TYPE) :: META_ARGS(18) = (/ & arg_type(gh_field, gh_real, gh_read, w2h), & - arg_type(gh_field, gh_real, gh_write, w2v), & + arg_type(gh_field, gh_real, gh_readwrite, w2v), & @@ -29,10 +29,10 @@ lhs_w(idx_8) = 0.0 enddo - do idx_7 = UBOUND(t_col, dim=1), LBOUND(t_col, dim=1), -1 -- t_col = t_col + mt_lumped_inv(idx_7 + iwt - LBOUND(t_col(idx_7), dim=1)) * t_col(idx_7) +- t_col = t_col + const_t * mt_lumped_inv(idx_7 + iwt - LBOUND(t_col(idx_7), dim=1)) * t_col(idx_7) - t_col(idx_7) = 0.0 - enddo -+ t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) ++ t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) * const_t do df = ndf_w2, 1, -1 do idx_6 = nm1 + 1, 1, -1 u_e(idx_6 + LBOUND(u_e, dim=1) - 1,df) = u_e(idx_6 + LBOUND(u_e, dim=1) - 1,df) + (-pt2(idx_6 + ij - 1,2,df) * t_col(idx_6)) diff --git a/science/adjoint/patches/kernel/adj_opt_apply_variable_hx_kernel_mod.patch b/science/adjoint/patches/kernel/adj_opt_apply_variable_hx_kernel_mod.patch index a1a0c8e02b..8cf5eebe4c 100644 --- a/science/adjoint/patches/kernel/adj_opt_apply_variable_hx_kernel_mod.patch +++ b/science/adjoint/patches/kernel/adj_opt_apply_variable_hx_kernel_mod.patch @@ -13,7 +13,7 @@ - end interface opt_apply_variable_hx_code + end interface adj_opt_apply_variable_hx_code type, public, extends(kernel_type) :: adj_opt_apply_variable_hx_kernel_type - type(ARG_TYPE) :: META_ARGS(10) = (/ & + type(ARG_TYPE) :: META_ARGS(11) = (/ & - arg_type(gh_field, gh_real, gh_write, w3), & - arg_type(gh_field, gh_real, gh_read, w2), & + arg_type(gh_field, gh_real, gh_readwrite, w3), & @@ -101,9 +101,9 @@ enddo + k = 0 + ik = cell * nlayers + k - nlayers + 1 - div_u = div_u + lhs(map_w31 + k) * sgn - t_e(1) = t_e(1) + sgn * lhs(map_w31 + k) - t_e(2) = t_e(2) + sgn * lhs(map_w31 + k) + div_u = div_u + const_div * lhs(map_w31 + k) + t_e(1) = t_e(1) + const_theta * lhs(map_w31 + k) + t_e(2) = t_e(2) + const_theta * lhs(map_w31 + k) pressure(k + map_w31) = pressure(k + map_w31) + m3(ik,1,1) * lhs(map_w31 + k) rhs_p(k + map_w3(1)) = rhs_p(k + map_w3(1)) + lhs(map_w31 + k) - lhs(map_w31 + k) = 0.0 @@ -197,9 +197,9 @@ enddo + k = 0 + ik = cell * nlayers + k - nlayers + 1 - div_u = div_u + lhs(map_w31 + k) * sgn - t_e(1) = t_e(1) + sgn * lhs(map_w31 + k) - t_e(2) = t_e(2) + sgn * lhs(map_w31 + k) + div_u = div_u + const_div * lhs(map_w31 + k) + t_e(1) = t_e(1) + const_theta * lhs(map_w31 + k) + t_e(2) = t_e(2) + const_theta * lhs(map_w31 + k) pressure(k + map_w31) = pressure(k + map_w31) + m3(ik,1,1) * lhs(map_w31 + k) rhs_p(k + map_w3(1)) = rhs_p(k + map_w3(1)) + lhs(map_w31 + k) - lhs(map_w31 + k) = 0.0 diff --git a/science/adjoint/patches/kernel/apply_elim_mixed_lp_operator_kernel_mod.patch b/science/adjoint/patches/kernel/apply_elim_mixed_lp_operator_kernel_mod.patch index 809464429a..b26ed556ad 100644 --- a/science/adjoint/patches/kernel/apply_elim_mixed_lp_operator_kernel_mod.patch +++ b/science/adjoint/patches/kernel/apply_elim_mixed_lp_operator_kernel_mod.patch @@ -15,14 +15,14 @@ ! LHS for this element - lhs_e = matmul(m3exner(ik,:,:), p_e) & - - matmul(p3theta(ik,:,:), t_e) & -- + matmul(q32(ik,:,:), u_e) +- + const_r*matmul(q32_rho(ik,:,:), u_e) + m3exner_at_cell = m3exner(ik,:,:) + p3theta_at_cell = p3theta(ik,:,:) -+ q32_at_cell = q32(ik,:,:) ++ q32_at_cell = q32_rho(ik,:,:) + m3e_pe = matmul(m3exner_at_cell(:,:), p_e) + p3t_te = matmul(p3theta_at_cell(:,:), t_e) + q32_ue = matmul(q32_at_cell(:,:), u_e) -+ lhs_e = m3e_pe - p3t_te + q32_ue ++ lhs_e = m3e_pe - p3t_te + const_r*q32_ue do df = 1, ndf_w3 lhs_exner(map_w3(df)+k) = lhs_e(df) end do diff --git a/science/adjoint/source/algorithm/core_dynamics/atl_rhs_alg_mod.x90 b/science/adjoint/source/algorithm/core_dynamics/atl_rhs_alg_mod.x90 index 5d1757e81c..180403bd55 100644 --- a/science/adjoint/source/algorithm/core_dynamics/atl_rhs_alg_mod.x90 +++ b/science/adjoint/source/algorithm/core_dynamics/atl_rhs_alg_mod.x90 @@ -74,10 +74,11 @@ contains !> @param[in] compute_eos Flag to control computation of the equation of !! state !> @param[in] dlayer_rhs Use damping layer in rhs yes/no + !> @param[in] stepper Enumerator for timestepper !> @param[in] model_clock Time in the model subroutine atl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & ls_state, ls_moist_dyn, compute_eos, & - dlayer_rhs, model_clock) + dlayer_rhs, stepper, model_clock) implicit none @@ -92,6 +93,7 @@ subroutine atl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & type(field_type), intent(in) :: ls_moist_dyn(num_moist_factors) type(field_type), intent(inout) :: rhs(bundle_size) logical(kind=l_def), intent(in) :: compute_eos + integer(kind=i_def), intent(in) :: stepper class(model_clock_type), intent(in) :: model_clock type(operator_type), pointer :: mm_vel, & @@ -145,7 +147,7 @@ subroutine atl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & ! Using modified velocity mass matrix if using damping layer if (dlayer_rhs) then - mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, mesh%get_id(), model_clock) + mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, stepper, mesh%get_id(), model_clock) else mm_vel => get_mass_matrix_fe(W2, mesh%get_id()) end if diff --git a/science/adjoint/source/algorithm/solver/adj_mixed_operator_alg_mod.x90 b/science/adjoint/source/algorithm/solver/adj_mixed_operator_alg_mod.x90 index 00e3e3e692..bc20e421bb 100644 --- a/science/adjoint/source/algorithm/solver/adj_mixed_operator_alg_mod.x90 +++ b/science/adjoint/source/algorithm/solver/adj_mixed_operator_alg_mod.x90 @@ -45,12 +45,15 @@ module adj_mixed_operator_alg_mod get_face_selector_ns use sci_linear_operator_mod, only: abstract_linear_operator_type use sci_r_solver_field_vector_mod, only: r_solver_field_vector_type - use si_operators_alg_mod, only: get_p2theta, & - get_div_star, & - get_ptheta2, & - get_m3_exner_star, & - get_p3theta, & - get_eliminated_q32 + use si_operators_alg_mod, only: get_p2theta, & + get_div_star, & + get_ptheta2, & + get_m3_exner_star, & + get_p3theta, & + get_eliminated_q32_rho, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt use solver_constants_mod, only: get_w2_mass_matrix_r_solver, & get_normalisation_r_solver use timing_mod, only: start_timing, & @@ -64,14 +67,34 @@ module adj_mixed_operator_alg_mod type, public, extends(abstract_linear_operator_type) :: adj_mixed_operator_type private + integer(kind=i_def) :: stepper contains procedure, public :: apply => apply_adj_mixed_operator procedure, private :: apply_adj_mixed_operator final :: destroy_adj_mixed_operator end type adj_mixed_operator_type + interface adj_mixed_operator_type + module procedure adj_mixed_operator_constructor + end interface + contains + !> @brief Constructor for the adjoint mixed operator + !> @param[in] stepper The time stepper enumerator used to select the operators + !> @return Instance of the adjoint mixed operator + function adj_mixed_operator_constructor(stepper) result(self) + + implicit none + + integer(kind=i_def), intent(in) :: stepper + type(adj_mixed_operator_type) :: self + + self%stepper = stepper + + end function adj_mixed_operator_constructor + + !> @brief Applies the adjoint mixed operator to the vector. !> @param[in] x Field vector to be read !> @param[in,out] y Field vector to be written @@ -90,8 +113,8 @@ contains integer(i_def) :: p_h, p_v type(r_solver_field_type), pointer :: w2_mask, w3_mask type(r_solver_field_type) :: x_t - real(kind=r_solver), parameter :: minus_one = -1.0_r_solver - type(r_solver_operator_type), pointer :: q32_op + real(kind=r_solver) :: const_u, const_t, const_r, minus_const_t + type(r_solver_operator_type), pointer :: q32_rho_op type(r_solver_field_type), pointer :: xvec_uv, xvec_p, xvec_w type(r_solver_field_type), pointer :: yvec_uv, yvec_p, yvec_w @@ -130,7 +153,7 @@ contains ! Obtain operators from runtime constants mt_lumped_inv => get_normalisation_r_solver( Wtheta, mesh%get_id() ) m2_diag => get_normalisation_r_solver( W2, mesh%get_id() ) - mm_vel => get_w2_mass_matrix_r_solver( w2_si_matrix, mesh%get_id() ) + mm_vel => get_w2_mass_matrix_r_solver( w2_si_matrix, self%stepper, mesh%get_id() ) ! Obtain operators from SI operators p2theta => get_p2theta() @@ -139,6 +162,12 @@ contains m3_exner_star => get_m3_exner_star() p3theta => get_p3theta() + ! Scaling constants (previously baked into the operators, now applied here) + const_u = get_tau_u_dt_cp(self%stepper) + const_t = get_tau_t_dt(self%stepper) + const_r = get_tau_r_dt(self%stepper) + minus_const_t = -const_t + select type (x) type is (r_solver_field_vector_type) select type (y) @@ -202,13 +231,15 @@ contains select case (eliminate_variables) case (eliminate_variables_discrete) - q32_op => get_eliminated_q32() + q32_rho_op => get_eliminated_q32_rho() if (optimised_operator) then call invoke( adj_apply_mixed_operator_kernel_type( yvec_uv, yvec_w, yvec_p, & xvec_uv, xvec_w, xvec_p, & ptheta2, mt_lumped_inv, & mm_vel, p2theta, div_star, m2_diag, & - m3_exner_star, q32_op, p3theta ), & + m3_exner_star, q32_rho_op, & + p3theta, & + const_u, const_t, const_r ), & setval_c( yvec_uv, 0.0_r_solver ) ) else t_fs => function_space_collection%get_fs( mesh, p_h, p_v, Wtheta ) @@ -217,11 +248,12 @@ contains enforce_bc_kernel_type(y_uvw), & adj_apply_elim_mixed_lp_operator_kernel_type( yvec_p, x_t, x_uvw, & xvec_p, m3_exner_star, & - q32_op, p3theta ), & + q32_rho_op, p3theta, const_r ), & adj_apply_mixed_lu_operator_kernel_type( y_uvw, x_uvw, x_t, xvec_p, & - mm_vel, p2theta, div_star, m2_diag ), & + mm_vel, p2theta, div_star, m2_diag, & + const_u ), & setval_c( y_uvw, 0.0_r_solver ), & - inc_aX_times_Y( minus_one, x_t, mt_lumped_inv ), & + inc_aX_times_Y( minus_const_t, x_t, mt_lumped_inv ), & adj_dg_inc_matrix_vector_kernel_type( x_t, x_uvw, Ptheta2 ), & setval_c( x_t, 0.0_r_solver ) ) end if diff --git a/science/adjoint/source/algorithm/solver/adj_mixed_schur_preconditioner_alg_mod.x90 b/science/adjoint/source/algorithm/solver/adj_mixed_schur_preconditioner_alg_mod.x90 index ca9d372251..ca0c2ca5b4 100644 --- a/science/adjoint/source/algorithm/solver/adj_mixed_schur_preconditioner_alg_mod.x90 +++ b/science/adjoint/source/algorithm/solver/adj_mixed_schur_preconditioner_alg_mod.x90 @@ -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. !----------------------------------------------------------------------------- !> @brief Adjoint of mixed_schur_preconditioner_alg_mod @@ -33,7 +36,10 @@ module adj_mixed_schur_preconditioner_alg_mod get_ptheta2v, & get_p3theta, & get_helm_diag, & - get_Hb_lumped_inv + get_Hb_lumped_inv, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt use solver_constants_mod, only: get_normalisation_r_solver use fs_continuity_mod, only: W2, W3, Wtheta use boundaries_config_mod, only: limited_area @@ -59,6 +65,7 @@ module adj_mixed_schur_preconditioner_alg_mod type(r_solver_field_vector_type) :: pressure_b type(r_solver_field_vector_type) :: pressure_x class(abstract_iterative_solver_type), pointer :: adj_pressure_solver + integer(kind=i_def) :: stepper contains procedure, public :: apply => apply_adj_mixed_schur_preconditioner procedure, private :: apply_adj_mixed_schur_preconditioner @@ -78,7 +85,8 @@ contains !> @param [in] p_h Horizontal element order for function spaces !> @param [in] p_v Vertical element order for function spaces !> @param [in] adj_pressure_solver Solver object for Helmholtz system - function adj_mixed_schur_preconditioner_ctor( mesh, p_h, p_v, adj_pressure_solver ) & + !> @param [in] stepper Timestepper enumerator used to select operators + function adj_mixed_schur_preconditioner_ctor( mesh, p_h, p_v, adj_pressure_solver, stepper ) & result(self) ! Note: name shortened from adj_mixed_schur_preconditioner_constructor as this ! causes "error #5462: Global name too long" @@ -88,6 +96,7 @@ contains integer(i_def), intent(in) :: p_h, p_v type(mesh_type), target, intent(in) :: mesh class(abstract_iterative_solver_type), target, intent(in) :: adj_pressure_solver + integer(i_def), intent(in) :: stepper type(adj_mixed_schur_preconditioner_type) :: self @@ -110,6 +119,7 @@ contains ! Set pressure solver self%adj_pressure_solver => adj_pressure_solver + self%stepper = stepper call log_event( 'done', LOG_LEVEL_DEBUG ) @@ -212,7 +222,8 @@ contains type(r_solver_operator_type), pointer :: m3_rho_star, ptheta2, p3theta, compound_div type(r_solver_field_type), pointer :: mt_lumped_inv, h_diag, Hb_lumped_inv type(r_solver_field_type) :: rhs_d - real(kind=r_solver), parameter :: minus_one = -1.0_r_solver + real(kind=r_solver) :: const_r, const_t + real(kind=r_solver) :: minus_const_r, minus_const_t type(r_solver_field_type) :: rhs_uvw integer(kind=i_def) :: mesh_id type(r_solver_field_type), pointer :: rhs_uv, rhs_p, rhs_w, rhs @@ -249,10 +260,15 @@ contains p3theta => get_p3theta() m3_rho_star => get_m3_rho_star() compound_div => get_compound_div() - Hb_lumped_inv => get_Hb_lumped_inv() + Hb_lumped_inv => get_Hb_lumped_inv(self%stepper) + + const_r = get_tau_r_dt(self%stepper) + const_t = get_tau_t_dt(self%stepper) + minus_const_r = -const_r + minus_const_t = -const_t if (normalise) then - h_diag => get_helm_diag() + h_diag => get_helm_diag(self%stepper) call invoke( name="adj_msp1", & inc_X_times_Y( rhs, h_diag ) ) end if @@ -274,7 +290,8 @@ contains mt_lumped_inv, rhs_d, & compound_div, p3theta, & ptheta2, m3_rho_star, & - minus_one, rhs_p ) ) + minus_const_r, & + minus_const_t, rhs_p ) ) else call log_event( "adj_build_pressure_rhs: element_orders /= 0 not coded", LOG_LEVEL_ERROR ) end if @@ -321,6 +338,7 @@ contains type(r_solver_operator_type), pointer :: div_star type(r_solver_field_type) :: u_inc integer(kind=i_def) :: mesh_id + real(kind=r_solver) :: const_u type(r_solver_field_type), pointer :: state_uv, state_p, state_w, exner_inc @@ -340,7 +358,10 @@ contains call u_inc%initialise(vector_space=self%rhs_u%get_function_space()) u_normalisation => get_normalisation_r_solver( W2, mesh_id ) div_star => get_div_star() - Hb_lumped_inv => get_Hb_lumped_inv() + Hb_lumped_inv => get_Hb_lumped_inv(self%stepper) + ! div_star is assembled unscaled; the D*p' reconstruction carries tau_u*dt*cp + ! in the forward model, so its adjoint carries the same constant. + const_u = get_tau_u_dt_cp(self%stepper) ! u' = ru + BC[HB * unorm * D * p'] if (split_w) then @@ -372,7 +393,7 @@ contains inc_X_plus_Y( self%rhs_u, u_inc ), & adj_scaled_matrix_vector_kernel_type( u_inc, exner_inc, & div_star, u_normalisation, & - Hb_lumped_inv ), & + Hb_lumped_inv, const_u ), & setval_c(u_inc, 0.0_r_solver) ) if ( LPROF ) call stop_timing( id, 'adj_schur_precon.back_sub' ) diff --git a/science/adjoint/source/algorithm/solver/adj_pressure_operator_alg_mod.x90 b/science/adjoint/source/algorithm/solver/adj_pressure_operator_alg_mod.x90 index 6fae394238..2738aab3cd 100644 --- a/science/adjoint/source/algorithm/solver/adj_pressure_operator_alg_mod.x90 +++ b/science/adjoint/source/algorithm/solver/adj_pressure_operator_alg_mod.x90 @@ -36,6 +36,7 @@ module adj_pressure_operator_alg_mod type, public, extends(abstract_hierarchical_linear_operator_type) :: adj_pressure_operator_type private integer(kind=i_def) :: level + integer(kind=i_def) :: stepper type(adj_solver_lookup_cache_type), pointer :: adj_lookup_table_cache_ptr contains procedure, public :: apply => apply_adj_pressure_operator @@ -55,12 +56,14 @@ contains !> @brief Construct new instance of type. !> @param[in] level The mesh level the space is on + !> @param[in] stepper Timestepper enumerator used to select operators !> @param[in] adj_lookup_table_cache The lookup table cache - function adj_pressure_operator_constructor(level, adj_lookup_table_cache) result(self) + function adj_pressure_operator_constructor(level, stepper, adj_lookup_table_cache) result(self) implicit none integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper type(adj_solver_lookup_cache_type), target, intent(in) :: adj_lookup_table_cache type(adj_pressure_operator_type) :: self @@ -68,6 +71,7 @@ contains ! Temporaries required in operator application self%level = level + self%stepper = stepper self%adj_lookup_table_cache_ptr => adj_lookup_table_cache call log_event( 'done', LOG_LEVEL_DEBUG ) @@ -86,6 +90,7 @@ contains ! Deep copy of the contents of the adj_pressure_operator_type dest%level = source%level + dest%stepper = source%stepper dest%adj_lookup_table_cache_ptr => source%adj_lookup_table_cache_ptr end subroutine adj_pressure_operator_assign @@ -137,7 +142,7 @@ contains end if if (element_order_h == 0 .and. element_order_v == 0) then - Helmholtz_operator => get_helmholtz_operator(self%level) + Helmholtz_operator => get_helmholtz_operator(self%stepper, self%level) lam_mesh = .false. if (limited_area .and. topology==topology_non_periodic) lam_mesh=.true. @@ -186,7 +191,7 @@ contains class(abstract_hierarchical_linear_operator_type), allocatable, intent(inout) :: coarse_operator allocate( coarse_operator, & - source = adj_pressure_operator_type(self%level + 1, self%adj_lookup_table_cache_ptr) ) + source = adj_pressure_operator_type(self%level + 1, self%stepper, self%adj_lookup_table_cache_ptr) ) end subroutine coarsen_adj_pressure_operator diff --git a/science/adjoint/source/algorithm/solver/adj_pressure_precon_alg_mod.x90 b/science/adjoint/source/algorithm/solver/adj_pressure_precon_alg_mod.x90 index dcffacd93d..583be8eacf 100644 --- a/science/adjoint/source/algorithm/solver/adj_pressure_precon_alg_mod.x90 +++ b/science/adjoint/source/algorithm/solver/adj_pressure_precon_alg_mod.x90 @@ -19,6 +19,7 @@ module adj_pressure_precon_alg_mod type, public, extends(abstract_hierarchical_preconditioner_type) :: adj_pressure_preconditioner_type integer(kind=i_def) :: level + integer(kind=i_def) :: stepper contains procedure, public :: apply => apply_adj_pressure_preconditioner @@ -42,19 +43,22 @@ module adj_pressure_precon_alg_mod contains !> @brief Constructs a adj_pressure_preconditioner_type object - !> @param[in] level Multigrid level + !> @param[in] level Multigrid level + !> @param[in] stepper Timestepper enumerator used to select operators !> @return self The constructed preconditioner object - function adj_pressure_preconditioner_constructor(level) result(self) + function adj_pressure_preconditioner_constructor(level, stepper) result(self) use log_mod, only: log_event, LOG_LEVEL_INFO implicit none integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper type(adj_pressure_preconditioner_type) :: self call log_event( 'Constructing adjoint pressure preconditioner...', LOG_LEVEL_INFO ) self%level = level + self%stepper = stepper call log_event( 'done', LOG_LEVEL_INFO ) end function adj_pressure_preconditioner_constructor @@ -70,6 +74,7 @@ contains class(adj_pressure_preconditioner_type), intent(out) :: dest dest%level = source%level + dest%stepper = source%stepper end subroutine adj_pressure_preconditioner_assign @@ -98,7 +103,7 @@ contains select type(y) type is(r_solver_field_vector_type) ! Multiply by inverse of vertical operator \f$ H_z \f$ (adjoint) - tri => get_tri_precon(self%level) + tri => get_tri_precon(self%stepper, self%level) x_vec => x%get_field_from_position(1) y_vec => y%get_field_from_position(1) call invoke(adj_tri_solve_kernel_type( y_vec, x_vec, tri )) @@ -121,7 +126,7 @@ contains class(adj_pressure_preconditioner_type), intent(inout) :: self class(abstract_hierarchical_preconditioner_type), allocatable, intent(inout) :: other - allocate( other, source=adj_pressure_preconditioner_type(self%level+1) ) + allocate( other, source=adj_pressure_preconditioner_type(self%level+1, self%stepper) ) end subroutine coarsen_adj_pressure_preconditioner diff --git a/science/adjoint/source/algorithm/solver/adj_semi_implicit_solver_alg_mod.x90 b/science/adjoint/source/algorithm/solver/adj_semi_implicit_solver_alg_mod.x90 index fb92980dd6..aeed458b3d 100644 --- a/science/adjoint/source/algorithm/solver/adj_semi_implicit_solver_alg_mod.x90 +++ b/science/adjoint/source/algorithm/solver/adj_semi_implicit_solver_alg_mod.x90 @@ -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. !----------------------------------------------------------------------------- !> @brief Adjoint of semi_implicit_solver_alg_mod @@ -70,6 +73,7 @@ module adj_semi_implicit_solver_alg_mod class(abstract_preconditioner_type), allocatable :: adj_mixed_preconditioner class(abstract_iterative_solver_type), allocatable :: adj_mixed_solver type(adj_mixed_operator_type) :: adj_mixed_operator + integer(kind=i_def) :: stepper contains procedure, public :: initialise procedure, public :: step @@ -92,8 +96,10 @@ contains !> @param[in] adj_lookup_table_cache The lookup table cache !> @param[out] adj_pressure_operator_out Output adjoint (Helmholtz) pressure operator !> @param[out] adj_pressure_preconditioner_out Output adjoint (Helmholtz) pressure preconditioner + !> @param[in] stepper Time stepper enumerator used to select operators subroutine create_adj_pressure_preconditioner( state, adj_lookup_table_cache, & - adj_pressure_operator_out, adj_pressure_preconditioner_out ) + adj_pressure_operator_out, adj_pressure_preconditioner_out, & + stepper ) use helmholtz_solver_config_mod, only: helmholtz_preconditioner => preconditioner, & preconditioner_none, & @@ -110,6 +116,9 @@ contains type(adj_pressure_operator_type), intent(out) :: adj_pressure_operator_out class(abstract_preconditioner_type), allocatable, intent(out) :: adj_pressure_preconditioner_out + ! Timestepper enumerator + integer(kind=i_def), intent(in) :: stepper + ! Vertical pressure preconditioner type(adj_pressure_preconditioner_type) :: adj_helmholtz_preconditioner @@ -117,7 +126,7 @@ contains level = 1_i_def - adj_pressure_operator_out = adj_pressure_operator_type(level, adj_lookup_table_cache) + adj_pressure_operator_out = adj_pressure_operator_type(level, stepper, adj_lookup_table_cache) call log_event( "adj_semi_implicit_solver_type%create_adj_pressure_preconditioner: starting", LOG_LEVEL_INFO ) @@ -128,9 +137,9 @@ contains source = null_preconditioner_type() ) case(PRECONDITIONER_TRIDIAGONAL) allocate( adj_pressure_preconditioner_out, & - source = adj_pressure_preconditioner_type(level=1_i_def) ) + source = adj_pressure_preconditioner_type(level=1_i_def, stepper=stepper) ) case(PRECONDITIONER_MULTIGRID) - adj_helmholtz_preconditioner = adj_pressure_preconditioner_type(level=1_i_def) + adj_helmholtz_preconditioner = adj_pressure_preconditioner_type(level=1_i_def, stepper=stepper) allocate( adj_pressure_preconditioner_out, & source = multigrid_preconditioner_type( state(igh_p)%get_function_space(), & adj_pressure_operator_out, & @@ -191,7 +200,8 @@ contains !> @param[in] state Prognostic state for the adjoint solver !> @param[in] adj_pressure_solver_in Input adjoint (Helmholtz) pressure solver !> @param[out] adj_mixed_preconditioner_out Output adjoint mixed preconditioner - subroutine create_adj_mixed_preconditioner( state, adj_pressure_solver_in, adj_mixed_preconditioner_out ) + !> @param[in] stepper Timestepper enumerator used to select operators + subroutine create_adj_mixed_preconditioner( state, adj_pressure_solver_in, adj_mixed_preconditioner_out, stepper ) implicit none @@ -204,6 +214,9 @@ contains ! Output adjoint preconditioner for mixed problem class(abstract_preconditioner_type), allocatable, intent(out) :: adj_mixed_preconditioner_out + ! Time stepper enumerator + integer(kind=i_def), intent(in) :: stepper + call log_event( "adj_semi_implicit_solver_type%create_adj_mixed_preconditioner: starting", LOG_LEVEL_INFO ) select case(si_preconditioner) @@ -212,7 +225,8 @@ contains source = adj_mixed_schur_preconditioner_type( state(igh_u)%get_mesh(), & state(igh_u)%get_element_order_h(), & state(igh_u)%get_element_order_v(), & - adj_pressure_solver_in ) ) + adj_pressure_solver_in, & + stepper ) ) case(SI_PRECONDITIONER_NONE) allocate ( adj_mixed_preconditioner_out, & source = null_preconditioner_type() ) @@ -229,7 +243,8 @@ contains !> @param[in] adj_mixed_preconditioner_in Input adjoint mixed preconditioner !> @param[in,out] adj_mixed_operator_out Output adjoint mixed operator (not explicitly set, so must be inout) !> @param[out] adj_mixed_solver_out Output adjoint mixed solver - subroutine create_adj_mixed_solver( adj_mixed_preconditioner_in, adj_mixed_operator_out, adj_mixed_solver_out ) + !> @param[in] stepper Time stepper enumerator used to select operators + subroutine create_adj_mixed_solver( adj_mixed_preconditioner_in, adj_mixed_operator_out, adj_mixed_solver_out, stepper ) implicit none @@ -240,8 +255,16 @@ contains type(adj_mixed_operator_type), intent(inout) :: adj_mixed_operator_out class(abstract_iterative_solver_type), allocatable, intent(out) :: adj_mixed_solver_out + ! Time stepper enumerator + integer(kind=i_def), intent(in) :: stepper + call log_event( "adj_semi_implicit_solver_type%create_adj_mixed_solver: starting", LOG_LEVEL_INFO ) + ! Store the stepper enumerator on the adjoint mixed operator so that it can + ! obtain the correct operator scaling constants when applied + adj_mixed_operator_out = adj_mixed_operator_type( stepper ) + + select case(si_method) case(SI_METHOD_BLOCK_GCR) allocate ( adj_mixed_solver_out, & @@ -263,7 +286,7 @@ contains !> @brief Initialisation procedure for the adjoint semi-implicit solver !> @param[in] state Prognostic state for the solver - subroutine initialise( self, state, adj_lookup_table_cache ) + subroutine initialise( self, state, adj_lookup_table_cache, stepper ) implicit none @@ -271,14 +294,18 @@ contains class(adj_semi_implicit_solver_type), intent(inout) :: self type(field_type), dimension(bundle_size), intent(in) :: state type(adj_solver_lookup_cache_type), intent(in) :: adj_lookup_table_cache + integer(kind=i_def), intent(in) :: stepper + + self%stepper = stepper call create_adj_pressure_preconditioner( state, & adj_lookup_table_cache, & self%adj_pressure_operator, & - self%adj_pressure_preconditioner ) + self%adj_pressure_preconditioner, & + stepper ) call create_adj_pressure_solver( self%adj_pressure_operator, self%adj_pressure_preconditioner, self%adj_pressure_solver ) - call create_adj_mixed_preconditioner( state, self%adj_pressure_solver, self%adj_mixed_preconditioner ) - call create_adj_mixed_solver( self%adj_mixed_preconditioner, self%adj_mixed_operator, self%adj_mixed_solver ) + call create_adj_mixed_preconditioner( state, self%adj_pressure_solver, self%adj_mixed_preconditioner, stepper ) + call create_adj_mixed_solver( self%adj_mixed_preconditioner, self%adj_mixed_operator, self%adj_mixed_solver, stepper ) call log_event( "adj_semi_implicit_solver_type%initialise: Initialised adjoint semi-implicit solver", LOG_LEVEL_INFO ) @@ -312,7 +339,8 @@ contains use solver_constants_mod, only: get_normalisation_r_solver, get_im3_div_r_solver, get_normalisation use mr_indices_mod, only: nummr use si_operators_alg_mod, only: get_m3_rho_star, get_rho_at_u, & - get_p2theta, get_p3theta, get_ptheta2 + get_p2theta, get_p3theta, get_ptheta2, & + get_tau_u_dt_cp, get_tau_t_dt use matrix_vector_kernel_mod, only: matrix_vector_kernel_type use adj_matrix_vector_kernel_mod, only: adj_matrix_vector_kernel_type use dg_matrix_vector_kernel_mod, only: dg_matrix_vector_kernel_type @@ -347,6 +375,7 @@ contains p3theta, p2theta, ptheta2 type(field_type) :: f_star_rdef real(kind=r_solver) :: tau_r_dt + real(kind=r_solver) :: const_u, const_t real(kind=r_def) :: tau_r_dt_rdef integer(kind=i_def) :: mesh_id type(integer_field_type), pointer :: face_selector_ew, face_selector_ns @@ -360,6 +389,9 @@ contains mesh_id = state(igh_p)%get_mesh_id() + const_u = get_tau_u_dt_cp(self%stepper) + const_t = get_tau_t_dt(self%stepper) + ! Normalise theta & u residual t_normalisation => get_normalisation( Wtheta, mesh_id ) u_normalisation => get_normalisation( W2, mesh_id ) @@ -405,7 +437,8 @@ contains if (eliminate_variables == eliminate_variables_analytic) then call log_event( "adj_semi_implicit_solver_type%step: eliminate_variables_analytic not coded", LOG_LEVEL_ERROR ) else - call invoke( inc_X_times_Y(rhs_tmp, mt_lumped_inv) ) + call invoke( inc_X_times_Y(rhs_tmp, mt_lumped_inv), & + inc_a_times_X(const_t, rhs_tmp) ) end if ! Compute theta increment since solver does not provide one @@ -495,6 +528,7 @@ contains setval_c( rhs_tmp, 0.0_r_solver ), & enforce_bc_kernel_type(rhs_rsol(igh_u)), & inc_X_plus_Y( rhs_tmp, rhs_rsol(igh_u) ), & + inc_a_times_X( const_u, rhs_tmp ), & inc_X_times_Y( rhs_tmp, m2_diag ), & adj_matrix_vector_kernel_type( rhs_tmp, rhs_rsol(igh_t), p2theta ), & setval_c( rhs_tmp, 0.0_r_solver ), & diff --git a/science/adjoint/source/algorithm/timestepping/atl_si_timestep_alg_mod.x90 b/science/adjoint/source/algorithm/timestepping/atl_si_timestep_alg_mod.x90 index 816e78312b..e21868a25e 100644 --- a/science/adjoint/source/algorithm/timestepping/atl_si_timestep_alg_mod.x90 +++ b/science/adjoint/source/algorithm/timestepping/atl_si_timestep_alg_mod.x90 @@ -19,7 +19,7 @@ module atl_si_timestep_alg_mod use_physics, use_wavedynamics use mixed_solver_config_mod, only: guess_np1, reference_reset_time use timestepping_config_mod, only: alpha, spinup_alpha, & - outer_iterations, inner_iterations + outer_iterations, inner_iterations_si use linear_config_mod, only: fixed_ls, & l_stabilise_bl, & n_bl_levels_to_stabilise, & @@ -48,7 +48,9 @@ module atl_si_timestep_alg_mod use adj_solver_lookup_cache_mod, only: adj_solver_lookup_cache_type use adj_trans_lookup_cache_mod, only: adj_trans_lookup_cache_type use atl_transport_control_alg_mod, only: atl_transport_control_alg - use si_operators_alg_mod, only: compute_si_operators + use si_operators_alg_mod, only: compute_si_operators_common, & + compute_helmholtz_operators + use dycore_constants_mod, only: stepper_siqn use semi_implicit_solver_alg_mod, only: semi_implicit_solver_alg_step use adj_semi_implicit_solver_alg_mod, only: adj_semi_implicit_solver_type use derive_exner_from_eos_alg_mod, only: derive_exner_from_eos @@ -108,7 +110,8 @@ module atl_si_timestep_alg_mod type(field_type), allocatable :: ls_rhs_phys(:,:,:) type(field_type), allocatable :: ls_mr_itns(:,:,:) type(field_type), allocatable :: ls_moist_dyn_itns(:,:,:) - integer( i_def ) :: ls_outer_iterations, ls_inner_iterations + integer( i_def ), allocatable :: ls_inner_iterations(:) + integer( i_def ) :: ls_outer_iterations ! theta_fv transport increment to change to weak form type(field_type) :: theta_fv_inc @@ -171,12 +174,14 @@ contains ! but ls_outer_iterations and ls_inner_iterations are set to ! 1 so that the arrays are defined. self%ls_outer_iterations = 1_i_def - self%ls_inner_iterations = 1_i_def + if (.not. allocated(self%ls_inner_iterations)) allocate(self%ls_inner_iterations(1)) + self%ls_inner_iterations(:) = 1_i_def else ! The linearisation state is evolved, and the intermediate iterations ! are used to calculate the evolution of the perturbation. self%ls_outer_iterations = outer_iterations - self%ls_inner_iterations = inner_iterations + if (.not. allocated(self%ls_inner_iterations)) allocate(self%ls_inner_iterations(outer_iterations)) + self%ls_inner_iterations(:) = inner_iterations_si(:) end if allocate(self%state(bundle_size)) @@ -207,13 +212,20 @@ contains allocate(self%ls_mr_n(nummr)) allocate(self%ls_mr_after_slow(nummr)) - allocate(self%ls_state_itns( bundle_size, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_rhs_np1( bundle_size, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_rhs_adv( bundle_size, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_rhs_phys( bundle_size, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_mr_inc( nummr, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_mr_itns( nummr, self%ls_outer_iterations, self%ls_inner_iterations )) - allocate(self%ls_moist_dyn_itns( num_moist_factors, self%ls_outer_iterations, self%ls_inner_iterations )) + allocate(self%ls_state_itns( bundle_size, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_rhs_np1( bundle_size, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_rhs_adv( bundle_size, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_rhs_phys( bundle_size, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_mr_inc( nummr, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_mr_itns( nummr, self%ls_outer_iterations, & + maxval(self%ls_inner_iterations) )) + allocate(self%ls_moist_dyn_itns( num_moist_factors, & + self%ls_outer_iterations, maxval(self%ls_inner_iterations) )) ! Initialise internal state field objects @@ -249,7 +261,7 @@ contains call clone_bundle( self%state, self%ls_rhs_n, bundle_size ) do outer = 1, self%ls_outer_iterations - do inner = 1, self%ls_inner_iterations + do inner = 1, self%ls_inner_iterations(outer) call clone_bundle( self%state, self%ls_state_itns(:,outer,inner), bundle_size ) call clone_bundle( self%state, self%ls_rhs_np1(:,outer,inner), bundle_size ) call clone_bundle( self%state, self%ls_rhs_adv(:,outer,inner), bundle_size ) @@ -274,7 +286,7 @@ contains call clone_bundle( ls_mr, self%ls_mr_after_slow, nummr ) do outer = 1, self%ls_outer_iterations - do inner = 1, self%ls_inner_iterations + do inner = 1, self%ls_inner_iterations(outer) call clone_bundle( ls_moist_dyn, self%ls_moist_dyn_itns(:,outer,inner), num_moist_factors ) call clone_bundle( ls_mr, self%ls_mr_itns(:,outer,inner), nummr ) if (self%use_moisture) call clone_bundle( ls_mr, self%ls_mr_inc(:,outer,inner), nummr ) @@ -289,7 +301,7 @@ contains call self%adj_solver_lookup_cache%initialise(u%get_mesh()) call self%adj_trans_lookup_cache%initialise(config, u%get_mesh()) - call self%adj_semi_implicit_solver%initialise(self%state, self%adj_solver_lookup_cache) + call self%adj_semi_implicit_solver%initialise(self%state, self%adj_solver_lookup_cache, stepper_siqn) call log_event( "atl_si_timestep_type%init: initialised timestepping algorithm", LOG_LEVEL_INFO ) @@ -402,9 +414,10 @@ contains ! Note that this reset can only occur at most once per timestep. reference_reset_freq = nint( reference_reset_time / cast_dt, i_def ) if (mod( modeldb%clock%get_step() - 1_i_def, reference_reset_freq ) == 0_i_def) then - call compute_si_operators( modeldb%config, self%ls_state(igh_t), & - self%ls_state(igh_d), self%ls_state(igh_p), & - modeldb%clock, self%ls_moist_dyn_itns(:,1,1) ) + call compute_si_operators_common( modeldb%config, self%ls_state(igh_t), & + self%ls_state(igh_d), self%ls_state(igh_p), & + self%ls_moist_dyn_itns(:,1,1) ) + call compute_helmholtz_operators( modeldb%clock, stepper_siqn ) end if ! Compute the time-level n dynamics terms @@ -416,7 +429,8 @@ contains self%ls_state_after_slow, self%ls_state_n, & self%ls_moist_dyn_itns(:,1,1), & compute_eos=.false., compute_rhs_t_d=.true., & - dlayer_rhs=.false., model_clock=modeldb%clock ) + dlayer_rhs=.false., stepper=stepper_siqn, & + model_clock=modeldb%clock ) if (.not. si_momentum_equation) call mass_matrix_solver_alg( self%ls_advected_state(igh_u), self%ls_rhs_n(igh_u) ) @@ -436,6 +450,7 @@ contains self%ls_mr_itns(:,outer,1), & self%ls_mr_after_slow(:), & modeldb%clock, outer, & + stepper_siqn, & cheap_update=.false. ) ! Convert theta increment to weak form @@ -458,10 +473,10 @@ contains !----------------------------------------------------------------------- ! Start the inner (nonlinear, Coriolis) loop !----------------------------------------------------------------------- - ls_inner_dynamics_loop: do inner = 1,self%ls_inner_iterations + ls_inner_dynamics_loop: do inner = 1,self%ls_inner_iterations(outer) ! Calculate the counters for the next iteration - if (inner == inner_iterations) then + if (inner == inner_iterations_si(outer)) then next_inner = 1 next_outer = outer + 1 else @@ -471,7 +486,7 @@ contains ! Only intermediate iterations are required for the adjoint and not ! the final iteration so the final loop of the nonlinear isn't required - if (next_outer <= outer_iterations .and. next_inner <= inner_iterations) then + if (next_outer <= outer_iterations .and. next_inner <= inner_iterations_si(outer)) then ! Compute the time-level n + 1 dynamics terms call rhs_alg( self%ls_rhs_np1(:,outer,inner), & @@ -482,6 +497,7 @@ contains compute_eos=.true., & compute_rhs_t_d=.true., & dlayer_rhs=dlayer_on, & + stepper=stepper_siqn, & model_clock=modeldb%clock ) ! Compute the LAM LBCs and RHS @@ -540,7 +556,7 @@ contains dry_flux_solver, & self%ls_moist_dyn_itns(gas_law, next_outer, next_inner), & self%ls_mr_itns(:,next_outer,next_inner), & - first_iteration=(inner==1) ) + first_iteration=(inner==1), stepper=stepper_siqn ) ! If not already done, update factors for moist dynamics if (.not. guess_np1 .and. self%use_moisture) then call moist_dyn_factors_alg( self%ls_moist_dyn_itns(:,next_outer,next_inner), & @@ -629,7 +645,7 @@ contains !------------------------------------------------------------------------- ! Start the inner (nonlinear, Coriolis) loop !------------------------------------------------------------------------- - inner_dynamics_loop: do inner = inner_iterations, 1, -1 + inner_dynamics_loop: do inner = inner_iterations_si(outer), 1, -1 if (fixed_ls) then ls_inner = 1 @@ -693,6 +709,7 @@ contains self%ls_moist_dyn_itns(:,ls_outer,ls_inner), & .true., & dlayer_on, & + stepper_siqn, & modeldb%clock ) call add_bundle( self%state, self%state2, self%state, bundle_size ) @@ -734,6 +751,7 @@ contains self%ls_moist_dyn_itns(:,ls_outer,1), & .true., & dlayer_on, & + stepper_siqn, & modeldb%clock ) call add_bundle( self%state, self%state2, self%state, bundle_size ) @@ -757,6 +775,7 @@ contains self%ls_mr_after_slow, & modeldb%clock, & outer, & + stepper_siqn, & self%adj_trans_lookup_cache ) ! advected_state finished with end do outer_dynamics_loop @@ -780,7 +799,8 @@ contains call atl_rhs_alg( self%rhs_n, varbeta * cast_dt, self%state_after_slow, & self%state_n, moist_dyn, self%ls_state_n, & - self%ls_moist_dyn_itns(:, 1,1), .false., .false., modeldb%clock ) + self%ls_moist_dyn_itns(:, 1,1), .false., .false., & + stepper_siqn, modeldb%clock ) call copy_bundle( self%state, self%state_copy, bundle_size ) call add_bundle( self%state_copy, self%state_after_slow, self%state, bundle_size ) @@ -858,6 +878,8 @@ contains if (allocated(self%ls_mr_itns)) deallocate(self%ls_mr_itns) if (allocated(self%ls_moist_dyn_itns)) deallocate(self%ls_moist_dyn_itns) + if (allocated(self%ls_inner_iterations)) deallocate(self%ls_inner_iterations) + call self%adj_solver_lookup_cache%finalise() call self%adj_trans_lookup_cache%finalise() diff --git a/science/adjoint/source/algorithm/transport/control/atl_transport_control_alg_mod.x90 b/science/adjoint/source/algorithm/transport/control/atl_transport_control_alg_mod.x90 index fe76e16cc3..76c3cc129b 100644 --- a/science/adjoint/source/algorithm/transport/control/atl_transport_control_alg_mod.x90 +++ b/science/adjoint/source/algorithm/transport/control/atl_transport_control_alg_mod.x90 @@ -57,13 +57,15 @@ contains !> @param[in] ls_mr_in PASSIVE Moisture fields before transport !> @param[in] model_clock Time within the model !> @param[in] outer Outer (advection) iteration number + !> @param[in] stepper Enumerator for timestepper !> @param[in] adj_lookup_table_cache Lookup table cache !> subroutine atl_transport_control_alg(config, advection_inc, advected_fields, & wind_np1, wind_n, mr_out, mr_in, & ls_advected_fields, & ls_wind_np1, ls_wind_n, ls_mr_in, & - model_clock, outer, adj_lookup_table_cache ) + model_clock, outer, stepper, & + adj_lookup_table_cache ) use derived_config_mod, only: bundle_size use sci_field_bundle_builtins_mod, only: clone_bundle, set_bundle_scalar @@ -98,6 +100,7 @@ contains type(field_type), intent(in) :: ls_mr_in(nummr) class(model_clock_type), intent(in) :: model_clock integer(kind=i_def), intent(in) :: outer + integer(kind=i_def), intent(in) :: stepper type(adj_trans_lookup_cache_type), intent(in) :: adj_lookup_table_cache ! Internal variables @@ -145,8 +148,9 @@ contains setval_c( zero_wind_n, 0.0_r_def ), & setval_c( zero_wind_np1, 0.0_r_def ) ) - call tl_transport_controller%initialise( config, & - model_clock, zero_adv_fields, ls_advected_fields(igh_d), & + call tl_transport_controller%initialise( & + config, model_clock, stepper, & + zero_adv_fields, ls_advected_fields(igh_d), & zero_wind_n, zero_wind_np1, ls_wind_n, ls_wind_np1, & outer=outer, cheap_update_step=cheap_update_step ) diff --git a/science/adjoint/source/kernel/solver/adj_scaled_matrix_vector_kernel_mod.F90 b/science/adjoint/source/kernel/solver/adj_scaled_matrix_vector_kernel_mod.F90 index ad2ffa2ac3..4ad527c239 100644 --- a/science/adjoint/source/kernel/solver/adj_scaled_matrix_vector_kernel_mod.F90 +++ b/science/adjoint/source/kernel/solver/adj_scaled_matrix_vector_kernel_mod.F90 @@ -8,7 +8,7 @@ module adj_scaled_matrix_vector_kernel_mod use argument_mod, only: arg_type, & - GH_FIELD, GH_OPERATOR, GH_REAL, & + GH_FIELD, GH_OPERATOR, GH_REAL, GH_SCALAR, & GH_READ, GH_READWRITE, GH_INC, & CELL_COLUMN use constants_mod, only: i_def, r_solver @@ -23,12 +23,13 @@ module adj_scaled_matrix_vector_kernel_mod type, public, extends(kernel_type) :: adj_scaled_matrix_vector_kernel_type private - type(ARG_TYPE) :: META_ARGS(5) = (/ & + type(ARG_TYPE) :: META_ARGS(6) = (/ & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & arg_type(GH_FIELD, GH_REAL, GH_READWRITE, W3), & arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & + arg_type(GH_SCALAR, GH_REAL, GH_READ) & /) integer :: operates_on = CELL_COLUMN contains @@ -54,6 +55,7 @@ module adj_scaled_matrix_vector_kernel_mod !> @param[in] matrix Local matrix assembly form of the operator A !> @param[in] y Field to scale output by !> @param[in] z Second field to scale output by +!> @param[in] scalar Scalar to scale output by !> @param[in] ndf1 No. degrees of freedom per cell for y/z/lhs !> @param[in] undf1 Unique no. degrees of freedom for y/z/lhs !> @param[in] map1 Dofmap for cell at base of column for y/z/lhs @@ -64,6 +66,7 @@ subroutine adj_scaled_matrix_vector_code(cell, nlayers, lhs, & x, & ncell_3d, & matrix, y, z, & + scalar, & ndf1, undf1, map1, & ndf2, undf2, map2) @@ -76,6 +79,7 @@ subroutine adj_scaled_matrix_vector_code(cell, nlayers, lhs, & integer(kind=i_def), intent(in) :: ncell_3d, ndf1, ndf2 real(kind=r_solver), intent(in) :: matrix(ncell_3d,ndf1,ndf2) real(kind=r_solver), intent(in) :: y(undf1), z(undf1) + real(kind=r_solver), intent(in) :: scalar integer(kind=i_def), dimension(ndf1), intent(in) :: map1(ndf1), map2(ndf2) ! Local variables @@ -89,7 +93,7 @@ subroutine adj_scaled_matrix_vector_code(cell, nlayers, lhs, & do k = nlayers - 1, 0, -1 ik = cell * nlayers + k - nlayers + 1 x(k + map2(df2)) = x(k + map2(df2)) + & - matrix( ik, df, df2 ) * lhs(map1(df) + k) & + scalar * matrix( ik, df, df2 ) * lhs(map1(df) + k) & * y(k + map1(df)) * z(k + map1(df)) end do end do diff --git a/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf b/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf index 335d8e89b4..f8bb470326 100644 --- a/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf +++ b/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf @@ -5968,114 +5968,188 @@ type=real #============================================================================== [namelist:timestepping=alpha] compulsory=true -description=?????? -help=Time off-centering parameter +description=Off-centering parameter for the Semi-Implicit timestepping scheme +help=This controls the implicitness of the Semi-Implicit timestepping scheme. + =A value of 0.5 corresponds to a Crank-Nicolson scheme, while a value of 1.0 + =corresponds to a fully implicit scheme. !kind=default -sort-key=Panel-A03 +range=0.0:1.0 +sort-key=Panel-A04 type=real [!namelist:timestepping=beta] compulsory=false expression=1.0_r_def - namelist:timestepping=alpha -help=?????? - =?????? +help=The explicitness parameter for the Semi-Implicit timestepping scheme. This + =is calculated as 1 - alpha, where alpha is the off-centering parameter. !kind=default type=real -[namelist:timestepping=inner_iterations] +[namelist:timestepping=inner_iterations_bdf2] +!bounds=namelist:timestepping=outer_iterations compulsory=true -description=?????? +description=Number of inner Newton iterations to perform in BDF stage of TR-BDF2 fail-if=this < 1 ; -help=Number of inner (Newton) iterations to do +help=The stages of the TR-BDF2 timestepping scheme involve two nested loops. The + =inner loop calls the implicit forcing terms and the linear solver, and the + =number of iterations can vary between outer loops. !kind=default +length=: range=1: -sort-key=Panel-A08 +sort-key=Panel-A03c +type=integer + +[namelist:timestepping=inner_iterations_si] +!bounds=namelist:timestepping=outer_iterations +compulsory=true +description=Number of inner Newton iterations to perform in Semi-Implicit scheme +fail-if=this < 1 ; +help=The Semi-Implicit timestepping scheme involves two nested loops. The inner + =loop calls the implicit forcing terms and the linear solver, and the number + =of iterations can vary between outer loops. +!kind=default +length=: +range=1: +sort-key=Panel-A03b +type=integer + +[namelist:timestepping=inner_iterations_tr] +!bounds=namelist:timestepping=outer_iterations +compulsory=true +description=Number of inner Newton iterations to perform in TR stage of TR-BDF2 +fail-if=this < 1 ; +help=The stages of the TR-BDF2 timestepping scheme involve two nested loops. The + =inner loop calls the implicit forcing terms and the linear solver, and the + =number of iterations can vary between outer loops. +!kind=default +length=: +range=1: +sort-key=Panel-A03b type=integer [namelist:timestepping=method] compulsory=true -description=Use either explicit Runge-Kutta timestepping or (iterative-) Semi-Implicit scheme +description=The overall timestepping algorithm to use !enumeration=true -help=Set the timestepping method for the GungHo dynamical core, either a fully explicit multi-stage - =Runge-Kutta method ('rk') or an (iterative-) Semi-Implicit scheme ('semi_implicit'). - =It is also possible to set 'no_timestepping'. There are no calls to dynamics or physics and the prognostic fields remain the same. However, time-varying fields such as ancillaries, and LBCs are still updated on each timestep, and diagnostics are output. - ='no_timestepping' is intended as a temporary switch required for basic-ral development. - =But it may also be useful for testing the tangent linear in 4DVar. +help=Set the timestepping method for the GungHo dynamical core, and its + =interaction with physics schemes. Options are: + =Runge-Kutta: an explicit multi-stage method. Note that this has + = not been implemented with physics schemes. + =Semi-Implicit: the Semi-Implicit Quasi-Newton timestepping scheme is + = designed as GungHo's default. It has evolved from ENDGame's + = timestepping scheme, which combines an off-centered + = Crank-Nicolson scheme with a Semi-Lagrangian treatment of + = transport (in GungHo transport can be an Eulerian or Semi- + = Lagrangian). + = The Semi=Implicit scheme consists of a nested outer loop + = (which includes transport and fast physics), and an inner + = loop which calls the linear solver. This scheme uses an off- + = centering parameter alpha to control the implicitness. + =TR-BDF2: a two-stage semi-implicit method, using a Quasi-Newton iterative + = structure like the Semi-Implicit scheme. The Trapezoidal (TR) and + = Backwards Difference (BDF2) stages each takes the form of a Semi- + = Implicit step. There is no off-centering parameter which improves + = accuracy. + =JULES: a timestepping scheme which calls the standalone JULES surface + = scheme without coupling to a dynamical core. + =No-Timestepping: a null timestepping scheme, which does not call the + = dynamics or physics schemes. However, time-varying fields + = such as ancillaries, and LBCs are still updated on each + = timestep, and diagnostics are output. sort-key=Panel-A01 trigger=namelist:timestepping=tau_t: 'semi_implicit' ; =namelist:timestepping=tau_r: 'semi_implicit' ; + =namelist:timestepping=tau_u: 'semi_implicit' ; =semi-implicit: 'semi_implicit' ; - =namelist:timestepping=outer_iterations: 'semi_implicit', 'jules' ; - =namelist:timestepping=inner_iterations: 'semi_implicit' ; -value-titles=Semi-implicit, Runge-Kutta, No-timestepping, JULES -values='semi_implicit', 'rk', 'no_timestepping', 'jules' + =namelist:timestepping=outer_iterations: 'semi_implicit', 'jules', 'tr_bdf2'; + =namelist:timestepping=inner_iterations_si: 'semi_implicit' ; + =namelist:timestepping=inner_iterations_tr: 'tr_bdf2' ; + =namelist:timestepping=inner_iterations_bdf2: 'tr_bdf2' ; +value-titles=Semi-implicit, TR-BDF2, Runge-Kutta, No-timestepping, JULES +values='semi_implicit', 'tr_bdf2', 'rk', 'no_timestepping', 'jules' [namelist:timestepping=outer_iterations] compulsory=true -description=?????? +description=Number of outer iterations to perform in Quasi-Newton schemes. fail-if=this < 1 ; -help=Number of outer (advection) iterations to do +help=The Semi-Implicit and TR-BDF2 timestepping schemes involve two nested + =loops. The outer loop includes transport and fast physics terms. This + =parameter controls the number of iterations to perform for the outer loop. !kind=default range=1: -sort-key=Panel-A07 +sort-key=Panel-A03a type=integer [namelist:timestepping=runge_kutta_method] compulsory=true -description=????? +description=Choice of Runge-Kutta method !enumeration=true fail-if= -help=????? - =????? +help=Several Runge-Kutta methods are available for either timestepping the whole + =dynamical core, or for use with the Method-of-Lines transport scheme. + =The Strong Stability Preserving (SSP) methods are explicit multi-stage + =methods which combine the values over multiple stages as a weighted linear + =sum to provide stability. ns=namelist/Job/Timestepping/runge kutta -sort-key=Panel-A01 -value-titles=Foward Euler, - =Stong Stability Preserving: Order-2, - =Stong Stability Preserving: Order-3, - =Stong Stability Preserving: Order-4, - =Stong Stability Preserving: Order-5 +sort-key=Panel-A05 +value-titles=Forward Euler, + =Strong Stability Preserving: Order-2, + =Strong Stability Preserving: Order-3, + =Strong Stability Preserving: Order-4, + =Strong Stability Preserving: Order-5 values='forward_euler', 'ssp2', 'ssp3', 'ssp4', 'ssp5' [namelist:timestepping=spinup_alpha] compulsory=true -description=?????? -help=If true then spin up alpha over the spin up period +description=Whether to enforce alpha=1 during the spin up period +help=If true the Semi-Implicit off-centering parameter is set to 1 (fully + =implicit) during the spin up period, to improve stability. !kind=default -sort-key=Panel-A11 +sort-key=Panel-A07 trigger=namelist:timestepping=spinup_period: .true.; type=logical [namelist:timestepping=tau_r] compulsory=true -description=?????? +description=Relaxation parameter for density in the Semi-Implicit scheme fail-if=this < 0.0 -help=Relaxation parameter for density in semi-implicit method +help=The relaxation parameters give the implicitness weighting of semi-implicit + =terms (e.g. transport or forcing terms) in the left-hand side of the linear + =solver. When using more than one Quasi-Newton inner iteration, it is + =recommended to set tau_r=1, as the density transport term is not updated + =between inner iterations. !kind=default ns=namelist/Job/Timestepping/semi-implicit range=0.0: -sort-key=Panel-A06 +sort-key=Panel-A06b type=real [namelist:timestepping=tau_t] compulsory=true -description=?????? +description=Relaxation parameter for potential temperature in the Semi-Implicit scheme fail-if=this < 0.0 -help=Relaxation parameter for potential temperature in semi-implicit method +help=The relaxation parameters give the implicitness weighting of semi-implicit + =terms (e.g. transport or forcing terms) in the left-hand side of the linear + =solver. When using more than one Quasi-Newton inner iteration, it is + =recommended to set tau_t=1, as the potential temperature transport term is + =not updated between inner iterations. !kind=default ns=namelist/Job/Timestepping/semi-implicit range=0.0: -sort-key=Panel-A05 +sort-key=Panel-A06c type=real [namelist:timestepping=tau_u] compulsory=true -description=?????? +description=Relaxation parameter for velocity in the Semi-Implicit scheme fail-if=this < 0.0 -help=Relaxation parameter for velocity in semi-implicit method +help=The relaxation parameters give the implicitness weighting of semi-implicit + =terms (e.g. transport or forcing terms) in the left-hand side of the linear + =solver. It is recommended to set tau_u=alpha, the off-centering parameter. !kind=default ns=namelist/Job/Timestepping/semi-implicit range=0.0: -sort-key=Panel-A04 +sort-key=Panel-A06a type=real #============================================================================== diff --git a/science/gungho/rose-meta/lfric-gungho/versions.py b/science/gungho/rose-meta/lfric-gungho/versions.py index 01e65a2b91..f72fe3c3a7 100644 --- a/science/gungho/rose-meta/lfric-gungho/versions.py +++ b/science/gungho/rose-meta/lfric-gungho/versions.py @@ -20,14 +20,55 @@ def __repr__(self): """ Copy this template and complete to add your macro - class vnXX_txxx(MacroUpgrade): # Upgrade macro for by - BEFORE_TAG = "vnX.X" AFTER_TAG = "vnX.X_txxx" - def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ + + +class vn32_t714(MacroUpgrade): + """Upgrade macro for ticket #714 by Thomas Bendall.""" + + BEFORE_TAG = "vn3.2" + AFTER_TAG = "vn3.2_t714" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-gungho + # Semi-Implicit setting changes ---------------------------------------- + # Get number of outer/inner iterations from the existing namelist + outer = self.get_setting_value( + config, ["namelist:timestepping", "outer_iterations"] + ) + inner = self.get_setting_value( + config, ["namelist:timestepping", "inner_iterations"] + ) + # Determine inner iterations settings + if outer in [None, "''", ""]: + inner_array = "''" + else: + inner_array = f"{inner}" + for _ in range(int(outer) - 1): + inner_array += f",{inner}" + self.add_setting( + config, + ["namelist:timestepping", "inner_iterations_si"], + inner_array, + ) + # Remove old setting + self.remove_setting( + config, ["namelist:timestepping", "inner_iterations"] + ) + # TR-BDF2 settings ----------------------------------------------------- + # This is easier because it's new and we can prescribe what to do + self.add_setting( + config, ["namelist:timestepping", "inner_iterations_tr"], "2,1" + ) + self.add_setting( + config, ["namelist:timestepping", "inner_iterations_bdf2"], "1,1" + ) + + return config, self.reports diff --git a/science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90 b/science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90 index a305feac4d..b2a3dc93fc 100644 --- a/science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90 +++ b/science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90 @@ -91,9 +91,10 @@ contains !> @param[in] dlayer_rhs Use damping layer in rhs yes/no !> @param[in] compute_rhs_t_d Compute rhs for the potential temperature !! and density + !> @param[in] stepper Enumerator for timestepper !> @param[in] model_clock Time in the model subroutine rhs_alg( rhs, alpha_dt, base_state, state, moist_dyn, compute_eos, & - compute_rhs_t_d, dlayer_rhs, model_clock ) + compute_rhs_t_d, dlayer_rhs, stepper, model_clock ) implicit none @@ -107,6 +108,7 @@ contains type(field_type), intent(inout) :: rhs(bundle_size) logical(kind=l_def), intent(in) :: compute_eos logical(kind=l_def), intent(in) :: compute_rhs_t_d + integer(kind=i_def), intent(in) :: stepper class(model_clock_type), intent(in) :: model_clock if ( (rhs(igh_u)%get_element_order_h() == 0) & @@ -114,10 +116,10 @@ contains .and. (.not. si_momentum_equation) & .and. (eos_method == eos_method_sampled) ) then call rhs_default_alg( rhs, alpha_dt, base_state, state, moist_dyn, compute_eos, & - compute_rhs_t_d, dlayer_rhs, model_clock ) + compute_rhs_t_d, dlayer_rhs, stepper, model_clock ) else call rhs_general_alg( rhs, alpha_dt, base_state, state, moist_dyn, compute_eos, & - compute_rhs_t_d, dlayer_rhs, model_clock ) + compute_rhs_t_d, dlayer_rhs, stepper, model_clock ) end if end subroutine rhs_alg @@ -125,7 +127,7 @@ contains !> @brief rhs algorithm for the default setup ( lowest order elements, !! explicit momentum advection, global and sampled eos) subroutine rhs_default_alg( rhs, alpha_dt, base_state, state, moist_dyn, compute_eos, & - compute_rhs_t_d, dlayer_rhs, model_clock ) + compute_rhs_t_d, dlayer_rhs, stepper, model_clock ) implicit none @@ -139,6 +141,7 @@ contains type(field_type), intent(inout) :: rhs(bundle_size) logical(kind=l_def), intent(in) :: compute_eos logical(kind=l_def), intent(in) :: compute_rhs_t_d + integer(kind=i_def), intent(in) :: stepper class(model_clock_type), intent(in) :: model_clock type(operator_type), pointer :: mm_vel => null(), & @@ -174,7 +177,7 @@ contains ! Using modified velocity mass matrix if needing damping layer if (dlayer_rhs) then - mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, mesh_id, model_clock) + mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, stepper, mesh_id, model_clock) else mm_vel => get_mass_matrix_fv(W2, mesh_id) end if @@ -241,7 +244,7 @@ contains !> @brief rhs algorithm for any generic setup subroutine rhs_general_alg( rhs, alpha_dt, base_state, state, moist_dyn, compute_eos, & - compute_rhs_t_d, dlayer_rhs, model_clock ) + compute_rhs_t_d, dlayer_rhs, stepper, model_clock ) implicit none @@ -255,6 +258,7 @@ contains type(field_type), intent(inout) :: rhs(bundle_size) logical(kind=l_def), intent(in) :: compute_eos logical(kind=l_def), intent(in) :: compute_rhs_t_d + integer(kind=i_def), intent(in) :: stepper class(model_clock_type), intent(in) :: model_clock type(operator_type), pointer :: mm_vel => null(), & @@ -306,7 +310,7 @@ contains ! Using modified velocity mass matrix if needing damping layer if (dlayer_rhs) then - mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, mesh_id, model_clock) + mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, stepper, mesh_id, model_clock) else mm_vel => get_mass_matrix_fe(w2, mesh%get_id()) end if diff --git a/science/gungho/source/algorithm/diagnostics/si_diagnostics_mod.x90 b/science/gungho/source/algorithm/diagnostics/si_diagnostics_mod.x90 index 7e865b2bba..1653ec01b4 100644 --- a/science/gungho/source/algorithm/diagnostics/si_diagnostics_mod.x90 +++ b/science/gungho/source/algorithm/diagnostics/si_diagnostics_mod.x90 @@ -157,6 +157,11 @@ contains call dtheta_adv%write_field() end if + ! NB: these increments are the difference between the state after slow + ! physics and before the *last* fast physics. They include advection, but + ! also increments from forcing terms (Coriolis, pressure gradient) and + ! the evolution of the model through previous outer loops. + ! For TR-BDF2, all of the TR step is included in these increments du_adv_flag = init_diag(du_adv, 'advection__du_adv') dv_adv_flag = init_diag(dv_adv, 'advection__dv_adv') dw_adv_flag = init_diag(dw_adv, 'advection__dw_adv') @@ -198,6 +203,8 @@ contains ! Solver increments ! Difference between solver value (X-dX_cld) and X_star+dX_fast_physics + ! NB: these increments only include the increment from the *final* call + ! to the solver if (init_diag(dtheta_solv, 'solver__dtheta_solv')) then call derived_fields%get_field('theta_star', theta_star) call invoke(X_minus_Y(dtheta_solv,state(igh_t),theta_star), & diff --git a/science/gungho/source/algorithm/runtime_constants/dycore_constants_mod.x90 b/science/gungho/source/algorithm/runtime_constants/dycore_constants_mod.x90 index c3d8bf6b1b..6ed9c0650d 100644 --- a/science/gungho/source/algorithm/runtime_constants/dycore_constants_mod.x90 +++ b/science/gungho/source/algorithm/runtime_constants/dycore_constants_mod.x90 @@ -55,9 +55,15 @@ module dycore_constants_mod type(inventory_by_mesh_type) :: geopotential_inventory type(inventory_by_mesh_type) :: coriolis_inventory type(inventory_by_mesh_type) :: vert_coriolis_inventory - type(inventory_by_mesh_type), target :: mm_w2_dl_inventory - type(inventory_by_mesh_type), target :: mm_w2_si_inventory - type(inventory_by_mesh_type), target :: mm_w2_dl_lagged_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_siqn_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_siqn_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_lagged_siqn_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_tr_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_tr_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_lagged_tr_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_bdf2_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_bdf2_inventory + type(inventory_by_mesh_type), target :: mm_w2_dl_lagged_bdf2_inventory ! ========================================================================== ! ! Public enumerated types for selecting W2 mass matrices @@ -67,6 +73,20 @@ module dycore_constants_mod integer(kind=i_def), parameter, public :: w2_lagged_damping_layer_matrix = 4374 integer(kind=i_def), parameter, public :: w2_si_matrix = 891 + ! Timestepping enumerators + integer(kind=i_def), parameter, public :: stepper_siqn = 2 + integer(kind=i_def), parameter, public :: stepper_tr = 3 + integer(kind=i_def), parameter, public :: stepper_bdf2 = 4 + integer(kind=i_def), parameter, public :: stepper_rk = 1 + + ! TR-BDF2 gamma values + ! gamma = 1 - 0.5*sqrt(2) + real(kind=r_def), parameter, public :: gamma = 0.2928932188134524_r_def + real(kind=r_def), parameter, public :: gamma2 = & + 0.5_r_def*(1.0_r_def - 2.0_r_def*gamma)/(1.0_r_def - gamma) + real(kind=r_def), parameter, public :: gamma3 = & + 0.5_r_def*(1.0_r_def - gamma)/gamma + ! ========================================================================== ! ! Public functions for accessing the module contents ! ========================================================================== ! @@ -254,13 +274,16 @@ contains !> @brief Returns a pointer to a generalised W2 mass matrix operator !> @param[in] mesh_id The ID of the mesh to get the object for + !> @param[in] w2_op_name The enumerated name of the W2 mass matrix operator + !> @param[in] stepper_name The enumerator of the time stepper being used !> @param[in] model_clock The model clock object !! @TODO #490: !! NB: This is currently an optional argument as it is not possible !! to pass it from all parts of the model (in particular from the !! apply method in the mixed operator) !> @return A generalised W2 mass matrix operator for the dynamical core - function get_w2_mass_matrix(w2_op_name, mesh_id, model_clock) result(dynamics_mm_w2) + function get_w2_mass_matrix(w2_op_name, stepper_name, mesh_id, model_clock) & + result(dynamics_mm_w2) use compute_dl_matrix_kernel_mod, only: compute_dl_matrix_kernel_type use damping_layer_config_mod, only: dl_base, dl_str @@ -278,12 +301,16 @@ contains implicit none integer(kind=i_def), intent(in) :: w2_op_name + integer(kind=i_def), intent(in) :: stepper_name integer(kind=i_def), intent(in) :: mesh_id class(model_clock_type), optional, intent(in) :: model_clock type(mesh_type), pointer :: mesh logical(kind=l_def) :: constant_exists type(function_space_type), pointer :: fs type(inventory_by_mesh_type), pointer :: inventory + type(inventory_by_mesh_type), pointer :: dl_inventory + type(inventory_by_mesh_type), pointer :: dl_lagged_inventory + type(inventory_by_mesh_type), pointer :: si_inventory type(operator_type), pointer :: dynamics_mm_w2 type(operator_type), target :: mm_w2_tmp type(operator_type), target :: mm_w2_tmp2 @@ -296,19 +323,38 @@ contains type(quadrature_xyoz_type), pointer :: qr real(kind=r_def) :: const real(kind=r_second) :: dt + real(kind=r_second) :: dt_to_use type(operator_type), pointer :: coriolis integer(tik) :: id ! Check inventories are initialised - if (.not. mm_w2_si_inventory%is_initialised()) then - ! Initialise all inventories together - call mm_w2_si_inventory%initialise(name='mm_w2_si') - call mm_w2_dl_inventory%initialise(name='mm_w2_dl') - call mm_w2_dl_lagged_inventory%initialise(name='mm_w2_dl_lagged') - if (present(model_clock)) then - dt_stored = model_clock%get_seconds_per_step() + select case (stepper_name) + case (stepper_siqn) + if (.not. mm_w2_si_siqn_inventory%is_initialised()) then + ! Initialise all inventories together + call mm_w2_si_siqn_inventory%initialise(name='mm_w2_si') + call mm_w2_dl_siqn_inventory%initialise(name='mm_w2_dl') + call mm_w2_dl_lagged_siqn_inventory%initialise(name='mm_w2_dl_lagged') + if (present(model_clock)) then + dt_stored = model_clock%get_seconds_per_step() + end if + end if + + case (stepper_tr, stepper_bdf2) + if (.not. mm_w2_si_tr_inventory%is_initialised()) then + ! Initialise all inventories together + call mm_w2_si_tr_inventory%initialise(name='mm_w2_si_tr') + call mm_w2_dl_tr_inventory%initialise(name='mm_w2_dl_tr') + call mm_w2_dl_lagged_tr_inventory%initialise(name='mm_w2_dl_lagged_tr') + call mm_w2_si_bdf2_inventory%initialise(name='mm_w2_si_bdf2') + call mm_w2_dl_bdf2_inventory%initialise(name='mm_w2_dl_bdf2') + call mm_w2_dl_lagged_bdf2_inventory%initialise(name='mm_w2_dl_lagged_bdf2') + if (present(model_clock)) then + dt_stored = model_clock%get_seconds_per_step() + end if end if - end if + + end select ! Check this constant is still valid -- is the model time step the same? ! Can only do this if model_clock is present @@ -324,16 +370,78 @@ contains end if ! Determine which inventory to point to + select case (stepper_name) + case (stepper_siqn) + dl_inventory => mm_w2_dl_siqn_inventory + dl_lagged_inventory => mm_w2_dl_lagged_siqn_inventory + si_inventory => mm_w2_si_siqn_inventory + case (stepper_tr) + dl_inventory => mm_w2_dl_tr_inventory + dl_lagged_inventory => mm_w2_dl_lagged_tr_inventory + si_inventory => mm_w2_si_tr_inventory + case (stepper_bdf2) + dl_inventory => mm_w2_dl_bdf2_inventory + dl_lagged_inventory => mm_w2_dl_lagged_bdf2_inventory + si_inventory => mm_w2_si_bdf2_inventory + case default + call log_event( & + 'Dynamics W2 mass matrix not implemented for this stepper', & + LOG_LEVEL_ERROR & + ) + end select + select case (w2_op_name) - case(w2_damping_layer_matrix) - inventory => mm_w2_dl_inventory - case(w2_lagged_damping_layer_matrix) - ! @TODO #416: this should be an inventory of r_solver operators - ! as the r_def operators are not used anywhere - inventory => mm_w2_dl_lagged_inventory - case(w2_si_matrix) - inventory => mm_w2_si_inventory + case (w2_damping_layer_matrix) + select case (stepper_name) + case (stepper_siqn) + inventory => mm_w2_dl_siqn_inventory + case (stepper_tr) + inventory => mm_w2_dl_tr_inventory + case (stepper_bdf2) + inventory => mm_w2_dl_bdf2_inventory case default + dynamics_mm_w2 => null() + call log_event( & + 'Dynamics W2 mass matrix does not exist', LOG_LEVEL_ERROR & + ) + stop + end select + + case (w2_lagged_damping_layer_matrix) + ! @TODO #416: this should be an inventory of r_solver operators + ! as the r_def operators are not used anywhere + select case (stepper_name) + case (stepper_siqn) + inventory => mm_w2_dl_lagged_siqn_inventory + case (stepper_tr) + inventory => mm_w2_dl_lagged_tr_inventory + case (stepper_bdf2) + inventory => mm_w2_dl_lagged_bdf2_inventory + case default + dynamics_mm_w2 => null() + call log_event( & + 'Dynamics W2 mass matrix does not exist', LOG_LEVEL_ERROR & + ) + stop + end select + + case (w2_si_matrix) + select case (stepper_name) + case (stepper_siqn) + inventory => mm_w2_si_siqn_inventory + case (stepper_tr) + inventory => mm_w2_si_tr_inventory + case (stepper_bdf2) + inventory => mm_w2_si_bdf2_inventory + case default + dynamics_mm_w2 => null() + call log_event( & + 'Dynamics W2 mass matrix does not exist', LOG_LEVEL_ERROR & + ) + stop + end select + + case default dynamics_mm_w2 => null() call log_event('Dynamics W2 mass matrix does not exist', LOG_LEVEL_ERROR) stop @@ -347,6 +455,13 @@ contains fs => function_space_collection%get_fs(mesh, element_order_h, & element_order_v, W2) + select case (stepper_name) + case (stepper_siqn, stepper_bdf2) + dt_to_use = dt_stored + case (stepper_tr) + dt_to_use = dt_stored * 2.0_r_def * gamma + end select + ! Each matrix is built on a previous matrix. Generally either all three ! matrices are needed, or only the S.I. matrix (the final in the chain) ! Therefore if this is a call to get the S.I. matrix and the others do not @@ -355,14 +470,14 @@ contains ! ====================================================================== ! ! DAMPING LAYER MATRIX ! ====================================================================== ! - if (mm_w2_dl_inventory%paired_object_exists(mesh_id)) then + if (dl_inventory%paired_object_exists(mesh_id)) then ! Get existing matrix - call mm_w2_dl_inventory%get_operator(mesh, mm_w2_dl) + call dl_inventory%get_operator(mesh, mm_w2_dl) else ! We are going to need to create this matrix if (w2_op_name == w2_damping_layer_matrix) then ! This is our target matrix, so store it - call mm_w2_dl_inventory%add_operator(mm_w2_dl, fs, fs, mesh) + call dl_inventory%add_operator(mm_w2_dl, fs, fs, mesh) else ! Assume that this matrix is only used to create another, so ! make a temporary matrix @@ -384,7 +499,7 @@ contains planet_radius, & element_order_h, & element_order_v, & - dt_stored, & + dt_to_use, & qr) ) if ( LPROF ) call stop_timing( id, 'runtime_constants.dycore' ) else @@ -399,16 +514,16 @@ contains ! ====================================================================== ! ! @TODO: logic here is probably not optimal if (w2_op_name /= w2_damping_layer_matrix) then - if (mm_w2_dl_lagged_inventory%paired_object_exists(mesh_id)) then + if (dl_lagged_inventory%paired_object_exists(mesh_id)) then ! Get existing matrix - call mm_w2_dl_lagged_inventory%get_operator(mesh, mm_w2_dl_lagged) + call dl_lagged_inventory%get_operator(mesh, mm_w2_dl_lagged) else ! We are going to need to create this matrix if ( LPROF ) call start_timing( id, 'runtime_constants.dycore' ) if (w2_op_name == w2_lagged_damping_layer_matrix) then ! This is our target matrix, so store it - call mm_w2_dl_lagged_inventory%add_operator(mm_w2_dl_lagged, fs, fs, mesh) + call dl_lagged_inventory%add_operator(mm_w2_dl_lagged, fs, fs, mesh) else ! Assume that this matrix is only used to create another, so ! make a temporary matrix @@ -437,10 +552,19 @@ contains ! ====================================================================== ! if (w2_op_name == w2_si_matrix) then if ( LPROF ) call start_timing( id, 'runtime_constants.dycore' ) - call mm_w2_si_inventory%add_operator(mm_w2_si, fs, fs, mesh) + call si_inventory%add_operator(mm_w2_si, fs, fs, mesh) if ( rotating ) then - const = tau_u * real(dt_stored, r_def) + select case (stepper_name) + case (stepper_siqn) + const = tau_u * real(dt_stored, r_def) + case (stepper_tr) + ! tau_u = gamma + const = gamma * real(dt_stored, r_def) + case (stepper_bdf2) + ! tau_u = gamma2 + const = gamma2 * real(dt_stored, r_def) + end select else const = 0.0_r_def end if @@ -474,9 +598,15 @@ contains call geopotential_inventory%clear() call vert_coriolis_inventory%clear() call coriolis_inventory%clear() - call mm_w2_dl_inventory%clear() - call mm_w2_dl_lagged_inventory%clear() - call mm_w2_si_inventory%clear() + call mm_w2_dl_siqn_inventory%clear() + call mm_w2_si_siqn_inventory%clear() + call mm_w2_dl_lagged_siqn_inventory%clear() + call mm_w2_dl_tr_inventory%clear() + call mm_w2_si_tr_inventory%clear() + call mm_w2_dl_lagged_tr_inventory%clear() + call mm_w2_dl_bdf2_inventory%clear() + call mm_w2_si_bdf2_inventory%clear() + call mm_w2_dl_lagged_bdf2_inventory%clear() dt_stored = 0.0_r_second end subroutine final_dycore_constants diff --git a/science/gungho/source/algorithm/runtime_constants/solver_constants_mod.x90 b/science/gungho/source/algorithm/runtime_constants/solver_constants_mod.x90 index dd40d13cb1..b15a514aa5 100644 --- a/science/gungho/source/algorithm/runtime_constants/solver_constants_mod.x90 +++ b/science/gungho/source/algorithm/runtime_constants/solver_constants_mod.x90 @@ -63,7 +63,9 @@ module solver_constants_mod type(inventory_by_mesh_type), target :: im3_div_r_solver_inventory ! Special dynamical core r_solver matrices - type(inventory_by_mesh_type), target :: mm_w2_si_r_solver_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_siqn_r_solver_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_tr_r_solver_inventory + type(inventory_by_mesh_type), target :: mm_w2_si_bdf2_r_solver_inventory ! Normalisations type(inventory_by_mesh_type) :: w2_normalisation_inventory @@ -271,14 +273,19 @@ contains !> @brief Returns a pointer to a generalised W2 mass matrix operator !> @param[in] mesh_id The ID of the mesh to get the object for + !> @param[in] w2_op_name The type of W2 mass matrix operator to get + !> @param[in] stepper_name The time stepper being used !> @return The semi-implicit W2 mass matrix operator - function get_w2_mass_matrix_r_solver(w2_op_name, mesh_id) result(mm_r_solver) + function get_w2_mass_matrix_r_solver(w2_op_name, stepper_name, mesh_id) & + result(mm_r_solver) - use dycore_constants_mod, only: get_w2_mass_matrix, w2_si_matrix + use dycore_constants_mod, only: get_w2_mass_matrix, w2_si_matrix, & + stepper_siqn, stepper_tr, stepper_bdf2 implicit none integer(kind=i_def), intent(in) :: w2_op_name + integer(kind=i_def), intent(in) :: stepper_name integer(kind=i_def), intent(in) :: mesh_id type(mesh_type), pointer :: mesh logical(kind=l_def) :: constant_exists @@ -286,21 +293,43 @@ contains type(operator_type), pointer :: mm_r_def type(r_solver_operator_type), pointer :: mm_r_solver type(inventory_by_mesh_type), pointer :: inventory + character(len=str_def) :: name integer(tik) :: id ! Determine which inventory to point to select case (w2_op_name) - case(w2_si_matrix) - inventory => mm_w2_si_r_solver_inventory + case (w2_si_matrix) + select case (stepper_name) + case (stepper_siqn) + name = 'mm_w2_si_siqn_r_solver' + inventory => mm_w2_si_siqn_r_solver_inventory + case (stepper_tr) + name = 'mm_w2_si_tr_r_solver' + inventory => mm_w2_si_tr_r_solver_inventory + case (stepper_bdf2) + name = 'mm_w2_si_bdf2_r_solver' + inventory => mm_w2_si_bdf2_r_solver_inventory case default mm_r_solver => null() - call log_event('r_solver dynamics W2 mass matrix does not exist', LOG_LEVEL_ERROR) + call log_event( & + 'r_solver dynamics W2 mass matrix does not exist for this stepper', & + LOG_LEVEL_ERROR & + ) stop + end select + + case default + mm_r_solver => null() + call log_event( & + 'r_solver dynamics W2 mass matrix does not exist for this W2 ' // & + 'enumerator', LOG_LEVEL_ERROR & + ) + stop end select ! Initialise inventory if this is the first time getting this constant - if (.not. mm_w2_si_r_solver_inventory%is_initialised()) then - call mm_w2_si_r_solver_inventory%initialise(name='mm_w2_si_r_solver') + if (.not. inventory%is_initialised()) then + call inventory%initialise(name=name) end if mesh => mesh_collection%get_mesh(mesh_id) @@ -308,7 +337,7 @@ contains if (.not. constant_exists) then ! Create constant if it doesn't already exist - mm_r_def => get_w2_mass_matrix(w2_op_name, mesh_id) + mm_r_def => get_w2_mass_matrix(w2_op_name, stepper_name, mesh_id) if ( LPROF ) call start_timing( id, 'runtime_constants.solver' ) @@ -532,7 +561,9 @@ contains call w2_normalisation_inventory%clear() call mm_w2_r_solver_inventory%clear() - call mm_w2_si_r_solver_inventory%clear() + call mm_w2_si_siqn_r_solver_inventory%clear() + call mm_w2_si_tr_r_solver_inventory%clear() + call mm_w2_si_bdf2_r_solver_inventory%clear() call mm_wtheta_r_solver_inventory%clear() call mm_w3_inv_r_solver_inventory%clear() call detj_at_w3_r_solver_inventory%clear() diff --git a/science/gungho/source/algorithm/solver/lam_rhs_alg_mod.x90 b/science/gungho/source/algorithm/solver/lam_rhs_alg_mod.x90 index 0b3ae266d9..4d9e28cc9d 100644 --- a/science/gungho/source/algorithm/solver/lam_rhs_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/lam_rhs_alg_mod.x90 @@ -19,8 +19,12 @@ module lam_rhs_alg_mod use derived_config_mod, only: bundle_size use si_operators_alg_mod, only: get_rho_at_u use sci_fem_constants_mod, only: get_im3_div_fe - use dycore_constants_mod, only: get_w2_mass_matrix, & - w2_si_matrix + use dycore_constants_mod, only: get_w2_mass_matrix, & + w2_si_matrix, & + stepper_siqn, & + stepper_tr, & + stepper_bdf2, & + gamma use limited_area_constants_mod, only: get_mask_fe use fs_continuity_mod, only: W2, W3, Wtheta use field_mod, only: field_type @@ -87,8 +91,9 @@ contains !> @param[in] model_clock Time in the model !> @param[in] finest_mesh_name Name of the finest mesh !> @param[in] tau_r Relaxation parameter for density in semi-implicit method + !> @param[in] stepper Enumerator for timestepper being used subroutine calc_rhs_lbc( rhs, lbc_fields, model_clock, finest_mesh_name, & - tau_r ) + tau_r, stepper ) implicit none @@ -97,6 +102,7 @@ contains class(model_clock_type), intent(in) :: model_clock character(len=str_def), intent(in) :: finest_mesh_name real(r_def), intent(in) :: tau_r + integer(i_def), intent(in) :: stepper type(field_type), pointer :: boundary_u => null() type(operator_type), pointer :: mm_vel => null(), & @@ -121,9 +127,16 @@ contains if ( LPROF ) call start_timing( id, 'dynamics.rhs_lbc' ) mesh_id = rhs(igh_u)%get_mesh_id() - dt = real(model_clock%get_seconds_per_step(), r_def) - tau_r_dt = tau_r*dt + + select case (stepper) + case (stepper_siqn) + tau_r_dt = tau_r*dt + case (stepper_tr) + tau_r_dt = 2.0_r_def*gamma*dt + case (stepper_bdf2) + tau_r_dt = dt + end select ! Get the LBC data call lbc_fields%get_field('boundary_u_diff', boundary_u) @@ -137,7 +150,7 @@ contains div => get_im3_div_fe(mesh_id) ! m2 (or dl) + tau_u*dt*coriolis (lagged if required) - mm_vel => get_w2_mass_matrix(w2_si_matrix, mesh_id, model_clock) + mm_vel => get_w2_mass_matrix(w2_si_matrix, stepper, mesh_id, model_clock) ! Obtain operators from SI operators r_solver_rho_at_u => get_rho_at_u() diff --git a/science/gungho/source/algorithm/solver/mixed_operator_alg_mod.x90 b/science/gungho/source/algorithm/solver/mixed_operator_alg_mod.x90 index c559e1317a..e6d571d634 100644 --- a/science/gungho/source/algorithm/solver/mixed_operator_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/mixed_operator_alg_mod.x90 @@ -73,6 +73,8 @@ module mixed_operator_alg_mod mixed_operator_type private + !> Time stepper enumerator (used to select the SI operators) + integer(kind=i_def) :: stepper contains !> Over-ride the abstract interface @@ -86,8 +88,26 @@ module mixed_operator_alg_mod final :: destroy_mixed_operator end type mixed_operator_type + interface mixed_operator_type + module procedure mixed_operator_constructor + end interface + contains + !> @brief Constructor for the mixed operator + !> @param[in] stepper The time stepper enumerator used to select the operators + !> @return Instance of the mixed operator + function mixed_operator_constructor(stepper) result(self) + + implicit none + + integer(kind=i_def), intent(in) :: stepper + type(mixed_operator_type) :: self + + self%stepper = stepper + + end function mixed_operator_constructor + !> @brief Applies the mixed operator to the vector, \f$ y = M x \f$. !> !> @param[in,out] self Instance of the mixed operator @@ -109,7 +129,12 @@ contains get_m3_exner_star, & get_p3theta, & get_eliminated_q22, & - get_eliminated_q32 + get_eliminated_q32_rho, & + get_eliminated_q32_theta, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt, & + get_tau_tu_dt2_cp use dycore_constants_mod, only: w2_si_matrix use solver_constants_mod, only: get_w2_mass_matrix_r_solver, & get_normalisation_r_solver @@ -151,9 +176,13 @@ contains w3_mask type(r_solver_field_type) :: x_t real(kind=r_solver), parameter :: minus_one = -1.0_r_solver + real(kind=r_solver) :: const_u, const_t, const_r, const_tu + real(kind=r_solver) :: minus_const_t type(r_solver_field_type) :: q22u + type(r_solver_field_type) :: q32t_p type(r_solver_operator_type), pointer :: q22_op, & - q32_op + q32_rho_op, & + q32_theta_op type(r_solver_field_type), pointer :: xvec_uv, & xvec_p, & xvec_w @@ -200,7 +229,7 @@ contains mt_lumped_inv => get_normalisation_r_solver(Wtheta, mesh%get_id()) m2_diag => get_normalisation_r_solver(W2, mesh%get_id()) ! mm_vel = m2 (or dl) + tau_u*dt*coriolis - mm_vel => get_w2_mass_matrix_r_solver(w2_si_matrix, mesh%get_id()) + mm_vel => get_w2_mass_matrix_r_solver(w2_si_matrix, self%stepper, mesh%get_id()) ! Obtain operators from SI operators p2theta => get_p2theta() @@ -209,6 +238,13 @@ contains m3_exner_star => get_m3_exner_star() p3theta => get_p3theta() + ! Obtain the tau*dt scaling constants used to assemble the SI operators. + const_u = get_tau_u_dt_cp(self%stepper) ! tau_u*dt*cp + const_t = get_tau_t_dt(self%stepper) ! tau_t*dt + const_r = get_tau_r_dt(self%stepper) ! tau_r*dt + const_tu = get_tau_tu_dt2_cp(self%stepper) ! tau_t*tau_u*dt^2*cp + minus_const_t = -const_t + select type (x) type is (r_solver_field_vector_type) select type (y) @@ -254,7 +290,7 @@ contains select case ( eliminate_variables ) case ( eliminate_variables_discrete ) - q32_op => get_eliminated_q32() + q32_rho_op => get_eliminated_q32_rho() if ( optimised_operator ) then ! Compute the lhs of mixed operator in two steps: ! 1) Compute the horizontal wind lhs (yvec_uv), this is done in the broken W2 @@ -270,14 +306,16 @@ contains call invoke( name="apply_split_mixed_operator", & apply_mixed_u_operator_kernel_type( y_uv_broken, & xvec_uv, xvec_w, xvec_p, & - mm_vel, div_star, m2_diag ), & + mm_vel, div_star, m2_diag, & + const_u ), & setval_c( yvec_uv, 0.0_r_solver ), & assemble_w2h_from_w2hb_kernel_type(yvec_uv, y_uv_broken), & apply_mixed_wp_operator_kernel_type( yvec_w, yvec_p, & xvec_uv, xvec_w, xvec_p, & ptheta2, mt_lumped_inv, & mm_vel, p2theta, div_star, m2_diag, & - m3_exner_star, q32_op, p3theta ) ) + m3_exner_star, q32_rho_op, p3theta, & + const_u, const_t, const_r ) ) else ! Create theta' field t_fs => function_space_collection%get_fs( mesh, p_h, p_v, Wtheta ) @@ -288,19 +326,22 @@ contains ! but we do not assemble the full Q22 & Q32 matrices as these can ! not be represented by local matrix operators ! Q32 = tau*dt*M3^rho * D * rho^ref - ! and x_t = -mt_lumped_inv*Ptheta2*u', so P3theta*x_t gives the - ! contribution to the equation of state from eliminating the - ! potential temperature + ! and x_t = -tau_t*dt*mt_lumped_inv*Ptheta2*u', so P3theta*x_t gives + ! the (already tau_t*dt scaled) contribution to the equation of state + ! from eliminating the potential temperature. Baking tau_t*dt into + ! x_t also means that the momentum-row P2theta*x_t term, once scaled + ! by const_u below, correctly carries tau_u*tau_t*dt^2*cp (i.e. Q22). call invoke( name="apply_discretely_eliminated_mixed_lhs", & setval_c( x_t, 0.0_r_solver ), & dg_inc_matrix_vector_kernel_type( x_t, x_uvw, Ptheta2 ), & - inc_aX_times_Y( minus_one, x_t, mt_lumped_inv ), & + inc_aX_times_Y( minus_const_t, x_t, mt_lumped_inv ), & setval_c( y_uvw, 0.0_r_solver ), & apply_mixed_lu_operator_kernel_type( y_uvw, x_uvw, x_t, xvec_p, & - mm_vel, p2theta, div_star, m2_diag ), & + mm_vel, p2theta, div_star, m2_diag, & + const_u ), & apply_elim_mixed_lp_operator_kernel_type( yvec_p, x_t, x_uvw, & xvec_p, m3_exner_star, & - q32_op, p3theta), & + q32_rho_op, p3theta, const_r ), & enforce_bc_kernel_type( y_uvw ) ) end if @@ -311,19 +352,27 @@ contains ! For analytic elimination: ! Q32 = tau*dt*M3^rho * D * rho^ref + ! and x_t = 0 - q32_op => get_eliminated_q32() + q32_rho_op => get_eliminated_q32_rho() q22_op => get_eliminated_q22() + q32_theta_op => get_eliminated_q32_theta() call q22u%initialise( vector_space = u_fs ) + call q32t_p%initialise( yvec_p%get_function_space() ) call invoke( name="analytic_elim_mixed_lhs", & setval_c( x_t, 0.0_r_solver ), & setval_c( y_uvw, 0.0_r_solver ), & apply_mixed_lu_operator_kernel_type( y_uvw, x_uvw, x_t, xvec_p, & - mm_vel, p2theta, div_star, m2_diag ), & + mm_vel, p2theta, div_star, m2_diag, & + const_u ), & apply_elim_mixed_lp_operator_kernel_type( yvec_p, x_t, x_uvw, & xvec_p, m3_exner_star, & - q32_op, p3theta), & + q32_rho_op, p3theta, const_r ), & + setval_c( q32t_p, 0.0_r_solver ), & + matrix_vector_kernel_type( q32t_p, x_uvw, q32_theta_op ), & + inc_a_times_X( const_t, q32t_p ), & + inc_X_plus_Y( yvec_p, q32t_p ), & setval_c( q22u, 0.0_r_solver ), & matrix_vector_kernel_type( q22u, x_uvw, q22_op ), & + inc_a_times_X( const_tu, q22u ), & inc_X_minus_Y( y_uvw, q22u ), & enforce_bc_kernel_type( y_uvw ) ) diff --git a/science/gungho/source/algorithm/solver/mixed_schur_preconditioner_alg_mod.x90 b/science/gungho/source/algorithm/solver/mixed_schur_preconditioner_alg_mod.x90 index 2454132228..ea2776da50 100644 --- a/science/gungho/source/algorithm/solver/mixed_schur_preconditioner_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/mixed_schur_preconditioner_alg_mod.x90 @@ -2,6 +2,9 @@ ! (C) Crown copyright 2018 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. !----------------------------------------------------------------------------- !> @brief Preconditioner for the Euler equations system. @@ -115,7 +118,11 @@ module mixed_schur_preconditioner_alg_mod get_p3theta, & get_helm_diag, & get_Hb_lumped_inv, & - get_eliminated_q32 + get_eliminated_q32_rho, & + get_eliminated_q32_theta, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt use solver_constants_mod, only: get_normalisation_r_solver use limited_area_constants_mod, only: get_mask_r_solver use fs_continuity_mod, only: W2, W3, Wtheta @@ -144,6 +151,7 @@ module mixed_schur_preconditioner_alg_mod !> Pressure (Helmholtz) solver object class(abstract_iterative_solver_type), pointer :: & pressure_solver + integer(kind=i_def) :: stepper contains ! Override the (abstract interface) for application of @@ -183,10 +191,12 @@ contains !> @param [in] element_order_h Horizontal element order for function spaces !> @param [in] element_order_v Vertical element order for function spaces !> @param [in] pressure_solver Solver object for Helmholtz system + !> @param [in] stepper Timestepper enumerator used to select operators !> @return self the constructed preconditioner object function mixed_schur_preconditioner_constructor(mesh, element_order_h, & element_order_v, & - pressure_solver) & + pressure_solver, & + stepper) & result(self) use function_space_mod, only: function_space_type @@ -199,6 +209,7 @@ contains integer(i_def), intent(in) :: element_order_v type(mesh_type), target, intent(in) :: mesh class(abstract_iterative_solver_type), target, intent(in) :: pressure_solver + integer(i_def), intent(in) :: stepper type(mixed_schur_preconditioner_type) :: self @@ -225,6 +236,7 @@ contains ! Set pressure solver self%pressure_solver => pressure_solver + self%stepper = stepper call log_event( 'done', LOG_LEVEL_DEBUG ) @@ -302,7 +314,8 @@ contains !! of the mixed system subroutine build_pressure_rhs(self, rhs0) - use dg_matrix_vector_kernel_mod, only: dg_matrix_vector_kernel_type + use apply_analytic_q32_rhs_kernel_mod, & + only: apply_analytic_q32_rhs_kernel_type use apply_variable_hx_kernel_mod, only: apply_variable_hx_kernel_type use opt_apply_variable_hx_kernel_mod, only: opt_apply_variable_hx_kernel_type use operator_mod, only: r_solver_operator_type @@ -319,12 +332,14 @@ contains ptheta2, & p3theta, & compound_div, & - q32_op + q32_rho_op, & + q32_theta_op type( r_solver_field_type ), pointer :: mt_lumped_inv, & h_diag, & Hb_lumped_inv type( r_solver_field_type ) :: r_p, rhs_d - real( kind=r_solver ), parameter :: minus_one = -1.0_r_solver + real( kind=r_solver ) :: const_r, const_t + real( kind=r_solver ) :: minus_const_r, minus_const_t type( r_solver_field_type ) :: rhs_uvw type( r_solver_field_type ), pointer :: w2_mask, & w3_mask @@ -369,7 +384,15 @@ contains p3theta => get_p3theta() m3_rho_star => get_m3_rho_star() compound_div => get_compound_div() - Hb_lumped_inv => get_Hb_lumped_inv() + Hb_lumped_inv => get_Hb_lumped_inv(self%stepper) + + ! The SI operators are now assembled unscaled; re-apply the tau*dt scalings + ! here. The divergence term uses tau_r*dt and the potential temperature term + ! uses tau_t*dt. + const_r = get_tau_r_dt(self%stepper) + const_t = get_tau_t_dt(self%stepper) + minus_const_r = -const_r + minus_const_t = -const_t ! Compute rhs_u terms call invoke( name = "compute_elim_helmholtz_ru", & @@ -382,10 +405,16 @@ contains ! Compute H(rhs_u) if ( eliminate_variables == eliminate_variables_analytic ) then ! r_pi = rhs_pi - Q32*rhs_u - q32_op => get_eliminated_q32() + ! with the analytic Q32 = tau_r*dt*eliminated_q32_rho + ! + tau_t*dt*eliminated_q32_theta + q32_rho_op => get_eliminated_q32_rho() + q32_theta_op => get_eliminated_q32_theta() call r_p%initialise( rhs%get_function_space() ) - call invoke( dg_matrix_vector_kernel_type(r_p, self%rhs_u, q32_op), & - X_minus_Y(rhs, rhs_p, r_p ) ) + call invoke( apply_analytic_q32_rhs_kernel_type(r_p, self%rhs_u, & + q32_rho_op, & + q32_theta_op, & + const_r, const_t), & + X_minus_Y(rhs, rhs_p, r_p) ) else ! r_pi = rhs_pi + P03*M0^-1*rhs_t + M3rho*M3^-1*rhs_r ! r_rho already contains M3^-1 factor @@ -397,12 +426,12 @@ contains opt_apply_variable_hx_kernel_type( & rhs, self%rhs_u, mt_lumped_inv, rhs_d, & compound_div, p3theta, ptheta2, m3_rho_star, & - minus_one, rhs_p) ) + minus_const_r, minus_const_t, rhs_p) ) else call invoke( apply_variable_hx_kernel_type( & rhs, self%rhs_u, mt_lumped_inv, rhs_d, & compound_div, p3theta, ptheta2, m3_rho_star, & - minus_one), & + minus_const_r, minus_const_t), & inc_X_plus_Y(rhs, rhs_p) ) end if end if @@ -413,7 +442,7 @@ contains end if if ( normalise ) then - h_diag => get_helm_diag() + h_diag => get_helm_diag(self%stepper) call invoke( inc_X_times_Y(rhs, h_diag) ) end if @@ -448,6 +477,7 @@ contains type( r_solver_field_type ) :: u_inc type(r_solver_field_type), pointer :: w2_mask integer( kind=i_def ) :: mesh_id + real( kind=r_solver ) :: const_u type(r_solver_field_type), pointer :: state_uv, & state_p, & @@ -469,7 +499,9 @@ contains ! u increment u_normalisation => get_normalisation_r_solver(W2, mesh_id) div_star => get_div_star() - Hb_lumped_inv => get_Hb_lumped_inv() + Hb_lumped_inv => get_Hb_lumped_inv(self%stepper) + + const_u = get_tau_u_dt_cp(self%stepper) ! u' = ru + BC[HB * unorm * D * p'] if ( split_w ) then state_uv => state%get_field_from_position( isol_uv ) @@ -483,6 +515,7 @@ contains call uvw_norm%initialise( vector_space = self%rhs_u%get_function_space() ) call invoke( name = "compute_split_increments", & X_times_Y(uvw_norm, u_normalisation, Hb_lumped_inv), & + inc_a_times_X(const_u, uvw_norm), & setval_c(state_uv, 0.0_r_solver), & schur_backsub_kernel_type( state_uv, state_w, self%rhs_u, & exner_inc, div_star, & @@ -492,10 +525,10 @@ contains call u_inc%initialise( vector_space = self%rhs_u%get_function_space() ) call invoke( name = "compute_increments", & setval_c(u_inc, 0.0_r_solver), & - setval_X(u_inc, self%rhs_u), & scaled_matrix_vector_kernel_type(u_inc, exner_inc, & div_star, u_normalisation, & - Hb_lumped_inv), & + Hb_lumped_inv, const_u), & + inc_X_plus_Y(u_inc, self%rhs_u), & enforce_bc_kernel_type(u_inc) ) if ( limited_area ) then w2_mask => get_mask_r_solver(W2, mesh_id, prime_mesh_name) diff --git a/science/gungho/source/algorithm/solver/pressure_operator_alg_mod.x90 b/science/gungho/source/algorithm/solver/pressure_operator_alg_mod.x90 index a93ce877f3..ba2e0b04e5 100644 --- a/science/gungho/source/algorithm/solver/pressure_operator_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/pressure_operator_alg_mod.x90 @@ -43,7 +43,10 @@ module pressure_operator_alg_mod get_ptheta2v, & get_p3theta, & get_helm_diag, & - get_hb_lumped_inv + get_hb_lumped_inv, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt use boundaries_config_mod, only: limited_area use base_mesh_config_mod, only: topology, topology_non_periodic use function_space_mod, only: function_space_type @@ -56,6 +59,8 @@ module pressure_operator_alg_mod private !> Level of the operator (used for multigrid) integer(kind=i_def) :: level + !> Time stepper enumerator (used to select the SI operators) + integer(kind=i_def) :: stepper contains !> Over-ride the abstract interface !> param[in] self A linear operator @@ -89,18 +94,21 @@ contains !! inverse \f$ \tilde{H}_b^{-1} \f$ as well as other operators !! such as div and grad for the Helmholtz operator application. !> - !> @param[in] level The mesh level the space is on + !> @param[in] level The mesh level the space is on + !> @param[in] stepper The timestepper enumerator used to select the operators !> @return Instance of the Helmholtz operator - function pressure_operator_constructor(level) result(self) + function pressure_operator_constructor(level, stepper) result(self) implicit none type(pressure_operator_type) :: self integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper call log_event( 'Constructing pressure operator...', LOG_LEVEL_INFO ) ! Temporaries required in operator application self%level = level + self%stepper = stepper call log_event( 'done', LOG_LEVEL_INFO ) @@ -119,6 +127,7 @@ contains ! Deep copy of the contents of the pressure_operator_type dest%level = source%level + dest%stepper = source%stepper end subroutine pressure_operator_assign !> @brief Apply Helmholtz operator to a pressure field to obtain \f$y=Hx\f$. @@ -161,7 +170,7 @@ contains type(r_solver_field_type), pointer :: x_vec => null(), & y_vec => null() - real(kind=r_solver), parameter :: one = 1.0_r_solver + real(kind=r_solver) :: const_u, const_t, const_r integer(kind=i_def), parameter :: one_int = 1_i_def integer(kind=i_def) :: mesh_id logical(kind=l_def) :: lam_mesh @@ -180,7 +189,7 @@ contains y_vec => y%get_field_from_position(1) if ( x_vec%get_element_order_h() == 0 .and. & x_vec%get_element_order_v() == 0 ) then - Helmholtz_operator => get_helmholtz_operator(self%level) + Helmholtz_operator => get_helmholtz_operator(self%stepper, self%level) lam_mesh=.false. if (limited_area .and. topology==topology_non_periodic) lam_mesh=.true. @@ -200,7 +209,10 @@ contains mt_lumped_inv => get_normalisation_r_solver(Wtheta, mesh_id) p3theta => get_p3theta(self%level) u_normalisation => get_normalisation_r_solver(W2, mesh_id) - hb_lumped_inv => get_hb_lumped_inv(self%level) + hb_lumped_inv => get_hb_lumped_inv(self%stepper, self%level) + const_u = get_tau_u_dt_cp(self%stepper) ! tau_u*dt*cp: scales grad_p (from div_star) + const_t = get_tau_t_dt(self%stepper) ! tau_t*dt: scales the potential temp term + const_r = get_tau_r_dt(self%stepper) ! tau_r*dt: scales the divergence term call grad_p%initialise( hb_lumped_inv%get_function_space() ) if ( limited_area ) then w2_mask => get_mask_r_solver(W2, mesh_id, prime_mesh_name) @@ -208,27 +220,27 @@ contains setval_c( y_vec, 0.0_r_solver ), & scaled_matrix_vector_kernel_type(grad_p, x_vec, & div_star, hb_lumped_inv, & - u_normalisation), & + u_normalisation, const_u), & enforce_bc_kernel_type( grad_p ), & inc_X_times_Y( grad_p, w2_mask ), & apply_variable_hx_kernel_type(y_vec, grad_p, & mt_lumped_inv, x_vec, & compound_div, p3theta, ptheta2, & - m3_exner_star, one) ) + m3_exner_star, const_r, const_t) ) else call invoke( setval_c( grad_p, 0.0_r_solver ), & setval_c( y_vec, 0.0_r_solver ), & scaled_matrix_vector_kernel_type(grad_p, x_vec, & div_star, hb_lumped_inv, & - u_normalisation), & + u_normalisation, const_u), & enforce_bc_kernel_type( grad_p ), & apply_variable_hx_kernel_type(y_vec, grad_p, & mt_lumped_inv, x_vec, & compound_div, p3theta, ptheta2, & - m3_exner_star, one) ) + m3_exner_star, const_r, const_t) ) end if if ( normalise ) then - h_diag => get_helm_diag(self%level) + h_diag => get_helm_diag(self%stepper, self%level) call invoke( inc_X_times_Y(y_vec, h_diag) ) end if @@ -273,7 +285,7 @@ contains class(abstract_hierarchical_linear_operator_type), allocatable, intent(inout) :: coarse_operator allocate(coarse_operator, & - source=pressure_operator_type(self%level+1)) + source=pressure_operator_type(self%level+1, self%stepper)) end subroutine coarsen_pressure_operator !> @brief Finalizer for the Helmholtz operator. diff --git a/science/gungho/source/algorithm/solver/pressure_precon_alg_mod.x90 b/science/gungho/source/algorithm/solver/pressure_precon_alg_mod.x90 index f5d1260e69..a9d4d8ea99 100644 --- a/science/gungho/source/algorithm/solver/pressure_precon_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/pressure_precon_alg_mod.x90 @@ -37,6 +37,7 @@ module pressure_precon_alg_mod type, public, extends(abstract_hierarchical_preconditioner_type) :: pressure_preconditioner_type integer(kind=i_def) :: level + integer(kind=i_def) :: stepper contains procedure, public :: apply => apply_pressure_preconditioner @@ -61,19 +62,22 @@ contains !> @brief Construct a pressure_preconditioner_type object. !> - !> @param[in] level Multigrid level + !> @param[in] level Multigrid level + !> @param[in] stepper The timestepper enumerator used to select the operators !> @return self The constructed preconditioner object - function pressure_preconditioner_constructor(level) result(self) + function pressure_preconditioner_constructor(level, stepper) result(self) use log_mod, only: log_event, LOG_LEVEL_INFO implicit none integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper type(pressure_preconditioner_type) :: self call log_event( 'Constructing pressure preconditioner...', & LOG_LEVEL_INFO ) self%level = level + self%stepper = stepper call log_event( 'done', LOG_LEVEL_INFO ) end function pressure_preconditioner_constructor @@ -91,6 +95,7 @@ contains ! Deep copy of the contents of the pressure_preconditioner_type dest%level = source%level + dest%stepper = source%stepper end subroutine pressure_preconditioner_assign !> @brief Apply the preconditioner to calculate \f$y = P.x = x\f$. @@ -117,7 +122,7 @@ contains select type(y) type is(r_solver_field_vector_type) ! Multiply by inverse of vertical operator \f$ H_z \f$ - tri => get_tri_precon(self%level) + tri => get_tri_precon(self%stepper, self%level) x_vec => x%get_field_from_position(1) y_vec => y%get_field_from_position(1) call invoke( tri_solve_kernel_type(y_vec, x_vec, tri) ) @@ -146,7 +151,7 @@ contains class(pressure_preconditioner_type), intent(inout) :: self class(abstract_hierarchical_preconditioner_type), allocatable, intent(inout) :: other allocate(other, & - source = pressure_preconditioner_type(self%level+1) ) + source = pressure_preconditioner_type(self%level+1, self%stepper) ) end subroutine coarsen_pressure_preconditioner !> @brief Destructor diff --git a/science/gungho/source/algorithm/solver/semi_implicit_solver_alg_mod.x90 b/science/gungho/source/algorithm/solver/semi_implicit_solver_alg_mod.x90 index bb50664c54..956ef56c5c 100644 --- a/science/gungho/source/algorithm/solver/semi_implicit_solver_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/semi_implicit_solver_alg_mod.x90 @@ -2,6 +2,9 @@ ! (C) Crown copyright 2018 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. !----------------------------------------------------------------------------- !> @brief Semi-Implicit solver for the gungho dynamical core. @@ -103,7 +106,8 @@ contains !> @param[in] state Prognostic state for the solver !> @param[out] pressure_operator_out Output (Helmholtz) pressure operator !> @param[out] pressure_preconditioner_out Output (Helmholtz) pressure preconditioner - subroutine create_pressure_preconditioner( state, pressure_operator_out, pressure_preconditioner_out ) + !> @param[in] stepper Timestepper enumerator used to select operators + subroutine create_pressure_preconditioner( state, pressure_operator_out, pressure_preconditioner_out, stepper ) use helmholtz_solver_config_mod, only: helmholtz_preconditioner => preconditioner, & preconditioner_none, & @@ -120,10 +124,12 @@ contains type(pressure_operator_type), intent(out) :: pressure_operator_out class(abstract_preconditioner_type), allocatable, intent(out) :: pressure_preconditioner_out + integer(i_def), intent(in) :: stepper + ! Vertical pressure preconditioner type(pressure_preconditioner_type) :: Hz_preconditioner - pressure_operator_out = pressure_operator_type(level=1_i_def) + pressure_operator_out = pressure_operator_type(level=1_i_def, stepper=stepper) call log_event( "create_pressure_preconditioner: starting", LOG_LEVEL_INFO ) @@ -137,9 +143,9 @@ contains source = pressure_diag_preconditioner_type() ) case(PRECONDITIONER_TRIDIAGONAL) allocate( pressure_preconditioner_out, & - source = pressure_preconditioner_type(level=1_i_def) ) + source = pressure_preconditioner_type(level=1_i_def, stepper=stepper) ) case(PRECONDITIONER_MULTIGRID) - Hz_preconditioner = pressure_preconditioner_type(level=1_i_def) + Hz_preconditioner = pressure_preconditioner_type(level=1_i_def, stepper=stepper) allocate( pressure_preconditioner_out, & source = multigrid_preconditioner_type( state(igh_p)%get_function_space(), & pressure_operator_out, & @@ -271,7 +277,8 @@ contains !> @param[in] state Prognostic state for the solver !> @param[in] pressure_solver_in Input (Helmholtz) pressure solver !> @param[out] mixed_preconditioner_out Output mixed preconditioner - subroutine create_mixed_preconditioner( state, pressure_solver_in, mixed_preconditioner_out ) + !> @param[in] stepper Timestepper enumerator used to select operators + subroutine create_mixed_preconditioner( state, pressure_solver_in, mixed_preconditioner_out, stepper ) use mixed_solver_config_mod, only: si_preconditioner, & si_preconditioner_pressure, & @@ -288,6 +295,8 @@ contains ! Output preconditioner for mixed problem class(abstract_preconditioner_type), allocatable, intent(out) :: mixed_preconditioner_out + integer(i_def), intent(in) :: stepper + call log_event( "create_mixed_preconditioner: starting", LOG_LEVEL_INFO ) ! Allocate mixed preconditioner of correct type @@ -298,7 +307,8 @@ contains state(igh_u)%get_mesh(), & state(igh_u)%get_element_order_h(), & state(igh_u)%get_element_order_v(), & - pressure_solver_in ) ) + pressure_solver_in, & + stepper ) ) case(SI_PRECONDITIONER_NONE) allocate( mixed_preconditioner_out, & @@ -317,7 +327,8 @@ contains !> @param[in] mixed_preconditioner_in Input mixed preconditioner !> @param[in,out] mixed_operator_out Output mixed operator (not explicitly set, so must be inout) !> @param[out] mixed_solver_out Output mixed solver - subroutine create_mixed_solver( mixed_preconditioner_in, mixed_operator_out, mixed_solver_out ) + !> @param[in] stepper Timestepper enumerator used to select operators + subroutine create_mixed_solver( mixed_preconditioner_in, mixed_operator_out, mixed_solver_out, stepper ) use mixed_solver_config_mod, only: si_maximum_iterations, & si_tolerance, & @@ -347,8 +358,13 @@ contains type(mixed_operator_type), intent(inout) :: mixed_operator_out class(abstract_iterative_solver_type), allocatable, intent(out) :: mixed_solver_out + integer(i_def), intent(in) :: stepper + call log_event( "create_mixed_solver: starting", LOG_LEVEL_INFO ) + ! Build the mixed operator for the requested timestepper + mixed_operator_out = mixed_operator_type(stepper) + ! Allocate mixed solver of correct type select case(si_method) case(SI_METHOD_BICGSTAB) @@ -434,23 +450,26 @@ contains !=============================================================================! !> @brief Initialisation procedure for the semi-implicit solver - !> @param[in] state Prognostic state for the solver - subroutine semi_implicit_solver_alg_init(state) + !> @param[in] state Prognostic state for the solver + !> @param[in] stepper Timestepper enumerator used to select operators + subroutine semi_implicit_solver_alg_init(state, stepper) implicit none ! Prognostic fields type( field_type ), dimension(bundle_size), intent( in ) :: state + integer(i_def), intent(in) :: stepper + write(log_scratch_space,'(A)') & 'SI solver built with '//trim(PRECISION_R_SOLVER)// & '-bit real numbers' call log_event( log_scratch_space, LOG_LEVEL_ALWAYS ) - call create_pressure_preconditioner( state, pressure_operator, pressure_preconditioner ) + call create_pressure_preconditioner( state, pressure_operator, pressure_preconditioner, stepper ) call create_pressure_solver( pressure_operator, pressure_preconditioner, pressure_solver ) - call create_mixed_preconditioner( state, pressure_solver, mixed_preconditioner ) - call create_mixed_solver( mixed_preconditioner, mixed_operator, mixed_solver ) + call create_mixed_preconditioner( state, pressure_solver, mixed_preconditioner, stepper ) + call create_mixed_solver( mixed_preconditioner, mixed_operator, mixed_solver, stepper ) call log_event( "semi_implicit_solver_alg_init: Initialised semi-implicit solver", LOG_LEVEL_INFO ) @@ -492,10 +511,11 @@ contains !> @param[in] moist_dyn_gas_law Gas law component of moist dynamics factors !> @param[in] mr Mixing ratio array !> @param[in] first_iteration Flag for first inner iteration + !> @param[in] stepper Timestepper enumerator subroutine semi_implicit_solver_alg_step(state, rhs, & dry_flux_solver, & moist_dyn_gas_law, mr, & - first_iteration) + first_iteration, stepper) use solver_constants_mod, only: get_normalisation_r_solver, & get_im3_div_r_solver, & @@ -508,7 +528,10 @@ contains get_p3theta, & get_ptheta2, & get_eliminated_q2t, & - get_eliminated_q3t + get_eliminated_q3t, & + get_tau_u_dt_cp, & + get_tau_t_dt, & + get_tau_r_dt use matrix_vector_kernel_mod, only: matrix_vector_kernel_type use dg_matrix_vector_kernel_mod, only: dg_matrix_vector_kernel_type use dg_inc_matrix_vector_kernel_mod, & @@ -517,7 +540,6 @@ contains r_solver_operator_type use field_mod, only: field_type use r_solver_field_mod, only: r_solver_field_type - use timestepping_config_mod, only: dt, tau_r use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type use sci_mass_matrix_solver_alg_mod, & only: mass_matrix_solver_alg @@ -531,7 +553,9 @@ contains type( field_type ), intent( inout ) :: dry_flux_solver type( field_type ), intent( in ) :: moist_dyn_gas_law type( field_type ), dimension(nummr), intent( in ) :: mr - logical( kind=l_def), intent( in ) :: first_iteration + logical( kind=l_def ), intent( in ) :: first_iteration + + integer( kind=i_def ), intent( in ) :: stepper real( kind=r_def ) :: si_err(bundle_size) type( field_type ), pointer :: t_normalisation, & @@ -571,6 +595,7 @@ contains inc_theta_rdef, & inc_rho_rdef real( kind=r_solver ) :: tau_r_dt + real( kind=r_solver ) :: const_u, const_t integer( kind=i_def ) :: mesh_id type(mesh_type), pointer :: mesh @@ -585,6 +610,13 @@ contains mesh_id = state(igh_p)%get_mesh_id() mesh => state(igh_p)%get_mesh() + ! The SI operators are assembled unscaled; the tau*dt scalings are applied + ! at the point of use. The momentum-row projection operators (p2theta, q2t) + ! carry tau_u*dt*cp and the potential-temperature projection (ptheta2) + ! carries tau_t*dt. + const_u = get_tau_u_dt_cp(stepper) + const_t = get_tau_t_dt(stepper) + ! Normalise theta & u residual ! @TODO #416: can these be at r_solver precision? t_normalisation => get_normalisation(Wtheta, mesh_id) @@ -646,8 +678,14 @@ contains if ( eliminate_variables == eliminate_variables_analytic ) then q2t_op => get_eliminated_q2t() q3t_op => get_eliminated_q3t() + ! q2t is assembled unscaled, so re-apply the scaling tau_u*dt*cp + ! to its contribution to rhs_u. (q3t is the EOS operator p3theta + ! and is applied unscaled.) + call rhs_tmp%initialise( vector_space = rhs_rsol(igh_u)%get_function_space() ) call invoke( dg_inc_matrix_vector_kernel_type( rhs_rsol(igh_p), rhs_rsol(igh_t), q3t_op ), & - matrix_vector_kernel_type( rhs_rsol(igh_u), rhs_rsol(igh_t), q2t_op ), & + setval_c(rhs_tmp, 0.0_r_solver), & + matrix_vector_kernel_type( rhs_tmp, rhs_rsol(igh_t), q2t_op ), & + inc_X_plus_bY( rhs_rsol(igh_u), const_u, rhs_tmp ), & enforce_bc_kernel_type( rhs_rsol(igh_u) ) ) else p3theta => get_p3theta() @@ -657,9 +695,10 @@ contains ! Set rhs_u = rhs_u + M_2^{diag} * P_{2,theta} * rhs_theta call rhs_tmp%initialise( vector_space = rhs_rsol(igh_u)%get_function_space() ) p2theta => get_p2theta() + ! p2theta is assembled unscaled, so apply the scaling tau_u*dt*cp call invoke( setval_c(rhs_tmp, 0.0_r_solver), & matrix_vector_kernel_type( rhs_tmp, rhs_rsol(igh_t), p2theta ), & - inc_X_times_Y(rhs_tmp, m2_diag), & + inc_aX_times_Y(const_u, rhs_tmp, m2_diag), & inc_X_plus_Y(rhs_rsol(igh_u), rhs_tmp), & enforce_bc_kernel_type( rhs_rsol(igh_u) ) ) end if @@ -704,7 +743,7 @@ contains ! Compute rho increment since solver does not provide one div => get_im3_div_r_solver(mesh_id) rho_at_u => get_rho_at_u() - tau_r_dt = real(-tau_r*dt, kind=r_solver) + tau_r_dt = -get_tau_r_dt(stepper) call div_u%initialise( vector_space = rhs_rsol(igh_p)%get_function_space() ) call f_star%initialise( vector_space = rhs_rsol(igh_u)%get_function_space() ) @@ -714,7 +753,7 @@ contains ) call f_star_rdef%initialise( vector_space = rhs(igh_u)%get_function_space() ) - tau_r_dt_rdef = real(tau_r*dt, kind=r_def) + tau_r_dt_rdef = real(-tau_r_dt, kind=r_def) call invoke( & real_to_real_x(f_star_rdef, f_star), & inc_X_plus_bY(dry_flux_solver, tau_r_dt_rdef, f_star_rdef) & @@ -724,8 +763,10 @@ contains ptheta2 => get_ptheta2() mt_lumped_inv => get_normalisation_r_solver(Wtheta, mesh_id) call rhs_tmp%initialise( vector_space = rhs_rsol(igh_t)%get_function_space() ) + ! ptheta2 is assembled unscaled, so apply the scaling tau_t*dt call invoke( setval_c(rhs_tmp, 0.0_r_solver), & - dg_inc_matrix_vector_kernel_type(rhs_tmp, inc_uvw_rsol, ptheta2)) + dg_inc_matrix_vector_kernel_type(rhs_tmp, inc_uvw_rsol, ptheta2), & + inc_a_times_X(const_t, rhs_tmp)) if ( eliminate_variables == eliminate_variables_analytic ) then call invoke( real_to_real_x(rhs_rdef, rhs_tmp) ) diff --git a/science/gungho/source/algorithm/solver/si_operators_alg_mod.x90 b/science/gungho/source/algorithm/solver/si_operators_alg_mod.x90 index 031008b871..ad0dcbab37 100644 --- a/science/gungho/source/algorithm/solver/si_operators_alg_mod.x90 +++ b/science/gungho/source/algorithm/solver/si_operators_alg_mod.x90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the locally assembled SI operators. @@ -13,6 +15,7 @@ module si_operators_alg_mod use config_mod, only: config_type use constants_mod, only: i_def, r_def, r_solver + use inventory_by_integer_mod, only: inventory_by_integer_type use model_clock_mod, only: model_clock_type use operator_mod, only: operator_type, r_solver_operator_type use field_mod, only: field_type @@ -45,6 +48,8 @@ module si_operators_alg_mod use mixed_solver_config_mod, only: eliminate_variables, & eliminate_variables_analytic use moist_dyn_mod, only: num_moist_factors, gas_law, total_mass + use dycore_constants_mod, only: stepper_siqn, stepper_tr, stepper_bdf2, & + gamma, gamma2 ! Configuration modules use base_mesh_config_mod, only: prime_mesh_name @@ -65,16 +70,33 @@ module si_operators_alg_mod type(r_solver_operator_type), allocatable, dimension(:), target :: p3theta type(r_solver_operator_type), allocatable, dimension(:), target :: compound_div type(r_solver_operator_type), allocatable, dimension(:), target :: eliminated_q22 - type(r_solver_operator_type), allocatable, dimension(:), target :: eliminated_q32 + type(r_solver_operator_type), allocatable, dimension(:), target :: eliminated_q32_rho + type(r_solver_operator_type), allocatable, dimension(:), target :: eliminated_q32_theta type(r_solver_operator_type), target :: eliminated_q2t type(r_solver_field_type), allocatable, dimension(:), target :: rho_at_u - type(r_solver_field_type), allocatable, dimension(:,:), target :: tri_precon - type(r_solver_field_type), allocatable, dimension(:,:), target :: Helmholtz_operator - type(r_solver_field_type), allocatable, dimension(:), target :: Helm_diag - type(r_solver_field_type), allocatable, dimension(:), target :: Hb_lumped_inv integer(kind=i_def) :: multigrid_levels + ! The tri_precon, Helmholtz_operator, Helm_diag and Hb_lumped_inv working + ! fields, together with the tau*dt scaling constants, are stored in + ! inventories keyed by the time stepper enumerator. + ! + ! The scaling constants (tau*dt factors) are applied at the point of use of + ! the SI operators. The operators themselves are assembled unscaled, so any + ! algorithm that applies them must multiply in the appropriate constant. + ! + ! The stepper enumerator is passed as an argument to the getters (and to + ! compute_helmholtz_operators) so that the appropriate operator can be + ! picked up. + type(inventory_by_integer_type) :: tri_precon_inventory + type(inventory_by_integer_type) :: helmholtz_operator_inventory + type(inventory_by_integer_type) :: helm_diag_inventory + type(inventory_by_integer_type) :: hb_lumped_inv_inventory + type(inventory_by_integer_type) :: tau_u_dt_cp_inventory + type(inventory_by_integer_type) :: tau_t_dt_inventory + type(inventory_by_integer_type) :: tau_r_dt_inventory + type(inventory_by_integer_type) :: tau_tu_dt2_cp_inventory + ! Size of the Helmholtz stencil: 1 Central cell, 4 horizontal neighbours, 2 ! cells above (k+1,k+2) and 2 cells below (k-1,k-2) integer(kind=i_def), parameter :: helmholtz_stencil_size = 9 @@ -94,7 +116,8 @@ module si_operators_alg_mod ! Public functions to create and access the module contents public :: create_si_operators - public :: compute_si_operators + public :: compute_si_operators_common + public :: compute_helmholtz_operators public :: final_si_operators public :: get_m3_rho_star public :: get_m3_exner_star @@ -110,9 +133,14 @@ module si_operators_alg_mod public :: get_Hb_lumped_inv public :: get_Helmholtz_operator public :: get_eliminated_q22 - public :: get_eliminated_q32 + public :: get_eliminated_q32_rho + public :: get_eliminated_q32_theta public :: get_eliminated_q2t public :: get_eliminated_q3t + public :: get_tau_u_dt_cp + public :: get_tau_t_dt + public :: get_tau_r_dt + public :: get_tau_tu_dt2_cp !F90 function overloading interface get_m3_rho_star @@ -171,35 +199,144 @@ module si_operators_alg_mod module procedure get_eliminated_q22_fine, get_eliminated_q22_mg end interface get_eliminated_q22 - interface get_eliminated_q32 - module procedure get_eliminated_q32_fine, get_eliminated_q32_mg - end interface get_eliminated_q32 + interface get_eliminated_q32_rho + module procedure get_eliminated_q32_rho_fine, get_eliminated_q32_rho_mg + end interface get_eliminated_q32_rho + + interface get_eliminated_q32_theta + module procedure get_eliminated_q32_theta_fine, get_eliminated_q32_theta_mg + end interface get_eliminated_q32_theta contains - !>@brief Subroutine to create the si operators - !>@param[in] mesh The mesh - subroutine create_si_operators( mesh ) + !> @brief Subroutine to create the si operators + !> @param[in] mesh The mesh + !> @param[in] stepper The time stepper enumerator used to key the inventories + !> @param[in] config Application namelist configuration object + !> @param[in] clock Model clock, used to obtain the timestep length + subroutine create_si_operators( mesh, stepper, config, clock ) use fs_continuity_mod, only: W0, Wtheta implicit none type(mesh_type), pointer, intent(in) :: mesh + integer(kind=i_def), intent(in) :: stepper + type(config_type), intent(in) :: config + class(model_clock_type), intent(in) :: clock integer(kind=i_def) :: i, j type(function_space_type), pointer :: w2_fs => null() type(function_space_type), pointer :: w3_fs => null() type(function_space_type), pointer :: wt_fs => null() + real(kind=r_def) :: dt, tau_u, tau_r, tau_t, cp + real(kind=r_solver) :: tau_u_dt_cp, tau_t_dt, tau_r_dt, tau_tu_dt2_cp + + ! Working fields, created directly in the inventories (keyed by stepper) + ! via add_field_array below, and then initialised level-by-level on their + ! own mesh / function space. tri_precon and Helmholtz_operator are only + ! built for certain configurations, so are left unassociated otherwise. + type(r_solver_field_type), pointer :: tri_precon(:,:) => null() + type(r_solver_field_type), pointer :: Helmholtz_operator(:,:) => null() + type(r_solver_field_type), pointer :: Helm_diag(:) => null() + type(r_solver_field_type), pointer :: Hb_lumped_inv(:) => null() + call log_event( "Gungho: creating si_operators", LOG_LEVEL_DEBUG ) - if(l_multigrid) then - multigrid_levels=multigrid_chain_nitems + if (l_multigrid) then + multigrid_levels = multigrid_chain_nitems else - multigrid_levels=1 + multigrid_levels = 1 + end if + + w2_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, W2 ) + w3_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, W3 ) + wt_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, Wtheta ) + + ! ======================================================================== ! + ! Initialise inventories + ! ======================================================================== ! + + if (.not. tri_precon_inventory%is_initialised()) & + call tri_precon_inventory%initialise(name="si_tri_precon") + if (.not. helmholtz_operator_inventory%is_initialised()) & + call helmholtz_operator_inventory%initialise(name="si_helmholtz_operator") + if (.not. helm_diag_inventory%is_initialised()) & + call helm_diag_inventory%initialise(name="si_helm_diag") + if (.not. hb_lumped_inv_inventory%is_initialised()) & + call hb_lumped_inv_inventory%initialise(name="si_hb_lumped_inv") + if (.not. tau_u_dt_cp_inventory%is_initialised()) & + call tau_u_dt_cp_inventory%initialise(name="si_tau_u_dt_cp") + if (.not. tau_t_dt_inventory%is_initialised()) & + call tau_t_dt_inventory%initialise(name="si_tau_t_dt") + if (.not. tau_r_dt_inventory%is_initialised()) & + call tau_r_dt_inventory%initialise(name="si_tau_r_dt") + if (.not. tau_tu_dt2_cp_inventory%is_initialised()) & + call tau_tu_dt2_cp_inventory%initialise(name="si_tau_tu_dt2_cp") + + ! ======================================================================== ! + ! Create operators that are only needed once + ! ======================================================================== ! + + ! Use allocation of m3_rho_star to indicate whether any SI operators + ! have been created yet + if (.not. allocated(m3_rho_star)) then + allocate(m3_rho_star(multigrid_levels)) + allocate(m3_exner_star(multigrid_levels)) + allocate(div_star(multigrid_levels)) + allocate(p2theta(multigrid_levels)) + allocate(ptheta2(multigrid_levels)) + allocate(ptheta2v(multigrid_levels)) + allocate(p3theta(multigrid_levels)) + allocate(compound_div(multigrid_levels)) + allocate(eliminated_q22(multigrid_levels)) + allocate(eliminated_q32_rho(multigrid_levels)) + allocate(eliminated_q32_theta(multigrid_levels)) + allocate(rho_at_u(multigrid_levels)) + + call eliminated_q2t%initialise( w2_fs, wt_fs ) + + if (l_multigrid) then + call multigrid_function_space_chain%set_current(w3_fs%get_id()) + call w2_multigrid_function_space_chain%set_current(w2_fs%get_id()) + call wtheta_multigrid_function_space_chain%set_current(wt_fs%get_id()) + end if + + ! Loop through multigrid levels, initialising operators for each level + do i = 1, multigrid_levels + + write(log_scratch_space,'(A,I0,A)') "si_ops[",i,"]:creating ops" + call log_event(log_scratch_space,LOG_LEVEL_DEBUG) + + call m3_rho_star(i)%initialise( w3_fs, w3_fs ) + call m3_exner_star(i)%initialise( w3_fs, w3_fs ) + call div_star(i)%initialise( w2_fs, w3_fs ) + call p2theta(i)%initialise( w2_fs, wt_fs ) + call ptheta2(i)%initialise( wt_fs, w2_fs ) + call ptheta2v(i)%initialise( wt_fs, w2_fs ) + call p3theta(i)%initialise( w3_fs, wt_fs ) + call compound_div(i)%initialise( w3_fs, w2_fs ) + call eliminated_q22(i)%initialise( w2_fs, w2_fs ) + call eliminated_q32_rho(i)%initialise( w3_fs, w2_fs ) + call eliminated_q32_theta(i)%initialise( w3_fs, w2_fs ) + + call rho_at_u(i)%initialise(vector_space = w2_fs) + if (l_multigrid) then + w3_fs => multigrid_function_space_chain%get_next() + w2_fs => w2_multigrid_function_space_chain%get_next() + wt_fs => wtheta_multigrid_function_space_chain%get_next() + end if + end do end if + ! ======================================================================== ! + ! Fields, possibly needed multiple times + ! ======================================================================== ! + w2_fs => function_space_collection%get_fs( mesh, element_order_h, & element_order_v, W2 ) w3_fs => function_space_collection%get_fs( mesh, element_order_h, & @@ -207,78 +344,98 @@ contains wt_fs => function_space_collection%get_fs( mesh, element_order_h, & element_order_v, Wtheta ) - allocate(m3_rho_star(multigrid_levels)) - allocate(m3_exner_star(multigrid_levels)) - allocate(div_star(multigrid_levels)) - allocate(p2theta(multigrid_levels)) - allocate(ptheta2(multigrid_levels)) - allocate(ptheta2v(multigrid_levels)) - allocate(p3theta(multigrid_levels)) - allocate(compound_div(multigrid_levels)) - allocate(eliminated_q22(multigrid_levels)) - allocate(eliminated_q32(multigrid_levels)) - - !fields - allocate(rho_at_u(multigrid_levels)) if ( preconditioner == preconditioner_tridiagonal .or. & - preconditioner == preconditioner_multigrid) then + preconditioner == preconditioner_multigrid ) then if ( element_order_h /= 0 .or. element_order_v /= 0 ) then - call log_event( "tridiagonal precon only valid for order 0", & + call log_event( "tridiagonal precon only valid for order 0", & LOG_LEVEL_ERROR ) end if - allocate(tri_precon(3, multigrid_levels)) - end if - if ( element_order_h == 0 .and. element_order_v == 0 ) then - allocate( Helmholtz_operator(helmholtz_stencil_size, multigrid_levels) ) - end if - allocate(helm_diag(multigrid_levels)) - allocate(Hb_lumped_inv(multigrid_levels)) - - if (l_multigrid) then + call tri_precon_inventory%add_field_array( & + tri_precon, w3_fs, 3, multigrid_levels, stepper & + ) + end if + if ( element_order_h == 0 .and. element_order_v == 0 ) then + call helmholtz_operator_inventory%add_field_array( & + Helmholtz_operator, w3_fs, helmholtz_stencil_size, & + multigrid_levels, stepper & + ) + end if + call helm_diag_inventory%add_field_array( & + Helm_diag, w3_fs, multigrid_levels, stepper & + ) + call hb_lumped_inv_inventory%add_field_array( & + Hb_lumped_inv, w2_fs, multigrid_levels, stepper & + ) + + if (l_multigrid) then call multigrid_function_space_chain%set_current(w3_fs%get_id()) call w2_multigrid_function_space_chain%set_current(w2_fs%get_id()) call wtheta_multigrid_function_space_chain%set_current(wt_fs%get_id()) - end if - - call eliminated_q2t%initialise( w2_fs, wt_fs ) - - do i = 1, multigrid_levels - - write(log_scratch_space,'(A,I0,A)') "si_ops[",i,"]:creating ops" - call log_event(log_scratch_space,LOG_LEVEL_DEBUG) + end if - call m3_rho_star(i)%initialise( w3_fs, w3_fs ) - call m3_exner_star(i)%initialise( w3_fs, w3_fs ) - call div_star(i)%initialise( w2_fs, w3_fs ) - call p2theta(i)%initialise( w2_fs, wt_fs ) - call ptheta2(i)%initialise( wt_fs, w2_fs ) - call ptheta2v(i)%initialise( wt_fs, w2_fs ) - call p3theta(i)%initialise( w3_fs, wt_fs ) - call compound_div(i)%initialise( w3_fs, w2_fs ) - call eliminated_q22(i)%initialise( w2_fs, w2_fs ) - call eliminated_q32(i)%initialise( w3_fs, w2_fs ) + ! Loop through multigrid levels, initialising the working fields on each + ! level's function spaces + do i = 1, multigrid_levels - call rho_at_u(i)%initialise(vector_space = w2_fs) - if ( preconditioner == preconditioner_tridiagonal .or. & + if ( preconditioner == preconditioner_tridiagonal .or. & preconditioner == preconditioner_multigrid ) then call tri_precon(1,i)%initialise(vector_space = w3_fs) call tri_precon(2,i)%initialise(vector_space = w3_fs) call tri_precon(3,i)%initialise(vector_space = w3_fs) - end if - if ( element_order_h == 0 .and. element_order_v == 0 ) then - do j = 1,helmholtz_stencil_size - call Helmholtz_operator(j,i)%initialise(vector_space = w3_fs) - end do - end if - call helm_diag(i)%initialise(vector_space = w3_fs) - call Hb_lumped_inv(i)%initialise(vector_space = w2_fs) - if(l_multigrid) then - w3_fs=>multigrid_function_space_chain%get_next() - w2_fs=>w2_multigrid_function_space_chain%get_next() - wt_fs=>wtheta_multigrid_function_space_chain%get_next() - end if + end if + if ( element_order_h == 0 .and. element_order_v == 0 ) then + do j = 1,helmholtz_stencil_size + call Helmholtz_operator(j,i)%initialise(vector_space = w3_fs) + end do + end if + call helm_diag(i)%initialise(vector_space = w3_fs) + call Hb_lumped_inv(i)%initialise(vector_space = w2_fs) + if (l_multigrid) then + w3_fs => multigrid_function_space_chain%get_next() + w2_fs => w2_multigrid_function_space_chain%get_next() + wt_fs => wtheta_multigrid_function_space_chain%get_next() + end if end do - nullify( w2_fs, w3_fs, wt_fs ) + + ! ======================================================================== ! + ! Store scaling constants for this stepper + ! ======================================================================== ! + + ! Compute the tau*dt scaling constants from the namelist configuration and + ! the timestep length obtained from the clock + dt = real(clock%get_seconds_per_step(), r_def) + cp = config%planet%cp() + + select case (stepper) + case (stepper_siqn) + tau_u = config%timestepping%tau_u() + tau_r = config%timestepping%tau_r() + tau_t = config%timestepping%tau_t() + tau_u_dt_cp = real(tau_u*dt*cp, r_solver) + tau_t_dt = real(tau_t*dt, r_solver) + tau_r_dt = real(tau_r*dt, r_solver) + tau_tu_dt2_cp = real(tau_t*tau_u*dt**2*cp, r_solver) + case (stepper_tr) + ! tau_u = gamma, tau_r = 2*gamma, tau_t = 2*gamma + tau_u_dt_cp = real(gamma*dt*cp, r_solver) + tau_t_dt = 2.0_r_solver*real(gamma*dt, r_solver) + tau_r_dt = 2.0_r_solver*real(gamma*dt, r_solver) + tau_tu_dt2_cp = 2.0_r_solver*real(gamma**2*dt**2*cp, r_solver) + case (stepper_bdf2) + ! tau_u = gamma2, tau_r = 1, tau_t = 1 + tau_u_dt_cp = real(gamma2*dt*cp, r_solver) + tau_t_dt = real(dt, r_solver) + tau_r_dt = real(dt, r_solver) + tau_tu_dt2_cp = real(gamma2*dt**2*cp, r_solver) + case default + call log_event( "Unknown stepper enumerator in create_si_operators", & + LOG_LEVEL_ERROR ) + end select + + call tau_u_dt_cp_inventory%add_real(tau_u_dt_cp, stepper) + call tau_t_dt_inventory%add_real(tau_t_dt, stepper) + call tau_r_dt_inventory%add_real(tau_r_dt, stepper) + call tau_tu_dt2_cp_inventory%add_real(tau_tu_dt2_cp, stepper) end subroutine create_si_operators @@ -324,41 +481,41 @@ contains deallocate(rho_at_u) end if - if(allocated(Helm_diag)) then - deallocate(Helm_diag) - end if - - if(allocated(tri_precon)) then - deallocate(tri_precon) - end if - - if(allocated(hb_lumped_inv)) then - deallocate(hb_lumped_inv) - end if - - if(allocated(Helmholtz_operator)) then - deallocate(Helmholtz_operator) - end if + ! Clear the inventories holding the working fields and scaling constants + call tri_precon_inventory%clear() + call helmholtz_operator_inventory%clear() + call helm_diag_inventory%clear() + call hb_lumped_inv_inventory%clear() + call tau_u_dt_cp_inventory%clear() + call tau_t_dt_inventory%clear() + call tau_r_dt_inventory%clear() + call tau_tu_dt2_cp_inventory%clear() if(allocated(eliminated_q22)) then deallocate(eliminated_q22) end if - if(allocated(eliminated_q32)) then - deallocate(eliminated_q32) + if(allocated(eliminated_q32_rho)) then + deallocate(eliminated_q32_rho) + end if + + if(allocated(eliminated_q32_theta)) then + deallocate(eliminated_q32_theta) end if end subroutine final_si_operators - !> @brief Subroutine to compute the si operators + !> @brief Subroutine to compute the generic (stepper-independent) SI operators + !> @details Computes the reference-state-dependent operators and fields + !! that do not depend on the tau*dt scaling constants, storing + !! them in the plain module arrays (not keyed by stepper). !> @param[in] config Application namelist configuration object !> @param[in] theta_ref Reference Potential temperature !> @param[in] rho_ref Reference Density !> @param[in] exner_ref Reference Exner pressure - !> @param[in] model_clock Time in the model !> @param[in] moist_dyn_ref Bundle of reference moist dynamics factors - subroutine compute_si_operators(config, theta_ref, rho_ref, exner_ref, & - model_clock, moist_dyn_ref) + subroutine compute_si_operators_common(config, theta_ref, rho_ref, & + exner_ref, moist_dyn_ref) use quadrature_xyoz_mod, only: quadrature_xyoz_type use quadrature_face_mod, only: quadrature_face_type @@ -382,28 +539,15 @@ contains get_panel_id, & get_height_fv use sci_fem_constants_mod, only: get_rmultiplicity_fe - use dycore_constants_mod, only: get_w2_mass_matrix, & - w2_lagged_damping_layer_matrix use solver_constants_mod, only: get_detj_at_w3_r_solver, & get_im3_div_r_solver, & get_normalisation_r_solver, & get_inverse_mass_matrix_r_solver - use limited_area_constants_mod, only: get_mask_fv - use sci_invert_local_operator_kernel_mod, only: invert_local_operator_kernel_type - use field_indices_mod, only: igh_u, igh_t, igh_d, igh_p - use planet_config_mod, only: kappa, cp, rd, p_zero - use timestepping_config_mod, only: tau_r, tau_t, tau_u + use planet_config_mod, only: kappa, rd, p_zero use reference_element_mod, only: reference_element_type use mesh_mod, only: mesh_type - use matrix_vector_kernel_mod, only: matrix_vector_kernel_type - use dg_inc_matrix_vector_kernel_mod, only: dg_inc_matrix_vector_kernel_type - use formulation_config_mod, only: dlayer_on, & - lagged_orog, & - dry_static_adjust + use formulation_config_mod, only: dry_static_adjust use sci_sort_ref_kernel_mod, only: sort_ref_kernel_type - use psykal_lite_mod, only: invoke_helmholtz_operator_kernel_type, & - invoke_elim_helmholtz_operator_kernel_type - use boundaries_config_mod, only: limited_area use sample_eliminated_theta_q32_kernel_mod, & only: sample_eliminated_theta_q32_kernel_type use project_eliminated_theta_q32_kernel_mod, & @@ -419,7 +563,6 @@ contains use sci_restrict_scalar_unweighted_kernel_mod, & only: restrict_scalar_unweighted_kernel_type use sci_operator_algebra_kernel_mod, only: operator_setval_x_kernel_type - use model_clock_mod, only: model_clock_type implicit none @@ -427,8 +570,7 @@ contains type(field_type), intent(in) :: theta_ref, rho_ref, exner_ref type(field_type), intent(in) :: moist_dyn_ref(num_moist_factors) - class(model_clock_type), intent(in) :: model_clock - real(kind=r_def) :: dt + type(quadrature_xyoz_type) :: qr type(quadrature_face_type) :: qrf type(quadrature_rule_gaussian_type) :: quadrature_rule @@ -440,17 +582,10 @@ contains type(function_space_type), pointer :: w3_fs => null() type(function_space_type), pointer :: w2_fs => null() type(function_space_type), pointer :: wt_fs => null() - real(kind=r_solver) :: const1, const2, const3 - integer(kind=i_def), parameter :: imone = -1_i_def class(reference_element_type), pointer :: reference_element =>null() type(mesh_type), pointer :: mesh => null() - type(operator_type), pointer :: m2 => null() - type(r_solver_field_type), pointer :: u_normalisation => null(), & - t_normalisation => null() - type(r_solver_field_type) :: m2_u, theta_adv_term - integer(kind=i_def) :: level, i - type(r_solver_field_type) :: rsol_w2_mask - type(field_type), pointer :: w2_mask => null() + type(r_solver_field_type), pointer :: u_normalisation => null() + integer(kind=i_def) :: level type(field_type), pointer :: height_w3 => null() type(field_type), pointer :: height_wt => null() type(r_solver_field_type) :: multiplicity @@ -461,7 +596,6 @@ contains theta, & coarse_field type(r_solver_field_type) :: rsol_w2_rmultiplicity - type(r_solver_operator_type) :: m2_r_solver type(r_solver_field_type), pointer :: detj_at_w3 => null() type(field_type) :: moist_dyn_factor_rdef type(r_solver_field_type) :: moist_dyn_factor, theta_v @@ -473,10 +607,8 @@ contains integer(kind=i_def), parameter :: req_halo_depth = req_stencil_depth + 1 integer(tik) :: id - if ( LPROF ) call start_timing( id, 'dynamics.compute_si_operators' ) - call log_event( "Gungho: computing si_operators", LOG_LEVEL_DEBUG ) - - dt = real(model_clock%get_seconds_per_step(), r_def) + if ( LPROF ) call start_timing( id, 'dynamics.compute_si_operators_common' ) + call log_event( "Gungho: computing si_operators_common", LOG_LEVEL_DEBUG ) mesh => exner_ref%get_mesh() @@ -555,7 +687,6 @@ contains end if m3_inv => get_inverse_mass_matrix_r_solver( W3, mesh%get_id() ) - const1 = real(tau_t*tau_u*dt**2*cp, r_solver) select case(eos_method) case(eos_method_sampled) call invoke( sample_eos_operators_kernel_type(m3_exner_star(level), m3_rho_star(level), & @@ -571,7 +702,7 @@ contains if ( eliminate_variables == eliminate_variables_analytic ) then call invoke( eliminated_theta_q22_kernel_type(eliminated_q22(level), theta, & exner_in_wth, u_normalisation, & - chi, panel_id, const1, qr) ) + chi, panel_id, qr) ) end if ! Compute rho^ref at u nodal points @@ -599,71 +730,227 @@ contains element_order_v+2, quadrature_rule) ! Cell kernels - const1 = real(tau_u*dt*cp, r_solver) - const2 = real(tau_t*dt, r_solver) - const3 = real(tau_r*dt, r_solver) div => get_im3_div_r_solver(mesh%get_id()) if ( p2theta_vert ) then ! The projection operators are restricted to use the vertical only call invoke( weighted_proj_2thetav_kernel_type(p2theta(level), exner, & moist_dyn_factor, & - const1, & element_order_h, & element_order_v, qr), & weighted_proj_theta2v_kernel_type(ptheta2(level), theta, & - const2, & element_order_h, & element_order_v, qr) ) else ! The projection operators use horizonal and vertical call invoke( weighted_proj_2theta_kernel_type(p2theta(level), exner, & - moist_dyn_factor, const1, qr), & - weighted_proj_theta2_kernel_type(ptheta2(level), theta, const2, qr), & + moist_dyn_factor, qr), & + weighted_proj_theta2_kernel_type(ptheta2(level), theta, qr), & weighted_proj_theta2_bd_kernel_type(ptheta2(level), theta, & - req_stencil_depth, const2, qrf), & + req_stencil_depth, qrf), & weighted_proj_2theta_bd_kernel_type(p2theta(level), exner, & req_stencil_depth, & - moist_dyn_factor, const1, qrf) ) + moist_dyn_factor, qrf) ) end if call invoke( name = "cell_and_boundary_kernels_vert", & - weighted_div_kernel_type(div_star(level), theta_v, const1, qr), & + weighted_div_kernel_type(div_star(level), theta_v, qr), & weighted_proj_theta2_vert_kernel_type(ptheta2v(level), theta, & - const2, element_order_h, & + element_order_h, & element_order_v, qr), & ! Boundary kernels weighted_div_bd_kernel_type(div_star(level), theta_v, req_stencil_depth, & - const1, qrf), & + qrf), & ! Compound operators compound_operator_kernel_type( compound_div(level), m3_rho_star(level), & - div, rho_at_u(level), const3), & - operator_setval_x_kernel_type( eliminated_q32(level), compound_div(level) ) ) + div, rho_at_u(level), 1.0_r_solver), & + operator_setval_x_kernel_type( eliminated_q32_rho(level), compound_div(level) ) ) if ( level == 1 .and. eliminate_variables == eliminate_variables_analytic ) then call invoke( eliminated_theta_q2t_kernel_type(eliminated_q2t, u_normalisation, & - exner_in_wth, const1, qr) ) + exner_in_wth, qr) ) end if if ( eliminate_variables == eliminate_variables_analytic ) then - ! Add on contribution to q32 from eliminating theta + ! Add the contribution to q32 from eliminating theta into seperate operator select case(eos_method) case(eos_method_sampled) detj_at_w3 => get_detj_at_w3_r_solver( mesh%get_id() ) - call invoke( sample_eliminated_theta_q32_kernel_type(eliminated_q32(level), theta, detj_at_w3 , & - const2) ) + call invoke( sample_eliminated_theta_q32_kernel_type(eliminated_q32_theta(level), theta, detj_at_w3 ) ) case(eos_method_projected) - call invoke( project_eliminated_theta_q32_kernel_type(eliminated_q32(level), theta, & - m3_inv, const2, qr ) ) + call invoke( project_eliminated_theta_q32_kernel_type(eliminated_q32_theta(level), theta, & + m3_inv, qr ) ) case default call log_event( "Gungho: Unrecognised method used for equation of state", LOG_LEVEL_ERROR ) end select end if + ! Restrict the fields for the next level, provided not last time round + ! the loop + if (level < multigrid_levels) then + ! should not get here if no multigrid, but just in case + if (l_multigrid) then + + write(log_scratch_space,'(A,I0,A,I0)') & + "si_ops:MG restrict L",level," to L",level+1 + call log_event(log_scratch_space,LOG_LEVEL_DEBUG) + + ! copy current field to coarse field + call theta%copy_field_properties(coarse_field) + call invoke( setval_X(coarse_field, theta) ) + ! set the fs to the next (fine) + wt_fs=>wtheta_multigrid_function_space_chain%get_next() + call theta%initialise(vector_space = wt_fs, halo_depth=req_halo_depth ) + ! call restrict + call invoke( restrict_scalar_unweighted_kernel_type(theta, coarse_field) ) + + ! copy current field to coarse field + call moist_dyn_factor%copy_field_properties(coarse_field) + call invoke( setval_X(coarse_field, moist_dyn_factor) ) + call moist_dyn_factor%initialise(vector_space = wt_fs) + ! call restrict + call invoke( restrict_scalar_unweighted_kernel_type(moist_dyn_factor, coarse_field) ) + + ! copy current field to coarse field + call rho%copy_field_properties(coarse_field) + call invoke( setval_X(coarse_field, rho) ) + ! set the fs to the next (fine) + w3_fs=>multigrid_function_space_chain%get_next() + call rho%initialise(vector_space = w3_fs, halo_depth=req_halo_depth ) + ! call restrict + call invoke( restrict_scalar_unweighted_kernel_type(rho, coarse_field) ) + + ! copy current field to coarse field + call exner%copy_field_properties(coarse_field) + call invoke( setval_X(coarse_field, exner) ) + ! fs already set fine + call exner%initialise(vector_space = w3_fs , halo_depth=req_halo_depth) + ! call restrict + call invoke( restrict_scalar_unweighted_kernel_type(exner, coarse_field) ) + ! set w2_fs to next in chain + w2_fs=>w2_multigrid_function_space_chain%get_next() + end if + end if + + end do ! end of multigrid levels loop + + nullify( chi, panel_id, m3_inv, div, w2_rmultiplicity, & + mesh, reference_element, u_normalisation ) + if ( LPROF ) call stop_timing( id, 'dynamics.compute_si_operators_common' ) + + end subroutine compute_si_operators_common + + !> @brief Subroutine to compute the stepper-dependent Helmholtz operators. + !> @details Computes the Hb_lumped_inv, Helmholtz_operator, tri_precon and + !! Helm_diag fields, applying the tau*dt scaling constants for the + !! given stepper, and storing the results in the per-stepper + !! inventories. Requires compute_si_operators_common to have been + !! called first. + !> @param[in] model_clock Time in the model + !> @param[in] stepper Timestepper enumerator + subroutine compute_helmholtz_operators(model_clock, stepper) + + use fs_continuity_mod, only: W2, W3, Wtheta + use dycore_constants_mod, only: get_w2_mass_matrix, & + w2_lagged_damping_layer_matrix + use solver_constants_mod, only: get_normalisation_r_solver + use limited_area_constants_mod, only: get_mask_fv + use matrix_vector_kernel_mod, only: matrix_vector_kernel_type + use dg_inc_matrix_vector_kernel_mod, only: dg_inc_matrix_vector_kernel_type + use psykal_lite_mod, only: invoke_helmholtz_operator_kernel_type, & + invoke_elim_helmholtz_operator_kernel_type + use boundaries_config_mod, only: limited_area + use sci_operator_algebra_kernel_mod, only: operator_setval_x_kernel_type + use mesh_mod, only: mesh_type + use model_clock_mod, only: model_clock_type + + implicit none + + class(model_clock_type), intent(in) :: model_clock + integer(kind=i_def), intent(in) :: stepper + + real(kind=r_solver), pointer :: tau_u_dt_cp + real(kind=r_solver), pointer :: tau_t_dt + real(kind=r_solver), pointer :: tau_r_dt + real(kind=r_solver), pointer :: tau_tu_dt2_cp + type(r_solver_field_type), pointer :: tri_precon(:,:) + type(r_solver_field_type), pointer :: Helmholtz_operator(:,:) + type(r_solver_field_type), pointer :: Helm_diag(:) + type(r_solver_field_type), pointer :: Hb_lumped_inv(:) + type(function_space_type), pointer :: w3_fs + type(function_space_type), pointer :: w2_fs + type(function_space_type), pointer :: wt_fs + integer(kind=i_def), parameter :: imone = -1_i_def + type(mesh_type), pointer :: mesh + type(operator_type), pointer :: m2 + type(r_solver_field_type), pointer :: u_normalisation + type(r_solver_field_type), pointer :: t_normalisation + type(r_solver_field_type) :: ones, m2_u, theta_adv_term + integer(kind=i_def) :: level, i + type(r_solver_field_type) :: rsol_w2_mask + type(field_type), pointer :: w2_mask + type(r_solver_operator_type) :: m2_r_solver + + ! For continuous fields the default looping depth is to the depth 1 halo + ! and so for any fields that are accessed with a stencil the halo_depth + ! needs to be one bigger than the required stencil_depth + integer(kind=i_def), parameter :: req_stencil_depth = 1 + integer(tik) :: id + + if ( LPROF ) call start_timing( id, 'dynamics.compute_helmholtz_operators' ) + call log_event( "Gungho: computing helmholtz_operators", LOG_LEVEL_DEBUG ) + + if ( .not. allocated(m3_rho_star) ) then + call log_event( "Gungho: compute_helmholtz_operators called before " // & + "compute_si_operators_common", LOG_LEVEL_ERROR ) + end if + + ! Retrieve the tau*dt scaling constants (computed in create_si_operators) + ! and pointers to the working fields, all keyed by the active stepper + call tau_u_dt_cp_inventory%get_real(stepper, tau_u_dt_cp) + call tau_t_dt_inventory%get_real(stepper, tau_t_dt) + call tau_r_dt_inventory%get_real(stepper, tau_r_dt) + call tau_tu_dt2_cp_inventory%get_real(stepper, tau_tu_dt2_cp) + + call helm_diag_inventory%get_field_array(stepper, Helm_diag) + call hb_lumped_inv_inventory%get_field_array(stepper, Hb_lumped_inv) + if ( preconditioner == preconditioner_tridiagonal .or. & + preconditioner == preconditioner_multigrid ) then + call tri_precon_inventory%get_field_array(stepper, tri_precon) + end if + if ( element_order_h == 0 .and. element_order_v == 0 ) then + call helmholtz_operator_inventory%get_field_array(stepper, & + Helmholtz_operator) + end if + + ! Fetch the finest-level function spaces from the generic module arrays, + ! then reset the multigrid function space chains to walk them again + ! independently of the loop in compute_si_operators_common + mesh => rho_at_u(1)%get_mesh() + w3_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, W3 ) + w2_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, W2 ) + wt_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, Wtheta ) + + if (l_multigrid) then + call multigrid_function_space_chain%set_current(w3_fs%get_id()) + call w2_multigrid_function_space_chain%set_current(w2_fs%get_id()) + call wtheta_multigrid_function_space_chain%set_current(wt_fs%get_id()) + end if + + do level = 1, multigrid_levels + + write(log_scratch_space,'(A,I0)') "si_ops helmholtz: mg level=",level + call log_event(log_scratch_space, LOG_LEVEL_DEBUG) + + mesh => rho_at_u(level)%get_mesh() + ! Compute Hb_lumped_inv field ! mass matrix should include damping layer and lagged-orography terms ! if these options are not true, this matrix won't contain the terms m2 => get_w2_mass_matrix( & - w2_lagged_damping_layer_matrix, mesh%get_id(), model_clock & + w2_lagged_damping_layer_matrix, stepper, mesh%get_id(), model_clock & ) call m2_r_solver%initialise( w2_fs, w2_fs ) @@ -674,7 +961,7 @@ contains call m2_u%initialise( vector_space = w2_fs ) call ones%initialise( vector_space = w2_fs ) if ( eliminate_variables == eliminate_variables_analytic ) then - ! H_B = (Nu * Mu - Q22) * ones + ! H_B = (Nu * Mu - tau_tu_dt2_cp * Q22) * ones call invoke( name = "compute_analytic_lumped_inverse_h_b_operator", & setval_c(ones, 1.0_r_solver), & setval_c(Hb_lumped_inv(level), 0.0_r_solver), & @@ -682,11 +969,12 @@ contains matrix_vector_kernel_type(Hb_lumped_inv(level), ones, m2_r_solver), & inc_X_times_Y(Hb_lumped_inv(level), u_normalisation), & matrix_vector_kernel_type(m2_u, ones, eliminated_q22(level)), & + inc_X_minus_bY(Hb_lumped_inv(level), tau_tu_dt2_cp, m2_u), & inc_X_minus_Y(Hb_lumped_inv(level), m2_u), & inc_X_powint_n(Hb_lumped_inv(level), imone) ) else - ! H_B = Nu * ( Mu + P2t * Mt^-1 * Pt2v ) * ones + ! H_B = Nu * ( Mu + tau_u_dt_cp * P2t * Mt^-1 * (tau_t_dt * Pt2v) ) * ones call theta_adv_term%initialise( vector_space = wt_fs ) call invoke( name = "compute_lumped_inverse_h_b_operator", & setval_c(ones, 1.0_r_solver), & @@ -694,7 +982,9 @@ contains setval_c(theta_adv_term, 0.0_r_solver), & dg_inc_matrix_vector_kernel_type( & theta_adv_term, ones, ptheta2v(level)), & - inc_X_times_Y(theta_adv_term, t_normalisation), & + inc_aX_times_Y(tau_t_dt, theta_adv_term, & + t_normalisation), & + inc_a_times_X(tau_u_dt_cp, theta_adv_term), & matrix_vector_kernel_type( & Hb_lumped_inv(level), theta_adv_term, & p2theta(level) ), & @@ -722,8 +1012,10 @@ contains u_normalisation, & div_star(level), & m3_exner_star(level), & - eliminated_q32(level), & - rsol_w2_mask) + eliminated_q32_rho(level), & + eliminated_q32_theta(level), & + rsol_w2_mask, & + tau_u_dt_cp, tau_r_dt, tau_t_dt) else call invoke_helmholtz_operator_kernel_type( Helmholtz_operator(:,level), & @@ -736,7 +1028,8 @@ contains compound_div(level), & m3_exner_star(level), & p3theta(level), & - rsol_w2_mask) + rsol_w2_mask, & + tau_u_dt_cp, tau_t_dt, tau_r_dt) end if end if @@ -772,61 +1065,18 @@ contains call invoke( setval_c(Helm_diag(level), 1.0_r_solver) ) end if - ! Restrict the fields for the next level, provided not last time round - ! the loop - if (level < multigrid_levels) then - ! should not get here if no multigrid, but just in case - if (l_multigrid) then - - write(log_scratch_space,'(A,I0,A,I0)') & - "si_ops:MG restrict L",level," to L",level+1 - call log_event(log_scratch_space,LOG_LEVEL_DEBUG) - - ! copy current field to coarse field - call theta%copy_field_properties(coarse_field) - call invoke( setval_X(coarse_field, theta) ) - ! set the fs to the next (fine) - wt_fs=>wtheta_multigrid_function_space_chain%get_next() - call theta%initialise(vector_space = wt_fs, halo_depth=req_halo_depth ) - ! call restrict - call invoke( restrict_scalar_unweighted_kernel_type(theta, coarse_field) ) - - ! copy current field to coarse field - call moist_dyn_factor%copy_field_properties(coarse_field) - call invoke( setval_X(coarse_field, moist_dyn_factor) ) - call moist_dyn_factor%initialise(vector_space = wt_fs) - ! call restrict - call invoke( restrict_scalar_unweighted_kernel_type(moist_dyn_factor, coarse_field) ) - - ! copy current field to coarse field - call rho%copy_field_properties(coarse_field) - call invoke( setval_X(coarse_field, rho) ) - ! set the fs to the next (fine) - w3_fs=>multigrid_function_space_chain%get_next() - call rho%initialise(vector_space = w3_fs, halo_depth=req_halo_depth ) - ! call restrict - call invoke( restrict_scalar_unweighted_kernel_type(rho, coarse_field) ) - - ! copy current field to coarse field - call exner%copy_field_properties(coarse_field) - call invoke( setval_X(coarse_field, exner) ) - ! fs already set fine - call exner%initialise(vector_space = w3_fs , halo_depth=req_halo_depth) - ! call restrict - call invoke( restrict_scalar_unweighted_kernel_type(exner, coarse_field) ) - ! set w2_fs to next in chain - w2_fs=>w2_multigrid_function_space_chain%get_next() - end if + if (level < multigrid_levels .and. l_multigrid) then + w3_fs => multigrid_function_space_chain%get_next() + w2_fs => w2_multigrid_function_space_chain%get_next() + wt_fs => wtheta_multigrid_function_space_chain%get_next() end if end do ! end of multigrid levels loop - nullify( chi, panel_id, m3_inv, div, w2_rmultiplicity, & - mesh, reference_element, m2, u_normalisation, t_normalisation, & - w2_mask, mesh ) - if ( LPROF ) call stop_timing( id, 'dynamics.compute_si_operators' ) + nullify( mesh, m2, u_normalisation, t_normalisation, w2_mask ) + if ( LPROF ) call stop_timing( id, 'dynamics.compute_helmholtz_operators' ) - end subroutine compute_si_operators + end subroutine compute_helmholtz_operators !> @brief Function to return a pointer to the m3_rho_star !! on the finest multigrid level. @@ -1010,82 +1260,114 @@ contains !> @brief Function to return a pointer to the tri_precon !! on the finest multigrid level. + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @return The field - function get_tri_precon_fine() result(sol_field) + function get_tri_precon_fine(stepper) result(sol_field) implicit none + integer(kind=i_def), intent(in) :: stepper type(r_solver_field_type), pointer :: sol_field(:) - sol_field => tri_precon(:,1) + type(r_solver_field_type), pointer :: array(:,:) + call tri_precon_inventory%get_field_array(stepper, array) + sol_field => array(:,1) end function get_tri_precon_fine !> @brief Function to return a pointer to the tri_precon !! on the specified multigrid level. + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @param[in] level The multigrid level !> @return The field - function get_tri_precon_mg(level) result(sol_field) + function get_tri_precon_mg(stepper, level) result(sol_field) implicit none - integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper + integer(kind=i_def), intent(in) :: level type(r_solver_field_type), pointer :: sol_field(:) - sol_field => tri_precon(:,level) + type(r_solver_field_type), pointer :: array(:,:) + call tri_precon_inventory%get_field_array(stepper, array) + sol_field => array(:,level) end function get_tri_precon_mg !> @brief Function to return a pointer to the helmholtz_operator !! on the finest multigrid level. + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @return The field - function get_helmholtz_operator_fine() result(sol_field) + function get_helmholtz_operator_fine(stepper) result(sol_field) implicit none + integer(kind=i_def), intent(in) :: stepper type(r_solver_field_type), pointer :: sol_field(:) - sol_field => helmholtz_operator(:,1) + type(r_solver_field_type), pointer :: array(:,:) + call helmholtz_operator_inventory%get_field_array(stepper, array) + sol_field => array(:,1) end function get_helmholtz_operator_fine !> @brief Function to return a pointer to the helmholtz_operator !! on the specified multigrid level. + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @param[in] level The multigrid level !> @return The field - function get_helmholtz_operator_mg(level) result(sol_field) + function get_helmholtz_operator_mg(stepper, level) result(sol_field) implicit none - integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper + integer(kind=i_def), intent(in) :: level type(r_solver_field_type), pointer :: sol_field(:) - sol_field => helmholtz_operator(:,level) + type(r_solver_field_type), pointer :: array(:,:) + call helmholtz_operator_inventory%get_field_array(stepper, array) + sol_field => array(:,level) end function get_helmholtz_operator_mg !> @brief Function to return a pointer to the Helm diagonal !! on the finest multigrid level. + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @return The field - function get_helm_diag_fine() result(sol_field) + function get_helm_diag_fine(stepper) result(sol_field) implicit none + integer(kind=i_def), intent(in) :: stepper type(r_solver_field_type), pointer :: sol_field - sol_field => helm_diag(1) + type(r_solver_field_type), pointer :: array(:) + call helm_diag_inventory%get_field_array(stepper, array) + sol_field => array(1) end function get_helm_diag_fine !> @brief Function to return a pointer to the Helm diagonal !! on the specified multigrid level, + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @param[in] level The multigrid level !> @return The field - function get_helm_diag_mg(level) result(sol_field) + function get_helm_diag_mg(stepper, level) result(sol_field) implicit none - integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper + integer(kind=i_def), intent(in) :: level type(r_solver_field_type), pointer :: sol_field - sol_field => helm_diag(level) + type(r_solver_field_type), pointer :: array(:) + call helm_diag_inventory%get_field_array(stepper, array) + sol_field => array(level) end function get_helm_diag_mg !> @brief Function to return a pointer to the lumped inverse Hb operator !! on the finest multigrid level, + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @return The field - function get_hb_lumped_inv_fine() result(field) + function get_hb_lumped_inv_fine(stepper) result(field) implicit none + integer(kind=i_def), intent(in) :: stepper type(r_solver_field_type), pointer :: field - field => hb_lumped_inv(1) + type(r_solver_field_type), pointer :: array(:) + call hb_lumped_inv_inventory%get_field_array(stepper, array) + field => array(1) end function get_hb_lumped_inv_fine !> @brief Function to return a pointer to the lumped inverse Hb operator !! on the specified multigrid level, + !> @param[in] stepper The timestepper enumerator used to key the inventory !> @param[in] level The multigrid level !> @return The field - function get_hb_lumped_inv_mg(level) result(field) + function get_hb_lumped_inv_mg(stepper, level) result(field) implicit none - integer(kind=i_def), intent(in) :: level + integer(kind=i_def), intent(in) :: stepper + integer(kind=i_def), intent(in) :: level type(r_solver_field_type), pointer :: field - field => hb_lumped_inv(level) + type(r_solver_field_type), pointer :: array(:) + call hb_lumped_inv_inventory%get_field_array(stepper, array) + field => array(level) end function get_hb_lumped_inv_mg !> @brief Function to return a pointer to the q22 operator @@ -1108,25 +1390,45 @@ contains op => eliminated_q22(level) end function get_eliminated_q22_mg - !> @brief Function to return a pointer to the q32 operator + !> @brief Function to return a pointer to the q32 (density part) operator !! on the finest multigrid level. !> @return The operator - function get_eliminated_q32_fine() result(op) + function get_eliminated_q32_rho_fine() result(op) implicit none type(r_solver_operator_type), pointer :: op - op => eliminated_q32(1) - end function get_eliminated_q32_fine + op => eliminated_q32_rho(1) + end function get_eliminated_q32_rho_fine - !> @brief Function to return a pointer to the q32 operator + !> @brief Function to return a pointer to the q32 (density part) operator !! on the specified multigrid level. !> @param[in] level The multigrid level !> @return The operator - function get_eliminated_q32_mg(level) result(op) + function get_eliminated_q32_rho_mg(level) result(op) implicit none integer(kind=i_def), intent(in) :: level type(r_solver_operator_type), pointer :: op - op => eliminated_q32(level) - end function get_eliminated_q32_mg + op => eliminated_q32_rho(level) + end function get_eliminated_q32_rho_mg + + !> @brief Function to return a pointer to the theta-elimination + !! contribution to q32 on the finest multigrid level. + !> @return The operator + function get_eliminated_q32_theta_fine() result(op) + implicit none + type(r_solver_operator_type), pointer :: op + op => eliminated_q32_theta(1) + end function get_eliminated_q32_theta_fine + + !> @brief Function to return a pointer to the theta-elimination + !! contribution to q32 on the specified multigrid level. + !> @param[in] level The multigrid level + !> @return The operator + function get_eliminated_q32_theta_mg(level) result(op) + implicit none + integer(kind=i_def), intent(in) :: level + type(r_solver_operator_type), pointer :: op + op => eliminated_q32_theta(level) + end function get_eliminated_q32_theta_mg !> @brief Function to return a pointer to the q2t operator. !> @return The operator @@ -1144,4 +1446,56 @@ contains op => p3theta(1) end function get_eliminated_q3t + !> @brief Return the tau_u*dt*cp scaling constant applied to the div_star, + !! p2theta and q2t operators at their point of use. + !> @param[in] stepper The timestepper enumerator used to key the inventory + !> @return The scaling constant + function get_tau_u_dt_cp(stepper) result(val) + implicit none + integer(kind=i_def), intent(in) :: stepper + real(kind=r_solver) :: val + real(kind=r_solver), pointer :: val_ptr + call tau_u_dt_cp_inventory%get_real(stepper, val_ptr) + val = val_ptr + end function get_tau_u_dt_cp + + !> @brief Return the tau_t*dt scaling constant applied to the ptheta2, + !! ptheta2v and q32_theta operators at their point of use. + !> @param[in] stepper The timestepper enumerator used to key the inventory + !> @return The scaling constant + function get_tau_t_dt(stepper) result(val) + implicit none + integer(kind=i_def), intent(in) :: stepper + real(kind=r_solver) :: val + real(kind=r_solver), pointer :: val_ptr + call tau_t_dt_inventory%get_real(stepper, val_ptr) + val = val_ptr + end function get_tau_t_dt + + !> @brief Return the tau_r*dt scaling constant applied to the compound_div + !! and q32 operators at their point of use. + !> @param[in] stepper The timestepper enumerator used to key the inventory + !> @return The scaling constant + function get_tau_r_dt(stepper) result(val) + implicit none + integer(kind=i_def), intent(in) :: stepper + real(kind=r_solver) :: val + real(kind=r_solver), pointer :: val_ptr + call tau_r_dt_inventory%get_real(stepper, val_ptr) + val = val_ptr + end function get_tau_r_dt + + !> @brief Return the tau_t*tau_u*dt**2*cp scaling constant applied to the + !! analytic q22 operator at its point of use. + !> @param[in] stepper The timestepper enumerator used to key the inventory + !> @return The scaling constant + function get_tau_tu_dt2_cp(stepper) result(val) + implicit none + integer(kind=i_def), intent(in) :: stepper + real(kind=r_solver) :: val + real(kind=r_solver), pointer :: val_ptr + call tau_tu_dt2_cp_inventory%get_real(stepper, val_ptr) + val = val_ptr + end function get_tau_tu_dt2_cp + end module si_operators_alg_mod diff --git a/science/gungho/source/algorithm/timestepping/rk_alg_timestep_mod.x90 b/science/gungho/source/algorithm/timestepping/rk_alg_timestep_mod.x90 index 94a329e03c..3d84d64f63 100644 --- a/science/gungho/source/algorithm/timestepping/rk_alg_timestep_mod.x90 +++ b/science/gungho/source/algorithm/timestepping/rk_alg_timestep_mod.x90 @@ -47,7 +47,8 @@ module rk_alg_timestep_mod copy_bundle, & set_bundle_scalar use dycore_constants_mod, only: get_geopotential, & - get_coriolis + get_coriolis, & + stepper_rk ! PsyKAl PSYClone kernels use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type @@ -389,7 +390,8 @@ contains call gungho_transport_control_alg( self%config, & self%rhs_prediction(:,stage), self%state, & self%state(igh_u), self%state(igh_u), & - mr, mr, model_clock, outer, cheap_update ) + mr, mr, model_clock, outer, stepper_rk, & + cheap_update ) ! Compute new rhs if ( rotating ) then coriolis => get_coriolis(mesh_id) diff --git a/science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 b/science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 index 298decc8ba..74267bf48b 100644 --- a/science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 +++ b/science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 @@ -58,8 +58,8 @@ module semi_implicit_timestep_alg_mod lbc_option_um2lfric_file use mixed_solver_config_mod, only: guess_np1, reference_reset_time use stochastic_physics_config_mod, only : use_spt, use_skeb, stph_spectral_dim - use timestepping_config_mod, only: alpha, & - outer_iterations, inner_iterations, & + use timestepping_config_mod, only: alpha, & + outer_iterations, inner_iterations_si, & spinup_alpha use transport_config_mod, only: cheap_update, & transport_ageofair @@ -97,9 +97,11 @@ module semi_implicit_timestep_alg_mod only: gungho_transport_control_alg_init, & gungho_transport_control_alg - use si_operators_alg_mod, only: create_si_operators, & - compute_si_operators, & + use si_operators_alg_mod, only: create_si_operators, & + compute_si_operators_common, & + compute_helmholtz_operators, & final_si_operators + use dycore_constants_mod, only: stepper_siqn use fast_physics_alg_mod, only: fast_physics use slow_physics_alg_mod, only: slow_physics use checks_and_balances_alg_mod, & @@ -129,6 +131,11 @@ module semi_implicit_timestep_alg_mod use lam_rhs_alg_mod, only: calc_rhs_lbc, & apply_mask_rhs + ! Common routines + use timestepping_common_mod, only: conditional_collection_copy, & + get_stph_values, put_stph_values + + ! Field mappings use calc_phys_predictors_alg_mod, & only: calc_phys_predictors_alg @@ -197,7 +204,6 @@ module semi_implicit_timestep_alg_mod procedure, public :: finalise => semi_implicit_alg_final procedure, nopass :: run_init procedure, nopass :: run_step - procedure, nopass :: conditional_collection_copy end type semi_implicit_timestep_type @@ -362,13 +368,13 @@ contains #ifdef UM_PHYSICS if (use_spt) then ! Get spectral coefficients and power law from the model database - call get_stph_values(modeldb, spt_array_names, spt_spectral_coeffc, & - spt_spectral_coeffs, spt_power_law) + call get_stph_values(modeldb, spt_array_names, stph_spectral_dim, & + spt_spectral_coeffc, spt_spectral_coeffs, spt_power_law) end if if (use_skeb) then ! Get spectral coefficients and power law from the model database - call get_stph_values(modeldb, skeb_array_names, skeb_spectral_coeffc, & - skeb_spectral_coeffs, skeb_power_law) + call get_stph_values(modeldb, skeb_array_names, stph_spectral_dim, & + skeb_spectral_coeffc, skeb_spectral_coeffs, skeb_power_law) end if #endif @@ -541,7 +547,7 @@ contains !-------------------------------------------------------------------- ! Operators for si solves !-------------------------------------------------------------------- - call create_si_operators( mesh ) + call create_si_operators( mesh, stepper_siqn, self%config, model_clock ) ! If using checkpointed reference state, then calculate semi-implicit ! operators using the checkpointed reference state @@ -553,8 +559,9 @@ contains call prognostic_fields%get_field('theta_ref', theta_ref) call prognostic_fields%get_field('rho_ref', rho_ref) call prognostic_fields%get_field('exner_ref', exner_ref) - call compute_si_operators(self%config, theta_ref, rho_ref, exner_ref, & - model_clock, moist_dyn_ref) + call compute_si_operators_common(self%config, theta_ref, rho_ref, & + exner_ref, moist_dyn_ref) + call compute_helmholtz_operators(model_clock, stepper_siqn) nullify(theta_ref, rho_ref, exner_ref, moist_dyn_ref, moist_dyn_ref_array) end if @@ -562,7 +569,7 @@ contains call gungho_transport_control_alg_init( mesh ) ! Construct semi-implicit solver - call semi_implicit_solver_alg_init( self%state ) + call semi_implicit_solver_alg_init( self%state, stepper_siqn ) end if nullify(mesh) @@ -798,9 +805,10 @@ contains if ( mod(model_clock%get_step() - 1_i_def, reference_reset_freq) == 0_i_def ) then ! Compute semi-implicit operators with current model state - call compute_si_operators( self%config, self%state(igh_t), & - self%state(igh_d), self%state(igh_p), & - model_clock, moist_dyn ) + call compute_si_operators_common(self%config, self%state(igh_t), & + self%state(igh_d), self%state(igh_p), & + moist_dyn) + call compute_helmholtz_operators(model_clock, stepper_siqn) checkpoint_reference_fields = & mod(model_clock%get_first_step()-1, reference_reset_freq) /= 0 .or. & @@ -890,7 +898,8 @@ contains call rhs_alg( self%rhs_n, varbeta*cast_dt, & self%state_after_slow, self%state_n, moist_dyn, & compute_eos=.false., compute_rhs_t_d=.true., & - dlayer_rhs=.false., model_clock=model_clock ) + dlayer_rhs=.false., stepper=stepper_siqn, & + model_clock=model_clock ) call copy_bundle(self%state_after_slow, self%advected_state, bundle_size) ! Set the moisture to be transported to point to the moisture after slow physics @@ -924,8 +933,10 @@ contains call gungho_transport_control_alg( self%config, & self%rhs_adv, self%advected_state, self%state(igh_u), & self%state_n(igh_u), mr, mr_to_adv, model_clock, & - outer, cheap_update, self%adv_inc_prev, self%wind_prev, & - self%state_after_slow(igh_d), self%total_dry_flux, & + outer, stepper_siqn, cheap_update, & + self%adv_inc_prev, self%wind_prev, & + self%state_after_slow(igh_d), self%state_after_slow(igh_d), & + self%total_dry_flux, & adv_tracer_all_outer, adv_tracer_all_outer_after_slow, & adv_tracer_last_outer, adv_tracer_last_outer_after_slow, & con_tracer_all_outer, con_tracer_all_outer_after_slow, & @@ -970,7 +981,8 @@ contains call rhs_alg( self%rhs_np1, -varalpha*cast_dt, & self%state, self%state, moist_dyn, & compute_eos=.true., compute_rhs_t_d=.true., & - dlayer_rhs=dlayer_on, model_clock=model_clock ) + dlayer_rhs=dlayer_on, stepper=stepper_siqn, & + model_clock=model_clock ) else if (self%use_moisture) call copy_bundle(self%mr_after_slow, mr, nummr) end if @@ -1046,7 +1058,7 @@ contains !============================================================================ ! Start the Inner (nonlinear, coriolis) loop !============================================================================ - inner_dynamics_loop: do inner = 1,inner_iterations + inner_dynamics_loop: do inner = 1, inner_iterations_si(outer) write( log_scratch_space, '(A,2I3)' ) 'loop indices (o, i): ', & outer, inner call log_event( log_scratch_space, LOG_LEVEL_INFO ) @@ -1058,7 +1070,8 @@ contains call rhs_alg( self%rhs_np1, -varalpha*cast_dt, & self%state, self%state, moist_dyn, & compute_eos=.true., compute_rhs_t_d=.false., & - dlayer_rhs=dlayer_on, model_clock=model_clock ) + dlayer_rhs=dlayer_on, stepper=stepper_siqn, & + model_clock=model_clock ) end if !-------------------------------------------------------------------- ! Compute the LAM LBCs and RHS @@ -1066,7 +1079,7 @@ contains if ( limited_area .and. inner == 1 .and. outer == 1 ) then call lam_solver_lbc(self%state(igh_u), lbc_fields, prime_mesh_name) call calc_rhs_lbc(self%rhs_lbc, lbc_fields, model_clock, prime_mesh_name, & - tau_r) + tau_r, stepper_siqn) end if !-------------------------------------------------------------------- @@ -1095,10 +1108,12 @@ contains end if - write_moisture_diag = write_conservation_diag .and. & - outer == outer_iterations .and. & - inner == inner_iterations .and. & - self%use_moisture + write_moisture_diag = ( & + write_conservation_diag .and. & + outer == outer_iterations .and. & + inner == inner_iterations_si(outer_iterations) .and. & + self%use_moisture & + ) if (write_moisture_diag) then ! Calculate transported density call self%state(igh_d)%copy_field_properties(rho_star) @@ -1114,12 +1129,8 @@ contains dry_flux_solver, & moist_dyn(gas_law), & mr, & - first_iteration=(inner==1) ) - - if (write_moisture_diag) then - call moisture_conservation_alg(self%config, self%state(igh_d), mr, & - 'After solve') - end if + first_iteration=(inner==1), & + stepper=stepper_siqn ) ! If not already done update factors for moist dynamics if ( .not. guess_np1 .and. self%use_moisture ) & @@ -1134,13 +1145,13 @@ contains ! LAM Overwrite and Blend LBCs !-------------------------------------------------------------------- if ( limited_area ) then - if ( ( blend_frequency == blend_frequency_inner) & - .or. & - ( blend_frequency == blend_frequency_outer & - .and. inner == inner_iterations ) & - .or. & - ( blend_frequency == blend_frequency_final & - .and. inner == inner_iterations & + if ( ( blend_frequency == blend_frequency_inner) & + .or. & + ( blend_frequency == blend_frequency_outer & + .and. inner == inner_iterations_si(outer) ) & + .or. & + ( blend_frequency == blend_frequency_final & + .and. inner == inner_iterations_si(outer_iterations) & .and. outer == outer_iterations ) ) then call lam_blend_lbc(self%state(igh_u), self%state(igh_p), & @@ -1170,6 +1181,11 @@ contains ) end if + if (write_moisture_diag) then + call moisture_conservation_alg(self%config, self%state(igh_d), mr, & + 'After solve') + end if + else ! when use_wavedynamics=false, just add physics increments here call invoke(X_plus_Y(self%state(igh_t), self%state_after_slow(igh_t), self%dtheta), & @@ -1327,138 +1343,4 @@ contains return end subroutine semi_implicit_alg_final - !============================================================================! - !> @brief Make a deep copy of a subset of a field collection, based on a - !> list of fields provided by another collection - !> @param[out] generic_fields_copied New collection written with fields - !> saved at some point in time - !> @param[in] generic_fields_to_copy collection we want to save fields from - !> @param[in] field_list list of fields to be saved - subroutine conditional_collection_copy(generic_fields_copied, & - generic_fields_to_copy, & - field_list) - - use field_collection_mod, only: field_collection_type - use field_collection_iterator_mod, only: field_collection_iterator_type - - implicit none - - type(field_collection_type), intent(out) :: generic_fields_copied - type(field_collection_type), intent(in) :: generic_fields_to_copy - type(field_collection_type), intent(in) :: field_list - - ! Iterator for field collection - type(field_collection_iterator_type) :: iterator - - ! One of the single fields out of the generic_fields_to_copy collection - class( field_parent_type ), pointer :: abstract_field_ptr - type(field_type), pointer :: single_generic_field - - ! The saved version of single_generic_field - type(field_type) :: copied_generic_field - - logical(kind=l_def) :: l_copy - - nullify(abstract_field_ptr) - nullify(single_generic_field) - - call generic_fields_copied%initialise(name='fields_copied') - - if ( generic_fields_to_copy%get_length() > 0 ) then - - call iterator%initialise(generic_fields_to_copy) - - do - if ( .not.iterator%has_next() ) exit - - abstract_field_ptr => iterator%next() - select type(abstract_field_ptr) - type is (field_type) - single_generic_field => abstract_field_ptr - end select - - l_copy = field_list%field_exists(single_generic_field%get_name()) - - if ( l_copy ) then - - ! We copy the field we want to save into a new field - call single_generic_field%copy_field_properties(copied_generic_field) - call invoke( setval_X(copied_generic_field, single_generic_field) ) - - ! We add it to the field collection passed in - call generic_fields_copied%add_field(copied_generic_field) - - end if ! ( l_copy ) - - end do - - end if - - end subroutine conditional_collection_copy - - !> Get some stochastic physics variables out of modeldb - !> @param[in] modeldb Holds the model state - !> @param[in] array_names List of names that reference values - !> @param[out] spectral_coeffc Spectral coefficients - !> @param[out] spectral_coeffs Spectral coefficients - !> @param[out] power_law Power law - - subroutine get_stph_values(modeldb, array_names, spectral_coeffc, & - spectral_coeffs, power_law) - - type(modeldb_type), intent(in) :: modeldb - character(*), intent(in) :: array_names(:) - - real(r_def), allocatable, intent(out) :: spectral_coeffc(:) - real(r_def), allocatable, intent(out) :: spectral_coeffs(:) - real(r_def), allocatable, intent(out) :: power_law(:) - - type(io_value_type), pointer :: stph_io_value_type - - allocate(spectral_coeffc(stph_spectral_dim)) - allocate(spectral_coeffs(stph_spectral_dim)) - allocate(power_law(stph_spectral_dim)) - - stph_io_value_type => get_io_value(modeldb%values, array_names(1)) - spectral_coeffc = stph_io_value_type%data - stph_io_value_type => get_io_value(modeldb%values, array_names(2)) - spectral_coeffs = stph_io_value_type%data - stph_io_value_type => get_io_value(modeldb%values, array_names(3)) - power_law = stph_io_value_type%data - end subroutine get_stph_values - - !> Put some stochastic physics values into modeldb and deallocate - !> holding variables - !> @param[in] modeldb Holds the model state - !> @param[in] array_names List of names that reference values - !> @param[in,out] spectral_coeffc Spectral coefficients - !> @param[in,out] spectral_coeffs Spectral coefficients - !> @param[in,out] power_law Power law - - subroutine put_stph_values(modeldb, array_names, spectral_coeffc, & - spectral_coeffs, power_law) - - type(modeldb_type), intent(in) :: modeldb - character(*), intent(in) :: array_names(:) - - real(r_def), allocatable, intent(inout) :: spectral_coeffc(:) - real(r_def), allocatable, intent(inout) :: spectral_coeffs(:) - real(r_def), allocatable, intent(inout) :: power_law(:) - - type(io_value_type), pointer :: stph_io_value_type - - stph_io_value_type => get_io_value(modeldb%values, array_names(1)) - stph_io_value_type%data = spectral_coeffc - stph_io_value_type => get_io_value(modeldb%values, array_names(2)) - stph_io_value_type%data = spectral_coeffs - stph_io_value_type => get_io_value(modeldb%values, array_names(3)) - stph_io_value_type%data = power_law - - deallocate(spectral_coeffc) - deallocate(spectral_coeffs) - deallocate(power_law) - - end subroutine put_stph_values - - end module semi_implicit_timestep_alg_mod diff --git a/science/gungho/source/algorithm/timestepping/timestepping_common_mod.x90 b/science/gungho/source/algorithm/timestepping/timestepping_common_mod.x90 new file mode 100644 index 0000000000..31ee2d70aa --- /dev/null +++ b/science/gungho/source/algorithm/timestepping/timestepping_common_mod.x90 @@ -0,0 +1,154 @@ +!------------------------------------------------------------------------------- +! (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. +!------------------------------------------------------------------------------- + +module timestepping_common_mod + + use constants_mod, only: l_def, r_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 io_value_mod, only: io_value_type, get_io_value + + implicit none + private + + public :: conditional_collection_copy + public :: get_stph_values + public :: put_stph_values + +contains + + !> @brief Make a deep copy of a subset of a field collection, based on a + !! list of fields provided by another collection + !> @param[out] generic_fields_copied New collection written with fields + !! saved at some point in time + !> @param[in] generic_fields_to_copy collection we want to save fields from + !> @param[in] field_list list of fields to be saved + subroutine conditional_collection_copy(generic_fields_copied, & + generic_fields_to_copy, & + field_list) + + + implicit none + + type(field_collection_type), intent(out) :: generic_fields_copied + type(field_collection_type), intent(in) :: generic_fields_to_copy + type(field_collection_type), intent(in) :: field_list + + ! Iterator for field collection + type(field_collection_iterator_type) :: iterator + + ! One of the single fields out of the generic_fields_to_copy collection + class(field_parent_type), pointer :: abstract_field_ptr + type(field_type), pointer :: single_generic_field + + ! The saved version of single_generic_field + type(field_type) :: copied_generic_field + + logical(kind=l_def) :: l_copy + + nullify(abstract_field_ptr) + nullify(single_generic_field) + + call generic_fields_copied%initialise(name='fields_copied') + + if ( generic_fields_to_copy%get_length() > 0 ) then + + call iterator%initialise(generic_fields_to_copy) + + do + if ( .not.iterator%has_next() ) exit + + abstract_field_ptr => iterator%next() + select type(abstract_field_ptr) + type is (field_type) + single_generic_field => abstract_field_ptr + end select + + l_copy = field_list%field_exists(single_generic_field%get_name()) + + if ( l_copy ) then + + ! We copy the field we want to save into a new field + call single_generic_field%copy_field_properties(copied_generic_field) + call invoke( setval_X(copied_generic_field, single_generic_field) ) + + ! We add it to the field collection passed in + call generic_fields_copied%add_field(copied_generic_field) + + end if ! ( l_copy ) + + end do + + end if + + end subroutine conditional_collection_copy + + !> Get some stochastic physics variables out of modeldb + !> @param[in] modeldb Holds the model state + !> @param[in] array_names List of names that reference values + !> @param[out] spectral_coeffc Spectral coefficients + !> @param[out] spectral_coeffs Spectral coefficients + !> @param[out] power_law Power law + subroutine get_stph_values(modeldb, array_names, stph_spectral_dim, & + spectral_coeffc, spectral_coeffs, power_law) + + type(modeldb_type), intent(in) :: modeldb + character(*), intent(in) :: array_names(:) + integer(i_def), intent(in) :: stph_spectral_dim + real(r_def), allocatable, intent(out) :: spectral_coeffc(:) + real(r_def), allocatable, intent(out) :: spectral_coeffs(:) + real(r_def), allocatable, intent(out) :: power_law(:) + + type(io_value_type), pointer :: stph_io_value_type + + allocate(spectral_coeffc(stph_spectral_dim)) + allocate(spectral_coeffs(stph_spectral_dim)) + allocate(power_law(stph_spectral_dim)) + + stph_io_value_type => get_io_value(modeldb%values, array_names(1)) + spectral_coeffc = stph_io_value_type%data + stph_io_value_type => get_io_value(modeldb%values, array_names(2)) + spectral_coeffs = stph_io_value_type%data + stph_io_value_type => get_io_value(modeldb%values, array_names(3)) + power_law = stph_io_value_type%data + end subroutine get_stph_values + + !> Put some stochastic physics values into modeldb and deallocate + !> holding variables + !> @param[in] modeldb Holds the model state + !> @param[in] array_names List of names that reference values + !> @param[in,out] spectral_coeffc Spectral coefficients + !> @param[in,out] spectral_coeffs Spectral coefficients + !> @param[in,out] power_law Power law + subroutine put_stph_values(modeldb, array_names, spectral_coeffc, & + spectral_coeffs, power_law) + + type(modeldb_type), intent(in) :: modeldb + character(*), intent(in) :: array_names(:) + + real(r_def), allocatable, intent(inout) :: spectral_coeffc(:) + real(r_def), allocatable, intent(inout) :: spectral_coeffs(:) + real(r_def), allocatable, intent(inout) :: power_law(:) + + type(io_value_type), pointer :: stph_io_value_type + + stph_io_value_type => get_io_value(modeldb%values, array_names(1)) + stph_io_value_type%data = spectral_coeffc + stph_io_value_type => get_io_value(modeldb%values, array_names(2)) + stph_io_value_type%data = spectral_coeffs + stph_io_value_type => get_io_value(modeldb%values, array_names(3)) + stph_io_value_type%data = power_law + + deallocate(spectral_coeffc) + deallocate(spectral_coeffs) + deallocate(power_law) + + end subroutine put_stph_values + +end module timestepping_common_mod \ No newline at end of file diff --git a/science/gungho/source/algorithm/timestepping/tr_bdf2_timestep_alg_mod.X90 b/science/gungho/source/algorithm/timestepping/tr_bdf2_timestep_alg_mod.X90 new file mode 100644 index 0000000000..22f783d691 --- /dev/null +++ b/science/gungho/source/algorithm/timestepping/tr_bdf2_timestep_alg_mod.X90 @@ -0,0 +1,1641 @@ +!------------------------------------------------------------------------------- +! (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 A three time-level iterative timestepper for the 3D nonlinear +!! compressible Euler equations, using a Quasi-Newton method with a +!! Trapezoidal Backward-Difference (TR-BDF2) time discretisation. +module tr_bdf2_timestep_alg_mod + + ! Infrastructure + use config_mod, only: config_type + use constants_mod, only: i_def, r_def, l_def, str_def, r_tran + use driver_modeldb_mod, only: modeldb_type + use extrusion_mod, only: TWOD + use field_mod, only: field_type + use field_array_mod, only: field_array_type + use field_collection_mod, only: field_collection_type + use fs_continuity_mod, only: Wtheta, W2 + use io_value_mod, only: io_value_type, & + get_io_value + + use log_mod, only: log_event, log_scratch_space, & + LOG_LEVEL_INFO + use mesh_mod, only: mesh_type + use mesh_collection_mod, only: mesh_collection + use model_clock_mod, only: model_clock_type + use operator_mod, only: operator_type + use r_tran_field_mod, only: r_tran_field_type + use timing_mod, only: start_timing, stop_timing, tik, LPROF + + ! Field bundle built-ins + use derived_config_mod, only: bundle_size + use sci_field_bundle_builtins_mod, & + only: clone_bundle, & + bundle_axpy, & + bundle_axpby, & + add_bundle, & + copy_bundle, & + set_bundle_scalar + + ! Apps routines + use cld_incs_mod, only: cld_incs_init, cld_incs_output + use field_indices_mod, only: igh_u, igh_t, igh_d, igh_p + use moist_dyn_mod, only: num_moist_factors, gas_law + use mr_indices_mod, only: nummr, imr_v, imr_cl, imr_ci, & + imr_s, imr_r, imr_g + use si_diagnostics_mod, only: output_diags_for_si + use timestepping_common_mod, only: conditional_collection_copy, & + get_stph_values, put_stph_values + use timestep_method_mod, only: timestep_method_type + + ! Algorithms + use sci_mass_matrix_solver_alg_mod, & + only: mass_matrix_solver_alg + use ageofair_alg_mod, only: ageofair_update + use calc_phys_predictors_alg_mod, & + only: calc_phys_predictors_alg + use derive_exner_from_eos_alg_mod, & + only: derive_exner_from_eos + use fast_physics_alg_mod, only: fast_physics + use gungho_transport_control_alg_mod, & + only: gungho_transport_control_alg_init, & + gungho_transport_control_alg + use lam_rhs_alg_mod, only: calc_rhs_lbc, & + apply_mask_rhs + + use limited_area_lbc_alg_mod, only: lam_solver_lbc, & + lam_blend_lbc + use map_physics_fields_alg_mod, only: map_physics_fields_alg + use mixing_alg_mod, only: mixing_alg + use moist_dyn_factors_alg_mod, only: moist_dyn_factors_alg + use moisture_conservation_alg_mod, & + only: moisture_conservation_alg + use rhs_alg_mod, only: rhs_alg + use predictors_alg_mod, only: predictors_alg + use semi_implicit_solver_alg_mod, & + only: semi_implicit_solver_alg_init, & + semi_implicit_solver_alg_step, & + semi_implicit_solver_alg_final + use si_operators_alg_mod, only: create_si_operators, & + compute_si_operators_common, & + compute_helmholtz_operators, & + final_si_operators + use slow_physics_alg_mod, only: slow_physics + use smagorinsky_alg_mod, only: smagorinsky_alg + use solver_moist_correction_alg_mod, & + only: solver_moist_correction_alg + use update_prognostic_scalars_alg_mod, & + only: update_prognostic_scalars_alg +#ifdef UM_PHYSICS + use cld_alg_mod, only: cld_alg + use aerosol_ukca_alg_mod, only: aerosol_ukca_alg + use casim_activate_alg_mod, only: casim_activate_alg + use lsp_precfrac_checks_kernel_mod, & + only: lsp_precfrac_checks_kernel_type + use stph_main_alg_mod, only: spt_array_names, & + spt_array_count, & + skeb_array_names, & + skeb_array_count +#endif + + ! Kernels + use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type + use dg_matrix_vector_kernel_mod, & + only: dg_matrix_vector_kernel_type + use dg_inc_matrix_vector_kernel_mod, & + only: dg_inc_matrix_vector_kernel_type + use matrix_vector_kernel_mod, only: matrix_vector_kernel_type + + ! Pointers + use sci_fem_constants_mod, only: get_mass_matrix_fe, & + get_mass_matrix_fv + use dycore_constants_mod, only: stepper_tr, stepper_bdf2, & + gamma, gamma2, gamma3 + + ! Configuration options + use aerosol_config_mod, only: glomap_mode_dust_and_clim, & + glomap_mode_ukca + use boundaries_config_mod, only: blend_frequency_inner, & + blend_frequency_outer, & + blend_frequency_final + use formulation_config_mod, only: moisture_formulation_dry + use initialization_config_mod, only: init_option_checkpoint_dump, & + lbc_option_um2lfric_file + use physics_config_mod, only: smagorinsky_placement_outer + use section_choice_config_mod, only: cloud_um, aerosol_um, cloud_none, & + aerosol_none + use stochastic_physics_config_mod, & + only: stochastic_physics_is_loaded + + implicit none + + private + + ! State object for the semi-implicit time-stepping method + type, extends(timestep_method_type), public :: tr_bdf2_timestep_type + private + + type(config_type), pointer :: config + logical(kind=l_def) :: use_moisture + logical(kind=l_def) :: output_cld_incs + type(r_tran_field_type) :: total_dry_flux ! dry density flux stored + ! stored over whole step + type(field_type) :: dtheta, dtheta_cld ! increment to theta + type(field_type) :: du ! increment to u + type(field_type) :: wind_prev ! u from prev iteration + ! used for cheap transport update + + type(field_type), allocatable :: state(:) ! Latest estimate of time n+1 + type(field_type), allocatable :: state_n(:) ! Fields at time n + type(field_type), allocatable :: state_m(:) ! Latest estimate of midpoint + type(field_type), allocatable :: state_q(:) ! Used to calculate state_bdf + type(field_type), allocatable :: state_bdf(:) ! Initial state for BDF2 step + type(field_type), allocatable :: state_dag(:) ! State after slow physics + type(field_type), allocatable :: state_to_adv(:) ! State to transport (both steps) + type(field_type), allocatable :: state_aft_adv(:) ! State after transport (both steps) + type(field_type), allocatable :: mr_n(:) ! Mixing ratios at time n + type(field_type), allocatable :: mr_aft_adv(:) ! Mixing ratios after transport (both) + type(field_type), allocatable :: mr_dag(:) ! Mixing ratios after slow physics + type(field_type), allocatable :: mr_bdf(:) ! Mixing ratios after BDF2 step + type(field_type), allocatable :: rhs_n(:) ! Explicit RHS (TR) + type(field_type), allocatable :: rhs_np1(:) ! Implicit RHS (BDF2) + type(field_type), allocatable :: rhs_adv(:) ! Transport RHS (both) + type(field_type), allocatable :: rhs_bdf(:) ! Explicit RHS (BDF2) + type(field_type), allocatable :: rhs_m(:) ! Implicit RHS (TR) + type(field_type), allocatable :: adv_inc_prev(:) ! Transport increment from + ! prev iteration (for cheap update) + type(field_type), allocatable :: rhs_phys(:) ! Physics RHS (both steps) + type(field_type), allocatable :: rhs_lbc(:) ! LBC RHS (both steps) + + contains + private + + procedure, public :: step => tr_bdf2_alg_step + procedure, public :: finalise => tr_bdf2_alg_final + procedure, nopass :: run_init + procedure, nopass :: run_step + + end type tr_bdf2_timestep_type + + ! Constructor for type + interface tr_bdf2_timestep_type + module procedure tr_bdf2_alg_init + end interface tr_bdf2_timestep_type + +contains + + !> Extracts data from modeldb to prepare for initialising object + !> @param[in] modeldb Holds the model state + function tr_bdf2_alg_init(modeldb) result(self) + implicit none + + type(modeldb_type), target, intent(in) :: modeldb + + type(tr_bdf2_timestep_type) :: self + type(field_collection_type), pointer :: prognostic_fields + type(field_collection_type), pointer :: moisture_fields + type(field_type), pointer :: u + type(field_type), pointer :: rho + type(field_type), pointer :: theta + type(field_type), pointer :: exner + type(field_array_type), pointer :: mr_array + type(field_type), pointer :: mr(:) + class(model_clock_type), pointer :: model_clock + + ! Get pointer to clock to use downstream + model_clock => modeldb%clock + + ! Get pointers to field collections for use downstream + prognostic_fields => modeldb%fields%get_field_collection("prognostic_fields") + + ! Get pointers to fields in the prognostic/diagnostic field collections + ! for use downstream + call prognostic_fields%get_field('theta', theta) + call prognostic_fields%get_field('u', u) + call prognostic_fields%get_field('rho', rho) + call prognostic_fields%get_field('exner', exner) + + moisture_fields => modeldb%fields%get_field_collection("moisture_fields") + call moisture_fields%get_field("mr", mr_array) + mr => mr_array%bundle + + ! Run the initialisation process + call run_init( & + self, modeldb%config, u, rho, theta, exner, mr, & + prognostic_fields, moisture_fields, model_clock & + ) + + end function tr_bdf2_alg_init + + !> Extracts data from input objects to prepare for running timestep + !> @param[in] modeldb The gungho model data object + subroutine tr_bdf2_alg_step(self, modeldb) + + implicit none + + class(tr_bdf2_timestep_type), intent(inout) :: self + type(modeldb_type), target, intent(in) :: modeldb + + type(mesh_type), pointer :: mesh + type(mesh_type), pointer :: twod_mesh + + class(model_clock_type), pointer :: model_clock + type(io_value_type), pointer :: temp_corr_io_value + + type(field_collection_type), pointer :: prognostic_fields + type(field_collection_type), pointer :: moisture_fields + type(field_type), pointer :: u + type(field_type), pointer :: rho + type(field_type), pointer :: theta + type(field_type), pointer :: exner + type(field_array_type), pointer :: mr_array + type(field_type), pointer :: mr(:) + type(field_array_type), pointer :: moist_dyn_array + type(field_type), pointer :: moist_dyn(:) + + type(field_collection_type), pointer :: adv_tracer_all_outer + type(field_collection_type), pointer :: adv_tracer_last_outer + type(field_collection_type), pointer :: con_tracer_all_outer + type(field_collection_type), pointer :: con_tracer_last_outer + type(field_collection_type), pointer :: derived_fields + type(field_collection_type), pointer :: radiation_fields + type(field_collection_type), pointer :: microphysics_fields + type(field_collection_type), pointer :: electric_fields + type(field_collection_type), pointer :: orography_fields + type(field_collection_type), pointer :: turbulence_fields + type(field_collection_type), pointer :: convection_fields + type(field_collection_type), pointer :: cloud_fields + type(field_collection_type), pointer :: surface_fields + type(field_collection_type), pointer :: soil_fields + type(field_collection_type), pointer :: snow_fields + type(field_collection_type), pointer :: chemistry_fields + type(field_collection_type), pointer :: aerosol_fields + type(field_collection_type), pointer :: stph_fields + type(field_collection_type), pointer :: lbc_fields + + ! Arrays for passing modeldb data to stochastic physics scheme + real(kind=r_def), allocatable :: spt_spectral_coeffc(:) + real(kind=r_def), allocatable :: spt_spectral_coeffs(:) + real(kind=r_def), allocatable :: spt_power_law(:) + real(kind=r_def), allocatable :: skeb_spectral_coeffc(:) + real(kind=r_def), allocatable :: skeb_spectral_coeffs(:) + real(kind=r_def), allocatable :: skeb_power_law(:) + + real(kind=r_def) :: dt + real(kind=r_def) :: dtemp_encorr +#ifdef UM_PHYSICS + integer(kind=i_def) :: stph_spectral_dim + logical(kind=l_def) :: use_spt + logical(kind=l_def) :: use_skeb +#endif + + ! Get pointers to field collections for use downstream + prognostic_fields => modeldb%fields%get_field_collection("prognostic_fields") + model_clock => modeldb%clock + + ! Get pointers to fields for use downstream + call prognostic_fields%get_field('theta', theta) + call prognostic_fields%get_field('u', u) + call prognostic_fields%get_field('rho', rho) + call prognostic_fields%get_field('exner', exner) + + ! Get timestep parameters from clock + dt = real(model_clock%get_seconds_per_step(), r_def) + + moisture_fields => modeldb%fields%get_field_collection("moisture_fields") + lbc_fields => modeldb%fields%get_field_collection("lbc_fields") + radiation_fields => modeldb%fields%get_field_collection("radiation_fields") + call moisture_fields%get_field("mr", mr_array) + mr => mr_array%bundle + call moisture_fields%get_field("moist_dyn", moist_dyn_array) + moist_dyn => moist_dyn_array%bundle + + ! Get the mesh from one of the fields + mesh => theta%get_mesh() + twod_mesh => mesh_collection%get_mesh(mesh, TWOD) + + adv_tracer_all_outer => modeldb%fields%get_field_collection("adv_tracer_all_outer") + adv_tracer_last_outer => modeldb%fields%get_field_collection("adv_tracer_last_outer") + con_tracer_all_outer => modeldb%fields%get_field_collection("con_tracer_all_outer") + con_tracer_last_outer => modeldb%fields%get_field_collection("con_tracer_last_outer") + derived_fields => modeldb%fields%get_field_collection("derived_fields") + microphysics_fields => modeldb%fields%get_field_collection("microphysics_fields") + turbulence_fields => modeldb%fields%get_field_collection("turbulence_fields") + convection_fields => modeldb%fields%get_field_collection("convection_fields") + cloud_fields => modeldb%fields%get_field_collection("cloud_fields") + surface_fields => modeldb%fields%get_field_collection("surface_fields") + soil_fields => modeldb%fields%get_field_collection("soil_fields") + snow_fields => modeldb%fields%get_field_collection("snow_fields") + chemistry_fields => modeldb%fields%get_field_collection("chemistry_fields") + aerosol_fields => modeldb%fields%get_field_collection("aerosol_fields") + stph_fields => modeldb%fields%get_field_collection("stph_fields") + electric_fields => modeldb%fields%get_field_collection("electric_fields") + orography_fields => modeldb%fields%get_field_collection("orography_fields") + + temp_corr_io_value => get_io_value( modeldb%values, 'temperature_correction_io_value') + ! Get temperature increment for energy correction + dtemp_encorr = dt * temp_corr_io_value%data(1) + +#ifdef UM_PHYSICS + if (stochastic_physics_is_loaded()) then + use_spt = self%config%stochastic_physics%use_spt() + use_skeb = self%config%stochastic_physics%use_skeb() + else + use_spt = .false. + use_skeb = .false. + end if + + if (use_spt) then + ! Get spectral coefficients and power law from the model database + stph_spectral_dim = self%config%stochastic_physics%stph_spectral_dim() + call get_stph_values( & + modeldb, spt_array_names, stph_spectral_dim, & + spt_spectral_coeffc, spt_spectral_coeffs, spt_power_law & + ) + end if + if (use_skeb) then + ! Get spectral coefficients and power law from the model database + call get_stph_values( & + modeldb, skeb_array_names, stph_spectral_dim, & + skeb_spectral_coeffc, skeb_spectral_coeffs, skeb_power_law & + ) + end if +#endif + + ! Run the timestep + call run_step( & + self, modeldb, u, rho, theta, exner, mr, moist_dyn, & + adv_tracer_all_outer, adv_tracer_last_outer, & + con_tracer_all_outer, con_tracer_last_outer, & + prognostic_fields, moisture_fields, & + derived_fields, radiation_fields, microphysics_fields, & + electric_fields, orography_fields, turbulence_fields, & + convection_fields, cloud_fields, surface_fields, soil_fields, & + snow_fields, chemistry_fields, aerosol_fields, stph_fields, & + lbc_fields, & + model_clock, dtemp_encorr, & + spt_spectral_coeffc, spt_spectral_coeffs, spt_power_law, & + skeb_spectral_coeffc, skeb_spectral_coeffs, skeb_power_law, & + mesh, twod_mesh & + ) + +#ifdef UM_PHYSICS + if (use_spt) then + ! Put spectral coefficients and power law back into model database + call put_stph_values( & + modeldb, spt_array_names, spt_spectral_coeffc, & + spt_spectral_coeffs, spt_power_law & + ) + end if + + if (use_skeb) then + ! Put spectral coefficients and power law back into model database + call put_stph_values( & + modeldb, skeb_array_names, skeb_spectral_coeffc, & + skeb_spectral_coeffs, skeb_power_law & + ) + end if +#endif + + end subroutine tr_bdf2_alg_step + + !> @details Initialisation procedure for the timestepping algorithm + !> Initialises various internal fields + !> @param[in] config Application namelist configuration object + !> @param[in,out] u 3D wind field + !> @param[in,out] rho Density + !> @param[in,out] theta Potential temperature + !> @param[in,out] exner Exner pressure + !> @param[in,out] mr Mixing ratios + !> @param[in,out] prognostic_fields Prognostic field collection + !> @param[in,out] moisture_fields Moisture field collection + !> @param[in] model_clock Time in the model. + subroutine run_init( & + self, config, u, rho, theta, exner, mr, & + prognostic_fields, moisture_fields, model_clock & + ) + + implicit none + + type(tr_bdf2_timestep_type), intent(inout) :: self + type(config_type), target, intent(in) :: config + type(field_type), intent(in) :: u, rho, theta, exner + type(field_type), optional, intent(in) :: mr(:) + type(field_collection_type ), intent(inout) :: prognostic_fields + type(field_collection_type ), intent(inout) :: moisture_fields + class(model_clock_type), intent(in) :: model_clock + + ! Mesh + type(mesh_type), pointer :: mesh + ! Reference fields + type(field_type), pointer :: rho_ref, theta_ref, exner_ref + ! Reference moist dynamics factors + type(field_array_type), pointer :: moist_dyn_ref_array + type(field_type), pointer :: moist_dyn_ref(:) + + ! Timestep + real(kind=r_def) :: dt + + ! Reset frequency of semi-implicit operators + integer(kind=i_def) :: reference_reset_freq + + ! Configuration options retrieved from the config object + logical(kind=l_def) :: use_wavedynamics + integer(kind=i_def) :: moisture_formulation + logical(kind=l_def) :: write_diag + logical(kind=l_def) :: use_xios_io + real(kind=r_def) :: reference_reset_time + + self%config => config + + use_wavedynamics = config%formulation%use_wavedynamics() + moisture_formulation = config%formulation%moisture_formulation() + write_diag = config%io%write_diag() + use_xios_io = config%io%use_xios_io() + reference_reset_time = config%mixed_solver%reference_reset_time() + + ! Get the mesh from one of the fields + mesh => theta%get_mesh() + + !------------------------------------------------------------------------- ! + ! Allocate internal state field arrays + !------------------------------------------------------------------------- ! + allocate(self%state(bundle_size)) + allocate(self%state_n(bundle_size)) + allocate(self%state_m(bundle_size)) + allocate(self%state_q(bundle_size)) + allocate(self%state_bdf(bundle_size)) + allocate(self%state_dag(bundle_size)) + allocate(self%state_to_adv(bundle_size)) + allocate(self%state_aft_adv(bundle_size)) + allocate(self%rhs_n(bundle_size)) + allocate(self%rhs_m(bundle_size)) + allocate(self%rhs_bdf(bundle_size)) + allocate(self%rhs_np1(bundle_size)) + allocate(self%rhs_adv(bundle_size)) + allocate(self%adv_inc_prev(bundle_size)) + allocate(self%rhs_phys(bundle_size)) + allocate(self%rhs_lbc(bundle_size)) + allocate(self%mr_n(nummr)) + allocate(self%mr_bdf(nummr)) + allocate(self%mr_dag(nummr)) + allocate(self%mr_aft_adv(nummr)) + + self%use_moisture = ( moisture_formulation /= moisture_formulation_dry ) + self%output_cld_incs = ( & + self%use_moisture .and. write_diag .and. use_xios_io & + ) + + !------------------------------------------------------------------------- ! + ! Initialise internal state field objects + !------------------------------------------------------------------------- ! + + call u%copy_field_properties(self%state(igh_u)) + call theta%copy_field_properties(self%state(igh_t)) + call rho%copy_field_properties(self%state(igh_d)) + call exner%copy_field_properties(self%state(igh_p)) + + call clone_bundle(self%state, self%state_n, bundle_size) + call clone_bundle(self%state, self%state_m, bundle_size) + call clone_bundle(self%state, self%state_q, bundle_size) + call clone_bundle(self%state, self%state_dag, bundle_size) + call clone_bundle(self%state, self%state_bdf, bundle_size) + call clone_bundle(self%state, self%state_to_adv, bundle_size) + call clone_bundle(self%state, self%state_aft_adv, bundle_size) + call clone_bundle(self%state, self%rhs_n, bundle_size) + call clone_bundle(self%state, self%rhs_m, bundle_size) + call clone_bundle(self%state, self%rhs_bdf, bundle_size) + call clone_bundle(self%state, self%rhs_np1, bundle_size) + call clone_bundle(self%state, self%rhs_adv, bundle_size) + call clone_bundle(self%state, self%rhs_phys, bundle_size) + call clone_bundle(self%state, self%rhs_lbc, bundle_size) + call clone_bundle(self%state, self%adv_inc_prev, bundle_size) + + call theta%copy_field_properties(self%dtheta) + call theta%copy_field_properties(self%dtheta_cld) + call invoke(setval_c(self%dtheta_cld, 0.0_r_def)) + call u%copy_field_properties(self%du) + call u%copy_field_properties(self%wind_prev) + + call self%total_dry_flux%initialise(u%get_function_space()) + + call clone_bundle(mr, self%mr_n, nummr) + call clone_bundle(mr, self%mr_dag, nummr) + call clone_bundle(mr, self%mr_bdf, nummr) + if (self%use_moisture) then + call clone_bundle(mr, self%mr_aft_adv, nummr) + else + call set_bundle_scalar(0.0_r_def, self%mr_n, nummr) + call set_bundle_scalar(0.0_r_def, self%mr_dag, nummr) + call set_bundle_scalar(0.0_r_def, self%mr_bdf, nummr) + end if + + ! ------------------------------------------------------------------------ ! + ! Initialise the physics increments to 0 + ! ------------------------------------------------------------------------ ! + call set_bundle_scalar(0.0_r_def, self%rhs_phys, bundle_size) + + ! ------------------------------------------------------------------------ ! + ! Operators for si solves + ! ------------------------------------------------------------------------ ! + call create_si_operators(mesh, stepper_tr, self%config, model_clock) + call create_si_operators(mesh, stepper_bdf2, self%config, model_clock) + + ! If using checkpointed reference state, then calculate semi-implicit + ! operators using the checkpointed reference state + dt = real(model_clock%get_seconds_per_step(), r_def) + reference_reset_freq = nint(reference_reset_time / dt, i_def) + if (mod(model_clock%get_first_step()-1, reference_reset_freq) /= 0) then + call moisture_fields%get_field("moist_dyn_ref", moist_dyn_ref_array) + moist_dyn_ref => moist_dyn_ref_array%bundle + call prognostic_fields%get_field('theta_ref', theta_ref) + call prognostic_fields%get_field('rho_ref', rho_ref) + call prognostic_fields%get_field('exner_ref', exner_ref) + + call compute_si_operators_common( & + self%config, theta_ref, rho_ref, exner_ref, moist_dyn_ref & + ) + call compute_helmholtz_operators(model_clock, stepper_tr) + call compute_helmholtz_operators(model_clock, stepper_bdf2) + end if + + if (use_wavedynamics) then + call gungho_transport_control_alg_init(mesh) + + ! Construct semi-implicit solver + call semi_implicit_solver_alg_init(self%state, stepper_tr) + call semi_implicit_solver_alg_init(self%state, stepper_bdf2) + end if + + call log_event( & + "tr_bdf2_timestep: initialised timestepping algorithm", LOG_LEVEL_INFO & + ) + + end subroutine run_init + + !> @details The control algorithm for the TR-BDF2 timestepper. This is a three + !! time-level scheme that consists of two phases: the Trapezoidal + !! (TR) step and the Backward-Difference (BDF2) step, each of which + !! involves an implicit method that is solved with a Quasi-Newton + !! method. + !> @param[in] modeldb Holds the model state + !> @param[in,out] u 3D wind field + !> @param[in,out] rho Density + !> @param[in,out] theta Potential temperature + !> @param[in,out] exner Exner pressure + !> @param[in,out] mr Mixing ratios + !> @param[in,out] moist_dyn Factors for moist dynamics + !> @param[in,out] adv_tracer_all_outer Group of fields to be advected + !> @param[in,out] adv_tracer_last_outer Group of fields to be advected + !> @param[in,out] con_tracer_all_outer Second group of fields to be advected + !> @param[in,out] con_tracer_last_outer Second group of fields to be advected + !> @param[in,out] prognostic_fields Prognostic field collection + !> @param[in,out] moisture_fields Moisture field collection + !> @param[in,out] derived_fields Group of derived fields + !> @param[in,out] radiation_fields Fields for radiation scheme + !> @param[in,out] microphysics_fields Fields for mphys scheme + !> @param[in,out] electric_fields Fields for electric (lighting) scheme + !> @param[in] orography_fields Fields for orog drag scheme + !> @param[in,out] turbulence_fields Fields for turbulence scheme + !> @param[in,out] convection_fields Fields for convection scheme + !> @param[in,out] cloud_fields Fields for cloud scheme + !> @param[in,out] surface_fields Fields for surface scheme + !> @param[in,out] soil_fields Fields for soil hydrology scheme + !> @param[in,out] snow_fields Fields for snow scheme + !> @param[in,out] chemistry_fields Fields for chemistry scheme + !> @param[in,out] aerosol_fields Fields for aerosol scheme + !> @param[in,out] stph_fields Fields for stohcastic physics schemes + !> @param[in,out] lbc_fields Fields for lateral boundaries + !> @param[in] model_clock Time in the model. + !> @param[in] dtemp_encorr Temperature increment for energy + !! correction + !> @param[in,out] spt_spectral_coeffc Real Spectral coefficients + !> @param[in,out] spt_spectral_coeffs Imaginary Spectral coefficients + !> @param[in,out] spt_power_law Spectral power law + !> @param[in,out] skeb_spectral_coeffc Real Spectral coefficients + !> @param[in,out] skeb_spectral_coeffs Imaginary Spectral coefficients + !> @param[in,out] skeb_power_law Spectral power law + !> @param[in] mesh The current mesh + !> @param[in] twod_mesh The current 2d mesh + subroutine run_step( & + self, modeldb, u, rho, theta, exner, mr, moist_dyn, & + adv_tracer_all_outer, adv_tracer_last_outer, & + con_tracer_all_outer, con_tracer_last_outer, & + prognostic_fields, moisture_fields, derived_fields, & + radiation_fields, microphysics_fields, electric_fields, & + orography_fields, turbulence_fields, convection_fields, & + cloud_fields, surface_fields, soil_fields, snow_fields, & + chemistry_fields, aerosol_fields, stph_fields, lbc_fields, & + model_clock, dtemp_encorr, & + spt_spectral_coeffc, spt_spectral_coeffs, spt_power_law, & + skeb_spectral_coeffc, skeb_spectral_coeffs, skeb_power_law, & + mesh, twod_mesh & + ) + + implicit none + + ! Arguments + type(tr_bdf2_timestep_type), target, intent(inout) :: self + type(modeldb_type), target, intent(in) :: modeldb + + type(field_type), intent(inout) :: u, rho, theta, exner + type(field_type), intent(inout) :: mr(nummr) + type(field_type), intent(inout) :: moist_dyn(num_moist_factors) + + type(field_collection_type), intent(inout) :: adv_tracer_all_outer + type(field_collection_type), intent(inout) :: adv_tracer_last_outer + type(field_collection_type), intent(inout) :: con_tracer_all_outer + type(field_collection_type), intent(inout) :: con_tracer_last_outer + type(field_collection_type), intent(inout) :: prognostic_fields + type(field_collection_type), intent(inout) :: moisture_fields + type(field_collection_type), intent(inout) :: derived_fields + type(field_collection_type), intent(inout) :: radiation_fields + type(field_collection_type), intent(inout) :: microphysics_fields + type(field_collection_type), intent(inout) :: electric_fields + type(field_collection_type), intent(in) :: orography_fields + type(field_collection_type), intent(inout) :: turbulence_fields + type(field_collection_type), intent(inout) :: convection_fields + type(field_collection_type), intent(inout) :: cloud_fields + type(field_collection_type), intent(inout) :: surface_fields + type(field_collection_type), intent(inout) :: soil_fields + type(field_collection_type), intent(inout) :: snow_fields + type(field_collection_type), intent(inout) :: chemistry_fields + type(field_collection_type), intent(inout) :: aerosol_fields + type(field_collection_type), intent(inout) :: stph_fields + type(field_collection_type), intent(inout) :: lbc_fields + + class(model_clock_type), intent(in) :: model_clock + real(kind=r_def), intent(in) :: dtemp_encorr + real(kind=r_def), intent(inout) :: spt_spectral_coeffc(:) + real(kind=r_def), intent(inout) :: spt_spectral_coeffs(:) + real(kind=r_def), intent(inout) :: spt_power_law(:) + real(kind=r_def), intent(inout) :: skeb_spectral_coeffc(:) + real(kind=r_def), intent(inout) :: skeb_spectral_coeffs(:) + real(kind=r_def), intent(inout) :: skeb_power_law(:) + type(mesh_type), pointer, intent(in) :: mesh + type(mesh_type), pointer, intent(in) :: twod_mesh + + ! Internal variables + ! Reference fields + type(field_type), pointer :: rho_ref + type(field_type), pointer :: theta_ref + type(field_type), pointer :: exner_ref + type(field_type), pointer :: moist_dyn_ref(:) + type(field_array_type), pointer :: moist_dyn_ref_array + + ! Moisture field to transport + type(field_type), pointer :: mr_to_adv(:) + type(field_type) :: dry_flux_solver + type(r_tran_field_type) :: dry_flux_solver_r_tran + type(field_type) :: rho_star + + type(field_type) :: dcfl_tot, dcff_tot, dbcf_tot + type(field_type) :: dcfl_adv, dcff_adv, dbcf_adv + character(str_def), parameter :: sec_tot='processed' + character(str_def), parameter :: suffix_tot='tot' + character(str_def), parameter :: sec_adv='advection' + character(str_def), parameter :: suffix_adv='adv' + + type(field_type), pointer :: ageofair + type(operator_type), pointer :: mm_wt + type(operator_type), pointer :: mm_vel + +#ifdef UM_PHYSICS + type(field_type), pointer :: precfrac + integer(kind=i_def) :: glomap_mode +#endif + + integer(kind=i_def) :: outer, inner, reference_reset_freq + logical(kind=l_def) :: write_moisture_diag, do_moist_correction + type(field_collection_type) :: adv_tracer_all_outer_dag + type(field_collection_type) :: adv_tracer_last_outer_dag + type(field_collection_type) :: con_tracer_all_outer_dag + type(field_collection_type) :: con_tracer_last_outer_dag + logical(kind=l_def) :: checkpoint_reference_fields + character(len=str_def) :: prime_mesh_name + integer(kind=i_def) :: lbc_option + logical(kind=l_def) :: microphysics_casim + logical(kind=l_def) :: l_mcr_precfrac + logical(kind=l_def) :: murk_lbc + logical(kind=l_def) :: outer_smagorinsky + logical(kind=l_def) :: to_blend_lbc + real(kind=r_def) :: dt + integer(kind=tik) :: id + + ! Configuration options retrieved from the config object + logical(kind=l_def) :: limited_area + integer(kind=i_def) :: blend_frequency + integer(kind=i_def) :: element_order_h + integer(kind=i_def) :: element_order_v + logical(kind=l_def) :: use_physics + logical(kind=l_def) :: dlayer_on + logical(kind=l_def) :: use_wavedynamics + integer(kind=i_def) :: moisture_formulation + logical(kind=l_def) :: exner_from_eos + logical(kind=l_def) :: solver_moisture_conservation + integer(kind=i_def) :: init_option + logical(kind=l_def) :: subroutine_timers + logical(kind=l_def) :: write_conservation_diag + logical(kind=l_def) :: write_diag + logical(kind=l_def) :: use_xios_io + integer(kind=i_def) :: diagnostic_frequency + logical(kind=l_def) :: checkpoint_read + logical(kind=l_def) :: smagorinsky + real(kind=r_def) :: reference_reset_time + integer(kind=i_def) :: smagorinsky_placement + integer(kind=i_def) :: cloud + integer(kind=i_def) :: aerosol + integer(kind=i_def) :: outer_iterations + integer(kind=i_def), allocatable :: inner_iterations_tr(:) + integer(kind=i_def), allocatable :: inner_iterations_bdf2(:) + logical(kind=l_def) :: cheap_update + logical(kind=l_def) :: transport_ageofair + + if (LPROF) call start_timing(id, 'tr_bdf2_timestep_alg') + + ! Get config variables + element_order_h = self%config%finite_element%element_order_h() + element_order_v = self%config%finite_element%element_order_v() + init_option = self%config%initialization%init_option() + subroutine_timers = self%config%io%subroutine_timers() + write_conservation_diag = self%config%io%write_conservation_diag() + write_diag = self%config%io%write_diag() + use_xios_io = self%config%io%use_xios_io() + diagnostic_frequency = self%config%io%diagnostic_frequency() + checkpoint_read = self%config%io%checkpoint_read() + use_physics = self%config%formulation%use_physics() + dlayer_on = self%config%formulation%dlayer_on() + use_wavedynamics = self%config%formulation%use_wavedynamics() + moisture_formulation = self%config%formulation%moisture_formulation() + exner_from_eos = self%config%formulation%exner_from_eos() + if (moisture_formulation /= moisture_formulation_dry) then + solver_moisture_conservation = & + self%config%formulation%solver_moisture_conservation() + else + solver_moisture_conservation = .false. + end if + smagorinsky = self%config%mixing%smagorinsky() + reference_reset_time = self%config%mixed_solver%reference_reset_time() + cheap_update = self%config%transport%cheap_update() + transport_ageofair = self%config%transport%transport_ageofair() + outer_iterations = self%config%timestepping%outer_iterations() + allocate(inner_iterations_tr(outer_iterations)) + allocate(inner_iterations_bdf2(outer_iterations)) + inner_iterations_tr(:) = self%config%timestepping%inner_iterations_tr() + inner_iterations_bdf2(:) = self%config%timestepping%inner_iterations_bdf2() + limited_area = self%config%boundaries%limited_area() + if (limited_area) then + blend_frequency = self%config%boundaries%blend_frequency() + end if + if (use_physics) then + smagorinsky_placement = self%config%physics%smagorinsky_placement() + cloud = self%config%section_choice%cloud() + aerosol = self%config%section_choice%aerosol() + else + smagorinsky_placement = smagorinsky_placement_outer + cloud = cloud_none + aerosol = aerosol_none + end if + lbc_option = 0 + dt = real(model_clock%get_seconds_per_step(), r_def) + + if (limited_area .and. use_wavedynamics) then + + prime_mesh_name = self%config%base_mesh%prime_mesh_name() + lbc_option = self%config%initialization%lbc_option() + + if (lbc_option == lbc_option_um2lfric_file) then + murk_lbc = self%config%aerosol%murk_lbc() + end if + end if + if (lbc_option == lbc_option_um2lfric_file & + .or. (use_physics .and. cloud == cloud_um)) then + microphysics_casim = self%config%microphysics%microphysics_casim() + l_mcr_precfrac = self%config%microphysics%l_mcr_precfrac() + end if + + if (element_order_h == 0 .and. element_order_v == 0) then + ! Lowest order so use finite volume constants + mm_wt => get_mass_matrix_fv(Wtheta, mesh%get_id()) + mm_vel => get_mass_matrix_fv(W2, mesh%get_id()) + else + mm_wt => get_mass_matrix_fe(Wtheta, mesh%get_id()) + mm_vel => get_mass_matrix_fe(W2, mesh%get_id()) + end if + + !--------------------------------------------------------------------------- + ! Copy prognostic field data to state arrays + !--------------------------------------------------------------------------- + call invoke( & + name="copy_init_fields_to_state", & + setval_X(self%state(igh_u), u ), & + setval_X(self%state(igh_t), theta), & + setval_X(self%state(igh_d), rho), & + setval_X(self%state(igh_p), exner), & + setval_c(self%total_dry_flux, 0.0_r_tran) & + ) + + call copy_bundle(self%state, self%state_n, bundle_size) + call copy_bundle(self%state, self%state_m, bundle_size) + call copy_bundle(self%state, self%state_dag, bundle_size) + if (self%use_moisture) then + call copy_bundle(mr, self%mr_n, nummr) + call copy_bundle(mr, self%mr_dag, nummr) + end if + + call rho_star%initialise(rho%get_function_space()) + call dry_flux_solver%initialise(u%get_function_space()) + + ! ======================================================================== ! + ! SLOW PHYSICS + ! ======================================================================== ! + + if (use_physics) then + if (self%output_cld_incs) then + call cld_incs_init( & + cloud_fields, dcfl_tot, dcff_tot, dbcf_tot, sec_tot, suffix_tot & + ) + end if + + call slow_physics( & + modeldb, self%du, self%dtheta, self%mr_dag, & + self%state_n(igh_t), self%state_n(igh_u), self%state_n(igh_d), & + self%state_n(igh_p), moist_dyn, self%mr_n, & + derived_fields, radiation_fields, microphysics_fields, & + electric_fields, orography_fields, turbulence_fields, & + convection_fields, cloud_fields, surface_fields, soil_fields, & + snow_fields, chemistry_fields, aerosol_fields, model_clock, & + dt, dtemp_encorr, mesh, twod_mesh & + ) + + call invoke( & + name="update_from_slow_physics", & + inc_X_plus_Y(self%state_dag(igh_t), self%dtheta), & + inc_X_plus_Y(self%state_dag(igh_u), self%du) & + ) + ! mr_dag is already updated in slow_physics + + if (self%output_cld_incs) then + call cld_incs_init( & + cloud_fields, dcfl_adv, dcff_adv, dbcf_adv, sec_adv, suffix_adv & + ) + end if + end if ! use_physics + + call conditional_collection_copy( & + adv_tracer_all_outer_dag, generic_fields_to_copy=adv_tracer_all_outer, & + field_list=adv_tracer_all_outer & + ) + call conditional_collection_copy( & + adv_tracer_last_outer_dag, & + generic_fields_to_copy=adv_tracer_last_outer, & + field_list=adv_tracer_last_outer & + ) + call conditional_collection_copy( & + con_tracer_all_outer_dag, generic_fields_to_copy=con_tracer_all_outer, & + field_list=con_tracer_all_outer & + ) + call conditional_collection_copy( & + con_tracer_last_outer_dag, & + generic_fields_to_copy=con_tracer_last_outer, & + field_list=con_tracer_last_outer & + ) + + ! ======================================================================== ! + ! DYNAMICS -- TRAPEZOIDAL STEP + ! ======================================================================== ! + + ! X^m + gamma*dt*F[X^m] = T[X^dag - gamma*dt*F[X^n]] + + ! ------------------------------------------------------------------------ ! + ! Compute the semi-implicit operators + ! ------------------------------------------------------------------------ ! + ! Reset the reference state in the semi-implicit operators using the latest + ! value of the state. This occurs every n timesteps, where n is calculated + ! as reference_reset_time divided by dt. + ! The reference_reset_time is specified in the configuration namelist. + ! Note that this reset can only occur at most once per timestep. + reference_reset_freq = nint(reference_reset_time / dt, i_def) + + if (mod(model_clock%get_step()-1, reference_reset_freq) == 0) then + ! Compute semi-implicit operators with current model state + call compute_si_operators_common( & + self%config, self%state(igh_t), self%state(igh_d), & + self%state(igh_p), moist_dyn & + ) + call compute_helmholtz_operators(model_clock, stepper_tr) + call compute_helmholtz_operators(model_clock, stepper_bdf2) + + checkpoint_reference_fields = ( & + mod(model_clock%get_first_step()-1, reference_reset_freq) /= 0 .or. & + mod(model_clock%get_last_step(), reference_reset_freq) /= 0 & + ) + + if (checkpoint_read .or. init_option == init_option_checkpoint_dump) then + ! If the first timestep of this run IS an operator calc timestep, but + ! the first timestep of the next run IS NOT, then checkpoint_flag + ! must be false to allow model to start running, as the operator + ! prognostics will not be in the initial dump + if (mod(model_clock%get_first_step()-1, reference_reset_freq) == 0 & + .and. mod(model_clock%get_last_step(), reference_reset_freq) /= 0) then + checkpoint_reference_fields = .false. + end if + end if + + ! Copy over model state for checkpointing if required + if (checkpoint_reference_fields) then + call prognostic_fields%get_field('theta_ref', theta_ref) + call prognostic_fields%get_field('rho_ref', rho_ref) + call prognostic_fields%get_field('exner_ref', exner_ref) + call moisture_fields%get_field("moist_dyn_ref", moist_dyn_ref_array) + moist_dyn_ref => moist_dyn_ref_array%bundle + call copy_bundle(moist_dyn, moist_dyn_ref, num_moist_factors) + call invoke( & + setval_X(theta_ref, self%state(igh_t)), & + setval_X(rho_ref, self%state(igh_d)), & + setval_X(exner_ref, self%state(igh_p)) & + ) + end if + end if + + ! ------------------------------------------------------------------------ ! + ! Forcings: time-level n + ! ------------------------------------------------------------------------ ! + + ! rhs_n = M[X^dag - gamma*dt*F[X^n]] + call rhs_alg( & + self%rhs_n, gamma*dt, self%state_dag, self%state_n, moist_dyn, & + compute_eos=.false., compute_rhs_t_d=.true., dlayer_rhs=.false., & + stepper=stepper_tr, model_clock=model_clock & + ) + + ! ======================================================================== ! + ! Outer dynamics loop + ! ======================================================================== ! + + ! Transported variables are set to those after slow physics + call copy_bundle(self%state_dag, self%state_to_adv, bundle_size) + mr_to_adv => self%mr_dag + + ! Set predictors for transport + call predictors_alg( & + self%state_to_adv, self%state_n(igh_u), self%rhs_n(igh_u), & + gamma, model_clock & + ) + + outer_tr_loop: do outer = 1, outer_iterations + + if (use_wavedynamics) then + + call invoke( setval_c(dry_flux_solver, 0.0_r_def) ) + + ! -------------------------------------------------------------------- ! + ! Transport + ! -------------------------------------------------------------------- ! + ! Transport state_dag & mr_dag: put results in rhs_adv & mr + ! Transporting wind is 0.5*(u^n + u^m) + call gungho_transport_control_alg( & + self%config, self%rhs_adv, & + self%state_to_adv, self%state_m(igh_u), self%state_n(igh_u), & + mr, mr_to_adv, model_clock, outer, stepper_tr, & + cheap_update=.false., & + rho_d_n=self%state_dag(igh_d), & + rho_d_n_start=self%state_dag(igh_d), & + total_dry_flux=self%total_dry_flux & + ) + + if (outer == outer_iterations) then + ! Store the transported state for the BDF2 step + ! Need mass matrix solve on u: + call mass_matrix_solver_alg(self%du, self%rhs_adv(igh_u)) + call invoke( & + X_plus_Y( & + self%state_aft_adv(igh_u), self%du, self%state_to_adv(igh_u) & + ), & + X_plus_Y( & + self%state_aft_adv(igh_t), self%rhs_adv(igh_t), & + self%state_to_adv(igh_t) & + ), & + X_plus_Y( & + self%state_aft_adv(igh_d), self%rhs_adv(igh_d), & + self%state_to_adv(igh_d) & + ), & + X_plus_Y( & + self%state_aft_adv(igh_p), self%rhs_adv(igh_p), & + self%state_to_adv(igh_p) & + ) & + ) + end if + + ! Convert theta increment to weak form + call invoke( & + setval_X(self%dtheta, self%rhs_adv(igh_t)), & + setval_c(self%rhs_adv(igh_t), 0.0_r_def), & + dg_inc_matrix_vector_kernel_type( & + self%rhs_adv(igh_t), self%dtheta, mm_wt & + ) & + ) + + else ! No wavedynamics + if (self%use_moisture) call copy_bundle(self%mr_dag, mr, nummr) + call set_bundle_scalar(0.0_r_def, self%rhs_adv, bundle_size) + call copy_bundle(self%state_dag, self%state_aft_adv, bundle_size) + end if + + ! ====================================================================== ! + ! Inner dynamics loop + ! ====================================================================== ! + if (use_wavedynamics) then + + inner_tr_loop: do inner = 1, inner_iterations_tr(outer) + write( log_scratch_space, '(A,2I3)' ) & + 'TR loop indices (o, i): ', outer, inner + call log_event( log_scratch_space, LOG_LEVEL_INFO ) + + ! -------------------------------------------------------------------- + ! Forcings: time-level m + ! -------------------------------------------------------------------- + call rhs_alg( & + self%rhs_m, -gamma*dt, self%state_m, self%state_m, moist_dyn, & + compute_eos=.true., compute_rhs_t_d=(inner==1), & + dlayer_rhs=dlayer_on, stepper=stepper_tr, & + model_clock=model_clock & + ) + + !--------------------------------------------------------------------- + ! LAM LBCs and RHS + !--------------------------------------------------------------------- + if (limited_area .and. inner == 1 .and. outer == 1) then + call lam_solver_lbc( & + self%state_m(igh_u), lbc_fields, prime_mesh_name & + ) + call calc_rhs_lbc( & + self%rhs_lbc, lbc_fields, model_clock, prime_mesh_name, & + 1.0_r_def, stepper_tr & + ) + end if + + !--------------------------------------------------------------------- + ! Compute the residuals + !--------------------------------------------------------------------- + ! Add on advective terms: rhs = rhs_n - rhs_m + rhs_adv + ! (reuse rhs_m for rhs) + call bundle_axpy( & + -1.0_r_def, self%rhs_m, self%rhs_n, self%rhs_m, bundle_size & + ) + call add_bundle(self%rhs_m, self%rhs_adv, self%rhs_m, bundle_size) + + if (limited_area) then + if (inner == 1 .and. outer == 1) then + ! Add on the RHS for LBCs + call add_bundle(self%rhs_m, self%rhs_lbc, self%rhs_m, bundle_size) + end if + ! Apply masks to RHS + call apply_mask_rhs(self%rhs_m, prime_mesh_name) + end if + + ! Accelerators for inner loop convergence + if (inner > 1) then + call invoke( setval_c(self%rhs_m(igh_d), 0.0_r_def), & + setval_c(self%rhs_m(igh_t), 0.0_r_def) ) + end if + + write_moisture_diag = ( & + self%use_moisture .and. write_conservation_diag & + .and. outer == outer_iterations & + .and. inner == inner_iterations_tr(outer_iterations) & + ) + if (write_moisture_diag) then + ! Calculate transported density + call self%state(igh_d)%copy_field_properties(rho_star) + call invoke( & + X_plus_Y(rho_star, self%state_dag(igh_d), self%rhs_adv(igh_d)) & + ) + call moisture_conservation_alg( & + self%config, rho_star, mr, 'Before TR solve' & + ) + end if + + !--------------------------------------------------------------------- + ! Solve system: A*inc = rhs_m, and increment state by inc + !--------------------------------------------------------------------- + call semi_implicit_solver_alg_step( & + self%state_m, self%rhs_m, & + dry_flux_solver, moist_dyn(gas_law), mr, & + first_iteration=(inner==1), stepper=stepper_tr & + ) + + ! If not already done update factors for moist dynamics + if (self%use_moisture) then + call moist_dyn_factors_alg(moist_dyn, mr) + end if + + if (exner_from_eos) then + call derive_exner_from_eos(self%state_m, moist_dyn(gas_law)) + end if + end do inner_tr_loop + + end if ! use_wavedynamics + end do outer_tr_loop + + ! ======================================================================== ! + ! DYNAMICS -- BACKWARD-DIFFERENCE STEP + ! ======================================================================== ! + + ! X^{n+1} + gamma2*dt*F[X^{n+1}] = T[(1-gamma3)*X^q + gamma3*X^m] + ! where X^q = X_dag + X_aft_adv - X_to_adv + + ! First guess of X^{n+1} is extrapolated from X^m and X^n + call bundle_axpby( & + (1.0_r_def - 0.5_r_def/gamma), self%state_n, & + 0.5_r_def/gamma, self%state_m, & + self%state, bundle_size & + ) + + ! ------------------------------------------------------------------------ ! + ! Compute initial BDF state + ! ------------------------------------------------------------------------ ! + + ! X^q = X_dag + X_aft_adv - X_to_adv + call bundle_axpy( & + -1.0_r_def, self%state_to_adv, self%state_aft_adv, self%state_q, & + bundle_size & + ) + call add_bundle(self%state_q, self%state_dag, self%state_q, bundle_size) + + ! X_bdf = (1-gamma3)*X^q + gamma3*X^m + call bundle_axpby( & + (1.0_r_def - gamma3), self%state_q, gamma3, self%state_m, & + self%state_bdf, bundle_size & + ) + + do_moist_correction = (solver_moisture_conservation .and. self%use_moisture) + if (do_moist_correction) then + call dry_flux_solver_r_tran%initialise(u%get_function_space()) + call invoke( & + inc_a_times_X(gamma3, dry_flux_solver), & + real_to_real_X(dry_flux_solver_r_tran, dry_flux_solver), & + inc_X_plus_Y(self%total_dry_flux, dry_flux_solver_r_tran) & + ) + call solver_moist_correction_alg( & + self%config, mr, self%state_bdf(igh_d), self%state_aft_adv(igh_d), & + dry_flux_solver & + ) + end if + + if (write_moisture_diag) then + call moisture_conservation_alg( & + self%config, self%state_bdf(igh_d), mr, 'After TR solve' & + ) + end if + + ! Note that for mr, the value at the m-level is equal to that at the q-level + ! so we can just use mr as mr_bdf + call copy_bundle(mr, self%mr_bdf, nummr) + mr_to_adv => self%mr_bdf + + ! Compute BDF2 RHS, by multiplying by mass matrices + ! The pressure contribution is set to zero + call invoke( & + name="compute_rhs_bdf_from_state_bdf", & + setval_c(self%rhs_bdf(igh_u), 0.0_r_def), & + matrix_vector_kernel_type( & + self%rhs_bdf(igh_u), self%state_bdf(igh_u), mm_vel & + ), & + enforce_bc_kernel_type(self%rhs_bdf(igh_u)), & + dg_matrix_vector_kernel_type( & + self%rhs_bdf(igh_t), self%state_bdf(igh_t), mm_wt & + ), & + setval_X(self%rhs_bdf(igh_d), self%state_bdf(igh_d)), & + setval_c(self%rhs_bdf(igh_p), 0.0_r_def) & + ) + + ! ======================================================================== ! + ! Outer transport loop + ! ======================================================================== ! + + outer_bdf_loop: do outer = 1, outer_iterations + + if (use_wavedynamics) then + + call invoke( setval_c(dry_flux_solver, 0.0_r_def) ) + + ! -------------------------------------------------------------------- ! + ! Transport + ! -------------------------------------------------------------------- ! + ! Transport state_bdf & mr_bdf: put results in rhs_adv & mr + ! Transporting wind is u^{n+1} + ! Here we also transport other fields using 0.5*(u^n + u^{n+1}) + call gungho_transport_control_alg( & + self%config, self%rhs_adv, & + self%state_bdf, self%state(igh_u), self%state_n(igh_u), & + mr, mr_to_adv, model_clock, outer, stepper_bdf2, & + cheap_update, self%adv_inc_prev, self%wind_prev, & + self%state_bdf(igh_d), self%state_dag(igh_d), & + self%total_dry_flux, & + adv_tracer_all_outer, adv_tracer_all_outer_dag, & + adv_tracer_last_outer, adv_tracer_last_outer_dag, & + con_tracer_all_outer, con_tracer_all_outer_dag, & + con_tracer_last_outer, con_tracer_last_outer_dag & + ) + + ! Convert theta increment to weak form + call invoke( & + setval_X(self%dtheta, self%rhs_adv(igh_t)), & + setval_c(self%rhs_adv(igh_t), 0.0_r_def), & + dg_inc_matrix_vector_kernel_type( & + self%rhs_adv(igh_t), self%dtheta, mm_wt & + ) & + ) + + ! ---------------------------------------------------------------------- + ! Forcings: time-level n+1 + ! ---------------------------------------------------------------------- + ! Used for fast physics predictors, so calculated here + call rhs_alg( & + self%rhs_np1, -gamma2*dt, self%state, self%state, moist_dyn, & + compute_eos=.true., compute_rhs_t_d=.true., dlayer_rhs=dlayer_on, & + stepper=stepper_bdf2, model_clock=model_clock & + ) + else ! No wavedynamics + call set_bundle_scalar(0.0_r_def, self%rhs_adv, bundle_size) + if (self%use_moisture) call copy_bundle(self%mr_dag, mr, nummr) + end if + + ! Update the moisture after transport (mr_aft_adv) for diagnostics + if (self%use_moisture .and. outer == outer_iterations) then + call copy_bundle(mr, self%mr_aft_adv, nummr) + end if + + ! ====================================================================== ! + ! FAST PHYSICS + ! ====================================================================== ! + + if (use_physics) then + !----------------------------------------------------------------------- + ! Predictors + !----------------------------------------------------------------------- + call calc_phys_predictors_alg( & + derived_fields, self%rhs_np1, self%rhs_adv, self%rhs_bdf, & + self%state, self%state_dag, lbc_fields, model_clock & + ) + + if (outer == outer_iterations .and. self%output_cld_incs) then + call cld_incs_output( & + cloud_fields, dcfl_adv, dcff_adv, dbcf_adv, sec_adv, suffix_adv & + ) + end if + + call fast_physics( & + self%config, self%du, self%dtheta, mr, self%state_n(igh_t), & + self%state_n(igh_d), self%state_n(igh_u), self%state_n(igh_p), & + self%mr_n, derived_fields, radiation_fields, microphysics_fields, & + orography_fields, turbulence_fields, convection_fields, & + cloud_fields, surface_fields, soil_fields, snow_fields, & + chemistry_fields, aerosol_fields, stph_fields, & + spt_spectral_coeffc, spt_spectral_coeffs, spt_power_law, & + skeb_spectral_coeffc, skeb_spectral_coeffs, skeb_power_law, & + outer, model_clock, dt & + ) + + outer_smagorinsky = ( & + smagorinsky .and. & + smagorinsky_placement == smagorinsky_placement_outer & + ) + if (outer_smagorinsky) then + call smagorinsky_alg( & + self%config, self%dtheta, self%du, mr, & + self%state(igh_t), self%state(igh_u), derived_fields, & + cloud_fields, self%state(igh_d), self%state(igh_p), & + dt, model_clock & + ) + end if + + if (use_wavedynamics) then + ! copy incs into rhs_phys, including multiplication by mass matrix + ! need to reset rhs_phys to 0 because matrix_vector_kernel_type + ! increments the field rather than over-writing it + call set_bundle_scalar(0.0_r_def, self%rhs_phys, bundle_size) + call invoke( & + name="update_rhs_phys_from_fast_physics", & + dg_inc_matrix_vector_kernel_type( & + self%rhs_phys(igh_t), self%dtheta, mm_wt & + ), & + matrix_vector_kernel_type( & + self%rhs_phys(igh_u), self%du, mm_vel), & + enforce_bc_kernel_type(self%rhs_phys(igh_u)) & + ) + end if + end if ! use_physics + + ! ====================================================================== ! + ! Inner dynamics loop + ! ====================================================================== ! + if (use_wavedynamics) then + + inner_bdf_loop: do inner = 1, inner_iterations_bdf2(outer) + write( log_scratch_space, '(A,2I3)' ) & + 'BDF loop indices (o, i): ', outer, inner + call log_event( log_scratch_space, LOG_LEVEL_INFO ) + + ! -------------------------------------------------------------------- + ! Forcings: time-level n+1 + ! -------------------------------------------------------------------- + if (inner > 1) then + call rhs_alg( & + self%rhs_np1, -gamma2*dt, self%state, self%state, moist_dyn, & + compute_eos=.true., compute_rhs_t_d=.false., & + dlayer_rhs=dlayer_on, stepper=stepper_bdf2, & + model_clock=model_clock & + ) + end if + + !--------------------------------------------------------------------- + ! LAM LBCs and RHS + !--------------------------------------------------------------------- + if (limited_area .and. inner == 1 .and. outer == 1) then + call lam_solver_lbc( & + self%state(igh_u), lbc_fields, prime_mesh_name & + ) + call calc_rhs_lbc( & + self%rhs_lbc, lbc_fields, model_clock, prime_mesh_name, & + 1.0_r_def, stepper_bdf2 & + ) + end if + + !--------------------------------------------------------------------- + ! Compute the residuals + !--------------------------------------------------------------------- + ! Add on advective terms: rhs = rhs_bdf - rhs_np1 + rhs_adv + rhs_phys + ! (reuse rhs_np1 for rhs) + call bundle_axpy( & + -1.0_r_def, self%rhs_np1, self%rhs_bdf, self%rhs_np1, & + bundle_size & + ) + call add_bundle(self%rhs_np1, self%rhs_adv, self%rhs_np1, bundle_size) + call add_bundle(self%rhs_np1, self%rhs_phys, self%rhs_np1, bundle_size) + + if (limited_area) then + if (inner == 1 .and. outer == 1) then + ! Add on the RHS for LBCs + call add_bundle( & + self%rhs_np1, self%rhs_lbc, self%rhs_np1, bundle_size & + ) + end if + ! Apply masks to RHS + call apply_mask_rhs(self%rhs_np1, prime_mesh_name) + end if + + ! Accelerators for inner loop convergence + if (inner > 1) then + call invoke( setval_c(self%rhs_np1(igh_d), 0.0_r_def), & + setval_c(self%rhs_np1(igh_t), 0.0_r_def) ) + end if + + write_moisture_diag = ( & + self%use_moisture .and. write_conservation_diag & + .and. outer == outer_iterations & + .and. inner == inner_iterations_bdf2(outer_iterations) & + ) + if (write_moisture_diag) then + ! Calculate transported density + call self%state(igh_d)%copy_field_properties(rho_star) + call invoke( & + X_plus_Y(rho_star, self%state_bdf(igh_d), self%rhs_adv(igh_d)) & + ) + call moisture_conservation_alg( & + self%config, rho_star, mr, 'Before BDF solve' & + ) + end if + + !--------------------------------------------------------------------- + ! Solve system: A*inc = rhs_m, and increment state by inc + !--------------------------------------------------------------------- + call semi_implicit_solver_alg_step( & + self%state, self%rhs_np1, & + dry_flux_solver, moist_dyn(gas_law), mr, & + first_iteration=(inner==1), stepper=stepper_bdf2 & + ) + + ! If not already done update factors for moist dynamics + if (self%use_moisture) then + call moist_dyn_factors_alg(moist_dyn, mr) + end if + + if (exner_from_eos) then + call derive_exner_from_eos(self%state, moist_dyn(gas_law)) + end if + + !--------------------------------------------------------------------- + ! LAM Overwrite and Blend LBCs + !--------------------------------------------------------------------- + if (limited_area) then + to_blend_lbc = ( & + blend_frequency == blend_frequency_inner .or. ( & + blend_frequency == blend_frequency_outer & + .and. inner == inner_iterations_bdf2(outer_iterations) & + ) .or. ( & + blend_frequency == blend_frequency_final & + .and. inner == inner_iterations_bdf2(outer_iterations) & + .and. outer == outer_iterations & + ) & + ) + if (to_blend_lbc) then + call lam_blend_lbc( & + self%state(igh_u), self%state(igh_p), self%state(igh_d), & + self%state(igh_t), mr, lbc_fields, microphysics_fields, & + aerosol_fields, lbc_option, microphysics_casim, murk_lbc, & + moisture_formulation, prime_mesh_name & + ) + end if + end if + end do inner_bdf_loop + + do_moist_correction = ( & + solver_moisture_conservation .and. self%use_moisture & + .and. outer == outer_iterations & + ) + if (do_moist_correction) then + call invoke( & + X_plus_Y(rho_star, self%rhs_adv(igh_d), self%state_bdf(igh_d)) & + ) + call solver_moist_correction_alg( & + self%config, mr, self%state(igh_d), rho_star, dry_flux_solver & + ) + end if + + if (write_moisture_diag) then + call moisture_conservation_alg( & + self%config, self%state(igh_d), mr, 'After BDF solve' & + ) + end if + + else ! when use_wavedynamics=false, just add physics increments here + + call invoke( & + X_plus_Y(self%state(igh_t), self%state_dag(igh_t), self%dtheta), & + X_plus_Y(self%state(igh_u), self%state_dag(igh_u), self%du) & + ) + end if ! use_wavedynamics + end do outer_bdf_loop + + ! ======================================================================== ! + ! END-OF-STEP PHYSICS + ! ======================================================================== ! + + call adv_tracer_all_outer_dag%clear() + call adv_tracer_last_outer_dag%clear() + call con_tracer_all_outer_dag%clear() + call con_tracer_last_outer_dag%clear() + + if (transport_ageofair) then + call con_tracer_last_outer%get_field('ageofair', ageofair) + call ageofair_update(ageofair, model_clock) + end if + + !--------------------------------------------------------------------------- + ! Apply mixing + !--------------------------------------------------------------------------- + call mixing_alg( & + self%config, mr, self%state(igh_t), self%state(igh_u), derived_fields, & + cloud_fields, self%state(igh_d), self%state(igh_p), dt, model_clock & + ) + + ! -------------------------------------------------------------------------- + ! Call cloud scheme to generate cloud and latent heating after pressure + ! changes are applied from the solver. + ! -------------------------------------------------------------------------- +#ifdef UM_PHYSICS + if (use_physics .and. cloud == cloud_um) then + call cld_alg( & + self%config, self%dtheta_cld, mr, self%state(igh_t), & + self%state(igh_p), self%state(igh_d), derived_fields, & + turbulence_fields, cloud_fields, convection_fields, & + self%state_n(igh_t), self%mr_n, & + model_clock%get_step(), dt, .false. & + ) + call invoke(inc_X_plus_Y(self%state(igh_t), self%dtheta_cld)) + + if (l_mcr_precfrac) then + call microphysics_fields%get_field('precfrac', precfrac) + call invoke( & + lsp_precfrac_checks_kernel_type( & + exner, mr(imr_v), mr(imr_cl), mr(imr_ci), & + mr(imr_s), mr(imr_r), mr(imr_g), precfrac & + ) & + ) + end if + + if (microphysics_casim) then + call casim_activate_alg( & + self%config, self%state(igh_t), mr, derived_fields, cloud_fields, & + microphysics_fields, convection_fields, initialise=.false. & + ) + end if ! microphysics_casim + end if +#endif + + ! Update derived variables for time level n+1 + if (self%use_moisture) then + call moist_dyn_factors_alg(moist_dyn, mr) + end if + if (use_physics) then + call map_physics_fields_alg( & + self%config, self%state(igh_u), self%state(igh_p), & + self%state(igh_d), self%state(igh_t), moist_dyn, derived_fields & + ) + end if + + !---------------------------------------------------------------------------- + ! Call UKCA for GLOMAP-mode prognostic aerosol updates + !--------------------------------------------------------------------------- +#ifdef UM_PHYSICS + if (aerosol == aerosol_um) then + glomap_mode = self%config%aerosol%glomap_mode() + end if + if (aerosol == aerosol_um .and. & + (glomap_mode == glomap_mode_ukca .or. & + glomap_mode == glomap_mode_dust_and_clim)) then + call aerosol_ukca_alg( & + self%config, chemistry_fields, aerosol_fields, & + radiation_fields, derived_fields, microphysics_fields, & + turbulence_fields, convection_fields, cloud_fields, surface_fields, & + soil_fields, self%state, mr, model_clock & + ) + end if +#endif + + ! Write diagnostic output + if (use_physics .and. self%output_cld_incs) then + call cld_incs_output( & + cloud_fields, dcfl_tot, dcff_tot, dbcf_tot, sec_tot, suffix_tot & + ) + end if + if (write_diag .and. use_xios_io .and. & + mod(model_clock%get_step(), diagnostic_frequency) == 0) then + call output_diags_for_si( & + self%state, self%state_n, self%state_dag, & + mr, self%mr_n, self%mr_dag, self%mr_aft_adv, & + derived_fields, self%du, self%dtheta, self%dtheta_cld & + ) + end if + + !--------------------------------------------------------------------------- + ! Update fields held in the driver layer + !--------------------------------------------------------------------------- + call invoke( setval_X(u, self%state(igh_u)), & + setval_X(theta, self%state(igh_t)), & + setval_X(rho, self%state(igh_d)), & + setval_X(exner, self%state(igh_p)) ) + + deallocate(inner_iterations_tr) + deallocate(inner_iterations_bdf2) + + if (LPROF) call stop_timing(id, 'tr_bdf2_timestep_alg') + + end subroutine run_step + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !> Release all claimed resources once completed. + subroutine tr_bdf2_alg_final(self) + + implicit none + + class(tr_bdf2_timestep_type), intent(inout) :: self + + call semi_implicit_solver_alg_final() + call final_si_operators() + + if (allocated(self%state)) deallocate(self%state) + if (allocated(self%state_n)) deallocate(self%state_n) + if (allocated(self%state_m)) deallocate(self%state_m) + if (allocated(self%state_bdf)) deallocate(self%state_bdf) + if (allocated(self%state_q)) deallocate(self%state_q) + if (allocated(self%state_aft_adv)) deallocate(self%state_aft_adv) + if (allocated(self%state_dag)) deallocate(self%state_dag) + if (allocated(self%state_to_adv)) deallocate(self%state_to_adv) + if (allocated(self%rhs_n)) deallocate(self%rhs_n) + if (allocated(self%rhs_m)) deallocate(self%rhs_m) + if (allocated(self%rhs_bdf)) deallocate(self%rhs_bdf) + if (allocated(self%rhs_np1)) deallocate(self%rhs_np1) + if (allocated(self%rhs_adv)) deallocate(self%rhs_adv) + if (allocated(self%rhs_phys)) deallocate(self%rhs_phys) + if (allocated(self%rhs_lbc)) deallocate(self%rhs_lbc) + if (allocated(self%adv_inc_prev)) deallocate(self%adv_inc_prev) + if (allocated(self%mr_n)) deallocate(self%mr_n) + if (allocated(self%mr_dag)) deallocate(self%mr_dag) + if (allocated(self%mr_bdf)) deallocate(self%mr_bdf) + if (allocated(self%mr_aft_adv)) deallocate(self%mr_aft_adv) + + call self%dtheta%field_final() + call self%du%field_final() + call self%total_dry_flux%field_final() + + return + end subroutine tr_bdf2_alg_final + +end module tr_bdf2_timestep_alg_mod diff --git a/science/gungho/source/algorithm/transport/control/gungho_transport_control_alg_mod.X90 b/science/gungho/source/algorithm/transport/control/gungho_transport_control_alg_mod.X90 index f799cef47f..594047e259 100644 --- a/science/gungho/source/algorithm/transport/control/gungho_transport_control_alg_mod.X90 +++ b/science/gungho/source/algorithm/transport/control/gungho_transport_control_alg_mod.X90 @@ -8,34 +8,39 @@ module gungho_transport_control_alg_mod use config_mod, only: config_type - use constants_mod, only: i_def, r_def, l_def, r_tran, & + use constants_mod, only: i_def, r_def, l_def, r_tran, & PRECISION_R_TRAN + use dycore_constants_mod, only: stepper_siqn, stepper_tr, & + stepper_bdf2 use extrusion_mod, only: SHIFTED use field_mod, only: field_type use flux_precomputations_alg_mod, only: flux_precomputations_type - use formulation_config_mod, only: moisture_formulation, & - moisture_formulation_dry, & + use formulation_config_mod, only: moisture_formulation, & + moisture_formulation_dry, & use_multires_coupling use local_mesh_mod, only: local_mesh_type - use log_mod, only: log_event, & - log_scratch_space, & - LOG_LEVEL_DEBUG, & - LOG_LEVEL_ERROR, & + use log_mod, only: log_event, & + log_scratch_space, & + LOG_LEVEL_DEBUG, & + LOG_LEVEL_ERROR, & LOG_LEVEL_ALWAYS use mesh_collection_mod, only: mesh_collection use mesh_mod, only: mesh_type - use multires_coupling_config_mod, only: coarse_aerosol_transport, & + 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, & + si_outer_transport, & + si_outer_transport_advective, & + si_outer_transport_horizontal_sl 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, & - transport_metadata_collection - use check_configuration_mod, only: check_any_shifted, & - check_transport_name, & + use transport_metadata_collection_mod, only: transport_metadata_collection, & + transport_metadata_collection_type + use check_configuration_mod, only: check_any_shifted, & + check_transport_name, & check_any_eqn_consistent - use timing_mod, only: start_timing, stop_timing, & + use timing_mod, only: start_timing, stop_timing, & tik, LPROF implicit none @@ -148,6 +153,7 @@ contains !> @param[in] mr_in Moisture fields before transport !> @param[in] model_clock Time within the model !> @param[in] outer Outer (advection) iteration number + !> @param[in] stepper Enumerator for timestepper !> @param[in] cheap_update Logical flag for cheap transport update !> @param[in] prev_inc (Optional) Advective increment after 1st outer !! iteration transport used for cheap transport update @@ -155,6 +161,8 @@ contains !! previous outer iteration !> @param[in] rho_d_n (Optional) dry density to be transported, !! without the predictor factor + !> @param[in] rho_d_n_start (Optional) dry density at start of timestep, + !! for use with TR-BDF2 timestepper !> @param[in] total_dry_flux (Optional) the mass flux used to transport !! the dry density !> @param[in,out] adv_tracer_all_outer @@ -177,9 +185,9 @@ contains subroutine gungho_transport_control_alg(config, & advection_inc, advected_fields, & wind_np1, wind_n, mr_out, mr_in, & - model_clock, outer, & + model_clock, outer, stepper, & cheap_update, prev_inc, wind_prev, & - rho_d_n, & + rho_d_n, rho_d_n_start, & total_dry_flux, & adv_tracer_all_outer, & adv_tracer_all_outer_after_slow, & @@ -227,10 +235,12 @@ contains type(field_type), intent(in) :: mr_in(nummr) class(model_clock_type), intent(in) :: model_clock integer(kind=i_def), intent(in) :: outer + integer(kind=i_def), intent(in) :: stepper logical(kind=l_def), intent(in) :: cheap_update type(field_type), intent(in), optional :: prev_inc(bundle_size) type(field_type), intent(in), optional :: wind_prev type(field_type), target, intent(in), optional :: rho_d_n + type(field_type), intent(in), optional :: rho_d_n_start type(r_tran_field_type), intent(in), optional :: total_dry_flux type(field_collection_type), intent(inout), optional :: adv_tracer_all_outer type(field_collection_type), intent(in), optional :: adv_tracer_all_outer_after_slow @@ -251,6 +261,7 @@ contains type(field_type) :: rho_d_np1 type(field_type) :: aerosol_wind_n, aerosol_wind_np1 type(field_type) :: aerosol_reference_rho + type(r_tran_field_type) :: tr_and_bdf2_flux type(field_type), pointer :: rho_d_n_ptr type(field_type), target :: rho_d_n_trgt type(field_type), pointer :: rho_d_latest_ptr @@ -294,6 +305,12 @@ contains ! Determine aspects relating to cheap update steps ------------------------- ! Check whether it is a cheap update step cheap_update_step = (cheap_update .and. outer > 1) + if (cheap_update .and. .not. stepper == stepper_siqn) then + call log_event( & + 'Cheap transport update not implemented for TR-BDF2 stepper', & + LOG_LEVEL_ERROR & + ) + end if call wind_for_adv%initialise( wind_n%get_function_space() ) if (cheap_update .AND. outer > 2 .AND. present(wind_prev) ) then @@ -314,8 +331,9 @@ contains end if ! Initialise the main transport controller --------------------------------- - call transport_controller%initialise(config, & - model_clock, rho_d_latest_ptr, wind_for_adv, wind_np1, outer, & + call transport_controller%initialise( & + config, model_clock, stepper, & + rho_d_latest_ptr, wind_for_adv, wind_np1, outer, & cheap_update_step & ) @@ -338,10 +356,26 @@ contains ! Increment the whole time step's dry flux, which is to be used in the ! transport of tracers in the final outer step, if using the cheap update - if (cheap_update) then + ! or the TR-BDF2 timestepper + if (cheap_update .or. ( & + stepper == stepper_bdf2 .and. outer == outer_iterations) & + ) then flux_precomputations => transport_controller%get_flux_precomputations() flux_this_outer => flux_precomputations%get_total_ref_flux() call invoke( inc_X_plus_Y(total_dry_flux, flux_this_outer) ) + + ! If in BDF2 stage of TR-BDF2, but not last outer, need to store flux + else if (stepper == stepper_bdf2 .and. outer < outer_iterations) then + flux_precomputations => transport_controller%get_flux_precomputations() + flux_this_outer => flux_precomputations%get_total_ref_flux() + call tr_and_bdf2_flux%initialise(total_dry_flux%get_function_space()) + call invoke( X_plus_Y(tr_and_bdf2_flux, total_dry_flux, flux_this_outer) ) + + ! Store dry flux in final outer iteration of TR + else if (stepper == stepper_tr .and. outer == outer_iterations) then + flux_precomputations => transport_controller%get_flux_precomputations() + flux_this_outer => flux_precomputations%get_total_ref_flux() + call invoke( setval_X(total_dry_flux, flux_this_outer) ) end if ! Check negative reference fields at this point @@ -385,9 +419,50 @@ contains mr_out, mr_in, nummr_to_transport, & transport_controller, transport_metadata & ) - ! ---------------------------------------------------------------------- ! - ! Transport tracers which are active in fast physics, and therefore need - ! transporting on every outer iteration + end if + + ! ------------------------------------------------------------------------ ! + ! Transport potential temperature + ! (must be after moisture but before last_outer tracers due to cheap update) + ! Note: the theta increment is pointwise + call log_event( "Transporting potential temperature...", LOG_LEVEL_DEBUG) + transport_metadata => & + transport_metadata_collection%get_transport_metadata('potential_temperature') + + call theta_transport_alg( & + fields_np1(igh_t), advection_inc(igh_t), advected_fields(igh_t), & + mr_out, mr_in, transport_controller, transport_metadata & + ) + + ! ------------------------------------------------------------------------ ! + ! Transport tracers which are active in fast physics, and therefore need + ! transporting on every outer iteration + ! Not transported in TR step of TR-BDF2 + if ( moisture_formulation /= moisture_formulation_dry ) then + + if (stepper == stepper_bdf2) then + ! Reset transport controller -- transport is done over whole timestep + ! Set stepper to SIQN to use time-averaged wind + call transport_controller%finalise() + call transport_controller%initialise( & + config, model_clock, stepper_siqn, & + rho_d_n_start, wind_n, wind_np1, outer=outer, & + cheap_update_step=.false. & + ) + if (outer == outer_iterations) then + ! Dry flux is flux built up over whole timestep + call transport_controller%initialise_flux_precomputations(total_dry_flux) + else if (.not. ( & + si_outer_transport == si_outer_transport_advective & + .or. si_outer_transport == si_outer_transport_horizontal_sl & + )) then + ! Dry flux is the stored TR flux plus the latest BDF flux + call transport_controller%initialise_flux_precomputations(tr_and_bdf2_flux) + end if + ! Otherwise, not doing conservative tracer transport so don't initialise + ! flux precomputations + end if + if (present(adv_tracer_all_outer) & .and. check_transport_name('adv_tracer') ) then call log_event( & @@ -416,19 +491,6 @@ contains end if end if - ! ------------------------------------------------------------------------ ! - ! Transport potential temperature - ! (must be after moisture but before last_outer tracers due to cheap update) - ! Note: the theta increment is pointwise - call log_event( "Transporting potential temperature...", LOG_LEVEL_DEBUG) - transport_metadata => & - transport_metadata_collection%get_transport_metadata('potential_temperature') - - call theta_transport_alg( & - fields_np1(igh_t), advection_inc(igh_t), advected_fields(igh_t), & - mr_out, mr_in, transport_controller, transport_metadata & - ) - ! ======================================================================== ! ! TRANSPORT OF PROGNOSTICS: LAST OUTER LOOP ! ======================================================================== ! @@ -446,8 +508,8 @@ contains ! the difference in winds from the cheap update call transport_controller%finalise() call transport_controller%initialise( & - config, & - model_clock, rho_d_n_ptr, wind_n, wind_np1, & + config, model_clock, stepper_siqn, & + rho_d_n_ptr, wind_n, wind_np1, & outer=outer, cheap_update_step=.false. & ) ! Copy dry density flux for the whole timestep into flux precomputations @@ -470,8 +532,8 @@ contains ! Set up new transport controller for coarser mesh call aerosol_transport_controller%initialise( & - config, & - model_clock, aerosol_reference_rho, aerosol_wind_n, & + config, model_clock, stepper_siqn, & + aerosol_reference_rho, aerosol_wind_n, & aerosol_wind_np1, outer, cheap_update_step=.false. & ) ! Copy dry density flux for the whole timestep into flux precomputations diff --git a/science/gungho/source/algorithm/transport/control/transport_controller_mod.x90 b/science/gungho/source/algorithm/transport/control/transport_controller_mod.x90 index fe2eaeeb55..983e0cac73 100644 --- a/science/gungho/source/algorithm/transport/control/transport_controller_mod.x90 +++ b/science/gungho/source/algorithm/transport/control/transport_controller_mod.x90 @@ -42,6 +42,8 @@ module transport_controller_mod use sci_geometric_constants_mod, only: get_face_selector_ew, & get_face_selector_ns use transport_constants_mod, only: get_detj_at_w3_r_tran + use dycore_constants_mod, only: stepper_siqn, stepper_tr, & + stepper_bdf2, stepper_rk, gamma ! Transport objects use flux_precomputations_alg_mod, only: flux_precomputations_type @@ -140,6 +142,7 @@ contains !! - initialising precomputation objects !> @param[in] config Application namelist configuration object !> @param[in] model_clock Tracks the time within the model + !> @param[in] stepper Enumerator for timestepper !> @param[in] ref_field_rdef The reference density to use for conservative !! transport of tracers. This argument must be !! specified to perform conservative transport @@ -157,7 +160,7 @@ contains !! the transporting wind is the *difference* !! in wind from the previous step, rather than !! the full transport wind. - subroutine initialise(self, config, model_clock, ref_field_rdef, & + subroutine initialise(self, config, model_clock, stepper, ref_field_rdef, & wind_n_rdef, wind_np1_rdef, outer, cheap_update_step) use split_transport_utils_mod, only: get_dry_config, & @@ -177,6 +180,7 @@ contains class(transport_controller_type), intent(inout) :: self class(model_clock_type), target, intent(in) :: model_clock + integer(kind=i_def), intent(in) :: stepper type(field_type), intent(in) :: ref_field_rdef type(field_type), intent(in) :: wind_n_rdef type(field_type), optional, intent(in) :: wind_np1_rdef @@ -229,7 +233,20 @@ contains self%cheap_update_step = cheap_update_step end if - dt_rtran = real(model_clock%get_seconds_per_step(), r_tran) + ! Determine time increment for this step, based on the stepper + select case (stepper) + case (stepper_siqn, stepper_rk) + dt_rtran = real(model_clock%get_seconds_per_step(), r_tran) + case (stepper_tr) + dt_rtran = real(model_clock%get_seconds_per_step(), r_tran) + dt_rtran = 2.0_r_tran*real(gamma, r_tran)*dt_rtran + case (stepper_bdf2) + dt_rtran = real(model_clock%get_seconds_per_step(), r_tran) + dt_rtran = (1.0_r_tran - 2.0_r_tran*real(gamma, r_tran))*dt_rtran + case default + call log_event( "Unknown stepper passed to transport_controller " // & + "initialise method", LOG_LEVEL_ERROR ) + end select self%reference_splitting = splitting(get_dry_config()) @@ -272,12 +289,23 @@ contains self%wind_n_rtran), & inc_a_times_X(0.5_r_tran, self%transporting_wind) ) - ! standard semi-implicit transport wind: average of wind_n and wind_np1 else if (present(wind_np1_rdef)) then - call invoke( X_plus_Y(self%transporting_wind, self%wind_np1_rtran, & - self%wind_n_rtran), & - inc_a_times_X(0.5_r_tran, self%transporting_wind) ) - + select case (stepper) + case (stepper_rk) + ! Use wind_n as transporting wind + call invoke( setval_X(self%transporting_wind, self%wind_n_rtran) ) + case (stepper_siqn, stepper_tr) + ! standard semi-implicit transport wind: average of wind_n and wind_np1 + call invoke( X_plus_Y(self%transporting_wind, self%wind_np1_rtran, & + self%wind_n_rtran), & + inc_a_times_X(0.5_r_tran, self%transporting_wind) ) + case (stepper_bdf2) + ! Use wind_np1 as transporting wind + call invoke( setval_X(self%transporting_wind, self%wind_np1_rtran) ) + case default + call log_event( "Unknown stepper passed to transport_controller " // & + "initialise method", LOG_LEVEL_ERROR ) + end select else call invoke( setval_X(self%transporting_wind, self%wind_n_rtran) ) end if diff --git a/science/gungho/source/configuration/check_configuration_mod.F90 b/science/gungho/source/configuration/check_configuration_mod.F90 index 201537a5a7..d3da2b5983 100644 --- a/science/gungho/source/configuration/check_configuration_mod.F90 +++ b/science/gungho/source/configuration/check_configuration_mod.F90 @@ -142,10 +142,13 @@ subroutine check_configuration(modeldb) scaling_factor use timestepping_config_mod, only: method, & method_semi_implicit, & + method_tr_bdf2, & dt, & alpha, & outer_iterations, & - inner_iterations + inner_iterations_si, & + inner_iterations_tr, & + inner_iterations_bdf2 use base_mesh_config_mod, only: geometry, & geometry_spherical, & geometry_planar, & @@ -268,13 +271,57 @@ subroutine check_configuration(modeldb) outer_iterations call log_event( log_scratch_space, LOG_LEVEL_ERROR ) end if - if ( inner_iterations < 1 ) then - write( log_scratch_space, '(A,I4)' ) 'Invalid Choice: inner_iterations must be at least 1:', & - inner_iterations + if ( SIZE(inner_iterations_si) /= outer_iterations ) then + write( log_scratch_space, '(A,I4,A,I4)' ) 'Invalid Options: ' // & + 'inner_iterations_si has size ', SIZE(inner_iterations_si), & + ', but must have the same size as outer_iterations:', & + outer_iterations + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + if ( minval(inner_iterations_si) < 1 ) then + write( log_scratch_space, '(A,I4)' ) & + 'Invalid Choice: inner_iterations_si must be at least 1:', & + minval(inner_iterations_si) + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + + else if ( method == method_tr_bdf2 ) then + if ( outer_iterations < 1 ) then + write( log_scratch_space, '(A,I4)' ) & + 'Invalid Choice: outer_iterations must be at least 1:', & + outer_iterations + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + if ( SIZE(inner_iterations_tr) /= outer_iterations ) then + write( log_scratch_space, '(A,I4,A,I4)' ) 'Invalid Options: ' // & + 'inner_iterations_tr has size ', SIZE(inner_iterations_tr), & + ', but must have the same size as outer_iterations:', & + outer_iterations + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + if ( SIZE(inner_iterations_bdf2) /= outer_iterations ) then + write( log_scratch_space, '(A,I4,A,I4)' ) 'Invalid Options: ' // & + 'inner_iterations_bdf2 has size ', SIZE(inner_iterations_bdf2), & + ', but must have the same size as outer_iterations:', & + outer_iterations + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + if ( minval(inner_iterations_tr) < 1 ) then + write( log_scratch_space, '(A,I4)' ) & + 'Invalid Choice: inner_iterations_tr must be at least 1:', & + minval(inner_iterations_tr) + call log_event( log_scratch_space, LOG_LEVEL_ERROR ) + end if + if ( minval(inner_iterations_bdf2) < 1 ) then + write( log_scratch_space, '(A,I4)' ) & + 'Invalid Choice: inner_iterations_bdf2 must be at least 1:', & + minval(inner_iterations_bdf2) call log_event( log_scratch_space, LOG_LEVEL_ERROR ) end if end if + + ! Check the transport namelist if ( geometry == geometry_spherical .and. consistent_metric) then write( log_scratch_space, '(A)' ) 'Consistent metric option only valid for planar geometries' diff --git a/science/gungho/source/driver/gungho_model_mod.F90 b/science/gungho/source/driver/gungho_model_mod.F90 index b89f3f2ab1..24de77621f 100644 --- a/science/gungho/source/driver/gungho_model_mod.F90 +++ b/science/gungho/source/driver/gungho_model_mod.F90 @@ -86,6 +86,7 @@ module gungho_model_mod use rk_alg_timestep_mod, only : rk_timestep_type use semi_implicit_timestep_alg_mod, & only : semi_implicit_timestep_type + use tr_bdf2_timestep_alg_mod, only : tr_bdf2_timestep_type use setup_orography_alg_mod, only : setup_orography_alg use idealised_config_mod, only : perturb_init, perturb_seed use initial_temperature_config_mod, only : perturb, perturb_random @@ -1128,6 +1129,7 @@ subroutine initialise_model( mesh, modeldb ) use timestepping_config_mod, only: method, & method_semi_implicit, & method_rk, & + method_tr_bdf2, & method_no_timestepping, & method_jules @@ -1178,42 +1180,18 @@ subroutine initialise_model( mesh, modeldb ) case( method_semi_implicit ) ! Semi-Implicit ! Initialise the semi-implicit timestep method allocate( timestep_method, source=semi_implicit_timestep_type(modeldb) ) - ! Add to the model database - call modeldb%values%add_key_value('timestep_method', & - timestep_method) - ! Output initial conditions - if ( write_conservation_diag ) then - call conservation_algorithm( modeldb%config, rho, u, theta, & - mr, exner ) - if ( use_moisture ) then - call moisture_conservation_alg( modeldb%config, rho, mr, & - 'Before timestep' ) - end if - end if + + case( method_tr_bdf2 ) ! TR-BDF2 + ! Initialise the TR-BDF2 timestep method + allocate( timestep_method, source=tr_bdf2_timestep_type(modeldb) ) case( method_rk ) ! RK ! Initialise the Runge-Kutta timestep method allocate( timestep_method, source=rk_timestep_type(modeldb) ) - ! Add to the model database - call modeldb%values%add_key_value('timestep_method', & - timestep_method) - - ! Output initial conditions - if ( write_conservation_diag ) then - call conservation_algorithm( modeldb%config, rho, u, theta, & - mr, exner ) - if ( use_moisture ) then - call moisture_conservation_alg( modeldb%config, rho, mr, & - 'Before timestep' ) - end if - end if case( method_no_timestepping ) ! Initialise a null-timestep method allocate( timestep_method, source=no_timestep_type() ) - ! Add to the model database - call modeldb%values%add_key_value('timestep_method', & - timestep_method) write( log_scratch_space, & '(A, A)' ) 'CAUTION: Running with no timestepping. ' // & ' Prognostic fields not evolved' @@ -1223,9 +1201,6 @@ subroutine initialise_model( mesh, modeldb ) case( method_jules ) ! jules ! Initialise the jules timestep method allocate( timestep_method, source=jules_timestep_type(modeldb) ) - ! Add to the model database - call modeldb%values%add_key_value('timestep_method', & - timestep_method) #endif case default @@ -1233,6 +1208,17 @@ subroutine initialise_model( mesh, modeldb ) "stopping program! ",LOG_LEVEL_ERROR) end select + ! Add to the model database + call modeldb%values%add_key_value('timestep_method', timestep_method) + + ! Output initial conditions + if ( write_conservation_diag ) then + call conservation_algorithm(modeldb%config, rho, u, theta, mr, exner) + if ( use_moisture ) then + call moisture_conservation_alg(modeldb%config, rho, mr, 'Before timestep') + end if + end if + end subroutine initialise_model !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/science/gungho/source/driver/gungho_step_mod.x90 b/science/gungho/source/driver/gungho_step_mod.x90 index 403bc7c8bb..bb1d10eae5 100644 --- a/science/gungho/source/driver/gungho_step_mod.x90 +++ b/science/gungho/source/driver/gungho_step_mod.x90 @@ -45,13 +45,6 @@ module gungho_step_mod use moisture_fluxes_alg_mod, only : moisture_fluxes_alg use timestep_method_mod, only : timestep_method_type, & get_timestep_method_from_collection - use rk_alg_timestep_mod, only : rk_timestep_type - use semi_implicit_timestep_alg_mod, & - only : semi_implicit_timestep_type - use timestepping_config_mod, only : method, & - method_semi_implicit, & - method_rk, & - method_no_timestepping use update_energy_correction_alg_mod, & only : update_energy_correction_alg use compute_total_energy_alg_mod, only : compute_total_energy_alg diff --git a/science/gungho/source/kernel/solver/apply_analytic_q32_rhs_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_analytic_q32_rhs_kernel_mod.F90 new file mode 100644 index 0000000000..95202232bc --- /dev/null +++ b/science/gungho/source/kernel/solver/apply_analytic_q32_rhs_kernel_mod.F90 @@ -0,0 +1,120 @@ +!----------------------------------------------------------------------------- +! (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. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. +!----------------------------------------------------------------------------- + +!> @brief Compute analytic Q32 contribution to the pressure RHS. +!> @details Computes: +!! rhs = const_r*Q32_rho*rhs_u + const_t*Q32_theta*rhs_u. +module apply_analytic_q32_rhs_kernel_mod + + use argument_mod, only : arg_type, & + GH_FIELD, GH_OPERATOR, & + GH_READ, GH_WRITE, & + GH_SCALAR, & + GH_REAL, CELL_COLUMN + use constants_mod, only : r_solver, i_def + use kernel_mod, only : kernel_type + use fs_continuity_mod, only : W2, W3 + + implicit none + + private + + !--------------------------------------------------------------------------- + ! Public types + !--------------------------------------------------------------------------- + + type, public, extends(kernel_type) :: apply_analytic_q32_rhs_kernel_type + private + type(arg_type) :: meta_args(6) = (/ & + arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & ! rhs + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! rhs_u + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! q32_rho + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! q32_theta + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! const_r + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_t + /) + integer :: operates_on = CELL_COLUMN + contains + procedure, nopass :: apply_analytic_q32_rhs_code + end type apply_analytic_q32_rhs_kernel_type + + !--------------------------------------------------------------------------- + ! Contained functions/subroutines + !--------------------------------------------------------------------------- + public :: apply_analytic_q32_rhs_code + +contains + +!> @brief Compute analytic-elimination Q32 contribution for one column. +!> @param[in] cell Horizontal cell index +!> @param[in] nlayers Number of layers +!> @param[in,out] rhs Output Q32 contribution field in W3 +!> @param[in] rhs_u Input velocity RHS field in W2 +!> @param[in] ncell1 Total number of cells for q32_rho +!> @param[in] q32_rho Weighted projection operator from W2 to W3 +!> @param[in] ncell2 Total number of cells for q32_theta +!> @param[in] q32_theta Projection operator from W2 to W3 from +!! eliminated theta +!> @param[in] const_r tau_r*dt scaling constant applied to q32_rho +!> @param[in] const_t tau_t*dt scaling constant applied to q32_theta +!> @param[in] ndf_w3 Number of degrees of freedom per cell for W3 +!> @param[in] undf_w3 Unique number of degrees of freedom for W3 +!> @param[in] map_w3 Dofmap for W3 +!> @param[in] ndf_w2 Number of degrees of freedom per cell for W2 +!> @param[in] undf_w2 Unique number of degrees of freedom for W2 +!> @param[in] map_w2 Dofmap for W2 +subroutine apply_analytic_q32_rhs_code(cell, & + nlayers, & + rhs, & + rhs_u, & + ncell1, q32_rho, & + ncell2, q32_theta, & + const_r, const_t, & + ndf_w3, undf_w3, map_w3, & + ndf_w2, undf_w2, map_w2) + + implicit none + + integer(kind=i_def), intent(in) :: cell, nlayers + integer(kind=i_def), intent(in) :: ncell1, ncell2 + integer(kind=i_def), intent(in) :: undf_w3, ndf_w3 + integer(kind=i_def), intent(in) :: undf_w2, ndf_w2 + integer(kind=i_def), intent(in) :: map_w3(ndf_w3) + integer(kind=i_def), intent(in) :: map_w2(ndf_w2) + + real(kind=r_solver), intent(inout) :: rhs(undf_w3) + real(kind=r_solver), intent(in) :: rhs_u(undf_w2) + real(kind=r_solver), intent(in) :: const_r + real(kind=r_solver), intent(in) :: const_t + + real(kind=r_solver), intent(in) :: q32_rho(ncell1, ndf_w3, ndf_w2) + real(kind=r_solver), intent(in) :: q32_theta(ncell2, ndf_w3, ndf_w2) + + integer(kind=i_def) :: df1, df2, ik, i1, i2, nl + + nl = nlayers-1 + + do df1 = 1, ndf_w3 + i1 = map_w3(df1) + rhs(i1:i1+nl) = 0.0_r_solver + end do + + ik = (cell-1)*nlayers + 1 + do df2 = 1, ndf_w2 + i2 = map_w2(df2) + do df1 = 1, ndf_w3 + i1 = map_w3(df1) + rhs(i1:i1+nl) = rhs(i1:i1+nl) & + + const_r*q32_rho(ik:ik+nl,df1,df2)*rhs_u(i2:i2+nl) & + + const_t*q32_theta(ik:ik+nl,df1,df2)*rhs_u(i2:i2+nl) + end do + end do + +end subroutine apply_analytic_q32_rhs_code + +end module apply_analytic_q32_rhs_kernel_mod \ No newline at end of file diff --git a/science/gungho/source/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod.F90 index da306d4598..59016b3316 100644 --- a/science/gungho/source/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (C) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Apply the semi-implicit mixed operator to the equation of state. @@ -19,6 +21,7 @@ module apply_elim_mixed_lp_operator_kernel_mod use argument_mod, only : arg_type, & GH_FIELD, GH_OPERATOR, & GH_READ, GH_WRITE, & + GH_SCALAR, & GH_REAL, CELL_COLUMN use constants_mod, only : r_solver, i_def use kernel_mod, only : kernel_type @@ -34,14 +37,15 @@ module apply_elim_mixed_lp_operator_kernel_mod type, public, extends(kernel_type) :: apply_elim_mixed_lp_operator_kernel_type private - type(arg_type) :: meta_args(7) = (/ & + type(arg_type) :: meta_args(8) = (/ & arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & ! lhs_exner arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & ! theta' arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! u' arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & ! exner' arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! M3^exner - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! Q32 - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta) & ! P3theta + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! Q32_rho + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta),& ! P3theta + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_r /) integer :: operates_on = CELL_COLUMN contains @@ -66,10 +70,16 @@ module apply_elim_mixed_lp_operator_kernel_mod !> @param[in] ncell1 Total number of cells for the m3exner operator !> @param[in] m3exner W3 mass matrix weighted by the reference Exner pressure !> @param[in] ncell2 Total number of cells for the m3rho operator -!> @param[in] q32 Projection matrix from W2 to W3 +!> @param[in] q32_rho Projection matrix from W2 to W3 (density +!! contribution to Q32; the theta contribution is +!! carried instead through the p3theta*theta' term, +!! since theta' already carries the tau_t*dt scaling +!! when discretely eliminated -- see call sites) !> @param[in] ncell3 Total number of cells for the p3theta operator !> @param[in] p3theta Projection from Wtheta to W3 weighted by the reference !! potential temperature +!> @param[in] const_r tau_r*dt scaling constant applied to the Q32 +!! (density) contribution to the equation of state !> @param[in] ndf_w3 Number of degrees of freedom per cell for the density space !> @param[in] undf_w3 Unique number of degrees of freedom for the density space !> @param[in] map_w3 Dofmap for the cell at the base of the column for the @@ -86,8 +96,9 @@ subroutine apply_elim_mixed_lp_operator_code(cell, & lhs_exner, & theta, u, exner, & ncell1, m3exner, & - ncell2, q32, & + ncell2, q32_rho, & ncell3, p3theta, & + const_r, & ndf_w3, undf_w3, map_w3, & ndf_wt, undf_wt, map_wt, & ndf_w2, undf_w2, map_w2) @@ -109,10 +120,11 @@ subroutine apply_elim_mixed_lp_operator_code(cell, & real(kind=r_solver), dimension(undf_wt), intent(in) :: theta real(kind=r_solver), dimension(undf_w3), intent(in) :: exner real(kind=r_solver), dimension(undf_w2), intent(in) :: u + real(kind=r_solver), intent(in) :: const_r ! Operators real(kind=r_solver), dimension(ncell1, ndf_w3, ndf_w3), intent(in) :: m3exner - real(kind=r_solver), dimension(ncell2, ndf_w3, ndf_w2), intent(in) :: q32 + real(kind=r_solver), dimension(ncell2, ndf_w3, ndf_w2), intent(in) :: q32_rho real(kind=r_solver), dimension(ncell3, ndf_w3, ndf_wt), intent(in) :: p3theta ! Internal variables @@ -137,7 +149,7 @@ subroutine apply_elim_mixed_lp_operator_code(cell, & ! LHS for this element lhs_e = matmul(m3exner(ik,:,:), p_e) & - matmul(p3theta(ik,:,:), t_e) & - + matmul(q32(ik,:,:), u_e) + + const_r*matmul(q32_rho(ik,:,:), u_e) do df = 1, ndf_w3 lhs_exner(map_w3(df)+k) = lhs_e(df) end do diff --git a/science/gungho/source/kernel/solver/apply_mixed_lu_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_mixed_lu_operator_kernel_mod.F90 index 326e395505..e01a1e34aa 100644 --- a/science/gungho/source/kernel/solver/apply_mixed_lu_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_mixed_lu_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (C) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Apply the semi-implicit mixed operator to the momentum equation. @@ -10,6 +12,7 @@ module apply_mixed_lu_operator_kernel_mod use argument_mod, only : arg_type, & GH_FIELD, GH_OPERATOR, & GH_READ, GH_INC, & + GH_SCALAR, & GH_REAL, CELL_COLUMN use constants_mod, only : r_solver, i_def use kernel_mod, only : kernel_type @@ -24,7 +27,7 @@ module apply_mixed_lu_operator_kernel_mod type, public, extends(kernel_type) :: apply_mixed_lu_operator_kernel_type private - type(arg_type) :: meta_args(8) = (/ & + type(arg_type) :: meta_args(9) = (/ & arg_type(GH_FIELD, GH_REAL, GH_INC, W2), & ! lhs_u arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! u' arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & ! theta' @@ -32,7 +35,8 @@ module apply_mixed_lu_operator_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W2), & ! Mu^{c,d} arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, Wtheta), & ! P2theta arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & ! grad - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & ! norm_u + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! norm_u + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_u /) integer :: operates_on = CELL_COLUMN contains @@ -60,6 +64,9 @@ module apply_mixed_lu_operator_kernel_mod !! @param[in] ncell3 Total number of cells for the grad operator !! @param[in] grad Generalised gradient operator for the momentum equation !! @param[in] norm_u Normalisation field for the momentum equation +!! @param[in] const_u tau_u*dt*cp scaling constant applied to the pressure +!! gradient (grad) and potential temperature projection +!! (P2theta) contributions to the momentum equation !! @param[in] ndf_w2 number of degrees of freedom per cell for the wind space !! @param[in] undf_w2 Unique number of degrees of freedom for the wind space !! @param[in] map_w2 Dofmap for the cell at the base of the column for the wind space @@ -81,6 +88,7 @@ subroutine apply_mixed_lu_operator_code(cell, & ncell2, P2theta, & ncell3, grad, & norm_u, & + const_u, & ndf_w2, undf_w2, map_w2, & ndf_wt, undf_wt, map_wt, & ndf_w3, undf_w3, map_w3) @@ -102,6 +110,7 @@ subroutine apply_mixed_lu_operator_code(cell, & real(kind=r_solver), dimension(undf_w2), intent(in) :: wind, norm_u real(kind=r_solver), dimension(undf_wt), intent(in) :: theta real(kind=r_solver), dimension(undf_w3), intent(in) :: exner + real(kind=r_solver), intent(in) :: const_u ! Operators real(kind=r_solver), dimension(ncell1, ndf_w2, ndf_w2), intent(in) :: mu_cd @@ -125,14 +134,14 @@ subroutine apply_mixed_lu_operator_code(cell, & do df2 = 1, ndf_wt do k = 0, nlayers-1 ik = (cell-1)*nlayers + k + 1 - lhs_t(k) = lhs_t(k) - p2theta(ik,df1,df2) * theta(map_wt(df2)+k) + lhs_t(k) = lhs_t(k) - const_u * p2theta(ik,df1,df2) * theta(map_wt(df2)+k) end do end do do df2 = 1, ndf_w3 do k = 0, nlayers-1 ik = (cell-1)*nlayers + k + 1 - lhs_t(k) = lhs_t(k) - grad(ik,df1,df2) * exner(map_w3(df2)+k) + lhs_t(k) = lhs_t(k) - const_u * grad(ik,df1,df2) * exner(map_w3(df2)+k) end do end do diff --git a/science/gungho/source/kernel/solver/apply_mixed_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_mixed_operator_kernel_mod.F90 index bf7b8c073d..d11e3b78e5 100644 --- a/science/gungho/source/kernel/solver/apply_mixed_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_mixed_operator_kernel_mod.F90 @@ -12,6 +12,7 @@ module apply_mixed_operator_kernel_mod use argument_mod, only : arg_type, & GH_FIELD, GH_OPERATOR, & + GH_SCALAR, & GH_READ, GH_INC, & GH_WRITE, & GH_REAL, CELL_COLUMN @@ -28,7 +29,7 @@ module apply_mixed_operator_kernel_mod type, public, extends(kernel_type) :: apply_mixed_operator_kernel_type private - type(arg_type) :: meta_args(15) = (/ & + type(arg_type) :: meta_args(18) = (/ & arg_type(GH_FIELD, GH_REAL, GH_INC, W2h), & ! lhs_uv arg_type(GH_FIELD, GH_REAL, GH_WRITE, W2v), & ! lhs_w arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & ! lhs_p @@ -43,7 +44,10 @@ module apply_mixed_operator_kernel_mod arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! norm_u arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! m3p arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! q32 - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta) & ! p3t + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta), & ! p3t + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! const_u + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! const_t + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_r /) integer :: operates_on = CELL_COLUMN contains @@ -82,6 +86,13 @@ module apply_mixed_operator_kernel_mod !> @param[in] q32 Projection operator from W2 to W3 !> @param[in] ncell6 Total number of cells for the p3t operator !> @param[in] p3t Projection operator from W2 to Wtheta +!> @param[in] const_u tau_u*dt*cp scaling constant applied to the pressure +!! gradient (grad) and potential temperature projection +!! (P2theta) contributions to the momentum equations +!> @param[in] const_t tau_t*dt scaling constant applied to the eliminated +!! potential temperature increment t = -Mt^-1*Pt2*u +!> @param[in] const_r tau_r*dt scaling constant applied to the Q32 +!! (density) contribution to the equation of state !> @param[in] ndf_w2h Number of degrees of freedom per cell for the horizontal wind space !> @param[in] undf_w2h Unique number of degrees of freedom for the horizontal wind space !> @param[in] map_w2h Dofmap for the cell at the base of the column for the horizontal wind space @@ -114,6 +125,7 @@ subroutine apply_mixed_operator_code(cell, & ncell4, m3p, & ncell5, q32, & ncell6, p3t, & + const_u, const_t, const_r, & ndf_w2h, undf_w2h, map_w2h, & ndf_w2v, undf_w2v, map_w2v, & ndf_w3, undf_w3, map_w3, & @@ -146,6 +158,7 @@ subroutine apply_mixed_operator_code(cell, & real(kind=r_solver), dimension(undf_w2), intent(in) :: norm_u real(kind=r_solver), dimension(undf_wt), intent(in) :: mt_lumped_inv real(kind=r_solver), dimension(undf_w3), intent(in) :: exner + real(kind=r_solver), intent(in) :: const_u, const_t, const_r ! Operators real(kind=r_solver), dimension(ncell0, ndf_wt, ndf_w2), intent(in) :: pt2 @@ -183,8 +196,8 @@ subroutine apply_mixed_operator_code(cell, & do df = 1, ndf_w2h iw2h = map_w2h(df) iw2 = map_w2(df) - lhs_uv(iw2h:iw2h+nm1) = lhs_uv(iw2h:iw2h+nm1) & - - norm_u(iw2:iw2+nm1) & + lhs_uv(iw2h:iw2h+nm1) = lhs_uv(iw2h:iw2h+nm1) & + - const_u*norm_u(iw2:iw2+nm1) & *grad(ij:ij+nm1, df, 1)*exner(iw3:iw3+nm1) end do do df2 = 1, ndf_w2 @@ -203,7 +216,7 @@ subroutine apply_mixed_operator_code(cell, & t_col(0:nm1) = t_col(0:nm1) - pt2(ij:ij+nm1, 1, df)*u_e(:,df) t_col(1:nm1+1) = t_col(1:nm1+1) - pt2(ij:ij+nm1, 2, df)*u_e(:,df) end do - t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) + t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) * const_t ! LHS W iw2v = map_w2v(1) @@ -213,7 +226,7 @@ subroutine apply_mixed_operator_code(cell, & iw2v = map_w2v(df) iw2 = map_w2(ndf_w2h+df) lhs_w(iw2v:iw2v+nm1) = lhs_w(iw2v:iw2v+nm1) & - + norm_u(iw2:iw2+nm1)*( & + + const_u*norm_u(iw2:iw2+nm1)*( & - p2t(ij:ij+nm1, ndf_w2h+df, 1)*t_col(0:nm1) & - p2t(ij:ij+nm1, ndf_w2h+df, 2)*t_col(1:nm1+1) & - grad(ij:ij+nm1, ndf_w2h+df, 1)*exner(iw3:iw3+nm1)) @@ -238,7 +251,7 @@ subroutine apply_mixed_operator_code(cell, & - p3t(ij:ij+nm1, 1, 1)*t_col(0:nm1) & - p3t(ij:ij+nm1, 1, 2)*t_col(1:nm1+1) do df = 1, ndf_w2 - lhs_p(iw3:iw3+nm1) = lhs_p(iw3:iw3+nm1) + q32(ij:ij+nm1, 1, df)*u_e(:,df) + lhs_p(iw3:iw3+nm1) = lhs_p(iw3:iw3+nm1) + const_r*q32(ij:ij+nm1, 1, df)*u_e(:,df) end do end subroutine apply_mixed_operator_code diff --git a/science/gungho/source/kernel/solver/apply_mixed_u_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_mixed_u_operator_kernel_mod.F90 index fb51ad1199..4668a98d74 100644 --- a/science/gungho/source/kernel/solver/apply_mixed_u_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_mixed_u_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (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. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the LHS of the semi-implicit system for the horizontal velocity: @@ -13,6 +15,7 @@ module apply_mixed_u_operator_kernel_mod GH_FIELD, GH_OPERATOR, & GH_READ, & GH_WRITE, & + GH_SCALAR, & GH_REAL, CELL_COLUMN use constants_mod, only : r_solver, i_def use kernel_mod, only : kernel_type @@ -27,14 +30,15 @@ module apply_mixed_u_operator_kernel_mod type, public, extends(kernel_type) :: apply_mixed_u_operator_kernel_type private - type(arg_type) :: meta_args(7) = (/ & + type(arg_type) :: meta_args(8) = (/ & arg_type(GH_FIELD, GH_REAL, GH_WRITE, W2broken), & ! lhs_uv arg_type(GH_FIELD, GH_REAL, GH_READ, W2h), & ! uv' arg_type(GH_FIELD, GH_REAL, GH_READ, W2v), & ! w' arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & ! exner' arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W2), & ! Mu^{c,d} arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & ! grad - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & ! norm_u + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! norm_u + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_u /) integer :: operates_on = CELL_COLUMN contains @@ -60,6 +64,8 @@ module apply_mixed_u_operator_kernel_mod !> @param[in] ncell2 Total number of cells for the grad operator !> @param[in] grad Generalised gradient operator for the momentum equation !> @param[in] norm_u Normalisation field for the momentum equation +!> @param[in] const_u tau_u*dt*cp scaling constant applied to the pressure +!! gradient (grad) contribution to the momentum equation !> @param[in] ndf_w2hb number of degrees of freedom per cell for the broken horizontal wind space !> @param[in] undf_w2hb unique number of degrees of freedom for the broken horizontal wind space !> @param[in] map_w2hb dofmap for the cell at the base of the column for the broken horizontal wind space @@ -83,6 +89,7 @@ subroutine apply_mixed_u_operator_code(cell, & ncell1, mu_cd, & ncell2, grad, & norm_u, & + const_u, & ndf_w2hb, undf_w2hb, map_w2hb, & ndf_w2h, undf_w2h, map_w2h, & ndf_w2v, undf_w2v, map_w2v, & @@ -111,6 +118,7 @@ subroutine apply_mixed_u_operator_code(cell, & real(kind=r_solver), dimension(undf_w2v), intent(in) :: wind_w real(kind=r_solver), dimension(undf_w2), intent(in) :: norm_u real(kind=r_solver), dimension(undf_w3), intent(in) :: exner + real(kind=r_solver), intent(in) :: const_u ! Operators real(kind=r_solver), dimension(ncell1, ndf_w2, ndf_w2), intent(in) :: mu_cd @@ -130,7 +138,7 @@ subroutine apply_mixed_u_operator_code(cell, & do df = 1, ndf_w2h iw2h = map_w2hb(df) iw2 = map_w2(df) - lhs_uv(iw2h:iw2h+nm1) = - norm_u(iw2:iw2+nm1) & + lhs_uv(iw2h:iw2h+nm1) = - const_u*norm_u(iw2:iw2+nm1) & *grad(ij:ij+nm1, df, 1)*exner(iw3:iw3+nm1) end do do df2 = 1, ndf_w2h diff --git a/science/gungho/source/kernel/solver/apply_mixed_wp_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_mixed_wp_operator_kernel_mod.F90 index afa1f1f7df..4d9b31d94d 100644 --- a/science/gungho/source/kernel/solver/apply_mixed_wp_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_mixed_wp_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (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. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the LHS of the semi-implicit system for the @@ -15,6 +17,7 @@ module apply_mixed_wp_operator_kernel_mod GH_FIELD, GH_OPERATOR, & GH_READ, & GH_WRITE, & + GH_SCALAR, & GH_REAL, CELL_COLUMN use constants_mod, only : r_solver, i_def use kernel_mod, only : kernel_type @@ -28,7 +31,7 @@ module apply_mixed_wp_operator_kernel_mod !------------------------------------------------------------------------------- type, public, extends(kernel_type) :: apply_mixed_wp_operator_kernel_type private - type(arg_type) :: meta_args(14) = (/ & + type(arg_type) :: meta_args(17) = (/ & arg_type(GH_FIELD, GH_REAL, GH_WRITE, W2v), & ! lhs_w arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & ! lhs_p arg_type(GH_FIELD, GH_REAL, GH_READ, W2h), & ! uv' @@ -41,8 +44,11 @@ module apply_mixed_wp_operator_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & ! grad arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! norm_u arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! m3p - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! q32 - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta) & ! p3t + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! q32_rho + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta), & ! p3t + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! const_u + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! const_t + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! const_r /) integer :: operates_on = CELL_COLUMN contains @@ -76,10 +82,20 @@ module apply_mixed_wp_operator_kernel_mod !> @param[in] norm_u Normalisation field for the momentum equation !> @param[in] ncell4 Total number of cells for the m3p operator !> @param[in] m3p Weighted mass matrix for the W3 space -!> @param[in] ncell5 Total number of cells for the q32 operator -!> @param[in] q32 Projection operator from W2 to W3 +!> @param[in] ncell5 Total number of cells for the q32_rho operator +!> @param[in] q32_rho Projection operator from W2 to W3 (density +!! contribution to Q32; the theta contribution +!! arrives via p3t*t_col, since t_col already +!! carries the tau_t*dt scaling) !> @param[in] ncell6 Total number of cells for the p3t operator !> @param[in] p3t Projection operator from W2 to Wtheta +!> @param[in] const_u tau_u*dt*cp scaling constant applied to the pressure +!! gradient (grad) and potential temperature projection +!! (P2theta) contributions to the vertical momentum equation +!> @param[in] const_t tau_t*dt scaling constant applied to the eliminated +!! potential temperature increment t = -Mt^-1*Pt2*u +!> @param[in] const_r tau_r*dt scaling constant applied to the Q32 +!! (density) contribution to the equation of state !> @param[in] ndf_w2v Number of degrees of freedom per cell for the vertical wind space !> @param[in] undf_w2v Unique number of degrees of freedom for the vertical wind space !> @param[in] map_w2v Dofmap for the cell at the base of the column for the vertical wind space @@ -110,8 +126,9 @@ subroutine apply_mixed_wp_operator_code(cell, & ncell3, grad, & norm_u, & ncell4, m3p, & - ncell5, q32, & + ncell5, q32_rho, & ncell6, p3t, & + const_u, const_t, const_r, & ndf_w2v, undf_w2v, map_w2v, & ndf_w3, undf_w3, map_w3, & ndf_w2h, undf_w2h, map_w2h, & @@ -143,6 +160,7 @@ subroutine apply_mixed_wp_operator_code(cell, & real(kind=r_solver), dimension(undf_w2), intent(in) :: norm_u real(kind=r_solver), dimension(undf_wt), intent(in) :: mt_lumped_inv real(kind=r_solver), dimension(undf_w3), intent(in) :: exner + real(kind=r_solver), intent(in) :: const_u, const_t, const_r ! Operators real(kind=r_solver), dimension(ncell0, ndf_wt, ndf_w2), intent(in) :: pt2 @@ -150,7 +168,7 @@ subroutine apply_mixed_wp_operator_code(cell, & real(kind=r_solver), dimension(ncell2, ndf_w2, ndf_wt), intent(in) :: p2t real(kind=r_solver), dimension(ncell3, ndf_w2, ndf_w3), intent(in) :: grad real(kind=r_solver), dimension(ncell4, ndf_w3, ndf_w3), intent(in) :: m3p - real(kind=r_solver), dimension(ncell5, ndf_w3, ndf_w2), intent(in) :: q32 + real(kind=r_solver), dimension(ncell5, ndf_w3, ndf_w2), intent(in) :: q32_rho real(kind=r_solver), dimension(ncell6, ndf_w3, ndf_wt), intent(in) :: p3t ! Internal variables @@ -182,7 +200,7 @@ subroutine apply_mixed_wp_operator_code(cell, & t_col(0:nm1) = t_col(0:nm1) - pt2(ij:ij+nm1, 1, df)*u_e(:,df) t_col(1:nm1+1) = t_col(1:nm1+1) - pt2(ij:ij+nm1, 2, df)*u_e(:,df) end do - t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) + t_col(:) = t_col(:) * mt_lumped_inv(iwt:iwt+1+nm1) * const_t ! LHS W iw2v = map_w2v(1) @@ -192,7 +210,7 @@ subroutine apply_mixed_wp_operator_code(cell, & iw2v = map_w2v(df) iw2 = map_w2(ndf_w2h+df) lhs_w(iw2v:iw2v+nm1) = lhs_w(iw2v:iw2v+nm1) & - + norm_u(iw2:iw2+nm1)*( & + + const_u*norm_u(iw2:iw2+nm1)*( & - p2t(ij:ij+nm1, ndf_w2h+df, 1)*t_col(0:nm1) & - p2t(ij:ij+nm1, ndf_w2h+df, 2)*t_col(1:nm1+1) & - grad(ij:ij+nm1, ndf_w2h+df, 1)*exner(iw3:iw3+nm1)) @@ -217,7 +235,7 @@ subroutine apply_mixed_wp_operator_code(cell, & - p3t(ij:ij+nm1, 1, 1)*t_col(0:nm1) & - p3t(ij:ij+nm1, 1, 2)*t_col(1:nm1+1) do df = 1, ndf_w2 - lhs_p(iw3:iw3+nm1) = lhs_p(iw3:iw3+nm1) + q32(ij:ij+nm1, 1, df)*u_e(:,df) + lhs_p(iw3:iw3+nm1) = lhs_p(iw3:iw3+nm1) + const_r*q32_rho(ij:ij+nm1, 1, df)*u_e(:,df) end do end subroutine apply_mixed_wp_operator_code diff --git a/science/gungho/source/kernel/solver/apply_variable_hx_kernel_mod.F90 b/science/gungho/source/kernel/solver/apply_variable_hx_kernel_mod.F90 index 7ae7346f25..d97fe736b7 100644 --- a/science/gungho/source/kernel/solver/apply_variable_hx_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/apply_variable_hx_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (C) Crown copyright 2017 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 Create unit test for this kernel, see #2935 @@ -26,7 +28,7 @@ module apply_variable_hx_kernel_mod type, public, extends(kernel_type) :: apply_variable_hx_kernel_type private - type(arg_type) :: meta_args(9) = (/ & + type(arg_type) :: meta_args(10) = (/ & arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & @@ -35,6 +37,7 @@ module apply_variable_hx_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta), & arg_type(GH_OPERATOR, GH_REAL, GH_READ, Wtheta, W2), & arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & + arg_type(GH_SCALAR, GH_REAL, GH_READ), & arg_type(GH_SCALAR, GH_REAL, GH_READ) & /) integer :: operates_on = CELL_COLUMN @@ -76,7 +79,9 @@ module apply_variable_hx_kernel_mod !> @param[in] pt2 Mapping from velocity space to temperature space !> @param[in] ncell_3d_4 Total number of cells for m3 matrix !> @param[in] m3 Mass matrix for the pressure space -!> @param[in] sgn +/- 1 Weight +!> @param[in] const_div Scaling constant (tau_r*dt) applied to the divergence term +!> @param[in] const_theta Scaling constant (tau_t*dt) applied to the potential +!! temperature term !> @param[in] ndf_w3 Number of degrees of freedom per cell for the pressure space !> @param[in] undf_w3 Unique number of degrees of freedom for the pressure space !> @param[in] map_w3 Dofmap for the cell at the base of the column for the pressure space @@ -102,7 +107,8 @@ subroutine apply_variable_hx_code_r_double(cell, & pt2, & ncell_3d_4, & m3, & - sgn, & + const_div, & + const_theta, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2, & ndf_wt, undf_wt, map_wt) @@ -124,7 +130,8 @@ subroutine apply_variable_hx_code_r_double(cell, & real(kind=r_double), dimension(undf_wt), intent(in) :: mt_inv real(kind=r_double), dimension(undf_w3), intent(inout) :: lhs real(kind=r_double), dimension(undf_w3), intent(in) :: pressure - real(kind=r_double), intent(in) :: sgn + real(kind=r_double), intent(in) :: const_div + real(kind=r_double), intent(in) :: const_theta real(kind=r_double), dimension(ncell_3d_1,ndf_w3,ndf_w2), intent(in) :: div real(kind=r_double), dimension(ncell_3d_2,ndf_wt,ndf_w2), intent(in) :: pt2 @@ -173,7 +180,8 @@ subroutine apply_variable_hx_code_r_double(cell, & ik = (cell-1)*nlayers + k + 1 - lhs_e = matmul(m3(ik,:,:),p_e) + sgn*(matmul(div(ik,:,:),x_e) + matmul(p3t(ik,:,:),t_e)) + lhs_e = matmul(m3(ik,:,:),p_e) + const_div*matmul(div(ik,:,:),x_e) & + + const_theta*matmul(p3t(ik,:,:),t_e) do df = 1,ndf_w3 lhs(map_w3(df)+k) = lhs_e(df) end do @@ -197,7 +205,8 @@ subroutine apply_variable_hx_code_r_single(cell, & pt2, & ncell_3d_4, & m3, & - sgn, & + const_div, & + const_theta, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2, & ndf_wt, undf_wt, map_wt) @@ -219,7 +228,8 @@ subroutine apply_variable_hx_code_r_single(cell, & real(kind=r_single), dimension(undf_wt), intent(in) :: mt_inv real(kind=r_single), dimension(undf_w3), intent(inout) :: lhs real(kind=r_single), dimension(undf_w3), intent(in) :: pressure - real(kind=r_single), intent(in) :: sgn + real(kind=r_single), intent(in) :: const_div + real(kind=r_single), intent(in) :: const_theta real(kind=r_single), dimension(ncell_3d_1,ndf_w3,ndf_w2), intent(in) :: div real(kind=r_single), dimension(ncell_3d_2,ndf_wt,ndf_w2), intent(in) :: pt2 @@ -268,7 +278,8 @@ subroutine apply_variable_hx_code_r_single(cell, & ik = (cell-1)*nlayers + k + 1 - lhs_e = matmul(m3(ik,:,:),p_e) + sgn*(matmul(div(ik,:,:),x_e) + matmul(p3t(ik,:,:),t_e)) + lhs_e = matmul(m3(ik,:,:),p_e) + const_div*matmul(div(ik,:,:),x_e) & + + const_theta*matmul(p3t(ik,:,:),t_e) do df = 1,ndf_w3 lhs(map_w3(df)+k) = lhs_e(df) end do diff --git a/science/gungho/source/kernel/solver/elim_helmholtz_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/elim_helmholtz_operator_kernel_mod.F90 index 3714e8bf07..ebc3de79c3 100644 --- a/science/gungho/source/kernel/solver/elim_helmholtz_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/elim_helmholtz_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the coefficients of the Helmholz operator for lowest-order @@ -22,6 +24,7 @@ module elim_helmholtz_operator_kernel_mod use argument_mod, only : arg_type, & GH_FIELD, GH_OPERATOR, & + GH_SCALAR, & GH_REAL, GH_READ, GH_WRITE, & STENCIL, CROSS, CELL_COLUMN use constants_mod, only : i_def, r_solver @@ -38,15 +41,18 @@ module elim_helmholtz_operator_kernel_mod type, public, extends(kernel_type) :: elim_helmholtz_operator_kernel_type private - type(arg_type) :: meta_args(8) = (/ & + type(arg_type) :: meta_args(11) = (/ & arg_type(GH_FIELD*9, GH_REAL, GH_WRITE, W3), & ! Helmholtz operator arg_type(GH_FIELD, GH_REAL, GH_READ, W2, STENCIL(CROSS)), & ! hb_lumped_inv arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! u_normalisation arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & ! div_star arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! M3_exner - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! Q32 - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! M3^-1 - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & ! W2 mask + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! Q32_rho + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! Q32_theta + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! W2 mask + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! tau_u*dt*cp + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! tau_r*dt + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! tau_t*dt /) integer :: operates_on = CELL_COLUMN contains @@ -84,9 +90,19 @@ module elim_helmholtz_operator_kernel_mod !> @param[in] div_star Weighted transpose of the divergence operator !> @param[in] ncell_3d_2 Total number of cells for m3_exner_star matrix !> @param[in] m3_exner_star Weighted W3 mass matrix -!> @param[in] ncell_3d_3 Total number of cells for q32 matrix -!> @param[in] q32 Weighted projection operator from W2 to W3 +!> @param[in] ncell_3d_3 Total number of cells for q32_rho matrix +!> @param[in] q32_rho Weighted projection operator from W2 to W3 +!! (compound_div contribution) +!> @param[in] ncell_3d_4 Total number of cells for q32_theta matrix +!> @param[in] q32_theta Projection operator from W2 to W3 from +!! eliminating theta !> @param[in] w2_mask LAM mask for W2 space +!> @param[in] tau_u_dt_cp Off-centring weight tau_u multiplied by the +!! timestep and cp, applied to div_star +!> @param[in] tau_r_dt Off-centring weight tau_r multiplied by the +!! timestep, applied to q32_rho +!> @param[in] tau_t_dt Off-centring weight tau_t multiplied by the +!! timestep, applied to q32_theta !> @param[in] ndf_w3 Number of degrees of freedom per cell for the pressure space !> @param[in] undf_w3 Unique number of degrees of freedom for the pressure space !> @param[in] map_w3 Dofmap for the cell at the base of the column for the pressure space @@ -107,8 +123,11 @@ subroutine elim_helmholtz_operator_code(stencil_size, & ncell_3d_2, & m3_exner_star, & ncell_3d_3, & - q32, & + q32_rho, & + ncell_3d_4, & + q32_theta, & w2_mask, & + tau_u_dt_cp, tau_r_dt, tau_t_dt, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2) @@ -119,7 +138,7 @@ subroutine elim_helmholtz_operator_code(stencil_size, & integer(kind=i_def), intent(in) :: stencil_size integer(kind=i_def), dimension(stencil_size), intent(in) :: cell_stencil integer(kind=i_def), intent(in) :: ncell_3d_1, ncell_3d_2, & - ncell_3d_3 + ncell_3d_3, ncell_3d_4 integer(kind=i_def), intent(in) :: undf_w2, ndf_w2 integer(kind=i_def), intent(in) :: undf_w3, ndf_w3 integer(kind=i_def), intent(in) :: smap_size_w2 @@ -138,7 +157,11 @@ subroutine elim_helmholtz_operator_code(stencil_size, & ! Operators real(kind=r_solver), dimension(ncell_3d_1, ndf_w2, ndf_w3), intent(in) :: div_star real(kind=r_solver), dimension(ncell_3d_2, ndf_w3, ndf_w3), intent(in) :: m3_exner_star - real(kind=r_solver), dimension(ncell_3d_3, ndf_w3, ndf_w2), intent(in) :: q32 + real(kind=r_solver), dimension(ncell_3d_3, ndf_w3, ndf_w2), intent(in) :: q32_rho + real(kind=r_solver), dimension(ncell_3d_4, ndf_w3, ndf_w2), intent(in) :: q32_theta + + ! Scalars + real(kind=r_solver), intent(in) :: tau_u_dt_cp, tau_r_dt, tau_t_dt ! Internal variables integer(kind=i_def) :: k, ik, kk, df, e, stencil_ik @@ -282,7 +305,8 @@ subroutine elim_helmholtz_operator_code(stencil_size, & a_op(df,:,e-1) = -u_normalisation(smap_w2(df,e)+k) & *w2_mask(smap_w2(df,e)+k) & *hb_lumped_inv(smap_w2(df,e)+k) & - *div_star(stencil_ik,df,:) + *div_star(stencil_ik,df,:) & + *tau_u_dt_cp end do ! Vertical stencil: @@ -303,14 +327,16 @@ subroutine elim_helmholtz_operator_code(stencil_size, & kk = -1 if ( k > 0 ) then a_op(df,:,down) = -u_normalisation(map_w2(df)+k+kk)*w2_mask(map_w2(df)+k+kk) & - *hb_lumped_inv(map_w2(df)+k+kk)*div_star(ik+kk,df,:) + *hb_lumped_inv(map_w2(df)+k+kk)*div_star(ik+kk,df,:) & + *tau_u_dt_cp else a_op(df,:,down) = 0.0_r_solver end if kk = 1 if ( k < nlayers-1 ) then a_op(df,:,up) = -u_normalisation(map_w2(df)+k+kk)*w2_mask(map_w2(df)+k+kk) & - *hb_lumped_inv(map_w2(df)+k+kk)*div_star(ik+kk,df,:) + *hb_lumped_inv(map_w2(df)+k+kk)*div_star(ik+kk,df,:) & + *tau_u_dt_cp else a_op(df,:,up) = 0.0_r_solver end if @@ -324,8 +350,9 @@ subroutine elim_helmholtz_operator_code(stencil_size, & ! Compute B for all cells in the stencil, ! B maps from W2 points to W3 points and we only need it for the central - ! cell. - b_op = q32(ik,:,:) + ! cell. Q32 comprises a compound_div contribution (weighted by tau_r*dt) + ! and a theta-elimination contribution (weighted by tau_t*dt). + b_op = tau_r_dt*q32_rho(ik,:,:) + tau_t_dt*q32_theta(ik,:,:) ! Compute C for all cells in the stencil, ! C maps from W3 points to W3 points and we only need it for the central diff --git a/science/gungho/source/kernel/solver/eliminated_theta_q22_kernel_mod.F90 b/science/gungho/source/kernel/solver/eliminated_theta_q22_kernel_mod.F90 index a477811062..da95c7edc9 100644 --- a/science/gungho/source/kernel/solver/eliminated_theta_q22_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/eliminated_theta_q22_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the q22 matrix for analytic elimination of theta. The family @@ -18,7 +20,7 @@ module eliminated_theta_q22_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_REAL, GH_SCALAR, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, & @@ -45,14 +47,13 @@ module eliminated_theta_q22_kernel_mod type, public, extends(kernel_type) :: eliminated_theta_q22_kernel_type private - type(arg_type) :: meta_args(7) = (/ & + type(arg_type) :: meta_args(6) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & arg_type(GH_FIELD*3, GH_REAL, GH_READ, ANY_SPACE_9), & - arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_3) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS), & @@ -86,7 +87,6 @@ module eliminated_theta_q22_kernel_mod !> @param[in] chi2 Second component of the coordinate array !> @param[in] chi3 Third component of the coordinate array !> @param[in] panel_id Field containing the panel ID indicator -!> @param[in] const Scalar constant to multiply operator by !> @param[in] ndf_w2 Number of degrees of freedom per cell for the velocity space !> @param[in] undf_w2 Total number of degrees of freedom for the velocity space !> @param[in] map_w2 Dofmap for the bottom layer in the velocity space @@ -112,7 +112,6 @@ subroutine eliminated_theta_q22_code(cell, nlayers, ncell_3d, & theta, exner, norm_u, & chi1, chi2, chi3, & panel_id, & - const, & ndf_w2, undf_w2, map_w2, & basis_w2, & ndf_wt, undf_wt, map_wt, & @@ -148,7 +147,6 @@ subroutine eliminated_theta_q22_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(undf_wt), intent(in) :: theta, exner real(kind=r_solver), dimension(undf_w2), intent(in) :: norm_u real(kind=r_def), dimension(undf_pid), intent(in) :: panel_id - real(kind=r_solver), intent(in) :: const real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -201,7 +199,7 @@ subroutine eliminated_theta_q22_code(cell, nlayers, ncell_3d, & wt_dj = real(wqp_h(qp1)*wqp_v(qp2)/dj(qp1,qp2), r_solver) do df2 = 1, ndf_w2 - grad_term = wt_dj * const & + grad_term = wt_dj & *dot_product(grad_theta(:), rsol_basis_w2(:,df2,qp1,qp2)) & *grad_exner do df = 1, ndf_w2 diff --git a/science/gungho/source/kernel/solver/eliminated_theta_q2t_kernel_mod.F90 b/science/gungho/source/kernel/solver/eliminated_theta_q2t_kernel_mod.F90 index efb513abb6..d6f9b0057e 100644 --- a/science/gungho/source/kernel/solver/eliminated_theta_q2t_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/eliminated_theta_q2t_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the q2t matrix for analytic elimination of theta by Galerkin Projection. @@ -17,7 +19,7 @@ module eliminated_theta_q2t_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_REAL, GH_SCALAR, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -35,11 +37,10 @@ module eliminated_theta_q2t_kernel_mod type, public, extends(kernel_type) :: eliminated_theta_q2t_kernel_type private - type(arg_type) :: meta_args(4) = (/ & + type(arg_type) :: meta_args(3) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, Wtheta), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta) & /) type(func_type) :: meta_funcs(2) = (/ & func_type(W2, GH_BASIS), & @@ -66,7 +67,6 @@ module eliminated_theta_q2t_kernel_mod !> @param[in,out] q2t_op Projection matrix !> @param[in] norm_u Normalisation for the momentum equation !> @param[in] exner Exner pressure in Wtheta space -!> @param[in] const Constant scalar to multiply operator by !> @param[in] ndf_w2 Degrees of freedom per cell for the velocity space !> @param[in] undf_w2 Total degrees of freedom for the velocity space !> @param[in] map_w2 Cell dofmap for the velocity space @@ -86,7 +86,6 @@ module eliminated_theta_q2t_kernel_mod subroutine eliminated_theta_q2t_code(cell, nlayers, ncell_3d, & q2t_op, & norm_u, exner, & - const, & ndf_w2, undf_w2, map_w2, & basis_w2, & ndf_wt, undf_wt, map_wt, & @@ -112,7 +111,6 @@ subroutine eliminated_theta_q2t_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(undf_wt), intent(in) :: exner real(kind=r_solver), dimension(undf_w2), intent(in) :: norm_u - real(kind=r_solver), intent(in) :: const real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -145,7 +143,7 @@ subroutine eliminated_theta_q2t_code(cell, nlayers, ncell_3d, & wt = real(wqp_h(qp1) * wqp_v(qp2), r_solver) do dft = 1, ndf_wt - integrand = wt * const & + integrand = wt & * dexnerdz_q * rsol_basis_wt(1,dft,qp1,qp2) do df2 = 1, ndf_w2 q2t_op(ik,df2,dft) = q2t_op(ik,df2,dft) & diff --git a/science/gungho/source/kernel/solver/helmholtz_operator_kernel_mod.F90 b/science/gungho/source/kernel/solver/helmholtz_operator_kernel_mod.F90 index a2807f0103..2f9fd2ea5a 100644 --- a/science/gungho/source/kernel/solver/helmholtz_operator_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/helmholtz_operator_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the coefficients of the Helmholtz operator for lowest-order @@ -20,6 +22,7 @@ module helmholtz_operator_kernel_mod use argument_mod, only : arg_type, & GH_FIELD, GH_OPERATOR, & + GH_SCALAR, & GH_REAL, GH_READ, GH_WRITE, & STENCIL, CROSS2D, CELL_COLUMN use constants_mod, only : i_def, r_solver @@ -36,7 +39,7 @@ module helmholtz_operator_kernel_mod type, public, extends(kernel_type) :: helmholtz_operator_kernel_type private - type(arg_type) :: meta_args(10) = (/ & + type(arg_type) :: meta_args(13) = (/ & arg_type(GH_FIELD*9, GH_REAL, GH_WRITE, W3), & ! Helmholtz operator arg_type(GH_FIELD, GH_REAL, GH_READ, W2, STENCIL(CROSS2D)), & ! hb_lumped_inv arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! u_normalisation @@ -46,7 +49,10 @@ module helmholtz_operator_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W2), & ! compound_div arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & ! M3_exner arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, Wtheta), & ! p3theta - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & ! W2 mask + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & ! W2 mask + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! tau_u*dt*cp + arg_type(GH_SCALAR, GH_REAL, GH_READ), & ! tau_t*dt + arg_type(GH_SCALAR, GH_REAL, GH_READ) & ! tau_r*dt /) integer :: operates_on = CELL_COLUMN contains @@ -96,6 +102,12 @@ module helmholtz_operator_kernel_mod !> @param[in] ncell_3d_5 Total number of cells for p3theta matrix !> @param[in] p3theta Weighted projection operator from Wtheta to W3 !> @param[in] w2_mask LAM mask for W2 space +!> @param[in] tau_u_dt_cp Off-centring weight tau_u multiplied by the +!! timestep and cp, applied to div_star +!> @param[in] tau_t_dt Off-centring weight tau_t multiplied by the +!! timestep, applied to ptheta2v +!> @param[in] tau_r_dt Off-centring weight tau_r multiplied by the +!! timestep, applied to compound_div !> @param[in] ndf_w3 Number of degrees of freedom per cell for the pressure space !> @param[in] undf_w3 Unique number of degrees of freedom for the pressure space !> @param[in] map_w3 Dofmap for the cell at the base of the column for the pressure space @@ -126,6 +138,7 @@ subroutine helmholtz_operator_code(stencil_size, & ncell_3d_5, & p3theta, & w2_mask, & + tau_u_dt_cp, tau_t_dt, tau_r_dt, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2, & ndf_wt, undf_wt, map_wt) @@ -158,6 +171,9 @@ subroutine helmholtz_operator_code(stencil_size, & w2_mask real(kind=r_solver), dimension(undf_wt), intent(in) :: mt_lumped_inv + ! Scalars + real(kind=r_solver), intent(in) :: tau_u_dt_cp, tau_t_dt, tau_r_dt + ! Operators real(kind=r_solver), dimension(ncell_3d_1, ndf_w2, ndf_w3), intent(in) :: div_star real(kind=r_solver), dimension(ncell_3d_2, ndf_w3, ndf_w2), intent(in) :: compound_div @@ -446,6 +462,9 @@ subroutine helmholtz_operator_code(stencil_size, & if ( k == nlayers - 2 ) a_op(up,:,up) = 0.0_r_solver if ( k == nlayers - 1 ) a_op(up,:,centre:north) = 0.0_r_solver + ! Apply the tau_u*dt*cp weighting associated with div_star + a_op(:,:,:) = tau_u_dt_cp*a_op(:,:,:) + ! Compute B for all cells in the stencil ! B maps from W2v -> Wtheta points ! and we need it for the k-1,k,k+1 cells @@ -478,10 +497,12 @@ subroutine helmholtz_operator_code(stencil_size, & b_op(df,:, 1) = 0.0_r_solver end if end do + ! Apply the tau_t*dt weighting associated with ptheta2v + b_op(:,:,:) = tau_t_dt*b_op(:,:,:) ! Compute E*C for all cells in the stencil, ! EC maps from W2 points to W3 points and we only need it for the central ! cell. - ec_op = - compound_div(ik,:,:) + ec_op = - tau_r_dt*compound_div(ik,:,:) ! Compute D for all cells in the stencil, ! D maps from Wtheta points to W3 points and we only need it for the diff --git a/science/gungho/source/kernel/solver/opt_apply_variable_hx_kernel_mod.F90 b/science/gungho/source/kernel/solver/opt_apply_variable_hx_kernel_mod.F90 index 1b525436b2..40adba0d85 100644 --- a/science/gungho/source/kernel/solver/opt_apply_variable_hx_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/opt_apply_variable_hx_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (C) Crown copyright 2017 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 Create unit test for this kernel, see #2935 @@ -26,7 +28,7 @@ module opt_apply_variable_hx_kernel_mod type, public, extends(kernel_type) :: opt_apply_variable_hx_kernel_type private - type(arg_type) :: meta_args(10) = (/ & + type(arg_type) :: meta_args(11) = (/ & arg_type(GH_FIELD, GH_REAL, GH_WRITE, W3), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & @@ -36,6 +38,7 @@ module opt_apply_variable_hx_kernel_mod arg_type(GH_OPERATOR, GH_REAL, GH_READ, Wtheta, W2), & arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & arg_type(GH_SCALAR, GH_REAL, GH_READ), & + arg_type(GH_SCALAR, GH_REAL, GH_READ), & arg_type(GH_FIELD, GH_REAL, GH_READ, W3) & /) integer :: operates_on = CELL_COLUMN @@ -79,7 +82,9 @@ module opt_apply_variable_hx_kernel_mod !> @param[in] pt2 Mapping from velocity space to temperature space !> @param[in] ncell_3d_4 Total number of cells for m3 matrix !> @param[in] m3 Mass matrix for the pressure space -!> @param[in] sgn +/- 1 Weight +!> @param[in] const_div Scaling constant (sgn*tau_r*dt) applied to the divergence term +!> @param[in] const_theta Scaling constant (sgn*tau_t*dt) applied to the potential +!! temperature term !> @param[in] rhs_p Pressure field in w3 !> @param[in] ndf_w3 Number of degrees of freedom per cell for the pressure space !> @param[in] undf_w3 Unique number of degrees of freedom for the pressure space @@ -106,7 +111,8 @@ subroutine opt_apply_variable_hx_code_r_double(cell, & pt2, & ncell_3d_4, & m3, & - sgn, & + const_div, & + const_theta, & rhs_p, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2, & @@ -129,7 +135,8 @@ subroutine opt_apply_variable_hx_code_r_double(cell, & real(kind=r_double), dimension(undf_wt), intent(in) :: mt_inv real(kind=r_double), dimension(undf_w3), intent(inout) :: lhs real(kind=r_double), dimension(undf_w3), intent(in) :: pressure - real(kind=r_double), intent(in) :: sgn + real(kind=r_double), intent(in) :: const_div + real(kind=r_double), intent(in) :: const_theta real(kind=r_double), dimension(undf_w3), intent(in) :: rhs_p real(kind=r_double), dimension(ncell_3d_1,1,6), intent(in) :: div @@ -179,7 +186,7 @@ subroutine opt_apply_variable_hx_code_r_double(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + (t_e(1) + t_e(2))) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e(1) + t_e(2)) + rhs_p(map_w3(1)+k) do k = 1,nlayers-2 ik = (cell-1)*nlayers + k + 1 @@ -199,7 +206,7 @@ subroutine opt_apply_variable_hx_code_r_double(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + t_e1_vec(k) + t_e2_vec(k)) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e1_vec(k) + t_e2_vec(k)) + rhs_p(map_w3(1)+k) end do k = nlayers-1 @@ -215,7 +222,7 @@ subroutine opt_apply_variable_hx_code_r_double(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + (t_e(1) + t_e(2))) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e(1) + t_e(2)) + rhs_p(map_w3(1)+k) end subroutine opt_apply_variable_hx_code_r_double @@ -234,7 +241,8 @@ subroutine opt_apply_variable_hx_code_r_single(cell, & pt2, & ncell_3d_4, & m3, & - sgn, & + const_div, & + const_theta, & rhs_p, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2, & @@ -257,7 +265,8 @@ subroutine opt_apply_variable_hx_code_r_single(cell, & real(kind=r_single), dimension(undf_wt), intent(in) :: mt_inv real(kind=r_single), dimension(undf_w3), intent(inout) :: lhs real(kind=r_single), dimension(undf_w3), intent(in) :: pressure - real(kind=r_single), intent(in) :: sgn + real(kind=r_single), intent(in) :: const_div + real(kind=r_single), intent(in) :: const_theta real(kind=r_single), dimension(undf_w3), intent(in) :: rhs_p real(kind=r_single), dimension(ncell_3d_1,1,6), intent(in) :: div @@ -307,7 +316,7 @@ subroutine opt_apply_variable_hx_code_r_single(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + (t_e(1) + t_e(2))) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e(1) + t_e(2)) + rhs_p(map_w3(1)+k) do k = 1,nlayers-2 ik = (cell-1)*nlayers + k + 1 @@ -327,7 +336,7 @@ subroutine opt_apply_variable_hx_code_r_single(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + t_e1_vec(k) + t_e2_vec(k)) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e1_vec(k) + t_e2_vec(k)) + rhs_p(map_w3(1)+k) end do k = nlayers-1 @@ -343,7 +352,7 @@ subroutine opt_apply_variable_hx_code_r_single(cell, & + div(ik,1,3)*x(map_w23+k) + div(ik,1,4)*x(map_w24+k) & + div(ik,1,5)*x(map_w25+k) + div(ik,1,6)*x(map_w26+k) lhs(map_w31+k) = m3(ik,1,1)*pressure(map_w31+k) & - + sgn*(div_u + (t_e(1) + t_e(2))) + rhs_p(map_w3(1)+k) + + const_div*div_u + const_theta*(t_e(1) + t_e(2)) + rhs_p(map_w3(1)+k) end subroutine opt_apply_variable_hx_code_r_single diff --git a/science/gungho/source/kernel/solver/project_eliminated_theta_q32_kernel_mod.F90 b/science/gungho/source/kernel/solver/project_eliminated_theta_q32_kernel_mod.F90 index 0c99d11ae1..a48a07c07a 100644 --- a/science/gungho/source/kernel/solver/project_eliminated_theta_q32_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/project_eliminated_theta_q32_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the q32 matrix for analytic elimination of theta. The family @@ -17,7 +19,7 @@ module project_eliminated_theta_q32_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_REAL, GH_SCALAR, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -34,11 +36,10 @@ module project_eliminated_theta_q32_kernel_mod !--------------------------------------------------------------------------- type, public, extends(kernel_type) :: project_eliminated_theta_q32_kernel_type private - type(arg_type) :: meta_args(4) = (/ & + type(arg_type) :: meta_args(3) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_OPERATOR, GH_REAL, GH_READ, W3, W3) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W3, GH_BASIS), & @@ -64,11 +65,10 @@ module project_eliminated_theta_q32_kernel_mod !> @param[in] cell Horizontal cell index. !> @param[in] nlayers Number of layers !> @param[in] ncell_3d Number of cells in the 3D mesh -!> @param[in,out] q32_op Projection matrix +!> @param[in,out] q32_theta_op Contribution to q32 from eliminating theta !> @param[in] theta Potential temperature field !> @param[in] ncell_3d1 Number of cells in the 3D mesh !> @param[in] inv_m3 Inverse mass matrix for the W3 space -!> @param[in] const Constant scalar to multiply operator by !> @param[in] ndf_w3 Degrees of freedom per cell for the pressure space !> @param[in] basis_w3 Basis function for the pressure space !! evaluated on quadrature points @@ -87,10 +87,9 @@ module project_eliminated_theta_q32_kernel_mod !> @param[in] wqp_h Horizontal quadrature weights !> @param[in] wqp_v Vertical quadrature weights subroutine project_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & - q32_op, & + q32_theta_op, & theta, & ncell_3d1, inv_m3, & - const, & ndf_w3, basis_w3, & ndf_w2, basis_w2, & ndf_wt, undf_wt, map_wt, & @@ -112,11 +111,10 @@ subroutine project_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & real(kind=r_def), dimension(1, ndf_wt, nqp_h, nqp_v), intent(in) :: basis_wt real(kind=r_def), dimension(3, ndf_wt, nqp_h, nqp_v), intent(in) :: diff_basis_wt - real(kind=r_solver), dimension(ncell_3d, ndf_w3, ndf_w2), intent(inout) :: q32_op + real(kind=r_solver), dimension(ncell_3d, ndf_w3, ndf_w2), intent(inout) :: q32_theta_op real(kind=r_solver), dimension(ncell_3d1, ndf_w3, ndf_w3), intent(in) :: inv_m3 real(kind=r_solver), dimension(undf_wt), intent(in) :: theta - real(kind=r_solver), intent(in) :: const real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -154,7 +152,7 @@ subroutine project_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & dthetadz_q = max(1.0_r_solver, dthetadz_q) wt = real( wqp_h(qp1) * wqp_v(qp2), r_solver) do df2 = 1, ndf_w2 - integrand = wt * const & + integrand = wt & * dthetadz_q/theta_q * rsol_basis_w2(3,df2,qp1,qp2) do df = 1, ndf_w3 proj(df,df2) = proj(df,df2) + rsol_basis_w3(1,df,qp1,qp2)*integrand @@ -162,7 +160,7 @@ subroutine project_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & end do end do end do - q32_op(ik,:,:) = q32_op(ik,:,:) + matmul(inv_m3(ik,:,:), proj(:,:)) + q32_theta_op(ik,:,:) = matmul(inv_m3(ik,:,:), proj(:,:)) end do end subroutine project_eliminated_theta_q32_code diff --git a/science/gungho/source/kernel/solver/sample_eliminated_theta_q32_kernel_mod.F90 b/science/gungho/source/kernel/solver/sample_eliminated_theta_q32_kernel_mod.F90 index 6058ab1219..a7b5390dda 100644 --- a/science/gungho/source/kernel/solver/sample_eliminated_theta_q32_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/sample_eliminated_theta_q32_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> @brief Compute the q32 matrix for analytic elimination of theta. The family @@ -17,7 +19,7 @@ module sample_eliminated_theta_q32_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_REAL, GH_SCALAR, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_EVALUATOR @@ -34,11 +36,10 @@ module sample_eliminated_theta_q32_kernel_mod !--------------------------------------------------------------------------- type, public, extends(kernel_type) :: sample_eliminated_theta_q32_kernel_type private - type(arg_type) :: meta_args(4) = (/ & + type(arg_type) :: meta_args(3) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W3, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, W3) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W3, GH_BASIS), & @@ -64,10 +65,9 @@ module sample_eliminated_theta_q32_kernel_mod !> @param[in] cell Horizontal cell index. !> @param[in] nlayers Number of layers !> @param[in] ncell_3d Number of cells in the 3D mesh -!> @param[in,out] q32_op sampection matrix +!> @param[in,out] q32_theta_op Contribution to q32 from eliminating theta !> @param[in] theta Potential temperature field !> @param[in] detj_at_w3 Det J evaluated at W3 DoFs -!> @param[in] const Constant scalar to multiply operator by !> @param[in] ndf_w3 Degrees of freedom per cell for the pressure space !> @param[in] undf_w3 Total degrees of freedom for the pressure space !> @param[in] map_w3 Cell dofmap for the pressure space @@ -84,10 +84,9 @@ module sample_eliminated_theta_q32_kernel_mod !> @param[in] diff_basis_wt Differential basis function for the theta space !! evaluated at W3 DoFs subroutine sample_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & - q32_op, & + q32_theta_op, & theta, & detj_at_w3, & - const, & ndf_w3, undf_w3, & map_w3, basis_w3, & ndf_w2, basis_w2, & @@ -109,10 +108,9 @@ subroutine sample_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & real(kind=r_def), dimension(1, ndf_wt, ndf_w3), intent(in) :: basis_wt real(kind=r_def), dimension(3, ndf_wt, ndf_w3), intent(in) :: diff_basis_wt - real(kind=r_solver), dimension(ncell_3d, ndf_w3, ndf_w2), intent(inout) :: q32_op + real(kind=r_solver), dimension(ncell_3d, ndf_w3, ndf_w2), intent(inout) :: q32_theta_op real(kind=r_solver), dimension(undf_wt), intent(in) :: theta real(kind=r_solver), dimension(undf_w3), intent(in) :: detj_at_w3 - real(kind=r_solver), intent(in) :: const ! Internal variables integer(kind=i_def) :: df, df3, df2, dft, k, ik @@ -151,14 +149,14 @@ subroutine sample_eliminated_theta_q32_code(cell, nlayers, ncell_3d, & ! g/theta*dtheta/dz) is positive dthetadz_q = max(1.0_r_solver, dthetadz_q) do df2 = 1, ndf_w2 - prod = const* dthetadz_q/theta_q * rsol_basis_w2(3,df2,df) + prod = dthetadz_q/theta_q * rsol_basis_w2(3,df2,df) do df3 = 1, ndf_w3 samp(df3,df2) = samp(df3,df2) + rsol_basis_w3(1,df3,df)* prod/detj_e end do end do end do - ! Incrementally add sampled operator - q32_op(ik,:,:) = q32_op(ik,:,:) + samp(:,:) + ! Set the sampled operator + q32_theta_op(ik,:,:) = samp(:,:) end do end subroutine sample_eliminated_theta_q32_code diff --git a/science/gungho/source/kernel/solver/scaled_matrix_vector_kernel_mod.F90 b/science/gungho/source/kernel/solver/scaled_matrix_vector_kernel_mod.F90 index bd4b086988..1c9ded6bd7 100644 --- a/science/gungho/source/kernel/solver/scaled_matrix_vector_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/scaled_matrix_vector_kernel_mod.F90 @@ -6,7 +6,7 @@ module scaled_matrix_vector_kernel_mod - use argument_mod, only : arg_type, & + use argument_mod, only : arg_type, GH_SCALAR, & GH_FIELD, GH_OPERATOR, & GH_READ, GH_INC, & GH_REAL, CELL_COLUMN @@ -24,12 +24,13 @@ module scaled_matrix_vector_kernel_mod type, public, extends(kernel_type) :: scaled_matrix_vector_kernel_type private - type(arg_type) :: meta_args(5) = (/ & + type(arg_type) :: meta_args(6) = (/ & arg_type(GH_FIELD, GH_REAL, GH_INC, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & arg_type(GH_OPERATOR, GH_REAL, GH_READ, W2, W3), & arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & - arg_type(GH_FIELD, GH_REAL, GH_READ, W2) & + arg_type(GH_FIELD, GH_REAL, GH_READ, W2), & + arg_type(GH_SCALAR, GH_REAL, GH_READ) & /) integer :: operates_on = CELL_COLUMN contains @@ -53,6 +54,7 @@ module scaled_matrix_vector_kernel_mod !! @param[in] matrix Local matrix assembly form of the operator A !! @param[in] y Field to scale output by !! @param[in] z Second field to scale output by +!> @param[in] scalar Scalar to scale output by !! @param[in] ndf1 Number of degrees of freedom per cell for the output field !! @param[in] undf1 Unique number of degrees of freedom for the output field !! @param[in] map1 Dofmap for the cell at the base of the column for the output field @@ -66,6 +68,7 @@ subroutine scaled_matrix_vector_code(cell, & matrix, & y, & z, & + scalar, & ndf1, undf1, map1, & ndf2, undf2, map2) @@ -83,6 +86,7 @@ subroutine scaled_matrix_vector_code(cell, & real(kind=r_solver), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix real(kind=r_solver), dimension(undf1), intent(in) :: y real(kind=r_solver), dimension(undf1), intent(in) :: z + real(kind=r_solver), intent(in) :: scalar ! Internal variables integer(kind=i_def) :: df, df2, ij, nl, i1, i2 @@ -94,7 +98,7 @@ subroutine scaled_matrix_vector_code(cell, & do df2 = 1, ndf2 i2 = map2(df2) lhs(i1:i1+nl) = lhs(i1:i1+nl) & - + matrix(ij:ij+nl, df, df2)*x(i2:i2+nl)*y(i1:i1+nl)*z(i1:i1+nl) + + scalar*matrix(ij:ij+nl, df, df2)*x(i2:i2+nl)*y(i1:i1+nl)*z(i1:i1+nl) end do end do diff --git a/science/gungho/source/kernel/solver/weighted_div_bd_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_div_bd_kernel_mod.F90 index ea7b1162cd..04b65b374d 100644 --- a/science/gungho/source/kernel/solver/weighted_div_bd_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_div_bd_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Computes boundary part of the weighted divergence operator. !> @@ -23,7 +25,7 @@ module weighted_div_bd_kernel_mod mesh_data_type, & reference_element_data_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & + GH_REAL, & GH_READ, GH_READWRITE, & STENCIL, CROSS, GH_BASIS, & GH_QUADRATURE_face, & @@ -44,10 +46,9 @@ module weighted_div_bd_kernel_mod !> PSy layer. type, public, extends(kernel_type) :: weighted_div_bd_kernel_type private - type(arg_type) :: meta_args(3) = (/ & + type(arg_type) :: meta_args(2) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_READWRITE, W2, W3), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta, STENCIL(CROSS)), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta, STENCIL(CROSS)) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS), & @@ -84,7 +85,6 @@ module weighted_div_bd_kernel_mod !> @param[in] theta Potential temperature !> @param[in] stencil_wtheta_size Size of the Wtheta stencil (number of cells) !> @param[in] stencil_wtheta_map Wtheta dofmaps for the stencil - !> @param[in] scalar Real to scale matrix by !> @param[in] ndf_w2 Number of degrees of freedom per cell for W2 !> @param[in] w2_basis_face W2 basis functions evaluated at Gaussian !! quadrature points on horizontal faces @@ -112,7 +112,7 @@ subroutine weighted_div_bd_code( cell, nlayers, ncell_3d, & div, theta, & stencil_wtheta_size, & stencil_wtheta_map, & - scalar, & + ndf_w2, w2_basis_face, & ndf_w3, w3_basis_face, & ndf_wtheta, undf_wtheta, map_wtheta, & @@ -144,7 +144,6 @@ subroutine weighted_div_bd_code( cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_w2,ndf_w3), intent(inout) :: div real(kind=r_solver), dimension(undf_wtheta), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar integer(kind=i_def), intent(in) :: adjacent_face(nfaces_re_h) @@ -214,7 +213,7 @@ subroutine weighted_div_bd_code( cell, nlayers, ncell_3d, & next_bd_term = -v_dot_n(df2,qp,face)*theta_next_at_fquad integrand = rsol_wqp_f(qp,face)*rsol_w3_basis_face(1,df3,qp,face) & * 0.5_r_solver*(this_bd_term + next_bd_term) - div(ik,df2,df3) = div(ik,df2,df3) - scalar*integrand + div(ik,df2,df3) = div(ik,df2,df3) - integrand end do ! df2 end do ! df3 diff --git a/science/gungho/source/kernel/solver/weighted_div_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_div_kernel_mod.F90 index 251c15e0cb..f579fbfdd9 100644 --- a/science/gungho/source/kernel/solver/weighted_div_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_div_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the divergence operatore weigthed by the potential !> temperature. @@ -15,7 +17,7 @@ module weighted_div_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -33,10 +35,9 @@ module weighted_div_kernel_mod type, public, extends(kernel_type) :: weighted_div_kernel_type private - type(arg_type) :: meta_args(3) = (/ & + type(arg_type) :: meta_args(2) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, W3), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS, GH_DIFF_BASIS), & @@ -62,7 +63,6 @@ module weighted_div_kernel_mod !! @param[in] ncell_3d ncell*ndf !! @param[in,out] div Local stencil of the div operator !! @param[in] theta Potential temperature -!! @param[in] scalar Real to scale operator by !! @param[in] ndf_w2 Number of degrees of freedom per cell !! @param[in] basis_w2 Scalar basis functions evaluated at quadrature points !! @param[in] diff_basis_w2 Differential vector basis functions evaluated @@ -82,7 +82,6 @@ module weighted_div_kernel_mod subroutine weighted_div_code(cell, nlayers, ncell_3d, & div, & theta, & - scalar, & ndf_w2, basis_w2, diff_basis_w2, & ndf_w3, basis_w3, & ndf_wtheta, undf_wtheta, map_wtheta, & @@ -107,7 +106,6 @@ subroutine weighted_div_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_w2,ndf_w3), intent(inout) :: div real(kind=r_solver), dimension(undf_wtheta), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -150,7 +148,7 @@ subroutine weighted_div_code(cell, nlayers, ncell_3d, & end do wt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) do df3 = 1, ndf_w3 - integrand = scalar*wt*rsol_basis_w3(1,df3,qp1,qp2) + integrand = wt*rsol_basis_w3(1,df3,qp1,qp2) do df2 = 1, ndf_w2 div_theta_v = rsol_diff_basis_w2(1,df2,qp1,qp2)*theta_quad & + dot_product(rsol_basis_w2(:,df2,qp1,qp2),grad_theta_quad) diff --git a/science/gungho/source/kernel/solver/weighted_proj_2theta_bd_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_2theta_bd_kernel_mod.F90 index 3c368235c1..63c3af544c 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_2theta_bd_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_2theta_bd_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Computes the boundary part of the projection operator from the !> potential temperature space to the velocity space weighted by the @@ -19,7 +21,7 @@ module weighted_proj_2theta_bd_kernel_mod mesh_data_type, & reference_element_data_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & + GH_REAL, & GH_READ, GH_READWRITE, & STENCIL, CROSS, GH_BASIS, & GH_QUADRATURE_face, & @@ -40,11 +42,10 @@ module weighted_proj_2theta_bd_kernel_mod !> PSy layer. type, public, extends(kernel_type) :: weighted_proj_2theta_bd_kernel_type private - type(arg_type) :: meta_args(4) = (/ & + type(arg_type) :: meta_args(3) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_READWRITE, W2, Wtheta), & arg_type(GH_FIELD, GH_REAL, GH_READ, W3, STENCIL(CROSS)), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS), & @@ -81,7 +82,6 @@ module weighted_proj_2theta_bd_kernel_mod !> @param[in] stencil_w3_size Size of the W3 stencil (number of cells) !> @param[in] stencil_w3_map W3 dofmaps for the stencil !> @param[in] moist_dyn_factor The moist dynamics factor for theta - !> @param[in] scalar Real to scale matrix by !> @param[in] ndf_w2 Number of degrees of freedom per cell for W2 !> @param[in] w2_basis_face W2 basis functions evaluated at Gaussian !! quadrature points on horizontal faces @@ -110,7 +110,6 @@ subroutine weighted_proj_2theta_bd_code( cell, nlayers, ncell_3d, & projection, exner, & stencil_w3_size, stencil_w3_map, & moist_dyn_factor, & - scalar, & ndf_w2, w2_basis_face, & ndf_wtheta, undf_wtheta, & map_wtheta, wtheta_basis_face, & @@ -148,7 +147,6 @@ subroutine weighted_proj_2theta_bd_code( cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_w2,ndf_wtheta), intent(inout) :: projection real(kind=r_solver), dimension(undf_w3), intent(in) :: exner real(kind=r_solver), dimension(undf_wtheta), intent(in) :: moist_dyn_factor - real(kind=r_solver), intent(in) :: scalar integer(kind=i_def), intent(in) :: adjacent_face(:) @@ -209,7 +207,7 @@ subroutine weighted_proj_2theta_bd_code( cell, nlayers, ncell_3d, & v = rsol_w2_basis_face(:,df2,qp,face) integrand = rsol_wqp_f(qp,face)*exner_av*dot_product(v, normal) - projection(ik,df2,df0) = projection(ik,df2,df0) - scalar*integrand + projection(ik,df2,df0) = projection(ik,df2,df0) - integrand end do ! df2 end do ! df0 diff --git a/science/gungho/source/kernel/solver/weighted_proj_2theta_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_2theta_kernel_mod.F90 index d3656be547..5d83f81972 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_2theta_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_2theta_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the projection operator from the potential temperature space !! to the velocity space weighted by the pressure gradient. @@ -18,7 +20,7 @@ module weighted_proj_2theta_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & + GH_REAL, & GH_READ, GH_WRITE, & ANY_SPACE_9, & GH_BASIS, GH_DIFF_BASIS, & @@ -37,11 +39,10 @@ module weighted_proj_2theta_kernel_mod type, public, extends(kernel_type) :: weighted_proj_2theta_kernel_type private - type(arg_type) :: meta_args(4) = (/ & + type(arg_type) :: meta_args(3) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, ANY_SPACE_9), & arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & - arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_9), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_9) & /) type(func_type) :: meta_funcs(3) = (/ & func_type(W2, GH_BASIS, GH_DIFF_BASIS), & @@ -68,7 +69,6 @@ module weighted_proj_2theta_kernel_mod !! @param[in,out] projection Projection operator to compute !! @param[in] exner Exner pressure !! @param[in] moist_dyn_factor The moist dynamics factor for theta -!! @param[in] scalar Real to scale matrix by !! @param[in] ndf_w2 Number of degrees of freedom per cell !! @param[in] basis_w2 Basis functions evaluated at quadrature points !! @param[in] diff_basis_w2 Differential vector basis functions evaluated @@ -91,7 +91,6 @@ subroutine weighted_proj_2theta_code(cell, nlayers, ncell_3d, & projection, & exner, & moist_dyn_factor, & - scalar, & ndf_w2, basis_w2, diff_basis_w2, & ndf_wtheta, undf_wtheta, map_wtheta, & basis_wtheta, diff_basis_wtheta, & @@ -118,7 +117,6 @@ subroutine weighted_proj_2theta_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_w2,ndf_wtheta), intent(inout) :: projection real(kind=r_solver), dimension(undf_w3), intent(in) :: exner real(kind=r_solver), dimension(undf_wtheta), intent(in) :: moist_dyn_factor - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -158,7 +156,7 @@ subroutine weighted_proj_2theta_code(cell, nlayers, ncell_3d, & + exner_e(df)*rsol_basis_w3(1,df,qp1,qp2) end do wt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) - integrand = scalar*exner_quad*wt + integrand = exner_quad*wt do df0 = 1, ndf_wtheta do df2 = 1, ndf_w2 div_gamma_v = rsol_diff_basis_w2(1,df2,qp1,qp2)*rsol_basis_wtheta(1,df0,qp1,qp2) & diff --git a/science/gungho/source/kernel/solver/weighted_proj_2thetav_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_2thetav_kernel_mod.F90 index 177f9c15ce..3834d0e559 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_2thetav_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_2thetav_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2023 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. !----------------------------------------------------------------------------- !> @brief Compute the projection operator from the potential temperature space !! to the velocity space weighted by the pressure gradient. @@ -18,8 +20,8 @@ module weighted_proj_2thetav_kernel_mod use argument_mod, only: arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & - GH_INTEGER, & + GH_REAL, & + GH_INTEGER, GH_SCALAR, & GH_READ, GH_WRITE, & ANY_SPACE_9, & GH_BASIS, GH_DIFF_BASIS, & @@ -38,11 +40,10 @@ module weighted_proj_2thetav_kernel_mod type, public, extends(kernel_type) :: weighted_proj_2thetav_kernel_type private - type(arg_type) :: meta_args(6) = (/ & + type(arg_type) :: meta_args(5) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, W2, ANY_SPACE_9), & arg_type(GH_FIELD, GH_REAL, GH_READ, W3), & arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_SPACE_9), & - arg_type(GH_SCALAR, GH_REAL, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ) & /) @@ -71,7 +72,6 @@ module weighted_proj_2thetav_kernel_mod !! @param[in,out] projection Projection operator to compute !! @param[in] exner Exner pressure !! @param[in] moist_dyn_factor The moist dynamics factor for theta -!! @param[in] scalar Real to scale matrix by !! @param[in] element_order_h Horizontal element order of the function space !! @param[in] element_order_v Vertical element order of the function space !! @param[in] ndf_w2 Number of degrees of freedom per cell @@ -96,7 +96,6 @@ subroutine weighted_proj_2thetav_code(cell, nlayers, ncell_3d, & projection, & exner, & moist_dyn_factor, & - scalar, & element_order_h, element_order_v, & ndf_w2, basis_w2, diff_basis_w2, & ndf_wtheta, undf_wtheta, map_wtheta, & @@ -126,7 +125,6 @@ subroutine weighted_proj_2thetav_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_w2,ndf_wtheta), intent(inout) :: projection real(kind=r_solver), dimension(undf_w3), intent(in) :: exner real(kind=r_solver), dimension(undf_wtheta), intent(in) :: moist_dyn_factor - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -179,7 +177,7 @@ subroutine weighted_proj_2thetav_code(cell, nlayers, ncell_3d, & + exner_e(df)*rsol_basis_w3(1,df,qp1,qp2) end do wt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) - integrand = scalar*exner_quad*wt + integrand = exner_quad*wt do df0 = 1, ndf_wtheta do df2 = ndf_w2h_vol+1, ndf_w2 ! W2 dofs are ordered: diff --git a/science/gungho/source/kernel/solver/weighted_proj_theta2_bd_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_theta2_bd_kernel_mod.F90 index 33c58e484b..a239a87d57 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_theta2_bd_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_theta2_bd_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Computes the boundary integral part of the projection operator from !> the velocity space to the potential temperature space weighted by @@ -21,10 +23,9 @@ module weighted_proj_theta2_bd_kernel_mod mesh_data_type, & reference_element_data_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & GH_READ, GH_READWRITE, & STENCIL, CROSS, GH_BASIS, & - GH_QUADRATURE_face, & + GH_QUADRATURE_face, GH_REAL, & CELL_COLUMN, adjacent_face, & outward_normals_to_horizontal_faces use constants_mod, only : r_def, i_def, l_def, r_solver @@ -43,10 +44,9 @@ module weighted_proj_theta2_bd_kernel_mod !> PSy layer. type, public, extends(kernel_type) :: weighted_proj_theta2_bd_kernel_type private - type(arg_type) :: meta_args(3) = (/ & + type(arg_type) :: meta_args(2) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_READWRITE, Wtheta, W2), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta, STENCIL(CROSS)), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta, STENCIL(CROSS)) & /) type(func_type) :: meta_funcs(2) = (/ & func_type(Wtheta, GH_BASIS), & @@ -81,7 +81,6 @@ module weighted_proj_theta2_bd_kernel_mod !> @param[in] theta Potential temperature !> @param[in] stencil_wtheta_size Number of cells in the Wtheta stencil map !> @param[in] stencil_wtheta_map Stencil dofmap for the Wtheta space - !> @param[in] scalar Real to scale matrix by !> @param[in] ndf_wtheta Number of degrees of freedom per cell for Wtheta !> @param[in] undf_wtheta Number of unique degrees of freedom for Wtheta !> @param[in] map_wtheta Dofmap for the cell at the base of the column for @@ -106,7 +105,6 @@ subroutine weighted_proj_theta2_bd_code( cell, nlayers, ncell_3d, & projection, theta, & stencil_wtheta_size, & stencil_wtheta_map, & - scalar, & ndf_wtheta, undf_wtheta, map_wtheta, & wtheta_basis_face, & ndf_w2, w2_basis_face, & @@ -131,7 +129,6 @@ subroutine weighted_proj_theta2_bd_code( cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_wtheta,ndf_w2), intent(inout) :: projection real(kind=r_solver), dimension(undf_wtheta), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(3,ndf_w2,nqp_f,nfaces_qr), intent(in) :: w2_basis_face real(kind=r_def), dimension(1,ndf_wtheta,nqp_f,nfaces_qr), intent(in) :: wtheta_basis_face @@ -201,7 +198,7 @@ subroutine weighted_proj_theta2_bd_code( cell, nlayers, ncell_3d, & do dft = 1,ndf_wtheta projection(ik,dft,df2) = projection(ik,dft,df2) & + rsol_wtheta_basis_face(1,dft,qp,face) & - * flux_term * scalar + * flux_term end do ! dft end do ! df2 diff --git a/science/gungho/source/kernel/solver/weighted_proj_theta2_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_theta2_kernel_mod.F90 index d34d817d2f..f15dc05abd 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_theta2_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_theta2_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- ! !------------------------------------------------------------------------------- @@ -13,7 +15,7 @@ module weighted_proj_theta2_kernel_mod use argument_mod, only : arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -31,10 +33,9 @@ module weighted_proj_theta2_kernel_mod !> The type declaration for the kernel. Contains the metadata needed by the Psy layer type, public, extends(kernel_type) :: weighted_proj_theta2_kernel_type private - type(arg_type) :: meta_args(3) = (/ & + type(arg_type) :: meta_args(2) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, W2), & - arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ) & + arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta) & /) type(func_type) :: meta_funcs(2) = (/ & func_type(Wtheta, GH_BASIS, GH_DIFF_BASIS), & @@ -59,7 +60,6 @@ module weighted_proj_theta2_kernel_mod !! @param[in] ncell_3d Total number of cells in the 3d mesh !! @param[in,out] projection Locally assembled projection operator !! @param[in] theta Potential temperature array -!! @param[in] scalar Real to scale matrix by !! @param[in] ndf_wt Number of degrees of freedom per cell for Wtheta !! @param[in] undf_wt Number of unique degrees of freedom for Wtheta !! @param[in] map_wt Dofmap for the cell at the base of the column for Wtheta @@ -77,7 +77,6 @@ module weighted_proj_theta2_kernel_mod subroutine weighted_proj_theta2_code(cell, nlayers, ncell_3d, & projection, & theta, & - scalar, & ndf_wt, undf_wt, map_wt, & wt_basis, wt_diff_basis, & ndf_w2, w2_basis, w2_diff_basis, & @@ -98,7 +97,6 @@ subroutine weighted_proj_theta2_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_wt,ndf_w2), intent(inout) :: projection real(kind=r_solver), dimension(undf_wt), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -134,7 +132,7 @@ subroutine weighted_proj_theta2_code(cell, nlayers, ncell_3d, & theta_at_quad = theta_at_quad + theta_e(df)*rsol_wt_basis(1,df,qp1,qp2) end do wgt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) - i1 = scalar*theta_at_quad*wgt + i1 = theta_at_quad*wgt do df2 = 1,ndf_w2 do dft = 1,ndf_wt div_gamma_v = rsol_wt_basis(1,dft,qp1,qp2)*rsol_w2_diff_basis(1,df2,qp1,qp2) & diff --git a/science/gungho/source/kernel/solver/weighted_proj_theta2_vert_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_theta2_vert_kernel_mod.F90 index 5202edd725..8ae4d238bb 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_theta2_vert_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_theta2_vert_kernel_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> @brief Compute the projection operator from the vertical part of the !> velocity space to the potential temperature space weighted by the @@ -14,8 +16,8 @@ module weighted_proj_theta2_vert_kernel_mod use argument_mod, only : arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & GH_INTEGER, & + GH_SCALAR, GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -35,10 +37,9 @@ module weighted_proj_theta2_vert_kernel_mod !> type, public, extends(kernel_type) :: weighted_proj_theta2_vert_kernel_type private - type(arg_type) :: meta_args(5) = (/ & + type(arg_type) :: meta_args(4) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ) & /) @@ -65,7 +66,6 @@ module weighted_proj_theta2_vert_kernel_mod !! @param[in] ncell_3d Total number of cells in the 3d mesh !! @param[in,out] projection Locally assembled projection operator !! @param[in] theta Potential temperature array -!! @param[in] scalar Real to scale matrix by !! @param[in] element_order_h Horizontal element order of the function space !! @param[in] element_order_v Vertical element order of the function space !! @param[in] ndf_wtheta Number of degrees of freedom per cell for Wtheta @@ -83,7 +83,6 @@ module weighted_proj_theta2_vert_kernel_mod subroutine weighted_proj_theta2_vert_code(cell, nlayers, ncell_3d, & projection, & theta, & - scalar, & element_order_h, & element_order_v, & ndf_wtheta, undf_wtheta, map_wtheta, & @@ -106,7 +105,6 @@ subroutine weighted_proj_theta2_vert_code(cell, nlayers, ncell_3d, real(kind=r_solver), dimension(ncell_3d,ndf_wtheta,ndf_w2), intent(inout) :: projection real(kind=r_solver), dimension(undf_wtheta), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -159,7 +157,7 @@ subroutine weighted_proj_theta2_vert_code(cell, nlayers, ncell_3d, ! so the pragmatic solution is to enfoce dtheta/dz > 0 here grad_theta_at_quad(3) = max(1.0_r_solver, grad_theta_at_quad(3)) wt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) - i1 = scalar*grad_theta_at_quad*wt + i1 = grad_theta_at_quad*wt do df2 = ndf_w2h_vol+1,ndf_w2 ! W2 dofs are ordered: ! a) Horizontal volume dofs diff --git a/science/gungho/source/kernel/solver/weighted_proj_theta2v_kernel_mod.F90 b/science/gungho/source/kernel/solver/weighted_proj_theta2v_kernel_mod.F90 index a674a6578d..f12288bfbe 100644 --- a/science/gungho/source/kernel/solver/weighted_proj_theta2v_kernel_mod.F90 +++ b/science/gungho/source/kernel/solver/weighted_proj_theta2v_kernel_mod.F90 @@ -2,6 +2,8 @@ ! (c) Crown copyright 2023 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. !----------------------------------------------------------------------------- ! !------------------------------------------------------------------------------- @@ -14,8 +16,8 @@ module weighted_proj_theta2v_kernel_mod use argument_mod, only : arg_type, func_type, & GH_OPERATOR, GH_FIELD, & - GH_SCALAR, GH_REAL, & - GH_INTEGER, & + GH_INTEGER, GH_SCALAR, & + GH_REAL, & GH_READ, GH_WRITE, & GH_BASIS, GH_DIFF_BASIS, & CELL_COLUMN, GH_QUADRATURE_XYoZ @@ -33,10 +35,9 @@ module weighted_proj_theta2v_kernel_mod !> The type declaration for the kernel. Contains the metadata needed by the Psy layer type, public, extends(kernel_type) :: weighted_proj_theta2v_kernel_type private - type(arg_type) :: meta_args(5) = (/ & + type(arg_type) :: meta_args(4) = (/ & arg_type(GH_OPERATOR, GH_REAL, GH_WRITE, Wtheta, W2), & arg_type(GH_FIELD, GH_REAL, GH_READ, Wtheta), & - arg_type(GH_SCALAR, GH_REAL, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ), & arg_type(GH_SCALAR, GH_INTEGER, GH_READ) & /) @@ -63,7 +64,6 @@ module weighted_proj_theta2v_kernel_mod !! @param[in] ncell_3d Total number of cells in the 3d mesh !! @param[in,out] projection Locally assembled projection operator !! @param[in] theta Potential temperature array -!! @param[in] scalar Real to scale matrix by !! @param[in] element_order_h Horizontal element order of the function space !! @param[in] element_order_v Vertical element order of the function space !! @param[in] ndf_wt Number of degrees of freedom per cell for Wtheta @@ -83,7 +83,6 @@ module weighted_proj_theta2v_kernel_mod subroutine weighted_proj_theta2v_code(cell, nlayers, ncell_3d, & projection, & theta, & - scalar, & element_order_h, & element_order_v, & ndf_wt, undf_wt, map_wt, & @@ -107,7 +106,6 @@ subroutine weighted_proj_theta2v_code(cell, nlayers, ncell_3d, & real(kind=r_solver), dimension(ncell_3d,ndf_wt,ndf_w2), intent(inout) :: projection real(kind=r_solver), dimension(undf_wt), intent(in) :: theta - real(kind=r_solver), intent(in) :: scalar real(kind=r_def), dimension(nqp_h), intent(in) :: wqp_h real(kind=r_def), dimension(nqp_v), intent(in) :: wqp_v @@ -155,7 +153,7 @@ subroutine weighted_proj_theta2v_code(cell, nlayers, ncell_3d, & theta_at_quad = theta_at_quad + theta_e(df)*rsol_wt_basis(1,df,qp1,qp2) end do wgt = real(wqp_h(qp1)*wqp_v(qp2), r_solver) - i1 = scalar*theta_at_quad*wgt + i1 = theta_at_quad*wgt do df2 = ndf_w2h_vol+1, ndf_w2 ! W2 dofs are ordered: ! a) Horizontal volume dofs diff --git a/science/gungho/source/psy/psykal_lite_mod.F90 b/science/gungho/source/psy/psykal_lite_mod.F90 index 80509dc1d2..ea13c1b301 100644 --- a/science/gungho/source/psy/psykal_lite_mod.F90 +++ b/science/gungho/source/psy/psykal_lite_mod.F90 @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- ! !------------------------------------------------------------------------------- @@ -77,7 +79,8 @@ end subroutine invoke_compute_dof_level_kernel ! see PSyclone #1103: https://github.com/stfc/PSyclone/issues/1103 ! The LFRic infrastructure for this will be introduced in #2532 subroutine invoke_helmholtz_operator_kernel_type(helmholtz_operator, hb_lumped_inv, stencil_depth, u_normalisation, div_star, & - t_normalisation, ptheta2v, compound_div, m3_exner_star, p3theta, w2_mask) + t_normalisation, ptheta2v, compound_div, m3_exner_star, p3theta, w2_mask, & + tau_u_dt_cp, tau_t_dt, tau_r_dt) use helmholtz_operator_kernel_mod, only: helmholtz_operator_code use mesh_mod, only: mesh_type use stencil_2d_dofmap_mod, only: stencil_2d_cross @@ -88,6 +91,7 @@ subroutine invoke_helmholtz_operator_kernel_type(helmholtz_operator, hb_lumped_i type(r_solver_field_type), intent(in) :: helmholtz_operator(9) type(r_solver_field_type), intent(in) :: hb_lumped_inv, u_normalisation, t_normalisation, w2_mask type(r_solver_operator_type), intent(in) :: div_star, ptheta2v, compound_div, m3_exner_star, p3theta + real(kind=r_solver), intent(in) :: tau_u_dt_cp, tau_t_dt, tau_r_dt integer(kind=i_def), intent(in) :: stencil_depth integer(kind=i_def) :: stencil_size integer(kind=i_def) cell @@ -232,6 +236,7 @@ subroutine invoke_helmholtz_operator_kernel_type(helmholtz_operator, hb_lumped_i p3theta_proxy%ncell_3d, & p3theta_proxy%local_stencil, & w2_mask_proxy%data, & + tau_u_dt_cp, tau_t_dt, tau_r_dt, & ndf_w3, undf_w3, map_w3(:,cell), & ndf_w2, undf_w2, map_w2(:,cell), & ndf_wtheta, undf_wtheta, map_wtheta(:,cell)) @@ -262,8 +267,9 @@ end subroutine invoke_helmholtz_operator_kernel_type ! The LFRic infrastructure for this will be introduced in #2532 subroutine invoke_elim_helmholtz_operator_kernel_type(helmholtz_operator, hb_lumped_inv, stencil_depth, & u_normalisation, div_star, & - m3_exner_star, Q32, & - w2_mask) + m3_exner_star, Q32_rho, Q32_theta, & + w2_mask, & + tau_u_dt_cp, tau_r_dt, tau_t_dt) use elim_helmholtz_operator_kernel_mod, only: elim_helmholtz_operator_code use mesh_mod, only: mesh_type use stencil_dofmap_mod, only: stencil_cross @@ -274,12 +280,13 @@ subroutine invoke_elim_helmholtz_operator_kernel_type(helmholtz_operator, hb_lum type(r_solver_field_type), intent(in) :: helmholtz_operator(9) type(r_solver_field_type), intent(in) :: hb_lumped_inv, u_normalisation, w2_mask - type(r_solver_operator_type), intent(in) :: div_star, m3_exner_star, Q32 + type(r_solver_operator_type), intent(in) :: div_star, m3_exner_star, Q32_rho, Q32_theta + real(kind=r_solver), intent(in) :: tau_u_dt_cp, tau_r_dt, tau_t_dt integer(kind=i_def), intent(in) :: stencil_depth integer(kind=i_def) :: stencil_size integer(kind=i_def) cell integer(kind=i_def) nlayers - type(r_solver_operator_proxy_type) div_star_proxy, m3_exner_star_proxy, Q32_proxy + type(r_solver_operator_proxy_type) div_star_proxy, m3_exner_star_proxy, Q32_rho_proxy, Q32_theta_proxy type(r_solver_field_proxy_type) helmholtz_operator_proxy(9) type(r_solver_field_proxy_type) hb_lumped_inv_proxy, u_normalisation_proxy, & w2_mask_proxy @@ -309,7 +316,8 @@ subroutine invoke_elim_helmholtz_operator_kernel_type(helmholtz_operator, hb_lum u_normalisation_proxy = u_normalisation%get_proxy() div_star_proxy = div_star%get_proxy() m3_exner_star_proxy = m3_exner_star%get_proxy() - Q32_proxy = Q32%get_proxy() + Q32_rho_proxy = Q32_rho%get_proxy() + Q32_theta_proxy = Q32_theta%get_proxy() w2_mask_proxy = w2_mask%get_proxy() ! ! Initialise number of layers @@ -391,9 +399,12 @@ subroutine invoke_elim_helmholtz_operator_kernel_type(helmholtz_operator, hb_lum div_star_proxy%local_stencil, & m3_exner_star_proxy%ncell_3d, & m3_exner_star_proxy%local_stencil, & - Q32_proxy%ncell_3d, & - Q32_proxy%local_stencil, & + Q32_rho_proxy%ncell_3d, & + Q32_rho_proxy%local_stencil, & + Q32_theta_proxy%ncell_3d, & + Q32_theta_proxy%local_stencil, & w2_mask_proxy%data, & + tau_u_dt_cp, tau_r_dt, tau_t_dt, & ndf_w3, undf_w3, map_w3(:,cell), & ndf_w2, undf_w2, map_w2(:,cell)) end do diff --git a/science/gungho/unit-test/kernel/core_dynamics/compute_dl_matrix_kernel_mod_test.pf b/science/gungho/unit-test/kernel/core_dynamics/compute_dl_matrix_kernel_mod_test.pf index ecab41da72..90bf76cf84 100644 --- a/science/gungho/unit-test/kernel/core_dynamics/compute_dl_matrix_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/core_dynamics/compute_dl_matrix_kernel_mod_test.pf @@ -50,12 +50,15 @@ contains implicit none - call feign_timestepping_config( & - method=method_semi_implicit, & - dt=1.0_r_second, alpha=0.5_r_def, tau_u=0.5_r_def, & - tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=4_i_def, inner_iterations=1_i_def, & - runge_kutta_method=runge_kutta_method_ssp3, & + call feign_timestepping_config( & + method=method_semi_implicit, & + dt=1.0_r_second, alpha=0.5_r_def, tau_u=0.5_r_def, & + tau_t=0.5_r_def, tau_r=0.5_r_def, & + outer_iterations=4_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & + runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) call feign_finite_element_config( & diff --git a/science/gungho/unit-test/kernel/diagnostics/cfl_kernel_mod_test.pf b/science/gungho/unit-test/kernel/diagnostics/cfl_kernel_mod_test.pf index 44b9c23aea..ae0102c417 100644 --- a/science/gungho/unit-test/kernel/diagnostics/cfl_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/diagnostics/cfl_kernel_mod_test.pf @@ -52,7 +52,10 @@ contains method=method_semi_implicit, & dt=real(DT, r_second), alpha=0.5_r_def, tau_u=0.5_r_def, & tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/diagnostics/compute_bottom_mass_from_flux_kernel_mod_test.pf b/science/gungho/unit-test/kernel/diagnostics/compute_bottom_mass_from_flux_kernel_mod_test.pf index 5298e2a5b1..95b10a53e6 100644 --- a/science/gungho/unit-test/kernel/diagnostics/compute_bottom_mass_from_flux_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/diagnostics/compute_bottom_mass_from_flux_kernel_mod_test.pf @@ -50,7 +50,10 @@ contains method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, tau_u=0.5_r_def, & tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/external_forcing/deep_hot_jupiter_kernel_mod_test.pf b/science/gungho/unit-test/kernel/external_forcing/deep_hot_jupiter_kernel_mod_test.pf index e5c3ccef34..063cdc7c9c 100644 --- a/science/gungho/unit-test/kernel/external_forcing/deep_hot_jupiter_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/external_forcing/deep_hot_jupiter_kernel_mod_test.pf @@ -68,7 +68,10 @@ contains call feign_timestepping_config( method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, & tau_u=0.5_r_def, tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/external_forcing/earth_like_kernel_mod_test.pf b/science/gungho/unit-test/kernel/external_forcing/earth_like_kernel_mod_test.pf index 38d61f9324..d11c84414e 100644 --- a/science/gungho/unit-test/kernel/external_forcing/earth_like_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/external_forcing/earth_like_kernel_mod_test.pf @@ -74,7 +74,10 @@ contains call feign_timestepping_config( method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, & tau_u=0.5_r_def, tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/external_forcing/held_suarez_kernel_mod_test.pf b/science/gungho/unit-test/kernel/external_forcing/held_suarez_kernel_mod_test.pf index e5f2802e4b..37ef57d8b0 100644 --- a/science/gungho/unit-test/kernel/external_forcing/held_suarez_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/external_forcing/held_suarez_kernel_mod_test.pf @@ -70,7 +70,10 @@ contains call feign_timestepping_config(method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, tau_u=0.5_r_def, & tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def,& + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/external_forcing/shallow_hot_jupiter_kernel_mod_test.pf b/science/gungho/unit-test/kernel/external_forcing/shallow_hot_jupiter_kernel_mod_test.pf index e5a57eeed3..71197ee117 100644 --- a/science/gungho/unit-test/kernel/external_forcing/shallow_hot_jupiter_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/external_forcing/shallow_hot_jupiter_kernel_mod_test.pf @@ -69,7 +69,10 @@ contains call feign_timestepping_config( method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, & tau_u=0.5_r_def, tau_t=0.5_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/external_forcing/tidally_locked_earth_kernel_mod_test.pf b/science/gungho/unit-test/kernel/external_forcing/tidally_locked_earth_kernel_mod_test.pf index b5096dc847..d6151cc635 100644 --- a/science/gungho/unit-test/kernel/external_forcing/tidally_locked_earth_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/external_forcing/tidally_locked_earth_kernel_mod_test.pf @@ -70,7 +70,10 @@ contains call feign_timestepping_config( method=method_semi_implicit, & dt=real(dt, r_second), alpha=0.5_r_def, & tau_u=0.5_r_def, tau_t=1.0_r_def, tau_r=0.5_r_def, & - outer_iterations=1_i_def, inner_iterations=1_i_def, & + outer_iterations=1_i_def, & + inner_iterations_tr=(/1_i_def/), & + inner_iterations_bdf2=(/1_i_def/), & + inner_iterations_si=(/1_i_def/), & runge_kutta_method=runge_kutta_method_ssp3, & spinup_period=0.0_r_second, spinup_alpha=.false.) diff --git a/science/gungho/unit-test/kernel/solver/apply_analytic_q32_rhs_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_analytic_q32_rhs_kernel_mod_test.pf new file mode 100644 index 0000000000..c4c73a5515 --- /dev/null +++ b/science/gungho/unit-test/kernel/solver/apply_analytic_q32_rhs_kernel_mod_test.pf @@ -0,0 +1,86 @@ +!----------------------------------------------------------------------------- +! (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. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. +!----------------------------------------------------------------------------- + +!> Test analytic-elimination Q32 contribution kernel +module apply_analytic_q32_rhs_kernel_mod_test + + use constants_mod, only : i_def, r_solver + use funit + + implicit none + + private + public :: test_all + +contains + + @test( ) + subroutine test_all( ) + + use apply_analytic_q32_rhs_kernel_mod, only : apply_analytic_q32_rhs_code + + implicit none + + real(kind=r_solver), parameter :: tol = 1.0e-12_r_solver + + integer(kind=i_def), parameter :: nlayers = 1_i_def + integer(kind=i_def), parameter :: cell = 1_i_def + integer(kind=i_def), parameter :: ncell = 1_i_def + + integer(kind=i_def), parameter :: ndf_w3 = 2_i_def + integer(kind=i_def), parameter :: ndf_w2 = 3_i_def + integer(kind=i_def), parameter :: undf_w3 = ndf_w3*nlayers + integer(kind=i_def), parameter :: undf_w2 = ndf_w2*nlayers + + integer(kind=i_def), dimension(ndf_w3) :: map_w3 + integer(kind=i_def), dimension(ndf_w2) :: map_w2 + + real(kind=r_solver), dimension(undf_w3) :: rhs + real(kind=r_solver), dimension(undf_w2) :: rhs_u + + real(kind=r_solver), dimension(ncell, ndf_w3, ndf_w2) :: q32_rho + real(kind=r_solver), dimension(ncell, ndf_w3, ndf_w2) :: q32_theta + + real(kind=r_solver), parameter :: const_r = 2.0_r_solver + real(kind=r_solver), parameter :: const_t = 5.0_r_solver + + integer(kind=i_def) :: df + real(kind=r_solver) :: answer + + map_w3 = (/ 1_i_def, 2_i_def /) + map_w2 = (/ 1_i_def, 2_i_def, 3_i_def /) + + rhs_u = (/ 0.2_r_solver, -0.7_r_solver, 1.4_r_solver /) + + q32_rho(1,1,:) = (/ 1.0_r_solver, 0.5_r_solver, -2.0_r_solver /) + q32_rho(1,2,:) = (/ -1.5_r_solver, 2.0_r_solver, 0.1_r_solver /) + + q32_theta(1,1,:) = (/ 0.4_r_solver, -0.2_r_solver, 1.0_r_solver /) + q32_theta(1,2,:) = (/ 3.0_r_solver, 0.0_r_solver, -0.5_r_solver /) + + rhs = 0.0_r_solver + + call apply_analytic_q32_rhs_code(cell, & + nlayers, & + rhs, & + rhs_u, & + ncell, q32_rho, & + ncell, q32_theta, & + const_r, const_t, & + ndf_w3, undf_w3, map_w3, & + ndf_w2, undf_w2, map_w2) + + do df = 1, ndf_w3 + answer = const_r*sum(q32_rho(1,df,:)*rhs_u(:)) & + + const_t*sum(q32_theta(1,df,:)*rhs_u(:)) + @assertEqual(answer, rhs(df), tol) + end do + + end subroutine test_all + +end module apply_analytic_q32_rhs_kernel_mod_test \ No newline at end of file diff --git a/science/gungho/unit-test/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod_test.pf index fde964b8fb..fa018c9bdf 100644 --- a/science/gungho/unit-test/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/apply_elim_mixed_lp_operator_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (C) Crown copyright 2021 Met Office. All rights reserved. ! For further details please refer to the file COPYRIGHT.txt ! which you should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test computation of the LHS of the equation of state: @@ -89,6 +91,9 @@ contains integer(kind=i_def) :: df real(kind=r_solver) :: answer + ! Scaling constant applied to the Q32 contribution + real(kind=r_solver), parameter :: const_r = 3.0_r_solver + map_wt = (/ 1_i_def, 2_i_def /) map_w3 = (/ 1_i_def /) map_w2 = (/ 1_i_def, 2_i_def, 3_i_def, 4_i_def /) @@ -110,7 +115,7 @@ contains u = (/ 0.8_r_solver, 0.1_r_solver, -3.0_r_solver, 2.5_r_solver /) lhs_exner = 0.0_r_solver - ! Compute m3exner*exner - p3thetar*theta + q32*u + ! Compute m3exner*exner - p3thetar*theta + const_r*q32*u call apply_elim_mixed_lp_operator_code(cell, & nlayers, & lhs_exner, & @@ -118,6 +123,7 @@ contains ncell, m3exner, & ncell, q32, & ncell, p3theta, & + const_r, & ndf_w3, undf_w3, map_w3, & ndf_wt, undf_wt, map_wt, & ndf_w2, undf_w2, map_w2) @@ -125,7 +131,7 @@ contains do df = 1, ndf_w3 answer = m3exner(1,df,df)*exner(df) & - sum(p3theta(1,df,:)*theta(:)) & - + sum(q32(1,df,:)*u(:)) + + const_r*sum(q32(1,df,:)*u(:)) @assertEqual(answer, lhs_exner(df), tol) end do diff --git a/science/gungho/unit-test/kernel/solver/apply_mixed_lu_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_mixed_lu_operator_kernel_mod_test.pf index 402cc71979..14fedbc7cd 100644 --- a/science/gungho/unit-test/kernel/solver/apply_mixed_lu_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/apply_mixed_lu_operator_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (C) Crown copyright 2021 Met Office. All rights reserved. ! For further details please refer to the file COPYRIGHT.txt ! which you should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test the mixed operator to the momentum equation @@ -89,6 +91,10 @@ contains integer(i_def) :: df real(r_solver) :: answer + ! Scaling constant applied to the pressure gradient and potential + ! temperature projection contributions + real(r_solver), parameter :: const_u = 3.0_r_solver + map_w2 = (/ 1_i_def, 2_i_def, 3_i_def, 4_i_def /) map_wt = (/ 1_i_def, 2_i_def /) map_w3 = (/ 1_i_def /) @@ -108,7 +114,7 @@ contains Nu = 2.0_r_solver Lu = 0.0_r_solver - ! Compute Nu*(Mu*u - Proj*t - Grad*p) + ! Compute Nu*(Mu*u - const_u*Proj*t - const_u*Grad*p) call apply_mixed_lu_operator_code(cell, & nlayers, & Lu, & @@ -117,12 +123,13 @@ contains ncell, Proj, & ncell, Grad, & Nu, & + const_u, & ndf_w2, undf_w2, map_w2, & ndf_wt, undf_wt, map_wt, & ndf_w3, undf_w3, map_w3) do df = 1,ndf_w2 - answer = Nu(df)*(Mu(1,df,df)*u(df) - sum(Proj(1,df,:)*t(:)) - Grad(1,df,1)*p(1)) + answer = Nu(df)*(Mu(1,df,df)*u(df) - const_u*sum(Proj(1,df,:)*t(:)) - const_u*Grad(1,df,1)*p(1)) @assertEqual(answer, Lu(df), tol) end do diff --git a/science/gungho/unit-test/kernel/solver/apply_mixed_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_mixed_operator_kernel_mod_test.pf index 7afe6b6144..e766f5c841 100644 --- a/science/gungho/unit-test/kernel/solver/apply_mixed_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/apply_mixed_operator_kernel_mod_test.pf @@ -67,6 +67,10 @@ contains real(r_solver), dimension(undf_w3) :: p, Lp real(r_solver), dimension(undf_wt) :: t + real(r_solver), parameter :: const_u = 1.0_r_solver + real(r_solver), parameter :: const_t = 1.0_r_solver + real(r_solver), parameter :: const_r = 1.0_r_solver + integer(i_def) :: df real(r_solver) :: answer @@ -117,6 +121,7 @@ contains ncell, M3p, & ncell, Q32, & ncell, P3t, & + const_u, const_t, const_r, & ndf_w2h, undf_w2h, map_w2h, & ndf_w2v, undf_w2v, map_w2v, & ndf_w3, undf_w3, map_w3, & diff --git a/science/gungho/unit-test/kernel/solver/apply_mixed_u_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_mixed_u_operator_kernel_mod_test.pf index 111b48817f..097082f7cb 100644 --- a/science/gungho/unit-test/kernel/solver/apply_mixed_u_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/apply_mixed_u_operator_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (C) Crown copyright Met Office. All rights reserved. ! For further details please refer to the file COPYRIGHT.txt ! which you should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test the mixed operator of the semi-implicit lhs @@ -60,6 +62,9 @@ contains integer(i_def) :: df real(r_solver) :: answer + ! Scaling constant applied to the pressure gradient contribution + real(r_solver), parameter :: const_u = 3.0_r_solver + map_w2h = (/ 1_i_def, 1_i_def + nlayers /) map_w2v = (/ 1_i_def, 2_i_def /) map_w2 = (/ 1_i_def, 1_i_def + nlayers, 1_i_def + 2*nlayers, 2_i_def + 2*nlayers /) @@ -79,7 +84,7 @@ contains Nu = 2.0_r_solver Luv = 0.0_r_solver - ! Compute: (L_uv) = Nu*(Mu*u - Grad*p) + ! Compute: (L_uv) = Nu*(Mu*u - const_u*Grad*p) call apply_mixed_u_operator_code(cell, & nlayers, & Luv, & @@ -87,14 +92,17 @@ contains ncell, Mu, & ncell, Grad, & Nu, & + const_u, & ndf_w2h, undf_w2h, map_w2h, & ndf_w2h, undf_w2h, map_w2h, & ndf_w2v, undf_w2v, map_w2v, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2) - @assertEqual(2.4_r_solver, Luv(1), tol) - @assertEqual(1.6_r_solver, Luv(2), tol) + ! df=1: const_u*Nu*(-Grad*p) = 3*2*(-(-1)*1.2) = 7.2 + ! df=2: const_u*Nu*(-Grad*p) + Nu*Mu*uv = 3*2*(-1*1.2) + 2*2*1 = -7.2 + 4.0 + @assertEqual(7.2_r_solver, Luv(1), tol) + @assertEqual(-3.2_r_solver, Luv(2), tol) end subroutine test_all diff --git a/science/gungho/unit-test/kernel/solver/apply_mixed_wp_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/apply_mixed_wp_operator_kernel_mod_test.pf index a95cbbd6fc..d8d49d89af 100644 --- a/science/gungho/unit-test/kernel/solver/apply_mixed_wp_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/apply_mixed_wp_operator_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (C) Crown copyright Met Office. All rights reserved. ! For further details please refer to the file COPYRIGHT.txt ! which you should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test the mixed operator of the semi-implicit lhs @@ -70,6 +72,14 @@ contains real(r_solver), dimension(undf_w2v) :: answer real(r_solver) :: answer_p + ! Scaling constants applied at the point of use of the SI operators + real(r_solver), parameter :: const_u = 2.0_r_solver + real(r_solver), parameter :: const_t = 0.5_r_solver + real(r_solver), parameter :: const_r = 3.0_r_solver + integer(i_def) :: dfv + real(r_solver), dimension(undf_wt) :: t + real(r_solver), dimension(ndf_w2) :: u + map_w2h = (/ 1_i_def, 1_i_def + nlayers /) map_w2v = (/ 1_i_def, 2_i_def /) map_w2 = (/ 1_i_def, 1_i_def + nlayers, 1_i_def + 2*nlayers, 2_i_def + 2*nlayers /) @@ -103,9 +113,9 @@ contains Nu(:) = 2.0_r_solver invMt(:) = 0.25_r_solver - ! Compute: (L_uv, L_w) = Nu*(Mu*u - Proj*t - Grad*p) - ! L_p = M3p*p - P3t*t + Q32*u - ! with t = -Mt^-1 * Pt2*u + ! Compute: (L_uv, L_w) = Nu*(Mu*u - const_u*Proj*t - const_u*Grad*p) + ! L_p = M3p*p - P3t*t + const_r*Q32*u + ! with t = -const_t * Mt^-1 * Pt2*u call apply_mixed_wp_operator_code(cell, & nlayers, & Lw, Lp, & @@ -119,40 +129,40 @@ contains ncell, M3p, & ncell, Q32, & ncell, P3t, & + const_u, const_t, const_r, & ndf_w2v, undf_w2v, map_w2v, & ndf_w3, undf_w3, map_w3, & ndf_w2h, undf_w2h, map_w2h, & ndf_wt, undf_wt, map_wt, & ndf_w2, undf_w2, map_w2) - ! The code below can be used to generate the answers required and - ! is kept to here to make altering the unit test following changes in the - ! kernel easier - !t(:) = 0.0_r_solver - !do k = 1, nlayers - ! t(k) = t(k) - Pt2(k,1,3)*w(k) - Pt2(k,1,4)*w(k+1) - ! t(k+1) = t(k+1) - Pt2(k,2,3)*w(k) - Pt2(k,2,4)*w(k+1) - !end do - !t(:) = invMt(:)*t(:) - - !answer(:) = 0.0_r_solver - !do k = 0, nlayers - 1 - ! do dfv = 1,ndf_w2v - ! u = (/ uv(1+k), uv(4+k), w(1+k), w(2+k) /) - ! df = ndf_w2h+dfv - ! answer(map_w2v(dfv)+k) = answer(map_w2v(dfv)+k) & - ! + Nu(map_w2(df)+k)*(sum(Mu(k+1,df,:)*u) & - ! - sum(P2t(k+1,df,:)*t(k+1:k+2)) & - ! - Grad(k+1,df,1)*p(1+k)) - ! end do - !end do - !u = (/ uv(1), uv(4), w(1), w(2) /) - !answer_p = M3p(1,1,1)*p(1) - sum(P3t(1,1,:)*t(1:2)) + sum(Q32(1,1,:)*u(1:4)) - - answer = (/ 0.0_r_solver, 58.0_r_solver, -32.0_r_solver, 0.0_r_solver /) + ! Independent reference computation of the expected answer, including the + ! tau*dt scaling constants applied at the point of use. + t(:) = 0.0_r_solver + do k = 1, nlayers + t(k) = t(k) - Pt2(k,1,3)*w(k) - Pt2(k,1,4)*w(k+1) + t(k+1) = t(k+1) - Pt2(k,2,3)*w(k) - Pt2(k,2,4)*w(k+1) + end do + t(:) = const_t*invMt(:)*t(:) + + answer(:) = 0.0_r_solver + do k = 0, nlayers - 1 + do dfv = 1,ndf_w2v + u = (/ uv(1+k), uv(4+k), w(1+k), w(2+k) /) + df = ndf_w2h+dfv + answer(map_w2v(dfv)+k) = answer(map_w2v(dfv)+k) & + + Nu(map_w2(df)+k)*( sum(Mu(k+1,df,:)*u) & + + const_u*( - sum(P2t(k+1,df,:)*t(k+1:k+2)) & + - Grad(k+1,df,1)*p(1+k) ) ) + end do + end do + ! Boundary conditions on lhs_w + answer(map_w2v(1)) = 0.0_r_solver + answer(map_w2v(2)+nlayers-1) = 0.0_r_solver @assertEqual(answer, Lw, tol) - answer_p = 72.6_r_solver + u = (/ uv(1), uv(4), w(1), w(2) /) + answer_p = M3p(1,1,1)*p(1) - sum(P3t(1,1,:)*t(1:2)) + const_r*sum(Q32(1,1,:)*u(1:4)) @assertEqual(answer_p, Lp(1), tol) end subroutine test_all diff --git a/science/gungho/unit-test/kernel/solver/elim_helmholtz_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/elim_helmholtz_operator_kernel_mod_test.pf index 415a64874b..d266188120 100644 --- a/science/gungho/unit-test/kernel/solver/elim_helmholtz_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/elim_helmholtz_operator_kernel_mod_test.pf @@ -84,12 +84,17 @@ contains ! Operators real(kind=r_solver), dimension(ncell, ndf_w2, ndf_w3) :: div_star real(kind=r_solver), dimension(ncell, ndf_w3, ndf_w2) :: q32 + real(kind=r_solver), dimension(ncell, ndf_w3, ndf_w2) :: q32_theta real(kind=r_solver), dimension(ncell, ndf_w3, ndf_w3) :: m3_exner_star ! Number of dofs in a single column: 4*nlayers horizontal dofs ! and (nlayers + 1) vertical dofs integer(kind=i_def), parameter :: ndofs_col = 5*nlayers+1 + real(kind=r_solver), parameter :: const_u = 1.0_r_solver + real(kind=r_solver), parameter :: const_r = 1.0_r_solver + real(kind=r_solver), parameter :: const_t = 1.0_r_solver + integer(kind=i_def) :: df, k real(kind=r_solver) :: answer @@ -134,6 +139,9 @@ contains div_star = 1.0_r_solver m3_exner_star = 10.0_r_solver q32 = 10.0_r_solver + ! q32_theta is scaled by const_t; set to zero so it does not contribute + ! and the expected answers below (derived for a single Q32 operator) hold + q32_theta = 0.0_r_solver ! Compute Helmholtz operator call elim_helmholtz_operator_code(smap_size_w2, & @@ -151,7 +159,10 @@ contains m3_exner_star, & ncell, & q32, & + ncell, & + q32_theta, & w2_mask, & + const_u, const_r, const_t, & ndf_w3, undf_w3, map_w3, & ndf_w2, undf_w2, map_w2) ! In terms of the kernel operators we have diff --git a/science/gungho/unit-test/kernel/solver/eliminated_theta_q22_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/eliminated_theta_q22_kernel_mod_test.pf index b3b3b9cb6f..ba85205ada 100644 --- a/science/gungho/unit-test/kernel/solver/eliminated_theta_q22_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/eliminated_theta_q22_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> Test the weighted W2 mass matrix obtained by eliminating theta @@ -119,8 +121,6 @@ contains ! Coordinate fields real(kind=r_def), dimension(ndf_wx) :: x, y, z real(kind=r_def) :: dx, dy, dz, zero, detj - ! Scalars - real(kind=r_solver) :: const integer(kind=i_def) :: i, df1, df2 @@ -177,7 +177,6 @@ contains theta = (/ 300.0_r_solver, 310.0_r_solver /) exner = (/ 1.0_r_solver, 0.95_r_solver /) norm_u = (/ 2.0_r_solver, 0.5_r_solver, 3.0_r_solver, 6.3_r_solver /) - const = 17.0_r_solver call eliminated_theta_q22_code(cell, & nlayers, & @@ -188,7 +187,6 @@ contains norm_u, & x, y, z, & panel_id, & - const, & ndf_w2, undf_w2, map_w2, & basis_w2, & ndf_wt, undf_wt, map_wt, & @@ -198,14 +196,14 @@ contains ndf_p, undf_p, map_p, & nqp, nqp, wgt, wgt) - ! Q22 = norm_u * const * < basis_w2, (dtheta/dz * k.basis_w2)*(k*dexner/dz)/detJ > + ! Q22 = norm_u * < basis_w2, (dtheta/dz * k.basis_w2)*(k*dexner/dz)/detJ > ! Q22 is only non-zero for vertical dofs (=3,4) so we only need to compute ! the answer for these detj = dx*dy*dz answer = 0.0_r_solver do df2 = 3,4 do df1 = 3,4 - answer(df1,df2) = 0.25_r_solver * const * norm_u(df1) * & + answer(df1,df2) = 0.25_r_solver * norm_u(df1) * & (exner(2)-exner(1))*(theta(2)-theta(1))/real(detj, r_solver) end do end do diff --git a/science/gungho/unit-test/kernel/solver/eliminated_theta_q2t_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/eliminated_theta_q2t_kernel_mod_test.pf index 8f79d392b5..de444a0ba1 100644 --- a/science/gungho/unit-test/kernel/solver/eliminated_theta_q2t_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/eliminated_theta_q2t_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> Test the weighted q2t matrix @@ -83,8 +85,6 @@ contains ! Fields real(kind=r_solver), dimension(ndf_w2) :: norm_u real(kind=r_solver), dimension(ndf_wt) :: exner - ! Scalars - real(kind=r_solver) :: const integer(kind=i_def) :: i, df1, df2 real(kind=r_solver), dimension(ndf_w2, ndf_wt) :: answer @@ -113,7 +113,6 @@ contains ! Fields exner = (/ 1.0_r_solver, 0.95_r_solver /) norm_u = (/ 2.0_r_solver, 0.5_r_solver, 3.0_r_solver, 6.3_r_solver /) - const = 17.0_r_solver call eliminated_theta_q2t_code(cell, & nlayers, & @@ -121,19 +120,18 @@ contains q2t, & norm_u, & exner, & - const, & ndf_w2, undf_w2, map_w2, & basis_w2, & ndf_wt, undf_wt, map_wt, & basis_wt, diff_basis_wt, & nqp, nqp, wgt, wgt) - ! q2t = - norm_u * const * < basis_w2, (k*dexner/dz)*basis_wt > + ! q2t = - norm_u * < basis_w2, (k*dexner/dz)*basis_wt > ! This is only non-zero for vertical components of W2 ( df1 = 3,4) answer = 0.0_r_solver do df2 = 1,ndf_wt do df1 = 3,ndf_w2 - answer(df1,df2) = -0.25_r_solver * const * norm_u(df1) * (exner(2)-exner(1)) + answer(df1,df2) = -0.25_r_solver * norm_u(df1) * (exner(2)-exner(1)) end do end do @assertEqual(answer, q2t(1,:,:), tol) diff --git a/science/gungho/unit-test/kernel/solver/helmholtz_operator_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/helmholtz_operator_kernel_mod_test.pf index a65a858edc..46a1bd046e 100644 --- a/science/gungho/unit-test/kernel/solver/helmholtz_operator_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/helmholtz_operator_kernel_mod_test.pf @@ -164,6 +164,10 @@ contains integer(kind=i_def), parameter :: stencil_size = 5 integer(kind=i_def), parameter :: ncell = stencil_size*nlayers + real(kind=r_solver), parameter :: const_u = 1.0_r_solver + real(kind=r_solver), parameter :: const_r = 1.0_r_solver + real(kind=r_solver), parameter :: const_t = 1.0_r_solver + this%smap_sizes(:) = 2 allocate(this%div_star(ncell, ndf_w2, ndf_w3)) @@ -238,6 +242,9 @@ contains ncell, & this%p3theta, & this%w2_mask, & + const_u, & + const_t, & + const_r, & ndf_w3, & undf_w3, & this%map_w3, & @@ -298,6 +305,10 @@ contains integer(kind=i_def), parameter :: stencil_size = 4 integer(kind=i_def), parameter :: ncell = stencil_size*nlayers + real(kind=r_solver), parameter :: const_u = 1.0_r_solver + real(kind=r_solver), parameter :: const_r = 1.0_r_solver + real(kind=r_solver), parameter :: const_t = 1.0_r_solver + allocate(this%div_star(ncell, ndf_w2, ndf_w3)) allocate(this%compound_div(ncell, ndf_w3, ndf_w2)) allocate(this%p3theta(ncell, ndf_w3, ndf_wt)) @@ -378,6 +389,9 @@ contains ncell, & this%p3theta, & this%w2_mask, & + const_u, & + const_t, & + const_r, & ndf_w3, & undf_w3, & this%map_w3, & diff --git a/science/gungho/unit-test/kernel/solver/project_eliminated_theta_q32_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/project_eliminated_theta_q32_kernel_mod_test.pf index 781923e2bd..09b42f849d 100644 --- a/science/gungho/unit-test/kernel/solver/project_eliminated_theta_q32_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/project_eliminated_theta_q32_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (C) Crown copyright 2022 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. !----------------------------------------------------------------------------- !> Test the weighted q32 matrix @@ -56,7 +58,7 @@ contains class(project_eliminated_theta_q32_test_type), intent(inout) :: this - real(kind=r_solver), parameter :: tol = 1.0e-12_r_solver + real(kind=r_solver), parameter :: tol = 1.0e-7_r_solver ! Mesh integer(kind=i_def), parameter :: ncell = 1 @@ -88,8 +90,6 @@ contains real(kind=r_solver), dimension(undf_wt) :: theta ! Operators real(kind=r_solver), dimension(ncell,ndf_w3,ndf_w3) :: inv_m3 - ! Scalars - real(kind=r_solver) :: const integer(kind=i_def) :: i, df1, df2 real(kind=r_solver), dimension(ndf_w3, ndf_w2) :: answer @@ -122,7 +122,6 @@ contains ! Fields theta = (/ 310.0_r_solver, 322.95_r_solver /) - const = 17.0_r_solver ! Operators inv_m3 = 1.0_r_solver/27.0_r_solver q32 = 0.0_r_solver @@ -133,19 +132,18 @@ contains theta, & ncell, & inv_m3, & - const, & ndf_w3, basis_w3, & ndf_w2, basis_w2, & ndf_wt, undf_wt, map_wt, & basis_wt, diff_basis_wt, & nqp, nqp, wgt, wgt) - ! q32 = const * < basis_w3, (k*dtheta/dz).basis_w2 > + ! q32 = < basis_w3, (k*dtheta/dz).basis_w2 > ! Only the vertical components of W2 are nonzero (df2 = 3,4) answer = 0.0_r_solver do df2 = 3,ndf_w2 do df1 = 1,ndf_w3 - answer(df1,df2) = const / 27.0_r_solver * (theta(2)-theta(1))/(theta(2)+theta(1)) + answer(df1,df2) = 1.0_r_solver / 27.0_r_solver * (theta(2)-theta(1))/(theta(2)+theta(1)) end do end do @assertEqual(answer, q32(1,:,:), tol) diff --git a/science/gungho/unit-test/kernel/solver/sample_eliminated_theta_q32_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/sample_eliminated_theta_q32_kernel_mod_test.pf index 31af441f1e..d84acb4969 100644 --- a/science/gungho/unit-test/kernel/solver/sample_eliminated_theta_q32_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/sample_eliminated_theta_q32_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2021 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. !----------------------------------------------------------------------------- !> Test the weighted q32 matrix @@ -87,8 +89,6 @@ contains ! Fields real(kind=r_solver), dimension(undf_wt) :: theta real(kind=r_solver), dimension(ndf_w3,ndf_w3) :: detj_w3 - ! Scalars - real(kind=r_solver) :: const integer(kind=i_def) :: i, df1, df2 real(kind=r_solver), dimension(ndf_w3, ndf_w2) :: answer @@ -119,7 +119,6 @@ contains ! Fields detj_w3 = real(dx*dy*dz, r_solver) theta = (/ 310.0_r_solver, 322.95_r_solver /) - const = 17.0_r_solver ! Operator q32 = 0.0_r_solver call sample_eliminated_theta_q32_code(cell, & @@ -128,19 +127,18 @@ contains q32, & theta, & detj_w3, & - const, & ndf_w3, undf_w3, & map_w3, basis_w3, & ndf_w2, basis_w2, & ndf_wt, undf_wt, map_wt, & basis_wt, diff_basis_wt) - ! q32 = const * < basis_w3, (k*dtheta/dz).basis_w2 > + ! q32 = < basis_w3, (k*dtheta/dz).basis_w2 > ! Only the vertical components of W2 are nonzero (df2 = 3,4) answer = 0.0_r_solver do df2 = 3,ndf_w2 do df1 = 1,ndf_w3 - answer(df1,df2) = (const/(dx*dy*dz))*(theta(2)-theta(1))/(theta(2)+theta(1)) + answer(df1,df2) = (1.0_r_solver/(dx*dy*dz))*(theta(2)-theta(1))/(theta(2)+theta(1)) end do end do @assertEqual(answer, q32(1,:,:), tol) diff --git a/science/gungho/unit-test/kernel/solver/weighted_div_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/weighted_div_kernel_mod_test.pf index 1d6d6bfff6..86035704dc 100644 --- a/science/gungho/unit-test/kernel/solver/weighted_div_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/weighted_div_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test the theta weighted divergence operator computation @@ -139,7 +141,6 @@ contains ncell_3d, & local_stencil, & theta_p_data, & - 1.0_r_solver, & ndf_w2, & basis_w2, & diff_basis_w2, & diff --git a/science/gungho/unit-test/kernel/solver/weighted_proj_2theta_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/weighted_proj_2theta_kernel_mod_test.pf index c50ada8cd8..75b93001bb 100644 --- a/science/gungho/unit-test/kernel/solver/weighted_proj_2theta_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/weighted_proj_2theta_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer ! For further details please refer to the file LICENCE.original which you ! should have received as part of this distribution. +! Some of the content of this file has been produced with the assistance of +! Met Office GitHub Copilot Enterprise. !----------------------------------------------------------------------------- !> Test the theta weighted divergence operator computation @@ -160,7 +162,6 @@ contains local_stencil, & exner_data, & moist_dyn_data, & - 1.0_r_solver, & ndf_w2, & basis_w2, & diff_basis_w2, & diff --git a/science/gungho/unit-test/kernel/solver/weighted_proj_2thetav_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/weighted_proj_2thetav_kernel_mod_test.pf index b1538eba22..d8a570c5a4 100644 --- a/science/gungho/unit-test/kernel/solver/weighted_proj_2thetav_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/weighted_proj_2thetav_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2023 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. !----------------------------------------------------------------------------- !> Test the theta weighted divergence operator computation @@ -160,7 +162,6 @@ contains local_stencil, & exner_data, & moist_dyn_data, & - 1.0_r_solver, & 0, & 0, & ndf_w2, & diff --git a/science/gungho/unit-test/kernel/solver/weighted_proj_theta2_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/weighted_proj_theta2_kernel_mod_test.pf index 2bb1ba641d..65b6d6f370 100644 --- a/science/gungho/unit-test/kernel/solver/weighted_proj_theta2_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/weighted_proj_theta2_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2023 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. !----------------------------------------------------------------------------- !> Test the projection operator from the velocity space to @@ -145,7 +147,6 @@ contains ncells_3d, & local_stencil, & theta_data, & - 1.0_r_solver, & ndf_wt, & undf_wt, & map_wt(:,cell), & diff --git a/science/gungho/unit-test/kernel/solver/weighted_proj_theta2v_kernel_mod_test.pf b/science/gungho/unit-test/kernel/solver/weighted_proj_theta2v_kernel_mod_test.pf index aa524ace13..56330256ce 100644 --- a/science/gungho/unit-test/kernel/solver/weighted_proj_theta2v_kernel_mod_test.pf +++ b/science/gungho/unit-test/kernel/solver/weighted_proj_theta2v_kernel_mod_test.pf @@ -2,6 +2,8 @@ ! (c) Crown copyright 2023 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. !----------------------------------------------------------------------------- !> Test the projection operator from the velocity space to @@ -145,7 +147,6 @@ contains ncells_3d, & local_stencil, & theta_data, & - 1.0_r_solver, & 0, & 0, & ndf_wt, & diff --git a/science/linear/integration-test/nwp_gal9/resources/nwp_gal9_configuration.nml b/science/linear/integration-test/nwp_gal9/resources/nwp_gal9_configuration.nml index 95ade1f5df..e55c71e023 100644 --- a/science/linear/integration-test/nwp_gal9/resources/nwp_gal9_configuration.nml +++ b/science/linear/integration-test/nwp_gal9/resources/nwp_gal9_configuration.nml @@ -354,7 +354,7 @@ timestep_start='1', ×tepping alpha=0.55, dt=1800, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, runge_kutta_method='forward_euler', diff --git a/science/linear/integration-test/semi_implicit/resources/semi_implicit_configuration.nml b/science/linear/integration-test/semi_implicit/resources/semi_implicit_configuration.nml index 75e188f5ec..aaedd554d0 100644 --- a/science/linear/integration-test/semi_implicit/resources/semi_implicit_configuration.nml +++ b/science/linear/integration-test/semi_implicit/resources/semi_implicit_configuration.nml @@ -220,7 +220,7 @@ calendar_origin='2016-01-01 15:00:00', ×tepping alpha=0.5, dt=10.0, -inner_iterations=2, +inner_iterations_si=2,2 method='semi_implicit', outer_iterations=2, spinup_alpha=.false., diff --git a/science/linear/integration-test/tl_test/tl_test_advect_density_field_mod.x90 b/science/linear/integration-test/tl_test/tl_test_advect_density_field_mod.x90 index 4caac57f06..eec9f97fd9 100644 --- a/science/linear/integration-test/tl_test/tl_test_advect_density_field_mod.x90 +++ b/science/linear/integration-test/tl_test/tl_test_advect_density_field_mod.x90 @@ -14,6 +14,7 @@ module tl_test_advect_density_field_mod use sci_assign_field_random_kernel_mod, & only: assign_field_random_kernel_type use constants_mod, only: i_def, r_def, str_def + use dycore_constants_mod, only: stepper_siqn use field_mod, only: field_type use field_collection_mod, only: field_collection_type use function_space_collection_mod, only: function_space_collection @@ -139,7 +140,7 @@ module tl_test_advect_density_field_mod ! Init stuff call gungho_transport_control_alg_init(mesh) call tl_transport_controller%initialise(modeldb%config, & - modeldb%clock, n_rho, ls_rho, n_u, n_u, ls_u, ls_u & + modeldb%clock, stepper_siqn, n_rho, ls_rho, n_u, n_u, ls_u, ls_u & ) transport_metadata => transport_metadata_collection%get_transport_metadata('density') @@ -169,12 +170,13 @@ module tl_test_advect_density_field_mod inc_X_plus_Y( n_u, p_u ), & inc_X_plus_Y( n_rho, p_rho ) ) - call n_transport_controller%initialise(modeldb%config, modeldb%clock, n_rho, n_u) + call n_transport_controller%initialise(modeldb%config, modeldb%clock, & + stepper_siqn, n_rho, n_u) call transport_field( n_rho_np1, n_rho, n_transport_controller, transport_metadata ) call invoke( X_minus_Y( n2_advection_inc, n_rho_np1, n_rho ) ) call tl_transport_controller%initialise(modeldb%config, & - modeldb%clock, n_rho, ls_rho, p_u, p_u, ls_u, ls_u & + modeldb%clock, stepper_siqn, n_rho, ls_rho, p_u, p_u, ls_u, ls_u & ) call tl_transport_field( & p_rho_np1, p_rho, ls_rho, tl_transport_controller, & diff --git a/science/linear/integration-test/tl_test/tl_test_advect_theta_field_mod.x90 b/science/linear/integration-test/tl_test/tl_test_advect_theta_field_mod.x90 index cb0ee50281..b69a683b7a 100644 --- a/science/linear/integration-test/tl_test/tl_test_advect_theta_field_mod.x90 +++ b/science/linear/integration-test/tl_test/tl_test_advect_theta_field_mod.x90 @@ -14,6 +14,7 @@ module tl_test_advect_theta_field_mod use sci_assign_field_random_kernel_mod, & only: assign_field_random_kernel_type use constants_mod, only: i_def, r_def, str_def + use dycore_constants_mod, only: stepper_siqn use field_mod, only: field_type use field_collection_mod, only: field_collection_type use function_space_collection_mod, only: function_space_collection @@ -140,7 +141,8 @@ module tl_test_advect_theta_field_mod ! Init stuff call gungho_transport_control_alg_init(mesh) - call tl_transport_controller%initialise( modeldb%config, modeldb%clock, n_rho, & + call tl_transport_controller%initialise( modeldb%config, modeldb%clock, & + stepper_siqn, n_rho, & ls_rho, n_u, n_u, ls_u, ls_u ) transport_metadata => transport_metadata_collection%get_transport_metadata('potential_temperature') @@ -171,12 +173,13 @@ module tl_test_advect_theta_field_mod inc_X_plus_Y( n_u, p_u ), & inc_X_plus_Y( n_theta, p_theta ) ) - call n_transport_controller%initialise(modeldb%config, modeldb%clock, n_rho, n_u) + call n_transport_controller%initialise(modeldb%config, modeldb%clock, & + stepper_siqn, n_rho, n_u) call transport_field( n_theta_np1, n_theta, n_transport_controller, transport_metadata ) call invoke( X_minus_Y( n2_advection_inc, n_theta_np1, n_theta ) ) call tl_transport_controller%initialise( modeldb%config, & - modeldb%clock, n_rho, ls_rho, p_u, p_u, ls_u, ls_u & + modeldb%clock, stepper_siqn, n_rho, ls_rho, p_u, p_u, ls_u, ls_u & ) call tl_transport_field( & p_theta_np1, p_theta, ls_theta, tl_transport_controller, & diff --git a/science/linear/integration-test/tl_test/tl_test_rhs_alg_mod.x90 b/science/linear/integration-test/tl_test/tl_test_rhs_alg_mod.x90 index 306e92c782..ce90a409aa 100644 --- a/science/linear/integration-test/tl_test/tl_test_rhs_alg_mod.x90 +++ b/science/linear/integration-test/tl_test/tl_test_rhs_alg_mod.x90 @@ -10,6 +10,7 @@ module tl_test_rhs_alg_mod use constants_mod, only: i_def, r_def, str_def + use dycore_constants_mod, only: stepper_siqn use driver_modeldb_mod, only: modeldb_type use field_array_mod, only: field_array_type use field_mod, only: field_type @@ -174,7 +175,8 @@ module tl_test_rhs_alg_mod call set_bundle_scalar( 0.0_r_def, n1_rhs, bundle_size ) call rhs_alg( n1_rhs, dt, ls_state, ls_state, ls_moist_dyn, & compute_eos=.true., compute_rhs_t_d=.true., & - dlayer_rhs=.true., model_clock=modeldb%clock ) + dlayer_rhs=.true., stepper=stepper_siqn, & + model_clock=modeldb%clock ) do n=1,2 gamma_u = gamma_u / 2.0_r_def @@ -202,11 +204,13 @@ module tl_test_rhs_alg_mod call rhs_alg( n2_rhs, dt, state, state, n_moist_dyn, & compute_eos=.true., compute_rhs_t_d=.true., & - dlayer_rhs=.true., model_clock=modeldb%clock ) + dlayer_rhs=.true., stepper=stepper_siqn, & + model_clock=modeldb%clock ) call tl_rhs_alg(p_rhs, dt, p_state, p_state, p_moist_dyn, & ls_state, ls_moist_dyn, & compute_eos=.true., dlayer_rhs=.true., & + stepper=stepper_siqn, & model_clock=modeldb%clock) ! diff = n2_rhs - n1_rhs diff --git a/science/linear/integration-test/tl_test/tl_test_semi_imp_alg_mod.x90 b/science/linear/integration-test/tl_test/tl_test_semi_imp_alg_mod.x90 index 30bf004ec0..d058159341 100644 --- a/science/linear/integration-test/tl_test/tl_test_semi_imp_alg_mod.x90 +++ b/science/linear/integration-test/tl_test/tl_test_semi_imp_alg_mod.x90 @@ -351,7 +351,7 @@ module tl_test_semi_imp_alg_mod call tl_semi_implicit_alg_final() call tl_semi_implicit_alg_init(mesh, p_u, p_rho, p_theta, p_exner, & p_mr, ls_u, ls_rho, ls_theta, ls_exner, & - ls_mr, ls_moist_dyn) + ls_mr, ls_moist_dyn, modeldb) call tl_semi_implicit_alg_step(modeldb, p_u, p_rho, p_theta, & p_exner, p_mr, p_moist_dyn, & diff --git a/science/linear/integration-test/tl_test/tl_test_transport_control_mod.x90 b/science/linear/integration-test/tl_test/tl_test_transport_control_mod.x90 index f69d43a1fb..3ba90c0700 100644 --- a/science/linear/integration-test/tl_test/tl_test_transport_control_mod.x90 +++ b/science/linear/integration-test/tl_test/tl_test_transport_control_mod.x90 @@ -10,6 +10,7 @@ module tl_test_transport_control_mod use sci_assign_field_random_kernel_mod, & only: assign_field_random_kernel_type use constants_mod, only: i_def, r_def, str_def + use dycore_constants_mod, only: stepper_siqn use field_array_mod, only: field_array_type use field_mod, only: field_type use sci_field_bundle_builtins_mod, only: clone_bundle, & @@ -198,6 +199,7 @@ module tl_test_transport_control_mod ls_mr, & modeldb%clock, & outer, & + stepper_siqn, & cheap_update = .false.) gamma_u = 1._r_def @@ -241,6 +243,7 @@ module tl_test_transport_control_mod n_mr_in, & modeldb%clock, & outer, & + stepper_siqn, & cheap_update = .false. ) call tl_transport_control_alg(modeldb%config, & @@ -255,7 +258,8 @@ module tl_test_transport_control_mod ls_state(igh_u), & ls_mr, & modeldb%clock, & - outer ) + outer, & + stepper_siqn ) ! diff = n2_rhs - n1_rhs call minus_bundle( n2_rhs, n1_rhs, diff, bundle_size ) diff --git a/science/linear/source/algorithm/core_dynamics/tl_rhs_alg_mod.x90 b/science/linear/source/algorithm/core_dynamics/tl_rhs_alg_mod.x90 index 2ddbc1022b..9c389182fb 100644 --- a/science/linear/source/algorithm/core_dynamics/tl_rhs_alg_mod.x90 +++ b/science/linear/source/algorithm/core_dynamics/tl_rhs_alg_mod.x90 @@ -84,11 +84,12 @@ contains !! linearisation state !> @param[in] compute_eos Flag to control computation of the equation of !! state + !> @param[in] stepper Enumerator for the timestepper !> @param[in] dlayer_rhs Use damping layer in rhs yes/no !> @param[in] model_clock Time in the model subroutine tl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & ls_state, ls_moist_dyn, compute_eos, & - dlayer_rhs, model_clock) + dlayer_rhs, stepper, model_clock) implicit none @@ -103,6 +104,7 @@ subroutine tl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & type(field_type), intent(in) :: ls_moist_dyn(num_moist_factors) type(field_type), intent(inout) :: rhs(bundle_size) logical(kind=l_def), intent(in) :: compute_eos + integer(kind=i_def), intent(in) :: stepper class(model_clock_type), intent(in) :: model_clock type(operator_type), pointer :: mm_vel => null(), & @@ -150,7 +152,7 @@ subroutine tl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, & ! Using modified velocity mass matrix if using damping layer if (dlayer_rhs) then - mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, mesh%get_id(), model_clock) + mm_vel => get_w2_mass_matrix(w2_damping_layer_matrix, stepper, mesh%get_id(), model_clock) else mm_vel => get_mass_matrix_fe(W2, mesh%get_id()) end if diff --git a/science/linear/source/algorithm/timestepping/tl_rk_alg_timestep_mod.x90 b/science/linear/source/algorithm/timestepping/tl_rk_alg_timestep_mod.x90 index 0afcbe06d9..2b6587577d 100644 --- a/science/linear/source/algorithm/timestepping/tl_rk_alg_timestep_mod.x90 +++ b/science/linear/source/algorithm/timestepping/tl_rk_alg_timestep_mod.x90 @@ -43,7 +43,8 @@ module tl_rk_alg_timestep_mod copy_bundle, & set_bundle_scalar use dycore_constants_mod, only: get_geopotential, & - get_coriolis + get_coriolis, & + stepper_rk ! PsyKAl PSYClone kernels use sci_enforce_bc_kernel_mod, only: enforce_bc_kernel_type @@ -323,7 +324,8 @@ contains ls_state_stage(igh_u,stage), & ls_state_stage(igh_u,stage), & ls_mr, ls_mr, model_clock, & - 1_i_def, cheap_update = .false. ) + 1_i_def, stepper_rk, & + cheap_update = .false. ) ! Compute new rhs if ( rotating ) then @@ -413,7 +415,8 @@ contains ls_state_stage(:,stage), & ls_state_stage(igh_u,stage), & ls_state_stage(igh_u,stage), & - ls_mr, model_clock, 1_i_def ) + ls_mr, model_clock, 1_i_def, & + stepper_rk ) ! Compute new rhs if ( rotating ) then diff --git a/science/linear/source/algorithm/timestepping/tl_si_timestep_alg_mod.x90 b/science/linear/source/algorithm/timestepping/tl_si_timestep_alg_mod.x90 index bcef6d798a..08a57035ff 100644 --- a/science/linear/source/algorithm/timestepping/tl_si_timestep_alg_mod.x90 +++ b/science/linear/source/algorithm/timestepping/tl_si_timestep_alg_mod.x90 @@ -34,7 +34,7 @@ module tl_si_timestep_alg_mod use mixed_solver_config_mod, only: guess_np1, & reference_reset_time use timestepping_config_mod, only: alpha, & - outer_iterations, inner_iterations, & + outer_iterations, inner_iterations_si,& spinup_alpha use transport_config_mod, only: use_density_predictor use derived_config_mod, only: bundle_size @@ -77,9 +77,11 @@ module tl_si_timestep_alg_mod use tl_transport_control_alg_mod, & only: tl_transport_control_alg - use si_operators_alg_mod, only: create_si_operators, & - compute_si_operators, & + use si_operators_alg_mod, only: create_si_operators, & + compute_si_operators_common, & + compute_helmholtz_operators, & final_si_operators + use dycore_constants_mod, only: stepper_siqn use checks_and_balances_alg_mod, only: check_fields use semi_implicit_solver_alg_mod,only: semi_implicit_solver_alg_init, & @@ -149,7 +151,8 @@ module tl_si_timestep_alg_mod type( field_type ), allocatable :: ls_rhs_phys(:,:,:) type( field_type ), allocatable :: ls_mr_itns(:,:,:) type( field_type ), allocatable :: ls_moist_dyn_itns(:,:,:) - integer( i_def ) :: ls_outer_iterations, ls_inner_iterations + integer( i_def ), allocatable :: ls_inner_iterations(:) + integer( i_def ) :: ls_outer_iterations type( field_type ) :: theta_fv_inc ! theta fv transport increment to change to weak form @@ -172,9 +175,11 @@ contains !> @param[in] ls_exner Lin. state for Exner pressure !> @param[in] ls_mr Lin. state for Mixing ratios !> @param[in] ls_moist_dyn Lin. state for moist dynamical factors + !> @param[in] modeldb Structure containing the model state, used to + !! obtain the namelist configuration and clock subroutine tl_semi_implicit_alg_init( mesh, u, rho, theta, exner, mr, & ls_u, ls_rho, ls_theta, ls_exner, & - ls_mr, ls_moist_dyn, partial_init ) + ls_mr, ls_moist_dyn, modeldb, partial_init ) implicit none @@ -188,6 +193,10 @@ contains type( field_type ), intent( inout ) :: ls_mr(nummr) type( field_type ), intent( inout ) :: ls_moist_dyn(num_moist_factors) + ! Model database, providing the namelist configuration and clock needed to + ! create the semi-implicit operators + type(modeldb_type), intent( in ) :: modeldb + ! When atlt_si_timestep_alg_mod in adjoint_tests is run, this routine is called ! but it has been already. Hence we have a switch to turn off aspects of the ! initialisation that would result in attempts to allocate where memory is already @@ -210,12 +219,14 @@ contains ! but ls_outer_iterations and ls_inner_iterations are set to ! 1 so that the arrays are defined. ls_outer_iterations = 1_i_def - ls_inner_iterations = 1_i_def + if (.not. allocated(ls_inner_iterations)) allocate(ls_inner_iterations(1)) + ls_inner_iterations(:) = 1_i_def else ! The linearisation state is evolved, and the intermediate iterations ! are used to calculate the evolution of the perturbation. ls_outer_iterations = outer_iterations - ls_inner_iterations = inner_iterations + if (.not. allocated(ls_inner_iterations)) allocate(ls_inner_iterations(outer_iterations)) + ls_inner_iterations(:) = inner_iterations_si(:) end if if (full_init) then @@ -242,19 +253,19 @@ contains allocate(ls_mr_after_slow(nummr)) allocate(ls_state_itns(bundle_size, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_rhs_np1(bundle_size, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_rhs_adv(bundle_size, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_rhs_phys(bundle_size, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_mr_inc(nummr, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_mr_itns(nummr, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) allocate(ls_moist_dyn_itns(num_moist_factors, & - ls_outer_iterations, ls_inner_iterations )) + ls_outer_iterations, maxval(ls_inner_iterations) )) end if !-------------------------------------------------------------------- @@ -287,7 +298,7 @@ contains call clone_bundle(state, ls_rhs_n, bundle_size) do outer = 1, ls_outer_iterations - do inner = 1, ls_inner_iterations + do inner = 1, ls_inner_iterations(outer) call clone_bundle(state, ls_state_itns(:, outer, inner), bundle_size) call clone_bundle(state, ls_rhs_np1(:, outer, inner), bundle_size) call clone_bundle(state, ls_rhs_adv(:, outer, inner), bundle_size) @@ -312,7 +323,7 @@ contains call clone_bundle(ls_mr, ls_mr_after_slow, nummr) do outer = 1,ls_outer_iterations - do inner = 1, ls_inner_iterations + do inner = 1, ls_inner_iterations(outer) call clone_bundle(ls_moist_dyn, ls_moist_dyn_itns(:, outer, inner), & num_moist_factors) call clone_bundle(ls_mr, ls_mr_itns(:, outer, inner), nummr) @@ -332,9 +343,10 @@ contains ! Operators for si solves !-------------------------------------------------------------------- if (full_init) then - call create_si_operators( mesh ) + call create_si_operators( mesh, stepper_siqn, modeldb%config, & + modeldb%clock ) call gungho_transport_control_alg_init( mesh ) - call semi_implicit_solver_alg_init( state ) + call semi_implicit_solver_alg_init( state, stepper_siqn ) end if call log_event( "semi_implicit_timestep: initialised timestepping algorithm", LOG_LEVEL_INFO ) @@ -480,13 +492,14 @@ contains ! The reference_reset_time is specified in the configuration namelist. ! Note that this reset can only occur at most once per timestep. reference_reset_freq = nint(reference_reset_time / cast_dt, i_def) - if ( mod(modeldb%clock%get_step() - 1_i_def, reference_reset_freq) == 0_i_def ) & - call compute_si_operators(modeldb%config, & - ls_state(igh_t), & - ls_state(igh_d), & - ls_state(igh_p), & - modeldb%clock, & - ls_moist_dyn_itns(:,1,1)) + if ( mod(modeldb%clock%get_step() - 1_i_def, reference_reset_freq) == 0_i_def ) then + call compute_si_operators_common(modeldb%config, & + ls_state(igh_t), & + ls_state(igh_d), & + ls_state(igh_p), & + ls_moist_dyn_itns(:,1,1)) + call compute_helmholtz_operators(modeldb%clock, stepper_siqn) + end if !-------------------------------------------------------------------- @@ -499,7 +512,8 @@ contains call rhs_alg( ls_rhs_n, varbeta*cast_dt, ls_state_after_slow, & ls_state_n, ls_moist_dyn_itns(:,1,1), & compute_eos=.false., compute_rhs_t_d=.true., & - dlayer_rhs=.false., model_clock=modeldb%clock ) + dlayer_rhs=.false., stepper=stepper_siqn, & + model_clock=modeldb%clock ) if ( .not. si_momentum_equation ) then ! Predictor of the wind field (u-beta*dt*rhs) to be advected if using @@ -521,6 +535,7 @@ contains ls_mr_itns(:, outer, 1), & ls_mr_after_slow(:), & modeldb%clock, outer, & + stepper_siqn, & cheap_update = .false. ) ! Convert theta increment to weak form @@ -549,14 +564,14 @@ contains !===================================================================== ! Start the Inner (nonlinear, coriolis) loop !===================================================================== - ls_inner_dynamics_loop: do inner = 1,ls_inner_iterations + ls_inner_dynamics_loop: do inner = 1,ls_inner_iterations(outer) write( log_scratch_space, '(A,2I3)' ) 'loop indices (o, i): ', & outer, inner call log_event( log_scratch_space, LOG_LEVEL_INFO ) ! Calculate the counters for the next iteration - if ( inner == inner_iterations ) then + if ( inner == inner_iterations_si(outer) ) then next_inner = 1 next_outer = outer + 1 else @@ -568,7 +583,7 @@ contains ! - and not the final iteration. So the final loop of the nonlinear is ! not required. if ( next_outer <= outer_iterations .and. & - next_inner <= inner_iterations ) then + next_inner <= inner_iterations_si(outer) ) then !-------------------------------------------------------------------- ! Compute the time-level n+1 dynamics terms @@ -581,6 +596,7 @@ contains compute_eos=.true., & compute_rhs_t_d=.true., & dlayer_rhs=dlayer_on, & + stepper=stepper_siqn, & model_clock=modeldb%clock ) !-------------------------------------------------------------------- @@ -650,7 +666,7 @@ contains dry_flux_solver, & ls_moist_dyn_itns(gas_law, next_outer, next_inner), & ls_mr_itns(:, next_outer, next_inner), & - first_iteration=(inner==1) ) + first_iteration=(inner==1), stepper=stepper_siqn ) ! If not already done update factors for moist dynamics if ( .not. guess_np1 .and. use_moisture) then call moist_dyn_factors_alg( & @@ -720,7 +736,7 @@ contains !-------------------------------------------------------------------- call tl_rhs_alg( rhs_n, varbeta*cast_dt, state_after_slow, state_n, & moist_dyn, ls_state_n, ls_moist_dyn_itns(:, 1,1), & - .false., .false., model_clock=modeldb%clock ) + .false., .false., stepper_siqn, model_clock=modeldb%clock ) call invoke(setval_c( rhs_np1(igh_u), 0.0_r_def )) @@ -761,7 +777,8 @@ contains ls_state_n(igh_u), & ls_mr_after_slow, & modeldb%clock, & - outer ) + outer, & + stepper_siqn) ! Convert theta increment to weak form call invoke( setval_X(theta_fv_inc, rhs_adv(igh_t)), & @@ -783,6 +800,7 @@ contains ls_moist_dyn_itns( :, ls_outer, 1 ), & .true., & dlayer_on, & + stepper_siqn, & modeldb%clock ) end if @@ -810,7 +828,7 @@ contains !======================================================================= ! Start the Inner (nonlinear, coriolis) loop !======================================================================= - inner_dynamics_loop: do inner = 1,inner_iterations + inner_dynamics_loop: do inner = 1,inner_iterations_si(outer) write( log_scratch_space, '(A,2I3)' ) 'loop indices (o, i): ', & outer, inner call log_event( log_scratch_space, LOG_LEVEL_INFO ) @@ -835,6 +853,7 @@ contains ls_moist_dyn_itns(:, ls_outer, ls_inner), & .true., & dlayer_on, & + stepper_siqn, & modeldb%clock) end if @@ -878,7 +897,8 @@ contains dry_flux_solver, & moist_dyn(gas_law), & mr, & - first_iteration=(inner==1) ) + first_iteration=(inner==1), & + stepper=stepper_siqn ) end if ! Update factors for moist dynamics @@ -1011,6 +1031,7 @@ contains if (allocated(ls_mr_inc)) deallocate(ls_mr_inc) if (allocated(ls_mr_itns)) deallocate(ls_mr_itns) if (allocated(ls_moist_dyn_itns)) deallocate(ls_moist_dyn_itns) + if (allocated(ls_inner_iterations)) deallocate(ls_inner_iterations) return end subroutine tl_semi_implicit_alg_final diff --git a/science/linear/source/algorithm/transport/control/tl_transport_control_alg_mod.x90 b/science/linear/source/algorithm/transport/control/tl_transport_control_alg_mod.x90 index f5d68b3d2c..56ea1d00c1 100644 --- a/science/linear/source/algorithm/transport/control/tl_transport_control_alg_mod.x90 +++ b/science/linear/source/algorithm/transport/control/tl_transport_control_alg_mod.x90 @@ -51,12 +51,12 @@ contains !> @param[in] ls_mr_in PASSIVE Moisture fields before transport !> @param[in] model_clock Time within the model !> @param[in] outer Outer (advection) iteration number - !> + !> @param[in] stepper Enumerator for timestepper subroutine tl_transport_control_alg(config, advection_inc, advected_fields, & wind_np1, wind_n, mr_out, mr_in, & ls_advected_fields, & ls_wind_np1, ls_wind_n, ls_mr_in, & - model_clock, outer ) + model_clock, outer, stepper ) use derived_config_mod, only: bundle_size use sci_field_bundle_builtins_mod, only: clone_bundle, set_bundle_scalar @@ -88,6 +88,7 @@ contains type(field_type), intent(in) :: ls_mr_in(nummr) class(model_clock_type), intent(in) :: model_clock integer(kind=i_def), intent(in) :: outer + integer(kind=i_def), intent(in) :: stepper ! Internal variables type(field_type) :: fields_np1(bundle_size) @@ -115,8 +116,8 @@ contains end if ! Initialise the transport controllers ------------------------------------- - call tl_transport_controller%initialise( config, & - model_clock, advected_fields(igh_d), ls_advected_fields(igh_d), & + call tl_transport_controller%initialise( config, model_clock, stepper, & + advected_fields(igh_d), ls_advected_fields(igh_d), & wind_n, wind_np1, ls_wind_n, ls_wind_np1, & outer=outer, cheap_update_step=cheap_update_step ) diff --git a/science/linear/source/algorithm/transport/control/tl_transport_controller_mod.x90 b/science/linear/source/algorithm/transport/control/tl_transport_controller_mod.x90 index 3d50361760..095b6aa634 100644 --- a/science/linear/source/algorithm/transport/control/tl_transport_controller_mod.x90 +++ b/science/linear/source/algorithm/transport/control/tl_transport_controller_mod.x90 @@ -59,6 +59,7 @@ contains !! and perturbed winds and densities. !> @param[in] config Application namelist configuration object !> @param[in] model_clock Tracks the time within the model + !> @param[in] stepper Enumerator for timestepper !> @param[in] ref_field_rdef Perturbed reference density to use for !! conservative transport of tracers. !> @param[in] ls_ref_field_rdef Linear reference density to use for @@ -77,8 +78,9 @@ contains !! the transporting wind is the *difference* !! in wind from the previous step, rather !! than the full transport wind. - subroutine initialise(self, config, model_clock, ref_field_rdef, & - ls_ref_field_rdef, wind_n_rdef, wind_np1_rdef, & + subroutine initialise(self, config, model_clock, stepper, & + ref_field_rdef, ls_ref_field_rdef, & + wind_n_rdef, wind_np1_rdef, & ls_wind_n_rdef, ls_wind_np1_rdef, & outer, cheap_update_step) @@ -94,21 +96,25 @@ contains type(field_type), intent(in) :: ls_wind_np1_rdef type(field_type), intent(in) :: ref_field_rdef type(field_type), intent(in) :: ls_ref_field_rdef + integer(kind=i_def), intent(in) :: stepper integer(kind=i_def), optional, intent(in) :: outer logical(kind=l_def), optional, intent(in) :: cheap_update_step self%config => config - call self%ls_wind_ls_rho_controller%initialise( self%config, & - model_clock, ls_ref_field_rdef, ls_wind_n_rdef, ls_wind_np1_rdef, & + call self%ls_wind_ls_rho_controller%initialise( & + self%config, model_clock, stepper, & + ls_ref_field_rdef, ls_wind_n_rdef, ls_wind_np1_rdef, & outer=outer, cheap_update_step=cheap_update_step ) - call self%ls_wind_pert_rho_controller%initialise( self%config, & - model_clock, ref_field_rdef, ls_wind_n_rdef, ls_wind_np1_rdef, & + call self%ls_wind_pert_rho_controller%initialise( & + self%config, model_clock, stepper, & + ref_field_rdef, ls_wind_n_rdef, ls_wind_np1_rdef, & outer=outer, cheap_update_step=cheap_update_step ) - call self%pert_wind_ls_rho_controller%initialise( self%config, & - model_clock, ls_ref_field_rdef, wind_n_rdef, wind_np1_rdef, & + call self%pert_wind_ls_rho_controller%initialise( & + self%config, model_clock, stepper, & + ls_ref_field_rdef, wind_n_rdef, wind_np1_rdef, & outer=outer, cheap_update_step=cheap_update_step ) end subroutine initialise diff --git a/science/linear/source/driver/linear_model_mod.f90 b/science/linear/source/driver/linear_model_mod.f90 index 6c20f35d55..e67a44b2c5 100644 --- a/science/linear/source/driver/linear_model_mod.f90 +++ b/science/linear/source/driver/linear_model_mod.f90 @@ -97,7 +97,7 @@ subroutine initialise_linear_model( mesh, & call final_si_operators() 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) + ls_mr, ls_moist_dyn, modeldb) case( method_rk ) ! RK ! Initialise and output initial conditions for first timestep