Skip to content

Commit

Permalink
mom5: create member variables for platform and mom_type
Browse files Browse the repository at this point in the history
  • Loading branch information
harshula committed Mar 21, 2023
1 parent fdbe30e commit ab450f1
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions packages/mom5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Mom5(MakefilePackage):

phases = ["edit", "build", "install"]

_platform = "spack"
_mom_type = "ACCESS-OM"

def edit(self, spec, prefix):

srcdir = self.stage.source_path
Expand Down Expand Up @@ -294,16 +297,24 @@ def build(self, spec, prefix):
# ./MOM_compile.csh --type $mom_type --platform spack
with working_dir(join_path(self.stage.source_path, "exp")):
build = Executable("./MOM_compile.csh")
build("--type", "ACCESS-OM", "--platform", "spack", "--no_environ")
build(
"--type",
self._mom_type,
"--platform",
self._platform,
"--no_environ"
)

def install(self, spec, prefix):

platform = "spack"
mom_type = "ACCESS-OM"

mkdirp(prefix.bin)
install(
join_path("exec", platform, mom_type, "fms_" + mom_type + ".x"),
join_path(
"exec",
self._platform,
self._mom_type,
"fms_" + self._mom_type + ".x"
),
prefix.bin
)
install(join_path("bin", "mppnccombine." + platform), prefix.bin)
install(join_path("bin", "mppnccombine." + self._platform), prefix.bin)

0 comments on commit ab450f1

Please sign in to comment.