Skip to content

Conversation

@ebbekyhl
Copy link

@ebbekyhl ebbekyhl commented Nov 1, 2023

Added the function from here that calculates the hub wind speed based on either 10-m wind speeds and roughness or based on an interpolation of wind speeds at two heights.

I also added the argument "model" to the "convert_wind" function which should be either "interpolation" or "extrapolation" such that both methods can be applied and compared.

Currently, this has been tested for the EC-Earth3, which leads to a slightly higher capacity factor with the model="interpolation" setting (see jupyter notebook).

@ebbekyhl ebbekyhl changed the title Cmip6 Wind speed interpolation Nov 1, 2023
@martavp
Copy link
Owner

martavp commented Nov 13, 2023

Thanks, @ebbekyhl I'll accept this. I cannot see the jupyter notebook with the test on EC-Earth 3, can you share it?

@martavp martavp merged commit 93271ec into martavp:cmip6 Nov 13, 2023
from_name = "wnd{h:0d}m".format(h=int(from_height))
from_name2 = "wnd{h:0d}m".format(h=int(from_height2)) # definition of second wind speed (for instance at 100m)

wnd_spd = ds[from_name] * (to_height / from_height)**((1 / np.log(from_height)) * np.log(ds[from_name2] / ds[from_name]))
Copy link
Owner

@martavp martavp Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the equation be:

wnd_spd = ds[from_name] * (to_height / from_height)**((np.log(ds[from_name2] / ds[from_name])/(np.log(from_height2) / np.log(from_height)) )

do you agree @ebbekyhl ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. The former formulation only works when "from_height2" = 100 m and "from_height" = 10 m.

I would agree with Oskar's formulation (OskarSidor@bc8c622#r132404361):

wnd_spd = ds[from_name] * (to_height / from_height)**
(
np.log(ds[from_name2] / ds[from_name]) 
/ 
np.log(from_height2 / from_height)
)

@ebbekyhl
Copy link
Author

@martavp You can find the comparison for EC-Earth-3 in the bottom of this jupyter notebook: https://github.com/martavp/atlite/blob/cmip6/sandbox_ebbe/download_cmip_cutout_and_process.ipynb

hailiangliu89 pushed a commit to hailiangliu89/atlite that referenced this pull request Feb 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants