From 5b5a12b6882b75589e337724af30ddb8ac67bdef Mon Sep 17 00:00:00 2001 From: helenarichie Date: Wed, 7 Feb 2024 22:15:34 -0500 Subject: [PATCH 1/2] patch to fix logic of default floor value warnings --- src/global/global.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/global/global.cpp b/src/global/global.cpp index 64eac0d5b..b2905d230 100644 --- a/src/global/global.cpp +++ b/src/global/global.cpp @@ -185,6 +185,27 @@ void Parse_Params(char *param_file, struct Parameters *parms, int argc, char **a Parse_Param(name, value, parms); chprintf("Override with %s=%s\n", name, value); } + #ifdef TEMPERATURE_FLOOR + if (parms->temperature_floor == 0) { + chprintf( + "WARNING: temperature floor is set to its default value (zero)! It can be set to a different value in the " + "input parameter file.\n"); + } + #endif + #ifdef DENSITY_FLOOR + if (parms->density_floor == 0) { + chprintf( + "WARNING: density floor is set to its default value (zero)! It can be set to a different value in the input " + "parameter file.\n"); + } + #endif + #ifdef SCALAR_FLOOR + if (parms->scalar_floor == 0) { + chprintf( + "WARNING: scalar floor is set to its default value (zero)! It can be set to a different value in the input " + "parameter file.\n"); + } + #endif } /*! \fn void Parse_Param(char *name,char *value, struct Parameters *parms); @@ -443,29 +464,14 @@ void Parse_Param(char *name, char *value, struct Parameters *parms) #ifdef TEMPERATURE_FLOOR } else if (strcmp(name, "temperature_floor") == 0) { parms->temperature_floor = atof(value); - if (parms->temperature_floor == 0) { - chprintf( - "WARNING: temperature floor is set to its default value (zero)! It can be set to a different value in the " - "input parameter file.\n"); - } #endif #ifdef DENSITY_FLOOR } else if (strcmp(name, "density_floor") == 0) { parms->density_floor = atof(value); - if (parms->density_floor == 0) { - chprintf( - "WARNING: density floor is set to its default value (zero)! It can be set to a different value in the input " - "parameter file.\n"); - } #endif #ifdef SCALAR_FLOOR } else if (strcmp(name, "scalar_floor") == 0) { parms->scalar_floor = atof(value); - if (parms->scalar_floor == 0) { - chprintf( - "WARNING: scalar floor is set to its default value (zero)! It can be set to a different value in the input " - "parameter file.\n"); - } #endif #ifdef ANALYSIS } else if (strcmp(name, "analysis_scale_outputs_file") == 0) { From 5dfef2a1ecccb4a28cc00032574c01e0693ceec7 Mon Sep 17 00:00:00 2001 From: helenarichie Date: Wed, 7 Feb 2024 22:16:42 -0500 Subject: [PATCH 2/2] run clang format --- src/global/global.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/global/global.cpp b/src/global/global.cpp index b2905d230..8db60ec62 100644 --- a/src/global/global.cpp +++ b/src/global/global.cpp @@ -185,27 +185,27 @@ void Parse_Params(char *param_file, struct Parameters *parms, int argc, char **a Parse_Param(name, value, parms); chprintf("Override with %s=%s\n", name, value); } - #ifdef TEMPERATURE_FLOOR +#ifdef TEMPERATURE_FLOOR if (parms->temperature_floor == 0) { chprintf( "WARNING: temperature floor is set to its default value (zero)! It can be set to a different value in the " "input parameter file.\n"); } - #endif - #ifdef DENSITY_FLOOR +#endif +#ifdef DENSITY_FLOOR if (parms->density_floor == 0) { chprintf( "WARNING: density floor is set to its default value (zero)! It can be set to a different value in the input " "parameter file.\n"); } - #endif - #ifdef SCALAR_FLOOR +#endif +#ifdef SCALAR_FLOOR if (parms->scalar_floor == 0) { chprintf( "WARNING: scalar floor is set to its default value (zero)! It can be set to a different value in the input " "parameter file.\n"); } - #endif +#endif } /*! \fn void Parse_Param(char *name,char *value, struct Parameters *parms);