Assigning stokes drift to model in GPU #3420
-
I tried to add stokes drift on the Non-Hydrostatic model in GPU this way:
This Error is Showing up: Stacktrace: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 PS some tips on formatting the question --- use "```julia" to format your code as julia syntax. Secondly, try using triple ticks around the error, which will make it easier to read. Edit: I just noticed that the docstring for |
Beta Was this translation helpful? Give feedback.
Try this:
The
const
declarations, which inform the compiler that the type and value of those objects will not change, are necessary fors…