Skip to content

Commit

Permalink
Enforce the wind direction criteria of interval [0,360) instead of er…
Browse files Browse the repository at this point in the history
…roring out
  • Loading branch information
Chrismarsh committed Jun 4, 2024
1 parent d95f640 commit af612e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/interp_met/WindNinja.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ void WindNinja::run(mesh& domain)

if ((*s)["vw_dir"_s] >= 360.0)
{
CHM_THROW_EXCEPTION(module_error, "Wind direction >=360, must be on interval [0,360)");
// enforce the criteria that direction must be on interval [0,360)
(*s)["vw_dir"_s] = (*s)["vw_dir"_s] - 360.0;
}

double theta = (*s)["vw_dir"_s] * M_PI / 180.;
Expand Down

0 comments on commit af612e8

Please sign in to comment.