Skip to content

Commit e56494f

Browse files
committed
Fix dimension reading for the MPI version.
1 parent 216f87c commit e56494f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/ParaGridIO.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ bool ParaGridIO::doOnce()
7575

7676
ParaGridIO::~ParaGridIO() = default;
7777

78-
template <typename N> void ParaGridIO::readDimensions(const N& node)
78+
template <typename N> void ParaGridIO::readDimensions(const N& node, ModelMetadata& metadata)
7979
{
8080
for (auto entry : ModelArray::definedDimensions) {
8181
auto dimType = entry.first;
@@ -140,11 +140,11 @@ ModelState ParaGridIO::getModelState(const std::string& filePath, ModelMetadata&
140140
if (ncFile.getGroupCount()) {
141141
// Read in the legacy file format with groups
142142
netCDF::NcGroup dataGroup = ncFile.getGroup("data");
143-
readDimensions<netCDF::NcGroup>(dataGroup);
143+
readDimensions<netCDF::NcGroup>(dataGroup, metadata);
144144
vars = dataGroup.getVars();
145145
} else {
146146
// File format without groups
147-
readDimensions<netCDF::NcFile>(ncFile);
147+
readDimensions<netCDF::NcFile>(ncFile, metadata);
148148
vars = ncFile.getVars();
149149
}
150150

core/src/include/ParaGridIO.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ParaGridIO : public ParametricGrid::IParaGridIO {
116116

117117
//! A templated function to get the dimensions from a netCDF file, whether
118118
//! they are stored in the root or a group.
119-
template <typename N> void readDimensions(const N& node);
119+
template <typename N> void readDimensions(const N& node, ModelMetadata& metadata);
120120

121121
template <typename N>
122122
static ModelState readForcingTimeGeneric(

0 commit comments

Comments
 (0)