Skip to content

Commit

Permalink
Merge pull request cholla-hydro#373 from helenarichie/dev
Browse files Browse the repository at this point in the history
Patch to fix logic of floor warning messages
  • Loading branch information
evaneschneider authored Feb 8, 2024
2 parents ae75fe3 + 5dfef2a commit d2ac33b
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/global/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d2ac33b

Please sign in to comment.