Skip to content

Assigning stokes drift to model in GPU #3420

Discussion options

You must be logged in to vote

Try this:

amplitude = 0.8  # m
wavelength = 60   # m

wavenumber = 2π / wavelength  # m⁻¹
frequency = sqrt(g_Earth * wavenumber)  # s⁻¹
const e_folding_depth = 1 / (2 * wavenumber)  # m

const u_stokes = amplitude^2 * wavenumber * frequency  # m s⁻¹ Stokes drift velocity at the surface
@inline stokes_profile(z) = u_stokes * exp(z / e_folding_depth)
@inline stokes_derivative(z, t) = 1 / e_folding_depth * u_stokes * exp(z / e_folding_depth) # Stokes drift `z`-derivative 

model = NonhydrostaticModel(; grid, stokes_drift = UniformStokesDrift(∂z_uˢ=stokes_derivative))

The const declarations, which inform the compiler that the type and value of those objects will not change, are necessary for s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Swarnali-D
Comment options

Answer selected by glwagner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants