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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
| DrTVockerodtMO | Terence Vockerodt | Met Office | 2026-01-08 |
| MetBenjaminWent | Benjamin Went | Met Office | 2026-01-15 |
| timgraham-Met | Tim Graham | Met Office | 2026-01-15 |
| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-19 |
| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-19 |
| cjohnson-pi | Christine Johnson | Met Office | 2026-01-21 |
83 changes: 0 additions & 83 deletions applications/linear_model/plot_convergence/plot_convergence.sh

This file was deleted.

12 changes: 7 additions & 5 deletions science/gungho/source/driver/gungho_step_mod.x90
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ module gungho_step_mod
'(A,I0)' ) 'Start of timestep ', model_clock%get_step()
call log_event( log_scratch_space, LOG_LEVEL_INFO )

temp_corr_io_value => get_io_value( modeldb%values, 'temperature_correction_io_value')
call modeldb%values%get_value( 'total_dry_mass', total_dry_mass )
call modeldb%values%get_value( 'total_energy', total_energy )
call modeldb%values%get_value( 'total_energy_previous', &
total_energy_previous )
if ( encorr_usage /= encorr_usage_none .or. write_conservation_diag ) then
temp_corr_io_value => get_io_value( modeldb%values, 'temperature_correction_io_value')
call modeldb%values%get_value( 'total_dry_mass', total_dry_mass )
call modeldb%values%get_value( 'total_energy', total_energy )
call modeldb%values%get_value( 'total_energy_previous', &
total_energy_previous )
end if

use_moisture = ( moisture_formulation /= moisture_formulation_dry )

Expand Down
1 change: 1 addition & 0 deletions science/linear/integration-test/nwp_gal9/ReadMe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The nwp_gal9.nml matches the configuration from the default rose-app.conf, in linear_model.
124 changes: 124 additions & 0 deletions science/linear/integration-test/nwp_gal9/iodef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<simulation>

<!-- In this version we have ONE context -->

<context id = "gungho_atm">

<domain_definition comment="to be sized by the model">
<domain id="face" type="unstructured" comment="for dofs over faces of plane mesh"/>
<domain id="edge" type="unstructured" comment="for dofs over edges of plane mesh"/>
<domain id="node" type="unstructured" comment="for dofs over vertices of plane mesh"/>
</domain_definition>

<axis_definition>
<axis id="vert_axis_half_levels" name="half_levels"/>
<axis id="vert_axis_full_levels" name="full_levels"/>
<axis id="radiation_levels" name="radiation_levels"/>
<axis id="monthly_climatology" name="monthly_climatology" n_glo="12"/>
<axis id="ls_axis" name="ls_axis" n_glo="7"/>
</axis_definition>

<grid_definition>
<grid id="node_grid">
<domain domain_ref="node"/>
<axis axis_ref="vert_axis_full_levels"/>
</grid>
<grid id="half_level_face_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_half_levels"/>
</grid>
<grid id="full_level_face_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_full_levels"/>
</grid>
<grid id="half_level_edge_grid">
<domain domain_ref="edge"/>
<axis axis_ref="vert_axis_half_levels"/>
</grid>
<grid id="3D_monthly_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_half_levels"/>
<axis axis_ref="monthly_climatology"/>
</grid>
<grid id="full_level_face_time_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_full_levels"/>
<axis axis_ref="ls_axis"/>
</grid>
<grid id="half_level_face_time_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_half_levels"/>
<axis axis_ref="ls_axis"/>
</grid>
<grid id="half_level_edge_time_grid">
<domain domain_ref="edge"/>
<axis axis_ref="vert_axis_half_levels"/>
<axis axis_ref="ls_axis"/>
</grid>
</grid_definition>

<file_definition
type="one_file"
time_counter="none">

<file id="lfric_initial" name="lfric_initial" mode="read" output_freq="1ts" convention="UGRID" cyclic="true" enabled=".FALSE.">
</file>

<!-- File definition for reading in from a UM2LFRic FD UGRID format dump -->

