nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Wrap XIOS functionality for reading from file #597

Open jwallwork23 opened 3 days ago

jwallwork23 commented 3 days ago

Wrap XIOS functionality for reading from file

Fixes #577

Task List


Change Description

So far we have only considered writing to file in the XIOS integration work. This PR will enable reading from file, too, although there seems to be a hitch with completing this right now.

XIOS' read methods are wrapped, as well as methods for setting file attributes related to the file mode (read vs. write) and parallel access mode.


Test Description

A XiosRead_test.cpp script is added, which reads from a input.nc file and checks its dimensions and values are as expected.

Question for reviewer: is it okay to add a NetCDF file to the repo? (I notice such files are ignored by default so had to force-add it.)

This PR also modifies XiosFile_test.cpp to test the newly wrapped parts of the XIOS API related to file attributes, as well as modifying XiosWrite_test.cpp to check the existence of output.nc and delete it at the end of the test.


Pre-Request Checklist