Skip to content

Commit 23f4ee4

Browse files
authored
Fix parallel implementation of temporal reading (#414)
1 parent b2374d3 commit 23f4ee4

5 files changed

Lines changed: 53 additions & 7 deletions

File tree

components/lfric-xios/source/lfric_xios_temporal_mod.x90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@ contains
286286
trim(file_id)//init_suffix )
287287

288288
call xios_set_attr( initial_read_file, name=trim(adjustl(file_path)), &
289-
output_freq=timestep_duration, &
290-
mode="read", &
291-
type="one_file", &
292-
record_offset=record_offset, &
293-
time_counter_name="time", &
294-
enabled=.true. )
289+
output_freq=timestep_duration, &
290+
mode="read", &
291+
type="one_file", &
292+
record_offset=record_offset, &
293+
time_counter_name="time", &
294+
enabled=.true. )
295295

296296
! Move on record offset for next read
297297
record_offset = record_offset + 1

components/lfric-xios/source/lfric_xios_utils_mod.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ function read_time_data(file_path) result(time_data)
172172
type(lfric_ncdf_dims_type) :: time_dim
173173
type(lfric_ncdf_field_type) :: time_var
174174

175+
call log_event( "Reading time data from file ["//trim(file_path)//"]", &
176+
LOG_LEVEL_TRACE )
177+
175178
if (global_mpi%get_comm_rank() == 0) then
176179
file_ncdf = lfric_ncdf_file_type( trim(file_path)//".nc", &
177180
open_mode=FILE_OP_OPEN, &
@@ -194,7 +197,6 @@ function read_time_data(file_path) result(time_data)
194197
time_dim = lfric_ncdf_dims_type(trim(dim_id), file_ncdf)
195198
n_t = time_dim%get_size()
196199
allocate( input_data( n_t ) )
197-
allocate( time_data( n_t ) )
198200

199201
! Read the time data from the ancil file
200202
time_var = lfric_ncdf_field_type(trim(var_id), file_ncdf)
@@ -228,6 +230,7 @@ function read_time_data(file_path) result(time_data)
228230
call global_mpi%broadcast(input_data, n_t_buf(1), 0)
229231
call global_mpi%broadcast(time_meta_buf, size(time_meta_buf, 1)*str_def, 0)
230232

233+
allocate(time_data(n_t_buf(1)))
231234
ref_date_str = time_meta_buf(1)
232235
time_units = time_meta_buf(2)
233236
ref_date = parse_date_as_xios(trim(adjustl(ref_date_str)))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[file:mesh_C48.nc]
2+
mode=auto
3+
source=$MESH_DIR/mesh_C48.nc
4+
5+
[namelist:base_mesh]
6+
file_prefix='mesh_C48'
7+
geometry='spherical'
8+
9+
[namelist:partitioning]
10+
partitioner='cubedsphere'

rose-stem/site/common/io_demo/tasks_io_demo.cylc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,32 @@
4848
"tsteps": 90,
4949
}) %}
5050

51+
52+
{% elif task_ns.conf_name == "temporal_reading-C48" %}
53+
54+
{% do task_dict.update({
55+
"opt_confs": ["temporal_reading"],
56+
"resolution": "C48",
57+
"tsteps": 90,
58+
"kgo_checks": [],
59+
"mpi_parts": 24,
60+
}) %}
61+
62+
63+
{% elif task_ns.conf_name == "temporal_reading-C48-server" %}
64+
65+
{% do task_dict.update({
66+
"opt_confs": ["temporal_reading"],
67+
"resolution": "C48",
68+
"tsteps": 90,
69+
"kgo_checks": [],
70+
"mpi_parts": 24,
71+
"mpi_parts_xios": 1,
72+
"xios_nodes": 1,
73+
"xios_server_mode": true,
74+
"xios_server_ranks": 1,
75+
}) %}
76+
5177
{% elif task_ns.conf_name == "benchmark-C24" %}
5278

5379
{% do task_dict.update({

rose-stem/site/meto/groups/group_io_demo.cylc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"io_demo_multifile-C24_azspice_gnu_fast-debug-32bit",
2020
"io_demo_temporal_reading-C12_azspice_gnu_fast-debug-64bit",
2121
"io_demo_temporal_reading-C12_azspice_gnu_fast-debug-32bit",
22+
"io_demo_temporal_reading-C48_azspice_gnu_fast-debug-32bit",
2223
"io_demo_benchmark-C24_azspice_gnu_fast-debug-64bit",
2324
"io_demo_benchmark-C24_azspice_gnu_fast-debug-32bit",
2425
"io_demo_azspice_unit_tests",
@@ -57,6 +58,8 @@
5758
"io_demo_temporal_reading-C12_ex1a_cce_fast-debug-32bit",
5859
"io_demo_temporal_reading-C12_ex1a_gnu_fast-debug-64bit",
5960
"io_demo_temporal_reading-C12_ex1a_gnu_fast-debug-32bit",
61+
"io_demo_temporal_reading-C48_ex1a_cce_fast-debug-32bit",
62+
"io_demo_temporal_reading-C48_ex1a_gnu_fast-debug-64bit",
6063
"io_demo_benchmark-C24_ex1a_cce_fast-debug-32bit",
6164
"io_demo_benchmark-C24_ex1a_gnu_fast-debug-32bit",
6265
"io_demo_benchmark-C24_ex1a_gnu_fast-debug-64bit",
@@ -66,6 +69,10 @@
6669
"io_demo_benchmark-nwp-C224_ex1a_cce_fast-debug-32bit",
6770
"io_demo_benchmark-nwp-C224_ex1a_gnu_fast-debug-32bit",
6871
],
72+
"io_demo_ex1a_servers": [
73+
"io_demo_temporal_reading-C48-server_ex1a_cce_fast-debug-32bit",
74+
"io_demo_temporal_reading-C48-server_ex1a_gnu_fast-debug-64bit",
75+
],
6976
"io_demo_ex1a": [
7077
"io_demo_ex1a_developer"
7178
],

0 commit comments

Comments
 (0)