<file id="read_lfric_fd_dump" name="lfric_fd_dump" mode="read" output_freq="1ts" convention="UGRID" cyclic="true" enabled=".FALSE.">
<field id="read_h_u" name="h_u" long_name="horizontal_wind" standard_name="horizontal_wind" unit="m s-1" grid_ref="half_level_edge_grid" operation="instant" />
<field id="read_v_u" name="v_u" long_name="vertical_wind" standard_name="vertical_wind" unit="m s-1" grid_ref="full_level_face_grid" operation="instant" />
<field id="read_theta" name="theta" long_name="air_potential_temperature" standard_name="air_potential_temperature" unit="K" grid_ref="full_level_face_grid" operation="instant" />
<field id="read_rho" name="rho" long_name="air_density" unit="kg m-3" grid_ref="half_level_face_grid" operation="instant" />
<field id="read_exner" name="exner" long_name="exner_pressure" unit="1" grid_ref="half_level_face_grid" operation="instant" />
<field id="read_m_v" name="m_v" long_name="humidity_mixing_ratio" unit="kg/kg" grid_ref="full_level_face_grid" operation="instant" />
<field id="read_m_cl" name="m_cl" long_name="cloud_liquid_water_mixing_ratio" unit="kg/kg" grid_ref="full_level_face_grid" operation="instant" />
<field id="read_m_s" name="m_s" long_name="cloud_ice_mixing_ratio" unit="kg/kg" grid_ref="full_level_face_grid" operation="instant" />
<field id="read_m_r" name="m_r" long_name="rain_mixing_ratio" unit="kg/kg" grid_ref="full_level_face_grid" operation="instant" />
</file>

<!-- ANCIL FILES -->

<file id="orography_mean_ancil" name="orography_mean_ancil" mode="read" output_freq="1ts" convention="UGRID" cyclic="false" enabled=".FALSE.">
<field id="surface_altitude" name="surface_altitude" long_name="Surface altitude" unit="m" operation="once" domain_ref="face"/>
</file>

<!-- LS files -->
<file id="ls" name="ls" mode="read" output_freq="1ts" convention="UGRID" cyclic="true" enabled=".FALSE.">
<field id="ls_time" name="time" unit="seconds" operation="once" axis_ref="ls_axis" />
<field id="ls_theta_data" name="theta" long_name="air_potential_temperature" standard_name="air_potential_temperature" unit="K" grid_ref="full_level_face_time_grid" operation="once" />
<field id="ls_m_v_data" name="m_v" long_name="m_v" standard_name="m_v" unit="kg/kg" grid_ref="full_level_face_time_grid" operation="once" />
<field id="ls_m_cl_data" name="m_cl" long_name="m_cl" standard_name="m_cl" unit="kg/kg" grid_ref="full_level_face_time_grid" operation="once" />
<field id="ls_m_s_data" name="m_s" long_name="m_s" standard_name="m_s" unit="kg/kg" grid_ref="full_level_face_time_grid" operation="once" />
<field id="ls_m_r_data" name="m_r" long_name="m_r" standard_name="m_r" unit="kg/kg" grid_ref="full_level_face_time_grid" operation="once" />
<field id="ls_rho_data" name="rho" long_name="air_density" standard_name="air_density" unit="kg m-3" grid_ref="half_level_face_time_grid" operation="once"/>
<field id="ls_exner_data" name="exner" long_name="exner_pressure" unit="1" grid_ref="half_level_face_time_grid" operation="once"/>
<!--<field id="ls_h_u_data" name="h_u" long_name="horiz wind" unit="m s-1" grid_ref="half_level_edge_time_grid" operation="once"/>-->
<!--<field id="ls_v_u_data" name="v_u" long_name="upward wind" standard_name="upward_wind" unit="K" grid_ref="full_level_face_time_grid" operation="once" />-->
<field id="ls_u_in_w3_data" name="u_in_w3" long_name="NS wind" unit="m s-1" grid_ref="half_level_face_time_grid" operation="once"/>
<field id="ls_v_in_w3_data" name="v_in_w3" long_name="EW wind" unit="m s-1" grid_ref="half_level_face_time_grid" operation="once"/>
<field id="ls_w_in_wth_data" name="w_in_wth" long_name="Upward wind" unit="m s-1" grid_ref="full_level_face_time_grid" operation="once"/>
</file>

</file_definition>

</context>

<context id = "xios">
<variable_definition>
<variable_group id = "buffer">
<variable id = "optimal_buffer_size" type = "string" >performance</variable>
<variable id = "buffer_factor_size" type = "double" >1.0</variable>
</variable_group>

<variable_group id = "parameters" >
<variable id = "using_server" type = "bool" >true</variable>
<variable id = "info_level" type = "int" >50</variable>
<variable id = "print_file" type="bool">true</variable>
</variable_group>
</variable_definition>
</context>

