diff --git a/opening-hdf5/README.md b/opening-hdf5/README.md new file mode 100644 index 0000000..301bc25 --- /dev/null +++ b/opening-hdf5/README.md @@ -0,0 +1,21 @@ +## Location of data +The data path is hardcoded such that the following tree structure is assumed: +``` +data/ + grid.h5 + hydrodynamic_U.h5 + hydrodynamic_V.h5 +interactive-track-and-trace/ + opening-hdf5/ + ... +``` + +## Compiling +Makes use of `mdspan` which is not supported by GCC libstdc++ at time of writing. See [compiler support](https://en.cppreference.com/w/cpp/compiler_support/23) for `mdspan`. +Let the current directory be the `src` directory. Run: +```shell +mkdir build +cd build +cmake .. +make +``` diff --git a/opening-hdf5/src/main.cpp b/opening-hdf5/src/main.cpp index 1acc55d..691e160 100644 --- a/opening-hdf5/src/main.cpp +++ b/opening-hdf5/src/main.cpp @@ -85,7 +85,7 @@ pair, std::dextents> get3DMat(NcVar var) { } int main () { - netCDF::NcFile data("../../../hdf5/hydrodynamic_U.h5", netCDF::NcFile::read); + netCDF::NcFile data("../../../../data/hydrodynamic_U.h5", netCDF::NcFile::read); multimap< string, NcVar > vars = data.getVars();