From 913500eb1ec1f1cd86ec76215ac6023ecad36e72 Mon Sep 17 00:00:00 2001 From: Samantha Adams Date: Wed, 22 May 2024 10:25:39 +0100 Subject: [PATCH] Minor changes to README and unit tests --- xios_examples/write_domain_parallel/README | 12 ++++++------ .../write_domain_parallel/test_write_simple.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xios_examples/write_domain_parallel/README b/xios_examples/write_domain_parallel/README index 8b669f9..3f0799a 100644 --- a/xios_examples/write_domain_parallel/README +++ b/xios_examples/write_domain_parallel/README @@ -2,16 +2,16 @@ write_domain_parallel --------------------- This example demonstrates XIOS parallel write of a decomposed domain to one output NetCDF file. -It sets up a 100 x 100 unstructured horizontal domain with 3 vertical levels and creates two fields with sample data. -For file 1, data is written at hourly intervals for 10 timesteps and incremented by 0.2 units. For file 2 data is written at 2-hourly intervals for 5 timesteps and incremented by 0.5 units. +It sets up a 100 x 100 unstructured horizontal domain with 3 vertical levels and creates a field with sample data. +Data is written at hourly intervals for 10 timesteps and incremented by 0.2 units. Unit tests include: -- Checking the output files exist and are named correctly. -- Checking that each file has the correct number of times (10,5) +- Checking the output file exists and is named correctly. +- Checking that the file has the correct number of times (10) - Checking that the average value of the field in level 1 and final - timestep matches what we expect based on the starting value, number - of timesteps and increment (2.8, 3.0) + timestep matches what we expect based on the starting value and number + of timesteps and increment (2.8) diff --git a/xios_examples/write_domain_parallel/test_write_simple.py b/xios_examples/write_domain_parallel/test_write_simple.py index 447d712..fe81e25 100644 --- a/xios_examples/write_domain_parallel/test_write_simple.py +++ b/xios_examples/write_domain_parallel/test_write_simple.py @@ -35,9 +35,9 @@ def test_parallel_write(self): rootgrp = netCDF4.Dataset(runfile_1, 'r') file_1_data = rootgrp['global_field_1'] - # Check file 1 has 10 times + # Check file has 10 times assert(file_1_data.shape[0] == 10) - # Check average value of file 1, level 1, time 1 + # Check average value of file for level 1, time 1 expected = 2.8 result = np.average(file_1_data[-1,0,:]) diff = result - expected