</simulation>
144 changes: 144 additions & 0 deletions science/linear/integration-test/nwp_gal9/nwp_gal9.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
!-----------------------------------------------------------------------------
! (C) Crown copyright 2026 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 The top level program for the tangent linear tests.
!>@details The default is to run all available tests - which
!! test whether the linear code is tangent linear to the
!! corresponding nonlinear code.
program nwp_gal9

use driver_collections_mod, only: init_collections, final_collections
use driver_time_mod, only: init_time, final_time
use driver_comm_mod, only: init_comm, final_comm
use driver_log_mod, only: init_logger, final_logger
use driver_config_mod, only: init_config, final_config
use driver_modeldb_mod, only: modeldb_type
use lfric_mpi_mod, only: global_mpi
use gungho_mod, only: gungho_required_namelists
use log_mod, only: log_event, &
LOG_LEVEL_ERROR, &
LOG_LEVEL_INFO
use linear_driver_mod, only: initialise, finalise
use tl_test_driver_mod, only: run_timesteps, &
run_transport_control, &
run_semi_imp_alg, &
run_rhs_alg

implicit none

! Model run working data set
type(modeldb_type) :: modeldb
character(*), parameter :: application_name = 'nwp_gal9'
character(:), allocatable :: filename

! Variables used for parsing command line arguments
integer :: length, status, nargs
character(len=0) :: dummy
character(len=:), allocatable :: program_name, test_flag

! Flags which determine the tests that will be carried out
logical :: do_test_timesteps = .false.
logical :: do_test_transport_control = .false.
logical :: do_test_semi_imp_alg = .false.
logical :: do_test_rhs_alg = .false.

! Usage message to print
character(len=256) :: usage_message

modeldb%mpi => global_mpi

call modeldb%configuration%initialise( application_name, table_len=10 )
call modeldb%values%initialise('values', 5)

call log_event( 'TL testing running ...', LOG_LEVEL_INFO )

! Create the depository, prognostics and diagnostics field collections
call modeldb%fields%add_empty_field_collection("depository", table_len = 100)
call modeldb%fields%add_empty_field_collection("prognostic_fields", &
table_len = 100)
call modeldb%fields%add_empty_field_collection("diagnostic_fields", &
table_len = 100)
call modeldb%fields%add_empty_field_collection("lbc_fields", &
table_len = 100)
call modeldb%fields%add_empty_field_collection("radiation_fields", &
table_len = 100)
call modeldb%fields%add_empty_field_collection("fd_fields", &
table_len = 100)


call modeldb%io_contexts%initialise(application_name, 100)

! Parse command line parameters
call get_command_argument( 0, dummy, length, status )
allocate(character(length)::program_name)
call get_command_argument( 0, program_name, length, status )
nargs = command_argument_count()

! Print out usage message if wrong number of arguments is specified
if (nargs /= 2) then
write(usage_message,*) "Usage: ",trim(program_name), &
" <namelist filename> " // &
" test_XXX with XXX in { " // &
" timesteps, " // &
" transport_control, " // &
" semi_imp_alg, " // &
" rhs_alg, " // &
" } "
call log_event( trim(usage_message), LOG_LEVEL_ERROR )
end if

call get_command_argument( 1, dummy, length, status )
allocate( character(length) :: filename )
call get_command_argument( 1, filename, length, status )

call get_command_argument( 2, dummy, length, status )
allocate(character(length)::test_flag)
call get_command_argument( 2, test_flag, length, status )

! Choose test case depending on flag provided in the first command
! line argument
select case (trim(test_flag))
case ("test_timesteps")
do_test_timesteps = .true.
case ("test_transport_control")
do_test_transport_control = .true.
case ("test_semi_imp_alg")
do_test_semi_imp_alg = .true.
case ("test_rhs_alg")
do_test_rhs_alg = .true.
case default
call log_event( "Unknown test", LOG_LEVEL_ERROR )
end select

call init_comm( application_name, modeldb )
call init_config( filename, gungho_required_namelists, &
modeldb%configuration )
call init_logger( modeldb%mpi%get_comm(), application_name )
call init_collections()
call init_time( modeldb )
call initialise( application_name, modeldb )

if (do_test_timesteps) then
call run_timesteps(modeldb)
endif
if (do_test_transport_control) then
call run_transport_control(modeldb)
endif
if (do_test_rhs_alg) then
call run_rhs_alg(modeldb)
endif
if (do_test_semi_imp_alg) then
call run_semi_imp_alg(modeldb)
endif

call finalise( application_name, modeldb )
call final_time( modeldb )
call final_collections()
call final_logger( application_name )
call final_config()
call final_comm( modeldb )

end program nwp_gal9
Loading