From c46a39c954f000d530148a379778518d6a8ee4fe Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Mon, 18 Nov 2024 16:05:07 +1100 Subject: [PATCH] mom5: add support for generic tracers (#166) * Add new variant access-gtracers * Add new dependencies access-fms & access-generic-tracers --- packages/mom5/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/mom5/package.py b/packages/mom5/package.py index fce38eb..7828787 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -22,6 +22,7 @@ class Mom5(MakefilePackage): version("access-esm1.6", branch="master") variant("restart_repro", default=True, description="Reproducible restart build.") + variant("access-gtracers", default=False, description="Use ACCESS-NRI's fork of GFDL-generic-tracers.") # 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.") @@ -30,6 +31,9 @@ class Mom5(MakefilePackage): multi=False, description="Build MOM5 to support a particular use case.") + depends_on("access-fms", when="+access-gtracers") + depends_on("access-generic-tracers", when="+access-gtracers") + with when("@:access-esm0,access-esm2:"): depends_on("netcdf-c@4.7.4:") depends_on("netcdf-fortran@4.5.2:") @@ -82,6 +86,10 @@ def edit(self, spec, prefix): FFLAGS_OPT = "-g0 -O0 -xCORE-AVX2 -debug none -check none" CFLAGS_OPT = "-O0 -debug none -xCORE-AVX2" + if self.spec.satisfies("+access-gtracers"): + ideps.extend(["access-fms", "access-generic-tracers"]) + ldeps.extend(["access-fms", "access-generic-tracers"]) + incs = " ".join([istr] + [(spec[d].headers).cpp_flags for d in ideps]) libs = " ".join([(spec[d].libs).ld_flags for d in ldeps]) @@ -488,6 +496,10 @@ 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-gtracers"): + build.add_default_env("SPACK_BUILD", "true") + if not self.spec.satisfies("@access-esm1.5"): # The MOM5 commit d7ba13a3f364ce130b6ad0ba813f01832cada7a2 # requires the --no_version switch to avoid git hashes being