Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does wind speed correction factor depend on unorm or resid? #4

Open
jedokaplan opened this issue May 19, 2020 · 1 comment
Open

Does wind speed correction factor depend on unorm or resid? #4

jedokaplan opened this issue May 19, 2020 · 1 comment

Comments

@jedokaplan
Copy link
Contributor

According to Sommer and Kaplan (2017), eqns 21-23 and text on page 3784 the wind speed correction factor depends on the uniform random number used for windspeed. In the code, however, instead of using unorm(4), resid(4) is used.

gwgen_f90/weathergenmod.f90

Lines 555 to 572 in 9b11a3f

! ---- wind bias correction
if (wind_slope_bias_L > 0.0) then
slopecorr = wind_slope_bias_L / ( 1 + exp( - wind_slope_bias_k * ( &
resid(4) - wind_slope_bias_x0)))
else
slopecorr = sum(wind_bias_coeffs(:) * ( &
max(wind_bias_min, min(wind_bias_max, resid(4))) ** (/ 0, 1, 2, 3, 4, 5 /)))
end if
if (abs(wind_intercept_bias_a + 9999.) > 1e-7) then
intercept_corr = exp(wind_intercept_bias_b + &
wind_intercept_bias_a * max(wind_bias_min, min(wind_bias_max, resid(4))))
else
intercept_corr = sum(wind_intercept_bias_coeffs(:) * ( &
max(wind_bias_min, min(wind_bias_max, resid(4))) ** (/ 0, 1, 2, 3, 4, 5 /)))
end if
wind = (wind - intercept_corr) / max(slopecorr, 9e-4)

Which one of these is correct? Using resid(4) seems to generate unrealistically high values for corrected windspeed.

@Chilipp
Copy link
Member

Chilipp commented May 24, 2020

Yes, you are definitely right!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants