From 51ad658910a3cd8b3a9317af7aecf60089bb5172 Mon Sep 17 00:00:00 2001 From: EdHone Date: Tue, 13 Jan 2026 13:34:49 +0000 Subject: [PATCH 01/21] Add source code changes from previous Trac branch --- .../source/algorithm/io_demo_alg_mod.x90 | 3 +- .../io_benchmark/io_benchmark_setup_mod.f90 | 118 ++++++++++++++++++ .../io_benchmark/io_benchmark_step_mod.x90 | 91 ++++++++++++++ .../source/driver/io_demo_driver_mod.f90 | 44 +++++-- 4 files changed, 246 insertions(+), 10 deletions(-) create mode 100644 applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 create mode 100644 applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 diff --git a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 index e42ccba00..0cfb56798 100644 --- a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 +++ b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 @@ -77,7 +77,8 @@ contains field_in, & stencil_depth, & visc, & - dx_at_w2) ) + dx_at_w2) , & + inc_X_divideby_a(dfield_in, 100.0_r_def) ) ! Printing the min/max values in field_in and dfield_in call log_field_minmax( LOG_LEVEL_INFO, 'dfield_in', dfield_in ) diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 new file mode 100644 index 000000000..1b1aaa415 --- /dev/null +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 @@ -0,0 +1,118 @@ +!------------------------------------------------------------------------------- +! (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. +!------------------------------------------------------------------------------- +!> @brief Setup infrastructure used for I/O benchmark +!> @details Handles the setup of all the fields that will be passed used to +!! benchmark the speed of XIOS reading and writing +module io_benchmark_setup_mod + + use constants_mod, only: i_def, str_def + use driver_modeldb_mod, only: modeldb_type + use field_collection_mod, only: field_collection_type + use field_mod, only: field_type + use field_parent_mod, only: read_interface, write_interface + use file_mod, only: FILE_MODE_WRITE + use fs_continuity_mod, only: Wtheta + use function_space_collection_mod, only: function_space_collection + use lfric_xios_file_mod, only: lfric_xios_file_type, OPERATION_TIMESERIES + use lfric_xios_read_mod, only: read_field_generic + use lfric_xios_write_mod, only: write_field_generic + use linked_list_mod, only: linked_list_type + use mesh_mod, only: mesh_type + use mesh_collection_mod, only: mesh_collection + use namelist_mod, only: namelist_type + + implicit none + + public create_io_benchmark_fields, setup_io_benchmark_files + +contains + + !> @details Creates the fields needed for the IO benchmark + !> @param[in,out] modeldb The model database in which to store model data. + subroutine create_io_benchmark_fields(modeldb) + implicit none + + type(modeldb_type), intent(inout) :: modeldb + + type(mesh_type), pointer :: mesh + type(field_collection_type), pointer :: io_benchmark_fields + type(field_type) :: tmp_io_field + procedure(read_interface), pointer :: tmp_read_ptr + procedure(write_interface), pointer :: tmp_write_ptr + + type(namelist_type), pointer :: base_mesh_nml + type(namelist_type), pointer :: finite_element_nml + type(namelist_type), pointer :: io_demo_nml + type(namelist_type), pointer :: io_nml + character(str_def) :: prime_mesh_name, tmp_field_name + integer(i_def) :: element_order_h + integer(i_def) :: element_order_v + integer(i_def) :: i + integer(i_def) :: n_benchmark_fields + integer(i_def) :: diagnostic_frequency + + + base_mesh_nml => modeldb%configuration%get_namelist('base_mesh') + finite_element_nml => modeldb%configuration%get_namelist('finite_element') + io_demo_nml => modeldb%configuration%get_namelist('io_demo') + io_nml => modeldb%configuration%get_namelist('io') + call base_mesh_nml%get_value( 'prime_mesh_name', prime_mesh_name ) + call finite_element_nml%get_value('element_order_h', element_order_h) + call finite_element_nml%get_value('element_order_v', element_order_v) + call io_demo_nml%get_value('n_benchmark_fields', n_benchmark_fields) + call io_nml%get_value('diagnostic_frequency', diagnostic_frequency) + + mesh => mesh_collection%get_mesh(prime_mesh_name) + + call modeldb%fields%add_empty_field_collection("io_benchmark_fields") + io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") + + do i = 1, n_benchmark_fields + write(tmp_field_name, "(A19, I3.3)") 'io_benchmark_field_', i + call tmp_io_field%initialise( vector_space = & + function_space_collection%get_fs(mesh, element_order_h, & + element_order_v, Wtheta), & + name=tmp_field_name ) + tmp_read_ptr => read_field_generic + tmp_write_ptr => write_field_generic + call tmp_io_field%set_read_behaviour(tmp_read_ptr) + call tmp_io_field%set_write_behaviour(tmp_write_ptr) + call io_benchmark_fields%add_field(tmp_io_field) + end do + + end subroutine create_io_benchmark_fields + + subroutine setup_io_benchmark_files(file_list, modeldb) + + implicit none + + type(linked_list_type), intent(out) :: file_list + type(modeldb_type), optional, intent(inout) :: modeldb + + integer(i_def) :: diagnostic_frequency + type(field_collection_type), pointer :: io_benchmark_fields + type(namelist_type), pointer :: io_nml + + io_nml => modeldb%configuration%get_namelist('io') + call io_nml%get_value('diagnostic_frequency', diagnostic_frequency) + + + io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") + + file_list = linked_list_type() + call file_list%insert_item( lfric_xios_file_type( "lfric_xios_write_benchmark", & + xios_id="lfric_xios_write_benchmark", & + io_mode=FILE_MODE_WRITE, & + operation=OPERATION_TIMESERIES, & + freq=diagnostic_frequency, & + fields_in_file=io_benchmark_fields ) ) + + nullify(io_benchmark_fields) + nullify(io_nml) + + end subroutine setup_io_benchmark_files + +end module io_benchmark_setup_mod \ No newline at end of file diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 new file mode 100644 index 000000000..573078481 --- /dev/null +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 @@ -0,0 +1,91 @@ +!> Steps the I/O benchmark section of IO_demo +module io_benchmark_step_mod + + use, intrinsic :: iso_c_binding, only : c_int, c_int32_t + + use constants_mod, only: i_def, r_def + use driver_modeldb_mod, only: modeldb_type + use field_mod, only: field_type + use field_parent_mod, only: field_parent_type + use field_collection_iterator_mod, & + only: field_collection_iterator_type + use field_collection_mod, only: field_collection_type + use log_mod, only: log_event, & + log_scratch_space, & + LOG_LEVEL_INFO + use namelist_mod, only: namelist_type + + implicit none + + private + public :: step_io_benchmark + + interface + ! int usleep(useconds_t useconds) + function c_usleep(useconds) bind(c, name='usleep') + import :: c_int, c_int32_t + implicit none + integer(kind=c_int32_t), value :: useconds + integer(kind=c_int) :: c_usleep + end function c_usleep + end interface + +contains + + !> A simple timestep algorithm that copies the diffusion field into the + !! various benchmark fields and divides the entire field by the fields number + !! + !> @param[in,out] modeldb The model database + subroutine step_io_benchmark(modeldb) + + implicit none + + type(modeldb_type), optional, intent(inout) :: modeldb + + type(field_collection_type), pointer :: depository + type(field_collection_type), pointer :: io_benchmark_fields + type(field_collection_iterator_type) :: field_iter + class(field_parent_type), pointer :: step_field + type(field_type), pointer :: kernel_field + type(field_type), pointer :: diffusion_field + type(namelist_type), pointer :: io_demo_nml + + integer(i_def) :: i, sleep_duration, rc + integer(c_int32_t) :: sleep_ms + real(r_def) :: loop_factor + + io_demo_nml => modeldb%configuration%get_namelist('io_demo') + call io_demo_nml%get_value('benchmark_sleep_time', sleep_duration) + + ! Get field data ready + depository => modeldb%fields%get_field_collection("depository") + io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") + call depository%get_field("diffusion_field", diffusion_field) + + call field_iter%initialise(io_benchmark_fields) + do i = 1, io_benchmark_fields%get_length() + if ( .not. field_iter%has_next() ) exit + step_field => field_iter%next() + select type(step_field) + type is (field_type) + ! Copy diffusion field values to new fields and adjust values + kernel_field => step_field + loop_factor = real(i, r_def) + call invoke( setval_X(kernel_field, diffusion_field), & + inc_X_divideby_a(kernel_field, loop_factor) ) + end select + + end do + + write(log_scratch_space,'(A,I0,A)') "io_demo: sleeping for ", sleep_duration, " seconds" + call log_event(log_scratch_space, LOG_LEVEL_INFO) + sleep_ms = int(sleep_duration * 1e6, c_int32_t) + rc = c_usleep(sleep_ms) + + nullify(step_field) + nullify(kernel_field) + nullify(diffusion_field) + + end subroutine step_io_benchmark + +end module io_benchmark_step_mod \ No newline at end of file diff --git a/applications/io_demo/source/driver/io_demo_driver_mod.f90 b/applications/io_demo/source/driver/io_demo_driver_mod.f90 index 73fd63c24..e208ddfad 100644 --- a/applications/io_demo/source/driver/io_demo_driver_mod.f90 +++ b/applications/io_demo/source/driver/io_demo_driver_mod.f90 @@ -17,7 +17,7 @@ module io_demo_driver_mod use driver_mesh_mod, only : init_mesh use driver_modeldb_mod, only : modeldb_type use driver_fem_mod, only : init_fem, final_fem - use driver_io_mod, only : init_io, final_io + use driver_io_mod, only : init_io, final_io, filelist_populator use extrusion_mod, only : extrusion_type, & uniform_extrusion_type, & TWOD, PRIME_EXTRUSION @@ -36,6 +36,10 @@ module io_demo_driver_mod use model_clock_mod, only : model_clock_type use multifile_field_setup_mod, only : create_multifile_io_fields use multifile_io_mod, only : init_multifile_io, step_multifile_io + use io_benchmark_setup_mod, only : create_io_benchmark_fields, setup_io_benchmark_files + use io_benchmark_step_mod, only : step_io_benchmark + + use io_demo_alg_mod, only : io_demo_alg use io_demo_alg_mod, only : io_demo_alg use sci_field_minmax_alg_mod, only : log_field_minmax @@ -78,6 +82,7 @@ subroutine initialise(program_name, modeldb) class(extrusion_type), allocatable :: extrusion type(uniform_extrusion_type), allocatable :: extrusion_2d + procedure(filelist_populator), pointer :: files_init_ptr => null() character(str_def) :: prime_mesh_name integer(i_def) :: stencil_depth @@ -89,6 +94,7 @@ subroutine initialise(program_name, modeldb) real(r_def) :: scaled_radius logical :: check_partitions logical :: multifile_io + logical :: io_benchmark integer(i_def), parameter :: one_layer = 1_i_def integer(i_def) :: i @@ -106,7 +112,10 @@ subroutine initialise(program_name, modeldb) domain_height = modeldb%config%extrusion%domain_height() number_of_layers = modeldb%config%extrusion%number_of_layers() scaled_radius = modeldb%config%planet%scaled_radius() - multifile_io = modeldb%config%io%multifile_io() + multifile_io = modeldb%config%io_demo%multifile_io() + io_benchmark = modeldb%config%io_demo%io_benchmark() + + call init_timers("io_demo") !======================================================================= ! Mesh @@ -177,17 +186,29 @@ subroutine initialise(program_name, modeldb) !======================================================================= ! Setup multifile reading !======================================================================= - if (multifile_io) then + files_init_ptr => null() + if(multifile_io) then call create_multifile_io_fields(modeldb) call init_multifile_io(modeldb) end if + if (io_benchmark) then + call create_io_benchmark_fields(modeldb) + files_init_ptr => setup_io_benchmark_files + end if + !======================================================================= ! Setup general I/O system. !======================================================================= ! Initialise I/O context - call init_io( program_name, prime_mesh_name, modeldb, & - chi_inventory, panel_id_inventory ) + if (associated(files_init_ptr)) then + call init_io( program_name, prime_mesh_name, modeldb, & + chi_inventory, panel_id_inventory, & + populate_filelist=files_init_ptr ) + else + call init_io( program_name, prime_mesh_name, modeldb, & + chi_inventory, panel_id_inventory ) + end if !======================================================================= @@ -219,11 +240,11 @@ subroutine step( program_name, modeldb ) type( field_type ), pointer :: diffusion_field type( field_type ), pointer :: multifile_field - logical :: multifile_io - logical :: write_diag + logical :: write_diag, multifile_io, io_benchmark - multifile_io = modeldb%config%io%multifile_io() write_diag = modeldb%config%io%write_diag() + multifile_io = modeldb%config%io_demo%multifile_io() + io_benchmark = modeldb%config%io_demo%io_benchmark() if (multifile_io) then call step_multifile_io(modeldb, chi_inventory, panel_id_inventory) @@ -239,6 +260,10 @@ subroutine step( program_name, modeldb ) call log_event(program_name//": Calculating diffusion", LOG_LEVEL_INFO) call io_demo_alg(modeldb, diffusion_field) + if (io_benchmark) then + call step_io_benchmark(modeldb) + end if + if (write_diag) then ! Write out output file call log_event(program_name//": Writing diagnostic output", LOG_LEVEL_INFO) @@ -265,7 +290,7 @@ subroutine finalise( program_name, modeldb ) logical :: multifile_io - multifile_io = modeldb%config%io%multifile_io() + multifile_io = modeldb%config%io_demo%multifile_io() !------------------------------------------------------------------------- ! Checksum output @@ -292,6 +317,7 @@ subroutine finalise( program_name, modeldb ) ! Finalise IO call final_io(modeldb) call final_fem() + call final_timers("io_demo") end subroutine finalise From e51a8cc9a72cc0dc956cd04c2d0d652c8ec0bf0a Mon Sep 17 00:00:00 2001 From: EdHone Date: Tue, 20 Jan 2026 13:30:52 +0000 Subject: [PATCH 02/21] Remove old timer implementation --- applications/io_demo/source/driver/io_demo_driver_mod.f90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/applications/io_demo/source/driver/io_demo_driver_mod.f90 b/applications/io_demo/source/driver/io_demo_driver_mod.f90 index e208ddfad..0eb038554 100644 --- a/applications/io_demo/source/driver/io_demo_driver_mod.f90 +++ b/applications/io_demo/source/driver/io_demo_driver_mod.f90 @@ -115,8 +115,6 @@ subroutine initialise(program_name, modeldb) multifile_io = modeldb%config%io_demo%multifile_io() io_benchmark = modeldb%config%io_demo%io_benchmark() - call init_timers("io_demo") - !======================================================================= ! Mesh !======================================================================= @@ -317,7 +315,6 @@ subroutine finalise( program_name, modeldb ) ! Finalise IO call final_io(modeldb) call final_fem() - call final_timers("io_demo") end subroutine finalise From 3569a1aea097b86debb880056f96ad10a68037e7 Mon Sep 17 00:00:00 2001 From: EdHone Date: Tue, 13 Jan 2026 13:46:08 +0000 Subject: [PATCH 03/21] Bring in metadata from previous branch --- .../lfric-io_demo/HEAD/rose-meta.conf | 28 ++++++++- .../rose-meta/lfric-io_demo/versions.py | 57 +++++++++++++++++-- .../io_benchmark/io_benchmark_setup_mod.f90 | 7 ++- .../io_benchmark/io_benchmark_step_mod.x90 | 6 ++ applications/io_demo/source/io_demo.f90 | 1 + 5 files changed, 91 insertions(+), 8 deletions(-) diff --git a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf index 953fdde8d..318ed9d40 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf +++ b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf @@ -1,6 +1,13 @@ import=lfric-driver/HEAD -[namelist:io=multifile_io] +[namelist:io_demo] +compulsory=true +description=Provides options for configuring the runtime behaviour of the IO_Demo app +ns=namelist/io_demo +sort-key=Section-A02 +title=IO_Demo + +[namelist:io_demo=multifile_io] compulsory=true description=Use multifile_io functionality help=This is used to turn the multifile_io functionality in the io_demo app @@ -8,6 +15,25 @@ help=This is used to turn the multifile_io functionality in the io_demo app !kind=default type=logical +[namelist:io_demo=io_benchmark] +compulsory=true +description=Configure application to run as an I/O benchmarking tool +help=Configure application to run as an I/O benchmarking tool +!kind=default +type=logical + +[namelist:io_demo=n_benchmark_fields] +compulsory=true +description=Number of fields created in I/O benchmark +!kind=default +type=integer + +[namelist:io_demo=benchmark_sleep_time] +compulsory=true +description=Number of seconds to sleep for each timestep in I/O benchmark mode +!kind=default +type=integer + [namelist:multifile_io] compulsory=false duplicate=true diff --git a/applications/io_demo/rose-meta/lfric-io_demo/versions.py b/applications/io_demo/rose-meta/lfric-io_demo/versions.py index 152c043d0..011f01770 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/versions.py +++ b/applications/io_demo/rose-meta/lfric-io_demo/versions.py @@ -2,7 +2,7 @@ from metomi.rose.upgrade import MacroUpgrade -from .version22_30 import * +from .version21_22 import * class UpgradeError(Exception): @@ -20,14 +20,63 @@ 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 vn22_t4661(MacroUpgrade): + """Upgrade macro for ticket #4661 by Denis Sergeev.""" + + BEFORE_TAG = "vn2.2" + AFTER_TAG = "vn2.2_t4661" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-driver + self.add_setting(config, ["namelist:extrusion", "eta_values"], "''") + return config, self.reports + + +class vn22_t4684(MacroUpgrade): + """Upgrade macro for ticket #4684 by Ed Hone.""" + + BEFORE_TAG = "vn2.2_t4661" + AFTER_TAG = "vn2.2_t4684" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-io_demo + """Add new io_demo namelist""" + source = self.get_setting_value( + config, ["file:configuration.nml", "source"] + ) + source = re.sub( + r"namelist:io", + r"namelist:io" + "\n" + " namelist:io_demo", + source, + ) + self.change_setting_value( + config, ["file:configuration.nml", "source"], source + ) + self.add_setting(config, ["namelist:io_demo"]) + + """Move multifile_io setting from io namelist to io_demo""" + self.remove_setting( + config, ["namelist:io", "multifile_io"]) + self.add_setting( + config, ["namelist:io_demo", "multifile_io"], ".false." + ) + + """Add new default settings""" + self.add_setting( + config, ["namelist:io_demo", "io_benchmark"], ".false." + ) + self.add_setting( + config, ["namelist:io_demo", "n_benchmark_fields"], "0" + ) + + return config, self.reports diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 index 1b1aaa415..b3d851721 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 @@ -1,8 +1,9 @@ -!------------------------------------------------------------------------------- -! (c) Crown copyright 2025 Met Office. All rights reserved. +!----------------------------------------------------------------------------- +! (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 Setup infrastructure used for I/O benchmark !> @details Handles the setup of all the fields that will be passed used to !! benchmark the speed of XIOS reading and writing diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 index 573078481..50f4ad9f3 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 @@ -1,3 +1,9 @@ +!----------------------------------------------------------------------------- +! (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. +!----------------------------------------------------------------------------- + !> Steps the I/O benchmark section of IO_demo module io_benchmark_step_mod diff --git a/applications/io_demo/source/io_demo.f90 b/applications/io_demo/source/io_demo.f90 index 7f5d7d5db..457f20500 100644 --- a/applications/io_demo/source/io_demo.f90 +++ b/applications/io_demo/source/io_demo.f90 @@ -3,6 +3,7 @@ ! The file LICENCE, distributed with this code, contains details of the terms ! under which the code may be used. !----------------------------------------------------------------------------- + !> @page Miniapp io_demo program !> @brief Main program used to calculate diffusion of randomly initialised theta field !> @details Calls init, run and finalise routines from io_demo driver module From dae42a7d1637fe8ad6c246e1ef63c74079ee9472 Mon Sep 17 00:00:00 2001 From: EdHone Date: Wed, 14 Jan 2026 11:25:47 +0000 Subject: [PATCH 04/21] Use 'native' Fortran sleep --- applications/io_demo/build/project.mk | 1 + applications/io_demo/example/configuration.nml | 8 +++++++- .../io_benchmark/io_benchmark_step_mod.x90 | 18 ++---------------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/applications/io_demo/build/project.mk b/applications/io_demo/build/project.mk index 3ea4ab133..886a18076 100644 --- a/applications/io_demo/build/project.mk +++ b/applications/io_demo/build/project.mk @@ -8,3 +8,4 @@ # via the Makefile. $(info io_demo miniapp project specials) +FFLAGS += -fall-intrinsics diff --git a/applications/io_demo/example/configuration.nml b/applications/io_demo/example/configuration.nml index db34d0e36..84f54c519 100644 --- a/applications/io_demo/example/configuration.nml +++ b/applications/io_demo/example/configuration.nml @@ -47,7 +47,13 @@ coord_system='native' checkpoint_read = .false. checkpoint_write = .false. file_convention = 'UGRID' +/ + +&io_demo multifile_io = .false. + io_benchmark = .true. + n_benchmark_fields = 10 + benchmark_sleep_time = 1 / &logging @@ -57,7 +63,7 @@ coord_system='native' &time calendar = 'timestep' timestep_start = '1' - timestep_end = '90' + timestep_end = '100' calendar_type='gregorian' calendar_start='2016-01-01 15:00:00' calendar_origin='2016-01-01 15:00:00' diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 index 50f4ad9f3..5fbecfdc0 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 @@ -7,8 +7,6 @@ !> Steps the I/O benchmark section of IO_demo module io_benchmark_step_mod - use, intrinsic :: iso_c_binding, only : c_int, c_int32_t - use constants_mod, only: i_def, r_def use driver_modeldb_mod, only: modeldb_type use field_mod, only: field_type @@ -26,16 +24,6 @@ module io_benchmark_step_mod private public :: step_io_benchmark - interface - ! int usleep(useconds_t useconds) - function c_usleep(useconds) bind(c, name='usleep') - import :: c_int, c_int32_t - implicit none - integer(kind=c_int32_t), value :: useconds - integer(kind=c_int) :: c_usleep - end function c_usleep - end interface - contains !> A simple timestep algorithm that copies the diffusion field into the @@ -56,8 +44,7 @@ contains type(field_type), pointer :: diffusion_field type(namelist_type), pointer :: io_demo_nml - integer(i_def) :: i, sleep_duration, rc - integer(c_int32_t) :: sleep_ms + integer(i_def) :: i, sleep_duration real(r_def) :: loop_factor io_demo_nml => modeldb%configuration%get_namelist('io_demo') @@ -85,8 +72,7 @@ contains write(log_scratch_space,'(A,I0,A)') "io_demo: sleeping for ", sleep_duration, " seconds" call log_event(log_scratch_space, LOG_LEVEL_INFO) - sleep_ms = int(sleep_duration * 1e6, c_int32_t) - rc = c_usleep(sleep_ms) + call sleep(sleep_duration) nullify(step_field) nullify(kernel_field) From 3a97bd1a160cb910814b0c44479084f1292959ed Mon Sep 17 00:00:00 2001 From: EdHone Date: Fri, 16 Jan 2026 17:00:32 +0000 Subject: [PATCH 05/21] Fix upgrade macro --- .../rose-meta/lfric-io_demo/versions.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/applications/io_demo/rose-meta/lfric-io_demo/versions.py b/applications/io_demo/rose-meta/lfric-io_demo/versions.py index 011f01770..7637ef31f 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/versions.py +++ b/applications/io_demo/rose-meta/lfric-io_demo/versions.py @@ -2,7 +2,7 @@ from metomi.rose.upgrade import MacroUpgrade -from .version21_22 import * +from .version22_30 import * class UpgradeError(Exception): @@ -30,23 +30,11 @@ def upgrade(self, config, meta_config=None): """ -class vn22_t4661(MacroUpgrade): - """Upgrade macro for ticket #4661 by Denis Sergeev.""" +class vn30_t216(MacroUpgrade): + """Upgrade macro for ticket #216 by Ed Hone.""" - BEFORE_TAG = "vn2.2" - AFTER_TAG = "vn2.2_t4661" - - def upgrade(self, config, meta_config=None): - # Commands From: rose-meta/lfric-driver - self.add_setting(config, ["namelist:extrusion", "eta_values"], "''") - return config, self.reports - - -class vn22_t4684(MacroUpgrade): - """Upgrade macro for ticket #4684 by Ed Hone.""" - - BEFORE_TAG = "vn2.2_t4661" - AFTER_TAG = "vn2.2_t4684" + BEFORE_TAG = "vn3.0" + AFTER_TAG = "vn3.0_t216" def upgrade(self, config, meta_config=None): # Commands From: rose-meta/lfric-io_demo From d1b0048d3eb226d26c21fcfa6e28490e2956ecf2 Mon Sep 17 00:00:00 2001 From: EdHone Date: Fri, 16 Jan 2026 17:02:26 +0000 Subject: [PATCH 06/21] Macro whitespace --- applications/io_demo/rose-meta/lfric-io_demo/versions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/io_demo/rose-meta/lfric-io_demo/versions.py b/applications/io_demo/rose-meta/lfric-io_demo/versions.py index 7637ef31f..c67b9ab42 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/versions.py +++ b/applications/io_demo/rose-meta/lfric-io_demo/versions.py @@ -20,10 +20,13 @@ 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 From 30f38420080dcbd2be10d27544e4483f59ee640a Mon Sep 17 00:00:00 2001 From: EdHone Date: Fri, 16 Jan 2026 17:02:26 +0000 Subject: [PATCH 07/21] Macro whitespace From 5c9f123f0318f6d7d47c80e3d8c2eda6a6fa649a Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 10:54:55 +0000 Subject: [PATCH 08/21] Manual implementation of metadata - test suite runs but tests broken --- .../lfric-io_demo/HEAD/rose-meta.conf | 20 +++++++++---------- .../app/io_demo/opt/rose-app-multifile.conf | 2 +- rose-stem/app/io_demo/rose-app.conf | 8 +++++++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf index 318ed9d40..f7bb99a56 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf +++ b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf @@ -7,13 +7,11 @@ ns=namelist/io_demo sort-key=Section-A02 title=IO_Demo -[namelist:io_demo=multifile_io] +[namelist:io_demo=benchmark_sleep_time] compulsory=true -description=Use multifile_io functionality -help=This is used to turn the multifile_io functionality in the io_demo app - =on and off +description=Number of seconds to sleep for each timestep in I/O benchmark mode !kind=default -type=logical +type=integer [namelist:io_demo=io_benchmark] compulsory=true @@ -22,15 +20,17 @@ help=Configure application to run as an I/O benchmarking tool !kind=default type=logical -[namelist:io_demo=n_benchmark_fields] +[namelist:io_demo=multifile_io] compulsory=true -description=Number of fields created in I/O benchmark +description=Use multifile_io functionality +help=This is used to turn the multifile_io functionality in the io_demo app + =on and off !kind=default -type=integer +type=logical -[namelist:io_demo=benchmark_sleep_time] +[namelist:io_demo=n_benchmark_fields] compulsory=true -description=Number of seconds to sleep for each timestep in I/O benchmark mode +description=Number of fields created in I/O benchmark !kind=default type=integer diff --git a/rose-stem/app/io_demo/opt/rose-app-multifile.conf b/rose-stem/app/io_demo/opt/rose-app-multifile.conf index 3dda44de2..edd67832f 100644 --- a/rose-stem/app/io_demo/opt/rose-app-multifile.conf +++ b/rose-stem/app/io_demo/opt/rose-app-multifile.conf @@ -6,7 +6,7 @@ source=$MESH_DIR/mesh_C24.nc file_prefix='mesh_C24' geometry='spherical' -[namelist:io] +[namelist:io_demo] multifile_io=.true. [namelist:multifile_io(iau1)] diff --git a/rose-stem/app/io_demo/rose-app.conf b/rose-stem/app/io_demo/rose-app.conf index af4844708..f04b26d22 100644 --- a/rose-stem/app/io_demo/rose-app.conf +++ b/rose-stem/app/io_demo/rose-app.conf @@ -20,6 +20,7 @@ source=namelist:base_mesh = namelist:extrusion = namelist:finite_element = namelist:io + = namelist:io_demo = namelist:logging = (namelist:multifile_io(:)) = namelist:planet @@ -61,7 +62,6 @@ counter_output_suffix='counter.txt' diagnostic_frequency=1 !!end_of_run_checkpoint=.true. file_convention='UGRID' -multifile_io=.false. !!nodal_output_on_w3=.false. subroutine_counters=.false. subroutine_timers=.true. @@ -69,6 +69,12 @@ timer_output_path='timer.txt' use_xios_io=.true. write_diag=.false. +[namelist:io_demo] +benchmark_sleep_time=0 +io_benchmark=.false. +multifile_io=.false. +n_benchmark_fields=0 + [namelist:logging] log_to_rank_zero_only=.false. run_log_level='info' From 814953412e87dcfbe378c5bebca5978d65902287 Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 11:25:14 +0000 Subject: [PATCH 09/21] Fix metadata issues --- .../source/algorithm/io_demo_alg_mod.x90 | 18 +++++++++++++----- .../source/driver/io_demo_driver_mod.f90 | 6 +++++- rose-stem/app/io_demo/rose-app.conf | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 index 0cfb56798..b404020fb 100644 --- a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 +++ b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 @@ -35,20 +35,23 @@ contains !> @details Calculates the diffusion increment for a field, and adds it to said field. !> @param[in] modeldb Application state object !> @param[inout] field_in Input Wtheta field - subroutine io_demo_alg( modeldb, field_in ) + !> @param[in] visc_in Optional setting for viscosity value + subroutine io_demo_alg( modeldb, field_in, visc_in ) implicit none type(modeldb_type), intent(in) :: modeldb ! Prognostic fields - type( field_type ), intent( inout ) :: field_in + type( field_type ), intent( inout ) :: field_in + real(r_def), optional, intent( in ) :: visc_in ! Diagnostic fields type( field_type ) :: dfield_in type( field_type ) :: visc - real(r_def), parameter :: visc_val = 100000.0_r_def + real(r_def) :: visc_val + type(mesh_type), pointer :: mesh => null() integer(kind=i_def), parameter :: stencil_depth = 1_i_def type(mesh_type), pointer :: mesh @@ -56,6 +59,12 @@ contains type(function_space_type), pointer :: fs integer(i_def) :: order_h, order_v + ! Set viscosity to default value if not present + if (present(visc_in)) then + visc_val = visc_in + else + visc_val = 100000.0_r_def + end if call log_event( "io_demo: Running algorithm", LOG_LEVEL_TRACE ) @@ -77,8 +86,7 @@ contains field_in, & stencil_depth, & visc, & - dx_at_w2) , & - inc_X_divideby_a(dfield_in, 100.0_r_def) ) + dx_at_w2) ) ! Printing the min/max values in field_in and dfield_in call log_field_minmax( LOG_LEVEL_INFO, 'dfield_in', dfield_in ) diff --git a/applications/io_demo/source/driver/io_demo_driver_mod.f90 b/applications/io_demo/source/driver/io_demo_driver_mod.f90 index 0eb038554..8d179b7ff 100644 --- a/applications/io_demo/source/driver/io_demo_driver_mod.f90 +++ b/applications/io_demo/source/driver/io_demo_driver_mod.f90 @@ -256,10 +256,14 @@ subroutine step( program_name, modeldb ) ! Call an algorithm call log_event(program_name//": Calculating diffusion", LOG_LEVEL_INFO) - call io_demo_alg(modeldb, diffusion_field) + ! Diffusion algorithm unstable with high viscosity values at high + ! resolution, so for io_benchmark mode we lower the viscosity if (io_benchmark) then + call io_demo_alg(modeldb, diffusion_field, visc_in=1000.0_r_def) call step_io_benchmark(modeldb) + else + call io_demo_alg(modeldb, diffusion_field) end if if (write_diag) then diff --git a/rose-stem/app/io_demo/rose-app.conf b/rose-stem/app/io_demo/rose-app.conf index f04b26d22..180b48845 100644 --- a/rose-stem/app/io_demo/rose-app.conf +++ b/rose-stem/app/io_demo/rose-app.conf @@ -1,4 +1,4 @@ -meta=lfric-io_demo/vn3.0 +meta=lfric-io_demo/HEAD [command] default=$CORE_ROOT_DIR/bin/tweak_iodef ; \ From 073c302f53874e66e2fa8f085523e8d50c1e44b7 Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 11:57:04 +0000 Subject: [PATCH 10/21] Fix builds and suite running --- applications/io_demo/build/project.mk | 2 +- infrastructure/build/fortran/gfortran.mk | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/io_demo/build/project.mk b/applications/io_demo/build/project.mk index 886a18076..13fef734f 100644 --- a/applications/io_demo/build/project.mk +++ b/applications/io_demo/build/project.mk @@ -8,4 +8,4 @@ # via the Makefile. $(info io_demo miniapp project specials) -FFLAGS += -fall-intrinsics +export FFLAGS_GNU_OPTIONS = -fall-intrinsics diff --git a/infrastructure/build/fortran/gfortran.mk b/infrastructure/build/fortran/gfortran.mk index 3dabbabb4..59b6882f6 100644 --- a/infrastructure/build/fortran/gfortran.mk +++ b/infrastructure/build/fortran/gfortran.mk @@ -44,6 +44,10 @@ FFLAGS_FASTD_RUNTIME = $(FFLAGS_RUNTIME) # Option for checking code meets Fortran standard - currently 2008 FFLAGS_FORTRAN_STANDARD = -std=f2008 +# Add compiler-specific project option +$(info FFLAGS_GNU_OPTIONS = $(FFLAGS_GNU_OPTIONS)) +FFLAGS_COMPILER += $(FFLAGS_GNU_OPTIONS) + LDFLAGS_COMPILER = utilities/traceback_mod.o utilities/traceback_mod.mod: private FFLAGS_EXTRA = -fall-intrinsics From 90d94dfde8aa40cced80ec65e7fc4b0dbff0d3a6 Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 12:20:51 +0000 Subject: [PATCH 11/21] small benchmark cases in developer suite --- .../app/io_demo/opt/rose-app-benchmark.conf | 18 ++++++++++++++++++ .../app/io_demo/opt/rose-app-xios_server.conf | 3 --- .../site/common/io_demo/tasks_io_demo.cylc | 10 ++++++++++ rose-stem/site/meto/groups/group_io_demo.cylc | 5 +++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 rose-stem/app/io_demo/opt/rose-app-benchmark.conf diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf new file mode 100644 index 000000000..dcc76a844 --- /dev/null +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf @@ -0,0 +1,18 @@ +[file:mesh_C24.nc] +mode=auto +source=$MESH_DIR/mesh_C24.nc + +[namelist:base_mesh] +file_prefix='mesh_C24' +geometry='spherical' + +[namelist:io_demo] +io_benchmark=.true. +n_benchmark_fields=10 +benchmark_sleep_time=1 + +[namelist:partitioning] +partitioner='cubedsphere' + +[namelist:time] +timestep_end='24' diff --git a/rose-stem/app/io_demo/opt/rose-app-xios_server.conf b/rose-stem/app/io_demo/opt/rose-app-xios_server.conf index 3d1f563b4..a0f6669ed 100644 --- a/rose-stem/app/io_demo/opt/rose-app-xios_server.conf +++ b/rose-stem/app/io_demo/opt/rose-app-xios_server.conf @@ -1,5 +1,2 @@ -[env] -XIOS_SERVER_MODE=False - [namelist:io] !!nodal_output_on_w3=.true. diff --git a/rose-stem/site/common/io_demo/tasks_io_demo.cylc b/rose-stem/site/common/io_demo/tasks_io_demo.cylc index e3d3c069c..2152af0b7 100644 --- a/rose-stem/site/common/io_demo/tasks_io_demo.cylc +++ b/rose-stem/site/common/io_demo/tasks_io_demo.cylc @@ -21,6 +21,16 @@ "tsteps": 90, }) %} +{% elif task_ns.conf_name == "benchmark-C24" %} + + {% do task_dict.update({ + "opt_confs": ["benchmark"], + "resolution": "C24", + "tsteps": 24, + "kgo_checks": [], + }) %} + + {% elif task_ns.conf_name == "unit_tests" %} {% do task_dict.update({ diff --git a/rose-stem/site/meto/groups/group_io_demo.cylc b/rose-stem/site/meto/groups/group_io_demo.cylc index a6a908edf..6200d7bfe 100644 --- a/rose-stem/site/meto/groups/group_io_demo.cylc +++ b/rose-stem/site/meto/groups/group_io_demo.cylc @@ -13,6 +13,8 @@ "io_demo_default-C24_azspice_gnu_full-debug-64bit", "io_demo_multifile-C24_azspice_gnu_fast-debug-64bit", "io_demo_multifile-C24_azspice_gnu_fast-debug-32bit", + "io_demo_benchmark-C24_azspice_gnu_fast-debug-64bit", + "io_demo_benchmark-C24_azspice_gnu_fast-debug-32bit", "io_demo_azspice_unit_tests", ], "io_demo_azspice": [ @@ -41,6 +43,9 @@ "io_demo_multifile-C24_ex1a_cce_fast-debug-32bit", "io_demo_multifile-C24_ex1a_gnu_fast-debug-64bit", "io_demo_multifile-C24_ex1a_gnu_fast-debug-32bit", + "io_demo_benchmark-C24_ex1a_cce_fast-debug-32bit", + "io_demo_benchmark-C24_ex1a_gnu_fast-debug-32bit", + "io_demo_benchmark-C24_ex1a_gnu_fast-debug-64bit", "io_demo_ex1a_unit_tests", ], "io_demo_ex1a": [ From 250ce13bbde691765ca3c5163c4b44829e7f7ce2 Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 14:21:11 +0000 Subject: [PATCH 12/21] Interim test configs working --- rose-stem/app/io_demo/opt/rose-app-C224.conf | 10 ++++++++++ .../app/io_demo/opt/rose-app-benchmark-nwp.conf | 10 ++++++++++ rose-stem/app/io_demo/opt/rose-app-benchmark.conf | 14 +++----------- rose-stem/app/mesh/opt/rose-app-C224.conf | 6 ++++++ rose-stem/site/common/io_demo/tasks_io_demo.cylc | 13 +++++++++++++ rose-stem/site/meto/common/bin/launch-exe | 3 +-- rose-stem/site/meto/groups/group_io_demo.cylc | 8 ++++++++ 7 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 rose-stem/app/io_demo/opt/rose-app-C224.conf create mode 100644 rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf create mode 100644 rose-stem/app/mesh/opt/rose-app-C224.conf diff --git a/rose-stem/app/io_demo/opt/rose-app-C224.conf b/rose-stem/app/io_demo/opt/rose-app-C224.conf new file mode 100644 index 000000000..03e766c45 --- /dev/null +++ b/rose-stem/app/io_demo/opt/rose-app-C224.conf @@ -0,0 +1,10 @@ +[file:mesh_C24.nc] +mode=auto +source=$MESH_DIR/mesh_C224.nc + +[namelist:base_mesh] +file_prefix='mesh_C224' +geometry='spherical' + +[namelist:partitioning] +partitioner='cubedsphere' diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf new file mode 100644 index 000000000..4a1d887fb --- /dev/null +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf @@ -0,0 +1,10 @@ +[namelist:io_demo] +io_benchmark=.true. +n_benchmark_fields=100 +benchmark_sleep_time=2 + +[namelist:time] +timestep_end='24' + +[namelist:timestepping] +dt=3600.0 diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf index dcc76a844..c7e8fd076 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf @@ -1,18 +1,10 @@ -[file:mesh_C24.nc] -mode=auto -source=$MESH_DIR/mesh_C24.nc - -[namelist:base_mesh] -file_prefix='mesh_C24' -geometry='spherical' - [namelist:io_demo] io_benchmark=.true. n_benchmark_fields=10 benchmark_sleep_time=1 -[namelist:partitioning] -partitioner='cubedsphere' - [namelist:time] timestep_end='24' + +[namelist:timestepping] +dt=3600.0 \ No newline at end of file diff --git a/rose-stem/app/mesh/opt/rose-app-C224.conf b/rose-stem/app/mesh/opt/rose-app-C224.conf new file mode 100644 index 000000000..ffba5148e --- /dev/null +++ b/rose-stem/app/mesh/opt/rose-app-C224.conf @@ -0,0 +1,6 @@ +[command] +default=mkdir -p $MESH_DIR ; mpiexec -n 1 $BIN_DIR/cubedsphere_mesh_generator mesh_generation.nml +srun=mkdir -p $MESH_DIR ; srun --ntasks=1 $BIN_DIR/cubedsphere_mesh_generator mesh_generation.nml + +[namelist:cubedsphere_mesh] +edge_cells=224 diff --git a/rose-stem/site/common/io_demo/tasks_io_demo.cylc b/rose-stem/site/common/io_demo/tasks_io_demo.cylc index 2152af0b7..43547960c 100644 --- a/rose-stem/site/common/io_demo/tasks_io_demo.cylc +++ b/rose-stem/site/common/io_demo/tasks_io_demo.cylc @@ -30,6 +30,19 @@ "kgo_checks": [], }) %} +{% elif task_ns.conf_name == "benchmark-nwp-C24" %} + + {% do task_dict.update({ + "opt_confs": ["benchmark-nwp"], + "resolution": "C24", + "tsteps": 24, + "kgo_checks": [], + "mpi_parts": 6, + "mpi_parts_xios": 1, + "xios_nodes": 1, + "xios_server_mode": true, + "xios_server_ranks": 1, + }) %} {% elif task_ns.conf_name == "unit_tests" %} diff --git a/rose-stem/site/meto/common/bin/launch-exe b/rose-stem/site/meto/common/bin/launch-exe index 8a3fa68be..f65fbb431 100755 --- a/rose-stem/site/meto/common/bin/launch-exe +++ b/rose-stem/site/meto/common/bin/launch-exe @@ -24,7 +24,6 @@ else LAUNCHER=${RUN_METHOD} fi - # Construct launcher options #=========================================== LAUNCHER_OPTS="" @@ -32,7 +31,7 @@ if [ "${RUN_METHOD}" = "mpiexec" ] ; then if [ "${SITE_MPI_LAUNCHER_OPTS}" != "" ] ; then LAUNCHER_OPTS=${SITE_MPI_LAUNCHER_OPTS} else - LAUNCHER_OPTS="-n ${TOTAL_RANKS}" + LAUNCHER_OPTS="-n ${TOTAL_RANKS} --ppn ${CORES_PER_NODE}" fi elif [ "${RUN_METHOD}" = "srun" ] ; then LAUNCHER_OPTS="--ntasks ${TOTAL_RANKS}" diff --git a/rose-stem/site/meto/groups/group_io_demo.cylc b/rose-stem/site/meto/groups/group_io_demo.cylc index 6200d7bfe..0419ebdad 100644 --- a/rose-stem/site/meto/groups/group_io_demo.cylc +++ b/rose-stem/site/meto/groups/group_io_demo.cylc @@ -48,6 +48,11 @@ "io_demo_benchmark-C24_ex1a_gnu_fast-debug-64bit", "io_demo_ex1a_unit_tests", ], + "io_demo_ex1a_benchmark": [ + "io_demo_benchmark-nwp-C24_ex1a_cce_fast-debug-32bit", + "io_demo_benchmark-nwp-C24_ex1a_gnu_fast-debug-32bit", + "io_demo_benchmark-nwp-C24_ex1a_gnu_fast-debug-64bit", + ], "io_demo_ex1a": [ "io_demo_ex1a_developer" ], @@ -86,6 +91,9 @@ "io_demo_azspice_canned", "io_demo_ex1a_canned", ], + "io_demo_benchmark": [ + "io_demo_ex1a_benchmark", + ], }) %} {# Platform Generic Extends #} From c58ff99b9fe9ff59a90e79f9ee579a67f3e39e34 Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 19 Jan 2026 19:53:34 +0000 Subject: [PATCH 13/21] Working tests for benchmark case --- rose-stem/app/io_demo/opt/rose-app-C224.conf | 2 +- .../app/io_demo/opt/rose-app-benchmark-nwp.conf | 13 +++++++++++-- rose-stem/app/io_demo/opt/rose-app-benchmark.conf | 9 +++++++++ rose-stem/site/common/io_demo/tasks_io_demo.cylc | 10 +++++----- rose-stem/site/meto/groups/group_io_demo.cylc | 5 ++--- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/rose-stem/app/io_demo/opt/rose-app-C224.conf b/rose-stem/app/io_demo/opt/rose-app-C224.conf index 03e766c45..646de608e 100644 --- a/rose-stem/app/io_demo/opt/rose-app-C224.conf +++ b/rose-stem/app/io_demo/opt/rose-app-C224.conf @@ -1,4 +1,4 @@ -[file:mesh_C24.nc] +[file:mesh_C224.nc] mode=auto source=$MESH_DIR/mesh_C224.nc diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf index 4a1d887fb..6ba55db1e 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf @@ -1,7 +1,16 @@ +[env] +MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 +MPICH_MPIIO_HINTS_DISPLAY=1 +MPICH_MPIIO_STATS=1 + [namelist:io_demo] io_benchmark=.true. -n_benchmark_fields=100 -benchmark_sleep_time=2 +n_benchmark_fields=200 +benchmark_sleep_time=4 + +[namelist:io] +write_diag=.true. +subroutine_timers=.true. [namelist:time] timestep_end='24' diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf index c7e8fd076..e83d5f009 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf @@ -1,8 +1,17 @@ +[env] +MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 +MPICH_MPIIO_HINTS_DISPLAY=1 +MPICH_MPIIO_STATS=1 + [namelist:io_demo] io_benchmark=.true. n_benchmark_fields=10 benchmark_sleep_time=1 +[namelist:io] +write_diag=.true. +subroutine_timers=.true. + [namelist:time] timestep_end='24' diff --git a/rose-stem/site/common/io_demo/tasks_io_demo.cylc b/rose-stem/site/common/io_demo/tasks_io_demo.cylc index 43547960c..56f78cbba 100644 --- a/rose-stem/site/common/io_demo/tasks_io_demo.cylc +++ b/rose-stem/site/common/io_demo/tasks_io_demo.cylc @@ -30,18 +30,18 @@ "kgo_checks": [], }) %} -{% elif task_ns.conf_name == "benchmark-nwp-C24" %} +{% elif task_ns.conf_name == "benchmark-nwp-C224" %} {% do task_dict.update({ "opt_confs": ["benchmark-nwp"], - "resolution": "C24", + "resolution": "C224", "tsteps": 24, "kgo_checks": [], - "mpi_parts": 6, - "mpi_parts_xios": 1, + "mpi_parts": 384, + "mpi_parts_xios": 6, "xios_nodes": 1, "xios_server_mode": true, - "xios_server_ranks": 1, + "xios_server_ranks": 6, }) %} {% elif task_ns.conf_name == "unit_tests" %} diff --git a/rose-stem/site/meto/groups/group_io_demo.cylc b/rose-stem/site/meto/groups/group_io_demo.cylc index 0419ebdad..39c59a254 100644 --- a/rose-stem/site/meto/groups/group_io_demo.cylc +++ b/rose-stem/site/meto/groups/group_io_demo.cylc @@ -49,9 +49,8 @@ "io_demo_ex1a_unit_tests", ], "io_demo_ex1a_benchmark": [ - "io_demo_benchmark-nwp-C24_ex1a_cce_fast-debug-32bit", - "io_demo_benchmark-nwp-C24_ex1a_gnu_fast-debug-32bit", - "io_demo_benchmark-nwp-C24_ex1a_gnu_fast-debug-64bit", + "io_demo_benchmark-nwp-C224_ex1a_cce_fast-debug-32bit", + "io_demo_benchmark-nwp-C224_ex1a_gnu_fast-debug-32bit", ], "io_demo_ex1a": [ "io_demo_ex1a_developer" From e078f19b06cb515a7114039d86eed1fba557685b Mon Sep 17 00:00:00 2001 From: EdHone Date: Tue, 20 Jan 2026 14:12:21 +0000 Subject: [PATCH 14/21] Clean up branch --- .../io_demo/example/configuration.nml | 6 +-- .../rose-meta/lfric-io_demo/versions.py | 40 ------------------- infrastructure/build/fortran/gfortran.mk | 1 - 3 files changed, 3 insertions(+), 44 deletions(-) diff --git a/applications/io_demo/example/configuration.nml b/applications/io_demo/example/configuration.nml index 84f54c519..306160dd1 100644 --- a/applications/io_demo/example/configuration.nml +++ b/applications/io_demo/example/configuration.nml @@ -40,7 +40,7 @@ coord_system='native' use_xios_io = .true. write_diag = .true. diagnostic_frequency = 1 - subroutine_timers = .false. + subroutine_timers = .true. timer_output_path = 'timer.txt' subroutine_counters = .false. counter_output_suffix = 'counter.txt' @@ -53,7 +53,7 @@ coord_system='native' multifile_io = .false. io_benchmark = .true. n_benchmark_fields = 10 - benchmark_sleep_time = 1 + benchmark_sleep_time = 0 / &logging @@ -63,7 +63,7 @@ coord_system='native' &time calendar = 'timestep' timestep_start = '1' - timestep_end = '100' + timestep_end = '10' calendar_type='gregorian' calendar_start='2016-01-01 15:00:00' calendar_origin='2016-01-01 15:00:00' diff --git a/applications/io_demo/rose-meta/lfric-io_demo/versions.py b/applications/io_demo/rose-meta/lfric-io_demo/versions.py index c67b9ab42..152c043d0 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/versions.py +++ b/applications/io_demo/rose-meta/lfric-io_demo/versions.py @@ -31,43 +31,3 @@ def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ - - -class vn30_t216(MacroUpgrade): - """Upgrade macro for ticket #216 by Ed Hone.""" - - BEFORE_TAG = "vn3.0" - AFTER_TAG = "vn3.0_t216" - - def upgrade(self, config, meta_config=None): - # Commands From: rose-meta/lfric-io_demo - """Add new io_demo namelist""" - source = self.get_setting_value( - config, ["file:configuration.nml", "source"] - ) - source = re.sub( - r"namelist:io", - r"namelist:io" + "\n" + " namelist:io_demo", - source, - ) - self.change_setting_value( - config, ["file:configuration.nml", "source"], source - ) - self.add_setting(config, ["namelist:io_demo"]) - - """Move multifile_io setting from io namelist to io_demo""" - self.remove_setting( - config, ["namelist:io", "multifile_io"]) - self.add_setting( - config, ["namelist:io_demo", "multifile_io"], ".false." - ) - - """Add new default settings""" - self.add_setting( - config, ["namelist:io_demo", "io_benchmark"], ".false." - ) - self.add_setting( - config, ["namelist:io_demo", "n_benchmark_fields"], "0" - ) - - return config, self.reports diff --git a/infrastructure/build/fortran/gfortran.mk b/infrastructure/build/fortran/gfortran.mk index 59b6882f6..77a09287e 100644 --- a/infrastructure/build/fortran/gfortran.mk +++ b/infrastructure/build/fortran/gfortran.mk @@ -45,7 +45,6 @@ FFLAGS_FASTD_RUNTIME = $(FFLAGS_RUNTIME) FFLAGS_FORTRAN_STANDARD = -std=f2008 # Add compiler-specific project option -$(info FFLAGS_GNU_OPTIONS = $(FFLAGS_GNU_OPTIONS)) FFLAGS_COMPILER += $(FFLAGS_GNU_OPTIONS) LDFLAGS_COMPILER = From ec5a07b8199266f6582402d091c775839b4f4e51 Mon Sep 17 00:00:00 2001 From: EdHone Date: Wed, 21 Jan 2026 10:40:25 +0000 Subject: [PATCH 15/21] Fixes for developer suite --- applications/io_demo/build/project.mk | 1 + .../app/io_demo/opt/rose-app-benchmark-nwp.conf | 10 +++++----- .../app/io_demo/opt/rose-app-benchmark.conf | 12 ++++++------ rose-stem/site/meto/common/bin/launch-exe | 17 +++++++++++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/applications/io_demo/build/project.mk b/applications/io_demo/build/project.mk index 13fef734f..2f57b80aa 100644 --- a/applications/io_demo/build/project.mk +++ b/applications/io_demo/build/project.mk @@ -8,4 +8,5 @@ # via the Makefile. $(info io_demo miniapp project specials) +# Enable the use of the sleep() intrinsic for gfortran export FFLAGS_GNU_OPTIONS = -fall-intrinsics diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf index 6ba55db1e..82a994087 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf @@ -3,14 +3,14 @@ MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 MPICH_MPIIO_HINTS_DISPLAY=1 MPICH_MPIIO_STATS=1 +[namelist:io] +subroutine_timers=.true. +write_diag=.true. + [namelist:io_demo] +benchmark_sleep_time=4 io_benchmark=.true. n_benchmark_fields=200 -benchmark_sleep_time=4 - -[namelist:io] -write_diag=.true. -subroutine_timers=.true. [namelist:time] timestep_end='24' diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf index e83d5f009..979cc2991 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf @@ -3,17 +3,17 @@ MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 MPICH_MPIIO_HINTS_DISPLAY=1 MPICH_MPIIO_STATS=1 +[namelist:io] +subroutine_timers=.true. +write_diag=.true. + [namelist:io_demo] +benchmark_sleep_time=1 io_benchmark=.true. n_benchmark_fields=10 -benchmark_sleep_time=1 - -[namelist:io] -write_diag=.true. -subroutine_timers=.true. [namelist:time] timestep_end='24' [namelist:timestepping] -dt=3600.0 \ No newline at end of file +dt=3600.0 diff --git a/rose-stem/site/meto/common/bin/launch-exe b/rose-stem/site/meto/common/bin/launch-exe index f65fbb431..c12bffc15 100755 --- a/rose-stem/site/meto/common/bin/launch-exe +++ b/rose-stem/site/meto/common/bin/launch-exe @@ -26,12 +26,17 @@ fi # Construct launcher options #=========================================== +SET_CORES_PER_NODE=$((TOTAL_RANKS Date: Mon, 2 Feb 2026 10:35:52 +0000 Subject: [PATCH 16/21] Final implementation --- rose-stem/templates/runtime/generate_runtime_application.cylc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rose-stem/templates/runtime/generate_runtime_application.cylc b/rose-stem/templates/runtime/generate_runtime_application.cylc index d1cc6b52e..49108dd8a 100644 --- a/rose-stem/templates/runtime/generate_runtime_application.cylc +++ b/rose-stem/templates/runtime/generate_runtime_application.cylc @@ -52,7 +52,9 @@ 'touch $CYLC_TASK_WORK_DIR/tmp.m', 'mv $CYLC_TASK_WORK_DIR/*.m $TASK_OUTPUT_DIR/results', 'test -f $CYLC_TASK_WORK_DIR/timer.txt && '~ - 'cp $CYLC_TASK_WORK_DIR/timer.txt $TASK_OUTPUT_DIR || true' + 'cp $CYLC_TASK_WORK_DIR/timer.txt $TASK_OUTPUT_DIR || true', + 'test -f $CYLC_TASK_WORK_DIR/vernier-output* && '~ + 'cp $CYLC_TASK_WORK_DIR/vernier-output* $TASK_OUTPUT_DIR || true' ] %} {% if task_values["app_name"] == "canned_test" %} From 07f3b882e6852dbaa7fb83037ffaf41db36626bb Mon Sep 17 00:00:00 2001 From: EdHone Date: Mon, 2 Feb 2026 10:46:25 +0000 Subject: [PATCH 17/21] change vernieer output mode --- rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf | 1 + rose-stem/app/io_demo/opt/rose-app-benchmark.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf index 82a994087..5c82bcd2b 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark-nwp.conf @@ -2,6 +2,7 @@ MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 MPICH_MPIIO_HINTS_DISPLAY=1 MPICH_MPIIO_STATS=1 +VERNIER_OUTPUT_MODE=single [namelist:io] subroutine_timers=.true. diff --git a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf index 979cc2991..2896a3729 100644 --- a/rose-stem/app/io_demo/opt/rose-app-benchmark.conf +++ b/rose-stem/app/io_demo/opt/rose-app-benchmark.conf @@ -2,6 +2,7 @@ MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY=1 MPICH_MPIIO_HINTS_DISPLAY=1 MPICH_MPIIO_STATS=1 +VERNIER_OUTPUT_MODE=single [namelist:io] subroutine_timers=.true. From 29745584e7779e3f3ad3aab345fd6bc7ceb00a2e Mon Sep 17 00:00:00 2001 From: EdHone Date: Wed, 4 Feb 2026 15:08:38 +0000 Subject: [PATCH 18/21] RW comments - new namelist API and rose metadata triggers --- .../lfric-io_demo/HEAD/rose-meta.conf | 2 ++ .../source/algorithm/io_demo_alg_mod.x90 | 1 - .../io_benchmark/io_benchmark_setup_mod.f90 | 26 +++++-------------- .../io_benchmark/io_benchmark_step_mod.x90 | 5 +--- applications/io_demo/source/io_demo.f90 | 6 +---- 5 files changed, 10 insertions(+), 30 deletions(-) diff --git a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf index f7bb99a56..261870f95 100644 --- a/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf +++ b/applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf @@ -19,6 +19,8 @@ description=Configure application to run as an I/O benchmarking tool help=Configure application to run as an I/O benchmarking tool !kind=default type=logical +trigger=namelist:io_demo=benchmark_sleep_time: .true. ; + =namelist:io_demo=n_benchmark_fields: .true. ; [namelist:io_demo=multifile_io] compulsory=true diff --git a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 index b404020fb..b440cc811 100644 --- a/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 +++ b/applications/io_demo/source/algorithm/io_demo_alg_mod.x90 @@ -51,7 +51,6 @@ contains type( field_type ) :: visc real(r_def) :: visc_val - type(mesh_type), pointer :: mesh => null() integer(kind=i_def), parameter :: stencil_depth = 1_i_def type(mesh_type), pointer :: mesh diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 index b3d851721..7da5e45f3 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 @@ -23,7 +23,6 @@ module io_benchmark_setup_mod use linked_list_mod, only: linked_list_type use mesh_mod, only: mesh_type use mesh_collection_mod, only: mesh_collection - use namelist_mod, only: namelist_type implicit none @@ -44,10 +43,6 @@ subroutine create_io_benchmark_fields(modeldb) procedure(read_interface), pointer :: tmp_read_ptr procedure(write_interface), pointer :: tmp_write_ptr - type(namelist_type), pointer :: base_mesh_nml - type(namelist_type), pointer :: finite_element_nml - type(namelist_type), pointer :: io_demo_nml - type(namelist_type), pointer :: io_nml character(str_def) :: prime_mesh_name, tmp_field_name integer(i_def) :: element_order_h integer(i_def) :: element_order_v @@ -55,16 +50,11 @@ subroutine create_io_benchmark_fields(modeldb) integer(i_def) :: n_benchmark_fields integer(i_def) :: diagnostic_frequency - - base_mesh_nml => modeldb%configuration%get_namelist('base_mesh') - finite_element_nml => modeldb%configuration%get_namelist('finite_element') - io_demo_nml => modeldb%configuration%get_namelist('io_demo') - io_nml => modeldb%configuration%get_namelist('io') - call base_mesh_nml%get_value( 'prime_mesh_name', prime_mesh_name ) - call finite_element_nml%get_value('element_order_h', element_order_h) - call finite_element_nml%get_value('element_order_v', element_order_v) - call io_demo_nml%get_value('n_benchmark_fields', n_benchmark_fields) - call io_nml%get_value('diagnostic_frequency', diagnostic_frequency) + prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name() + element_order_h = modeldb%config%finite_element%element_order_h() + element_order_v = modeldb%config%finite_element%element_order_v() + n_benchmark_fields = modeldb%config%io_demo%n_benchmark_fields() + diagnostic_frequency = modeldb%config%io%diagnostic_frequency() mesh => mesh_collection%get_mesh(prime_mesh_name) @@ -95,11 +85,8 @@ subroutine setup_io_benchmark_files(file_list, modeldb) integer(i_def) :: diagnostic_frequency type(field_collection_type), pointer :: io_benchmark_fields - type(namelist_type), pointer :: io_nml - - io_nml => modeldb%configuration%get_namelist('io') - call io_nml%get_value('diagnostic_frequency', diagnostic_frequency) + diagnostic_frequency = modeldb%config%io%diagnostic_frequency() io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") @@ -112,7 +99,6 @@ subroutine setup_io_benchmark_files(file_list, modeldb) fields_in_file=io_benchmark_fields ) ) nullify(io_benchmark_fields) - nullify(io_nml) end subroutine setup_io_benchmark_files diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 index 5fbecfdc0..ee6e242d7 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90 @@ -17,7 +17,6 @@ module io_benchmark_step_mod use log_mod, only: log_event, & log_scratch_space, & LOG_LEVEL_INFO - use namelist_mod, only: namelist_type implicit none @@ -42,13 +41,11 @@ contains class(field_parent_type), pointer :: step_field type(field_type), pointer :: kernel_field type(field_type), pointer :: diffusion_field - type(namelist_type), pointer :: io_demo_nml integer(i_def) :: i, sleep_duration real(r_def) :: loop_factor - io_demo_nml => modeldb%configuration%get_namelist('io_demo') - call io_demo_nml%get_value('benchmark_sleep_time', sleep_duration) + sleep_duration = modeldb%config%io_demo%benchmark_sleep_time() ! Get field data ready depository => modeldb%fields%get_field_collection("depository") diff --git a/applications/io_demo/source/io_demo.f90 b/applications/io_demo/source/io_demo.f90 index 457f20500..8c7cd3e94 100644 --- a/applications/io_demo/source/io_demo.f90 +++ b/applications/io_demo/source/io_demo.f90 @@ -27,7 +27,6 @@ program io_demo use io_demo_driver_mod, only: initialise, step, finalise use timing_mod, only: init_timing, final_timing use io_config_mod, only: timer_output_path - use namelist_mod, only: namelist_type implicit none @@ -35,7 +34,6 @@ program io_demo type(modeldb_type) :: modeldb character(*), parameter :: program_name = "io_demo" character(:), allocatable :: filename - type(namelist_type), pointer :: io_nml logical :: lsubroutine_timers integer, parameter :: default_seed = 123456789 type(random_number_generator_type), pointer :: rng @@ -60,10 +58,8 @@ program io_demo deallocate( filename ) call init_logger( modeldb%mpi%get_comm(), program_name ) - io_nml => modeldb%configuration%get_namelist('io') - call io_nml%get_value('subroutine_timers', lsubroutine_timers) + lsubroutine_timers = modeldb%config%io%subroutine_timers() call init_timing( modeldb%mpi%get_comm(), lsubroutine_timers, program_name, timer_output_path ) - nullify( io_nml ) call init_collections() call init_time(modeldb) From f489e4ceb41c6a92a0230bcf905b2941002c118a Mon Sep 17 00:00:00 2001 From: EdHone Date: Wed, 4 Feb 2026 19:27:32 +0000 Subject: [PATCH 19/21] More efficient function space assignment --- .../driver/io_benchmark/io_benchmark_setup_mod.f90 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 index 7da5e45f3..b770cad3e 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 @@ -16,6 +16,7 @@ module io_benchmark_setup_mod use field_parent_mod, only: read_interface, write_interface use file_mod, only: FILE_MODE_WRITE use fs_continuity_mod, only: Wtheta + use function_space_mod, only: function_space_type use function_space_collection_mod, only: function_space_collection use lfric_xios_file_mod, only: lfric_xios_file_type, OPERATION_TIMESERIES use lfric_xios_read_mod, only: read_field_generic @@ -42,6 +43,7 @@ subroutine create_io_benchmark_fields(modeldb) type(field_type) :: tmp_io_field procedure(read_interface), pointer :: tmp_read_ptr procedure(write_interface), pointer :: tmp_write_ptr + type(function_space_type), pointer :: wtheta_fs character(str_def) :: prime_mesh_name, tmp_field_name integer(i_def) :: element_order_h @@ -60,13 +62,13 @@ subroutine create_io_benchmark_fields(modeldb) call modeldb%fields%add_empty_field_collection("io_benchmark_fields") io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") + wtheta_fs => function_space_collection%get_fs( mesh, element_order_h, & + element_order_v, Wtheta ) do i = 1, n_benchmark_fields write(tmp_field_name, "(A19, I3.3)") 'io_benchmark_field_', i - call tmp_io_field%initialise( vector_space = & - function_space_collection%get_fs(mesh, element_order_h, & - element_order_v, Wtheta), & - name=tmp_field_name ) + call tmp_io_field%initialise( vector_space = wtheta_fs, & + name=tmp_field_name ) tmp_read_ptr => read_field_generic tmp_write_ptr => write_field_generic call tmp_io_field%set_read_behaviour(tmp_read_ptr) @@ -74,6 +76,8 @@ subroutine create_io_benchmark_fields(modeldb) call io_benchmark_fields%add_field(tmp_io_field) end do + nullify( mesh, io_benchmark_fields, wtheta_fs ) + end subroutine create_io_benchmark_fields subroutine setup_io_benchmark_files(file_list, modeldb) From cc89e8a8483f67814b1e707af7a6d44a79cf2e33 Mon Sep 17 00:00:00 2001 From: EdHone Date: Wed, 4 Feb 2026 19:32:14 +0000 Subject: [PATCH 20/21] fix indentation --- .../io_benchmark/io_benchmark_setup_mod.f90 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 index b770cad3e..b79adb181 100644 --- a/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 +++ b/applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90 @@ -34,6 +34,7 @@ module io_benchmark_setup_mod !> @details Creates the fields needed for the IO benchmark !> @param[in,out] modeldb The model database in which to store model data. subroutine create_io_benchmark_fields(modeldb) + implicit none type(modeldb_type), intent(inout) :: modeldb @@ -66,14 +67,14 @@ subroutine create_io_benchmark_fields(modeldb) element_order_v, Wtheta ) do i = 1, n_benchmark_fields - write(tmp_field_name, "(A19, I3.3)") 'io_benchmark_field_', i - call tmp_io_field%initialise( vector_space = wtheta_fs, & - name=tmp_field_name ) - tmp_read_ptr => read_field_generic - tmp_write_ptr => write_field_generic - call tmp_io_field%set_read_behaviour(tmp_read_ptr) - call tmp_io_field%set_write_behaviour(tmp_write_ptr) - call io_benchmark_fields%add_field(tmp_io_field) + write(tmp_field_name, "(A19, I3.3)") 'io_benchmark_field_', i + call tmp_io_field%initialise( vector_space = wtheta_fs, & + name=tmp_field_name ) + tmp_read_ptr => read_field_generic + tmp_write_ptr => write_field_generic + call tmp_io_field%set_read_behaviour(tmp_read_ptr) + call tmp_io_field%set_write_behaviour(tmp_write_ptr) + call io_benchmark_fields%add_field(tmp_io_field) end do nullify( mesh, io_benchmark_fields, wtheta_fs ) From b42dd32c7dea7b4ffbe03617058b7d6801b3a573 Mon Sep 17 00:00:00 2001 From: Ed Hone <68642690+EdHone@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:02:54 +0000 Subject: [PATCH 21/21] Update applications/io_demo/source/driver/io_demo_driver_mod.f90 Suggestion from RW Co-authored-by: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com> --- applications/io_demo/source/driver/io_demo_driver_mod.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/io_demo/source/driver/io_demo_driver_mod.f90 b/applications/io_demo/source/driver/io_demo_driver_mod.f90 index 8d179b7ff..cc3044f21 100644 --- a/applications/io_demo/source/driver/io_demo_driver_mod.f90 +++ b/applications/io_demo/source/driver/io_demo_driver_mod.f90 @@ -185,7 +185,7 @@ subroutine initialise(program_name, modeldb) ! Setup multifile reading !======================================================================= files_init_ptr => null() - if(multifile_io) then + if (multifile_io) then call create_multifile_io_fields(modeldb) call init_multifile_io(modeldb) end if