GLEON / rLakeAnalyzer

An R version of Lake Analyzer
43 stars 26 forks source link

uStar calculation #120

Open bkelley9 opened 7 months ago

bkelley9 commented 7 months ago

I believe the code for checking if the wind height is above 10m should be if (wndHeight <= 10), not if (wndHeight != 10). In its current state it only checks if it is exactly equal to 10m.

Also, if a correction is being made to the wind speed if the above is true, shouldn't Cd be calculated after this correction, as it's value is dependent on wind speed being less than 5 m/s?

jzwart commented 7 months ago

Hey @bkelley9 , thanks for the comment. I think the code is correct but the comment here: https://github.com/GLEON/rLakeAnalyzer/blob/e74974f74082111065bd9cd759527f16608b3c82/R/uStar.R#L51 should be changed to correct for wind measurement if height does not equal 10 m (Amorocho and DeVries, 1980) . rLakeAnalyzer is based on MatLab version Lake-Analyzer, which has the same code implementation and correct comment - see here.

Good question about when to calculate Cd. The Cd calculation is based off of Hicks 1972 which says there isn't much of a dependence for wind speed height on the drag coefficient Cd. So I don't think it matters much that Cd is calculated prior to wind correction. @hdugan @riwoolway @jordansread might want to weigh in too