-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper implementation of ACCESS-OM3 SPD.
This now builds and install the OM3 executables and is aware of the different variants.
- Loading branch information
1 parent
9957fdc
commit 3ffd4c2
Showing
1 changed file
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,56 @@ | |
from spack.package import * | ||
|
||
|
||
class AccessOm3(BundlePackage): | ||
"""Dummy package to install the ACCESS-OM3 dependencies.""" | ||
class AccessOm3(CMakePackage): | ||
"""ACCESS-OM3 global ocean-sea ice-wave coupled model.""" | ||
|
||
homepage = "https://www.github.com/COSIMA/access-om3" | ||
# There is no URL since there is no code to download. | ||
git = "https://github.com/COSIMA/access-om3.git" | ||
|
||
maintainers = ["micaeljtoliveira", "aekiss"] | ||
|
||
version("0.0.1") | ||
|
||
depends_on("[email protected]+external-parallelio~pnetcdf") | ||
depends_on("[email protected]") | ||
depends_on("[email protected]") | ||
|
||
# There is no need for install() since there is no code. | ||
version("main", branch="main", submodules=True) | ||
|
||
variant( | ||
"build_type", default="Release", description="The build type to build", | ||
values=("Debug", "Release") | ||
) | ||
variant( | ||
"configurations", default="MOM6-CICE6, CICE6-WW3, MOM6-CICE6-WW3", | ||
values=("MOM6", "CICE6", "WW3", "MOM6-WW3", "MOM6-CICE6", "CICE6-WW3", "MOM6-CICE6-WW3"), | ||
multi=True, description="ACCESS-OM3 configurations to build" | ||
) | ||
variant("openmp", default=False, description="Enable OpenMP") | ||
variant("mom_symmetric", default=False, description="Use symmetric memory in MOM6") | ||
variant( | ||
"cice_io", default="PIO", description="CICE IO option", | ||
values=("NectCDF", "PIO", "Binary"), multi=False | ||
) | ||
|
||
depends_on("[email protected]:", type="build") | ||
depends_on("mpi") | ||
depends_on("[email protected]:") | ||
depends_on("[email protected]:") | ||
depends_on("[email protected]:") | ||
depends_on("[email protected]:") | ||
|
||
flag_handler = CMakePackage.build_system_flags | ||
|
||
def cmake_args(self): | ||
args = [ | ||
self.define_from_variant("OM3_MOM_SYMMETRIC", "mom_symmetric"), | ||
self.define_from_variant("OM3_OPENMP", "openmp"), | ||
self.define("OM3_ENABLE_MOM6", "configurations=MOM6" in self.spec), | ||
self.define("OM3_ENABLE_CICE6", "configurations=CICE6" in self.spec), | ||
self.define("OM3_ENABLE_WW3", "configurations=WW3" in self.spec), | ||
self.define("OM3_ENABLE_MOM6-WW3", "configurations=MOM6-WW3" in self.spec), | ||
self.define("OM3_ENABLE_MOM6-CICE6", "configurations=MOM6-CICE6" in self.spec), | ||
self.define("OM3_ENABLE_CICE6-WW3", "configurations=CICE6-WW3" in self.spec), | ||
self.define("OM3_ENABLE_MOM6-CICE6-WW3", "configurations=MOM6-CICE6-WW3" in self.spec) | ||
] | ||
|
||
args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc)) | ||
args.append(self.define("CMAKE_CXX_COMPILER", self.spec["mpi"].mpicxx)) | ||
args.append(self.define("CMAKE_Fortran_COMPILER", self.spec["mpi"].mpifc)) | ||
|
||
return args |