From 6d976ab579313d9017c5d70963dc90a84d0c18bd Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Tue, 3 Nov 2026 12:24:42 -0300 Subject: [PATCH 1/2] refactor: mark unused physics variables [[maybe_unused]] (#161) --- src/CLibForeFire.cpp | 4 ++-- src/flux/CraterHeatFluxModel.cpp | 2 +- src/flux/CraterVaporFluxModel.cpp | 4 ++-- src/flux/FactorChemFluxModel.cpp | 4 ++-- src/flux/HeatFluxBasicModel.cpp | 2 +- src/flux/LavaSO2FluxModel.cpp | 4 ++-- src/flux/VaporFluxBasicModel.cpp | 2 +- src/propagation/FarsitePropagationModel.cpp | 10 +++++----- src/propagation/IsotropicIsospeed.cpp | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/CLibForeFire.cpp b/src/CLibForeFire.cpp index 7af75189..0c8f6bde 100644 --- a/src/CLibForeFire.cpp +++ b/src/CLibForeFire.cpp @@ -496,7 +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"); + [[maybe_unused]] double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumInjected = SimulationParameters::GetInstance()->getDouble("sumInjected"); @@ -507,7 +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"); + [[maybe_unused]] 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/flux/CraterHeatFluxModel.cpp b/src/flux/CraterHeatFluxModel.cpp index 38b0c89d..a0f42e92 100644 --- a/src/flux/CraterHeatFluxModel.cpp +++ b/src/flux/CraterHeatFluxModel.cpp @@ -124,7 +124,7 @@ string CraterHeatFluxModel::getName(){ /* ****************** */ double CraterHeatFluxModel::getValue(double* valueOf - , const double& bt, const double& et, const double& at){ + , const double& bt, [[maybe_unused]] const double& et, [[maybe_unused]] const double& at){ if ( bt - eruptionTime < 0 ) return 0.; diff --git a/src/flux/CraterVaporFluxModel.cpp b/src/flux/CraterVaporFluxModel.cpp index eab3d529..5032e598 100644 --- a/src/flux/CraterVaporFluxModel.cpp +++ b/src/flux/CraterVaporFluxModel.cpp @@ -104,8 +104,8 @@ string CraterVaporFluxModel::getName(){ /* Model for the flux */ /* ****************** */ -double CraterVaporFluxModel::getValue(double* valueOf - , const double& bt, const double& et, const double& at){ +double CraterVaporFluxModel::getValue([[maybe_unused]] double* valueOf + , const double& bt, [[maybe_unused]] const double& et, [[maybe_unused]] const double& at){ if ( bt - eruptionTime < 0 ) return 0.; diff --git a/src/flux/FactorChemFluxModel.cpp b/src/flux/FactorChemFluxModel.cpp index 97663e49..85216a52 100644 --- a/src/flux/FactorChemFluxModel.cpp +++ b/src/flux/FactorChemFluxModel.cpp @@ -111,8 +111,8 @@ string FactorChemFluxModel::getName(){ /* Model for the flux */ /* ****************** */ -double FactorChemFluxModel::getValue(double* valueOf - , const double& bt, const double& et, const double& at){ +double FactorChemFluxModel::getValue([[maybe_unused]] double* valueOf + , const double& bt, [[maybe_unused]] const double& et, [[maybe_unused]] const double& at){ if ( bt - eruptionTime < 0 ) return 0.; /* getting the hours since eruption */ diff --git a/src/flux/HeatFluxBasicModel.cpp b/src/flux/HeatFluxBasicModel.cpp index 5cdcf766..d79cdb8c 100644 --- a/src/flux/HeatFluxBasicModel.cpp +++ b/src/flux/HeatFluxBasicModel.cpp @@ -90,7 +90,7 @@ string HeatFluxBasicModel::getName(){ /* *** *************** */ #include -double HeatFluxBasicModel::getValue(double* valueOf +double HeatFluxBasicModel::getValue([[maybe_unused]] double* valueOf , const double& bt, const double& et, const double& at){ /* Mean heat flux released between the time interval [bt, et] */ /* The heat flux is supposed to be constant from the arrival time (at) diff --git a/src/flux/LavaSO2FluxModel.cpp b/src/flux/LavaSO2FluxModel.cpp index 26bc324f..6e1893c2 100644 --- a/src/flux/LavaSO2FluxModel.cpp +++ b/src/flux/LavaSO2FluxModel.cpp @@ -109,8 +109,8 @@ string LavaSO2FluxModel::getName(){ /* Model for the flux */ /* ****************** */ -double LavaSO2FluxModel::getValue(double* valueOf - , const double& bt, const double& et, const double& at){ +double LavaSO2FluxModel::getValue([[maybe_unused]] double* valueOf + , const double& bt, [[maybe_unused]] const double& et, [[maybe_unused]] const double& at){ if ( bt - eruptionTime < 0 ) return 0.; /* getting the hours since eruption */ diff --git a/src/flux/VaporFluxBasicModel.cpp b/src/flux/VaporFluxBasicModel.cpp index dbe24245..ea28a074 100644 --- a/src/flux/VaporFluxBasicModel.cpp +++ b/src/flux/VaporFluxBasicModel.cpp @@ -88,7 +88,7 @@ string VaporFluxBasicModel::getName(){ /* Model for the flux */ /* ****************** */ -double VaporFluxBasicModel::getValue(double* valueOf +double VaporFluxBasicModel::getValue([[maybe_unused]] double* valueOf , const double& bt, const double& et, const double& at){ /* Mean heat flux released between the time interval [bt, et] */ /* The heat flux is supposed to be constant from the arrival time (at) diff --git a/src/propagation/FarsitePropagationModel.cpp b/src/propagation/FarsitePropagationModel.cpp index cb3b0c24..1fc23f83 100644 --- a/src/propagation/FarsitePropagationModel.cpp +++ b/src/propagation/FarsitePropagationModel.cpp @@ -115,7 +115,7 @@ namespace libforefire /* registering the model in the data broker */ dataBroker->registerPropagationModel(this); - double adjustementWind = 1.0; + [[maybe_unused]] double adjustementWind = 1.0; if (params->isValued("Farsite.adjustementWind")) adjustementWind = params->getDouble("Farsite.adjustementWind"); @@ -219,9 +219,9 @@ namespace libforefire }; double rateo = 0.0; - double slopespd = 0.0; - double react = 0.0; - double savx = 0.0; + [[maybe_unused]] double slopespd = 0.0; + [[maybe_unused]] double react = 0.0; + [[maybe_unused]] double savx = 0.0; long ndead = 0, nlive = 0; @@ -302,7 +302,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}}; diff --git a/src/propagation/IsotropicIsospeed.cpp b/src/propagation/IsotropicIsospeed.cpp index 12a796bd..a125299f 100644 --- a/src/propagation/IsotropicIsospeed.cpp +++ b/src/propagation/IsotropicIsospeed.cpp @@ -84,7 +84,7 @@ string IsotropicIsospeed::getName(){ /* Model for the propagation velovity of the front */ /* *********************************************** */ -double IsotropicIsospeed::getSpeed(double* valueOf){ +double IsotropicIsospeed::getSpeed([[maybe_unused]] double* valueOf){ return speed; } From 27b42fa242dd6d633ea81c4c18849cfc99bdf7fd Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Tue, 3 Nov 2026 12:48:00 -0300 Subject: [PATCH 2/2] refactor: keep warnings on adjustementWind and atmoSurf, they look like real bugs --- src/CLibForeFire.cpp | 4 ++-- src/propagation/FarsitePropagationModel.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CLibForeFire.cpp b/src/CLibForeFire.cpp index 0c8f6bde..7af75189 100644 --- a/src/CLibForeFire.cpp +++ b/src/CLibForeFire.cpp @@ -496,7 +496,7 @@ void FFGetDoubleArray(const char* mname, double t } if (tmpname == "injectedAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); - [[maybe_unused]] double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); + double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); double sumInjected = SimulationParameters::GetInstance()->getDouble("sumInjected"); @@ -507,7 +507,7 @@ void FFGetDoubleArray(const char* mname, double t if (tmpname == "spotAtGround"){ double atmosphericTimeStep = SimulationParameters::GetInstance()->getDouble("atmosphericTimeStep"); - [[maybe_unused]] double atmoSurf = SimulationParameters::GetInstance()->getDouble("atmosphericCellLength") * SimulationParameters::GetInstance()->getDouble("atmosphericCellWidth"); + 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 1fc23f83..144e7afc 100644 --- a/src/propagation/FarsitePropagationModel.cpp +++ b/src/propagation/FarsitePropagationModel.cpp @@ -115,7 +115,7 @@ namespace libforefire /* registering the model in the data broker */ dataBroker->registerPropagationModel(this); - [[maybe_unused]] double adjustementWind = 1.0; + double adjustementWind = 1.0; if (params->isValued("Farsite.adjustementWind")) adjustementWind = params->getDouble("Farsite.adjustementWind");