From 8c92408cc02a40490c194e8b785d94780f103bbb Mon Sep 17 00:00:00 2001 From: dougiesquire Date: Tue, 20 Aug 2024 13:39:53 +1000 Subject: [PATCH 1/4] Specify MOM5 type variant in ACCESS-ESM1.5 SBD --- packages/access-esm1p5/package.py | 2 +- packages/mom5/package.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/access-esm1p5/package.py b/packages/access-esm1p5/package.py index 1184f8b..c3b64fd 100644 --- a/packages/access-esm1p5/package.py +++ b/packages/access-esm1p5/package.py @@ -30,7 +30,7 @@ class AccessEsm1p5(BundlePackage): version("latest") depends_on("cice4@access-esm1.5", type="run") - depends_on("mom5@access-esm1.5", type="run") + depends_on("mom5@access-esm1.5 type=ACCESS-CM", type="run") # um7 is in a private repository depends_on("um7@access-esm1.5", type="run") diff --git a/packages/mom5/package.py b/packages/mom5/package.py index 94d9172..66088af 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -25,11 +25,7 @@ class Mom5(MakefilePackage): 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.") From d1cef91f879e3f9602d910ea3dfcbbbb0d498675 Mon Sep 17 00:00:00 2001 From: dougiesquire Date: Tue, 20 Aug 2024 13:46:23 +1000 Subject: [PATCH 2/4] Add ACCESS-ESM1.6 SBD --- packages/access-esm1p6/package.py | 37 +++++++++++++++++++++++++++++++ packages/mom5/package.py | 9 ++++---- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 packages/access-esm1p6/package.py diff --git a/packages/access-esm1p6/package.py b/packages/access-esm1p6/package.py new file mode 100644 index 0000000..b32fadf --- /dev/null +++ b/packages/access-esm1p6/package.py @@ -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("cice4@access-esm1.5", type="run") + depends_on("mom5@access-esm1.6 type=ACCESS-ESM", type="run") + # um7 is in a private repository + depends_on("um7@access-esm1.5", type="run") + + # There is no need for install() since there is no code. diff --git a/packages/mom5/package.py b/packages/mom5/package.py index 66088af..5579690 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -19,6 +19,7 @@ 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": @@ -39,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:access-esm1.6"): depends_on("netcdf-c@4.7.1:4.7.4") depends_on("netcdf-fortran@4.5.1:4.5.2") # Depend on "openmpi". @@ -60,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 ("@access-esm1.5" in self.spec) or ("@access-esm1.6" in self.spec): istr = " ".join([ join_path((spec["oasis3-mct"].headers).cpp_flags, "psmile.MPI1"), join_path((spec["oasis3-mct"].headers).cpp_flags, "mct")]) @@ -166,7 +167,7 @@ def edit(self, spec, prefix): """ # Copied from bin/mkmf.template.nci - if "@access-esm1.5" in self.spec: + if ("@access-esm1.5" in self.spec) or ("@access-esm1.6" in self.spec): config["intel"] = f""" ifeq ($(VTRACE), yes) FC = mpifort-vt @@ -300,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 ("@access-esm1.5" in self.spec) or ("@access-esm1.6" in self.spec): config["post"] = """ # you should never need to change any lines below. From 130b328f81b14e94aab667d0e532b5b61bac749f Mon Sep 17 00:00:00 2001 From: dougiesquire Date: Tue, 20 Aug 2024 14:31:08 +1000 Subject: [PATCH 3/4] Use self.spec.satisfies syntax --- packages/mom5/package.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/mom5/package.py b/packages/mom5/package.py index 5579690..5545e5e 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -40,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:access-esm1.6"): + with when("@access-esm1.5:access-esm1.6"): depends_on("netcdf-c@4.7.1:4.7.4") depends_on("netcdf-fortran@4.5.1:4.5.2") # Depend on "openmpi". @@ -61,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) or ("@access-esm1.6" 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")]) @@ -167,7 +167,7 @@ def edit(self, spec, prefix): """ # Copied from bin/mkmf.template.nci - if ("@access-esm1.5" in self.spec) or ("@access-esm1.6" in self.spec): + if self.spec.satisfies("@access-esm1.5:access-esm1.6"): config["intel"] = f""" ifeq ($(VTRACE), yes) FC = mpifort-vt @@ -301,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) or ("@access-esm1.6" in self.spec): + if self.spec.satisfies("@access-esm1.5:access-esm1.6"): config["post"] = """ # you should never need to change any lines below. @@ -487,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 self.spec.satisfies("@access-esm1.5"): # The MOM5 commit d7ba13a3f364ce130b6ad0ba813f01832cada7a2 # requires the --no_version switch to avoid git hashes being # embedded in the binary. From 30b8b9d44e7ed2f15bbafaea053a5879783cf255 Mon Sep 17 00:00:00 2001 From: dougiesquire Date: Tue, 20 Aug 2024 15:57:47 +1000 Subject: [PATCH 4/4] Add accidentally removed "not" --- packages/mom5/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mom5/package.py b/packages/mom5/package.py index 5545e5e..965cbae 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -487,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 self.spec.satisfies("@access-esm1.5"): + 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.