Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0f57ddb
refactor: use new constructor of `QuantityFactory`
romanc Jan 6, 2026
594739f
refactor: prefer `backend` over `gt4py_backend`
romanc Jan 6, 2026
d5408fc
Removing init_gravity stencil definition and using set_value from NDS…
fmalatino Jan 7, 2026
6309b07
Merge branch 'wam_dev' into wam
fmalatino Jan 7, 2026
1e2c9dc
Moving gravity operations to its own module for reusability
fmalatino Jan 8, 2026
1ae997d
Added in use of variable gravity for Riem_Solver3, Riem_Solver_C, and…
fmalatino Jan 8, 2026
725c2c8
refactor: update actions in workflows, checkout@v6, cache@v5
fmalatino Jan 9, 2026
66b11e8
Merge pull request #108 from romanc/romanc/quantity-factory-update
fmalatino Jan 13, 2026
3788a13
Merge pull request #109 from romanc/romanc/quantity-backend-update
fmalatino Jan 13, 2026
3c4fd8f
fix issues revealed after updating pyfv3 in pace
romanc Jan 13, 2026
e5eb35e
Merge branch 'develop' into wam_dev
fmalatino Jan 13, 2026
266d4b6
Merging in wam_dev
fmalatino Jan 13, 2026
a8548b3
fixup: Quantity requires backend parameter now
romanc Jan 13, 2026
aba0773
Centralized wam methods into one module, introduced potential wam ste…
fmalatino Jan 13, 2026
4db8304
Lint
fmalatino Jan 13, 2026
ec6e6ce
fixup: more type fixes around translate tests
romanc Jan 14, 2026
3c2c3d4
Merge pull request #114 from romanc/romanc/types-patches
jjuyeonkim Jan 14, 2026
ca42588
Removing wam class
fmalatino Jan 15, 2026
85597e2
refactor: replace `NullComm` with `LocalComm`
romanc Jan 16, 2026
22c14ab
Merge pull request #116 from romanc/romanc/replace-null-comm
jjuyeonkim Jan 16, 2026
435339c
Merge pull request #113 from fmalatino/workflow_fix
fmalatino Jan 16, 2026
99b9564
Pin pyFV3 to NDSL version 2026.01.00
romanc Jan 21, 2026
64ddc3a
Merge pull request #117 from romanc/romanc/ndsl-2026.01.00
jjuyeonkim Jan 21, 2026
2cda03f
Merging develop
fmalatino Jan 27, 2026
126dc07
ci: expose python version for translate tests
Feb 5, 2026
091bc1c
Merge pull request #118 from romanc/romanc/gha-translate-test-python-…
jjuyeonkim Feb 5, 2026
8929dd7
fix: DyCore orchestration without timer allocation
Feb 10, 2026
e4bbdeb
keep if/else code path for self.config.z_tracer
Feb 11, 2026
765db3b
Merge pull request #119 from romanc/romanc/orch-fv-dynamics-no-alloc-…
FlorianDeconinck Feb 11, 2026
a47df5b
Merging in develop
fmalatino Feb 17, 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
12 changes: 6 additions & 6 deletions .github/workflows/create_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

- uses: actions/cache@v4
- uses: actions/cache@v5
id: cache
with:
path: ~/.cache/pre-commit
Expand All @@ -64,14 +64,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

- uses: actions/cache@v4
- uses: actions/cache@v5
id: cache
with:
path: pyFV3/test_data
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh_pages_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com

- name: Setup python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.11

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

# Only restore (don't save) caches on PRs. New caches created from PRs won't be
# accessible from other PRs, see workflows/create_cache.yaml.
- uses: actions/cache/restore@v4
- uses: actions/cache/restore@v5
with:
path: ~/.cache/pre-commit
key: pre-commit_${{ env.pythonLocation }}_${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/translate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand All @@ -44,14 +44,14 @@ jobs:

- name: External trigger Checkout pyFV3
if: ${{inputs.component_trigger}}
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: 'recursive'
repository: noaa-gfdl/pyFV3
path: pyFV3

- name: Checkout hash that triggered CI
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: 'recursive'
path: pyFV3/${{inputs.component_name}}
Expand All @@ -73,7 +73,7 @@ jobs:
# accessible from other PRs, see workflows/create_cache.yaml.
- name: Restore test_data (if cached)
id: cache-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
key: ${{ env.DATA_PATH }}
path: pyFV3/test_data
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: 'recursive'

- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down
3 changes: 2 additions & 1 deletion examples/notebook/test_functionality.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@
" layout=layout,\n",
" tile_partitioner=partitioner.tile,\n",
" tile_rank=cs_communicator.tile.rank,\n",
" backend=backend,\n",
")\n",
"\n",
"# useful for easily allocating distributed data storages (fields)\n",
"quantity_factory = QuantityFactory.from_backend(sizer=sizer, backend=backend)\n",
"quantity_factory = QuantityFactory(sizer=sizer, backend=backend)\n",
"\n",
"compilation_config = CompilationConfig(backend=backend, communicator=cs_communicator)\n",
"\n",
Expand Down
32 changes: 13 additions & 19 deletions examples/standalone/runfile/acoustics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# type: ignore
from types import SimpleNamespace
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Tuple

import click
import f90nml
Expand All @@ -14,24 +14,20 @@
CubedSphereCommunicator,
CubedSpherePartitioner,
DaceConfig,
NullComm,
LocalComm,
MPIComm,
StencilConfig,
StencilFactory,
TilePartitioner,
)
from ndsl.comm import Comm
from ndsl.performance import Timer
from ndsl.stencils.testing import Grid
from pyfv3 import DynamicalCoreConfig
from pyfv3.stencils import AcousticDynamics
from pyfv3.testing import TranslateDynCore


