Commit 76e3fec2 authored by Purves, Murray's avatar Purves, Murray
Browse files

Fixing wind speed conversion

parent 48e123ea
Pipeline #16763 failed with stages
in 8 minutes and 36 seconds
......@@ -525,11 +525,11 @@ int main(int argc, char **argv)
// Write wind data
// Need to calculate wind u and v components from direction/speed
float thisWindU =
(float)(toRadians(cos(90.0 - (inputWDirs[level] - 180.0))) *
inputWSpds[level] * 0.51444444444);
(inputWSpds[level] * 0.5144444444) *
sin(toRadians(fmod((inputWDirs[level] + 180.0), 360.0)));
float thisWindV =
(float)(toRadians(sin(90.0 - (inputWDirs[level] - 180.0))) *
inputWSpds[level] * 0.51444444444);
(inputWSpds[level] * 0.5144444444) *
cos(toRadians(fmod((inputWDirs[level] + 180.0), 360.0)));
std::cout << " Initial wspd = " << inputWSpds[level]
<< " knots, wdir: " << inputWDirs[level] << " degrees"
<< std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment