Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
[submodule "NDSL"]
path = NDSL
url = git@github.com:NOAA-GFDL/NDSL.git
[submodule "pyFV3"]
path = pyFV3
url = git@github.com:NOAA-GFDL/PyFV3.git
2 changes: 1 addition & 1 deletion NDSL
36 changes: 22 additions & 14 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ cfgv==3.3.1
cftime==1.5.0
# via
# -r requirements_dev.txt
# ndsl
# netcdf4
# pace-util
chardet==4.0.0
# via aiohttp
charset-normalizer==2.0.4
Expand All @@ -74,14 +74,16 @@ coverage==5.5
# via pytest-cov
cytoolz==0.12.1
# via gt4py
dace==0.15
dace
# via ndsl
dacite==1.6.0
# via
# fv3config
# pace-driver
dask==2021.12.0
# via -r requirements_dev.txt
# via
# -r requirements_dev.txt
# ndsl
debugpy==1.6.3
# via ipykernel
decorator==5.0.9
Expand Down Expand Up @@ -111,9 +113,8 @@ f90nml==1.3.1
# via
# -r requirements_dev.txt
# fv3config
# pace-fv3core
# pace-physics
# pace-util
# pyfv3
fasteners==0.16.3
# via zarr
fastjsonschema==2.16.2
Expand All @@ -131,7 +132,7 @@ fsspec==2021.7.0
# dask
# fv3config
# gcsfs
# pace-util
# ndsl
fv3config==0.9.0
# via -r requirements_dev.txt
gcsfs==2021.7.0
Expand All @@ -146,8 +147,12 @@ gprof2dot==2021.2.21
# via pytest-profiling
gridtools-cpp==2.3.1
# via gt4py
gt4py==1.0.1
gt4py
# via ndsl
h5netcdf==1.1.0
# via ndsl
h5py==3.10.0
# via h5netcdf
identify==2.2.13
# via pre-commit
idna==3.2
Expand Down Expand Up @@ -204,6 +209,7 @@ matplotlib-inline==0.1.6
mpi4py==3.1.4
# via
# -r requirements_dev.txt
# ndsl
# pace-driver
mpmath==1.2.1
# via sympy
Expand Down Expand Up @@ -231,6 +237,7 @@ nest-asyncio==1.5.6
netcdf4==1.6.4
# via
# -r requirements_dev.txt
# ndsl
# pace-driver
networkx==2.6.3
# via dace
Expand All @@ -246,26 +253,25 @@ numpy==1.21.2
# cftime
# dace
# gt4py
# h5py
# netcdf4
# numcodecs
# pace-driver
# pace-fv3core
# pace-physics
# pace-util
# pandas
# pyfv3
# scipy
# xarray
# zarr
oauthlib==3.1.1
# via requests-oauthlib
ordered-set==4.1.0
# via deepdiff
pace-util==0.9.0
# via ndsl
packaging==21.0
# via
# dask
# gt4py
# h5netcdf
# ipykernel
# pytest
# setuptools-scm
Expand Down Expand Up @@ -375,7 +381,9 @@ requests-oauthlib==1.3.0
rsa==4.7.2
# via google-auth
scipy==1.10.1
# via -r requirements_dev.txt
# via
# -r requirements_dev.txt
# ndsl
setuptools-scm==8.0.4
# via fparser
six==1.16.0
Expand Down Expand Up @@ -451,7 +459,6 @@ typing-extensions==4.3.0
# aiohttp
# black
# gt4py
# pace-util
# setuptools-scm
urllib3==1.26.6
# via requests
Expand All @@ -468,9 +475,10 @@ wheel==0.37.0
xarray==0.19.0
# via
# -r requirements_dev.txt
# ndsl
# pace-driver
# pace-fv3core
# pace-physics
# pyfv3
xxhash==2.0.2
# via gt4py
yarl==1.6.3
Expand Down
2 changes: 1 addition & 1 deletion driver/pace/driver/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ndsl.monitor import Monitor, NetCDFMonitor, ZarrMonitor
from ndsl.quantity import Quantity

from pace.fv3core.dycore_state import DycoreState
from pyFV3.dycore_state import DycoreState

from .state import DriverState

Expand Down
10 changes: 5 additions & 5 deletions driver/pace/driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import pace.driver
import pace.physics
from pace import fv3core
import pyFV3
from pace.driver.safety_checks import SafetyChecker

