Skip to content

Commit

Permalink
Add ACCESS-ESM1.6 SBD (#141)
Browse files Browse the repository at this point in the history
* Specify MOM5 type variant in ACCESS-ESM1.5 SBD

* Add ACCESS-ESM1.6 SBD

* Use self.spec.satisfies syntax

* Add accidentally removed "not"
  • Loading branch information
dougiesquire authored Aug 21, 2024
1 parent 3f45685 commit 81a820e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/access-esm1p5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AccessEsm1p5(BundlePackage):
version("latest")

depends_on("[email protected]", type="run")
depends_on("[email protected]", type="run")
depends_on("[email protected] type=ACCESS-CM", type="run")
# um7 is in a private repository
depends_on("[email protected]", type="run")

Expand Down
37 changes: 37 additions & 0 deletions packages/access-esm1p6/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# Copyright 2024 ACCESS-NRI
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *

class AccessEsm1p6(BundlePackage):
"""ACCESS-ESM1.6 bundle contains the coupled UM7, CICE4 and MOM5 models.
ACCESS-ESM1.6 comprises of:
* The UKMO UM atmospheric model (v7.3), in the same configuration as
ACCESS1.4, at N96 (1.875×1.25 degree), 38 level resolution
* The CABLE land surface model with biogeochemistry (CASA-CNP) (CABLE2.4)
* The GFDL MOM5 ocean model at 1 degree resolution
* The WOMBATlite ocean BGC model (generic tracer version)
* The LANL CICE4.1 sea ice model (version as ACCESS1.4)
* The OASIS-MCT coupler
"""

homepage = "https://www.access-nri.org.au"

git = "https://github.com/ACCESS-NRI/ACCESS-ESM1.6.git"

maintainers("dougiesquire")

version("latest")

depends_on("[email protected]", type="run")
depends_on("[email protected] type=ACCESS-ESM", type="run")
# um7 is in a private repository
depends_on("[email protected]", type="run")

# There is no need for install() since there is no code.
17 changes: 7 additions & 10 deletions packages/mom5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ class Mom5(MakefilePackage):

version("master", branch="master", preferred=True)
version("access-esm1.5", branch="access-esm1.5")
version("access-esm1.6", branch="master")

variant("restart_repro", default=True, description="Reproducible restart build.")
# The following two variants are not applicable when version is "access-esm1.5":
variant("deterministic", default=False, description="Deterministic build.")
variant("optimisation_report", default=False, description="Generate optimisation reports.")
variant("type", default="ACCESS-OM",
# https://spack.readthedocs.io/en/latest/packaging_guide.html#conditional-possible-values
values=(
"ACCESS-CM",
# Spack does not have a spec syntax for NOT "@access-esm1.5", so use version ranges instead
conditional("ACCESS-ESM", "ACCESS-OM", "ACCESS-OM-BGC", "MOM_solo", when="@:access-esm0,access-esm2:")),
values=("ACCESS-CM", "ACCESS-ESM", "ACCESS-OM", "ACCESS-OM-BGC", "MOM_solo"),
multi=False,
description="Build MOM5 to support a particular use case.")

Expand All @@ -43,7 +40,7 @@ class Mom5(MakefilePackage):
depends_on("oasis3-mct~deterministic", when="~deterministic")
depends_on("libaccessom2+deterministic", when="+deterministic")
depends_on("libaccessom2~deterministic", when="~deterministic")
with when("@access-esm1.5"):
with when("@access-esm1.5:access-esm1.6"):
depends_on("[email protected]:4.7.4")
depends_on("[email protected]:4.5.2")
# Depend on "openmpi".
Expand All @@ -64,7 +61,7 @@ def edit(self, spec, prefix):
config = {}

# NOTE: The order of the libraries matters during the linking step!
if "@access-esm1.5" in self.spec:
if self.spec.satisfies("@access-esm1.5:access-esm1.6"):
istr = " ".join([
join_path((spec["oasis3-mct"].headers).cpp_flags, "psmile.MPI1"),
join_path((spec["oasis3-mct"].headers).cpp_flags, "mct")])
Expand Down Expand Up @@ -170,7 +167,7 @@ def edit(self, spec, prefix):
"""

# Copied from bin/mkmf.template.nci
if "@access-esm1.5" in self.spec:
if self.spec.satisfies("@access-esm1.5:access-esm1.6"):
config["intel"] = f"""
ifeq ($(VTRACE), yes)
FC = mpifort-vt
Expand Down Expand Up @@ -304,7 +301,7 @@ def edit(self, spec, prefix):
config["oneapi"] = config["intel"]

# Copied from bin/mkmf.template.t90
if "@access-esm1.5" in self.spec:
if self.spec.satisfies("@access-esm1.5:access-esm1.6"):
config["post"] = """
# you should never need to change any lines below.
Expand Down Expand Up @@ -490,7 +487,7 @@ def build(self, spec, prefix):
build = Executable("./MOM_compile.csh")
if "+restart_repro" in self.spec:
build.add_default_env("REPRO", "true")
if "@access-esm1.5" not in self.spec:
if not self.spec.satisfies("@access-esm1.5"):
# The MOM5 commit d7ba13a3f364ce130b6ad0ba813f01832cada7a2
# requires the --no_version switch to avoid git hashes being
# embedded in the binary.
Expand Down

0 comments on commit 81a820e

Please sign in to comment.