Skip to content
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
| mo-lucy-gordon | Lucy Gordon | Met Office | 2026-03-18 |
| shreybh1 | Shrey Bhardwaj | Met Office | 2026-03-26 |
| hiker | Joerg Henrichs | Bureau of Meteorology | 2026-02-11 |
| mcdalvi | Mohit Dalvi | Met Office | 2026-05-12 |
16 changes: 12 additions & 4 deletions components/lfric-xios/source/lfric_xios_read_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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 @@ -239,10 +240,16 @@ 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This comment doesn't seem to apply to anything.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed now - b556f0f, and rerunning tests for completeness.

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 @@ -278,13 +285,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 @@ -317,6 +324,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