Skip to content

Commit

Permalink
A nice warning and better show for ECCORestoring (#267)
Browse files Browse the repository at this point in the history
* one change

* new changes

* close file

* Inf inpainting in the inpaint mask

* correct stuff

* last bugfix

* revert back

* revert back

* revert back

* remove circular dependency of mask and field

* bugfix

* last bugfix in mask

* another bugfix

* fix mask

* Better show and warnings

---------

Co-authored-by: Simone Silvestri <[email protected]>
Co-authored-by: Navid C. Constantinou <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent b18d9bd commit 8057d1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DataWrangling/ECCO/ECCO_restoring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ end
ECCORestoring(variable_name::Symbol; kw...) = ECCORestoring(CPU(), variable_name; kw...)
ECCORestoring(metadata::ECCOMetadata; kw...) = ECCORestoring(CPU(), metadata; kw...)

Base.show(io::IO, p::ECCORestoring) =
print(io, "Three-dimensional restoring to ECCO data:", '\n',
function Base.show(io::IO, p::ECCORestoring)
print(io, "ECCORestoring:", '\n',
"├── restored variable: ", summary(p.variable_name), '\n',
"├── restoring dataset: ", summary(p.field_time_series.backend.metadata), '\n',
"├── restoring rate: ", p.rate, '\n',
"├── mask: ", summary(p.mask), '\n',
"└── grid: ", summary(p.grid))
end

regularize_forcing(forcing::ECCORestoring, field, field_name, model_field_names) = forcing
10 changes: 10 additions & 0 deletions src/OceanSimulations/OceanSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ function ocean_simulation(grid;
u_immersed_bc = nothing
v_immersed_bc = nothing
else
if !(grid isa ImmersedBoundaryGrid)
msg = """Are you totally, 100% sure that you want to build a simulation on
$(summary(grid))
rather than on an ImmersedBoundaryGrid?
"""
@warn msg
end

bottom_drag_coefficient = default_or_override(bottom_drag_coefficient)

u_immersed_drag = FluxBoundaryCondition(u_immersed_bottom_drag, discrete_form=true, parameters=bottom_drag_coefficient)
Expand Down

0 comments on commit 8057d1a

Please sign in to comment.