From c27af079c50f8f1cd3c12d1d03e3c37c3bc154d8 Mon Sep 17 00:00:00 2001 From: Tim Spain Date: Wed, 6 Sep 2023 09:09:07 +0200 Subject: [PATCH] Correct the dimension ordering, which was wrong. --- core/src/ParaGridIO.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/src/ParaGridIO.cpp b/core/src/ParaGridIO.cpp index 3260abff1..ebc1bd8b2 100644 --- a/core/src/ParaGridIO.cpp +++ b/core/src/ParaGridIO.cpp @@ -102,7 +102,7 @@ ModelState ParaGridIO::getModelState(const std::string& filePath) std::vector 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( @@ -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 restartFields = { hiceName, ciceName, hsnowName, ticeName, sstName, sssName, maskName, coordsName }; // TODO and others // Loop through either the above list (isRestart) or all provided fields(!isRestart)