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

Closed jwallwork23 closed 3 months ago

jwallwork23 commented 4 months 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 enables reading from file, too.

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

jwallwork23 commented 4 months ago

The commit history is rather nonlinear given a couple of merges from develop so (as mentioned above) I advocate squash-merging this PR rather than going through a rebase.

jwallwork23 commented 3 months ago

This has now been updated to use CDL files rather than NetCDF. Would you mind taking a look to re-review @timspainNERSC?

jwallwork23 commented 3 months ago

Reverted to standard = initialisation as discussed in the meeting.

Managed to do the rebase in the end so no need to squash-merge.

Ready for re-review now @timspainNERSC, thanks.