From c007a78460950d714539000af6bddb0a44371c90 Mon Sep 17 00:00:00 2001 From: ftomei Date: Mon, 19 Aug 2024 14:15:48 +0200 Subject: [PATCH] fix load snow state --- snow/snowMaps.cpp | 19 ++++++++++++++++++- snow/snowMaps.h | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/snow/snowMaps.cpp b/snow/snowMaps.cpp index f938fe7b9..050c1beab 100644 --- a/snow/snowMaps.cpp +++ b/snow/snowMaps.cpp @@ -105,7 +105,7 @@ void Crit3DSnowMaps::initializeSnowMaps(const gis::Crit3DRasterGrid &dtm, double } -void Crit3DSnowMaps::updateMap(Crit3DSnow &snowPoint, int row, int col) +void Crit3DSnowMaps::updateMapRowCol(Crit3DSnow &snowPoint, int row, int col) { _snowWaterEquivalentMap->value[row][col] = float(snowPoint.getSnowWaterEquivalent()); _iceContentMap->value[row][col] = float(snowPoint.getIceContent()); @@ -122,6 +122,23 @@ void Crit3DSnowMaps::updateMap(Crit3DSnow &snowPoint, int row, int col) } +void Crit3DSnowMaps::flagMapRowCol(int row, int col) +{ + _snowWaterEquivalentMap->value[row][col] = _snowWaterEquivalentMap->header->flag; + _iceContentMap->value[row][col] = _iceContentMap->header->flag; + _liquidWaterContentMap->value[row][col] = _liquidWaterContentMap->header->flag; + _internalEnergyMap->value[row][col] = _internalEnergyMap->header->flag; + _surfaceEnergyMap->value[row][col] = _surfaceEnergyMap->header->flag; + _snowSurfaceTempMap->value[row][col] = _snowSurfaceTempMap->header->flag; + _ageOfSnowMap->value[row][col] = _ageOfSnowMap->header->flag; + + _snowFallMap->value[row][col] = _snowFallMap->header->flag; + _snowMeltMap->value[row][col] = _snowMeltMap->header->flag; + _sensibleHeatMap->value[row][col] = _sensibleHeatMap->header->flag; + _latentHeatMap->value[row][col] = _latentHeatMap->header->flag; +} + + void Crit3DSnowMaps::updateRangeMaps() { gis::updateMinMaxRasterGrid(_snowWaterEquivalentMap); diff --git a/snow/snowMaps.h b/snow/snowMaps.h index 8696400d4..bcc5e729c 100644 --- a/snow/snowMaps.h +++ b/snow/snowMaps.h @@ -20,7 +20,9 @@ void initializeSnowMaps(const gis::Crit3DRasterGrid &dtm, double skinThickness); void resetSnowModel(double skinThickness); - void updateMap(Crit3DSnow &snowPoint, int row, int col); + void updateMapRowCol(Crit3DSnow &snowPoint, int row, int col); + void flagMapRowCol(int row, int col); + void setPoint(Crit3DSnow &snowPoint, int row, int col); void updateRangeMaps();