Skip to content

Fill the ERA5 level pressure through set! - #807

Open
dkytezab wants to merge 2 commits into
mainfrom
dkz/reactant-pressure-level-field
Open

dkytezab wants to merge 2 commits into
mainfrom
dkz/reactant-pressure-level-field

Conversation

@dkytezab

Copy link
Copy Markdown
Collaborator

Closes #805. Draft.

pressure_level_field builds the level column on the host and fills the field with one set!, instead of broadcasting a reshape of the device levels into interior(pressure), which on ReactantState falls back to element-wise indexing of device memory. On a GPU it is the same single copy as the on_architecture it replaces. The architecture argument is now unused; I kept the signature.

Test: test/reactant/test_reactant.jl, the levels in every column on CPU() and ReactantState(). Not yet run locally.

🤖 Generated with Claude Code

Broadcasting a reshape of the device levels into `interior(pressure)` indexes device memory element by
element on ReactantState, which Reactant refuses. The column is built on the host and moved with one
`set!`, a single copy on every architecture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dkytezab
dkytezab requested review from glwagner and xkykai and removed request for glwagner October 23, 2026 20:45
@dkytezab
dkytezab marked this pull request as ready for review October 23, 2026 20:45
@@ -139,10 +138,9 @@ end
# Pressure on a `PressureLevelGrid` is the level coordinate (Pa), constant in space and time
function pressure_level_field(grid, dataset, architecture)

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.

is this function signature used anywhere else? if not should be ok to remove the architecture arg

This branch has not been deployed

No deployments
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.

pressure_level_field fails on ReactantState: broadcast into interior of a device field

3 participants