Skip to content

Commit

Permalink
some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri committed Nov 21, 2023
1 parent c3d145b commit 0a04d6a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/freely_decaying_mediterranean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ heatmap!(ax, interior(model.tracers.T, :, :, Nz), colorrange = (10, 20), colorma
ax = Axis(fig[1, 2])
heatmap!(ax, interior(model.tracers.S, :, :, Nz), colorrange = (35, 40), colormap = :haline)

simulation = Simulation(model, Δt = 20, stop_iteration = 100)
simulation = Simulation(model, Δt = 20, stop_iteration = 100, stop_time = 10*365days)

function progress(sim)
u, v, w = sim.model.velocities
Expand All @@ -83,7 +83,7 @@ simulation.callbacks[:progress] = Callback(progress, IterationInterval(10))
# warm up for 100 iterations!
run!(simulation)

simulation.stop_time = 10*365days
simulation.stop_iteration = Inf

wizard = TimeStepWizard(; cfl = 0.2, max_Δt = 10minutes, max_change = 1.1)

Expand Down
3 changes: 2 additions & 1 deletion src/Bathymetry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ function interpolate_bathymetry_in_passes(native_h, target_grid; passes = 10)
new_size = (Nλ[pass], Nφ[pass], 1)

@debug "pass number $pass with size $new_size"
new_grid = LatitudeLongitudeGrid(size = new_size,
new_grid = LatitudeLongitudeGrid(architecture(target_grid),
size = new_size,
latitude = (latitude[1], latitude[2]),
longitude = (longitude[1], longitude[2]),
z = (0, 1),
Expand Down
13 changes: 13 additions & 0 deletions src/DataWrangling/ECCO2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ function adjusted_ecco_field(variable_name;
return f
end

"""
initialize!(model;
overwrite_existing = false,
filename = "./data/adjusted_ecco_tracers.nc",
kwargs...)
Initialize `model`. The keyword arguments `kwargs...` take the form `name=data`,
where `name` refers to one of the fields of `model.velocities` or `model.tracers`,
and the `data` may be
(1) an array
(2) a function with arguments `(x, y, z)` for 3D fields, `(x, y)` for 2D fields and `(x)` for 1D fields
(3) a symbol corresponding to a fldname of `ecco2_tracer_fields`
"""
function initialize!(model;
overwrite_existing = false,
filename = "./data/adjusted_ecco_tracers.nc",
Expand Down

0 comments on commit 0a04d6a

Please sign in to comment.