Skip to content

Commit

Permalink
Minor changes to README and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svadams committed May 22, 2024
1 parent e249ba9 commit e02c61e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions xios_examples/write_domain_parallel/README
Original file line number Diff line number Diff line change
Expand Up @@ -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)



4 changes: 2 additions & 2 deletions xios_examples/write_domain_parallel/test_write_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e02c61e

Please sign in to comment.