# TODO: move update_atmos_state into pace.driver
Expand Down Expand Up @@ -113,8 +113,8 @@ class DriverConfig:
comm_config: CreatesCommSelector = dataclasses.field(
default_factory=CreatesCommSelector
)
dycore_config: fv3core.DynamicalCoreConfig = dataclasses.field(
default_factory=fv3core.DynamicalCoreConfig
dycore_config: pyFV3.DynamicalCoreConfig = dataclasses.field(
default_factory=pyFV3.DynamicalCoreConfig
)
physics_config: pace.physics.PhysicsConfig = dataclasses.field(
default_factory=pace.physics.PhysicsConfig
Expand Down Expand Up @@ -243,7 +243,7 @@ def from_dict(cls, kwargs: Dict[str, Any]) -> "DriverConfig":
)

kwargs["dycore_config"] = dacite.from_dict(
data_class=fv3core.DynamicalCoreConfig,
data_class=pyFV3.DynamicalCoreConfig,
data=kwargs.get("dycore_config", {}),
config=dacite.Config(strict=True),
)
Expand Down Expand Up @@ -490,7 +490,7 @@ def exit_instead_of_build(self):

self._start_time = self.config.initialization.start_time
ndsl_log.info("setting up dycore object started")
self.dycore = fv3core.DynamicalCore(
self.dycore = pyFV3.DynamicalCore(
comm=communicator,
grid_data=self.state.grid_data,
stencil_factory=self.stencil_factory,
Expand Down
12 changes: 6 additions & 6 deletions driver/pace/driver/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from ndsl.stencils.testing import TranslateGrid, grid

import pace.driver
import pace.fv3core.initialization.analytic_init as analytic_init
import pace.physics
from pace import fv3core
from pace.fv3core.testing import TranslateFVDynamics
import pyFV3
import pyFV3.initialization.analytic_init as analytic_init
from pyFV3.testing import TranslateFVDynamics

from .registry import Registry
from .state import DriverState, TendencyState, _restart_driver_state
Expand Down Expand Up @@ -306,7 +306,7 @@ def _initialize_dycore_state(
self,
communicator: Communicator,
backend: str,
) -> fv3core.DycoreState:
) -> pyFV3.DycoreState:
grid = self._get_serialized_grid(communicator=communicator, backend=backend)

ser = self._serializer(communicator)
Expand Down Expand Up @@ -343,7 +343,7 @@ class PredefinedStateInit(Initializer):
used to construct the class.
"""

dycore_state: fv3core.DycoreState
dycore_state: pyFV3.DycoreState
physics_state: pace.physics.PhysicsState
tendency_state: TendencyState
grid_data: GridData
Expand All @@ -370,7 +370,7 @@ def get_driver_state(
)


# TODO: refactor fv3core so that pe and peln are internal temporaries
# TODO: refactor pyFV3 so that pe and peln are internal temporaries
# of the dynamical core, computed automatically, so that this helper
# can be eliminated from initialization
def _update_fortran_restart_pe_peln(state: DriverState) -> None:
Expand Down
2 changes: 1 addition & 1 deletion driver/pace/driver/safety_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from ndsl.quantity import Quantity

from pace.fv3core.dycore_state import DycoreState
from pyFV3.dycore_state import DycoreState


class VariableBounds:
Expand Down
10 changes: 5 additions & 5 deletions driver/pace/driver/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ndsl.quantity import Quantity

import pace.physics
from pace import fv3core
import pyFV3


@dataclasses.dataclass()
Expand Down Expand Up @@ -63,7 +63,7 @@ def init_zeros(cls, quantity_factory: QuantityFactory) -> "TendencyState":

@dataclasses.dataclass
class DriverState:
dycore_state: fv3core.DycoreState
dycore_state: pyFV3.DycoreState
physics_state: pace.physics.PhysicsState
tendency_state: TendencyState
grid_data: GridData
Expand Down Expand Up @@ -155,7 +155,7 @@ def save_state(self, comm, restart_path: str = "RESTART"):
def _overwrite_state_from_restart(
path: str,
rank: int,
state: fv3core.DycoreState,
state: pyFV3.DycoreState,
restart_file_prefix: str,
):
"""
Expand Down Expand Up @@ -192,11 +192,11 @@ def _restart_driver_state(
)

if is_fortran_restart:
dycore_state = fv3core.DycoreState.from_fortran_restart(
dycore_state = pyFV3.DycoreState.from_fortran_restart(
quantity_factory=quantity_factory, communicator=communicator, path=path
)
else:
dycore_state = fv3core.DycoreState.init_zeros(quantity_factory=quantity_factory)
dycore_state = pyFV3.DycoreState.init_zeros(quantity_factory=quantity_factory)
_overwrite_state_from_restart(
path,
rank,
Expand Down
3 changes: 2 additions & 1 deletion driver/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
setup_requirements: List[str] = []

requirements = [
"pace-fv3core",
"ndsl",
"pyFV3",
"pace-physics",
"dacite",
"pyyaml",
Expand Down
6 changes: 3 additions & 3 deletions examples/notebooks/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from ndsl.quantity import Quantity
from units_config import units

from pace.fv3core.stencils.fvtp2d import FiniteVolumeTransport
from pace.fv3core.stencils.fxadv import FiniteVolumeFluxPrep
from pace.fv3core.stencils.tracer_2d_1l import TracerAdvection
from pyFV3.stencils.fvtp2d import FiniteVolumeTransport
from pyFV3.stencils.fxadv import FiniteVolumeFluxPrep
from pyFV3.stencils.tracer_2d_1l import TracerAdvection


class GridType(enum.Enum):
Expand Down
Loading