Skip to content
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
e9bdaf4
Progress save
mo-rickywong Mar 17, 2026
bb966f5
Remove global config from init_fem and surrounding code
mo-rickywong Mar 20, 2026
eff9a44
Merge branch 'main' into RmGlobalCfg_Init_fem
mo-rickywong Mar 20, 2026
15b9dda
Commit changes that mean this branch is clear of chi_tranform_mod
mo-rickywong Mar 20, 2026
d55e7c2
Merge branch 'main' into RmGlobalCfg_driver_pt1
mo-rickywong Mar 20, 2026
4becb8b
Merge branch 'RmGlobalCfg_driver_pt1' into RmGlobalCfg_Init_fem
mo-rickywong Mar 21, 2026
27de4c4
Clean out rest of driver
mo-rickywong Mar 22, 2026
4259432
Update multitile provision
mo-rickywong Mar 23, 2026
97a85fe
Update
mo-rickywong Mar 24, 2026
05e0850
Add a newer version of gemoetric constants
mo-rickywong Mar 25, 2026
df1eecc
Reverting file back to original on main
mo-rickywong Mar 25, 2026
7869db7
Need an unaltered compute latlon
mo-rickywong Mar 25, 2026
a019544
Revert old compute latlon
mo-rickywong Mar 25, 2026
131f7fc
Duplicate more
mo-rickywong Mar 25, 2026
bffc6d9
duplicate chi_transform
mo-rickywong Mar 25, 2026
a9ed9e1
update
mo-rickywong Mar 25, 2026
d57f71a
test for new files
mo-rickywong Mar 25, 2026
827e6e1
new files
mo-rickywong Mar 25, 2026
3951a00
update
mo-rickywong Mar 26, 2026
7dd12a7
Getting it back to before
mo-rickywong Mar 26, 2026
f08b803
Pass args, not config_type
mo-rickywong Mar 26, 2026
da8ece9
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Mar 26, 2026
98f849f
Updates
mo-rickywong Mar 31, 2026
e560f49
updates
mo-rickywong Mar 31, 2026
41c3151
Updates
mo-rickywong Apr 1, 2026
33172d9
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Apr 1, 2026
c1220e0
Tidy up and don't pass config type to initialise lfrix-xios as it wil…
mo-rickywong Apr 2, 2026
e1396eb
Passing geometry and toplogy as lfric2lfric may not be using base mesh
mo-rickywong Apr 3, 2026
05d8bc1
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Apr 21, 2026
c3cbd14
Some tidy up, doxygen comments
mo-rickywong Apr 22, 2026
515f892
Remove this accidental commit
mo-rickywong Apr 22, 2026
d4f8af7
Update doxygen comments
mo-rickywong Apr 23, 2026
135eaff
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Apr 23, 2026
71ebba6
Add in update macros
mo-rickywong Apr 29, 2026
6d2589c
Update rose stem to pre-macro state
mo-rickywong Apr 29, 2026
e740180
Add some kinds
mo-rickywong Apr 29, 2026
c68bc2b
Change the version on apps so the upgrade macros will work
mo-rickywong Apr 29, 2026
781111b
Fix existing issues on trunk cause update macro failures
mo-rickywong Apr 29, 2026
c5bfc2f
Update rose meta and macros for driver
mo-rickywong Apr 29, 2026
d9e59d5
Update versions update so that lfric2lfric partition duplicates aren'…
mo-rickywong Apr 29, 2026
946b1ad
Correct rose metadata settings
mo-rickywong Apr 30, 2026
284d495
Merge branch 'main' into fix_rose_stem_io_demo_and_lbc_demo
mo-rickywong Apr 30, 2026
6e2d278
Set io_demo to point to corresponding version of driver
mo-rickywong Apr 30, 2026
2ad260e
Merge branch 'fix_rose_stem_io_demo_and_lbc_demo' into RmGlobalCfg_Co…
mo-rickywong Apr 30, 2026
41fc339
update versions file
mo-rickywong Apr 30, 2026
6f9cdc4
Update some breakages from mergin on head on main
mo-rickywong May 1, 2026
be3a8c3
Tweaks
mo-rickywong May 1, 2026
e55befb
typo
mo-rickywong May 1, 2026
3c135d4
update
mo-rickywong May 1, 2026
ea62f92
Update metadata and macro so that unecessary namlists are not injected
mo-rickywong May 1, 2026
c275342
Update versions.py after app macros modified it
mo-rickywong May 1, 2026
b2c37c9
typo
mo-rickywong May 1, 2026
3395c89
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong May 1, 2026
dce3a6c
Remove explict false
mo-rickywong May 2, 2026
13e614a
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong May 8, 2026
3aadd0c
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong May 8, 2026
766e91c
Missing types
mo-rickywong May 8, 2026
eb25697
Missing type
mo-rickywong May 8, 2026
b09ac5e
Missing use statement
mo-rickywong May 8, 2026
7347a3a
Update to pass config_type
mo-rickywong May 28, 2026
aa0fc57
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong May 28, 2026
c08393d
Some tidy on doxygen comments
mo-rickywong Jun 4, 2026
5bc8501
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Jun 4, 2026
0ac8cc2
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Jun 5, 2026
5ea0eeb
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Jun 18, 2026
c0c80f8
1st tranch of batch changes requested by @tommbendall
mo-rickywong Jun 25, 2026
4f4f6bc
2nd tranch of changes requested by tom Bendall
mo-rickywong Jun 25, 2026
e8921d8
1st tranch of changes requested by Steve Mullerworth
mo-rickywong Jun 25, 2026
86a9f26
1st tranch of changes requested by Andrew Coughtrie
mo-rickywong Jun 25, 2026
c5ea5c0
Local change for Steve Mullerworth
mo-rickywong Jun 25, 2026
eda9eb4
1st tranch of changes requested by Matthew Hambley
mo-rickywong Jun 25, 2026
077e3e3
Change for Matthew Hambley on character string
mo-rickywong Jun 25, 2026
5674b48
Knock on updates from requested changes
mo-rickywong Jun 26, 2026
180f52a
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Jun 26, 2026
062bdeb
Changes to demonstrate kgo changes on lfric2lfric
mo-rickywong Jun 29, 2026
63e2785
Reinstate original changes
mo-rickywong Jun 29, 2026
64cb834
Merge branch 'main' into RmGlobalCfg_CoreDriver
mo-rickywong Jun 30, 2026
98d5e02
revert change to vn3.1 metadata
james-bruten-mo Jul 1, 2026
185f977
apply macros
james-bruten-mo Jul 1, 2026
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ OPERATE_ON ?= infrastructure \
mesh_tools \
applications/skeleton \
applications/simple_diffusion \
applications/coupled \
applications/lbc_demo \
applications/io_demo

