Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9715db3
Corrected problems in write_fields, added code for full_muphys
fomics Sep 11, 2025
062e2da
try cse fix for compile-time in saturation adjustment 'loop'
havogt Sep 11, 2025
d3bf31b
merged Fix from Hannes
fomics Sep 15, 2025
a4a90ce
Merge remote-tracking branch 'origin/muphys_bug_fix'
fomics Sep 15, 2025
f4a73ec
For benchmarking only, includes workarounds from Hannes; do not merge
fomics Sep 16, 2025
ff63fbb
Revised integration tests to work with DaCe backends, credit to Edoardo
fomics Sep 16, 2025
d180013
Merge remote-tracking branch 'origin/main' into muphys_bug_fix
fomics Sep 16, 2025
77537ff
rewrite run_full_muphys
edopao Sep 16, 2025
f8c22e5
fix backend arg
edopao Sep 16, 2025
546bb75
remove k_field
edopao Sep 16, 2025
876e81f
remove qti field
edopao Sep 16, 2025
d40b215
fix out fields
edopao Sep 16, 2025
ed1f8a1
Merge remote-tracking branch 'origin/edopao_muphys_benchmarking_dont_…
edopao Sep 16, 2025
8aff981
edit run_graupel_only
edopao Sep 16, 2025
ab9981f
add backend parser
edopao Sep 16, 2025
5a574e6
cleanup
edopao Sep 16, 2025
3752592
Corrected inputs for qse, qie, qge so that qti=1.0746937601645517e-005
fomics Sep 18, 2025
d4432fc
Removed mask_out from saturation_adjustment -- not needed
fomics Sep 30, 2025
d475f0b
Adjustments for performance benefit
fomics Sep 30, 2025
a311d70
Merge branch 'main' into muphys_bug_fix
edopao Oct 23, 2025
d2e80db
Merge branch 'main' into muphys_bug_fix
edopao Nov 5, 2025
e1dd9e4
add static compute domain
edopao Nov 7, 2025
aef59a0
Merge remote-tracking branch 'upstream/main' into muphys_bug_fix
havogt Nov 21, 2025
971aec1
Merge branch 'main' into muphys_bug_fix
edopao Nov 21, 2025
9153482
use backend_like
edopao Nov 21, 2025
fb2763b
Merge branch 'muphys_bug_fix' of github.com:C2SM/icon4py into muphys_…
havogt Nov 21, 2025
798ad60
muphys: Refactor graupel_only driver and add integration test (#958)
havogt Nov 27, 2025
b934921
[draft] Muphys bug fix graupel refactoring hannes (#961)
havogt Dec 5, 2025
213e801
point to gt4py main
havogt Dec 5, 2025
3ff602f
fix module import
edopao Dec 5, 2025
671bd66
Merge remote-tracking branch 'upstream/main' into muphys_bug_fix
havogt Dec 9, 2025
4838d26
undo extra changes
edopao Dec 9, 2025
b959d57
Merge remote-tracking branch 'upstream/main' into muphys_bug_fix
havogt Jan 8, 2026
42e4b86
fix timers
havogt Jan 9, 2026
58b7a6a
fix stencil_test allocation for named_collections
havogt Jan 15, 2026
a6d1b5b
Merge remote-tracking branch 'upstream/main' into muphys_bug_fix
havogt Jan 15, 2026
f4ff457
refactor testing infrastructure
havogt Jan 16, 2026
b714d56
Muphys: merge scans (#973)
havogt Jan 16, 2026
466ff6b
update gt4py main
edopao Jan 16, 2026
3b3b4da
Only write the surface level of the fluxes
havogt Jan 19, 2026
5610e9f
make pflx full field
havogt Jan 19, 2026
a4c80bf
Merge branch 'main' into muphys_bug_fix_single_level_fluxes
edopao Feb 20, 2026
436497a
apply multiple output domain to full muphys
edopao Feb 20, 2026
ba8bac5
fix GraupelOutput
edopao Feb 20, 2026
ae7be1c
disable some tests
edopao Feb 20, 2026
e5b48cf
switch gt4py to dev branch
edopao Feb 20, 2026
7f19c23
update uv lock
edopao Feb 20, 2026
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
6 changes: 3 additions & 3 deletions ci/dace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include:
GRID: [simple, icon_regional]
# test_model_stencils_x86_64:
# extends: [.test_model_stencils, .test_template_x86_64]
test_model_stencils_aarch64:
.test_model_stencils_aarch64:
extends: [.test_model_stencils, .test_template_aarch64]

.test_model_datatests:
Expand All @@ -28,7 +28,7 @@ test_model_stencils_aarch64:
- nox -s "test_model-3.10(datatest, $COMPONENT)" -- --backend=$BACKEND --level=$LEVEL
parallel:
matrix:
- COMPONENT: [advection, diffusion, dycore, microphysics, muphys, common, driver]
- COMPONENT: [muphys]
BACKEND: [dace_cpu, dace_gpu]
LEVEL: [integration]
rules:
Expand All @@ -44,7 +44,7 @@ test_model_stencils_aarch64:
SLURM_TIMELIMIT: '01:00:00'
- when: on_success
variables:
SLURM_TIMELIMIT: '00:30:00'
SLURM_TIMELIMIT: '01:00:00'
# test_model_datatests_x86_64:
# extends: [.test_model_datatests, .test_template_x86_64]
test_model_datatests_aarch64:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import dataclasses
import functools
import pathlib
from typing import ClassVar

import netCDF4
import numpy as np
Expand Down Expand Up @@ -143,6 +144,8 @@ class GraupelOutput:
pg: gtx.Field[dims.CellDim, dims.KDim] | None
pre: gtx.Field[dims.CellDim, dims.KDim] | None

_surface_fields: ClassVar[list[str]] = ["pr", "ps", "pi", "pg", "pre"]

@classmethod
def allocate(
cls,
Expand All @@ -160,10 +163,22 @@ def allocate(
if references is None:
references = {}

zeros = functools.partial(gtx.zeros, domain=domain, allocator=allocator)
zeros_full = functools.partial(gtx.zeros, domain=domain, allocator=allocator)
surface_domain = gtx.Domain(
dims=domain.dims,
ranges=(
domain.ranges[0],
gtx.unit_range((domain.ranges[1].stop - 1, domain.ranges[1].stop)),
),
)
zeros_surface = functools.partial(gtx.zeros, domain=surface_domain, allocator=allocator)
return cls(
**{
field.name: zeros() if field.name not in references else references[field.name]
field.name: references[field.name]
if field.name in references
else zeros_surface()
if field.name in cls._surface_fields
else zeros_full()
for field in dataclasses.fields(cls)
}
)
Expand Down Expand Up @@ -210,6 +225,9 @@ def write(self, filename: pathlib.Path | str):
write_height_field = functools.partial(
_field_to_nc, ncfile, ("height", "ncells"), dtype=np.float64
)
write_surface_field = functools.partial(
_field_to_nc, ncfile, ("surface", "ncells"), dtype=np.float64
)

write_height_field("ta", self.t)
write_height_field("hus", self.qv)
Expand All @@ -221,14 +239,12 @@ def write(self, filename: pathlib.Path | str):
if self.pflx is not None:
write_height_field("pflx", self.pflx)
if self.pr is not None:
write_height_field(
"prr_gsp", self.pr
) # TODO(havogt): see https://github.com/C2SM/icon4py/pull/995
write_surface_field("prr_gsp", self.pr)
if self.ps is not None:
write_height_field("prs_gsp", self.ps) # TODO(havogt): see above
write_surface_field("prs_gsp", self.ps)
if self.pi is not None:
write_height_field("pri_gsp", self.pi) # TODO(havogt): see above
write_surface_field("pri_gsp", self.pi)
if self.pg is not None:
write_height_field("prg_gsp", self.pg) # TODO(havogt): see above
write_surface_field("prg_gsp", self.pg)
if self.pre is not None:
write_height_field("pre_gsp", self.pre) # TODO(havogt): see above
write_surface_field("pre_gsp", self.pre)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def main():
use_inout_buffers = True # Set to True to reuse input buffers for output.
if use_inout_buffers:
# We are passing the same buffers for `Q` as input and output. This is not best GT4Py practice,
# but should be save in this case as we are not reading the input with an offset.
# but should be safe in this case as we are not reading the input with an offset.
references = {
"qv": inp.qv,
"qc": inp.qc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,68 @@ def graupel_run(
qnc=qnc,
enable_masking=enable_masking,
out=(t_out, q_out, pflx, pr, ps, pi, pg, pre),
domain={
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
domain=(
# t_out
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
# q_out
(
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
),
# pflx
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
# pr
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# ps
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pi
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pg
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pre
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,68 @@ def muphys_run(
dt,
qnc,
out=(t_out, q_out, pflx, pr, ps, pi, pg, pre),
domain={
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
domain=(
# t_out
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
# q_out
(
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
),
# pflx
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_start, vertical_end),
},
# pr
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# ps
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pi
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pg
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
# pre
{
dims.CellDim: (horizontal_start, horizontal_end),
dims.KDim: (vertical_end - 1, vertical_end),
},
),
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ url = 'https://gridtools.github.io/pypi/'
[tool.uv.sources]
dace = {index = "gridtools"}
ghex = {git = "https://github.com/msimberg/GHEX.git", branch = "async-mpi"}
# gt4py = {git = "https://github.com/GridTools/gt4py", branch = "main"}
gt4py = {git = "https://github.com/edopao/gt4py", branch = "dace_scan_single_level"}
# gt4py = {index = "test.pypi"}
icon4py-atmosphere-advection = {workspace = true}
icon4py-atmosphere-diffusion = {workspace = true}
Expand Down
Loading
Loading