Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
| timgraham-Met | Tim Graham | Met Office | 2026-05-20 |
| tinyendian | Wolfgang Hayek | Earth Sciences New Zealand | 2026-05-04 |
| Adrian-Lock | Adrian Lock | Met Office | 2026-05-21 |
| mcdalvi | Mohit Dalvi | Met Office | 2026-06-17 |
7 changes: 5 additions & 2 deletions components/driver/source/driver_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ end subroutine filelist_populator

abstract interface
!> @brief Callback interface for bespoke IO configuration
!> @param[in] config configuration to be passed in at call site
!> @param[in] clock Clock to be passed in at call site
subroutine io_configuration_callback(clock)
subroutine io_configuration_callback(config,clock)
use config_mod, only: config_type
use clock_mod, only : clock_type
implicit none
type(config_type), intent(in) :: config
class(clock_type), intent(in) :: clock
end subroutine io_configuration_callback
end interface
Expand Down Expand Up @@ -115,7 +118,7 @@ subroutine init_io( context_name, &
call modeldb%io_contexts%get_io_context(context_name, context)
call context%set_current()
if (present(before_close)) then
call before_close(modeldb%clock)
call before_close(modeldb%config, modeldb%clock)
end if

call context%close_context_definition()
Expand Down
17 changes: 12 additions & 5 deletions components/lfric-xios/source/lfric_xios_read_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module lfric_xios_read_mod
use lfric_xios_utils_mod, only: prime_io_mesh_is
use lfric_xios_format_mod, only: inverse_format_field

use local_mesh_mod, only: local_mesh_type
use mesh_mod, only: mesh_type
use log_mod, only: log_event, &
log_scratch_space, &
Expand Down Expand Up @@ -290,10 +291,15 @@ subroutine read_field_time_var(xios_field_name, field_proxy, time_indices, time_
real(r_def), allocatable :: time_slice(:)
real(r_def), allocatable :: field_data(:)

type(mesh_type), pointer :: mesh => null()
type(mesh_type), pointer :: mesh
type(local_mesh_type), pointer :: local_mesh
character(str_def) :: local_mesh_name

nullify(mesh,local_mesh)

! Call error if field not on prime mesh
mesh => field_proxy%vspace%get_mesh()
local_mesh => mesh%get_local_mesh()
local_mesh_name = local_mesh%get_mesh_name()

fs_id = field_proxy%vspace%which()
if ( fs_id /= W3 .and. fs_id /= WTheta .and. fs_id /= W2H ) then
Expand Down Expand Up @@ -329,13 +335,13 @@ subroutine read_field_time_var(xios_field_name, field_proxy, time_indices, time_
end if
else
if ( fs_id == W3 ) then
call xios_get_domain_attr( trim(adjustl(mesh%get_mesh_name()))//"_face", ni=domain_size )
call xios_get_domain_attr( trim(adjustl(local_mesh_name))//"_face", ni=domain_size )
call xios_get_axis_attr( 'vert_axis_half_levels', n_glo=vert_axis_size )
else if ( fs_id == WTheta ) then
call xios_get_domain_attr( trim(adjustl(mesh%get_mesh_name()))//"_face", ni=domain_size )
call xios_get_domain_attr( trim(adjustl(local_mesh_name))//"_face", ni=domain_size )
call xios_get_axis_attr( 'vert_axis_full_levels', n_glo=vert_axis_size )
else if ( fs_id == W2H ) then
call xios_get_domain_attr( trim(adjustl(mesh%get_mesh_name()))//"_edge", ni=domain_size )
call xios_get_domain_attr( trim(adjustl(local_mesh_name))//"_edge", ni=domain_size )
call xios_get_axis_attr( 'vert_axis_half_levels', n_glo=vert_axis_size )
else
call log_event( 'Time varying fields only readable for W3, WTheta or W2H function spaces', &
Expand Down Expand Up @@ -368,6 +374,7 @@ subroutine read_field_time_var(xios_field_name, field_proxy, time_indices, time_

! Incoming data is shaped with multi-data axis first, then time axis, so set
! up an array for each multi-data level
! Note that this places a restriction on the format on some ancil files
do i = 0, ndata - 1

!Get first ndata slice - note the conversion from double precision to r_def
Expand Down