Skip to content

Commit

Permalink
Correct the dimension ordering, which was wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
timspainNERSC committed Sep 6, 2023
1 parent 1380991 commit c27af07
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/src/ParaGridIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ModelState ParaGridIO::getModelState(const std::string& filePath)
std::vector<netCDF::NcDim> varDims = var.getDims();
std::string dimKey = "";
for (netCDF::NcDim& dim : varDims) {
dimKey = dim.getName() + dimKey;
dimKey += dim.getName();
}
if (!dimensionKeys.count(dimKey)) {
throw std::out_of_range(
Expand Down Expand Up @@ -215,12 +215,6 @@ void ParaGridIO::dumpModelState(
dimMap.at(entry.second).push_back(ncFromMAMap.at(entry.first));
}

// Reverse the order of the dimensions to translate between column-major ModelArray and
// row-major netCDF
for (auto& [type, v] : dimMap) {
std::reverse(v.begin(), v.end());
}

std::set<std::string> restartFields = { hiceName, ciceName, hsnowName, ticeName, sstName,
sssName, maskName, coordsName }; // TODO and others
// Loop through either the above list (isRestart) or all provided fields(!isRestart)
Expand Down

0 comments on commit c27af07

Please sign in to comment.