Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions ext/ClimaSeaIceNCDatasetsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ default_sea_ice_attributes() = Dict(
"ℵ" => Dict("long_name" => "Sea ice concentration.", "units" => "-")
)

function __init__()
OCNE = Base.get_extension(Oceananigans, :OceananigansNCDatasetsExt)
if !isnothing(OCNE)
@eval begin
function $OCNE.default_output_attributes(model::SeaIceModel)
velocity_attrs = default_horizontal_velocity_attributes(model.grid)
tracer_attrs = default_sea_ice_attributes()
return merge(velocity_attrs, tracer_attrs)
end
end
OCNE = Base.get_extension(Oceananigans, :OceananigansNCDatasetsExt)
if !isnothing(OCNE)
function OCNE.default_output_attributes(model::SeaIceModel)
velocity_attrs = default_horizontal_velocity_attributes(model.grid)
tracer_attrs = default_sea_ice_attributes()
return merge(velocity_attrs, tracer_attrs)
Comment on lines +31 to +36
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work because the extension is not loaded at compile time. We need CliMA/Oceananigans.jl#5469 and then extend the function in output_writers

end
end

Expand Down
Loading