Expand Down
3 changes: 3 additions & 0 deletions applications/coupled/example/configuration_glo.nml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ coord_system='native'
&partitioning
partitioner='cubedsphere',
panel_decomposition = 'auto',
tile_size_x=1,
tile_size_y=1,
inner_halo_tiles=.false.
/

&planet
Expand Down
3 changes: 3 additions & 0 deletions applications/coupled/example/configuration_lam.nml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ coord_system='native'
&partitioning
partitioner='planar',
panel_decomposition = 'auto',
tile_size_x=1,
tile_size_y=1,
inner_halo_tiles=.false.
/

&planet
Expand Down
3 changes: 2 additions & 1 deletion applications/coupled/source/coupled.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ program coupled
call init_config( filename, coupled_required_namelists, &
config=modeldb%config )

call init_logger( modeldb%mpi%get_comm(), &
call init_logger( modeldb%config, &
modeldb%mpi%get_comm(), &
program_name//"_"//cpl_component_name )

write(log_scratch_space,'(A)') &
Expand Down
25 changes: 24 additions & 1 deletion applications/coupled/source/driver/coupled_driver_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ subroutine initialise( program_name, modeldb, calendar )
integer(i_def) :: geometry
integer(i_def) :: method
integer(i_def) :: number_of_layers
integer(i_def) :: tile_size_x
integer(i_def) :: tile_size_y
real(r_def) :: domain_bottom
real(r_def) :: domain_height
real(r_def) :: scaled_radius
logical :: check_partitions

logical :: inner_halo_tiles
logical :: prepartitioned

integer(i_def), allocatable :: tile_size(:,:)
integer(i_def) :: i
integer(i_def), parameter :: one_layer = 1_i_def

Expand All @@ -91,6 +97,17 @@ subroutine initialise( program_name, modeldb, calendar )
domain_height = modeldb%config%extrusion%domain_height()
number_of_layers = modeldb%config%extrusion%number_of_layers()
scaled_radius = modeldb%config%planet%scaled_radius()
prepartitioned = modeldb%config%base_mesh%prepartitioned()

if (prepartitioned) then
tile_size_x = 1
tile_size_y = 1
inner_halo_tiles = .false.
else
tile_size_x = maxval([1,modeldb%config%partitioning%tile_size_x()])
tile_size_y = maxval([1,modeldb%config%partitioning%tile_size_y()])
inner_halo_tiles = modeldb%config%partitioning%inner_halo_tiles()
end if

! Initialise mesh
! Determine the required meshes
Expand Down Expand Up @@ -120,23 +137,29 @@ subroutine initialise( program_name, modeldb, calendar )
! Create the required meshes
stencil_depth = 1
check_partitions = .false.
allocate(tile_size(2,size(base_mesh_names)))
tile_size(1,:) = tile_size_x
tile_size(2,:) = tile_size_y
call init_mesh( modeldb%config, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
base_mesh_names, extrusion, &
inner_halo_tiles, tile_size, &
stencil_depth, check_partitions )

allocate( twod_names, source=base_mesh_names )
do i=1, size(twod_names)
twod_names(i) = trim(twod_names(i))//'_2d'
end do

call create_mesh( base_mesh_names, extrusion_2d, &
inner_halo_tiles, tile_size, &
alt_name=twod_names )
call assign_mesh_maps( twod_names )


! Build the FEM function spaces and coordinate fields
call init_fem( mesh_collection, chi_inventory, panel_id_inventory )
call init_fem( modeldb%config, chi_inventory, panel_id_inventory )

! Create and initialise prognostic fields
mesh => mesh_collection%get_mesh(prime_mesh_name)
Expand Down
19 changes: 15 additions & 4 deletions applications/coupled/source/driver/init_coupled_mod.X90
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,24 @@ module init_coupled_mod
procedure(write_interface), pointer :: tmp_ptr

integer(i_def) :: order_h, order_v
integer(i_def) :: coord_system
integer(i_def) :: geometry
integer(i_def) :: topology
real(r_def) :: scaled_radius

type(function_space_type), pointer :: fs

call log_event( 'coupled: Initialising app ...', LOG_LEVEL_INFO )

! Get the name of the coupling component
call modeldb%values%get_value("cpl_name", cpl_component_name)

order_h = modeldb%config%finite_element%element_order_h()
order_v = modeldb%config%finite_element%element_order_v()
order_h = modeldb%config%finite_element%element_order_h()
order_v = modeldb%config%finite_element%element_order_v()
coord_system = modeldb%config%finite_element%coord_system()
geometry = modeldb%config%base_mesh%geometry()
topology = modeldb%config%base_mesh%topology()
scaled_radius = modeldb%config%planet%scaled_radius()

fs => function_space_collection%get_fs(mesh, order_h, order_v, W3)

Expand Down Expand Up @@ -122,8 +131,10 @@ module init_coupled_mod
call depository%get_field( trim(name), field_1_ptr)
! Initialise the values in the field that will be sent to the coupler.
! Set them to the longitude of the cell-centre (converted to degrees)
call invoke(compute_latlon_kernel_type(field_2, field_1_ptr, &
chi, panel_id), &
call invoke(compute_latlon_kernel_type(field_2, field_1_ptr, &
chi, panel_id, geometry, &
topology, coord_system, &
scaled_radius), &
inc_a_times_X(radians_to_degrees, field_1_ptr))
! Add that field to the coupling 2d "send" field collection
abs_field_ptr => field_1_ptr
Expand Down
3 changes: 3 additions & 0 deletions applications/io_demo/example/configuration.nml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ coord_system='native'
&partitioning
partitioner='cubedsphere',
panel_decomposition = 'auto',
tile_size_x=1,
tile_size_y=1,
inner_halo_tiles=.false.
/

&planet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
import=lfric-driver/vn3.1

[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=benchmark_sleep_time]
compulsory=true
description=Number of seconds to sleep for each timestep in I/O benchmark mode
!kind=default
type=integer

[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
trigger=namelist:io_demo=benchmark_sleep_time: .true. ;
=namelist:io_demo=n_benchmark_fields: .true. ;
type=logical

[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
=on and off
!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:multifile_io]
compulsory=false
duplicate=true
Expand Down
41 changes: 38 additions & 3 deletions applications/io_demo/source/driver/io_demo_checkpoint_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
!! files and fields to it
module io_demo_checkpoint_mod

use constants_mod, only: i_def, str_max_filename, str_def, r_second
use constants_mod, only: i_def, r_def, str_max_filename, &
str_def, r_second
use driver_modeldb_mod, only: modeldb_type
use event_mod, only: event_action
use event_actor_mod, only: event_actor_type
Expand All @@ -22,6 +23,12 @@ module io_demo_checkpoint_mod
use lfric_xios_file_mod, only: lfric_xios_file_type, OPERATION_ONCE
use log_mod, only: log_event, log_scratch_space, &
LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type

use base_mesh_config_mod, only: geometry_spherical, &
geometry_planar, &
topology_fully_periodic, &
topology_non_periodic

implicit none

Expand Down Expand Up @@ -54,8 +61,34 @@ subroutine setup_checkpoint_io(modeldb, chi, panel_id)
character(len=str_def) :: checkpoint_id
integer(i_def) :: ts_start, ts_end, t_cp, freq_ts

type(mesh_type), pointer :: mesh

integer(i_def) :: geometry
integer(i_def) :: topology
integer(i_def) :: coord_system
real(r_def) :: scaled_radius

call log_event( 'io_demo: Setting up checkpoint I/O', LOG_LEVEL_DEBUG )

mesh => chi(1)%get_mesh()
if (mesh%is_geometry_spherical()) then
geometry = geometry_spherical
else
geometry = geometry_planar
end if

if (mesh%is_topology_periodic()) then
topology = topology_fully_periodic
else if (mesh%is_topology_non_periodic()) then
topology = topology_non_periodic
else
call log_event( 'Unsupported mesh topology', &
log_level_error )
end if

coord_system = modeldb%config%finite_element%coord_system()
scaled_radius = modeldb%config%planet%scaled_radius()

ts_start = modeldb%calendar%parse_instance(modeldb%config%time%timestep_start())
ts_end = modeldb%calendar%parse_instance(modeldb%config%time%timestep_end())
checkpoint_fields => modeldb%fields%get_field_collection("depository")
Expand Down Expand Up @@ -125,8 +158,10 @@ subroutine setup_checkpoint_io(modeldb, chi, panel_id)
! Add checkpoint context to clock events so that it is advanced at each timestep
event_actor_ptr => cp_context
context_advance => advance
call cp_context%initialise_xios_context( modeldb%mpi%get_comm(), chi, panel_id, &
modeldb%clock, modeldb%calendar )
call cp_context%initialise_xios_context( &
modeldb%mpi%get_comm(), chi, panel_id, &
modeldb%clock, modeldb%calendar, &
geometry, topology, coord_system, scaled_radius )

call modeldb%clock%add_event(context_advance, event_actor_ptr)
call cp_context%set_active(.true.)
Expand Down
41 changes: 33 additions & 8 deletions applications/io_demo/source/driver/io_demo_driver_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,24 @@ subroutine initialise(program_name, modeldb)

integer(i_def) :: stencil_depth(1)
integer(i_def) :: geometry
integer(i_def) :: topology
integer(i_def) :: method
integer(i_def) :: number_of_layers
integer(i_def) :: tile_size_x
integer(i_def) :: tile_size_y
real(r_def) :: domain_bottom
real(r_def) :: domain_height
real(r_def) :: scaled_radius
logical :: check_partitions
logical :: multifile_io
logical :: io_benchmark
logical :: checkpoint_write
logical :: checkpoint_read

logical :: check_partitions
logical :: inner_halo_tiles
logical :: prepartitioned
logical :: multifile_io
logical :: io_benchmark
logical :: checkpoint_write
logical :: checkpoint_read

integer(i_def), allocatable :: tile_size(:,:)
integer(i_def), parameter :: one_layer = 1_i_def
integer(i_def) :: i

Expand All @@ -109,17 +116,29 @@ subroutine initialise(program_name, modeldb)
!=======================================================================
prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name()
geometry = modeldb%config%base_mesh%geometry()
topology = modeldb%config%base_mesh%topology()
method = modeldb%config%extrusion%method()
domain_height = modeldb%config%extrusion%domain_height()
number_of_layers = modeldb%config%extrusion%number_of_layers()
scaled_radius = modeldb%config%planet%scaled_radius()
prepartitioned = modeldb%config%base_mesh%prepartitioned()
multifile_io = modeldb%config%io_demo%multifile_io()
io_benchmark = modeldb%config%io_demo%io_benchmark()
checkpoint_write = modeldb%config%io%checkpoint_write()
checkpoint_read = modeldb%config%io%checkpoint_read()

! Log the configuration

if (prepartitioned) then
tile_size_x = 1
tile_size_y = 1
inner_halo_tiles = .false.
else
tile_size_x = maxval([1,modeldb%config%partitioning%tile_size_x()])
tile_size_y = maxval([1,modeldb%config%partitioning%tile_size_y()])
inner_halo_tiles = modeldb%config%partitioning%inner_halo_tiles()
end if

!=======================================================================
! Mesh
!=======================================================================
Expand Down Expand Up @@ -167,24 +186,29 @@ subroutine initialise(program_name, modeldb)
! ---------------------------------------------------------
stencil_depth = 1
check_partitions = .false.
allocate(tile_size(2,size(base_mesh_names)))
tile_size(1,:) = tile_size_x
tile_size(2,:) = tile_size_y
call init_mesh( modeldb%config, &
modeldb%mpi%get_comm_rank(), &
modeldb%mpi%get_comm_size(), &
base_mesh_names, extrusion, &
inner_halo_tiles, tile_size, &
stencil_depth, check_partitions )

allocate( twod_names, source=base_mesh_names )
do i=1, size(twod_names)
twod_names(i) = trim(twod_names(i))//'_2d'
end do
call create_mesh( base_mesh_names, extrusion_2d, &
inner_halo_tiles, tile_size, &
alt_name=twod_names )
call assign_mesh_maps(twod_names)

!=======================================================================
! Build the FEM function spaces and coordinate fields
!=======================================================================
call init_fem( mesh_collection, chi_inventory, panel_id_inventory )
call init_fem( modeldb%config, chi_inventory, panel_id_inventory )

!=======================================================================
! Setup multifile reading
Expand All @@ -207,10 +231,11 @@ subroutine initialise(program_name, modeldb)
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 )
geometry, topology, populate_filelist=files_init_ptr )
else
call init_io( program_name, prime_mesh_name, modeldb, &
chi_inventory, panel_id_inventory )
chi_inventory, panel_id_inventory, &
geometry, topology )
end if


Expand Down
Loading
Loading