From b95e89cd9479e8571168c78cd97ef1fe47eaeec5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 18 Dec 2024 11:33:45 +0100 Subject: [PATCH] Ensure depths are sorted by lowest to highest groundTemperatureDepth --- src/utilities/filetypes/EpwFile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utilities/filetypes/EpwFile.cpp b/src/utilities/filetypes/EpwFile.cpp index 777c26d92b..2efc50e6f4 100644 --- a/src/utilities/filetypes/EpwFile.cpp +++ b/src/utilities/filetypes/EpwFile.cpp @@ -4702,6 +4702,9 @@ bool EpwFile::parseGroundTemperatures(const std::string& line) { return false; } } + // Ensure sorted by lower to higher depths + std::sort(m_depths.begin(), m_depths.end(), + [](const auto& lhs, const auto& rhs) { return lhs.groundTemperatureDepth() < rhs.groundTemperatureDepth(); }); return true; }