Skip to content

Commit

Permalink
mom5: add support for generic tracers (#166)
Browse files Browse the repository at this point in the history
* Add new variant access-gtracers
* Add new dependencies access-fms & access-generic-tracers
  • Loading branch information
harshula authored Nov 18, 2024
1 parent ff94cda commit c46a39c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/mom5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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("[email protected]:")
depends_on("[email protected]:")
Expand Down Expand Up @@ -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])

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c46a39c

Please sign in to comment.