From 9aa6d9ff8169114240c506935bcdeec98562af0a Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Wed, 28 Oct 2026 18:20:33 -0300 Subject: [PATCH 1/2] refactor: clear the unused-variable and reorder warnings (#161) Removes variables that were computed and never read, and matches the constructor initializer order of RosLayer and BurningRatioLayer to the member declaration order. No behavior change. - CLibForeFire.cpp: drop two unused atmoSurf lookups - DataBroker.cpp: drop an FFArray that was allocated and leaked - FireDomain.cpp: drop an unused arrival-time lookup in isBurnt - FluxLayer.h: drop the leftover debug block (domID, sumAdded, diffN) - Command.cpp: drop the isoToSeconds lambda that emit never calls - FarsitePropagationModel.cpp: drop the unused rm declaration Left for a separate decision: listenMode in Command.cpp, and adjustementWind, slopespd, react and savx in the Farsite model. --- src/BurningRatioLayer.h | 2 +- src/CLibForeFire.cpp | 2 -- src/Command.cpp | 17 ----------------- src/DataBroker.cpp | 1 - src/FireDomain.cpp | 2 -- src/FluxLayer.h | 8 -------- src/RosLayer.h | 2 +- src/propagation/FarsitePropagationModel.cpp | 2 +- 8 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/BurningRatioLayer.h b/src/BurningRatioLayer.h index cab303ac..9e2807eb 100644 --- a/src/BurningRatioLayer.h +++ b/src/BurningRatioLayer.h @@ -47,7 +47,7 @@ template class BurningRatioLayer : public DataLayer { BurningRatioLayer() : DataLayer() {}; /*! \brief Constructor with all necessary information */ BurningRatioLayer(string name, FFPoint& atmoSWCorner, FFPoint& atmoNECorner, const size_t& nnx, const size_t& nny, FDCell** FDcells) - : DataLayer(name), SWCorner(atmoSWCorner), NECorner(atmoNECorner), nx(nnx), ny(nny), cells(FDcells) { + : DataLayer(name), nx(nnx), ny(nny), SWCorner(atmoSWCorner), NECorner(atmoNECorner), cells(FDcells) { size = nx*ny; ratioMap = new FFArray("BRatio", 0., nx, ny); latestCall = -1.; diff --git a/src/CLibForeFire.cpp b/src/CLibForeFire.cpp index da21e97b..82bfff6c 100644 --- a/src/CLibForeFire.cpp +++ b/src/CLibForeFire.cpp @@ -496,7 +496,6 @@ void FFGetDoubleArray(const char* mname, double t } if (tmpname == "injectedAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); - double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumInjected = SimulationParameters::GetInstance()->getDouble("sumInjected"); @@ -507,7 +506,6 @@ void FFGetDoubleArray(const char* mname, double t if (tmpname == "spotAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); - double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumSedimented = SimulationParameters::GetInstance()->getDouble("sumSedimented"); sumSedimented = sumSedimented + ((fullMatrix->sum()) * atmosphericTimeStep );; diff --git a/src/Command.cpp b/src/Command.cpp index 56352509..41799b1b 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -2235,23 +2235,6 @@ namespace libforefire return error; } - auto isoToSeconds = [&](const string &iso) -> double - { - if (iso == stringError) - return FLOATERROR; - SimulationParameters *simParam = SimulationParameters::GetInstance(); - int year = 0, yday = 0; - double secs = 0.; - if (!simParam->ISODateDecomposition(iso, secs, year, yday)) - { - return FLOATERROR; - } - return simParam->SecsBetween(simParam->getDouble("refTime"), - simParam->getInt("refYear"), - simParam->getInt("refDay"), - secs, year, yday); - }; - auto parsePointString = [&](const string &raw, bool lonlat) -> FFPoint { if (raw == stringError || raw.size() < 2) diff --git a/src/DataBroker.cpp b/src/DataBroker.cpp index 3c30fe8f..78943774 100644 --- a/src/DataBroker.cpp +++ b/src/DataBroker.cpp @@ -419,7 +419,6 @@ namespace libforefire void DataBroker::createEmptyTwoTimeArrayLayer(const string &name, FFPoint &Forigin, double addTime, const double dx, const double dy ) { - FFArray* xARR = new FFArray(name, 0., atmosphericNy, atmosphericNy); FFArray* xARRDT = new FFArray(name, 0., atmosphericNx+2, atmosphericNy+2); FFArray* xARRT = new FFArray("Old"+name, 0., atmosphericNx+2, atmosphericNy+2); TwoTimeArrayLayer *xLAY = new TwoTimeArrayLayer(name, diff --git a/src/FireDomain.cpp b/src/FireDomain.cpp index 6c4d1f77..cec7e974 100644 --- a/src/FireDomain.cpp +++ b/src/FireDomain.cpp @@ -1415,8 +1415,6 @@ // Checking whether a location is still burning bool FireDomain::isBurnt(FFPoint& loc, const double& t){ /* the location is considered to be burnt if at < t*/ - double at = getArrivalTime(loc); - return t>getArrivalTime(loc); diff --git a/src/FluxLayer.h b/src/FluxLayer.h index 5491b220..166e0133 100644 --- a/src/FluxLayer.h +++ b/src/FluxLayer.h @@ -349,7 +349,6 @@ void FluxLayer::addEmission(const FFPoint& center, double area, double startT template void FluxLayer::getMatrix(FFArray** matrix, const double& t){ - int domID = params->getInt("mpirank"); if ( t != latestCallGetMatrix ){ @@ -361,7 +360,6 @@ void FluxLayer::getMatrix(FFArray** matrix, const double& t){ pruneEmissions(t); - double sumAdded = 0.0; for ( size_t i = 0; i < nx; i++ ){ for ( size_t j = 0; j < ny; j++ ){ double base = cells[i][j].applyModelsOnBmap(fluxName, latestCallGetMatrix, t, modelCount); @@ -369,14 +367,8 @@ void FluxLayer::getMatrix(FFArray** matrix, const double& t){ double cy = SWCorner.getY() + ( (double)j + 0.5 ) * dy; double added = emissionContributionAt(cx, cy, t); (*flux)(i,j) = base + added; - sumAdded += (added+base); } } - if ((domID == 1 ) && (fluxName == "heatFlux" )){ - double diffN = t - latestCallGetMatrix ; - //cout<<"ID "<getKey() <<" has "< class RosLayer : public DataLayer { RosLayer() : DataLayer() {}; /*! \brief Constructor with all necessary information */ RosLayer(string name,FFPoint& atmoSWCorner, FFPoint& atmoNECorner, const size_t& nnx, const size_t& nny, FDCell** FDcells) - : DataLayer(name), SWCorner(atmoSWCorner), NECorner(atmoNECorner), nx(nnx), ny(nny), cells(FDcells) { + : DataLayer(name), nx(nnx), ny(nny), SWCorner(atmoSWCorner), NECorner(atmoNECorner), cells(FDcells) { size = nx*ny; rosMap = new FFArray("Ros", 0., nx, ny); latestCall = -1.; diff --git a/src/propagation/FarsitePropagationModel.cpp b/src/propagation/FarsitePropagationModel.cpp index 41640107..ac0c05a7 100644 --- a/src/propagation/FarsitePropagationModel.cpp +++ b/src/propagation/FarsitePropagationModel.cpp @@ -295,7 +295,7 @@ namespace libforefire {0.01, 0.00}, {0.01, 0.00}}; double fined = 0.0, finel = 0.0, wmfd = 0.0, fdmois = 0.0, w = 0.0, wo = 0.0, sum3 = 0.0; - double sum1 = 0.0, sum2 = 0.0, rm, sigma = 0.0, rhob; + double sum1 = 0.0, sum2 = 0.0, sigma = 0.0, rhob; double xir, rbqig = 0, xi = 0, wlim, rat, betaop, aa, gammax = 0.0, gamma = 0; double a[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; double f[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; From 2e06874541fa013e7cbc97a79cae218541f7a672 Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Wed, 28 Oct 2026 18:27:12 -0300 Subject: [PATCH 2/2] revert: keep atmoSurf and the Farsite rm for Filippi to decide (#161) atmoSurf is computed and never used in the coupling outputs injectedAtGround and spotAtGround: it may be a missing division, not dead code. Physics files stay as they are on dev. --- src/CLibForeFire.cpp | 2 ++ src/propagation/FarsitePropagationModel.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CLibForeFire.cpp b/src/CLibForeFire.cpp index 82bfff6c..da21e97b 100644 --- a/src/CLibForeFire.cpp +++ b/src/CLibForeFire.cpp @@ -496,6 +496,7 @@ void FFGetDoubleArray(const char* mname, double t } if (tmpname == "injectedAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); + double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumInjected = SimulationParameters::GetInstance()->getDouble("sumInjected"); @@ -506,6 +507,7 @@ void FFGetDoubleArray(const char* mname, double t if (tmpname == "spotAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); + double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumSedimented = SimulationParameters::GetInstance()->getDouble("sumSedimented"); sumSedimented = sumSedimented + ((fullMatrix->sum()) * atmosphericTimeStep );; diff --git a/src/propagation/FarsitePropagationModel.cpp b/src/propagation/FarsitePropagationModel.cpp index ac0c05a7..41640107 100644 --- a/src/propagation/FarsitePropagationModel.cpp +++ b/src/propagation/FarsitePropagationModel.cpp @@ -295,7 +295,7 @@ namespace libforefire {0.01, 0.00}, {0.01, 0.00}}; double fined = 0.0, finel = 0.0, wmfd = 0.0, fdmois = 0.0, w = 0.0, wo = 0.0, sum3 = 0.0; - double sum1 = 0.0, sum2 = 0.0, sigma = 0.0, rhob; + double sum1 = 0.0, sum2 = 0.0, rm, sigma = 0.0, rhob; double xir, rbqig = 0, xi = 0, wlim, rat, betaop, aa, gammax = 0.0, gamma = 0; double a[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; double f[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};