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

Solved zero wind velocity in Duran grainspeed #203

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions aeolis/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,16 @@ def duran_grainspeed(s, p):
dhn = np.repeat(dzn[:,:,np.newaxis], nf, axis = 2)

# Compute ets/etn (wind direction)
ets = np.ones(ustar.shape)
etn = np.zeros(ustar.shape)

# First, if uw is not zero, compute ets/etn based on uw
ix = (uw > 0.)
ets[ix] = uws[ix] / uw[ix] # s-component of ustar
etn[ix] = uwn[ix] / uw[ix] # n-component of ustar

# Second, if ustar is not zero, compute ets/etn based on ustar
ix = (ustar > 0.)
ets = uws / uw # s-component of wind (where ustar == 0)
etn = uwn / uw # n-component of wind (where ustar == 0)
ets[ix] = ustars[ix] / ustar[ix] # s-component of ustar
etn[ix] = ustarn[ix] / ustar[ix] # n-component of ustar

Expand Down
Loading