try:
from mpi4py import MPI
except ImportError:
MPI = None


def dycore_config_from_namelist(data_directory: str) -> DynamicalCoreConfig:
"""
Reads the namelist at the given directory and sets
Expand Down Expand Up @@ -89,17 +85,15 @@ def get_state_from_input(
def set_up_communicator(
disable_halo_exchange: bool,
layout: Tuple[int, int],
) -> Tuple[Optional[MPI.Comm], Optional[CubedSphereCommunicator]]:
partitioner = CubedSpherePartitioner(TilePartitioner(layout))
if MPI is not None:
comm = MPI.COMM_WORLD
else:
comm = None
if not disable_halo_exchange:
assert comm is not None
cube_comm = CubedSphereCommunicator(comm, partitioner)
else:
cube_comm = CubedSphereCommunicator(NullComm(0, 0), partitioner)
) -> Tuple[Comm, CubedSphereCommunicator]:
comm = (
LocalComm(rank=0, total_ranks=1, buffer={})
if disable_halo_exchange
else MPIComm()
)
cube_comm = CubedSphereCommunicator(
comm, CubedSpherePartitioner(TilePartitioner(layout))
)
return comm, cube_comm


Expand Down
14 changes: 4 additions & 10 deletions examples/standalone/runfile/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@

import f90nml
import gt4py.cartesian.config
from mpi4py import MPI

from ndsl import NullComm
from ndsl import LocalComm
from pyfv3 import DynamicalCoreConfig


try:
from mpi4py import MPI
except ImportError:
MPI = None

local = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, local)
from runfile.dynamics import get_experiment_info, setup_dycore # noqa: E402
Expand Down Expand Up @@ -68,10 +64,8 @@ def parse_args() -> Namespace:
for iteration in range(iterations):
top_tile_rank = global_rank + size * iteration
if top_tile_rank < sub_tiles:
mpi_comm = NullComm(
rank=top_tile_rank,
total_ranks=6 * sub_tiles,
fill_value=0.0,
mpi_comm = LocalComm(
rank=top_tile_rank, total_ranks=6 * sub_tiles, buffer_dict={}
)
gt4py.cartesian.config.cache_settings["dir_name"] = os.environ.get(
"GT_CACHE_ROOT", f".gt_cache_{mpi_comm.Get_rank():06}"
Expand Down
16 changes: 11 additions & 5 deletions examples/standalone/runfile/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
CubedSphereCommunicator,
CubedSpherePartitioner,
DaceConfig,
NullComm,
LocalComm,
MPIComm,
StencilConfig,
StencilFactory,
TilePartitioner,
Expand Down Expand Up @@ -286,10 +287,15 @@ def setup_dycore(
namelist = f90nml.read(args.data_dir + "/input.nml")
dycore_config = DynamicalCoreConfig.from_f90nml(namelist)
experiment_name, is_baroclinic_test_case = get_experiment_info(args.data_dir)
if args.disable_halo_exchange:
mpi_comm = NullComm(MPI.COMM_WORLD.Get_rank(), MPI.COMM_WORLD.Get_size())
else:
mpi_comm = MPI.COMM_WORLD
mpi_comm = (
LocalComm(
rank=MPI.COMM_WORLD.Get_rank(),
total_ranks=MPI.COMM_WORLD.Get_size(),
buffer_dict={},
)
if args.disable_halo_exchange
else MPIComm()
)
dycore, state, stencil_factory = setup_dycore(
dycore_config,
mpi_comm,
Expand Down
13 changes: 8 additions & 5 deletions pyfv3/dycore_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class DycoreState:
rdg_var: Quantity = field(
metadata={
"name": "gas constant for dry air over variable gravity (RDGAS / grav_var) for Whole Atmosphere calculations",
"units": "(J/kg/deg) / (m s^-2)", # JK TODO: What are the units?
"units": "(J/kg/deg) / (m s^-2)", # JK TODO: What are the units?
"dims": [X_DIM, Y_DIM, Z_DIM],
"intent": "inout",
}
Expand Down Expand Up @@ -345,7 +345,9 @@ def init_zeros(cls, quantity_factory: QuantityFactory) -> Self:
dtype=Float,
).data
return cls.init_from_storages(
storages=initial_storages, sizer=quantity_factory.sizer
storages=initial_storages,
sizer=quantity_factory.sizer,
backend=quantity_factory.backend,
)

@classmethod
Expand All @@ -368,10 +370,9 @@ def init_from_numpy_arrays(
_field.metadata["units"],
origin=sizer.get_origin(dims),
extent=sizer.get_extent(dims),
gt4py_backend=backend,
backend=backend,
)
state = cls(**dict_state)
return state
return cls(**dict_state) # type: ignore[arg-type,unused-ignore]

@classmethod
def init_from_storages(
Expand All @@ -380,6 +381,7 @@ def init_from_storages(
sizer: GridSizer,
bdt: float = 0.0,
mdt: float = 0.0,
backend: str | None = None,
) -> Self:
inputs = {}
for _field in fields(cls):
Expand All @@ -391,6 +393,7 @@ def init_from_storages(
_field.metadata["units"],
origin=sizer.get_origin(dims),
extent=sizer.get_extent(dims),
backend=backend,
)
inputs[_field.name] = quantity
return cls(**inputs, bdt=bdt, mdt=mdt)
Expand Down
Loading