snowpack-model / snowpack

SNOWPACK model
GNU Lesser General Public License v3.0
10 stars 5 forks source link

Wind direction is calculated inconsistently #9

Closed EricKeenan closed 4 years ago

EricKeenan commented 4 years ago

We should write a consistent wind direction function, instead of writing it in several places. Here is a start

// Calculate wind direction from u and v components of wind.
// Wind direction is calculated in degrees in the meteorological sense. For example, a wind coming from the north has a wind direction of zero degrees. 
// u and v components denote the horizontal and vertical components respectively and indicate the direction the wind is going. I.e. a wind coming from the north would have u = 0 and v < 0.
wind_direction = fmod( atan2(u, v) * Cst::to_deg + 180., 360.);
nwever commented 4 years ago

Should be mostly fixed with commit d18b044. Only need to check the Winstral algorithm.

nwever commented 4 years ago

Winstral algorithm seems to be correct too, so closing this issue.