Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with PALEOboxes v0.22 / PALEOmodel v0.16 dimensions / coordinates updates #27

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

sjdaines
Copy link
Member

See PRs:
PALEOtoolkit/PALEOboxes.jl#151
PALEOtoolkit/PALEOmodel.jl#107

Example of change needed from ReactionSedimentGridn1D do_sediment_setup_grid:

# attach coordinates to grid for output visualisation etc
if isdefined(PB, :set_coordinates!) # PALEOboxes >= 0.22
    PB.set_coordinates!(rj.domain.grid, "cells", ["zmid", "zlower", "zupper"])
else
    empty!(rj.domain.grid.z_coords)
    push!(rj.domain.grid.z_coords, PB.FixedCoord("zmid", grid_vars.zmid, PB.get_variable(m, "zmid").attributes))
    push!(rj.domain.grid.z_coords, PB.FixedCoord("zlower", grid_vars.zlower, PB.get_variable(m, "zlower").attributes))
    push!(rj.domain.grid.z_coords, PB.FixedCoord("zupper", grid_vars.zupper, PB.get_variable(m, "zupper").attributes))
end

…s updates

See PRs:
    PALEOtoolkit/PALEOboxes.jl#151
    PALEOtoolkit/PALEOmodel.jl#107

Example of change needed from ReactionSedimentGridn1D do_sediment_setup_grid:

    # attach coordinates to grid for output visualisation etc
    if isdefined(PB, :set_coordinates!) # PALEOboxes >= 0.22
        PB.set_coordinates!(rj.domain.grid, "cells", ["zmid", "zlower", "zupper"])
    else
        empty!(rj.domain.grid.z_coords)
        push!(rj.domain.grid.z_coords, PB.FixedCoord("zmid", grid_vars.zmid, PB.get_variable(m, "zmid").attributes))
        push!(rj.domain.grid.z_coords, PB.FixedCoord("zlower", grid_vars.zlower, PB.get_variable(m, "zlower").attributes))
        push!(rj.domain.grid.z_coords, PB.FixedCoord("zupper", grid_vars.zupper, PB.get_variable(m, "zupper").attributes))
    end
@sjdaines sjdaines merged commit 15cb0a2 into main Dec 30, 2024
3 checks passed
@sjdaines sjdaines deleted the dims_coords_update branch December 30, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant