-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I am running an Oceananigans.jl model, stepping it forward in a compiled loop. I want to update its boundary condition with some random noise each tilmestep, like this:
#
# Loop through our ocean model:
#
function my_loop!(model, u_wind_stress, random_field)
Δt = model.clock.last_Δt
@trace mincut = true track_numbers = false for i = 1:64
# Get some new randomness:
randn!(random_field)
# Add our wind stress to the randomness:
random_field .+= u_wind_stress
# Modify the top BC so it's wind stress + new randomness:
set!(model.velocities.u.boundary_conditions.top.condition, random_field)
# Step the model forward:
time_step!(model, Δt)
end
return nothing
end
Set up in this way so that the original boundary condition (u_wind_stress) is preserved. This produces the following error:
Maybe this is the wrong way to incorporate randomness into Reactant loops. Is there an alternative to randn! or a way to use it in this context?
Metadata
Metadata
Assignees
Labels
No labels