Repository navigation
feat(gpu): the weather's air pressure and inverse barometer on the device (P2.7 Phase 4.5i) - #283
Open
EmilLindfors wants to merge 1 commit into
Open
EmilLindfors wants to merge 1 commit into
EmilLindfors wants to merge 1 commit into
Conversation
…vice (P2.7 Phase 4.5i)
A 3D case with weather stopped on the device before its first step: its
2D module carries the weather's air pressure (GriddedAtmosphere2D's
pressure gradient on the depth mean), and the case runner raises the
open boundaries by the inverse barometer. Neither had a device form.
- dgcom (the CPU's bits unchanged): `DeviceSource2D::Atmosphere`;
`GriddedAtmosphere2D::{regridded, moment, switches, constants,
has_level, is}`; the pointwise `add_snapshot`, `atmosphere_source`,
`inverse_barometer_level`, which the CPU calls too;
`BoundaryLevel::device_form` (`DeviceLevel`),
`ExternalStateProvider::device_raise`, `InverseBarometer`'s device form
(its provider's, raised), `DeviceBoundary2D::Characteristic { raise }`;
`DragCoefficient::{device_code, from_device_code}`.
- gpu: the regridded snapshots in four device slots (`Weather`), a
level's moment with their slots and weights; `atmosphere_forcing` after
the element kernels in the CPU's order of the sources (`Post`); the
boundary kernel raises an open boundary's external level by the
inverse barometer at the face node. Refused by name: the wind stress on
a 2D run's depth mean (the CPU's speed is the platform's hypot), two
weather models.
Gates: `dgcom-gpu weather` (new, in `all`): a low crossing `nest`'s
channel, a tide raised by the full inverse barometer and the parent
raised by a quarter with its band, global steps and 3 levels: bit for
bit, 4 mutants caught. Frøya in 3D with MET Nordic's wind and heat
budget through the case runner, CPU against the RTX 4060, 2 h (and with
`boundary.0.inverse_barometer=0.25`): stations, snapshot and volume bit
for bit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P2.7 Phase 4.5i (
notes/gpu.md). Stacked on #282 (4.5h): merge that first, then retarget this tomain.A 3D case with weather now runs on the GPU. Before, it stopped on the device before its first step, for two reasons:
GriddedAtmosphere2D::split_for_3d: the pressure gradient on the depth mean; the wind goes to the columns);InverseBarometer).Neither had a device form. This was TODO P2.7's "the weather's device form", which 2D runs lacked too.
dgcom (the CPU's bits unchanged: the same arithmetic, moved into functions both sides call)
DeviceSource2D::Atmosphere(GriddedAtmosphere2D::device_form). New for a device:regridded(t): a snapshot on the mesh nodes; the CPU's cache, was private;moment(t): the time stencil and the ramp;switches,constants(AtmosphereConstants),has_level,is.add_snapshot,atmosphere_source((τ − h∇p)/ρ) andinverse_barometer_level.BoundaryLevel::device_formreturnsDeviceLevel::Atmosphere.ExternalStateProvider::device_raiseis new.InverseBarometer's device form is its provider's, raised by its level times its factor. It has none if the provider is raised already or the level has no form.DeviceBoundary2D::Characteristiccarries the raise.DragCoefficient::{device_code, from_device_code}.the_inverse_barometer_raises_its_providers_device_form.The device (
gpu/src/swe2d.rs)Weatherkeeps them regridded in four device slots, as the CPU caches four.atmosphere_forcingis a kernel after the element kernels, where the CPU's list of sources puts it.Postruns the relaxation bands and the weather in the list's order (the case runner's is Coriolis, the bands, the weather). It calls dgcom'sadd_snapshotandatmosphere_source.ηby the factor times the level at the face node (dgcom'sinverse_barometer_level). It works on any external form: uniform, tides or parent.hypoton the CPU, andmath::hypotwould change the CPU's bits of every weather run. That is your call, parked in the notes.Gates
dgcom-gpu weather(new, also inall; no NetCDF needed).nest's channel under a made-up 15 hPa low crossing it, 6 h, global steps and 3 levels: bit for bit, every node.nest's parent raised by a quarter of it, the band, then the pressure.--no-fmad). The case iscases/froya/rivers_3d.toml(the NorKyst parent, nine rivers) with--set 'atmosphere.files=["../../data/froya_met_heat.nc"]'(MET Nordic's wind and heat budget; COARE 3.5 into Jerlov III), 2 h. Bit for bit:boundary.0.inverse_barometer=0.25, the end volume another (the level acts).🤖 Generated with Claude Code